================================================================
GHIDRA SETUP — TsumuRecomp
================================================================

Goal: import the Tsumu Light (Japan) boot executable into Ghidra so
functions, labels and structs can feed ../seeds/ and ../annotations/.

Game:    Tsumu Light
Serial:  SLPS-02253
Region:  Japan (NTSC-J)

----------------------------------------------------------------
CPU / processor
----------------------------------------------------------------
The PlayStation CPU is a MIPS R3000A (LSI CW33300 core):
  - 32-bit, LITTLE-ENDIAN, MIPS I integer ISA
  - No hardware FPU. Coprocessors are COP0 (system control) and
    COP2 (the GTE geometry transform engine). Ghidra's default MIPS
    decoder handles the integer ISA fine; GTE (cop2) ops show up as
    coprocessor instructions — that is expected, not an error.

  Ghidra language:  MIPS:LE:32:default
  Compiler spec:    default
  Endianness:       little
  Address size:     32-bit

----------------------------------------------------------------
What to import
----------------------------------------------------------------
Import the HEADERLESS dump (the 2048-byte PS-EXE header is already
stripped, so file offset 0 maps cleanly to the load address):

  ghidra\SLPS_022.53_no_header.bin

(Alternatively import the header-ful boot EXE tsumu\SLPS_022.53 and
 set the import "File Offset" to 0x800. The headerless dump is simpler
 and is what these notes assume.)

----------------------------------------------------------------
Load / memory layout (read from the PS-EXE header)
----------------------------------------------------------------
  Load address (base):  0x80010000   <-- file offset 0 maps here
  Entry point (pc0):    0x800691F0
  Initial $gp:          0x00000000    (set at runtime)
  Text size:            0x00080000    (524,288 bytes)
  End of text:          0x80090000    (load_address + text_size)
  Initial $sp (stack):  0x801FFFF0

PS1 address space, for context:
  0x80000000-0x801FFFFF  KSEG0  cached; the 2 MB main RAM
  0xA0000000-0xA01FFFFF  KSEG1  uncached mirror of the same RAM
  0xBFC00000             BIOS ROM reset vector

The boot EXE loads contiguously at 0x80010000 (512 KB). Additional
game code/data is streamed from disc at runtime (TSUMU.XA, *.BIN,
*.STR) and is discovered dynamically by the recompiler / captured by
the overlay cache at runtime.

----------------------------------------------------------------
Inspect via the automatically spawned headless Ghidra MCP server
----------------------------------------------------------------
Use the global ghidra MCP registry_list(filter="psx/") then registry_open
with the discovered Tsumu key. Open read-only for inspection. Do not launch
a GUI, start an HTTP/SSE server, or use the retired per-project ports.
New imports and registry maintenance follow:
  F:/Software/Ghidra/ghidra-agent/README.md
Commit only ghidra/annotations/*.annotations.json, never .gpr/.rep databases.
