← All cores
PrimalRage
Cites hardware documentation that MAME's driver does not — 1
- README.md:137 The sound board boot ROM of this prototype was never dumped; MAME uses the one from a later set (marked BAD_DUMP), and so does this core.
Cites MAME source — 73
- Arcade-PrimalRage.sv:757 joystick_x bits: 0 right,1 left,2 down,3 up,4..7 buttons1-4,8 coin,9 start set_jan picks the primrage (1) or primrageo (0) button/start layout; see rtl/atarigt_inputs.sv for the MAME atarigt.cpp port mapping.
- Arcade-PrimalRage.sv:1056 the game tells a cold boot from a watchdog reset by what it finds in work RAM, so zero it after the download like MAME does at power-up
- rtl/atarigt_inputs.sv:69 T-MEK (MAME atarigt.cpp common INPUT_PORTS): one seat, P1/P2 buttons 1-2 are the right/left trigger and thumb on one pad; the service test shows no button 3, button4, start2 or P2 d-pad, so those stay released
- rtl/atarigt_inputs.sv:78 One T-MEK board is one seat, so MAME P1/P2 are its right/left handles (service menu stick test): right = ch7/ch6 (AN3 X, AN2 Y), left = ch3/ch2 (AN1 X, AN4 Y); handle forward = low byte, so the right handle alone forward turns left
- rtl/atarigt_video.sv:2 Reference: MAME atarigt_v.cpp (get_playfield_tile_info, get_alpha_tile_info, playfield_scan, scanline_update, screen_update Primal Rage branch) and MAME atarigt.cpp (pflayout, pftoplayout).
- rtl/atarigt_video.sv:207 colorram_r in MAME returns whatever was last written at ANY word in 0x20000-0x27fff/0x30000-0x37fff, not just the 128 entries the mixer cares about.
- rtl/atarigt_video.sv:749 alpha is not exempt, unlike upstream MAME: on the PCB text over far PF pales at LCR 3 and vanishes at LCR 1, text over an MO keeps its colour
- rtl/c31/c31_core.sv:2 Semantics follow MAME's 320c3x_ops.ipp instruction by instruction, not real silicon.
- rtl/c31/c31_core.sv:98 mod19 (bit-reversed) and 0x1A-0x1F: MAME's handlers just log and return address 0 with no AR side effect, and the access still happens, so match that rather than aborting the instruction
- rtl/c31/c31_core.sv:173 float helpers, matching 320c3x_ops.ipp bit for bit
- rtl/c31/c31_core.sv:266 AND/ANDN/NOT/OR/RPTS/TSTB/XOR take a zero-extended imm16 (MAME uint16_t), the rest sign-extend
- rtl/c31/c31_core.sv:2100 MAME zeroes dst in this branch but then overwrites it on the way out with the locals it never touched, so src passes through
- rtl/cage.sv:351 dsp_re/dsp_we come from the C31's own 0xA00000 window, decoded in cage_mem (MAME cage.cpp 0xA00000 rw)
- rtl/cage.sv:363 latch bit21 (MAME reset_w) stays unwired: Primal Rage drops it only once at boot, while control_reg still holds the DSP in reset
- rtl/cage_host.sv:1 CAGE host interface: the 68020 side registers at C00000, MAME atarigt.cpp sound_data_r/sound_data_w, and the DSP side of the handshake, MAME cage.cpp main_r/main_w/control_r/control_w/cage_from_main_r/cage_to_main_w.
- rtl/cage_host.sv:26 C31 interrupt lines, active-low (int_n convention): int0_n is the host command-ready IRQ0 (MAME cage.cpp cage_deferred_w/ cage_from_main_r), int1_n mirrors TMS320C3X_IRQ1, asserted whenever (control & 3) == 0 (MAME cage.cpp control_w).
- rtl/cage_host.sv:29 Both are levels, unlike cage_periph's TINT/DINT pulses, because MAME explicitly asserts and clears these two rather than only ever asserting them.
- rtl/cage_host.sv:34 IOF bits this device drives: bit3 = cpu_to_cage_ready, bit7 = cage_to_cpu_ready (MAME cage.cpp update_control_lines: val &= ~0x88).
- rtl/cage_host.sv:39 held while the DSP must stay in reset: control bits 0/1 both 0, or ext_reset (the 0xE08000 latch bit21 path, MAME atarigt.cpp reset_w)
- rtl/cage_mem.sv:3 Address map: MAME cage.cpp.
- rtl/cage_mem.sv:45 CAGE host latch, word address 0xA00000 (MAME cage.cpp cage_from_main_r/ cage_to_main_w): re/we are one-clock pulses, exactly one per access even if req is held
- rtl/cage_mem.sv:80 Only the populated part of the 0xC00000-0xFFFFFF sound ROM bank (MAME cage.cpp: "the DSP sees the pair at 0xD00000-0xDFFFFF ...
- rtl/cage_mem.sv:142 MAME cage set_mcbl_mode: the C31 boot ROM overlays 0x000000-0x000FFF and trap n loads its vector from word n there, which holds 0x809FC0+n
- rtl/cage_mem.sv:145 sound ROM and boot ROM are read-only (MAME cage.cpp 3.1): a write to either is simply dropped rather than allocating/dirtying a line
- rtl/cage_mem.sv:495 boot ROM direct path: uncached, byte-wide (MAME cage.cpp 3.1: one file byte per DSP word, stored packed as 512KB in DDR3)
- rtl/cage_periph.sv:2 Register map, timer/serial/DMA timing: MAME cage.cpp tms320c31_io_r/w, update_timer, update_serial, update_dma_state.
- rtl/cage_periph.sv:3 Register offsets below are the DSP's own word address within the block (periph_addr), identical to the offs_t values cage.cpp indexes m_tms320c31_io_regs with.
- rtl/cage_periph.sv:6 The 0x808064 primary bus control mask (0x1FFE) and reset value (0x10F8) are not in cage.cpp (MAME never touches that register); they come from an observed hardware trace.
- rtl/cage_periph.sv:12 held while the DSP is in reset (control bits 0/1 both 0, cage_host's dsp_hold_reset): mirrors MAME cage.cpp control_w, which zeroes offsets 0x00-0x5F of the peripheral array on this condition.
- rtl/cage_periph.sv:28 xint/rint are not modeled, MAME cage.cpp never asserts them for CAGE.
- rtl/cage_periph.sv:43 audio out, MAME cage.cpp 3.3 and atarigt.cpp atarigt_stereo routing (channels 0/3 -> right, 1/2 -> left)
- rtl/cage_periph.sv:75 register offsets, MAME cage.cpp macros
- rtl/cage_periph.sv:86 generic storage: every offset 0x00-0xFF is a plain read/write register, MAME cage.cpp COMBINE_DATA into m_tms320c31_io_regs[0x100].
- rtl/cage_periph.sv:108 timers: real down-counters clocked by h1_tick (MAME's own COUNTER register, offset 0x24/0x34, is write-through storage only -- see the generic regs[] array above; this is separate internal state driving the interrupt cadence MAME models, 2*
- rtl/cage_periph.sv:160 serial word clock chain, MAME cage.cpp update_serial: h1_tick -> /2 or /4 serial clock -> /SPORT_TIMER_PERIOD bit clock -> /bits_per_word word clock.
- rtl/cage_periph.sv:162 The divider constants are latched from the register file one clock after a write to SPORT_GLOBAL_CTL/SPORT_TIMER_PERIOD, and only when the candidate rate is valid (TPER!=0, derived freq <100kHz) -- MAME cage.cpp update_serial's own dmadac g
- rtl/cage_periph.sv:186 Rejecting it needs sp_ctl_reg != 0 at candidate time (below) -- an earlier attempt at this fixed the audio rate but broke the host<->DSP handshake, traced to the DINT timer stop rule using live register bits instead of MAME's internal dma_e
- rtl/cage_periph.sv:317 H1_HZ/88200 = 192 exactly, and h1_ticks_per_word = serial_div * tper * bits_per_word by construction of the divider chain above, so comparing that count to 192 reproduces MAME's frequency check without any real division.
- rtl/cage_periph.sv:334 DMA, MAME cage.cpp update_dma_state/dma_timer_callback (258-331).
- rtl/cage_periph.sv:342 MAME cage.cpp tracks enable with its OWN m_dma_enabled flag, separate from the register bits: dma_enabled_reg mirrors that.
- rtl/cage_periph.sv:361 forward this cycle's write into the enable check, mirroring MAME's update_dma_state which runs after COMBINE_DATA already applied it
- rtl/cage_periph.sv:394 clamp derived from MAME's mixer formula (atarigt.cpp atarigt_stereo: add_route(0/3, "speaker", 1.0, right), add_route(1/2, "speaker", 1.0, left) -- two unity-gain routes summed per output, saturated to the 16-bit DAC range)
- rtl/cage_periph.sv:423 MAME cage.cpp update_dma_state: runs only on a write to one of the four DMA regs, comparing enabled_new to the internal flag
- rtl/cage_periph.sv:427 MAME cage.cpp update_dma_state starts every transfer at channel 0
- rtl/cage_periph.sv:546 MAME cage.cpp control_w: memset(m_tms320c31_io_regs, 0, 0x60*4); 0x64 and above are outside that range and left alone clear once on the edge: a held level is a 96-way loop every clock in sim
- rtl/cage_periph.sv:557 MAME cage.cpp tms320c31_io_w, SPORT_DATA_TX case
- rtl/cage_periph.sv:562 MAME cage.cpp dma_timer_callback: DMA_SOURCE_ADDR/ DMA_TRANSFER_COUNT only change at DINT, to the final address / 0 -- never incrementally, matching what the CPU can observe (the transfer already happened up front)
- rtl/cage_periph.sv:577 MAME cage.cpp tms320c31_io_r assigns the array's uint32_t element into a uint16_t before returning it, truncating every read to 16 bits (zero-extended back to 32); that MAME quirk is reproduced here deliberately, on the read side only -- th
- rtl/cpu_bus.sv:89 MAME adc0808.cpp: 1 + 64 ADC clocks to convert, EOC 1 clock later; ADC clock = 14.318181 MHz/16 = 894.9 kHz, 66 clocks = 73.8 us, clk_cpu = 42.955 MHz -> 3168 clk_cpu ticks (research notes, adc finding)
- rtl/cpu_bus.sv:104 T-MEK: colour writes are dropped while set (MAME atarigt.cpp colorram_protection_w)
- rtl/cpu_bus.sv:106 T-MEK ADC0809 model (MAME atarigt.cpp analog_port_r): adc_q is the shared result register; clk_cpu may get no reset edge before its first use, so eoc (SERVICE bit3) derives from adc_busy instead of its own register
- rtl/cpu_bus.sv:150 bit 7 is the live VBLANK signal (atarigt.cpp SERVICE port), not a switch; bit 3 is A2D.EOC when tmek (MAME atarigt.cpp:472), else the switch as-is
- rtl/cpu_bus.sv:299 control_r has no side effect in MAME cage.cpp, only main_r does
- rtl/cpu_bus.sv:373 MAME latch_w: ACCESSING_BITS_24_31 (uds, MO control) and ACCESSING_BITS_16_23 (lds, cage/coin) are masked separately, so an lds-only write must not touch the MO control bits that live in the uds byte
- rtl/rle_objects.sv:1 Reference: MAME atarirle.cpp, modesc masks in MAME atarigt.cpp.
- rtl/rle_objects.sv:474 vblank frame-aligns the accumulator (mirrors MAME's m_partial_scanline reset at vblank); mogo consumes it.
- rtl/rle_objects.sv:521 the game rewrites object RAM in place during a draw: at tmek=0 the draw reads an image taken right after MOGO, the way MAME sorts and renders on that write.
- rtl/rle_objects.sv:604 clear the checksum BRAM first (MAME memsets m_checksums before accumulating; real BRAM power-on content is likewise undefined)
- rtl/rle_objects.sv:914 draw command: whole-buffer erase (simplification: MAME does a partial erase from the current scanline; a full clear is simpler and cheap enough here), then sort_and_render
- rtl/xga_prot.sv:14 word addresses = byte offset (atarixga.cpp PR_*) >> 1
- rtl/xga_prot.sv:26 T-MEK word addresses (MAME atarixga.cpp TM_* byte offsets in the D80000 window >> 1)
- rtl/xga_prot.sv:79 bit permutation of the query index, transcribed from atarixga.cpp
- rtl/xga_prot.sv:93 kmap[k]: number of LFSR clocks for key byte k, verbatim from atarixga.cpp
- rtl/xga_prot.sv:250 a write in DECIPHER mode (re)arms the engine and aborts any run still in progress (MAME: last write wins); busy stays high up to about 6 us at clk_cpu = 42.955 MHz
- rtl/xga_prot.sv:343 T-MEK: write16 returns to IDLE right on the triggering write (MAME atarixga.cpp:526-530), not deferred to the RESULT read; a later write here would otherwise be misread as a second query
- rtl/xga_prot.sv:390 restart from the SETUP start state (eng_x0), not the raw ciphertext: when c==0 that start state is 1, and eng_c==0 is a fixed point of the LFSR (MAME atarixga.cpp:100)
- README.md:46 | MAME description | Set | Zip files needed |
- README.md:103 XGA protection chip modelled after MAME
- README.md:118 The core uses the MAME sets listed under Sets, as of MAME 0.289.
- README.md:128 Put the zip files for the sets you want (see Sets) into `/games/mame`.
- README.md:137 The sound board boot ROM of this prototype was never dumped; MAME uses the one from a later set (marked BAD_DUMP), and so does this core.
- README.md:153 The sound DSP runs in lockstep against MAME's TMS320C31 core: a million instructions of the real CAGE program plus random instruction stress.
- README.md:183 FPGA core development: Nortido Hardware reference: MAME `atarigt.cpp` and `cage.cpp` (Aaron Giles and contributors), `atarixga.cpp` (Morten Shearman Kirkegaard,
Says it matches, follows or was checked against MAME — 11
- rtl/c31/c31_core.sv:27 for bits where iof_in_mask is set, the IOF register reads iof_in instead of its stored bit (bits 3 and 7 are driven by the CAGE host interface, matching MAME's set_state_int(TMS320C3X_IOF)); writes to IOF always go to storage, masked bits a
- rtl/cage_host.sv:79 dsp_re/dsp_we/host_re apply first, using this cycle's pre-update state; host_we (main_w) applies after, so a same-cycle "DSP reads the old command" + "host posts a new one" ends with the new command's ready flag set, matching MAME's machine
- rtl/cage_periph.sv:14 0x64 (primary bus control) is outside that range and is left alone, matching MAME.
- rtl/cage_periph.sv:24 interrupts to the (not yet built) C31 core: one clk_sys pulse per event, matching MAME's set_input_line() with no explicit clear for TINT0/TINT1/DINT0 -- the core's own IF register is a rising-edge latch, so a level-with-ack scheme here wou
- rtl/cage_periph.sv:312 matches MAME cage.cpp SPORT_DATA_TX special case: MAME compares the *derived word rate* to 22050*4 Hz (int(m_serial_period_per_word.
- rtl/cage_periph.sv:334 Two independent pieces, matching MAME's split between the (instant) bulk transfer and the deferred periodic timer:
- rtl/cage_periph.sv:338 (1) DINT timer: a free-running word-tick countdown, period = the transfer count latched at the FIRST arm after the timer was stopped (MAME cage.cpp only calls timer.adjust() when !m_dma_timer_enabled; a re-arm that lands while the timer is
- rtl/cage_periph.sv:507 playback: one word every word_tick, gated on the SPORT being configured (rate_valid) only -- the stream runs whether or not the DMA is on, repeating the stale/silent holding_reg when nothing is queued or the prefetch hasn't refilled yet, sa
- rtl/rle_objects.sv:1059 width==0 or height==0 means prescan found an invalid data offset for this object (matches MAME bailing on info.data == nullptr in draw_rle, before it ever divides by scaled_width/height)
- README.md:102 Full CAGE sound: TMS320C31 DSP written from scratch and checked against MAME
- README.md:155 A Verilator simulation runs the game ROMs through attract mode and play, and the sound output is checked against MAME's CAGE model.
Shares text with the MAME driver without saying so — 4