← All cores
NeratteChu (kyledlester)
Notes where it differs from MAME — 1
- rtl/nrc/nrc_core.sv:225 Flip Screen (DIP SW2:7): the game sets CRT register $74 and draws normally (MAME ignores the register and shows it upright), so the PCB flips in hardware; here the displayed framebuffer is read rotated 180 degrees.
Cites MAME source — 36
- rtl/nrc/nrc_clocks.sv:6 tick8 : nominal 8 MHz CPU time base = 48 MHz / 6 (MAME), fractional: 176/2205 of clk_sys.
- rtl/nrc/nrc_clocks.sv:7 ce_snd : tick8 / 128 = 62.5 kHz (MAME st0016 stream rate = clock / 128), from the nominal time base so the sample rate never jitters with CPU stalls.
- rtl/nrc/nrc_core.sv:101 DIP switches: MRA <switches>, ioctl index 254, byte 0 = DSW1, byte 1 = DSW2 (MAME values)
- rtl/nrc/nrc_cpu.sv:6 The wrapper exists to expose IntE (IFF1, needed for MAME's IFF1-gated NMI) and the register file (PC/SP for diagnostics), which T80s does not export.
- rtl/nrc/nrc_framebuffer.sv:4 Two 320 x 240 x 11-bit buffers (pen 0..1023, bit 10 = MAME UNUSED_PEN).
- rtl/nrc/nrc_inputs.sv:4 MAME simple_st0016.cpp, INPUT_PORTS_START(st0016) + (nratechu).
- rtl/nrc/nrc_inputs.sv:13 active-low DIP bytes as MAME defines them
- rtl/nrc/nrc_irq.sv:4 MAME simple_st0016.cpp st0016_state::interrupt (384-line fictitious screen, 60 Hz): line 240 : IRQ0, HOLD_LINE (asserted until the CPU acknowledges it) lines 0,64,..,320 : NMI pulse, but only if IFF1 = 1 at that moment ("dirty ha
- rtl/nrc/nrc_irq.sv:9 FPGA mapping [APPROXIMATION, MAME-compatible, all constants here]: IRQ at `irq_event` = start of vblank (line 256 of the 262-line raster) - the frame render instant.
- rtl/nrc/nrc_irq.sv:11 NMI k (k = 0..5) at IRQ + (16 + 64k) / 384 of a frame, i.e. MAME lines 256, 320, 0, 64, 128, 192 keep their phase relative to the IRQ.
- rtl/nrc/nrc_loader.sv:4 ioctl index 0 (hps_io WIDE=1): the MRA delivers the ST-0016 external ROM image in MAME region order, stream offset == extrom byte address (MRA: sx012-01 @0, 512 KiB zero pad, sx012-02 @100000).
- rtl/nrc/nrc_loader.sv:12 After the download finishes the loader zero-fills - extrom from the end of the stream up to 0x3FFFFF (MAME ROMREGION_ERASE00: U33/U34 unpopulated), - character RAM (SDRAM 0x800000-0x9FFFFF; MAME starts it zeroed), then raises rom_ready.
- rtl/nrc/nrc_palette.sv:4 Live palette: 2 KiB = 1024 colours x 16 bit little-endian (MAME m_paletteram), CPU window EA00-EBFF through the E5 bank register (512 bytes per bank).
- rtl/nrc/nrc_palette.sv:6 MAME converts pens to colours at the moment it renders the frame (vblank IRQ).
- rtl/nrc/nrc_palette.sv:12 Display reads (buffer, pen) -> RGB888 with MAME pal5bit expansion; pen 1024 (UNUSED_PEN) shows colour 0.
- rtl/nrc/nrc_render.sv:7 Tilemaps (MAME 0.289 draw_bgmap; Neratte Chu uses one only in its service mode): per slot with reg1 != 0, 64x32 tiles column-major at sprite RAM (reg1 & 15) * 0x1000, 4 bytes each (code.w, colour, attr), no scroll, tile (x, y) at (x*8 + spr
- rtl/nrc/nrc_render.sv:9 Phase order as MAME draw_screen: priority-0 layers (reg3 != $FF: sprite pixel rule, merge if reg7 == $12), sprites, priority-1 layers (plain transparency: pen 0 not drawn).
- rtl/nrc/nrc_render.sv:18 per 8x8 tile: compute which of its 8 destination columns / rows fall inside the clip (exactly MAME's u16 arithmetic, x wrap "-512 if > 327"); a tile with no visible pixel is skipped without fetching; otherwise fetch its 32 bytes (4 x 8-byte
- rtl/nrc/nrc_sound.sv:4 Behavioural reference: MAME master src/devices/sound/st0016.cpp (commit dcca0e9b), which adds PCB-fitted non-linear decoding, linear interpolation and an exponential volume law to MAME 0.289.
- rtl/nrc/nrc_sound.sv:8 For each of the 8 voices whose flags have bit 1 or 2 set: fetch the sample bytes at pos and next_pos(pos) from character RAM (SDRAM; one cached 8-byte group per voice), decode (linear or non-linear, voice 7 reg $1F bit 1), interpolate with
- rtl/nrc/nrc_sound.sv:39 ------------------------------------------------------------ tables volume byte -> gain x256 (MAME master m_voltab; bit 7 ignored); regenerate with scripts/gen_sound_tables.py
- rtl/nrc/nrc_sound.sv:118 sample byte -> s16 (MAME master m_linear / m_nonlinear)
- rtl/nrc/nrc_sound.sv:134 MAME master voice_t::next_pos
- rtl/nrc/nrc_sound.sv:188 CPU register writes; key-on per MAME voice_t::reg_w (compare with the live flags)
- rtl/nrc/nrc_sound.sv:275 write back unless the CPU wrote this voice's flags while it was processed (MAME: a register write follows the stream update, so the write wins)
- rtl/nrc/nrc_spriteram.sv:10 Snapshot protocol (docs/ARCHITECTURE.md "Video architecture"): snap pulse at the MAME render instant (vblank IRQ).
- rtl/nrc/nrc_spriteram.sv:12 From then until render_done, `render` is frozen: it equals `live` at the snap instant (MAME semantics).
- rtl/nrc/nrc_st0016.sv:4 Behavioural contract: MAME 0.289 st0016_cpu_device (cpu_internal_map / cpu_internal_io_map, vregs_r/w, bank handlers) plus the board glue of simple_st0016.cpp (st0016_mem, st0016_io, mux).
- rtl/nrc/nrc_st0016.sv:331 MAME vregs_w: byte copy extrom -> charram while src < 4 MiB and dst < 2 MiB
- rtl/nrc/nrc_video_timing.sv:7 Vertical: active lines 16..255 ($6A = $10 visible start, $6C = $100 visible end), vsync from line 1 ($68 = 1) [GAME-PROGRAMMED; register meanings from MAME comments].
- rtl/nrc/nrc_video_timing.sv:9 Horizontal: 320 active dots (MAME visible width for nratechu); the placement of sync inside the 135-dot blank is [MISTER-COMPATIBLE], centred like a standard NTSC active window (see docs/ST0016_VIDEO.md "Timing").
- rtl/nrc/nrc_video_timing.sv:13 ST-0016 bitmap x = x + 8 (MAME nratechu visible area 8..327), bitmap y = y.
- README.md:23 | Game | MAME set | Year | Genre | Board | Status |
- README.md:47 The game's Flip Screen DIP switch works (a true 180° rotation), which does not work in MAME.
- README.md:48 The service menu (DIP "Service Mode") works with readable text; MAME draws its text upside down.
- README.md:57 The picture is one frame later than on the original board (a constant 16.7 ms), because the core draws each frame into a framebuffer as MAME does.
Says it matches, follows or was checked against MAME — 2
- rtl/nrc/nrc_render.sv:6 Golden model: scripts/research/st0016_ref.py (pixel-identical to MAME snapshots).
- README.md:43 MAME's ST-0016 drivers (0.289, sound from MAME's current PCB-fitted model) are the behavioural reference; video was verified pixel-for-pixel against MAME.
Says it was translated, ported or taken from MAME — 1
- rtl/nrc/nrc_render.sv:4 Hardware port of MAME 0.289 st0016_cpu_device::draw_sprites() for game_flag 1 (nratechu): spr_dx = 0, spr_dy = 8, clip x 8..327 / y 0..239, bitmap pre-filled with UNUSED_PEN (1024).
Keeps a MAME approximation — 1
- README.md:59 A few undocumented ST-0016 behaviours follow MAME's approximations (the chip's timer/raster counter, the timing of the sound-sequencer interrupts, the sound chi
Shares text with the MAME driver without saying so — 2