Executables and boot files
Two PS-X executables, SLUS_004.22 and LOGO/LOGO.EXE, and the boot file SYSTEM.CNF start the game, with the logo video and the license sectors beside them. The main executable also holds g_EmiSlotLbas, the table of 887 start sectors through which the game finds every other file. This page covers these files, the PS-X header and that table. The boot sequence is in boot; EMI archives have their own page.
| Path | Size (bytes) | LBA | Kind | Read by |
|---|---|---|---|---|
SYSTEM.CNF |
70 | 187,467 | text, 4 KEY = value lines |
the BIOS (boot) |
SLUS_004.22 |
1,445,888 | 187,468 | PS-X EXE, resident game | the BIOS, from BOOT |
LOGO/LOGO.EXE |
122,880 | 187,407 | PS-X EXE, Capcom logo | SYS_StartLogo, through SYS_LoadExec |
LOGO/CAPCOM30.STR |
2,365,440 | 186,252 | MDEC video and XA, see STR | LOGO.EXE, by a fixed sector number |
| license sectors | 28,032 (12 x 2,336) | 0-11 | license text and logo, outside ISO9660 | the BIOS only |
The disc also has one CDDA track (track 2, 37,044,044 bytes), all zero samples. No function read issues CdlPlay; that no code plays it is [inferred].
PS-X EXE header
Section titled “PS-X EXE header”Both executables begin with the standard 2,048-byte PS-X EXE header: the PS-X EXE magic at offset 0 and u32 fields from 0x10 (psx-spx). The BIOS copies t_size bytes from sector 1 of the file to t_addr, then jumps to pc.
| Offset | Type | Name | SLUS_004.22 |
LOGO.EXE |
|---|---|---|---|---|
0x10 |
u32 |
pc |
0x8014AA0C |
0x801CE724 |
0x14 |
u32 |
gp |
0 |
0 |
0x18 |
u32 |
t_addr |
0x80096800 |
0x801CE000 |
0x1C |
u32 |
t_size |
0x160800 |
0x1D800 |
0x20 |
u32[4] |
d_addr to b_size (4 words) |
0 |
0 |
0x30 |
u32 |
s_addr |
0x801FFFF0 |
0x801FFFF0 |
0x34 |
u32 |
s_size |
0 |
0 |
0x4C |
char[] [inferred] |
region marker | “North America” | “Japan” |
- The file size equals
0x800 + t_size(1,445,888 and 122,880 bytes). - Header bytes
0x83to0x7FFare zero. SLUS_004.22starts atstup2(the PsyQ2MBYTE.OBJstart-up code). The headergpis0:stup1setsgpto0x8018B2B4, andstup2clears the BSS0x8018B2B8..0x80190C60(memory map).LOGO.EXEstarts at__SN_ENTRY_POINT (exe/logo@0x801CE724).- The
LOGO.EXEregion marker is Japanese in the US executable too. No reader looks at it. - The main executable image spans
0x80096800to0x801F7000. The module windows from0x801EEC00and0x801F2C00lie inside it; overlays overwrite them at run time (runtime). The last 17,408 bytes of the file (the0x801F2C00window) hold only the byte values 0, 14 and 15.
SYSTEM.CNF
Section titled “SYSTEM.CNF”| Key | Value |
|---|---|
BOOT |
cdrom:\SLUS_004.22;1 |
TCB |
4 |
EVENT |
16 |
STACK |
0x801FFF00 |
Only the BIOS reads the file. TCB and EVENT size the kernel’s thread control block and event tables. STACK is the initial stack pointer ([inferred] from the PsyQ boot convention).
Boot chain
Section titled “Boot chain”The BIOS loads SLUS_004.22 at 0x80096800. SYS_StartLogo (0x8014AEE0) calls SYS_LoadExec (0x8014E0FC) to run LOGO.EXE as a nested executable, which plays CAPCOM30.STR by LBA. On return SYS_InitHardware runs and the frontend starts (boot).
SYS_StartLogo passes the path \LOGO\LOGO.EXE;1 to SYS_LoadExec. LOGO.EXE finds the video by sector number: the 32-bit constant D_801D8BB0 (exe/logo@0x801D8BB0) is 0x0002D78C (186,252), the LBA of CAPCOM30.STR. Moving the STR file needs the same change in LOGO.EXE.
The disc file table
Section titled “The disc file table”g_EmiSlotLbas in SLUS_004.22 is an array of 887 u32 start sectors, one per disc file. EMI_GetArchiveSector (exe/slus_004_22@0x80162160) returns g_EmiSlotLbas[slot_id]. Every EMI and XA read goes through it (EMI slot ids); it is the only place the game learns where a file starts.
| Property | Value |
|---|---|
| File offset of slot 0 | 0xEC444 (the address minus 0x80096000) |
| Entries | 887, 4 bytes each, 3,548 bytes |
| Order | ascending LBA |
| The set of values equals the LBAs of the ISO9660 files | yes, 887 of 887 |
| Slots 0-882 | the 883 files under BIN/ |
| Slots 883-886 | CAPCOM30.STR, LOGO.EXE, SYSTEM.CNF, SLUS_004.22 |
The table follows on-disc order, not directory-record order: the directory lists SLUS_004.22 before SYSTEM.CNF, the table the other way. The u32 after the last slot (0x0002E03A) is the LBA of no file.
A file may shrink in place. A file that moves or grows needs its ISO9660 directory record and this table rewritten (sector layout).
Other executable data
Section titled “Other executable data”Data that editors look for in the main executable:
| Data | Address | Shape | Reader or page |
|---|---|---|---|
| XA stream slot ids | D_80183230 = {0x2A9, 0x1B2, 0x2AA} (S_XA00, MAGIC00, VOICE) |
3 u32 slot ids |
SND_ResolveXAStream (exe/slus_004_22@0x80163744) |
| XA cue-array pointers | D_8018323C = {0x801839C4, 0x801832C4, 0x80183298} |
3 pointers to u16 arrays, see STR |
- |
| BGM id to slot table | g_BGMTracks[id] |
slot ids 0xD1-0x121 |
EMI |
| Item, ability and level data | not here: ETC/GAME.EMI entry 0 |
game records | - |
| Save frame, checksum constants | not here | save format | - |
Sources and confidence
Section titled “Sources and confidence”- Confidence: high. Header fields, file table and boot files were checked on every file; only the CDDA track’s use and
STACKare[inferred]. - Evidence: the PS-X headers, the
SYSTEM.CNFtext, the ISO9660 directory records againstg_EmiSlotLbas, andSYS_StartLogo,SYS_LoadExecandEMI_GetArchiveSector.
Related
Section titled “Related”- Boot: how the BIOS handoff, the logo and the frontend run.
- Disc and files: the slot id range of each directory.
- EMI container: how a slot id becomes an archive read.
- STR and XA playback: the logo video and the XA streams.