← コア一覧
DJMain (dj6502)
MAMEとの相違点を記載 — 2
- rtl/djmain_main.vhd:238 MAME 0.289 never does this during the tune.
- rtl/djmain_main.vhd:1215 A VBlank held through the masked period would then never be delivered when interrupts are enabled, waiting until the next frame and diverging from MAME.
MAMEのソースを引用 — 66
- DJMain.sv:923 MAME gives 1121 for both.
- DJMain.sv:1191 The mapping was measured from MAME 0.289's ioport definitions.
- DJMain.sv:1261 MAME models this as a horizontal dial (IPT_DIAL) and only uses left/right, but MiSTer insists on mapping all four directions, so up and down are given the same effect rather than wasted.
- DJMain.sv:1291 The real board has none: turntable_r in MAME's driver is delta * 70 with the top byte returned, and nothing there depends on how fast the record is turning.
- DJMain.sv:1301 MAME 0.289 reads the dial the same for every title (no PORT_REVERSE anywhere in the driver, confirmed against `mame -listxml` for all twelve sets), so this is the game's own doing, not something the board does.
- rtl/djmain_main.vhd:11 The memory map follows memory_map in MAME's djmain driver: 0x000000-0x0FFFFF program ROM ...
- rtl/djmain_main.vhd:194 MAME 0.289: both 1121, one interrupt per frame.
- rtl/djmain_main.vhd:214 The vertical blank count at which each part is entered, MAME 0.289: 5153 / 5217 / 6241 / 6273.
- rtl/djmain_main.vhd:228 MAME 0.289 measured: frame 47 = 0x59168A, 547 = 0x64B0A2, 1121 = 0x71FCE0, advancing 1517.2 bytes a frame.
- rtl/djmain_main.vhd:245 MAME 0.289: fade in at -2, the 1024 loop at 64, fade out at 1087, stop at 1119.
- rtl/djmain_main.vhd:308 Byte index for the ROM read-through, the same expression as MAME's v_rom_r / obj_rom_r.
- rtl/djmain_main.vhd:309 In MAME a set bit of mem_mask means "leave that byte alone", and ACCESSING_MSB32 in v_rom_r asks whether the first byte of the 32-bit word was read, which on a 16-bit bus is the same as asking whether nUDS is asserted.
- rtl/djmain_main.vhd:519 The span has to be the first key-on to the first key-off-everything after it, and then stay put: the title tune is followed by more key-ons (a sound effect 70 frames later, in MAME), and overwriting on each one would leave a number measured
- rtl/djmain_main.vhd:523 Measured in MAME: key-on at frame 5153, key-off at 6274, and another key-on at 6347.
- rtl/djmain_main.vhd:528 MAME asserts the drive interrupt with HOLD_LINE, i.e. it clears itself once the CPU takes it.
- rtl/djmain_main.vhd:637 Measured with the MAME 0.289 debugger's "map" command on popn1a and bm2ndmix.
- rtl/djmain_main.vhd:669 As in MAME's v_rom_r, one 32-bit word maps to two bytes of ROM.
- rtl/djmain_main.vhd:883 MAME maps bits 31..24 of a 32-bit word to even-numbered registers and 15..8 to odd ones (MAME konamiic.c).
- rtl/djmain_main.vhd:888 MAME's register numbers 7 / 10 / 17 are the high bytes of our 16-bit words (bits 31..24 of a 32-bit word are the even registers, 15..8 the odd ones).
- rtl/djmain_main.vhd:1178 Two of the three snapshots of how far channel 0 has played, at the frames MAME was measured at (the third is taken when the tune stops).
- rtl/djmain_main.vhd:1296 The drive interrupt works the same way: remembered on its rising edge, cleared when the CPU takes it, and also cleared when the drive itself drops it (MAME's CLEAR_LINE).
- rtl/djmain_main.vhd:1348 As in MAME's v_rom_r: one 32-bit word maps to two ROM bytes, and a value is only returned for the high word (the low word reads 0).
- rtl/djmain_main.vhd:1451 Take the third snapshot here rather than on a frame number: this is the write that stops the tune, so it is exactly the moment MAME's 0x71FCE0 was measured at.
- rtl/djmain_main.vhd:1472 MAME looks at bit 19 of the 32-bit word, which is that same bit.
- rtl/djmain_main.vhd:1506 This mapping was measured in MAME.
- rtl/djmain_video.vhd:8 Measured from MAME 0.289: 512 x 384 visible, 16.000MHz dot clock (62.5ns per pixel) horizontal 41.25us = 660 pixels -> 24.242kHz vertical 17.2425ms = 418 lines -> 57.99623Hz So horizontal blanking is 660 - 512 = 148 pixels and vertical is
- rtl/djmain_video.vhd:13 Where the sync pulses sit cannot be read out of MAME, so the defaults are sensible values inside those blanking periods (and can be changed through the generics).
- rtl/djmain_video.vhd:81 MAME sorts the three ascending and draws in that order (its djmain VIDEO_UPDATE).
- rtl/djmain_video.vhd:83 Measured in MAME, layer 0 is fixed at 0x10 and layer 1 at 0x20, while the sprites alternate between 0x18 and 0x28.
- rtl/icache.vhd:9 Hit rate on the real bus addresses traced out of MAME: 98.8% at 1KB, 99.4% at 4KB, 99.7% at 8KB.
- rtl/icache.vhd:11 For reference, MAME's measurement of real play shows the 68020's own 256-byte cache bringing program ROM reads down to 275K/s.
- rtl/ide.vhd:4 Register accesses of bm2ndmix measured on MAME: only three commands are ever used
- rtl/ide.vhd:31 MAME 0.289 on bm4thmix: a correct password gives status 0x50 and the reads follow; one word changed gives 0x51 and the game issues nothing more.
- rtl/judge_table.vhd:24 The game copies each chart into work RAM with ascending 16-bit writes (as measured on every title in MAME 0.289).
- rtl/k054539.vhd:4 Implemented from MAME's k054539.c as the specification, narrowed to what DJMain (beatmania) actually uses.
- rtl/k054539.vhd:8 4-bit DPCM is implemented (step table, saturation) as in MAME 0.289.
- rtl/k054539.vhd:11 Reverb, as MAME 0.289 behaves.
- rtl/k054539.vhd:15 The word goes into the next output sample, to both L and R, before the 16-bit clamp; added to the same sample instead, the reverb lands one sample early against the dry sound compared with MAME.
- rtl/k054539.vhd:25 Against MAME 0.289 output for the same register writes and wave RAM: correlation 0.998 (L) / 0.981 (R) over six seconds, 0.995-0.9996 per note on the 8-bit key sounds.
- rtl/k054539.vhd:27 The residual is +/-1 sample of timing quantisation from the granularity of MAME's stream updates.
- rtl/k054539.vhd:28 The reverb term itself equals MAME's to within one LSB: MAME sums the dry path in double precision and truncates toward zero, so the sum lands one off when the reverb word moves it across zero.
- rtl/k054539.vhd:45 Initial reverb buffer position (power-on value only; reset leaves the position running, as MAME sets it once at start-up).
- rtl/k054539.vhd:78 The game stops a tune when it sees its channel finish, so this shows where a tune ended (0x73129A for the 2nd MIX title tune in MAME).
- rtl/k054539.vhd:114 Step table for 4-bit DPCM: powers of two, times 256 (MAME 0.289).
- rtl/k054539.vhd:115 Older MAME versions have squares here (0,1,4,9,16,25,36,49).
- rtl/k054539.vhd:334 Both act on the "sounding" flags in 0x22C (MAME's K054539_keyon / keyoff).
- rtl/k054539.vhd:346 In "load on key-on" mode MAME keeps writes to these three out of the registers, in a side buffer, and moves them across when 0x214 arrives.
- rtl/k054539.vhd:460 MAME does shift position and fraction left by one for DPCM, but that is a change of coordinates so the lowest position bit can select the nibble; it does not change the rate (the fraction shifts too).
- rtl/k054539.vhd:497 MAME clears the fraction when playback starts and then adds delta on that same sample, advancing by one step.
- rtl/k054539_tables.vhd:1 K054539 volume / pan tables The voltab / pantab of MAME k054539.c, precomputed as Q1.15 fixed point: voltab[i] = 10^((-36*i/64)/20) / 4 (i=0 is the maximum, 0.25) pantab[i] = sqrt(i) / sqrt(14) (i=0..14)
- rtl/k056766.vhd:4 Implemented from MAME's djmain_video.c as the specification.
- rtl/k056766.vhd:4 The algorithm reproduces MAME's screen pixel for pixel.
- rtl/k056766.vhd:7 What DJMain uses, as measured in MAME over 638 frames: at most 72 sprites at once, at most 512 drawn pixels per scanline all four sizes are used: 16x16, 32x32, 64x64, 128x128 only 4% of sprites are scaled; the rest are 1:1 and skip the divi
- rtl/k056766.vhd:12 Priority slots are walked from 127 down to 0, so what is drawn later ends up on top (the same order MAME draws in).
- rtl/k056766.vhd:70 MAME (draw_sprites in djmain_video.c) draws a whole frame from the object RAM as of one instant, so a frozen copy is used here too.
- rtl/k056832.vhd:4 Implemented from MAME's konamiic.c as the specification.
- rtl/k056832.vhd:4 The algorithm reproduces MAME's bm2ndmix screen on all 196,608 pixels.
- rtl/k056832.vhd:7 What bm2ndmix uses, as measured in MAME: Two layers: layer 0 on pages {0,4}, layer 1 on pages {1,5} One page = 64x32 tiles = 512x256 pixels; a tile entry is 2 words (attribute, code) Tiles are 8x8, 4bpp, 32 bytes.
- rtl/k056832.vhd:261 The four planes are ordered as in MAME's charlayout4dj: plane 0 is the most significant.
- rtl/turntable.vhd:15 This rule was measured on MAME 0.289 over 2,301 reads.
- README.md:138 The ROMs do not go in `games/mame/`
- README.md:143 A CHD from MAME cannot be read as it is; expand it into a raw image.
- README.md:143 `chdman` comes with MAME (on Homebrew, `brew install rom-tools`).
- README.md:371 | The MAME 0.289 sources read as the specification (smf, Olivier Galibert, David Haywood) | [LICENSE-MAME](LICENSE-MAME) | BSD-3-Clause |
- README.md:377 **The MAME developers.** This core was built by reading `djmain.cpp`, `k054539.cpp`, `k054156_k054157_k056832.cpp` and `k055555.cpp` from MAME 0.289 as the spec
- README.md:377 Those files are BSD-3-Clause; the notice is in [LICENSE-MAME](LICENSE-MAME).
MAMEと一致する、MAMEに合わせた、またはMAMEで確認したと記載 — 5
- rtl/djmain_main.vhd:54 Only matters when matching MAME instruction by instruction (it varies per boot on real hardware).
- rtl/djmain_main.vhd:1180 Taken on the vertical blank so the moment matches MAME's, which samples once a frame as well.
- rtl/djmain_video.vhd:40 The period matches the real board either way; the phase varies from boot to boot and only matters when matching MAME instruction by instruction.
- rtl/djmain_video.vhd:283 On a tie the order stays the same as MAME's stable sort (layer 0, layer 1, sprites).
- rtl/k056832.vhd:36 Per-layer display offsets, as applied by djmain_video.c. Using the register values as-is puts the picture in the wrong place, so match MAME.