← All cores
Arcade-SandScrp
Cites MAME source — 54
- SandScrp.sv:19 * The game is ROT90, where the NMK16 sets are ROT270, so the two Vert choices are the other way round: rotate_ccw = 0 is the MAME-correct quarter turn here.
- SandScrp.sv:23 Every consumer of it (video_retime, crt_chain) is parameterised, and the numbers themselves are a documented unknown -- see docs/known-issues.md SS-1: nothing in MAME describes this board's timing, so these come from the closest sibling Kan
- SandScrp.sv:71 Sand Scorpion is ROT90 in MAME: a vertical game the board draws on its side.
- SandScrp.sv:72 Both Vert choices present it upright through the framebuffer; "Vert 90" is the MAME-correct direction here (the NMK16 sets are ROT270 and want the other one), and "Vert 270" exists because a cabinet's monitor can be mounted either way round
- SandScrp.sv:294 Keyboard: MAME's own default bindings, always live, ORed with the pads.
- SandScrp.sv:704 Sand Scorpion is ROT90 in MAME, so the image has to be turned CLOCKWISE to stand upright, which is screen_rotate's rotate_ccw = 0 case -- the opposite of the NMK16 sets, which are ROT270.
- SandScrp.sv:706 "Vert 90" is therefore the MAME-correct choice here and is offered first; "Vert 270" is for a cabinet whose monitor is mounted the other way round.
- rtl/cheats.sv:1 Cheat engine — applies Pugsy MAME-database pokes to work RAM once a frame.
- rtl/cheats.sv:23 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/kaneko/kaneko_hit.sv:1 Kaneko CALC1 (40-pin DIP ULA, no internal ROM), the `kaneko_hit` type 0 of MAME kaneko/kaneko_hit.cpp: eight rectangle registers, a 16x16 multiplier and a random source, behind ten word registers at 0x200000.
- rtl/kaneko/kaneko_hit.sv:5 MAME's own note calls Sand Scorpion a set that "only uses Random Number?".
- rtl/kaneko/kaneko_hit.sv:28 A random Anything else reads 0 (MAME logs and returns its `data`, which is 0 there).
- rtl/kaneko/kaneko_hit.sv:32 MAME's own `machine().rand()` advances per call, so this is the closer model -- and it makes the generator's state a function of how many times the game has read it, which is savestate state.
- rtl/kaneko/pandora.sv:1 Kaneko PANDORA (PX79C480FP-3) sprite generator, as MAME kaneko/kan_pand.cpp models it: 512 x 8-byte entries in a 4 KB RAM, rendered whole into a framebuffered plane at every eof() (vblank start), double buffered ("4 64x4 DRAMs - 256x256 8 b
- rtl/kaneko/pandora.sv:11 7 [7] flip X [6] flip Y [5:0] code high 6 bits (kan_pand.cpp draw(): flipx = BIT(attr,7), flipy = BIT(attr,6) -- the code, not the table comment above it, which has the two swapped) Entries are walked 0..511; with bit 2 set dx/dy are A
- rtl/kaneko/pandora.sv:18 Flip screen (irq_cause bit 0 on this board, which MAME leaves commented out -- measured 2026-09-19 with the Flip Screen DIP: the game writes 0x1b/0x33/0x3b instead of 0x1a/0x32/0x3a): sx = 240 - x, sy = 240 - y, both flips inverted.
- rtl/kaneko/pandora.sv:31 * eof: SNAPSHOT the whole RAM into snap[] (1024 dwords, ~1024 cycles); cpu_hold is high meanwhile so the core stalls any CPU access to the RAM (MAME's copy is instantaneous; the game's vblank handler starts rewriting the table right after t
- rtl/kaneko/pandora.sv:39 * Swap: the finished plane goes on display at the next eof (lag: the table snapshotted at eof N is visible from the frame after eof N+1, one frame later than MAME) unless LAG1 is set, in which case a pass that finished before the next visib
- rtl/kaneko/pandora.sv:196 running position (MAME ints; only bits 8:0 matter)
- rtl/kaneko/pandora.sv:217 whole tile off the plane: skip it (MAME clips; walking 256 pixels each is what makes a pass long)
- rtl/kaneko/video_sandscrp.sv:1 Sand Scorpion video: VIEW2 (two tile layers) + PANDORA (sprite plane) + the 2048-entry xGRB_555 palette, composed per pixel exactly as sandscrp.cpp screen_update draws: fill with palette index 0; tile categories 0..3 (layer 0 then layer 1 f
- rtl/kaneko/video_timing_sandscrp.sv:1 Nothing in MAME documents this board's raster (sandscrp.cpp: set_refresh_hz(60), set_vblank_time(2500 us) "not accurate", set_size(256,256), set_visarea(0,255,16,239)); the values here are the sibling Kaneko/Pandora board snowbros.cpp's con
- rtl/kaneko/video_timing_sandscrp.sv:11 Coordinates are MAME's BITMAP coordinates: vcount == bitmap row, so the visible window is rows 16..239 (224 lines) and columns 0..255 of the 384-pixel line.
- rtl/kaneko/video_timing_sandscrp.sv:13 The vblank interrupt, the sprite interrupt and Pandora's eof all happen at the first vblank line (vcount == VACTIVE_END, hcount 0), which MAME models as one instant (screen.cpp vblank_begin: render, then the vblank callbacks).
- rtl/kaneko/video_timing_sandscrp.sv:18 Reset phase: vcount starts at VACTIVE_END, the first vblank line, as MAME's screen device does at machine time 0 (NMK16 video_timing.sv's measured finding), so the first interrupt comes one full frame after reset.
- rtl/kaneko/view2.sv:1 Kaneko VIEW2 tilemap chip, as MAME kaneko/kaneko_tmap.cpp models it for Sand Scorpion (one chip, two 512x512 layers of 16x16x4 tiles, per-row line scroll, 8 priority categories).
- rtl/kaneko/view2.sv:14 The chip's own register documentation in kaneko_tmap.cpp lists bits 1/0 as a second, per-layer flip pair, but prepare_common() ignores them: it gives m_tmap[0] AND m_tmap[1] the flip taken from bits 9/8.
- rtl/kaneko/view2.sv:17 Sand Scorpion writes 0x0303 with the Flip Screen DIP on -- both pairs at once -- so this capture cannot tell the two readings apart; MAME's behaviour is what the core matches.
- rtl/kaneko/view2.sv:20 Tile attr: bits 10-8 category, 7-2 colour, bit 1 flip Y, bit 0 flip X (tileinfo.set(..., TILE_FLIPXY(attr & 3)); TILE_FLIPX == 0x01 -- the comment block in kaneko_tmap.cpp has the two swapped).
- rtl/kaneko/view2.sv:25 Geometry, straight from tilemap.cpp with set_offset(0x5b, 0, 256, 224) (layer 0 dx = -0x5b, layer 1 dx = -(0x5b+2); dx_flipped = xdim + dx - 1, dy_flipped = ydim - 1; the flip "around the centre of the visible area" uses xextent = 256 and y
- rtl/rom_cache_n.sv:7 Why (docs/hw-bringup.md, "Slowdown"): the real board and MAME run the 68000 with zero wait states from EPROM.
- rtl/rom_cache_n.sv:8 Through the 1-line rom_cache1 56% of ROM bus cycles missed (the instruction stream and the game's ROM data-table reads thrash a single pair) and each miss is a ~10 clk_sys SDRAM round trip, 1-2 wait states — 13-20% of every frame spent stal
- rtl/sandscrp/sandscrp_core.sv:6 From kaneko/sandscrp.cpp: TMP68HC000N-12 @ 12 MHz, Z8400AB1 @ 4 MHz, YM2203C @ 4 MHz, OKIM6295 @ 12 MHz/6 = 2 MHz pin 7 HIGH, watchdog 3 s. The Z80 reads BOTH DIP banks through the YM2203's port A/B; the 68000 never sees them, so the OSD DI
- rtl/sandscrp/sandscrp_core.sv:18 Everything not listed is unmapped and reads 0x0000 -- MAME's unmapped value for this driver, which has no set_unmap_high; a core that returns 0xFFFF instead can spin forever on a bad vector (NMK16's airattcka).
- rtl/sandscrp/sandscrp_core.sv:150 SS-10 isolation: the YM2203's two halves before they are summed, so the FM and the SSG can be compared against MAME separately.
- rtl/sandscrp/sandscrp_core.sv:151 MAME routes them as two streams (ymfm's ym2203 has FM_OUTPUTS + SSG_OUTPUTS), and the mix alone cannot say which of the two is wrong.
- rtl/sandscrp/sandscrp_core.sv:413 PANDORA's flip: the two lines that would set it are commented out in sandscrp.cpp, but the game writes this bit exactly when the Flip Screen DIP is on (0x1b/0x33/0x3b instead of 0x1a/0x32/0x3a -- measured), and the chip has the mechanism.
- rtl/sandscrp/sandscrp_core.sv:494 Unmapped reads give 0x0000 (MAME's unmap value here).
- rtl/sandscrp/sandscrp_core.sv:818 MAME routes both chips at 0.5; its OKI stream is full 16-bit scale, i.e. jt6295's 14-bit `sound` x4, so the OKI term is shifted up two places against the FM before the halving.
- rtl/sandscrp/sandscrp_core.sv:823 SS-10, measured and REJECTED: jt12_top mixes the YM2203 as snd = fm_snd + {psg_snd, 5'd0} and it is tempting to call the FM twice as loud as MAME's, because MAME routes the chip's four streams at 0.5 each.
- rtl/sandscrp/sandscrp_core.sv:826 It is not: the mix below already applies its own >>> 1 to the combined term, so the FM reaches the output at 32767/2 = 16383, exactly MAME's routed FM.
- rtl/sandscrp/sandscrp_core.sv:828 Halving it again was tried and measured against a 30 s MAME capture: every band got 0.1-0.5 dB WORSE and the band correlation did not move.
- rtl/sandscrp/sandscrp_core.sv:833 SS-23: the YM2203 term is no longer jt03's own snd (fm + {psg,5'd0}, the SSG at x32): MAME routes the SSG at the same 0.5 as the FM, and ymfm's SSG channel peaks at 16382 where jt49's is 255, so the SSG weighs 16382/255 ~ 64 against jt03's
- rtl/sandscrp/sandscrp_core.sv:836 With upstream jt12 efa4068's YM2203 volume table (jt49 COMP 5) that puts the SSG +0.14 dB from MAME (a replay of MAME's YM2203 write log into jt03 against MAME patched with SS_YM_ISO=ssg); the old x32 on the compressed COMP=1 curve was -5.2
- rtl/savestate/savestate_ui.sv:4 Slot 2 is on F5 and NOT F2 because this core's own keyboard map already uses F2 for the Service Mode toggle (MAME's binding for it), and both were acting on the same press -- found on the board, 2026-09-20.
- README.md:3 Sand Scorpion (FACE, 1992) for the MiSTer FPGA platform — a from-scratch implementation of the Kaneko VIEW2 tilemap chip and PANDORA sprite generator, built aga
- README.md:63 The watchdog reboot the game needs in order to boot at all fires at the core's frame 180 against MAME's 179.
- README.md:67 The one frame that matches at no offset is a boot flash: the core renders one line ahead of the raster like the board, so a palette write during the visible are
- README.md:84 **CALC1: 200,000 randomised cases against a transcription of MAME's own collision and multiply code, 0 mismatches**, including values straddling 0x8000, sums th
- README.md:105 sandscrp_rom_hw.sv the SDRAM side: caches, arbiters, download rtl/ SDRAM controller, ROM caches, prefetch, video retimer, CRT Adjust chain, cheat
- README.md:109 sim/rtl/ video_state one frame of video from a MAME state dump
- README.md:171 **The MAME driver is the reference this core was built against**, and the debt is a large one.
- README.md:172 `kaneko/sandscrp.cpp` is **by Luca Elia**, who wrote the Sand Scorpion driver and is its copyright holder; the Kaneko chip devices this project reimplements in
- README.md:180 Every behavioural claim in this repository is measured against that code running as MAME 0.289.
Says it matches, follows or was checked against MAME — 7
- SandScrp.sv:29 Everything below compiles and is consistent with the simulations, which are pixel-exact against MAME through the SDRAM path, but no bitstream has been on a DE10-Nano.
- README.md:13 **Status: it boots and plays on real hardware.** Milestones 0 to 3 of `docs/PLAN.md` are done and measured: the video path, the whole board, and the whole board
- README.md:27 Orientation cannot be observed with the tools to hand, cheats are inconclusive and autofire is untested; audio against MAME and a frame-level comparison with th
- README.md:61 **The whole board, run from reset with nothing preloaded, is pixel-exact against MAME**: **43 of 44** dumped frames match with zero differing pixels, through th
- README.md:71 **The same core with every ROM byte coming out of the real SDRAM controller is also pixel-exact against MAME**, and an exhaustive golden-byte audit walks all **
- README.md:75 **Video: 61 of 61 frames identical to an independent model of MAME.** Each frame is rendered from a MAME state capture and compared three ways — the RTL, a Pyth
- README.md:78 31 of the 61 are additionally pixel-exact against MAME; the rest deviate identically in both renderers, because the game rewrites its sprite table 1,747 times p
Shares text with the MAME driver without saying so — 4