← コア一覧
StadiumHero (yaguboo)
MAMEのドライバにもある実基板の情報・測定値を引用 — 1
実基板での測定値を記載 — 2
「実機」で確認したと記載 — 2
MAMEのソースを引用 — 111
- projects/dataeast/stadium_hero/rtl/sh_main.sv:4 Map, from stadhero.cpp:226-241 (docs/MAME_NOTES.md section 2):
- projects/dataeast/stadium_hero/rtl/sh_main.sv:27 ---- the RNG at 0x30c003 ------------------------------------------------- MAME returns m_screen->hpos()/2 from a 256-wide screen, so 0-127, and the driver header carries `TODO : RNG issue?
- projects/dataeast/stadium_hero/rtl/sh_main.sv:29 This core returns (hdump*85)>>8 from the true 384-wide counter by default; rng_mode selects MAME's own derivation or hdump[6:0] for diagnosis.
- projects/dataeast/stadium_hero/rtl/sh_main.sv:62 DIAGNOSTIC, and it changes the game: 0 = board, (hdump*85)>>8 -- what has shipped since DEBUG_LOG O5 1 = MAME's hpos()/2, cycle-matched (EMULATION_DERIVED, below) 2 = hdump[6:0], DECISIONS D9's what-a-wire-does candidate 3 = same as 0
- projects/dataeast/stadium_hero/rtl/sh_main.sv:69 DIAGNOSTIC, and it changes the game (below): 0 = the raster's own blanking, 32 lines -- what DEC0 has (dec0.cpp:1797 set_raw(..., 272, 8, 248)) 1 = MAME stadhero.cpp:380, set_vblank_time(529 us) = 5290 clocks
- projects/dataeast/stadium_hero/rtl/sh_main.sv:109 MAME, measured over 6000 frames: 0.616 passes per frame.
- projects/dataeast/stadium_hero/rtl/sh_main.sv:152 ffc000-ffc7ff mirrored at +0x800 (stadhero.cpp:240) -- addr[11] is ignored, which is what `.mirror(0x000800)` means on the real decode.
- projects/dataeast/stadium_hero/rtl/sh_main.sv:181 COIN bit 7 is vblank and is the only ACTIVE HIGH bit on this board (stadhero.cpp:318).
- projects/dataeast/stadium_hero/rtl/sh_main.sv:186 That pair is the legacy screen setup copied into fourteen dataeast/ drivers; dec0.cpp, the same BAC06/MXC06 generation, has it commented out in favour of the raw 384 x 272 raster this core already generates.
- projects/dataeast/stadium_hero/rtl/sh_main.sv:188 It is here because the game's main loop starts its work when this bit FALLS (0x009330-0x009364), so the bit's length decides where in the raster every 0x30c003 read lands: 20,480 clocks of blanking here against 5,290 in MAME put every read
- projects/dataeast/stadium_hero/rtl/sh_main.sv:193 IRQ5 still asserts on the raster's vblank edge, as MAME's does.
- projects/dataeast/stadium_hero/rtl/sh_main.sv:218 MAME calls it mystery_r and returns m_screen->hpos() / 2 from a 256-wide screen, so 0..127 spread evenly across the line.
- projects/dataeast/stadium_hero/rtl/sh_main.sv:223 Of 1853 reads in 6000 frames (MAME, tools tapped by hand), every site but one masks the value -- & 0x0F, & 0x07, & 0x1F, & 0x7F, BTST #1 -- so the range cannot reach them.
- projects/dataeast/stadium_hero/rtl/sh_main.sv:239 This board's fielders throw to empty bases where MAME's do not, and this is the only difference in anything the 68000 reads -- ROM is byte-identical (tools/check_rom.py), and the only other reads outside RAM are the text layer, the BAC06 VR
- projects/dataeast/stadium_hero/rtl/sh_main.sv:245 So the counter is scaled to MAME's range: x85 >> 8 is /3.01, which maps hdump 0..383 onto 0..127 evenly.
- projects/dataeast/stadium_hero/rtl/sh_main.sv:248 INFERRED, and it stays inferred: nobody has told us how many bits of which counter the real chip puts on this register, and MAME's own header carries `TODO : RNG issue?
- projects/dataeast/stadium_hero/rtl/sh_main.sv:250 What is known is that the game was tuned against the real thing, MAME reproduces it, and 0..191 does not.
- projects/dataeast/stadium_hero/rtl/sh_main.sv:261 It is NOT a hardware claim -- MAME's line is 256 ticks and this board's is 384.
- projects/dataeast/stadium_hero/rtl/sh_main.sv:265 In 68000 clocks a MAME line is 10e6 / 58 / 256 = 673.4914 and a pixel 2.6308, so a 32-bit phase that restarts at 1/512 of a line on the vblank edge and adds 2^32 / 673.4914 = 6377167.44 per clock carries hpos in its top eight bits and hpos/
- projects/dataeast/stadium_hero/rtl/sh_main.sv:271 MAME's frame is 172,414 clocks, which is 256.000 of its lines, so the phase is back at 1/512 before this board's longer frame (174,080) ends: the restart on the edge is continuous with the free-running phase.
- projects/dataeast/stadium_hero/rtl/sh_main.sv:328 Against MAME's 159 that reads as a game running three and a half times too slowly; the true 301 reads as one running faster.
- projects/dataeast/stadium_hero/rtl/sh_main.sv:335 MAME measures 0.621 passes a frame, so 79 here.
- projects/dataeast/stadium_hero/rtl/sh_main.sv:383 MAME does 6630 a frame (tools/sh_pollrate.lua).
- projects/dataeast/stadium_hero/rtl/sh_main.sv:383 This board has 174,080 cycles in a frame against MAME's 172,414 -- the PCB's refresh against a rounded one -- so an identical CPU does 6694, and Verilator says 6694.
- projects/dataeast/stadium_hero/rtl/sh_main.sv:388 That one counts writes of 0x240012 and measures which attract scene is on screen: 99.3 % of passes take exactly one frame, and MAME's own 256-frame windows read 0.004 to 1.000.
- projects/dataeast/stadium_hero/rtl/sh_main.sv:394 A frame in which the game did some work polls less -- MAME's own count runs 4950..6630 across attract -- so an instantaneous reading is a measure of what is on screen and a screenshot catches one frame.
- projects/dataeast/stadium_hero/rtl/sh_main.sv:472 Verilator says 6694 = 0x1A 0x26; MAME's ceiling is 6630 = 0x19 0xE6.
- projects/dataeast/stadium_hero/rtl/sh_main.sv:509 ------------------------------------------------------------- sound latch A write to 0x30c007 raises NMI on the 65C02 (stadhero.cpp:400).
- projects/dataeast/stadium_hero/rtl/memory/sh_progrom.sv:21 bin rng MAME board (SDRAM)
- projects/dataeast/stadium_hero/rtl/memory/sh_progrom.sv:24 2 32..47 27.3 1.1 <- MAME's largest, all but absent
- projects/dataeast/stadium_hero/rtl/memory/sh_progrom.sv:29 7 112..127 0.7 32.3 <- absent in MAME, the board's largest
- projects/dataeast/stadium_hero/rtl/memory/sh_romarb.sv:57 ---- units --------------------------------------------------------------- sh_rommap.svh is in BYTES, because that is the unit MAME's ROM regions and the MRA are in and translating there would put the conversion somewhere nobody looks.
- projects/dataeast/stadium_hero/rtl/memory/sh_romarb.sv:231 On the board the samples that go missing are 8, 9, 10 and 13 -- and MAME says those are exactly the ones started on CHANNEL 2, which is to say the ones asked for while channels 0 and 1 are already consuming ADPCM slots.
- projects/dataeast/stadium_hero/rtl/memory/sh_romarb.sv:283 Every graphics pixel came out with its bits permuted -- MAME's pixel 5 arrived as 10, 6 as 9, 4 as 8 -- so the 3bpp layers lost their MSB entirely at the palette stage and the browns at palette 518/519/532-534 became unreachable.
- projects/dataeast/stadium_hero/rtl/memory/sh_romarb.sv:305 MAME reads the rest of that region back as zero; this image has the CHARACTER ROM there, so an address past the end would play tile graphics as audio.
- projects/dataeast/stadium_hero/rtl/cpu/sh_m68k.sv:13 60 MHz / 6 = 10.000 MHz, this board's 68000 clock (20 MHz XTAL / 2, stadhero.cpp:370, HW_CONFIRMED).
- projects/dataeast/stadium_hero/rtl/cpu/sh_m68k.sv:15 * IPL is driven from a single level-5 line held until acknowledged, so unlike Power Spikes' irq1_line_hold this board does NOT clear on the interrupt-acknowledge cycle -- it clears on a write to 0x30c004 (stadhero.cpp:211).
- projects/dataeast/stadium_hero/rtl/cpu/sh_m68k.sv:82 MAME spreads over all sixteen low nibbles.
- projects/dataeast/stadium_hero/rtl/video/sh_mxc06.sv:4 Behavioural reference: references/upstream/mame/src/mame/dataeast/decmxc06.cpp references/upstream/jtcores/cores/cop/hdl/jtcop_obj_draw.v (GPL-3.0)
- projects/dataeast/stadium_hero/rtl/video/sh_mxc06.sv:13 Stadium Hero has no DMA trigger anywhere in its memory map (stadhero.cpp:226-241) and screen_update reads m_spriteram directly.
- projects/dataeast/stadium_hero/rtl/video/sh_mxc06.sv:19 decmxc06.cpp:100-153 -- the `offs += 4` is INSIDE the width loop, and each pass re-reads `spriteram[offs + 1]` for that column's code while keeping the PARENT's position, palette, flips and height.
- projects/dataeast/stadium_hero/rtl/video/sh_mxc06.sv:29 This module follows MAME on both counts: 4 words for a disabled sprite, 4*w for an enabled one whether or not it touches this line.
- projects/dataeast/stadium_hero/rtl/video/sh_mxc06.sv:33 ---- table format (decmxc06.cpp:17-36) ---------------------------------- word0 [15] enable -- sprite skipped entirely when clear
- projects/dataeast/stadium_hero/rtl/video/sh_mxc06.sv:42 Position is `240 - x` / `240 - y` after a signed 9-bit wrap (decmxc06.cpp:78-83).
- projects/dataeast/stadium_hero/rtl/video/sh_mxc06.sv:47 Working from the bottom edge makes that fall out for free: `veff` is the raster line minus the sprite's bottom, so it counts up from -16h at the top to -1 at the bottom, and its bits 6:4 index the sub-tile in exactly MAME's order without a
- projects/dataeast/stadium_hero/rtl/video/sh_mxc06.sv:54 Later entries overwrite earlier ones, which is what MAME's front-to-back transpen loop produces.
- projects/dataeast/stadium_hero/rtl/video/sh_mxc06.sv:171 decmxc06.cpp works from `240 - y`; this is that plus the 16-pixel tile height, which is where the arithmetic is cheapest.
- projects/dataeast/stadium_hero/rtl/video/sh_mxc06.sv:193 -1 across the sprite, so its bits pick the row's tile in MAME's order and mask the base code at the same time.
- projects/dataeast/stadium_hero/rtl/video/sh_mxc06.sv:229 Flash alternates per frame (decmxc06.cpp:118).
- projects/dataeast/stadium_hero/rtl/video/sh_mxc06.sv:312 MAME draws sprites with transpen (drawgfx.cpp), which skips pen 0 entirely; a line buffer that takes every pixel instead lets a later sprite's empty area ERASE an earlier one.
- projects/dataeast/stadium_hero/rtl/video/sh_mxc06.sv:323 Measured offline before the fix, against a MAME dump of the same frame: tools/render_spr.py with transpen semantics 2538/2542 vs MAME 99.8 % the same model writing pen 0 as well 1828 pixels survive, no head
- projects/dataeast/stadium_hero/rtl/video/sh_mxc06.sv:328 Column c sits at sx + mult*c, mult = -16 normally and +16 flipped (decmxc06.cpp:85-93).
- projects/dataeast/stadium_hero/rtl/video/sh_colmix.sv:4 stadhero.cpp:165-176 is the whole mixer:
- projects/dataeast/stadium_hero/rtl/video/sh_colmix.sv:16 MAME loads it, marks it `// ?` and never reads it (stadhero.cpp:448-449).
- projects/dataeast/stadium_hero/rtl/video/sh_colmix.sv:22 ---- palette ------------------------------------------------------------- 1024 entries of 16 bits at 0x310000, format xBGR_444 (stadhero.cpp:387): bits 11-8 = B, 7-4 = G, 3-0 = R.
- projects/dataeast/stadium_hero/rtl/video/sh_colmix.sv:26 Layer palette bases come from GFXDECODE (stadhero.cpp:356-363):
- projects/dataeast/stadium_hero/rtl/video/sh_colmix.sv:80 which is the 640 reachable entries docs/MAME_NOTES.md section 6 already wrote down, from GFXDECODE_ENTRY at stadhero.cpp:356-363.
- projects/dataeast/stadium_hero/rtl/video/sh_colmix.sv:92 Found by comparing a board screenshot with a MAME snapshot of the same screen: MAME's outfield is green and the board's was orange.
- projects/dataeast/stadium_hero/rtl/video/sh_video.sv:10 Flip screen originates in the BAC06's ctrlreg[0] bit 7 and the driver fans it out to the sprite chip and the text tilemap by hand (stadhero.cpp:167-170).
- projects/dataeast/stadium_hero/rtl/video/sh_char.sv:4 0x200000-0x2007ff is plain SRAM and stadhero.cpp:203 builds a 32x32 tilemap of 8x8 tiles straight out of it:
- projects/dataeast/stadium_hero/rtl/video/sh_bac06.sv:4 Behavioural reference: references/upstream/mame/src/mame/dataeast/decbac06.cpp references/upstream/jtcores/cores/cop/hdl/jtcop_bac06.v (GPL-3.0)
- projects/dataeast/stadium_hero/rtl/video/sh_bac06.sv:19 decbac06.cpp:446:
- projects/dataeast/stadium_hero/rtl/video/sh_bac06.sv:28 dec0.cpp:479-493 maps colscroll_w/rowscroll_w for all three of RoboCop's chips; stadhero.cpp:226-241 maps neither, only vram at 0x260000.
- projects/dataeast/stadium_hero/rtl/video/sh_bac06.sv:37 The whole 8192-word VRAM is therefore tilemap, which matches the two 2063 (8Kx8) SRAMs on the DE-0304-3 layout (stadhero.cpp:65-67).
- projects/dataeast/stadium_hero/rtl/video/sh_bac06.sv:109 decbac06.cpp:26-44
- projects/dataeast/stadium_hero/rtl/video/sh_bac06.sv:127 3 is documented as invalid and behaves as 1 (decbac06.cpp:346-347)
- projects/dataeast/stadium_hero/rtl/video/sh_bac06.sv:130 Column-major mode flips tiles on X and inverts the scroll direction (decbac06.cpp:196, :207, :268).
- projects/dataeast/stadium_hero/rtl/video/sh_bac06.sv:167 MAME returns mode[0] for every register offset and jtcop_bac06.v does the same.
- projects/dataeast/stadium_hero/rtl/video/sh_bac06.sv:202 For GEOM_2X2 16x16 it used MAME's COMMENTED-OUT arrangement -- the one labelled "Needs testing on real hardware, not used by any game".
- projects/dataeast/stadium_hero/rtl/video/sh_bac06.sv:211 MAME's col/row are TILE indices, so they are computed once here rather than slicing an x/8 counter differently at each use -- which is how the off-by-a -factor-of-two crept into the testbench as well.
- projects/dataeast/stadium_hero/rtl/video/sh_bac06.sv:231 Tile indices, in MAME's terms.
- projects/dataeast/stadium_hero/rtl/video/sh_bac06.sv:268 Screen flip mirrors the line buffer's WRITE address, so the last visible column must map to the first: 255 - a, not 256 - a. Drawing in unflipped coordinates and mirroring on the way in is also why the per-tile and per-sprite flip bits are
- projects/dataeast/stadium_hero/rtl/video/sh_bac06.sv:275 This was 9'h100 until 2026-09-03 and the whole flipped picture sat one pixel down and to the right of MAME's. Nothing caught it because nothing had ever run the core flipped: tools/render_frame.py now does, driving the DIP word on the bus
- projects/dataeast/stadium_hero/rtl/video/sh_bac06.sv:305 decbac06.cpp:311-315.
- projects/dataeast/stadium_hero/rtl/video/sh_vtimer.sv:9 stadhero.cpp:53-54
- projects/dataeast/stadium_hero/rtl/video/sh_vtimer.sv:18 and MAME's set_visarea(0, 255, 8, 247) is exactly this window.
- projects/dataeast/stadium_hero/integration/sh_download.sv:24 That is a different shape from Power Spikes, whose MAME entry is ROM_LOAD16_WORD_SWAP -- so tools/build_rom.py must INTERLEAVE the two files here rather than byteswap one.
- README.md:34 | MAME set | 공식 명칭 | 상태 |
- README.md:38 MAME 의 `stadhero` 드라이버에는 이 세트 하나뿐입니다.
- README.md:56 직접 마련한 MAME ROM 세트 zip 을 SD 카드의 `/games/mame/` 에 넣습니다.
- README.md:58 zip 은 MAME 세트 이름 그대로 두고, 압축을 풀지 않습니다.
- README.md:117 | 2026-09-03 | 비디오 경로 전체를 MAME 덤프와 대조하는 골든 모델 작성 — 프레임 단위 100 % 일치 |
- README.md:118 | 2026-09-04 | 실기 화면이 MAME 와 픽셀 단위로 일치함을 확인. 사운드 믹스 보정 |
- README.md:119 | 2026-09-04 | 보드 전체를 Verilator 로 시뮬레이션, 워크 RAM 이 MAME 와 일치 |
- README.md:128 주소 디코드는 MAME 드라이버를 기준으로 하고, jotego 의 `jtcop_snd.v` 가 같은 영역을 같은 주소에 디코드한다는 점을 교차 확인에 썼습니다.
- README.md:133 레지스터 의미와 속성 디코드는 MAME 의 `decbac06.cpp` / `decmxc06.cpp` 를 따르고, jtcores 의 `jtcop` 을 독립적인 두 번째 해석으로 대조했습니다.
- README.md:145 MAME 덤프 기반 골든 모델로 찾았습니다.
- README.md:148 **3bpp 레이어의 팔레트 간격**, **타일맵 주소 계산**, **화면 반전 시 1 픽셀 어긋남**, **싱크 신호의 3 픽셀 지연** — 모두 MAME 와의 픽셀 대조로 찾아 고쳤습니다.
- README.md:153 **YM2203 의 FM 과 SSG 게인이 뒤바뀌어 있었다** — MAME 의 YM 라우팅을 읽고 FBNeo 로 교차 확인해 바로잡았습니다.
- README.md:156 순위를 바꾸고, 음량을 MAME 와 같은 조건에서 측정해 보정했습니다.
- README.md:158 **특정 투수의 공이 MAME 보다 맞지 않았다** — 게임이 난수로 쓰는 `0x30c003` 레지스터의 값 범위와 CPU 가 보는 VBLANK 길이가 MAME 와 달라, CPU 투수 AI 의 구종 선택이 MAME 와 반대로 고정되어 있었습니다.
- README.md:160 두 값의 기본을 MAME 호환으로 바꾼 뒤, 시뮬레이션에서 투구 1–9 구의 구종·비행, 첫 투구 타격 가능 구간, 번트, 두 번째 CPU 투수, 긴 경기 구간이 MAME 와 일치함을 확인했습니다.
- README.md:172 먼저 **MAME 개발팀**에 깊이 감사드립니다.
- README.md:172 이 코어의 메모리 맵, 클럭, 인터럽트, 화면 기하, 그래픽 디코드, DIP 기본값, 사운드 라우팅, 두 커스텀 칩의 동작은 모두 MAME 소스에서 배웠습니다.
- README.md:178 https://github.com/mamedev/mame
- README.md:199 참고한 MAME 소스
- README.md:201 MAME 의 BSD-3-Clause 는 GPL 과 호환됩니다.
- README.md:204 | MAME 파일 | 라이선스 | copyright-holders | 참고한 내용 |
- README.md:206 | `src/mame/dataeast/stadhero.cpp` | BSD-3-Clause | Bryan McPhail | 메모리 맵, 클럭, 인터럽트, 화면, gfxdecode, DIP, 사운드 라우팅, ROM 구성, `0x30c003` 동작 |
- README.md:207 | `src/mame/dataeast/decbac06.cpp` | BSD-3-Clause | Bryan McPhail, David Haywood | BAC06 레지스터 의미, 타일맵 주소 계산, 스크롤 |
- README.md:208 | `src/mame/dataeast/decmxc06.cpp` | BSD-3-Clause | Bryan McPhail, David Haywood | MXC06 속성 디코드, 다중 폭 스프라이트 순회 (구조적으로 따름) |
- README.md:209 | `src/mame/dataeast/dec0.cpp` | BSD-3-Clause | Bryan McPhail | 같은 세대 기판의 화면 타이밍, 열/행 스크롤 매핑 비교 |
- README.md:211 | `src/emu/screen.cpp` | BSD-3-Clause | Aaron Giles | `hpos()` 계산 방식 (난수 레지스터의 MAME 호환 모드) |
- README.md:212 | `src/emu/drawgfx.cpp` | BSD-3-Clause | Nicola Salmoria, Aaron Giles | 투명 펜(pen 0) 처리 |
- README.md:223 **FBNeo** (`d_stadhero.cpp`) — M6295 클럭, GFX ROM 오프셋, DIP 조합, 68000 ROM 인터리브, 사운드 게인 순서를 교차 확인하는 데만 읽었습니다.
- README.md:239 **난수 레지스터(`0x30c003`)와 CPU 가 보는 VBLANK 길이는 MAME 의 동작을 따른 값입니다.** 실제 PCB 가 이 값을 어떻게 만드는지는 확인되지 않았습니다.
- README.md:240 투구· 타격의 게임성은 MAME 와 일치하도록 맞췄고, OSD 의 Debug 페이지에서 다른 후보(보드 래스터 기반)로 바꿔 볼 수 있습니다.
- README.md:243 **어트랙트 데모의 대진이 MAME 와 다를 수 있습니다.** 이 코어는 PCB 의 프레임 주기(57.44 Hz)를 쓰고 MAME 는 58 Hz 로 가정하기 때문입니다.
- README.md:246 **CPU 팀의 도루 동작은 MAME 와 대조하지 못했습니다.**
- README.md:247 **`ef19.3d` PROM 은 구현하지 않았습니다.** MAME 도 이 PROM 을 읽지 않으며, 이 기판의 레이어 순서는 고정입니다.
- README.md:249 검증은 MAME 와의 대조 및 MiSTer 실기 플레이를 기준으로 합니다.
MAMEと一致する、MAMEに合わせた、またはMAMEで確認したと記載 — 6
MAMEから移植・書き写した、または取り入れたと記載 — 1
MAMEドライバと同じ文言を含む(出典の明記なし) — 2