ed 748b58c5c5 Codebase overhaul. Metaprogram proofread (part 2). Starting to get serious.
Need to rewrite the ps1 lua metaprogram sometime soonish. Getting too bloated... need to consolidate code paths.

In this push codebase structure is starting to get a bit more realized. Decided todo now to match Pikuma's linking module files vods beginning to reorganize its codebase as well.
Atoms & atom components are not in their on *.atom.c files. (Not calling it tape.c as I don't really bake tapes like that outside of the unity c file so far...)

The lua metaprogram has had additional features added to it yet again to avoid hardcoding module handling and supporting multiple atom files per-module.
Either after the camera or cd-rom section I'll be most likely pausing to fully refactor the metaprogram. Possibly as a full re-write to get the loc minimal.
2026-08-04 23:34:00 -04:00
2025-08-04 21:45:50 -04:00
2026-07-10 23:49:00 -04:00
2026-06-04 19:40:21 -04:00
2026-07-06 20:05:57 -04:00
2025-11-01 12:05:14 -04:00

Pikuma PS1

A rest from the usual.

img

Dependencies

I will be programming from a Windows 11 machine (may eventually try this on the Steam Deck...):

armips

  • Supports doing bare-metal assembly for the ps1
  • scoop install armips or just clone and build..
  • Was used early in the course. Now I just use an macro asm dsl in C11.

luajit-2.1

scoop install luajit
  • Used for lua scripts
  • Particularly, ps1_meta.lua which is a staged metaprogram pass for the custom C11 Assembly DSL used in this codebase.

lpeg

  • Lua is slow (even jitted) so this helps.

lfs (LuaFileSystem)

  • Native directory enumeration + mkdir for the build scripts.
  • Used by passes/word_count_eval.lua :: scan_dir (native walk vs. dir /b /s subprocess, ~2ms vs. ~56ms) and by duffle.lua :: ensure_dir + to_absolute_path (avoids cmd.exe mkdir + cd shell spawns, ~50ms each).

pscx-redux: A collection of tools, research, hardware design, and libraries aiming at development and reverse engineering on the PlayStation 1.

  • Used as the runtime sandbox emulated the ps1
  • Has hookups to behaving as a gdb server which can be utilized with the gdb client in vscode.
  • Supports symbolic info emitted by armips
  • pysq library has been sucessfully adjusted for modern compiler usage (see: src/)

MIPS Toolchain (from pscx-redux)

  • Used for building ps1 programs for the C runtime provided by the psyq/o SDK

nugget

  • Readonly mirror of pcsx-redux's src/mips directory.
  • Not necessary if the pcsx-redux repo is cloned

PSX Psy-Q SDK (supplied by psx.arthus.net)

  • Original official SDK
  • Modernized using obj parser to extract info for GNU toolchain usage.
  • Can either grab from arthus psyq-4.7-converted-full.7z or psyq-4_7-converted-light.zip
    • The light version omits the link modules (object files), just keeps the static archives.
  • Can be utilized effectively with the includes below

psyq_include_what_you_use

  • Fixes psyq headers to include what they use, so changing the include order in your project doesn't break compiling.
  • Needed if you want to link and utilize the psyq C SDK

Other toolchains (not used here)

clear!
traingles!
polys!
hello_psyq! cube! cube and floor!

Win 11 machine:

system_info

Still haven't gotten around to trying this on linux...

S
Description
No description provided
Readme Zlib
25 MiB
Languages
Lua 52.3%
C 41.9%
Assembly 3.4%
PowerShell 2.1%
GDB 0.2%