← All cores
SeibuSPI (zakk4223)
Cites hardware documentation that MAME's driver does not — 3
- rtl/z386/z386.sv:3106 Call gate: set SIGMA for CS write at 2F3 (gates jump to FARJUMP2 which skips PASS at 2ED)
- rtl/z386/z386.sv:3752 Workaround for call gates: FARJUMP2 (2F0-2F3) skips PASS at 2ED, so SIGMA isn't set from COUNTR At 2F3, if SIGMA=0 but COUNTR!=0, use COUNTR (set by gate_detect for call gates)
- rtl/z386/z386.sv:4021 IN+= latches the delta like IN=+: PUSHA latches -1 at 089 (IN=+) then +WORDSZ at 08B (IN+=) for the 08E IN+D loop.
Says it was checked on “real hardware” — 1
- rtl/spi_video_timing.sv:12 The CRTC register (0x408) nominally says vblank starts at 253, but the real board only displays 240 lines -- confirmed on hardware: turning the monitor's height down does NOT reveal lines 240..252, so they are blanked, not overscanned.
Cites MAME source — 173
- SeibuSPI.sv:284 The MRAs are named after the games now, not the sets, and rdfts is a clone of rdft in MAME so it sits under _alternatives.
- SeibuSPI.sv:733 It is joystick bit 11, the eighth name in the MRA's <buttons> list, and NOT button 3: four of the seven sets are MAME's spi_3button and use that as a game button.
- SeibuSPI.sv:1236 Bit 12 has NO default in the MRA's `default=` list and that is not an oversight: Main only accepts the eight base pad names there (A B X Y L R Start Select, joymapping.cpp:72) and the first eight buttons have taken all of them.
- SeibuSPI.sv:1253 Bit 15 is NOT: it is a DIPSWITCH field in MAME, which does not take the port's IP_ACTIVE_LOW inversion, and its Off state is the bit CLEAR.
- SeibuSPI.sv:1295 MAME's sxx2c port: bits [1:0] = 0x3 "Update", 0x0 "Normal"; bits [7:2] are unused IP_ACTIVE_LOW and read as 1.
- SeibuSPI.sv:1310 Leaving it in update mode does NOT make a programmed cartridge reflash: the game skips the updater on a matching stamp whatever the jumper says, which is what section 0 measured under MAME's own default of Update.
- rtl/ddr_rom_reader.sv:8 rom_loader does not copy bytes, it TRANSFORMS them: a 14-part scatter with ten destination modes, the BPE+DPCM decoder for rdft2's and rfjet's sample flash, and MAME's sprite_reorder swizzle folded into the destination address.
- rtl/rom_loader.sv:4 ROM loader: streams the MRA's concatenated ROM image from ioctl into SDRAM, performing the MAME ROM_LOAD24_* / ROM_LOAD32_* scatter in hardware.
- rtl/rom_loader.sv:12 NOTE on the 24-bit word mode: MAME's ROM_GROUPWORD swaps the two bytes of each source word when the destination is a plain ROM_REGION, as "chars" and "tiles" are.
- rtl/rom_loader.sv:15 This was verified by comparing tools/build_sdram_image.py's output against MAME's own :maincpu region (byte exact) and against its decrypted :chars and :tiles regions (exact after decryption).
- rtl/rom_loader.sv:98 LINEAR, plus MAME's sprite_reorder() rotated into the destination: within each 64-byte group the 32 words are permuted so that output word 2j comes from input word j and output word 2j+1 from input word j+16.
- rtl/rom_loader.sv:125 M_SPR_ILV_R is the same with MAME's sprite_reorder() applied to the source index first, for the RISE10 sets.
- rtl/rom_loader.sv:177 The order in each must match the <part> order in the MRA, and tools/check_mra.py checks exactly that against MAME's driver -- nothing at runtime can, because the MRA carries no scatter information.
- rtl/rom_loader.sv:248 The authentic tail is in MAME's OWN region order -- sound01's two ROMs, then soundflash1's blank -- because that is the order an MRA has to send them in for check_mra.py to hold each one against the ROM_START entry it claims to be.
- rtl/rom_loader.sv:251 That check compares the comment to MAME's ROM name exactly, so these say the name and nothing else: 14 and 15 are the updater's two sources, 16 is the blank it programs.
- rtl/rom_loader.sv:265 Differences from rdft, all read off MAME's ROM_START(rdft2): * twice the tiles (12 MB), so the second bg group sits at +6 MB * text lanes come in the order fix0(1), fix1(0), fixp(2) * 18 MB of sprites as three 6 MB plane-pair chunks, one lo
- rtl/rom_loader.sv:280 Stored PACKED, one byte per 386 dword; the window's other three byte lanes are zero in MAME's region too.
- rtl/rom_loader.sv:300 Authentic: the two sound01 ROMs and then a blank flash, in MAME's own region order, in place of the two slices of a derived image.
- rtl/rom_loader.sv:318 The same shape as rdft2 -- same board, same updater generation, same three text lanes in the same order -- with four differences, all read off MAME's ROM_START(rfjet): * 9 MB of tiles, not 12.
- rtl/rom_loader.sv:325 * 24 MB of sprites as three 8 MB chunks, and here MAME's file order IS the numeric one: obj-1 at region 0, obj-2 at 8 MB, obj-3 at 16.
- rtl/rom_loader.sv:373 Same decryption as rdft -- MAME's init_viprp1 is init_sei252, so the text, tile and sprite keys and the 4 MB sprite chunk are the ones already wired for the SEI252 sets.
- rtl/rom_loader.sv:407 Part 0 is the zero fill for the half of the program region MAME leaves empty.
- rtl/rom_loader.sv:431 A mahjong game: the flash, video and sound work, but its controls are a custom encoding (MAME's ejanhs_encode) that this core does not decode.
- rtl/seibu_partial_add.sv:4 The primitive under every Seibu Kaihatsu graphics encryption (mame/src/mame/seibu/seibu_helper.cpp): an adder whose carry only propagates from bit i to bit i+1 where carry_mask[i] is set, and whose carry out of the top bit wraps around to f
- rtl/spi_cpu.sv:6 Address map (sxx2e_map, seibuspi.cpp:1004,1077):
- rtl/spi_cpu.sv:17 The sound01 window (MAME maps the whole region at 00A0_0000-013F_FFFF) is where the cartridge sets that have a second sound ROM keep their Z80 program.
- rtl/spi_cpu.sv:29 Everything else in the sound01 window keeps falling through to S_NULL, which is what MAME's ERASE00 region reads as anyway, and so do the three dead lanes of every dword in this one.
- rtl/spi_cpu.sv:35 The rest of MAME's sound01 region is the cartridge's 2 MB PCM ROM, and the game's own sample-flash updater reads it from there a byte at a time to program the flash (PLAN.md 17.2).
- rtl/spi_cpu.sv:38 It is loaded ROM_LOAD32_WORD, so it occupies TWO byte lanes of every dword -- 1 MB of ROM per 2 MB of window -- and MAME's ROM_CONTINUE(base + 0x400000) puts the second megabyte 2 MB further up, which is the skip the 386's own fetcher walks
- rtl/spi_cpu.sv:355 MAME drives IRQ0 with HOLD_LINE on vblank and the acknowledge callback unconditionally returns vector 0x20 -- there is no PIC on this board.
- rtl/spi_cpu.sv:415 The two can coincide -- the toggle crosses from clk_sys and is true for one clk_cpu cycle, and the retire is one cycle a frame -- and MAME's HOLD_LINE re-asserts on a vblank that arrives during the acknowledge rather than dropping it.
- rtl/spi_cpu.sv:1009 MAME performs each video DMA atomically inside the trigger write, so no instruction can run between the trigger and the copy.
- rtl/spi_cpu.sv:1017 This is a correctness fix for tearing, NOT the cause of the empty sprite list: MAME's capture shows the game does not clear the buffer after triggering (main RAM at 0x37000 still holds the list at end of frame).
- rtl/spi_cpu.sv:1181 The board decodes no I/O ports; MAME's map has none.
- rtl/spi_cpu.sv:1256 sound01 answers one packed byte in lane 0 and zeroes above, which is what MAME's ROM_LOAD32_BYTE region holds there; the PCM source answers two, ROM_LOAD32_WORD.
- rtl/spi_cpu.sv:1258 The dead lanes are zero in MAME's region too, not don't-care -- the region is ERASE00 and the updater's fetcher reads whole dwords.
- rtl/spi_dma.sv:4 Video DMA engines (seibuspi_v.cpp:238,327,351).
- rtl/spi_dma.sv:25 That is what MAME does, and the renderer reads them back from 0x200 / 0x600 / 0xA00 for back / midl / fore respectively.
- rtl/spi_dma.sv:47 MAME asserts DWORD_ALIGNED on this register, so the low two bits are always zero and are not carried here.
- rtl/spi_dma.sv:180 MAME performs each DMA instantaneously inside the trigger write, so it always uses the video_dma_address current at that instant.
- rtl/spi_ds2404.sv:8 The real DS2404 speaks 1-Wire, and the board does not: the SEI600 presents it to the 386 as four byte ports, and MAME's ds2404.cpp models THAT view rather than the chip's own protocol (its header says so, at length).
- rtl/spi_ds2404.sv:11 So the thing to be faithful to is MAME's device, which is what the game has always been talking to:
- rtl/spi_ds2404.sv:21 MAME calls anything else a fatal error; hardware cannot, so an unknown byte is ignored and the machine stays where it is.
- rtl/spi_ds2404.sv:42 The RTC is NOT part of the save file, because it is not part of MAME's either -- ds2404_device::nvram_write stores m_sram and nothing else.
- rtl/spi_ds2404.sv:43 MAME seeds the counter from the host clock against a 1995-01-01 reference; there is no clock here, so it starts at zero and counts from power-on, the way a board whose battery has gone would.
- rtl/spi_ds2404.sv:51 MAME ticks the counter at 256 Hz, so this is 114.545455 MHz / 256.
- rtl/spi_ds2404.sv:129 MAME's state stack.
- rtl/spi_ds2404.sv:143 MAME has a read-scratchpad state and no command that reaches it: cmd() decodes 0x0F, 0x55 and 0xF0 only.
- rtl/spi_ds2404.sv:159 Six bits, not five: MAME's m_offset walks 0..32 and the write is guarded on `< 0x20`, so a 33rd scratchpad byte is DROPPED rather than wrapping back over the first.
- rtl/spi_ds2404.sv:164 five bytes, low first, as MAME orders them
- rtl/spi_ds2404.sv:199 MAME's loop runs `for (i = 0; i <= end_offset; i++)` over a 32-byte scratchpad, so a game asking for more than 32 reads past it there; here the index wraps, which is at least defined.
- rtl/spi_ds2404.sv:260 nvram_default(): the SRAM comes up ZEROED, not erased, so a set with no save file yet sees what MAME's first boot sees.
- rtl/spi_ds2404.sv:290 MAME's data_w() writes m_state[] and m_a2 and then reads them back within the same call, and steps the pointer twice, so all of it has to be visible here rather than a cycle late -- which is what these are for, and why they are the one plac
- rtl/spi_ds2404.sv:343 ---- the RTC, 40 bits at 256 Hz ------------------------------ A tick landing on the same cycle as a copy into the counter's bytes leaves the incremented value with that byte replaced, where MAME's scheduler would give one or the other whol
- rtl/spi_ds2404.sv:369 ---- 0x6DC --------------------------------------------------- Reading it has no side effect in any reachable state: MAME advances the pointer on the CLOCK write, not on the read.
- rtl/spi_ds2404.sv:456 MAME calls this fatal
- rtl/spi_ds2404.sv:470 MAME acts on it in the same call; here it is NAMED now and set up next cycle, which is what keeps the decode and the arithmetic out of one another's path.
- rtl/spi_io.sv:5 (sxx2e_map / base_map, seibuspi.cpp:1004,1077; seibu_crtc.cpp)
- rtl/spi_io.sv:7 MAME reaches it through seibu_crtc_device::write(offset, data), which then writes word `offset` of the CRTC's own 16-bit space -- so a CRTC register documented at internal byte address N is simply CPU byte address 0x400 + N. The registers t
- rtl/spi_io.sv:45 MAME's own CRTC map documents it (seibu_crtc.cpp:34, "---x Flip Screen") but seibuspi_v.cpp decodes only bits 15 and 11, so MAME never flips -- the real board does.
- rtl/spi_io.sv:101 Everything at or above it is SDRAM nobody has filled, and `spi_sound` reads it back as MAME's zero padding instead.
- rtl/spi_io.sv:170 Read/write storage behind the whole CRTC window (0x400-0x44F, 20 dwords), mirroring MAME's `map(0x0000, 0x004f).ram()`.
- rtl/spi_io.sv:207 MAME does the same: COMBINE_DATA into m_layer_bank, then BIT(m_layer_bank, 15).
- rtl/spi_io.sv:217 Measured on rdfts -- the ONLY register bits that move when the DIP is toggled are this one and layer_scroll_base (0x42C-0x438), which neither MAME nor this core implements.
- rtl/spi_io.sv:260 MAME video_start: 0 = all layers enabled
- rtl/spi_io.sv:293 Every CRTC register is merged PER BYTE, which is what MAME's COMBINE_DATA does: bytes outside mem_mask keep their old value.
- rtl/spi_io.sv:372 MAME drops writes past the end of the region and stops advancing, so do the same.
- rtl/spi_io.sv:414 Both are the ACTIVE LOW pins: MAME's ff_r()/ef_r() return the negated internal flags, so d0 reads 1 when there is room to send and d1 reads 0 while nothing has come back.
- rtl/spi_io.sv:424 MAME backs the whole Seibu CRTC window with `map(0x0000, 0x004f).ram()` and overlays the register handlers on top, so a read returns whatever was last written -- reg_1a even has an explicit reg_1a_r().
- rtl/spi_io.sv:451 0x6DC is the DS2404's data byte and 0x6DD is the three bits the game waits to see clear -- the same dword, so one entry covers both, and MAME's spi_ds2404_unknown_r returns zero for the second.
- rtl/spi_layers.sv:11 Layer geometry (seibuspi_v.cpp:591):
- rtl/spi_layers.sv:19 Tile word decode (seibuspi_v.cpp:511):
- rtl/spi_layers.sv:29 Within a decrypted group v (v[23] is the MSB of the first byte), MAME's gfx_layout puts entry k of planeoffset[] at bit offset 4k, pixel p at a further (3-p), and bit offset n reads as v[23-n].
- rtl/spi_layers.sv:70 The fore layer's tile base, which depends on the SIZE of the tile region (seibuspi_v.cpp:585): 0x2000 up to 3 MB, 0x4000 up to 6 MB, 0x8000 beyond.
- rtl/spi_layers.sv:76 Per GAME, not per board, and the same triple serves both layers -- MAME's text_decrypt and bg_decrypt take the same three constants.
- rtl/spi_layers.sv:185 Rowscroll tables, when enabled (seibuspi_v.cpp:437).
- rtl/spi_layers.sv:208 MAME indexes the table with (y + 19) & 511; the adder is presumably a CRTC value rather than a true constant, but every SPI game uses the same one.
- rtl/spi_layers.sv:229 Rowscroll follows the MIRRORED row, because MAME indexes this table by SCREEN row while the tilemap source row is the scrolled one (seibuspi_v.cpp:405-420: rowscroll[(y+19)] against pix(y+sy)).
- rtl/spi_layers.sv:366 MAME reads a group as w = (b0 << 16) | (b1 << 8) | b2, so the first byte becomes the MSB.
- rtl/spi_mixer.sv:4 Layer mixer (screen_update_spi, seibuspi_v.cpp:434).
- rtl/spi_mixer.sv:6 MAME composites in this exact order, and the odd bits matter:
- rtl/spi_mixer.sv:20 The "back layer again" step is MAME's `(m_layer_enable & 0x15) == 0`, i.e. back, fore and sprites all on.
- rtl/spi_mixer.sv:23 Sprites arrive as a single pixel per column carrying its priority, because that is how MAME works: every sprite is rendered into one buffer tagged with its priority, so sprite-versus-sprite occlusion is decided purely by list order and a hi
- rtl/spi_mixer.sv:29 Alpha blending is MAME's alpha_blend_r32(dest, pen, 0x7f) -- (src*127 + dst*129) >> 8, not a 50/50 mix -- applied to a hand-picked set of pens.
- rtl/spi_mixer.sv:179 Alpha table (seibuspi_v.cpp:603)
- rtl/spi_mixer.sv:181 MAME sets these ranges and explicitly leaves the commented-out ones alone because they break specific games.
- rtl/spi_mixer.sv:208 BGR555 is expanded to 8 bits per channel the way MAME's pal5bit does: x << 3 | x >> 2.
- rtl/spi_mixer.sv:217 MAME's alpha_blend_r32(dest, pen, 0x7f), exactly:
- rtl/spi_mixer.sv:260 MAME: (layer_enable & 0x15) == 0 => back, fore and sprites all enabled
- rtl/spi_mixer.sv:296 MAME's ten composite steps, spread over five clk_sys cycles instead of crammed into one.
- rtl/spi_mixer.sv:336 With the back layer disabled MAME does `bitmap.fill(0, cliprect)` (seibuspi_v.cpp:452), which writes the raw RGB value 0 into a bitmap_rgb32 -- hard black.
- rtl/spi_nvram.sv:32 The 512-byte tail is byte-for-byte MAME's own `ds2404` nvram file.
- rtl/spi_rise10_decrypt.sv:4 seibuspi_rise10_sprite_decrypt(), seibuspi_m.cpp.
- rtl/spi_rise10_decrypt.sv:19 MAME writes both back as chunk0 = {plane5, plane4} chunk1 = {plane3, plane2} chunk2 = {plane1, plane0} and pixel j of plane n is bit j of that byte.
- rtl/spi_rise11_decrypt.sv:4 seibuspi_rise11_sprite_decrypt(), seibuspi_m.cpp.
- rtl/spi_rise11_decrypt.sv:15 `i` is MAME's loop variable, which is the index BEFORE sprite_reorder().
- rtl/spi_rise11_decrypt.sv:25 MAME writes the planes back as chunk0 = {plane5, plane4} chunk1 = {plane3, plane2} chunk2 = {plane1, plane0} which is the same byte-to-plane map RISE10 uses; only the way the six planes are grouped into sums differs (543 / 210 here, 54 /
- rtl/spi_rise11_decrypt.sv:39 MAME's `i`: the word's index within one plane-pair chunk, BEFORE sprite_reorder.
- rtl/spi_rise11_decrypt.sv:64 MAME's plane543 line calls the 32-bit form, but every operand is 24 bits and R11_MASK543 cannot carry out of bit 23, so a 24-bit adder gives the same answer -- the generator refuses to emit constants for which that is not true.
- rtl/spi_snd_window.sv:2 SeibuSPI - the 386's view of MAME's `sound01` region
- rtl/spi_snd_window.sv:4 MAME gives the SXX2C cartridge a 10 MB `sound01` region mapped at 386 address 0x00A0_0000, holding two ROMs that the loader stores PACKED in SDRAM and that this decode unpacks on the fly.
- rtl/spi_snd_window.sv:10 tools/check_snd01_window.py transcribes THIS file, and sim/tb_snd_window.cpp checks it against a model built from MAME's region layout.
- rtl/spi_snd_window.sv:31 Generation B loads it ROM_LOAD32_WORD, so it occupies TWO byte lanes of every dword -- 1 MB of ROM per 2 MB of window -- and MAME's ROM_CONTINUE(base + 0x400000) puts the second megabyte 2 MB further up.
- rtl/spi_snd_window.sv:48 Leaving the window enabled for a set with nothing behind it made the 386 read 0xFF where MAME reads 0x00 on all 512 K dwords, which is why `snd01_en` and `pcmsrc_en` are separate: check_snd01_window.py caught that before it reached hardware
- rtl/spi_snd_window.sv:92 Stating the addresses whole and letting the unused bits go is what keeps the comments above readable in MAME's own byte addresses instead of in dword indices.
- rtl/spi_sound.sv:5 (sxx2e_soundmap, seibuspi.cpp:1171)
- rtl/spi_sound.sv:354 The region is 256 KB (MAME's :audiocpu region is 0x40000, eight 32 KB bank entries) and how much of it holds a program is per set.
- rtl/spi_sound.sv:361 The pad still has to read as MAME's zeros rather than as whatever SDRAM held at power-on, so the bound is what was actually written -- the 386's download high-water on a cartridge, and the 128 KB ROM part on SXX2E.
- rtl/spi_sound.sv:881 SXX2C only; MAME leaves it a TODO
- rtl/spi_soundflash.sv:16 COMMANDS, from that trace plus MAME's intelfsh:
- rtl/spi_soundflash.sv:29 Byte programming costs one write, and like MAME's intelfsh we charge no program time: the ritual then takes as long as the 386/FIFO/Z80 round trip makes it, which is tens of seconds rather than the minutes real flash needs (PLAN.md 16.6).
- rtl/spi_soundflash.sv:37 The updater's actual sequence, logged out of MAME by tools/mame_flash_port.lua (PLAN.md 17.14):
- rtl/spi_soundflash.sv:55 The updater erases everything first and MAME does the same thing, so nothing observable depends on it.
- rtl/spi_soundflash.sv:108 ---- the watch (PLAN.md 19.11) ------------------------------------ rdft2's flash comes out with byte 0x29FE erased where MAME holds 0xFE: one byte in two megabytes, reproducibly, on two builds.
- rtl/spi_soundflash.sv:169 A QUEUE, not a single block: the updater sends all sixteen block-erase pairs of a chip back to back without waiting, because MAME's intelfsh erases instantly and only its STATUS is slow (a 1-second timer).
- rtl/spi_spr_decrypt.sv:4 mame/src/mame/seibu/seibuspi_m.cpp:115 (seibuspi_sprite_decrypt).
- rtl/spi_spr_decrypt.sv:7 MAME writes the result back as six plane bytes and lets the gfx decoder unpack them; we skip the round trip and emit pixels directly.
- rtl/spi_spr_decrypt.sv:12 gfx plane p of pixel x reads byte p of the row at bit x, and the decrypt stores plane5..plane0 into chunk0.b0, chunk0.b1, chunk1.b0, chunk1.b1, chunk2.b0, chunk2.b1 -- so gfx plane 0 (the pixel's LSB) comes from MAME's `plane5` variable, an
- rtl/spi_spr_decrypt.sv:57 Bit 15 is deliberately unused -- MAME notes "Bit 15 is still unknown" and never reads it either.
- rtl/spi_spr_decrypt.sv:72 key_table[], the y3 permutation and the four bit gathers (s1_in, add1_in, s2_in, add2_in) are machine generated from MAME.
- rtl/spi_sprite.sv:4 Sprite engine (sei25x_rise1x_spr.cpp).
- rtl/spi_sprite.sv:21 MAME walks the list BACKWARDS (last entry first), so entry 0 is drawn last and ends up on top.
- rtl/spi_sprite.sv:31 The RISE "extra bank" bit -- word 2 bit 12, which becomes tile code bit 16 -- is applied only when the gfx region holds MORE than 0x10000 tiles, which is MAME's own gfxbank_callback rule (seibuspi_v.cpp:370).
- rtl/spi_sprite.sv:61 It is no longer an address stride, because the chunks are interleaved rather than laid end to end; it survives because MAME's extra-bank rule is stated in terms of it (elements = chunk / 64).
- rtl/spi_sprite.sv:107 Exposed so the golden test can decode the same tile row straight out of the sprite ROM with MAME's decryptor and compare pixel for pixel.
- rtl/spi_sprite.sv:185 MAME: gfxbank_callback adds 0x10000 only when elements > 0x10000, and elements is the chunk size over 64 bytes per tile.
- rtl/spi_sprite.sv:330 RISE11's plane210 sum takes MAME's loop variable `i` as its addend, so the index has to be reconstructed here -- and it is the index BEFORE sprite_reorder, which is not the position the word was read from.
- rtl/spi_sprite.sv:343 Get this wrong and the pens are silently wrong -- there is nothing downstream that could notice -- so tb_rise11_decrypt walks the words in exactly this order and checks them against MAME's final image.
- rtl/spi_sprite.sv:376 spi_spr_decrypt emits the pen BIT REVERSED: its bit p is MAME's plane(5-p), i.e. bit 0 carries plane5 which is the pen's MSB.
- rtl/spi_sprite.sv:449 FIFO order is list order, so MAME's "later entry drawn on top" still falls out of the write order exactly as before.
- rtl/spi_sprite.sv:562 MAME skips code 0 (`code % elements == 0`).
- rtl/spi_tile_decrypt.sv:4 mame/src/mame/seibu/seibuspi_v.cpp:42
- rtl/spi_tile_decrypt.sv:12 The `tileno` term is what makes this cheap enough to do at fetch time rather than in a boot-time pass over the whole ROM: MAME derives it from the ROM address, but that collapses to the tile code.
- rtl/spi_tile_decrypt.sv:16 chars: each 8x8 tile is 48 bytes = 16 groups, MAME uses group_index >> 4, so tileno = char code.
- rtl/spi_tile_decrypt.sv:18 tiles: decryption restarts every 0xC0000 bytes; within a block each 16x16 tile is 192 bytes = 64 groups and MAME uses group_index >> 6, so tileno = tile_code & 0xFFF.
- rtl/spi_tile_decrypt.sv:35 MAME: bitswap<24>(val, 18,19,9,5, 10,17,16,20, 21,22,6,11, 15,14,4,23, 0,1,7,8, 13,12,3,2) The first source index becomes the result's MSB.
- rtl/spi_top.sv:332 Leaving the window on for it made the 386 read the unwritten SDRAM there as 0xFF where MAME reads 0x00, on all 512 K dwords of it -- caught by tools/check_snd01_window.py before it ever reached hardware.
- rtl/spi_top.sv:424 layer_enable is active LOW per MAME (0 = layer shown).
- rtl/spi_top.sv:979 bg_fore_pos is the fore layer's tile base and it follows the SIZE of the tile region (seibuspi_v.cpp:585): 0x2000 up to 3 MB, 0x4000 up to 6 MB, 0x8000 beyond.
- rtl/spi_top.sv:986 The same triple does text and background -- MAME's text_decrypt and bg_decrypt take the same three constants -- so one selection covers both layers.
- rtl/spi_top.sv:1081 The chunk size is no longer an address stride -- the loader interleaves the chunks -- it is what MAME's extra-bank rule counts tiles with.
- rtl/spi_video_timing.sv:6 The Seibu CRTC is programmable, but every SPI game writes essentially the same values, and MAME hardcodes the resulting raster (seibuspi.cpp:898):
- rtl/spi_video_timing.sv:15 MAME blanks at 240 for the same reason.
- rtl/ymf271.sv:4 Even offsets latch an address, odd offsets deliver the data to one of four FM register banks, the PCM bank, or the timer/control bank (ymf271_device::write, ymf271.cpp:1446).
- rtl/ymf271.sv:148 ext_latch is a read-ahead: a read returns it and only then advances the address and refetches, which is MAME's structure and the reason the first read after setting an address is a dummy.
- rtl/ymf271.sv:375 MAME's ymf271 read() has the same shape -- ext_read() is called once per advance and its result is what the next read returns -- and doing it at the mux instead would answer from the address the port has moved on to, which shows up as the w
- rtl/ymf271.sv:417 MAME contradicts it deliberately -- the split matches the other Yamaha FM chips -- and the timer is this board's sound heartbeat, so follow MAME.
- rtl/ymf271.sv:425 A timer only ever starts here: MAME reaches the "stop" branch only when the enable bit is already set, so it can never be taken.
- rtl/ymf271.sv:558 It returns the LATCHED byte and only then advances, so the first read after setting an address is a dummy and the data stream starts at address+1 -- MAME's read() does exactly this.
- rtl/ymf271.sv:567 With the direction bit clear the port reads 0xFF either way, which is what MAME does and what the existing test pins down.
- rtl/ymf271_synth.sv:4 MAME's sound_stream_update / op / eg_tick / pcm_sample / env_mul / pan (ymf271.cpp, the OPX rewrite 03761e46766), re-expressed as one serial pass over 48 slots per 44100 Hz sample.
- rtl/ymf271_synth.sv:8 This replaced a port of MAME's OLD core, which worked in linear gains: a 6 x 1024 signed waveform ROM multiplied by an envelope volume.
- rtl/ymf271_synth.sv:13 Detune, Acc On, EN/EXT Out, PCM interpolation and the external-waveform key code all arrived with it; PLAN.md 14.5 listed every one of them as unimplementable because MAME did not implement them either.
- rtl/ymf271_synth.sv:34 MAME's comment says so outright -- "modulators with a lower slot number are taken from the current frame, higher-numbered ones from the previous".
- rtl/ymf271_synth.sv:62 tools/check_ymf271_math.py sweeps phase_inc, pcm_step and the envelope increment against MAME's unbounded integers, 2.5 M combinations, and fails if any of them is a bit short.
- rtl/ymf271_synth.sv:82 The cartridge board wires chip output 0 to the left speaker and 1 to the right (MAME's spi(): add_route(0,"speaker",1.0,0) and (1,...,1)); the single board sums ALL of them into one (sxx2e(): ALL_OUTPUTS -> "mono").
- rtl/ymf271_synth.sv:161 W_OUT is 18 rather than the operator's 14 because waveform 6 is not an operator output: it is a DC half-scale level plus the modulation input stretched by 64, which reaches about 2.5x the range of every other waveform (MAME 783e8a2efc2).
- rtl/ymf271_synth.sv:483 Both heads are reached before any slot that needs the value, so this is never stale within a sample -- which is what MAME's rebuild_group() achieves by rebuilding the whole group's connection cache up front.
- rtl/ymf271_synth.sv:561 Detune, Acc On, Src Note and Src B were already stored -- they sat in bytes nothing extracted, because MAME's old core dropped them.
- rtl/ymf271_synth.sv:596 Only the twelve slots of groups 0/4/8 -- slot % 4 == 0 -- can fetch external data; a wave-7 select anywhere else is silence, which is what MAME does and what the old core had to special-case because its update_pcm() called fatalerror() on t
- rtl/ymf271_synth.sv:610 For an internal waveform MAME clamps the octave at 0 instead of letting the manual's 4*Block wrap up to octave 7.
- rtl/ymf271_synth.sv:624 ---- envelope state transitions --------------------------------------- MAME checks these BEFORE picking the rate, and the D1L test runs on the state the attack test may just have changed.
- rtl/ymf271_synth.sv:717 The tables are MAME's alg4 / alg3 / alg2, packed.
- rtl/ymf271_synth.sv:883 Every width here is swept against MAME's int64 by tools/check_ymf271_math.py; the accumulator TRUNCATES to 32 bits, which is how increments above fs/2 alias (the hi-hat carriers of the Seibu titles are fed by such a modulator).
- rtl/ymf271_synth.sv:911 The Fs divide happens on the full product, before the 32-bit truncation, which is the order MAME uses and the order the sweep checks.
- rtl/ymf271_synth.sv:1025 MAME writes this as `eg_att += ((~eg_att) * inc) >> 4` on a SIGNED int32, where ~att is -(att+1) and the shift floors toward -infinity -- so the step is ceil((att+1) * inc / 16) subtracted, not floor((1023 - att) * inc / 16) added.
- rtl/ymf271_synth.sv:1094 Mono sums every channel MAME routes, which is now all eight -- see the note on `stereo` at the top.
- rtl/ymf271_synth.sv:1136 Real hardware has nothing above the ROM either; MAME reads 0 there because its region is ERASE00.
- rtl/ymf271_synth.sv:1458 A slot in EG_OFF writes nothing: MAME's `continue` skips the history update along with the output, so a released operator leaves the head's loop holding its last real samples rather than pushing zeros through it.
- rtl/ymf271_synth.sv:1463 A slot in EG_OFF hands over nothing: MAME's `continue` skips the history update along with the output.
- rtl/ymf271_synth.sv:1546 MAME's device_reset() puts all 48 slots in EG_OFF, and a core that did not would come out of reset playing whatever it was playing when it went in.
- README.md:17 As the kids say, this is an AI Slop mame core.
- README.md:37 It is functional but 'mame quality' which still clearly has some issues.
Says it matches, follows or was checked against MAME — 5
- rtl/ddr_rom_reader.sv:11 All of that is verified byte-exact against MAME (PLAN.md section 12) and none of it wants reimplementing against a different source.
- rtl/rom_loader.sv:153 Both put their program in the UPPER half of the 2 MB region -- four 256 KB ROMs at offset 0x100000 -- so part 0 is a megabyte of zeroes that nothing reads but that makes the region match MAME's rather than hold whatever the last core left i
- rtl/spi_sound.sv:221 The sound path is matched against MAME over two minutes of rdft2 attract (PLAN.md 14) and that measurement, not a compile, is what says this swap is sound -- so the thing it replaced should still be there to go back to.
- rtl/spi_soundflash.sv:110 Everything the counters above can see says the write happened -- `dbg_progs` counts at ISSUE and matches MAME's command total exactly, `dbg_drops` is zero -- and replaying the updater's real writes through this module reproduces MAME byte f
- rtl/ymf271_synth.sv:90 This matches MAME; it is not independently confirmed.
Says it was translated, ported or taken from MAME — 1
- README.md:17 It was built based on mame seibuspi.cpp and some reference documentation/datasheets of the OPX sound chip.
Keeps a MAME approximation — 1
- rtl/spi_mixer.sv:31 MAME's own table is an approximation (its TODO says as much); we reproduce it exactly rather than inventing something different.
Shares text with the MAME driver without saying so — 42
- rtl/spi_spr_decrypt.sv:51 key(t, addr) = bit(key_table[addr & 0xFF] >> 4, t) — shares text with seibu/seibuspi_m.cpp:111
- rtl/spi_tile_decrypt.sv:35 MAME: bitswap<24>(val, 18,19,9,5, 10,17,16,20, 21,22,6,11, — shares text with seibu/seibuspi_v.cpp:44
- rtl/ymf271.sv:206 edge or not: P-47 Aces writes KON=1 onto already-keyed slots for note — shares text with devices/sound/ymf271.cpp:336
- rtl/ymf271.sv:334 The End flags are cleared by READING them. Brave Blade copies the — shares text with devices/sound/ymf271.cpp:631
- rtl/ymf271.sv:335 status registers to RAM every ~100 us and frees a PCM channel when it — shares text with devices/sound/ymf271.cpp:632
- rtl/ymf271.sv:337 on that slot from the stale copy. Placed before the engine's set below — shares text with devices/sound/ymf271.cpp:634
- rtl/ymf271_synth.sv:35 lower slot number are taken from the current frame, higher-numbered ones — shares text with devices/sound/ymf271.cpp:1070
- rtl/ymf271_synth.sv:83 right (MAME's spi(): add_route(0,"speaker",1.0,0) and (1,...,1)); the — shares text with seibu/seibuspi.cpp:1837
- rtl/ymf271_synth.sv:110 address -- NOT once per loop. Drivers play one-shot samples as a short — shares text with devices/sound/ymf271.cpp:972
- rtl/ymf271_synth.sv:111 silent loop and free the channel from a copy of the status register, so — shares text with devices/sound/ymf271.cpp:973
- rtl/ymf271_synth.sv:112 re-raising End on every pass of that loop kills a note re-triggered on — shares text with devices/sound/ymf271.cpp:974
- rtl/ymf271_synth.sv:113 the same slot between the copy and the free pass. — shares text with devices/sound/ymf271.cpp:975
- rtl/ymf271_synth.sv:596 Only the twelve slots of groups 0/4/8 -- slot % 4 == 0 -- can fetch — shares text with devices/sound/ymf271.cpp:16
- rtl/ymf271_synth.sv:636 rate2 is 2*AR/D1R/D2R or 4*RR; rate 0 means infinite and never advances. — shares text with devices/sound/ymf271.cpp:285
- rtl/ymf271_synth.sv:667 Table 2-6-2 as a clock divider: one of 128 steps every K samples, — shares text with devices/sound/ymf271.cpp:802
- rtl/ymf271_synth.sv:668 K = (32 - (n & 15)) << (14 - (n >> 4)) below 240 and 16 - (n & 15) above, — shares text with devices/sound/ymf271.cpp:803
- rtl/ymf271_synth.sv:697 attenuation at key-on and the saw and triangle come down from there -- — shares text with devices/sound/ymf271.cpp:842
- rtl/ymf271_synth.sv:698 the OPM convention, and ymfm's reading of the manual's figures. — shares text with devices/sound/ymf271.cpp:843
- rtl/ymf271_synth.sv:706 AMS depth: 63 / 126 / 252 units of 0.09375 dB. — shares text with devices/sound/ymf271.cpp:1108
- rtl/ymf271_synth.sv:864 OPM's feedback law on the average of the last two outputs; the S3->S1 — shares text with devices/sound/ymf271.cpp:1092
- rtl/ymf271_synth.sv:865 loop of algorithms 1/5/7/11 follows the same law. Level 0 is off. — shares text with devices/sound/ymf271.cpp:159
- rtl/ymf271_synth.sv:878 f = 2 * fnum * 2^(block-7) * MUL * fs / 2^15, which is fnum << (block+11) — shares text with devices/sound/ymf271.cpp:857
- rtl/ymf271_synth.sv:879 times MUL with detune added in units of fs/2^20 before the multiplier. — shares text with devices/sound/ymf271.cpp:858
- rtl/ymf271_synth.sv:880 The external-waveform form is the same PG with the implicit F-number bit — shares text with devices/sound/ymf271.cpp:889
- rtl/ymf271_synth.sv:885 is how increments above fs/2 alias (the hi-hat carriers of the Seibu — shares text with devices/sound/ymf271.cpp:881
- rtl/ymf271_synth.sv:886 titles are fed by such a modulator). — shares text with devices/sound/ymf271.cpp:882
- rtl/ymf271_synth.sv:943 (v * exp[(env & 63) << 2]) >> (11 + (env >> 6)); 64 attenuation units are — shares text with devices/sound/ymf271.cpp:989
- rtl/ymf271_synth.sv:950 waveform 6: no phase dependence at all. A DC level of half scale plus the — shares text with devices/sound/ymf271.cpp:1126
- rtl/ymf271_synth.sv:952 a hi-hat carrier emits its own modulator, up to 2.5x the range of every — shares text with devices/sound/ymf271.cpp:1129
- rtl/ymf271_synth.sv:1000 x * (1 or 0.75) >> (L >> 1), and L >= 13 is silence. The old core's — shares text with devices/sound/ymf271.cpp:1044
- rtl/ymf271_synth.sv:1039 (table 2-6-8: rate 63 is 0.07 ms). The attenuation otherwise continues — shares text with devices/sound/ymf271.cpp:299
- rtl/ymf271_synth.sv:1048 Acc On: a running sum that saturates at the operator's own range, so any — shares text with devices/sound/ymf271.cpp:1146
- rtl/ymf271_synth.sv:1049 sustained tone rails into a full-level square that flips at the — shares text with devices/sound/ymf271.cpp:29
- rtl/ymf271_synth.sv:1050 operator's zero crossings. Cleared at key-on and when the EG goes off. — shares text with devices/sound/ymf271.cpp:1150
- rtl/ymf271_synth.sv:1206 edge or not -- P-47 Aces writes KON=1 onto already-keyed slots for — shares text with devices/sound/ymf271.cpp:336
- rtl/ymf271_synth.sv:1380 by End-Loop, so a looped sample's period is exactly End-Loop words — shares text with devices/sound/ymf271.cpp:892
- rtl/ymf271_synth.sv:1385 End is raised once per key-on, not once per pass. Drivers play — shares text with devices/sound/ymf271.cpp:971
- rtl/ymf271_synth.sv:1386 one-shot samples as a short silent loop and free the channel — shares text with devices/sound/ymf271.cpp:972
- rtl/ymf271_synth.sv:1387 from a copy of the status register; re-raising it would kill a — shares text with devices/sound/ymf271.cpp:973
- rtl/ymf271_synth.sv:1388 note re-triggered between the copy and the free pass. — shares text with devices/sound/ymf271.cpp:975
- rtl/ymf271_synth.sv:1444 EXT1 = CH4/5, EXT2 = CH6/7. EN enables them and EXT Out is a — shares text with devices/sound/ymf271.cpp:1172
- rtl/ymf271_synth.sv:1456 writes it is the head itself, or S3 for the loop algorithms. — shares text with devices/sound/ymf271.cpp:698