← コア一覧
Arcade-DreamWorld (ppriest)
MAMEとの相違点を記載 — 2
- rtl/dreamworld_core.sv:712 MAME's boot never executes any of the loop's addresses, so this is a fault path, not game logic.
- README.md:178 [ ] Find why Baryon's and Rolling Crush's attract demos differ from MAME's
MAMEのソースを引用 — 75
- DreamWorld.sv:3 Top-level HPS/DIP/video glue for the SemiCom 68EC020 board (MAME dreamwld.cpp), wiring rtl/dreamworld_top.sv into the MiSTer framework.
- DreamWorld.sv:6 Input layout is dreamwld.cpp's INPUT_PORTS: one 32-bit port at $C00000, and the 16-bit DSW at $C00004, which reads the same on both words.
- DreamWorld.sv:42 The board is mono (dreamwld.cpp routes both OKIs to one "mono" speaker); the OSD's Stereo Mix defaults to mono: status 0 Mono (AUDIO_MIX 3), 1 None (0), 2 25% (1), 3 50% (2).
- DreamWorld.sv:226 dreamwld.cpp INPUT_PORTS_START( dreamwld ), all IP_ACTIVE_LOW (hence the `~`: hps_io's joystick bits are active high): bits 31-24 P1 UP, DOWN, RIGHT, LEFT, B1, B2, B3, START1 bits 23-16 P2 UP, DOWN, RIGHT, LEFT, B1, B2, B3, START2 bits 15
- DreamWorld.sv:234 MAME's default keys alongside the pads (rtl/mame_keys.sv): arrows, LCtrl LAlt Space, 1 start, 5 coin for player 1; R F D G, A S Q, 2, 6 for player 2; P pause.
- DreamWorld.sv:252 dreamwld.cpp's DSW is one 16-bit port (SW2 in bits 7:0, SW1 in bits 15:8), read through lr16 over $C00004-$C00007, so both words of the long return it.
- DreamWorld.sv:318 Freeze the 68020 so a frame can be captured and compared against a MAME dump of the same moment.
- rtl/cpu/maincpu.sv:1 Main CPU: 68EC020 at 16 MHz (dreamwld.cpp baryon(): XTAL 32MHz/2, "16MHz verified").
- rtl/cpu/maincpu.sv:7 The decode is dreamwld.cpp's baryon_map and dreamwld_map (lines 417-447).
- rtl/cpu/maincpu.sv:10 Unmapped reads return 0, MAME's default for a map without unmap_value_high.
- rtl/cpu/maincpu.sv:13 The 68EC020 has a 32-bit bus in MAME; TG68K's here is 16 bits, so a long access is two word cycles.
- rtl/cpu/maincpu.sv:14 Each I/O handler below fires on the word MAME's handler lives on, so a long access to it fires once; the games use byte accesses there (docs/boot_trace_mame.txt).
- rtl/cpu/maincpu.sv:26 MAME's spin_until_time(50 us) after each MCU handshake access: 50 us at 54 MHz
- rtl/cpu/maincpu.sv:92 Gates the 16 MHz clock enable, so the 68020 simply stops stepping; video timing and the debug overlay keep running, which is what makes a frame comparable against a MAME dump.
- rtl/cpu/maincpu.sv:98 MAME's copy takes no time.
- rtl/cpu/maincpu.sv:131 ---- 16 MHz CPU clock enable ---- The board clocks the 68EC020 at 32MHz/2 = 16 MHz (dreamwld.cpp baryon(), "16MHz verified").
- rtl/cpu/maincpu.sv:289 MCU handshake accesses hold the bus STALL_CLKS after they complete, as MAME spins the 68020 50 us in to_prot_w and protdata_r ("give it time to respond"); the 68020 code does not poll.
- rtl/cpu/maincpu.sv:291 The read value is taken when the access completes, as MAME's.
- rtl/cpu/maincpu.sv:371 Byte handlers in MAME: the OKIs on the even byte (upper lane), the bank registers on the odd byte (lower lane).
- rtl/cpu/maincpu.sv:372 0xC00010 ("might reset the MCU") is not modelled, as in MAME.
- rtl/dreamworld_core.sv:9 The video pipeline is still the Psikyo core's (psikyo_v.cpp) apart from vreg_decode's control word; dreamwld.cpp's sprite format, sprite LUT redirect, layer offsets and 308-pixel screen are not implemented yet.
- rtl/dreamworld_core.sv:13 ---- Sprite pipeline per-frame sequencing ---- Per-scanline sprites, sequenced to psikyo_v.cpp's screen_vblank(): at frame_start, sprite_line_list rebuilds its compact table FROM the spriteram snapshot (get_sprites), then spriteram_dbuf.cop
- rtl/dreamworld_core.sv:122 Freeze the main CPU, so a frame can be captured and compared against a MAME dump of the same moment without the game advancing underneath it.
- rtl/dreamworld_core.sv:391 Indexing by {vcnt[3:0],hcnt[7:0]} puts all 4096 words of both layers into 32 scanlines, so one screenshot carries the complete tilemap RAM for comparison against a MAME dump.
- rtl/dreamworld_core.sv:424 Reads the CPU-VISIBLE buffer (the one spriteram_dbuf's cpu_addr/cpu_rdata port serves, i.e. the SAME buffer MAME's own debugger/memory viewer shows -- not the render engine's snapshot copy) so a probed value is directly comparable to a MAME
- rtl/dreamworld_core.sv:496 ---- tilemap engines ---- dreamwld.cpp screen_update: scrolly + 32 on both layers, scrollx + 0 on layer 0 and + 2 on layer 1.
- rtl/dreamworld_core.sv:532 ---- sprite RAM, its vblank copy, and the per-frame list ---- dreamwld.cpp screen_vblank copies sprite RAM at vblank start and the next frame is drawn from that copy.
- rtl/mame_keys.sv:1 MAME's default keys (src/emu/inpttype.ipp) in hps_io's joystick layout, to OR into joystick_0/1: right, left, down, up at bits 0-3, buttons 1-6 at 4-9, Start, Coin, Pause, Service at the J1 line's own positions (parameters).
- rtl/mame_keys.sv:7 P1 arrows, LCtrl LAlt Space LShift Z X, 1 start, 5 coin P2 R F D G, A S Q W E (MAME gives P2 no sixth key), 2 start, 6 coin F2 service (test) switch, 9 and 0 service coins 1 and 2, P pause
- rtl/mame_keys.sv:24 MAME's Service 1, 2: wire to the board's SERVICE1/2 bits, if any
- rtl/mcu/jt8052/jt8052.v:32 [DW] P2 was written at the last enable (dreamwld.cpp prot_p2_w)
- rtl/mcu/jt8052/jt8052_periph.v:33 [EO] the 8052's timer 2 (T2CON 0xc8, RCAP2 0xca/0xcb, TL2/TH2 0xcc/0xcd, vector 0x2b, ET2 IE.5, PT2 IP.5): timer and capture modes on the machine cycle, as MAME's i8052 update_timer_t2.
- rtl/mcu/semicom_mcu.sv:1 The protection MCU: an 87C52 at 16 MHz (jt8052) running its own 8 KB ROM, and the board logic between it and the 68020 as dreamwld.cpp models it (lines 736-794):
- rtl/mcu/semicom_mcu.sv:10 MAME leaves P0, P1 and P3 inputs and both interrupt pins unconnected; they read as idle here.
- rtl/memory/gfxrom_byte_reorder.sv:13 This module is the seam between two self-consistent but OPPOSITE byte-order conventions: sdram.sv's is ordinary ascending-address-ascending-bit-position, matching standard little-endian ROM/CPU word semantics (and correct as-is for rtl/memo
- rtl/memory/gfxrom_byte_reorder.sv:20 Neither side is wrong on its own, so the reorder belongs here, not in sdram.sv (correct for general ROM access) or in tilemap_line_engine.sv/sprite_render_engine.sv (correct against MAME's real tile format, and independently unit-tested tha
- rtl/video/compositor.sv:1 Mixing, dreamwld.cpp screen_update: layer 0 (opaque), then layer 1 (pen 0 transparent), then sprites (pen 0 transparent, already applied by the sprite engine, so sp_present means a drawn pixel).
- rtl/video/sprite_line_list.sv:8 At build_start it walks records 0-511 of the snapshot in order (dreamwld.cpp draw_sprites: the first 0x1000 bytes, two longs a record) and stores, in that order -- later entries overwrite earlier ones -- one entry per sprite whose box touch
- rtl/video/sprite_pos_transform.sv:1 Applies the position offset correction and zoom-factor transform that get_sprites() does between decoding the raw record and iterating sub-tiles (psikyo_v.cpp:235-239):
- rtl/video/sprite_pos_transform.sv:17 flip_screen (the DIP-controlled screen flip, psikyo_v.cpp:241-247) is not handled here: the core renders the mirrored source line and reads the line buffer right to left instead (dreamworld_core.sv's flip_screen), which flips sprites and ti
- rtl/video/sprite_record_decode.sv:1 Decodes one sprite record, dreamwld.cpp draw_sprites (lines 203-260), as four 16-bit words (record n at sprite RAM word 4n):
- rtl/video/sprite_record_decode.sv:9 MAME draws each tile at (X, Y), (X - 0x200, Y), (X - 0x200, Y - 0x200) and (X, Y - 0x200), with X = ((x + 4) & 0x1ff) - 16 and Y = y. A sprite is at most 128 pixels each way and the screen 308 x 224, so at most one copy is ever on screen, a
- rtl/video/sprite_subtile_step.sv:1 Computes one 16x16 sub-tile's screen position and LUT-index code, from the get_sprites() sub-tile loop (psikyo_v.cpp, verified against the actual current source rather than re-derived by hand):
- rtl/video/sprite_zoom_lut.sv:1 Sprite zoom scaling lookup: raw 4-bit zoom field -> (dst_size, dx), the two quantities drawgfxzoom_core (src/emu/drawgfxt.ipp:738) needs to render one 16x16 source tile at the requested scale.
- rtl/video/sprite_zoom_src_index.sv:1 Per-destination-column source pixel index for the nearest-neighbor zoom-blit accumulator (gfx_element::drawgfxzoom_core, drawgfxt.ipp:738-805), collapsed to a closed form -- see docs/phase1_video_engine.md, "The actual per-tile scaling algo
- rtl/video/spriteram_dbuf.sv:1 Sprite RAM (0x400000-0x401FFF) and the copy the sprites are drawn from: dreamwld.cpp's screen_vblank copies sprite RAM to m_spritebuf[0] at vblank start, and draw_sprites reads only that copy.
- rtl/video/spriteram_dbuf.sv:6 The copy is not instantaneous as MAME's is, so dreamworld_core holds the 68020's sprite RAM accesses until it ends: the game writes the next list from the first lines after vblank start (docs/write_timing_mame.txt).
- rtl/video/tile_cell_decode.sv:1 Decodes a raw 16-bit tilemap VRAM cell (named vram_cell -- "cell" is a reserved SystemVerilog keyword, part of the config/cell/liblist/use declaration syntax) into a gfx-ROM tile number and palette color-group index, per get_tile_info<Layer
- rtl/video/tile_row_decode.sv:1 Decodes one 16-pixel row of a 16x16x4bpp "packed_msb" tile (MAME's gfx_16x16x4_packed_msb layout, used for both the "sprites" and "tiles" gfx regions -- gfx_psikyo in psikyo.cpp) into 16 4-bit pixel/palette-nibble values.
- rtl/video/tile_row_decode.sv:17 - Each byte's HIGH nibble is the even (left) pixel, LOW nibble is the odd (right) pixel ("x order: hi nibble first" per generic.cpp).
- rtl/video/tilemap_addrgen.sv:5 See docs/phase1_video_engine.md ("Tilemap addressing") for the derivation: MAME's tile_scan<Layer> (psikyo_v.cpp) looks like a bit-interleave, but its result is always masked to the low 12 bits by the caller, and every extra term in each ca
- rtl/video/tilemap_line_engine.sv:198 One-PIXEL alignment bias, measured on real hardware against the MAME reference (reported by the author of MAME's Psikyo renderer): screen_x shows tilemap pixel (scroll + screen_x + 1), moving the image one pixel LEFT of the unbiased sum.
- rtl/video/tilemap_line_engine.sv:339 dreamwld.cpp: linebase[((y + 32) & 0xff) >> tile_rowscroll]
- rtl/video/video_timing.sv:1 H total 444 and V total 263 at 6.75 MHz, the pair chosen in docs/HACKS.md (57.805 Hz, MAME's 57.793 Hz +207 ppm; 15.203 kHz).
- rtl/video/video_timing.sv:2 308 x 224 visible, as dreamwld.cpp's set_visarea.
- rtl/video/video_timing.sv:20 frame_start fires on vblank's rising edge (vcnt 223->224), dreamwld.cpp's screen_vblank sprite copy point.
- rtl/video/vreg_decode.sv:1 dreamwld.cpp maps the row-scroll RAM at 0x804000-0x8043FF (word 0x000-0x0FF layer 0, 0x100-0x1FF layer 1) and the "vregs" share at 0x804400-0x805FFF; the scroll and layer control words sit at the same offsets as on the Psikyo boards.
- rtl/video/vreg_decode.sv:60 Fixed word offsets (byte offset >> 1): dreamwld.cpp reads m_vregs[0..5] from the share at 0x804400.
- rtl/video/vreg_decode.sv:99 Layer control word, dreamwld.cpp screen_update():
- README.md:3 A MiSTer FPGA core for SemiCom's 68EC020 arcade hardware (MAME's `dreamwld.cpp`), built with Quartus Prime 17.0.2 Lite for the DE10-nano.
- README.md:41 The five SemiCom games MAME runs on this board, seven sets, one `.rbf`.
- README.md:59 Six of the seven protection MCU programs are reconstructions MAME marks `BAD_DUMP`; the core runs the programs MAME ships.
- README.md:68 None: `dreamwld.cpp` has no other sets.
- README.md:74 | MC68EC020, 16 MHz | main CPU | TG68K.C (Tobias Gubener), vendored; boot traced against MAME |
- README.md:76 | OKI M6295 x2, 1 MHz | sound | jt6295 (jotego), vendored; command traces from MAME replayed against a transcription of MAME's chip |
- README.md:81 6.75 MHz pixel clock (54 MHz / 8), 444 pixels a line, 263 lines: 15.203 kHz and 57.805 Hz, against MAME's declared 57.793 Hz.
- README.md:82 308 x 224 visible, as MAME's `set_visarea`.
- README.md:82 MAME gives no raw timing, so the totals and sync positions are chosen (`docs/HACKS.md`).
- README.md:138 The 68020 runs about half as fast as MAME's model in the protection handshake loop, so a game reaches its first frame about 0.8 s later than in MAME; after that
- README.md:145 Palette, tile VRAM and scroll are read as each line is drawn; MAME draws the whole frame at vblank.
- README.md:200 MAME is the accuracy reference, with its own acknowledged uncertainties noted where they matter.
- README.md:204 CPU: dreamwld's first 50 ms of bus writes equal MAME's (34,223 of 34,223); the protection stream intact as far as the bench ran (1,586 of 1,737 bytes, none wron
- README.md:229 The **MAMEdev team** — David Haywood — for `dreamwld.cpp` and the device emulations that are this core's specification.
- README.md:249 | `debug` | reference captures from MAME used as ground truth (gitignored) |
- README.md:250 | `roms` | your own MAME sets (gitignored, never committed) |
MAMEと一致する、MAMEに合わせた、またはMAMEで確認したと記載 — 11
- rtl/cpu/maincpu.sv:388 Match MAME's irq4_line_hold: assert on the RISING edge, hold until acknowledged, and let the acknowledge win.
- rtl/memory/gfxrom_byte_reorder.sv:1 Reorders a 64-bit SDRAM read granule (native ascending-address -> ascending-bit-position packing, as produced by rtl/memory/sdram/ sdram.sv's burst-4 read capture -- see that module's own STATE_READ0..STATE_READ3 comments, and confirmed dir
- rtl/video/tile_row_decode.sv:6 Format, verified against MAME's actual decode algorithm (src/emu/drawgfx.cpp: gfx_element::decode()/readbit()), NOT just the gfx_layout struct's field values at face value -- a first pass at reading the struct alone (planeoffset={0,1,2,3})
- README.md:77 | two tilemaps, sprites | video | adapted from the Psikyo core's per-line engines to `dreamwld.cpp`'s formats; checked against MAME frames |
- README.md:141 Baryon's and Rolling Crush's attract demos play differently from MAME's: 25 s after launch the tilemaps and score display match a MAME frame, the ships, shots a
- README.md:143 Dream World's, Cute Fighter's and Gaia's match MAME pixel for pixel.
- README.md:207 Video model: `scripts/render_model.py` identical to MAME on 49 scenes, seven per set.
- README.md:210 Hardware: 11 of 12 dreamwld attract screenshots identical to a MAME frame; the twelfth differs in rows 0-27 during a palette fade (known issue above).
- README.md:211 Three flipped screenshots, turned 180, identical to MAME frames.
- README.md:216 Sound: `sim/oki_phrase_tb` 20 of 20 dreamwld phrases sample-identical to a transcription of MAME's `okim6295.cpp`; `sim/oki_trace_tb` replays 3 s of MAME's OKI
- README.md:221 Attract screenshots 25 s after launch: Dream World, Cute Fighter and Gaia identical to MAME frames; Baryon and Rolling Crush differ in the demo (known issue abo
MAMEから移植・書き写した、または取り入れたと記載 — 1
- README.md:149 `docs/MAME_KLUDGES.md` lists what is taken from MAME as behaviour and what is known not to be right.