← All cores
Arcade-GingaNin
Cites hardware documentation that MAME's driver does not — 2
- rtl/gingan/gn_sound.sv:6 Map (ginganin.cpp:390-398): 0000-07FF RAM 0800-0807 MC6840
- rtl/gingan/gn_sound.sv:50 `hold` freezes the board's clock (6809, PTM, chips) from the moment every CPU is parked until the release; the state bus reads/writes the words below (ss_a, local word address; data one clock after the address, registered twice): 000-7FF RA
Reports a measurement taken on the original PCB — 1
- GingaNin.sv:342 REFRESH_CYCLES 740 at 96 MHz (~7.7 us); the controller's default 850 was measured corrupting reads on silicon in the NMK16 work.
Notes where it differs from MAME — 1
- README.md:29 The attract demo and scripted play diverge from MAME's later (GN-7, open).
Cites MAME source — 50
- GingaNin.sv:10 * One 16-bit input word (MAME's P1_P2: both players, coins and starts) and one 16-bit DSW word (<switches> bytes 0 and 1).
- GingaNin.sv:16 * No Service key: the board has none (MAME maps none).
- GingaNin.sv:255 Bytes 0 and 1 are the low and high bytes of MAME's DSW word at 070002.
- GingaNin.sv:267 Keyboard: MAME's default bindings, always live, ORed with the pads.
- GingaNin.sv:313 Inputs: MAME's P1_P2 word at 070000, active low (ginganin.cpp): bit 0 up, 1 down, 2 left, 3 right, 4 B1, 5 B2 (player 1) bit 6 up, 7 down, 8 left, 9 right, 10 B1, 11 B2 (player 2) bit 12 coin 1, 13 coin 2, 14 start 1, 15 start 2 M
- rtl/cheats.sv:1 Cheat engine — applies Pugsy MAME-database pokes to work RAM once a frame.
- rtl/cheats.sv:34 Poke semantics follow MAME's "run" state: the value is written every frame for as long as the cheat is enabled, which is what makes "infinite" cheats hold against the game decrementing the counter.
- rtl/gingan/gn_main.sv:5 Map (ginganin.cpp:374-387), byte addresses: 000000-01FFFF program ROM (writes ignored: the POST writes 10000-13FFF) 020000-023FFF work RAM 030000-0307FF text VRAM 040000-0407FF sprite RAM 050000-0507FF palette 06000
- rtl/gingan/gn_main.sv:14 IRQ1 (MAME: irq1_line_hold at vblank) is raised at the start of line 240 and held until one level-1 interrupt-acknowledge cycle (MS1-23).
- rtl/gingan/gn_main.sv:37 inputs, active low (MAME's P1_P2 and DSW words)
- rtl/gingan/gn_main.sv:193 ---------------------------------------------------------------- latch one pulse per write cycle to 06000E (MAME: m_soundlatch->write(data), then pulse NMI): the low byte of the register after the write
- rtl/gingan/gn_ptm6840.sv:1 Motorola MC6840 programmable timer module, written against MAME's machine/6840ptm.cpp (the oracle; no existing HDL was found, docs/PLAN.md fact 6).
- rtl/gingan/gn_ptm6840.sv:3 Clocked by the E enable only: this board has no external timer clocks and no gate inputs (MAME: set_external_clocks(0, 0, 0)).
- rtl/gingan/gn_ptm6840.sv:6 Registers (A2:A0), as MAME: W 0 CR1 if CR2 bit 0, else CR3 R 0 - W 1 CR2 R 1 status (bit 7 = any IRQ) W 2/4/6 MSB buffer (shared) R 2/4/6 counter MSB (LSB latched) W 3/5/7 latch n = {M
- rtl/gingan/gn_ptm6840.sv:15 Counting follows MAME's reload_counter / state_changed: 16-bit continuous (modes 0, 2): expire after latch+1 E; the output toggles dual 8-bit: (lsb+1)*msb E with the output low, lsb+1 with it high one-shot (modes 4, 6): 1 E with the output
- rtl/gingan/gn_ptm6840.sv:20 The output pins are MAME's out_cb: they follow a toggle only while the output is enabled, and go low when a control write clears the enable.
- rtl/gingan/gn_ptm6840.sv:24 Ginga Ninkyouden (Q1, docs/known-issues.md GN-3) uses timer 1 only: the handler holds reset (CR1 = 1), loads 0x4800, and releases with CR1 = 0x92 (continuous, internal clock, output enabled, no IRQ); output 1 is the 6809's IRQ (MAME: o1_cal
- rtl/gingan/gn_ptm6840.sv:51 MAME's m_output
- rtl/gingan/gn_ptm6840.sv:52 MAME's timer armed
- rtl/gingan/gn_ptm6840.sv:80 MAME's reset: CR1 = 1 (timers held)
- rtl/gingan/gn_ptm6840.sv:85 counting and expiry (MAME's state_changed)
- rtl/gingan/gn_ptm6840.sv:100 register writes (MAME's write)
- rtl/gingan/gn_sound.sv:1 Ginga Ninkyouden sound board (docs/PLAN.md 1.3, 2.5): an MC6809 on the 3.579545 MHz crystal (E = /4), 2 KB of RAM, the MC6840 whose output 1 is the 6809's IRQ, the sound latch whose write pulses NMI, a YM2149 and a Y8950 (both write-only in
- rtl/gingan/gn_sound.sv:6 Map (ginganin.cpp:390-398): 0000-07FF RAM 0800-0807 MC6840
- rtl/gingan/gn_sound.sv:33 audio: MAME's mix (Y8950 at 1.0, each YM2149 channel at 0.10)
- rtl/gingan/gn_sound.sv:167 latch and NMI (MAME: generic_latch_8, pulse_input_line(NMI)); the pulse is held low for two E cycles so the 6809's falling-Q sample sees it
- rtl/gingan/gn_sound.sv:310 ---------------------------------------------------------------- mix MAME's YM2149 is a resistor model into a 1 kohm load (ay8910.cpp build_single_table, ym2149_param, not normalised): a channel outputs table[volume] (0.4159 at volume 0 up
- rtl/gingan/gn_sound.sv:314 In WAV units that is table x 3277, with a DC floor of 1,363 per channel; the board's output is AC-coupled, so the mixer keeps MAME's AC part, (table[v] - table[0]) x 3277 (GN-5).
- rtl/gingan/gn_sound.sv:329 Measured against MAME's YM2149-only WAV over 90 s of play (GN-5), the table alone is 4.5 dB low in every band; the level is calibrated to MAME's RMS (x 107/64), as MS1Z-13 calibrated its SSG.
- rtl/gingan/gn_sprline.sv:3 256 entries of four words (MAME's draw_sprites): Y and X 9-bit signed ((v & 0xFF) - (v & 0x100)), code [13:0] with flip X [14] and flip Y [15], colour [15:12] of word 3.
- rtl/gingan/gn_sprline.sv:7 MAME draws them in index order, so a later entry covers an earlier one; the engine walks the entries in the same order and a write simply overwrites the line buffer.
- rtl/gingan/gn_tilerow.sv:3 The map is NCOLS x 32 tiles in column order (MAME's TILEMAP_SCAN_COLS: tile index = col * 32 + row), one word per tile: code [11:0], colour [15:12]; tile = code mod NTILES (1,024 here, a mask).
- rtl/gingan/gn_tilerow.sv:5 For source line `line` (0-255 of MAME's 256-line frame) the engine draws the 17 tiles covering screen x 0-255 at scroll (sx, sy): map pixel (x + sx) mod (NCOLS*16), line (line + sy) mod 512 (MAME's tilemap scrolling).
- rtl/gingan/gn_video.sv:5 Raster (D3): a 6 MHz dot (ce_pix = clk / 8), 400 dots x 250 lines = exactly 100,000 dots a frame = 60.000 Hz, MAME's frame period.
- rtl/gingan/gn_video.sv:6 Lines are numbered as MAME's 256-line frame: 16-239 are visible (224), 240 starts vblank (IRQ1), the frame wraps after 249.
- rtl/gingan/gn_video.sv:15 Composition (GN-2's model, exact against MAME): text over sprites over FG over BG; pen 15 is clear on text, sprites and FG; BG disabled shows pen 0.
- rtl/gingan/gn_video.sv:17 Palette RGBx_444 looked up at scan-out; an entry never written shows MAME's default colour (GN-1).
- rtl/gingan/gn_video.sv:140 text snapshot (GN-18): MAME composes the frame once, at the start of vblank, and the game rewrites the whole text RAM from vblank on when a life starts, redrawing the HUD only after the beam has passed it.
- rtl/gingan/gn_video.sv:143 The text engine draws from this copy instead, taken from text RAM in the 1,024 clocks after line 240 (MAME's frame_done); the 68000 waits on a text access meanwhile (txt_busy), so the copy is that instant's RAM exactly.
- rtl/gingan/gn_video.sv:351 MAME's default palette (GN-1)
- rtl/gingan/gn_y8950.sv:1 Yamaha Y8950 (MSX-AUDIO) for Ginga Ninkyouden: no open implementation exists (docs/PLAN.md fact 3), so it is composed the way MAME's ymfm builds it (ymfm_opl.cpp y8950): FM jtopl (YM3526, jotego/jtopl, vendored unmodified) ADPCM gn_adp
- rtl/gingan/gn_y8950.sv:15 The chip is write-only on this board (MAME maps no read), and its IRQ, timers and I/O ports are unused (GN-3).
- README.md:3 **Ginga Ninkyouden** (Jaleco, 1987) for the MiSTer FPGA platform: one bitstream for both MAME sets, `ginganin` and `ginganina`.
- README.md:14 It follows the methodology of Arcade-NMK16_MiSTer, Arcade-SandScrp_MiSTer, Arcade-JalecoMS1BCD_MiSTer and Arcade-JalecoMS1Z_MiSTer: MAME is the reference, and e
- README.md:21 **Runs on the DE10-Nano.** Measured against MAME 0.289:
- README.md:23 **video block:** 4,098 / 4,098 MAME frames reproduced pixel for pixel from MAME's own state (attract, scripted play, Flip Screen; GN-6).
- README.md:25 The rest are tearing: the game rewrites sprites while the picture is on screen, and MAME draws the frame once, afterwards.
- README.md:30 Each chip is within 0.21 dB of MAME's level, and the mix has an envelope correlation of 0.952 (GN-5).
- README.md:67 `sim/rtl/video_state`: the video block against MAME states;
- README.md:78 **MAME** `jaleco/ginganin.cpp` (driver by **Luca Elia**), with MAME's **ymfm** (Aaron Giles; `gn_adpcmb.sv` is a port of its ADPCM-B channel) and 6840 PTM: the
Says it matches, follows or was checked against MAME — 3
- rtl/gingan/gn_sound.sv:289 ---------------------------------------------------------------- YM2149 ZX-Spectrum_MISTer's copy (it matches MAME's period-0 rule, GN-5): BDIR/BC = 1/1 latches the address, 1/0 writes data; SEL 0 = no /2 (MAME's default YM2149), MODE 0 = t
- rtl/gingan/gn_video.sv:11 With flip (vregs[6] bit 0 clear) the whole 256 x 256 frame is turned 180 degrees: the engines draw source line 255 - y and the buffers are read mirrored (verified against MAME's flipped output, GN-2's sweep).
- README.md:39 **board:** the attract matches MAME's frames on the board.
Says it was translated, ported or taken from MAME — 1
- rtl/gingan/gn_adpcmb.sv:1 The Y8950's DELTA-T (ADPCM-B) unit: a port of MAME's ymfm adpcm_b_channel (3rdparty/ymfm/src/ymfm_adpcm.cpp, Aaron Giles, BSD-3-Clause), the oracle this core is measured against (docs/PLAN.md 2.5; GN-5).
Shares text with the MAME driver without saying so — 2