# Memory map, the memory controller, the boot sequence and the cartridge check Sources: **[TRM]** = *Jaguar Technical Reference Manual, Tom & Jerry, Revision 8* (`reference/src/jaguar-sdk/jaguar/docs/dev/Technical Reference v8.pdf`, tier 2), cited by printed page; **[TR10]** = *Technical Reference V10.0* (Stephen Moss, 2010; an amended copy of Atari's console hardware notes, tier 2 with community edits); **[NET]** = the Flare netlists (`reference/src/JagNetlists/netlists_org`, tier 2 as text), cited by file and line; **[JAGCRYPT]** = Atari's signing tool source (`reference/src/makefastboot/jagcrypt`, tier 2); **[MAME run]** = the session of [mame-oracle.md](mame-oracle.md) (tier 5, measured here). Nothing below is copied from those sources; addresses and bit positions are facts. ## The 24-bit map (ROMHI = 1, the only map a console uses) | Range | What | Width seen by the 68000 | Owner | | --- | --- | --- | --- | | `000000-1FFFFF` | DRAM0, 2 MiB fitted | 16 (the DRAM is 64 bits wide) | board | | `200000-3FFFFF` | rest of the 4 MiB DRAM0 bank: not fitted (mirror or open bus: **U3**; MAME mirrors the 2 MiB through `000000-7FFFFF`, tier 5) | | board | | `400000-7FFFFF` | DRAM1 bank: not fitted | | board | | `800000-DFFFFF` | ROM1, the cartridge: 6 MiB | per the cart: 32 (most), 16 or 8 | board, `cart` socket | | `E00000-E1FFFF` | ROM0, the boot ROM, 128 KiB (8 bits wide) | | board | | `F00000-F000FF` | Tom registers (memory control, video timing, OLP, interrupts) | 16 | board (`tom`) | | `F00400-F007FE` | CLUT, two copies (A reads `400-5FE`, B `600-7FE`; a write goes to both) | 16 | board | | `F00800-F00D9E`, `F01000-F0159E`, `F01800-F01D9E` | line buffer A, B, "the one being written" | 16 | board | | `F02100-F0211F` | GPU control registers | 16, in pairs | wiring: board; meaning of flags, PC: `jrisc` | | `F02200-F0229B` | Blitter registers | 16, in pairs | board (`blitter`) | | `F03000-F03FFF` | GPU local RAM, 4 KiB (1K x 32) | 16, in pairs | proposed: `jrisc` owns the bytes (open decision, [handoff-brief.md](handoff-brief.md)) | | `F08000-F0BFFF` | the same `F00000-F03FFF` again as **32-bit write-only** ports (`+$8000`) | 32 | board | | `F10000-F1003F` | Jerry registers (clocks, PITs, interrupt control, UART) | 16 | board (`jerry`) | | `F14000-F14003` | `JOYSTICK`, `JOYBUTS` | 16 | board | | `F14800-F17FFF` | GPIO0-5 decodes (EEPROM clock/data and chip select, CD, paddles) | 16 | board, sockets | | `F1A100-F1A123` | DSP control registers | 16, in pairs | wiring: board; flags, PC, modulo, MAC: `jrisc` | | `F1A140-F1A157` | DAC and I2S registers (inside the DSP's local space) | | board (`jerry`) | | `F1B000-F1CFFF` | DSP local RAM, 8 KiB | | as GPU RAM | | `F1D000-F1DFFF` | wave-table ROM: eight 128-entry tables, 16-bit values sign-extended to 32 | | image supplied by the board (`jagwave.rom`, 4,096 bytes); it sits in the DSP's RAM block (`jerry/DSP.NET` `DSP_RAM (..., romen)`) | **The GPU's and DSP's own view.** Each RISC processor has a local bus controller (`tom/GPU_MEM.NET`, `jerry/DSP_MEM.NET`, "the local bus controller associated for the graphics processor, and is also responsible for controlling local memory"). The GPU's local space is `F02000-F07FFF` (comment at `GPU_MEM.NET` l.296): its control registers, **the Blitter's registers**, local RAM; everything else, Tom's own registers at `F00000` included, is "external" and goes out over the main bus through the gateway. The DSP's local space is `F18000-F1FFFF` (`DSP_MEM.NET` l.287): its control registers, **the DAC and I2S registers** (`Dacw`, `I2sw`, `I2sr` decodes), local RAM and the wave ROM. Outside masters reach local space through an I/O port that has the **highest priority on the local bus** (I/O, then the gateway's program data, then loads/stores, then program fetch), one tick per access. [TRM p.9-17, p.30-31, p.96-98]. With ROMHI = 0 the same decode sits at `1xxxxx` instead of `Fxxxxx` and ROM is low; the console never runs that way. **Until MEMCON1 is first written the 2 MiB ROM0 window repeats through the whole 16 MiB space** [TRM p.9], which is how a 68000 finds its reset vectors at address 0 in a ROM that lives at `E00000`. The `F02000-F03FFF` block must be read and written by other processors as two 16-bit halves "in the order low address then high address" [TRM p.31]; DSP space is 16-bit only for outsiders [TRM p.100]. `G_END` bit 0 (`BIG_IO`) chooses which half holds the high word [TRM p.59]. The GPU itself sees all of it as 32-bit and cannot use the `+$8000` ports [TRM p.31]. **Why the order matters** (`tom/GPU_CPU.NET` l.63-120, read 2026-11-12): on the 16-bit port a write to the low address only **latches** its data; the 32-bit local write happens on the high-address write, combining the latch with the new half. A read of the low address performs the 32-bit read and latches the other half, which a read of the high address then returns. With `A15` high (the `+$8000` window) the port is 32 bits wide and no latch is used. So a 68000 instruction that writes the high word first commits stale data. The 1995 *Hardware Bugs & Warnings* sheet (OCRed here, page 6) names exactly this: `clr.l ` and `move.l ,-(An)` "do not work correctly when writing to Jaguar GPU & DSP hardware registers and internal RAM" (`F02000-F07FFF`, `F1A000-F1F000`) because they write the two 16-bit halves in reversed order (high address first). The board must model the latch, and the 68000 core's **word order within long writes** must be the real one (m68000-python claims the bus sequence of every instruction; this is a direct use of that claim). **Register address corrections found while reading**: [TRM p.86] prints the Timer 2 divider `JPIT4` at `F10002` (same as `JPIT2`); [TR10 p.5] has `F10006` (conflict **C1**, TR10 is right by elimination). [TR10 p.5] prints `ASIDATA` at `F10039`; [TRM p.94] has `F10030` (**C2**). ## MEMCON1 (`F00000`) and MEMCON2 (`F00002`) [TRM p.10-11] MEMCON1: bit 0 `ROMHI`; bits 1-2 `ROMWIDTH` (0/1/2/3 = 8/16/32/64 bits); bits 3-4 `ROMSPEED` (10/8/6/5 clocks per cycle); bits 5-6 `DRAMSPEED` (RAS precharge / RAS-to-CAS / refresh = 4-3-5, 4-3-4, 3-2-4, 2-1-3 clocks; a page-mode cycle is always 2); bit 7 `FASTROM` (test); bits 11-12 `IOSPEED` (18/10/4/6 clocks); bit 14 `CPU32`. At reset `ROMSPEED` = 0 and `ROMHI`, `ROMWIDTH`, `CPU32` come from pull resistors. MEMCON2: `COLS0`, `DWIDTH0`, `COLS1`, `DWIDTH1` (2 bits each), bits 8-11 `REFRATE` (rows refreshed at `CLK / (64 x (REFRATE + 1))`, 0 disables), bit 12 `BIGEND`, bit 13 `HILO`. **What the boot ROM writes** [MAME run, first instructions at `E00008`]: MEMCON1 = `$1861` (ROMHI, ROM 8 bits wide at 10 clocks, DRAMSPEED 3, IOSPEED 3 = 6 clocks), MEMCON2 = `$35CC` (both DRAM banks 64 bits wide, REFRATE 5, BIGEND, HILO). The Series M ROM writes `$35DD` on one path (read from the image, not traced). IOSPEED 3 is required for reads of DSP space to work at all [TRM p.141, Jerry bug 2]. **What the model needs from this**: (1) the decode above; (2) **the cost in system clocks of each kind of bus cycle** (DRAM page hit 2, row miss per DRAMSPEED, ROM per ROMSPEED and width, I/O per IOSPEED), because every processor's speed on the shared bus follows from it ([bus-arbitration.md](bus-arbitration.md)); (3) width conversion: a 32-bit cart read by the 64-bit Object Processor is two ROM cycles. A first build may fix the console's values and assert that software does not change them ("do not ever write to" MEMCON1/2, [TR10 p.2]). ## Clocks | | NTSC | PAL | Source | | --- | --- | --- | --- | | Video clock = system (GPU/DSP/bus) clock | 26.590906 MHz | 26.593900 MHz | [TR10 p.6] | | 68000 clock = half of it | 13.295453 MHz | 13.296950 MHz | [TR10 p.6] prints the PAL figure as 13.296695: a slip (**C3**) | | Chroma | 3.579545 MHz | 4.43361875 MHz | [TR10 p.7] | MAME's `jaguar` gives `maincpu` 13,295,453 Hz and `gpu`/`dsp` 26,590,906 Hz (`-listxml`). NTSC or PAL is a strap read by software as `JOYBUTS` bit 4 (1 = NTSC) [TR10 p.14]; the boot ROM tests it (`btst #4` on `F14003` in the first lines of the trace) to choose the video timing constants. ## The boot sequence Measured with the Series K ROM under MAME 0.285, no cartridge [MAME run]; the 68000 code was read only as far as the trace shows it, so the steps are a trace, not a disassembly. 1. Reset: SSP and PC from the ROM mirrored at 0; first instruction at `E00008`. 2. MEMCON1, MEMCON2, background and border to 0, then `CLK3` = 4, `CLK2` = `$B5`, and the whole video time base (`HP` = `$34C`, `HBB` = `$6B1`, `HBE` = `$7D`, `HS` = `$6CD`, `HVS` = `$28B`, `HEQ` = `$310`, `HDE` = `$6A0`, `HDB1` = `HDB2` = `$A6`, `VP` = `$20B`, `VEE` = 6, `VBE` = `$18`, `VDB` = `$2E`, `VDE` = `$1F0`, `VBB` = `$1F4`, `VEB` = `$1FF`, `VS` = `$205`): the NTSC set. 3. The ROM copies itself to RAM and continues at `$402`, then `$5002` (about 0.05 s in). 4. It loads a program into DSP RAM (a loop storing to `F1B800` and up is visible), writes the object list pointer (MAME logs the two halves of `OLP`: `F00020` = `$7000`, `F00022` = `$0003`) and `VMODE` = `$6C1` (CRY, CSYNC, BGEN, pixel width 4 clocks, video on). 5. At about 1.15 s it starts the GPU (`G_CTRL` written at 68000 clock 15,286,586). The GPU runs 34,840 instructions from local RAM starting at `F032EC`, reading the cartridge at `800000` (first instructions: `movei $f03314,r29; movei $800000,r0; ... loadb (r0),r13`). 6. With no cartridge the check fails: the picture after 2 s is the Jaguar logo outline on a red field and the 68000 sits in a branch-to-self at `$50B8`. 7. With a signed cartridge (*Tempest 2000 (World)*, 12 s) the logo sequence runs and the game's title screen is reached, under MAME, through the real boot ROM. The boot ROM then jumps to the address at cart `$404` (normally `$802000`) [MAME source comment, tier 5; the census confirms `00802000` in 266 of 268 cart images]. ## The cartridge check Three independent sources agree on the shape; each is cited for what it alone shows. - **The hardware lock** [TRM p.133, "Cartridge protection mechanism"]: out of reset a `LOCK` bit keeps the 68000 from doing anything to the GPU except setting `GO`; the Blitter and Object Processor are disabled and the GPU is "invisible" until "software requirements in the ROM are met". The manual declines to say more. **The netlist does** [NET `tom/GPU_MEM.NET` l.356-363, 426-431]: while `lock` is set, CPU I/O access to the GPU's internal registers is disabled (`Disable\ := ND2(ioserv, lock)`), "however the control register is not locked", and **"the lock is cleared by any write to the endian control register"** (`G_END`, `F0210C`); its reset value is an input, `reset_lock`, which `TOM.NET` l.306-308 wires (by position) to the signal `nocpu` (the Verilog translation names it: `verilog/tom/tom.v` l.4382). **`nocpu` is MEMCON1 bit 13** (`ABUS.NET` l.84, 102, 113), which the manual lists as "unused, set to zero" [TRM p.10]: it is loaded at reset from a pull resistor on memory address pin `MA4` (`cfg[4]`, `TOM.NET` l.214, `CLK.NET` l.80-85), like `ROMHI`, `ROMWIDTH` and `CPU32`. So the lock is on at reset exactly when the board straps "no CPU". The MiSTer core straps `MA4` low (HYPOTHESIS: read from its GPL source in Phase 0), so it boots with the lock off, and so do MAME and Virtual Jaguar, which do not model it. `VID.NET` l.32 adds: "the lock input holds the video generator in reset". The natural reading is that a retail console (which has a 68000) straps `MA4` low and the lock never engages, contrary to the manual's description; the console schematic or a console's MEMCON1 read-back (bit 13) would settle it (**U1**). The model makes it a strap, default off. - **The signature** [JAGCRYPT, `JAGCRYPT.C`, `RSA.C`; `JAGENX/readme.txt`]: the first bytes of the cartridge are RSA-encrypted blocks. Byte 0 is the negated block count (`$F6` = 10 blocks in 267 of 268 census images, `$FF` = 1 in one aftermarket image); the header is 650 bytes; the tool carries a 65-byte public and private key (the private key is in the public repository); the plaintext is **GPU code** (`md5.dat`, "magic GPU boot code") into which the tool patches the MD5 of the ROM. The boot ROM decrypts the blocks into GPU RAM and runs them. - **The result** [MAME source header; Tursi's notes]: the GPU program leaves a value in GPU RAM at `F03000` and stops; the 68000 compares it with **`$03D0DEAD`**; any other value gives the red screen. Tursi's replacement boot (shipped on the Skunkboard, so tested on consoles) is a two-block program that subtracts a 32-bit word checksum of a cart range from a seed stored at cart `$410` and must end at `$03D0DEAD`; its fields are `$410` start address, `$414` word count, `$418` seed. **Census facts** (`tests/detectors/census-2026-11-11.txt`): of the 89 full-size carts in the No-Intro retail set, 59 carry one of 58 individually signed headers; the other 30 (betas, prototypes, two unlicensed) share one header (SHA-1 of bytes 0-`$3FF` begins `06966406`), as do 167 of 186 aftermarket images: the "universal header" Virtual Jaguar compares against (`file.cpp`, `HasUniversalHeader`, 8,192 bytes). **How emulators skip it** (tier 5, read in source): Virtual Jaguar by default never runs the boot ROM: it writes the cart to `800000`, sets the 68000's PC from `$404`, and installs a high-level BIOS; "use the real BIOS" is an option. MAME runs the real ROM and flags the driver `MACHINE_UNEMULATED_PROTECTION`; its comment says "all Jaguar emulators (including this one) skip the logo with the appropriate memory hack" and that a non-zero cart `$408` also skips it (all 268 census carts have 0 there). BigPEmu takes a boot ROM image as an option. **For this board**: run the real boot ROM and the real check. It needs no special case: a correct GPU, RSA done by the 68000 (it is the 68000 that decrypts: not verified by disassembly, **U2**), and `LOADB` from the cart. A `--skip-boot` path (PC from `$404`, registers as the ROM leaves them) is a convenience for homebrew executables that have no header, never the default for carts. The boot ROMs: [file-formats.md](file-formats.md). ## Power-on state Not documented beyond the registers the manual lists as reset to a value (`CLK1` = 1, `CLK2` = 0, `CLK3` = `$3F`, DACs 0, `JOYSTICK` bit 15 = 0, audio muted [TRM p.84, 88, 95; TR10 p.2]). DRAM contents at power-on are unknown and at least one game is said to depend on them (MAME's `battlesp` hack reads uninitialised shared RAM, [bus-arbitration.md](bus-arbitration.md)): choose fixed values, make them a machine option (**U4**).