← All cores
heavyunit (decoryah)
Reports a measurement taken on the original PCB — 1
- rtl/hvyunit/hvyunit_timing.sv:6 The real PCB measures 15.59 kHz / 58 Hz, i.e. about 385 x 269; which line numbers the interrupts really sit on in that frame is unknown (MAME marks the line-64 timing "likely off"), so these are parameters, not facts.
Cites MAME source — 40
- HeavyUnit.sv:5 The machine (rtl/hvyunit) is three Z80s, the Mermaid 8751, a YM2203 and Kaneko's Pandora sprite chip, modelled on MAME's hvyunit.cpp and verified against it frame by frame (docs/oracle.md).
- HeavyUnit.sv:162 keyboard: 1 / 2 start, 5 / 6 coin, F2 service (MAME's defaults)
- HeavyUnit.sv:182 the board's input ports, active low (MAME's IN0 / IN1 / IN2): IN0: bit0 start 1, 1 start 2, 2 coin 1, 3 coin 2, 6 service IN1 / IN2: bit0 up, 1 down, 2 left, 3 right, 4 button 1, 5 button 2
- HeavyUnit.sv:293 the raster in force (0 TV, 1 MAME)
- HeavyUnit.sv:302 1, "MAME": 404 x 256 = 58.01 Hz / 14.85 kHz, MAME's model of the board (a 256-line frame at 58 Hz), so the vblank and sprite IRQs fall at the same fractions of the frame as in MAME.
- HeavyUnit.sv:411 Negative delays count from the frame length the module is built for (264 lines); in the 256-line MAME raster they count from 256, i.e. 8 lines fewer
- rtl/hvyunit/hvyunit_core.sv:3 Three Z80s, the Mermaid 8751, the three latches, every RAM and the YM2203, wired exactly as MAME's hvyunit.cpp maps them (docs/ARCHITECTURE.md sec.
- rtl/hvyunit/hvyunit_core.sv:142 The Pandora snapshots the sprite RAM at vblank start (MAME's eof is instantaneous): the main CPU's accesses to that window wait for it.
- rtl/hvyunit/hvyunit_core.sv:228 MAME uses HOLD_LINE: asserted until the Z80 acknowledges.
- rtl/hvyunit/hvyunit_core.sv:414 MAME routes the chip to a mono speaker at 0.80
- rtl/hvyunit/hvyunit_mermaid.sv:1 Mermaid MCU glue: the board-level behaviour MAME implements in the mermaid_p0..p3 callbacks of hvyunit.cpp.
- rtl/hvyunit/hvyunit_mermaid.sv:12 P3 in [7:4] DIP nibble, [3] sublatch pending, [2] !mermaid-latch pending, [1:0] read as 0 (MAME's callback returns zero there) P3 out [1] = sub CPU run (1) / reset (0) INT0 = Mermaid latch pending (active low pin)
- rtl/hvyunit/hvyunit_mermaid.sv:17 MAME invokes each callback on EVERY port write, including writes of an unchanged value; port_we from the patched jt8051 reproduces that exactly.
- rtl/hvyunit/hvyunit_mermaid.sv:49 last value written to P0 (MAME m_mermaid_p[0])
- rtl/hvyunit/hvyunit_mermaid.sv:50 MAME m_mermaid_p[1]
- rtl/hvyunit/hvyunit_mermaid.sv:51 MAME m_mermaid_p[2]
- rtl/hvyunit/hvyunit_pandora.sv:1 Kaneko Pandora sprite generator, behaviourally equivalent to MAME's kan_pand.cpp as hvyunit.cpp uses it (docs/ARCHITECTURE.md section 6.1, and the pixel-exact model in tools/hv_oracle.py).
- rtl/hvyunit/hvyunit_pandora.sv:9 * At vblank start (MAME's eof) the whole table is SNAPSHOTTED, then every entry is drawn, in order, into a plane; later entries overwrite earlier ones; pen 0 is transparent.
- rtl/hvyunit/hvyunit_pandora.sv:11 The plane is read out (and cleared) by the scan-out during the following visible area, so sprites lag the RAM by one frame exactly as MAME's double buffer does.
- rtl/hvyunit/hvyunit_pandora.sv:22 The plane is 256 x 224: the visible rows of MAME's bitmap (16..239).
- rtl/hvyunit/hvyunit_pandora.sv:87 running position (MAME ints; only [8:0] matter)
- rtl/hvyunit/hvyunit_pandora.sv:127 (MAME clips; skipping the fetch just saves time.)
- rtl/hvyunit/hvyunit_timing.sv:4 The defaults reproduce MAME's model of this board (hvyunit.cpp): a 256-line frame at ~58 Hz, vblank starting at line 240, and the main-CPU "sprite" IRQ at line 64.
- rtl/hvyunit/hvyunit_timing.sv:6 The real PCB measures 15.59 kHz / 58 Hz, i.e. about 385 x 269; which line numbers the interrupts really sit on in that frame is unknown (MAME marks the line-64 timing "likely off"), so these are parameters, not facts.
- rtl/hvyunit/hvyunit_video.sv:4 Everything here is behaviourally what MAME's hvyunit.cpp screen_update does (docs/ARCHITECTURE.md section 6; tools/hv_oracle.py is the pixel-exact model):
- rtl/third_party/jt8051/jt8051_periph.v:237 MAME's i8051 calls its port-out callback on EVERY write to P0..P3, even of an unchanged value, and the Heavy Unit glue depends on that.
- README.md:25 The MAME setting of Video timing, and the switch between the two, have been checked in simulation only.
- README.md:28 Everything else below is simulation and the Quartus tool flow, against MAME 0.289 (the reference for every comparison):
- README.md:62 The OSD's **Video timing** chooses between that raster (TV, the default, so the behaviour of 20261016) and MAME's own model of the board, 404 x 256 = 58.01 Hz (
- README.md:96 | Video timing | TV 58.3 Hz, MAME 58.0 Hz | The raster; see below |
- README.md:103 `MAME 58.0 Hz` is MAME's own model of the board, a 256-line frame at 58 Hz (404 x 256, 14.85 kHz), with the vblank and sprite interrupts at the same fractions o
- README.md:107 The RT4K may classify the MAME raster as `MiSTer Gen.` again; that has not been tried.
- README.md:126 Known differences from MAME
- README.md:129 Whether the vblank snapshot takes its new position or the previous one depends on the Z80's phase against the vblank, which neither MAME's CPU scheduling nor th
- README.md:133 **The raster.** MAME models the board as a 256-line frame at 58 Hz and has no line rate; the PCB's 15.59 kHz comes from the driver notes.
- README.md:134 Where the two interrupts sit in the real frame is not known (MAME itself marks the line-64 timing "likely off"), so the lines (64 and 240) are parameters, not f
- README.md:149 | `sim/` | Verilator benches: the machine (`m1`), the video block (`video`), the MiSTer top level end to end (`emu`), the MAME capture script (`oracle`) |
- README.md:173 The scratch folder is `work/` beside the repository (`../work`): the ROM image, MAME captures and bench output.
- README.md:177 tools/capture.ps1 -Frames 300 -Mcu -Out ..\work\oracle\m1ref # the MAME oracle (pixels + state) wsl bash sim/m1/run.sh 300
- README.md:201 **The MAME team** -- `hvyunit.cpp` and `kan_pand.cpp`, the reference for every comparison.
Says it matches, follows or was checked against MAME — 2
- README.md:30 **CPU side.** The three Z80s and the 8751 match MAME's RAM state frame for frame (tilemap, palette, scroll, sprite RAM) through the attract mode (`sim/m1`, `too
- README.md:37 A gameplay run (coin, start, hold right, autofire) sampled every third frame from 100 to 400 is bit-exact in 99 of 101 frames with the MAME setting and 97 of 10