Files
Drew T 8ffb7f0607 feat(phase-7): -O0 split + 4 matches (42 real) + libcd.h — session B checkpoint
- per-file -O0 mechanism: split text c-subseg into boot@-O0 (src/boot.c) + 800@-O2
  via splat resegmentation + Makefile target-specific CC1FLAGS; the boot/main/
  game-mode-dispatch module (0x80010000-0x800123F0) is -O0, not the pinned -O2
  (per-module compiler mixing, SETUP §5.5). Regression-gated byte-identical.
- 4 byte-matches (38->42 real, make check BYTE-IDENTICAL throughout): GameModeDispatch
  (-O0 register-ptr far member), DebugMenuHandler (-O0 reserved-slot local), CdQueueBusy
  (-O2 if/else order + branch polarity), CdReadRequest (-O2 early-return fall-through)
- PsyQ infra: include/psyq/libcd.h (CdlLOC/CdlFILE from the .gdt) + 4 named symbols
  (CdSearchFile/CdPosToInt/CdIntToPos/VSync) in symbols.us.txt; func_* stubs renamed
- loader cluster non-jtbl COMPLETE (6 matched + 2 drafted): NON_MATCHING drafts of
  LoaderInitFileTable + ResourceLoadStateMachine (logically faithful, residuals in-source)
- tooling: progress.py/difficulty.py fixed for the multi-file split (glob src/*.c, all
  asm dirs, skip forward-decls); deterministic; 42 real / 4 NM
- flywheel: matching-cookbook §6 (-O0 detection + idioms), §7 (PsyQ types/symbols), T4
- build byte-identical 143dbb89f34491258bbc27810d0a12ec8b43a8dd from a full clean cycle
2026-06-14 19:37:05 -06:00

35 lines
1.3 KiB
C

/* psyq/libcd.h — PSY-Q libcd (CD-ROM) types & prototypes used by the file loader.
*
* Struct layouts are the authoritative ones from the imported PsyQ 4.0 .gdt
* (Ghidra category /LIBCD.H) — verified offsets/sizes, not guessed (G1). Function
* prototypes use the canonical PsyQ signatures; their symbols are pinned in
* config/symbols.us.txt (and already named in the Ghidra DB). Grow this as more
* libcd surface is matched. Companion to common.h (provides the u8/u32 typedefs).
*/
#ifndef PSYQ_LIBCD_H
#define PSYQ_LIBCD_H
#include "common.h"
/* CD logical location — minute/second/sector are BCD. 4 bytes. (/LIBCD.H) */
typedef struct {
u8 minute; /* +0x00 */
u8 second; /* +0x01 */
u8 sector; /* +0x02 */
u8 track; /* +0x03 */
} CdlLOC;
/* CD file descriptor (CdSearchFile result / directory entry). 24 bytes. (/LIBCD.H) */
typedef struct {
CdlLOC pos; /* +0x00 file start location */
u32 size; /* +0x04 file size in bytes */
char name[16]; /* +0x08 file name */
} CdlFILE;
/* libcd prototypes (symbols in config/symbols.us.txt). */
extern CdlFILE *CdSearchFile(CdlFILE *fp, char *name); /* 0x80045374 */
extern int CdPosToInt(CdlLOC *p); /* 0x80043B1C */
extern CdlLOC *CdIntToPos(int i, CdlLOC *p); /* 0x80043A18 */
#endif /* PSYQ_LIBCD_H */