# Hardware quirks, revision differences, and open questions What the Manual does not say, or says wrongly, with the source for each and its tier ([validation.md](validation.md)). A board should make the revision differences fields of its machine description, each with a comment naming its source, the way sms-python does. ## Models and revisions | Difference | Where it shows | Source | | --- | --- | --- | | VDP 315-5313 versus 315-5313A (a manufacturing change) | "around 30% of Model I and 5% of Model II systems experience issues" with Overdrive 2 | Overdrive 2's readme (inside `titan-overdrive2.zip`); Kabuto, "Plane masking instability": "VA4 and prior use this chip, while VA6 and higher use the 5313A or newer", unreliably | | YM2612 (NMOS, discrete) versus the ASIC-integrated FM (YM3438-like) | the DAC's crossover distortion ("ladder effect"); BUSY readable from port 0 only on the discrete chip; DAC output held versus pulsed | HardWareMan's oscilloscope traces and Aly James's `MD1_LADDER.wav`; Eke, forum t=386 start=810; Kabuto, "The YM2612" | | Audio circuit | Model 1: first-order filter; Model 2: second-order, more distortion, "noisy, muffled and heavily distorted" | Kabuto's measurements of several MD1s and MD2s; MDFourier's 21-board recordings | | TMSS | a nonzero hardware version (from Model 1 VA6) has the boot ROM and the $A14000 lock | Manual PDF page 94; TmEE's dumps of several chips agree (forum t=3197) | | Genesis 3 VSRAM | a different VSRAM size makes it fail several of Nemesis's VSRAM tests | Nemesis, forum t=1291 start=30 | | Version register | bits 7–6 region and video standard; bits 3–0 the hardware version | Manual PDF page 84 | ## The bus and memory map 1. **Open bus returns the next prefetched opcode word**, for unmapped reads, the unused VDP addresses ($C00018–$C0001E), and the top six bits of the status register; "every now and then, probably when there are bus delays / z80->ROM accesses, a value of $FFFF is read" (Kabuto, "The VDP ports"; CMD `gen-hw.txt` section 1). Through the Z80's bank those bits read as 1 (CMD). 2. **Lock-ups**: accessing $800000–$9FFFFF without a 32X, a VDP address outside its mirror pattern, the HV counter by writing, the PSG by reading, or $7F20–$7FFF from the Z80 locks the machine (CMD). A board may treat these as halts and report them. 3. **The Z80 reading 68000 RAM through the bank fails; writing works** (MoD's `gen_test_z80_bus`, "writes always worked and reads always failed", tested on several machines; CMD saw $FF). Steve Snake told CMD reads work on some models: no evidence here supports that. 4. **The Z80 reading $A00000–$A0FFFF through the bank locks up** (CMD; MoD's test). 5. **68000 access to Z80 space while the Z80 holds its bus or is in reset** reads the prefetched opcode and ignores writes; the I/O area stays accessible (CMD 2.2). 6. **TAS**: the Genesis bus drops the write half of `TAS` (m68000-python's `docs/undocumented-behavior.md`; it exposes a `tas_write` hook for this). 7. **Refresh slow-down**: 2 of every 128 68000 cycles, not while writing to the VDP; work RAM has an extra slow-down Kabuto did not measure ([timing.md](timing.md)), now measured on the die (item 13). Separately, **every 68000 access to $A00000-$A0FFFF is one 68000 clock longer**: nothing hardware says so, but Nuked-MD holds every such bus cycle 7 MCLK and MAME charges the same clock (`before_delay(1)`, "TODO: unverified"). The board charges it since the timing session (open item 16). **A refresh landing on such an access costs one clock more, not the cartridge's two, and none if it fell due within the last 68000 clock before /AS** -- used up all the same. Nuked-MD, Overdrive 2's start-up copying its sound driver into Z80 RAM: of 519 refreshes on those writes, 392 held the write 7 MCLK and 127 held it not at all, every one as the rule says ([worklog.md](worklog.md), "The access-timing table, and what the slip turned into"). Die-derived; nothing hardware covers it. 8. **The bank register** is written a bit at a time; the result of a partial sequence is unknown (CMD could not find it). 9. **The reset button is not a power cycle.** It pulses VRES#, which goes "to 68000 and cartridge connector": "the 68k RESET pulse is asserted for 128 VCLK", with /HALT, and "!ZRES is held low at the same time ... but remains low after that until software enables it again", so the Z80 and the YM2612 stay in reset until the game writes $A11200. SRES#, which resets the VDP and the I/O chip, "is only asserted on a cold boot". Hardware measurements by Charles MacDonald and Eke (forum t=1262). The board does exactly that (``System.press_reset``). Not modelled: the switch-to-pulse delay, "Minimum is 2.1ms" and variable; what a cartridge's own board does with VRES# (none of these sources says). 10. **The Z80's clock runs on through a bus hold or a reset, and it takes its bus back on that clock.** On Nuked-MD every Z80 access falls on one phase of its 15-MCLK clock; after the 68000's write that ends a bus request the next access comes on the first such edge at least 42 MCLK after the write began, after a reset release 57. With the bus already requested at a reset release the Z80 still fetches its first opcode first. Its accesses to the VDP go through the 68000's bus arbitration like those through the bank window (held 60, 75 or 90 MCLK). Die-derived ([worklog.md](worklog.md), "The Z80 after a hold"). 11. **The reset button restarts the 68000's refresh** -- *a supported finding, not a proven model*. On Nuked-MD no cartridge read is refresh-stretched before the reset and every one after it lies 0-28 MCLK past a multiple of 896 from the pulse's start; a pending work-RAM refresh is cleared, the first refreshed RAM access coming 2,352-2,408 MCLK after the pulse's start. With both the board's 68000 bus cycles match the die's four to five times more closely after a reset; the Overdrive 2 picture 7,000 frames on matches it less well, a downstream measure also moved by the die's Z80 caveat. The work-RAM refresh's rule after the reset is not settled. `system.RESET_RESTARTS_REFRESH` (Aubrey's decision, [worklog.md](worklog.md) Session 14); the OD2 harnesses' `--no-refresh-restart` runs the board without it. 12. **A Z80 bank read costs the 68000 only the bus time it wanted.** Kabuto's "average 68k delay is around 11 68k cycles" and MoD's measurements are of a 68000 always on the bus. Inside a multiply or another long internal operation it is not, and on Nuked-MD a read granted then costs it only what runs past the operation: in Overdrive 2's 3D scene 13-clock charges are 6 % of the Z80's reads on the die, where charging from four clocks after the 68000's last cycle gave 28 % and put its 68000 about 10,000 MCLK a frame behind. Die-derived; `board.Z80_GRANT_OVERLAPS_IDLE` ([worklog.md](worklog.md), "The ninja's arm colours"). 13. **The work-RAM refresh is hidden when the RAM is idle.** It falls due 819 MCLK after the last one began; a work-RAM access within 98 MCLK of that takes it and waits 3 68000 clocks, and if none comes it runs by itself 112-133 MCLK after, an access then waiting for its end (7-35 MCLK, on a 68000 clock edge). A 68000 that leaves the RAM alone pays nothing. Nuked-MD, 135,937 work-RAM accesses in Overdrive 2's 3D scene, every stall predicted exactly but 172 (153 a refresh one clock early, an unsettled clock-domain effect). Die-derived; `board.RAM_REFRESH_HIDDEN` ([worklog.md](worklog.md), "The work-RAM refresh"). ## The VDP 1. **The sprite cache.** The Y position and size/link fields of each sprite are cached inside the VDP and updated only by VRAM writes that land in the current sprite table; moving the table does not refresh the cache, and the check spans 128 KB even in 64 KB mode (Kabuto, "Precise details of sprite rendering"). Games and demos that move the table show stale sprites on hardware. 2. **Sprite rendering phases** (Kabuto): visibility is decided two lines ahead from the cache, X and pattern fetched one line ahead, pixels drawn during the preceding horizontal blank into a 320-pixel buffer. A sprite with X = 0 following one with X ≠ 0 masks the rest of the line; the masking has other conditions Nemesis's sprite masking ROM checks on an MD1600. 3. **Shadow/highlight**: Kabuto's rules ("S/H") correct the Manual. Sprite colours 62 and 63 (palette 3, colours 14 and 15) highlight and shadow what is beneath instead of being drawn; a sprite over low-priority planes is darkened unless it is colour 14, 30 or 46 (colour 14 of palettes 0–2), which he reads as a leftover of a design change. The DAC levels in S/H are not exact halves and doubles (Plutiedev `vdp-color-ramp`; CMD's `ste.txt` is idealised). 4. **V28/V30 border trick**: switching to V30 during the active display and back before line 240 makes the VDP forget the bottom border, giving up to 243 stable lines on NTSC (Kabuto, "V28/V30 tricks"). 5. **CRAM dots**: a CRAM write during the display shows the written colour for a pixel at the access slot's position. BlastEm emulates it (``vdp.c`` ``write_cram``, lines 443-451: it puts the newly written colour into the one output pixel of the current slot), and is the only implementation pinned here, so this is emulator-derived. Kabuto's "Access timing" says which slots fall in visible pixels; he describes the dots only in passing ("Writing the debug register can also cause a glitched pixel, similar to a CRAM dot") and never says what colour one shows. Modelled in milestone 5. 6. **The debug register** $C0001C: layers can be forced, disabled or mixed, and the PSG can be made louder; writes can corrupt VRAM, sprites and reads. Overdrive 2 depends on parts of it (Kabuto, "The mighty debug register"; CMD `newreg.txt`). 7. **The control port is not latched**: a register write triggered by the top two bits of the first word; a DMA triggered by bit 7 of the second; a read set-up fetches immediately, and an immediate control write after a VRAM read can AND the register number and value with the address (Kabuto, "The VDP ports"). 8. **Register $17 with bit 7 clear** sets a flag that crashes the machine if a VRAM address is then set before a DMA runs (Kabuto). 9. **A CRAM DMA wrapping a 128 KB boundary does not abort** ("definitely wrong", Kabuto, of a claim elsewhere). 10. **Mode 4 on the Mega Drive VDP** differs from the SMS's: no sprite doubling, no 224/240-line modes, 4 bytes fetched per slot of which 2 are used, all 64 sprites scanned, the background starting 12 slots later, different interrupt timing, a broken plane B and a broken H40 in Mode 4 (Kabuto, "Mode 4"; MoD, forum t=2557; SMS Power's `VDPRegisters` page). 11. **Plane masking instability**: some layer-masking behaviour differs between consoles and power-ons (Kabuto, "Plane masking instability"). 12. **The window plane's column-fetch bug** at its left edge (CMD's capture photos in `md_tech.zip`, `mdpic.htm`; `wbug.bin` in `md_test.zip`). 13. **H40's long pixels move around VSYNC** (found in Nemesis's captures, milestone 2): on the nine lines ending on V = jump + 5 the second run of long sync pixels ($1DE-$1ED) lasts 8 MCLK and $09F-$0AE take the long lengths instead; in an interlaced odd field the two sets of lines are offset by one, making one line 30 MCLK longer and one 30 MCLK shorter. No emulator table has it ([timing.md](timing.md), "What the captures say"). 14. **A read that lands as a counter steps** sees a mid-change value, and the two captured consoles differ there (a ripple counter caught part-way; the PAL Model 1 and the NTSC-J Model 1 at slightly different phases, and each varying between runs). Details and the board's choice in [timing.md](timing.md). 15. **In mode 4 a register write clears the F flag**: every capture's first run after power-on (the VDP still in mode 4) reads F clear until its first VBlank, every later run reads it set; Nuked-MD shows the mechanism (any register written in mode 4 clears F; written in mode 5, not). 16. **Interlace mode 2 addresses patterns by the name's low ten bits times 64**, not by "bit zero of the name is ignored" as CMD's `genvdp.txt` says: Exodus (`CalculatePatternDataRowAddress`), Genesis Plus GX (`GET_LSB_TILE_IM2`) and MAME (`get_nametable`, `m_imode == 3`) agree against him, and CMD's own `wtest_i2.bin` renders correctly only the other way (milestone 3). 17. **The window's column-fetch bug hits the partial column** the fine horizontal scroll puts before plane A's first whole 2-cell column, so that column repeats the two cells of the column after it (CMD's diagram; Genesis Plus GX reads it the same way, MAME differently -- the two disagree by 112 pixels of `wbug.bin`). 18. **In shadow/highlight mode the backdrop is darkened too**, wherever both planes are low priority: Kabuto ("If both A+B are low prio, the visible color becomes shadowed", with G in his mixer), CMD's `ste.htm` and Genesis Plus GX all say so; MAME's backdrop stays at normal intensity, which is most of what the board and MAME differ by on the S/H test ROMs (milestone 3). 19. **An idle line has one access slot fewer per refresh, not two.** Exodus's ``GetPixelClockTicksUntilNextAccessSlot`` jumps from a refresh block's start to six pixels past it, losing two slots each and leaving 161 (H32) and 198 (H40) slots on a line with the display off. Kabuto's access pattern has one ``r`` per group, and the Manual's DMA transfer capacity table (PDF page 44) gives 167 and 205 bytes a line in blanking, which is 171 - 4 and 210 - 5: one slot per refresh. The board follows the two hardware-tier sources, which puts its DMA rates on Kabuto's measured formulas and reproduces the Manual's whole table ([timing.md](timing.md); milestone 5). 20. **Where a mid-line write lands: tiles are fetched ahead, colours come out behind.** The VDP fetches each 2-cell group's tiles on a fixed schedule and outputs the pixels later, and a change reaches the picture through whichever stage it acts on. Nuked-MD (die-derived) gives both, and Kabuto measured one point of the second. - **The fetch.** For group g, in the die's H counter: plane A's name at 16g + 3 and its two pattern rows at 16g + 7 and 9; plane B's name at 16g + 11 and patterns at 16g + 15 and 17; group -1, the partial column fine scroll brings in, in the blank before the display. The same in H40 and H32. Read off the die's own VRAM accesses (``scripts/run_fetch_schedule.py``). So a write to a name table reaches only the groups whose name is fetched after it -- about 21 pixels ahead of their output -- and a pattern write only the cells whose pattern is. - **The output.** The colour is looked up 24 of the die's H counts behind it: a CRAM write committed at h shows from pixel h - 24 (153 of 154 lines in H40, 155 of 158 in H32; ``scripts/run_output_delay.py``). Register 7, the backdrop index, shows at the same place, and changes the rest of its line. - **The counters.** The die numbers H40's pixels three above the board's (the board's slot $042 is its $045), so in the board's terms the output runs 21 pixels behind in H40 and 24 in H32, which puts H40's slot $012 at X = -3 -- Kabuto's "the next one happens at the pixel with X=-3 (display area coordinates)" ("Access timing"), a hardware measurement the die agrees with. The board renders in the same two stages (``render.FETCH_AT``, ``render.OUTPUT_DELAY``): at any change it first fetches every tile whose time has come, from the state before the change -- for a change to a name table or to the plane registers, every tile whose name has -- and then mixes up to where the output has got to. It used to do both at the one moment, at the pixel the H counter named: right for patterns in H40 by coincidence, 8 pixels late for them in H32, a slot late for names in both, and 21 or 24 pixels late for colours. Against the die on its test cartridges it now differs only on lines where the 68000's write reached a different access slot. The horizontal scroll table is read at die H $1E9, in the blank, where the board reads it as the display begins: not yet modelled. 22. **Register $00 bit 0 turns off display generation altogether**, which is not the same as blanking: "Setting bit 0 actually turns off all display generation, as opposed to the screen blanking feature which simply shows the backdrop color" (CMD ``genvdp.txt`` 17). The board draws such a line black, whatever CRAM holds, and models nothing else about it (the sprite and plane fetches still happen). r57shell's "VDP Blink Test (Reg 0 bit 0)" is what makes it visible; without it that test showed nothing at all, which is why milestone 7 added it. What colour a console actually puts out with all generation off is not in any pinned source. 21. **A VSRAM read past its 40th word** returns the last word the renderer read from VSRAM, which follows the H counter (the column's entry, or the first two in full-screen vertical scroll; entries $26 AND $27 past the end): Exodus's model, which VDPFIFOTesting's DMA Fill to VSRAM tests judge. A Genesis 3, with 64 words, returns the words themselves and fails those tests. 23. **Full-screen vertical scroll is latched once a line, at the end of the line before; 2-cell column scroll once a line, column by column.** Plane A's word at internal H $149 and plane B's at $143 in H40 ($109 and $103 in H32), the last pixels before the V counter increments; display line v is drawn from what was latched on line v - 1, and a VSRAM write made during a line -- including in the horizontal blank that precedes its display -- reaches the picture only on the line after. Measured on Nuked-MD, which is **die-derived** and judges here because nothing hardware-captured covers the question: its two VSRAM-to-scroll latches (``l184`` for A, ``l185`` for B) change at those counts on 640 of 640 lines, no line of its picture changes plane row part way along, and 224 of 224 lines show the latch of the line before (``scripts/run_vscroll_latch.py``). Neither emulator source settles it: BlastEm latches at one H40 slot and says it is untested ("TODO: Develop some tests on hardware to see when vscroll latch actually happens for full plane mode", ``vdp.c`` 3611), and Nemesis "believe[d]" it is re-read at every mapping slot, also untested (forum t=1291). The board read VSRAM as it stood whenever it drew, so a write early in a line split that line in two; Overdrive 2's fractal zoom (frames 7,066-7,598) writes VSRAM every line and was drawn chopped because of it. **In 2-cell column mode each column's word is latched once a line, during the line itself**, as the column is fetched: plane A's column k at the die's H counter 16k + 1 and plane B's at 16k + 9, in both modes, and display line v shows what counter line v latched (224 of 224 lines for columns 0, 10 and 19 in H40 and 0, 8 and 15 in H32; ``scripts/run_vscroll_columns.py``). In the board's H40 counter that is 16k - 2 and 16k + 6 (the die counts three above it, item 20), so plane A's column 0 is latched in the blank just before the display. A write landing after a column's latch reaches it on the next line; one landing before reaches the whole column -- including, for plane B, a write that lands after the board has begun drawing the column, since the die outputs it about 21 pixels later (item 20), after its latch. The board read the column's word as it stood whenever it drew and split such columns in two (7 to 20 of 224 lines on the test cartridge; none since). Not measured: interlace mode 2, and a line with the display off. 24. **The command address is 17 bits, and the sprite cache compares all of them.** In mode 5 the second control word's bits 2-0 are address bits 16-14 (the Manual shows bit 2 as 0), and the auto-increment carries into bit 16 and wraps at 128 KB. With the usual single 64 KB VRAM a write lands at the address modulo 64 KB, but the sprite cache's check "is sensitive to the entire 128 KB address range even in 64 KB mode, so when setting bit 16 for the sprite table address but not for the Write/DMA target address (or the other way round) the sprite table in memory will get updated but the cache won't" (Kabuto, "Precise details of sprite rendering"; **hardware-measured research**, and the author of the program below). Nuked-MD (die-derived) has the same register: ``reg_addr`` takes ``io_data & 7`` into bits 16-14 on the second word in mode 5 (``vdp.c`` 947-951) and increments ``& 0x1ffff`` (926-927). BlastEm keeps the same three bits (``vdp.c`` 5943); Exodus, which the board's port logic was written from, keeps 16, and so did the board. **Overdrive 2's rain depends on it**: the scene (frames 4,117-5,100) draws its rain as 70 sprites of 32x32 in palette 3, highlight and shadow operators over the whole screen, and every frame it writes zeros over the Y and size/link words of every fourth entry through **$10000**, so VRAM's table breaks the chain at sprite 0 while the cache keeps it. The board dropped bit 16, took the writes as $0000, broke the cache's chain too, and drew no rain. Now 101 of 101 frames sampled over 4,100-6,600 draw exactly BlastEm's picture where the scene is the rain ([worklog.md](worklog.md), "The rain"). Not settled, and Overdrive 2 does not decide it: which address a **128 KB-mode** write is checked against. Kabuto's "if the formula above happens to spit out an address that happens to be covered by the sprite cache it will get updated" reads as the rearranged address, which the board uses; BlastEm checks the address as written and stores both bytes. The demo's pictures are identical either way. 25. **The sprite line buffer keeps a transparent pixel's palette, and a line's sprites are read a line ahead.** Kabuto, "Precise details of sprite rendering" (hardware-measured research): the buffer holds "7 bits per pixel: colour ..., palette, priority", and "only transparent pixels (i.e. the 4 bits that come from tile data are 0; palette and priority are ignored for this check) will get overwritten with the 7 bits from the current sprite ... with certain debug flags set, transparent pixels' palettes ... play an important role because these are always overwritten so the sprite which contributes last wins". And phase 1 scans the cache "2 H-borders before the raster line to be rendered", phase 2 reads X and pattern "1 raster line before". The board kept opaque pixels only and ran all three phases as the line began. **Overdrive 2's ring scene** (frames 6,540-7,060) shows both: with the debug register's sprite plane forced on (bits 8-7 = 01), its blue and magenta rings are palette entry 0 of transparent sprite pixels, and it points register 5 at another table in the blank before its last line, after that line's sprites were read. The board now scans (phases 1 and 2) when the line before begins and draws (phase 3) when the line begins; a line nothing scanned for is scanned as it begins, as before. Line granularity only: phase 2's reads are taken at the start of the line before, not slot by slot. Not measured: a transparent pixel's priority in shadow/highlight ("sometimes", Kabuto), and what a line after a display-off line gets (Kabuto: "No sprites are checked while display is disabled"). 26. **A transparent plane pixel keeps its tile's priority and palette.** Shadow is decided by the planes' tile priority whether or not their pixels are transparent: "If both A+B are low prio, the visible color becomes shadowed", and "sprite darkness depends on plane tile priority, even when all plane tile pixels are transparent" (Kabuto, "S/H"; hardware-measured research). BlastEm's ``render_map`` keeps palette and priority on every plane pixel, and its ``composite_highlight`` takes each plane's priority without a transparency test. The board dropped both for a transparent pixel, so plane B showing through a high-priority transparent tile of plane A was shadowed. **Overdrive 2's scene at frames 9,750-10,125** (the shaded boxes and quads; Aubrey's "gray box missing a kind of gray") is built that way: all 16 sampled frames went from 0-95% of BlastEm's picture to identical. The palette shows where the debug register forces a plane on: palette entry 0 of the tile's palette instead of the backdrop, as BlastEm draws it. Opacity is still the colour bits alone everywhere. 27. **The vertical border starts only if the V28/V30 mode in force as the V counter reaches its line says so.** "When switching between V28 and V30 the only thing that changes are the raster lines in which to switch vertical border / vblank / vsync ... When switching to V30 within active scan and back to V28 after line 224 but before line 240 then the VDP will 'forget' to start the vertical border and keep display active all the time ... the VDP tests it constantly, so having V28 active for a single VDP cycle during line 224 or V30 for line 240 will start the border ... When opening the vertical border this way HIRQ runs continuously and is not reset before the start of each frame" (Kabuto, "V28/V30 tricks"; hardware-measured research). BlastEm does the same: it enters its border state only when the V counter equals ``inactive_start``, which follows register 1 live (``check_switch_inactive``, ``update_video_params``), and reloads the H interrupt counter only outside the active state. The board latched V28/V30 at the blanking line of the mode already latched, after Exodus, so the trick did nothing: the border started at 224 regardless and the H interrupt counter was reloaded through it. Now ``VDP.border`` holds the border, started at the line where the V counter meets the live mode's blanking line (or by a register 1 write during that line), ended at line 0; the access slots, the status VBlank bit, the H interrupt reload and whether a line is drawn follow it. The V counter's sequence, VSYNC and interlace keep the mode latched at the blanking line, as before -- the model Nemesis's HV captures (hardware-captured) were fitted against, and they are unchanged to the word with the live border. Whether the counter's jump would follow the live bit too is not tested here. **Overdrive 2's arcade scene (frames 12,154-12,960)** switches to V30 at line ~207 and back at ~225 every frame and runs a 313-line chain of H interrupt handlers whose last one releases the main loop. On the board the chain fell out of step, so the loop ran every 1.4 frames, the demo fell 330 frames behind by 13,300 (Aubrey saw it as a hang), and its vertical-blank DMA landed on visible lines. Now the 32 sampled 240-line frames of the scene are BlastEm's picture to the pixel and the demo stays in step into the next scene. Not settled: **whether VINT fires on a frame whose border never starts.** BlastEm raises it from its border state only, so not; Kabuto says "vblank still works normally", which may mean VSYNC only. The board follows BlastEm (``VINT_WITHOUT_BORDER = False``), and Overdrive 2's pictures are identical either way. A die-model measurement would settle it. Also not measured: the display's lines 240 and on in an open-border frame are not drawn (they fall in the TV's blanking), and a border started part way along a line takes effect from that line's next slot. 28. **The data port's read-ahead hands a word over late, needs lead time, and skips H40's $142.** A read that waits for the buffer is released 45 MCLK after the slot that fills it, not at the slot; a slot fills the buffer only if the read that emptied it began at least 21 MCLK before; and in an active H40 line the slot at H $142 fills no read. Measured on Nuked-MD with bursts and pairs of CRAM, VSRAM and VRAM reads swept across the line (`scripts/run_read_slots.py`). Overdrive 2's boot, which polls vblank once per pass of a CRAM readback, depends on it: without the rule the board reaches the Z80's start 4,182 MCLK late against its own vblank, with it 57 MCLK early, and the demo's one-frame slip moves from 6,981 to 7,095 ([worklog.md](worklog.md), Session 14). Die-derived. VDPFIFOTesting's "FIFO Wait States" fails with it every time; on the die that test passes once per ~800 iterations, so it cannot judge the rule and is counted with Nemesis's intermittent tests. ## The pads and the I/O chip 1. **The 6-button pad's timeout has no one value.** It is a capacitor discharging, and Terakawa says so in as many words: "It seems that the time is measured by discharging of a capacitor in a 6-Button-Controller. It may mean parameters differ one by one controller. Please choose values you think proper for parameters." The four published figures do not even measure the same quantity: CMD (`gen-hw.txt` 3.2) times out "about 8192 (probably less than that) 68000 CPU cycles" (1.07 ms) after TH was last *modified*; Terakawa gives 1.1 ms for the second up-edge to arrive, 1.6 ms for the data to stay readable and 1.8 ms before the sequence may start again, all from the *first* up-edge; MAME 0.285 uses 1.5 ms from the last rising edge (`bus/sms_ctrl/md6bt.cpp`). The board takes CMD's shape and figure as a field (`io.Pad6.timeout_mclk`) and claims nothing: a poll takes a few microseconds and a game polls once a frame, so all four reset the pad between frames and none resets it inside one. 2. **D4 and D5 in the extra-buttons phase carry B and C**, not a fixed high. CMD writes the phase as `?1CBMXYZ`; Terakawa's table shows "HI HI" there, which is those two buttons released. MAME's pad agrees with CMD (`md6bt.cpp`, `case 3`). The board follows CMD, and `scripts/run_pads.py` checks every one of the 4,096 button combinations through the whole sequence. 3. **After the fourth rising edge the pad is a 3-button pad again**, until the timeout: "From this point on, the standard 3-button pad values will be returned if any further TH transitions are done" (CMD). MAME instead wraps its counter modulo 4, so its pad starts the sequence again on the fifth edge. Nothing pinned settles which is right; the board follows CMD, who checked his on hardware. 4. **MAME cannot be used as a detector for the 6-button pad.** Its pad reads its own MODE switch in `device_reset`, and its comment says that does not work -- "TODO: doesn't work - reset happens before host inputs are read for the first time" -- so `-ctrl1 md6button` leaves the pad in 3-button mode. r57shell's `joy_speed` prints "3 Buttons Pad" for it, and for the board it prints the same although the board's own read sequence is the 6-button one (docs/worklog.md, milestone 7). ## The YM2612 1. **BUSY**: set only by data-port writes, for 32 internal clocks (32 × 6 68000 cycles), the same on both chip types; readable from any port on the ASIC but from port 0 only on the discrete YM2612, which is why Hellfire's music runs slow on a Model 2 (Eke, forum t=386 start=810). "The YM2612's busy flag is useless as already documented elsewhere" (Kabuto) is about relying on it, not about its timing. 2. **Write speed**: registers $30–$FF live in a rotating shift register; wait about 33.6 Z80 cycles between writes (Kabuto). A Z80 word write of address and data is too fast for the chip. 3. **The DAC**: 9 bits, with a visible jump between $7F and $80 on the Model 1, mostly gone on the Model 2; the "loud PCM" debug bit amplifies about 5× (Model 2) or 30× (Model 1) (Kabuto). 4. **The ladder effect** (crossover distortion) is a YM2612 property the YM3438 lacks. Nuked-OPN2 models the YM3438 and has a YM2612 mode flag ("MD1, MD2 VA2"); YM2608-LLE models the YM2612 from its die. 5. **Test register**, CSM, SSG-EG: Nemesis's test ROMs and recordings ([validation.md](validation.md)); the early pages of the YM2612 thread were corrected later in the same thread (phase generator at start=165, envelope generator at start=405): cite the corrections. 6. **The two die-derived models disagree about where in a channel's four cycles the sample is driven** (found in milestone 4). The six channels are multiplexed onto MOL/MOR four cycles each. YM2608-LLE -- a transcription of the *YM2612's* die -- drives the channel's value on the first of the four and the bare sign (+1 or -1) on the other three (`fmopna_impl.c` lines 5824-5853). Nuked-OPN2 is a transcription of the *YM3438's* die with a YM2612 output mode its own comment calls "YM2612 DAC emulation(not verified)" (`ym3438.c` line 966); that mode drives the sign on three cycles and the value on the **last**. The 24 values of an output sample are the same multiset either way, so the sample at the chip's native rate is unaffected and nothing audible turns on it; the board follows Nuked-OPN2, and the difference is measured and recorded in [worklog.md](worklog.md). 7. **What a discrete YM2612's ports 1-3 read is not known.** Eke measured that the status answers on port 0 only on the discrete chip and on every port on the ASIC (forum t=386 start=810), but not what the other three ports give. Genesis Plus GX returns 0 (`core/sound/sound.c` line 152), which the board copies, labelled emulator-derived. A hardware read would settle it. 8. **The ladder effect is a property of the DAC's output stage, not of a filter.** The discrete chip adds 1 to every non-negative sample and drives +1/-1 in the gaps between channels, so the console's low-pass sees a step at the zero crossing (HardWareMan's oscilloscope traces; Aly James's `MD1_LADDER.wav`). The board carries it as `FMVariant.ladder` and it is what `ym2612ladder` differences in the referee comparison come from. 9. **Asserting /IC stops the chip for 12 FM clocks and then lets it run on, and whether its slot counter restarts depends on where in the slot the assertion falls.** Nuked-MD's FM (`fm.c` `FM_Prescaler`'s `ic_check`, and `fc1004.c`'s `i_fsm_reset`, three clocks late) restarts the counter at slot 0 only if a phase-1 clock comes while the reset holds: sampled 1-3 FM clocks into a slot it restarts; sampled 0, 4 or 5 clocks in it keeps its count and resumes at the slot under way two clocks later. Found by clocking the die's own `fm.c` through every position, and matching all three assertions in its Overdrive 2 run; releasing /IC resets nothing. So the chip's sample phase after a reset follows when the reset began, and, for a short pulse, what came before it. Die-derived. ## The PSG and the analogue path 1. **The attenuation ladder is not 2 dB a step.** Nuked-PSG's measured curve (`ympsg.c` line 7) gives 1.0, 0.772, 0.622, 0.485 ... where the ideal would give 1.0, 0.794, 0.631, 0.501. The board uses the measured one (`psg.VOLUME_LEVELS`); sms-python uses the ideal one, which is why the two boards' PSG levels differ slightly. 2. **The PSG's counter is an up-counter compared with the period**, reset to 0 and then incremented, not a down-counter reloaded at zero (Nuked-PSG `YMPSG_ClockInternal1`). The two differ for one tick after a period is written and for the periods 0 and 1. 3. **A PSG register write reaches the register on the clock after the write, or on the same clock** when that clock happens to be the second of the two internal phases, which updates the registers a second time (`ympsg.c` lines 208 and 285). Worth 19 samples in 102,569 on the first stream the board was compared on. 4. **No distortion model.** Kabuto measures the Model 2's amplifier as introducing "severe nonlinearities ... Distortion is quite high too, very well audible" and the Model 1's filter as first-order against the Model 2's second-order, but publishes no transfer curve and no corner frequency. The board low-passes (one pole for `model1`, two for `model2`) at a corner fitted to the MDFourier recordings and models no distortion at all, so its Model 2 output is cleaner than the hardware's. `src/megadrive_python/audio.py` says so where the constants are. 5. **The mixing ratio between the PSG and the FM** has no pinned number either; the board's is measured from the MDFourier recordings ([worklog.md](worklog.md), milestone 4). ## Cartridges 1. **Eke's NBA Jam entry has /SDA in and /SDA out on the wrong bits.** His `gen_eeprom.pdf` gives the Acclaim type 1 board `SDA_IN: 0x200001 (bit 0)`, `SDA_OUT: 0x200001 (bit 1)`, `SCL: 0x200001 (bit 1)`, which puts the data out and the clock on one bit and cannot be a board. MAME's own NBA Jam device reads /SDA at bit 1 and writes /SDA at bit 0 and /SCL at bit 1 (`bus/megadrive/eeprom.cpp` lines 606-628). **The game settles it**: with bit 1 the board writes its "Snake 1993" header once and, restarted with that EEPROM, reads it back and writes nothing; with bit 0 it cannot read its own save and rewrites all 256 bytes on every boot (docs/worklog.md, milestone 7). The board uses bit 1. 2. **MAME's `sram` data area is an address range, not a size.** `md_slot.cpp` sets `m_nvram_end = m_nvram_start + length - 1` and allocates that many bytes as 16-bit words, one per address the chip answers at, with the byte in *both* halves of each word. The chip itself is eight bits wide on the odd byte (CMD `gen-hw.txt` 4.3: Phantasy Star 4's "16k of battery backed RAM mapped to $200001-$203FFF. (odd addresses used)"), so it holds half as many bytes as the range is wide. The board keeps the chip's own bytes and halves the list's figure; `scripts/run_battery.py` unpacks MAME's file to compare, and checks that its words' two halves agree. 3. **A word read of battery RAM: what is on D15-D8 is not known.** The board reads $FF there (the chip drives only the odd byte and nothing else drives the bus); MAME returns the byte in both halves, because that is what it stored. No pinned source says. Nothing measured here depends on it: the games that save read bytes. 4. **Two EEPROM boards where Eke and MAME disagree, neither settled.** The Ninja Burai Densetsu *prototype* (`rom_eeprom`): Eke lists the game under Sega's mode 1 (X24C01) and MAME fits a mode-2 24C01; the board follows the research document. Brian Lara Cricket (`rom_blara95`): Eke gives it mode 1 with the Codemasters addresses, MAME puts all three lines on $380000-$380001 and fits a 24C65; the board takes MAME's addresses (they are what its code reads and writes) and Eke's chip. Neither game was run: both are in the local romset but neither writes its battery without being played. 5. **The J-Cart's two extra ports answer with nothing plugged in.** The board decodes $38FFFE and returns all pins high with bit 7 set (MAME `bus/megadrive/jcart.cpp` lines 150-160), which is an empty socket. Attaching pads there is a frontend's job and is not modelled. ## Known-wrong or superseded sources - **CMD `m5hvc.txt`**: "probably off by one or two". Superseded by Nemesis's captures. - **CMD `genvdp.txt`**: "very preliminary"; timing superseded by Nemesis, MoD and Kabuto; its S/H colour model is idealised. - **CMD `segasix.txt`** (Rosenberg, 1996): three select states and no timeout. Superseded by Terakawa's measurements and Plutiedev `controllers`. - **Rick McTeague's `genhw.txt`** (1993): early and incomplete. - **The Genesis Software Manual**: corrected by the Technical Bulletins; the two scans differ in page count (183 and 150). - **"CRAM DMA across a 128 KB page aborts"**: wrong (Kabuto). - **The YM2612 thread's early pages**: corrected later in the thread. ## Open items (no pinned source settles them) 1. **The Z80's interrupt length.** CMD says the IRQ comes at line $E0 and is missed if disabled; Genesis Plus GX holds it to the end of that line. No hardware measurement is pinned. A test that enables interrupts at a measured delay after the line starts would settle it. The board holds it for one line (Genesis Plus GX's choice, labelled): the only support for it is that Sonic The Hedgehog 3's 1,688 Z80 interrupts in 30 seconds all fall at the instruction MAME takes them at (milestone 1's lockstep). 2. ~~The H counter's position in MCLK~~: decoded from Nemesis's captures in milestone 2 ([timing.md](timing.md), "What the captures say"). Left open there: a few hundred status reads near the HBlank edges, four dumps. 3. **The delay from the F flag to the 68000's interrupt**: VDPTEST probes it without published hardware values. 4. **TMSS on Japanese consoles**: Nicole Express (2026) reports that a Japanese Model 2 enforces only the header check and a header-modified Hellfire failed on it and on a Genesis 3 while running on a VA3; one tester, not in Sega Retro. A lead to confirm, not a rule. 5. **The work-RAM slow-down** Kabuto saw but did not measure. The board's model (21 MCLK on the next work-RAM access once due, due again about 805 MCLK after) is Nuked-MD's, and reproduces the capture loop's rate. Milestone 6 measured it properly against the referee's own reported cycle lengths and the rule **does not generalise**: the 21-MCLK stretch is confirmed on every one of the several hundred stretches seen, but the re-arm period that reproduces the referee exactly is 806-819 MCLK in a dense work-RAM loop (which narrows the old 743-826 and excludes the board's 805), 694-699 in CMD's `wtest.bin`, and no value in 600-1400 fits Nemesis's capture ROM at any phase. The referee's stretches are not raster-locked either. So the re-arm timer is a fit to one access pattern rather than the machine's rule, and it is the largest single source of difference in milestone 6's ROM comparison (1,300-1,900 misplaced ticks per test ROM, each shifting the board's timeline by 21 MCLK and so moving the -- otherwise exact -- cartridge grid). Nuked-MD also varies the stretch (7/21/35 MCLK) in some loops, which the board does not model. **The timing session investigated it further, with a limit, and kept 805.** Three new facts, all read out of the referee's own reported bus-cycle lengths over eight traces (three dense probe loops of 300,000 MCLK and five test ROMs of 900,000): - **The stretch is not always 21 MCLK.** A work-RAM cycle can be stretched 7, 21 or 35 MCLK -- 1, 3 or 5 68000 clocks. In Nemesis's capture ROM 100 of 401 stretches are 7; in r57shell's `vdp_tests` 18 of 1,020 are 7 and 182 are 35. The board models only the 21. - **The rate varies by a factor of two and a half between programs.** In 900,000 MCLK `wtest.bin` shows 1,032 stretches (one per 872 MCLK) and the capture ROM 401 (one per 2,244), and the apparent period rises as work-RAM traffic thins: 845 MCLK where 44 % of bus cycles are work RAM, 871 at 29 %, 896 at 20 %. - **No free-running grid fits.** For a fixed grid of period *G* every stretch's time must fall in one narrow band of residues mod *G*; over 200-2,000 MCLK the tightest band any *G* gives is 70-165 MCLK wide, 8-18 % of the period, and no *G* is shared by two programs. Nor do the 4,546 stretches of all eight runs -- which share one power-on phase -- band together at any period. Five candidate rules were scored against the referee, each free to choose its own period and phase, counting how many of the referee's stretches it misplaces: | rule | dense probe (354) | `wtest` (1,032) | capture ROM (401) | `vdp_tests` (1,020) | | --- | ---: | ---: | ---: | ---: | | **A** re-arm *P* after the stretched RAM access (the board's) | 556 @ 946 | **0** @ 760 | 1,055 @ 946 | 1,664 @ 834 | | **B** fixed grid, any bus cycle absorbs the tick, only RAM pays | 233 @ 845 | 863 @ 871 | 300 @ 896 | 638 @ 880 | | **C** fixed grid, the tick waits for a RAM access | 175 @ 845 | **0** @ 871 | 604 @ 896 | 183 @ 880 | | **D** every *N*th work-RAM access (a row counter, not a timer) | 353 @ 44 | **0** @ 8 | 300 @ 57 | **0** @ 11 | | **E** any bus cycle absorbs the tick and re-arms the timer | 361 @ 785 | 1,032 @ 834 | 401 @ 876 | 1,072 @ 778 | Two rules are exact on two programs each and hopeless on the others, and the period or count each needs differs by a factor of five between programs. At the board's own 805 MCLK rule C is no better than rule A overall (663 against 709 on the dense probe, but 1,656 against **0** on `wtest`). So **805 and rule A stay**, the difference is named, and the question is sharper than it was: the mechanism makes the interval depend on the access pattern in a way none of these five shapes captures. What would settle it is a hardware measurement, or reading the refresh counter out of the referee's own state rather than inferring it from stretches. 6. **VDPFIFOTesting's intermittent tests**: data-port writes during a DMA fill, and the fill's FIFO byte order, vary on real hardware (Nemesis). The board passes all four (milestone 2). 7. **The YM2612's DAC sampling point** within its cycle, which differs between the Model 1 and Model 2 and which Kabuto did not publish. Related: "On MD1 it just outputs a short pulse for each voice ... on MD2 it holds the value for quite a while", which the board does not model -- it sums a sample's 24 multiplexed values, the same on both. 8. **The delay from a bus request to BUSACK.** MoD's `gen_test_z80_bus` measures it twice (with the Z80 running 4-T-state and 6-T-state machine cycles) but its hardware values are not published in the pinned material; his logic-analyser measurement of 2 68000 cycles from /BR to /BG (forum t=1661) is of the other direction, the Z80 reaching the 68000's bus. **Modelled in milestone 5** from the specification alone: BUSREQ "is sampled by the CPU with the rising edge of the last clock period of any machine cycle" and the bus is released after it (Zilog UM0080), so the grant falls at the end of the machine cycle in progress, and a 68000 access to the Z80's space before then is held by the arbiter rather than failing. On MoD's ROM the delays that gives are 0 to 9 68000 cycles, all shorter than the 8-cycle `move.b (a2),dN` the ROM measures with, so **both its counters still print 0000** -- the same result as before it was modelled, and still not comparable with hardware. MAME grants at once and models no arbiter, so the milestone-1 lockstep turns the whole arbiter off (`Board.arbiter_enabled`), as it already does the refresh. **Milestone 6 gave it a judge.** Nothing hardware covers the question, so the tier rule lets Nuked-MD answer it: from the 68000's write to $A11100 to /BUSAK it takes 9.71-16.86 68000 cycles (mean 12.34 over 122 grants), where the machine-cycle rule alone takes 1.43-5.29 (mean 4.15). The specification's rule is therefore right in shape and short by the arbiter's own propagation. **The timing session adopted that propagation** as `arbiter.BUSACK_PROPAGATION_MCLK` = 57 MCLK -- the difference of the two means, 8.19 68000 cycles, rounded to whole master clocks and labelled die-derived and fitted. The board's grants are then 9.57-13.43 cycles, mean 12.29 against the referee's 12.34; the spread is narrower than the referee's because the board's machine-cycle estimate is coarse (`System.z80_probe`). MoD's ROM's two delay counters now print **0001** instead of 0000, which is still not comparable with hardware because his own values are not published. **What is still open.** With the Z80 *held in reset* the referee takes far longer: on `gen_test_z80_bus`, the one pinned ROM that polls $A11100 in that state, /BUSAK follows the write by **235 MCLK** (33.6 68000 cycles) against the board's 57. One observation is not a constant, so no second figure was fitted, and both `gen_test_z80_bus` and `stetest` still end their referee comparison at that poll (referee $67, board $66) -- a measured gap of about 178 MCLK rather than an unmodelled one ([worklog.md](worklog.md), the timing session). 9. **What a VRAM write in 128 KB mode does to the picture.** The board models the write path from Kabuto's formulas (one byte per word, the address bits rearranged) but keeps reading VRAM as in 64 KB mode, where the hardware shows garbage. Nothing pinned judges either half; Overdrive 2 is the case. 10. ~~**Mid-line VDP writes**~~: modelled in milestone 5. A line is set up where its active display begins and then drawn in pieces, each write landing at the pixel of its own access slot, and a CRAM write in the display leaves its dot. What is still open is the pipeline offset (item 20 of "The VDP") and judging any of it: r57shell's redraw-timing tests poll the pad seven times a frame -- the 6-button handshake -- so neither the board nor MAME leaves their first screen until milestone 7 fits that pad. 11. ~~**MD Soft Checker v0.30**~~ **is available and has been run** (milestone 8). The local No-Intro mirror holds it as `MD Soft Checker (USA) (Proto) (Unl)` (the romset's own symlink dangles because No-Intro dropped the `(v0.30)` from the name); it is pinned in `scripts/pinned_files.json`. Sega's own factory diagnostic prints 17 checks and the board gets its OK on every one, on all nine machines, with the version register read back correctly in its header ([validation.md](validation.md), milestone 8). It tests that each memory answers and that each kind of DMA moves bytes; it says nothing about timing, the picture or sound, so it is a floor and not a ceiling. 12. **The analogue path's corner frequency and the PSG/FM mixing ratio** are fitted to the MDFourier recordings, not read from a document; no source gives either. 13. **What a discrete YM2612's ports 1-3 read** (above, "The YM2612" item 7). 14. **Where a Z80 bus access falls inside its instruction.** z80-python reports only an instruction's total, so the arbiter places each bank access at the Z80 step's start plus the delays already charged. MoD measured that on a `POP` the 68000 "manages to sneak in a bus operation in between the first and second Z80 read", so the second read "seems to always have at least 4 wait states" and the pair averages 3.5; the board, placing both reads almost together, charges 2.53 wait states on that experiment where it charges 3.36 on his single-read one ([worklog.md](worklog.md), milestone 5). **Milestone 6 measured the split** on Nuked-MD, which charges the `pop`'s first read 2.95 wait states and its second 3.61 -- MoD's order and very nearly his number -- where the board charges 4.08 then 2.30: the same total, the opposite split, exactly as the missing accessor predicts. A core-side accessor would settle it ([polish.md](polish.md)). **After the timing session** the compensation is gone and the gap is plain: with the release rule corrected the `pop`'s first read costs the board 2.97 wait states against the referee's 2.95, its second 2.04 against 3.60, and the pair 2.50 against 3.27. This is now the board's largest remaining arbiter difference and it is entirely the missing accessor. **The accessor exists now** (z80-python `b62891b`'s access-timing table, adopted for the Z80's device accesses), but the arbiter still places bank accesses at the step's start: it reads the 68000's bus cycles only as far as the Z80 has been caught up to, and an access later in the instruction would land past them on a bus that looks idle ([worklog.md](worklog.md), "The access-timing table, and what the slip turned into", item 2). 15. **The DMA's start-up cost**, adopted in the timing session and **not fully resolved**. Kabuto's fast-transfer formula has a +5.6-cycle intercept, so a one-word transfer costs 8 68000 cycles on his hardware; milestone 6 measured Nuked-MD at 11.0 for the same transfer, fitting +8.0 over 1 to 512 words. The two judges agree that a start-up exists and disagree about its size by 2.4 cycles, so the **hardware source was taken**: `vdp.DMA_STARTUP_MCLK` is his own 5.6 cycles (39 MCLK). The board now costs 7.4 cycles for a one-word fast transfer against his 8.0 and the referee's 11.0, so it is still 3.6 cycles under the die. Why the die charges more than the hardware research reports is not explained here; the referee is an FC1004 with NMOS CPUs and Kabuto measured a Model 1, which is a candidate and nothing more. 16. ~~**What a 68000 access to the Z80's space costs.**~~ **Settled and adopted** in the timing session (2026-09-23). MAME adds one 68000 clock to every access to $A00000-$A0FFFF (`megadriv.cpp`, `before_delay(1)`, "required by pacman2 intro", "TODO: unverified"), which milestone 1 carried as a named class of lockstep difference (41,274 steps of Sonic alone); Nuked-MD does the same (all 68 of the FM probe's $A0xxxx accesses held 7 MCLK). Nothing hardware covers it, so the die-derived model judges and it agrees with MAME against the board. The board now charges it (`board.Z80_SPACE_STALL`, after the access, so the access still lands at the clock its bus cycle began at). The milestone-1 replay was re-recorded from MAME and re-run on all six games: the named class is gone and 0 differences are unexplained. What remains open is only the *reason* -- no hardware source says why a Z80-space cycle is a clock longer, and MAME's own comment still calls it unverified. 18. **The TMSS boot ROM is something a caller fits, not something a TMSS machine has.** On the hardware a TMSS console powers up with its own ROM on the bus and bit 0 of $A14101 chooses between it and the cartridge; the board does the same *when a boot ROM is supplied* (`System(..., tmss_rom=...)`), and otherwise puts the cartridge on the bus from power-on and ignores $A14101. That is what every run of milestones 1 to 6 did -- VDPFIFOTesting is scored on `genesis-tmss` among others -- and making the boot ROM automatic would move all of them. The VDP lock ("SEGA" to $A14000) is not optional and is on for every TMSS machine. 19. **r57shell's VDP Redraw Time Test 4 cannot be reproduced as reported.** The one hardware report (MrTamk1s, an MD2 VA1.8 with a 315-5708-01, forum t=1585) is "On the smaller [CRT], the screen completely rolled over, while on the larger, only the first few rows were flickering/rolling" -- a display losing and regaining sync, which depends on the monitor and which a frame buffer has no way to show. The board's picture for that test does not change at all from frame to frame. The rest of that ROM's eight screens are measured in docs/worklog.md, milestone 7. 17. **The VDP in Mode 4.** At power-on the VDP is in Mode 4 and Nuked-MD's $C00008 reads a constant ($9F00 in the runs made); the board reads its Mode 5 HV counter whatever the mode. No test ROM of milestones 2-5 reads HV before setting Mode 5, and Mode 4 as a whole is milestone 10. 20. **What an Extended SSF cartridge writes to $A130F0/$A130F1: MAME is right and krikzz's own document does not describe these carts.** Krikzz's `extended_ssf-v2.txt` (specification tier, the designer's own) gives that register as `[PXWL.... ...RRRRR]` -- a protection bit, 32x mode, ROM write-enable, an LED, and **the first bank** in the low five bits -- and puts no SRAM control anywhere in the mapper. MAME's `megadrive_hb_ssf_device::time_f0_w` implements it as the *Sega* mapper's SRAM control instead (bit 1 disables the SRAM view, bit 0 write-protects it), with the comment "same as Sega mapper (Demons of Asteborg wants it this way)". The document outranks MAME on the tier rule, so the conflict was settled by looking at what the games themselves write, which is evidence about their own cartridges. `Board._system_write` was wrapped (the board's own dispatch drops the high byte, so the cartridge is the wrong place to watch from) and four carts run for 900 frames each on a forced `rom_ssf2` board: | cartridge | header | what it writes to $A130F1 | | --- | --- | --- | | Demons of Asteborg (v1.1) | `SEGA DOA` | `$01` x6, `$03` x3 | | Earthion (v3.3.0) | `SEGA SSF` | `$00` x1 | | Kunio no Nekketsu (v1.6) | `SEGA SSF` | `$00` x1 | | Overdrive 2 | `SEGA SSF` | never writes it | `$00`, `$01` and `$03` use bits 0 and 1 and nothing else. Read krikzz's way those are **first-bank selects**, and writing bank 1 or bank 3 over the window that holds the vector table would break the running program immediately; read the Sega mapper's way they are exactly its documented idiom -- Phantasy Star IV "will always write $01 to $A130F1 before accessing the RAM" (CMD `gen-hw.txt` 4.3), and `$03` is that plus the write-protect bit. Demons of Asteborg is the cart MAME's comment names, it is the one with battery RAM (MAME's slot is `ssf_sram`), and it is the only one of the four that writes anything but `$00`. So: **these retail aftermarket cartridges are not krikzz's flashcart.** His document describes the Mega Everdrive's own mapper, which has an LED, an SD card and a USB port; a cartridge pressed for a game implements the bank registers and leaves $A130F1 as the Sega mapper had it. Both statements are true of different hardware, which is why the document and MAME disagree without either being wrong. Two further things the same run settled: - **The bank field is five bits, and four is not enough.** The largest bank written is `$1C` (Demons of Asteborg, twice). MAME's *legacy* `rom_ssf2` device masks `data & 0xf` and would fetch bank `$0C` for it; krikzz's five bits and the board's six both carry it. Corroboration that the numbering is krikzz's: his document reserves "Bank 28 ... for saves", and `$1C` is 28. - **Every write is a byte write to an odd address** ($A130F1, F3, F5, ... FF) -- no game wrote a word, in 3,600 frames across the four. The high byte where all of krikzz's flag bits live is therefore never written by these cartridges, so the board's `write_time(address | 1, low)` dispatch loses nothing real here. (An earlier note in this session guessed that dispatch would have to carry the whole word before the mapper could be implemented. The observation says otherwise for these four carts, and it is recorded here rather than acted on.) 21. **Withdrawn: there is no rate difference.** *(Corrected 2026-09-24, later the same day.)* Everything below that says the board runs Earthion's loading loop "twice as fast" as BlastEm, or that BlastEm "takes about 2.6 times longer", came from reading BlastEm's clock as half a master clock. It is one master clock (``vdp.c`` 3815 at 542164d advances it 3,420 a line, and Overdrive 2's once-a-line writes land 3,420 apart in the log), and ``-b 600`` runs 300 frames, not 600. Read right, both emulators take **300 frames** for the same work, running the same 31 transfers every other frame one frame apart, and the median gap between DMA set-ups is **1,712 MCLK on the board against 1,804 on BlastEm**, a ratio of 1.05 (re-measured on `Earthion (World) (En) (Aftermarket) (Unl)`, `genesis`, 300 frames; docs/worklog.md, "The BlastEm clock"). What stands is the part that never rested on BlastEm: the board's transfers are the Manual's, ratio 1.00. What is withdrawn is the disagreement, and with it "BlastEm is the outlier". The original entry, kept as it was written: **The board runs Earthion's loading loop about twice as fast as BlastEm does, and the Manual says the board is right.** Chasing what looked like a divergence (the board appeared to run the game's VDP initialisation twice where BlastEm ran it once) showed there is no divergence at all: **the first 9,062 VDP register writes are identical, in order, between the two.** The board's stream is a strict superset -- it simply gets further. The apparent double initialisation is BlastEm reaching the same code later, and comparing by frame number rather than by content is what made it look structural. What is left is a rate difference, and it is a clean factor of two: | | frames for identical work | DMA triggers (reg 23) | median gap between triggers | | --- | ---: | ---: | ---: | | the board | **300** | 1,374 | **1,710 MCLK** | | BlastEm | **599** | 1,377 | **3,608 MCLK** | Emulated time per frame agrees (the board's 536,728,611 MCLK over 600 frames against BlastEm's 537,526,808), the work is the same, and the number of transfers is the same. The board simply advances half as far between one DMA and the next. It is **not** the interrupts: 556 VINTs over 600 frames, 0.93 a frame, with no doubling. It is **not** simply the transfer being undercharged either -- the difference is about 1,900 MCLK per DMA, where the whole cost of a 31-word transfer under Kabuto's formula is about 560. The likeliest remaining candidate is what the game does *between* transfers: a status bit polled in a loop, which the board would clear too early. **Resolved the same day, and in the board's favour, by a source that outranks both emulators.** The loop is the game polling status bit 1, the DMA-busy bit: it triggers a 31-word 68000-to-VRAM transfer, reads $C00004 until the bit clears, and triggers the next. So the rate is set by how long a transfer takes. - The board's transfers are **exactly** what the Manual's DMA transfer capacity table gives. `scripts/run_dma_cost.py` reproduces the whole table to a tenth of a byte -- 16.1, 167.1, 18.1, 205.1 against its 16, 167, 18, 205 -- and Earthion's own 31-word transfers take a median of **1,036 MCLK against the 1,034 the table predicts, a ratio of 1.00**. - The table's blanking column is the right one: the display is **disabled on all 34 of the board's triggers**, and the Manual's rule is that with the display disabled the blanking figure applies on every line (docs/timing.md). - The display state is not in doubt on BlastEm's side either. The two emulators' register write streams are identical, so register 1 -- which carries the display-enable bit -- holds the same value at the same point in both. BlastEm takes about 2.6 times longer for those same transfers. The **Manual is specification tier and outranks both emulators**, so on this measure the board is right and the difference is BlastEm's. Nothing was changed. The apparent contradiction with MAME dissolves with it: the board running *behind* MAME (`FRAME_OFFSET` = 3) is the accumulated cost of stalls MAME models nothing of, and running *ahead* of BlastEm is one DMA rate that the Manual settles. They were never the same measurement. Two readings had to be discarded to get here, both from comparing before checking the instrument: that the board "runs the initialisation twice" (it does not -- the streams are identical and the board is simply further along), and that BlastEm's `EVENT_FLUSH` marks frames (it does not). `scripts/blastem_events.py` is the instrument; every measurement above is reproducible with it.