← All cores
Godzilla
Cites hardware references or measurements that MAME's driver also gives — 1
Reports a measurement taken on the original PCB — 1
Says it was checked on “real hardware” — 4
Cites MAME source — 177
- Godzilla.sv:208 Offset per-layer Godzilla: MAME visarea parte da (0,0) (set_raw vbend=0, legionna.cpp:1318) e godzilla NON definisce scrolldx/dy per BG/MG/FG ne' sprite offset (nessun set_offset, legionna.cpp:1331) → tutti 0.
- Godzilla.sv:213 NB: godzilla ha anche tile_scroll_base_w (legionna_v.cpp:58-65): reg base 7 → text set_scrolldy(0x1ef - data).
- Godzilla.sv:328 --- Joystick to SD Gundam input mapping --- MAME P1_P2 port ($E0002): active low.
- Godzilla.sv:331 MiSTer joy bits: joy[0]=R, joy[1]=L, joy[2]=D, joy[3]=U, joy[4]=A, joy[5]=B. MAME PLAYERS12 (legionna.cpp:439-444): bit[0]=UP, [1]=DOWN, [2]=LEFT, [3]=RIGHT, [4]=BTN1, [5]=BTN2, [6]=BTN3, [7]=unused (active low).
- Godzilla.sv:341 Godzilla SYSTEM port ($10074C) — MAME legionna.cpp:427-436 bit0 = START1 (active LOW) bit1 = START2 (active LOW) bit2..7 = UNKNOWN → tied 1 bit8..15 = UNKNOWN → tied 1 Coin inputs NON sono qui: vanno via SEIBU_COIN_INPUTS → Z80 → soundlatch
- Godzilla.sv:695 ── Flip screen (CRTC reg 0x1A bit 0) ─────────────────────────────────────── MAME: BIT(reg_1a, 0) → flip_screen.
- Godzilla.sv:741 ── Text layer renderer (8x8, 4bpp, 64x32 grid) ───────────────────────────── Godzilla MAME (ROM_START godzilla): "char" = REGIONE PROPRIA 128KB (11.620/10.615, ROM_LOAD16_BYTE), NON dentro user1 come Legionnaire.
- Godzilla.sv:754 Godzilla text scroll-base (CRTC reg 0x3A, hook godzilla-only legionna.cpp:1326).
- Godzilla.sv:755 Calibrazione HW di famiglia (dump vregs in seibu_crtc.cpp): Legionnaire reg=0x01FF, visarea da riga 16 → 0x1FF-0x1EF=+16 = ESATTAMENTE il vecchio yoff text +16 del core Legionnaire funzionante; D-Con reg=0xFFEF (low9=0x1EF), visarea da 0 →
- Godzilla.sv:759 La formula MAME set_scrolldy(0x1EF-data) è INVERTITA rispetto all'HW (convenzione dy del tilemap.cpp) — mai fidarsi del verso MAME.
- Godzilla.sv:797 Godzilla CRTC scroll passthrough (legionna_v.cpp:34-49 tile_scroll_w): scroll_ram[0/1] → BG (m_background_layer) scroll_ram[2/3] → MG (m_midground_layer) scroll_ram[4/5] → FG (m_foreground_layer) Nel nostro CRTC: xscroll_l0 = ram[0/1], xscr
- Godzilla.sv:815 Godzilla BG: tilemap 32x32 (legionna_v.cpp:204).
- Godzilla.sv:816 MAME GFXDECODE "back" color base = 0 (gfx_legionna riga 1168), 32 colorset.
- Godzilla.sv:817 HAS_TRANSP=1 perché m_background_layer->set_transparent_pen(15) in legionna_v.cpp:216 (pen 15 = trasparente, NON opaco come Blood Bros).
- Godzilla.sv:839 Godzilla MG: 16x16, 4bpp, 32x32 tilemap (legionna_v.cpp:204).
- Godzilla.sv:840 get_mid_tile_info_share_bgrom (legionna_v.cpp:158): MG share BG ROM, tile = (vram & 0xfff) | 0x1000 (= seconda metà della BG ROM) color = ((vram >> 12) & 0xf) | 0x10 (= palette set superiore: bit 4 = 1) In palette MAME "back" base = 0,
- Godzilla.sv:867 Godzilla FG: tilemap 32x32 (legionna_v.cpp:213).
- Godzilla.sv:869 MAME GFXDECODE "fore" color base = 32*16 = 0x200, 16 colorset.
- Godzilla.sv:879 GODZILLA: fore = bg2.619 ROM_LOAD16_WORD_SWAP (legionna.cpp:1987) = IDENTICO alla back bg1.618 → stesso decode DCBA di BG/MG (riscontro HW utente: col BADC il FG era sbagliato).
- Godzilla.sv:887 Godzilla: bit 2 = FG (legionna_v.cpp:344)
- Godzilla.sv:974 Anticipando di 1 l'indirizzo e il DE, il dato campionato al tick e' quello del pixel CORRENTE: allineamento coi tile ripristinato (= calibrazione +1 pixel-hunting MAME, fatta prima del fix CRT) e colonna 0 coperta.
- Godzilla.sv:1008 MAME riferimenti (GODZILLA — diverso da legionna!): legionna_v.cpp:247-251 m_sprite_pri_mask[0..3] per godzilla: pri=0 → 0xFFF0 (copre pri-value 0,1,2 → bg,mg,fg → SOTTO text) pri=1 → 0xFFFC (copre 0,1 → bg,mg → sotto fg,text) pri=2 → 0x
- Godzilla.sv:1028 MAME godzilla legionna_v.cpp:382 bitmap.fill(0xff) "matches PCB recording"
- Godzilla.sv:1049 Backdrop = palette[0x0FF] reale (MAME godzilla: bitmap.fill(0xff), match PCB).
- rtl/Godzilla/Godzilla_audio_z80.sv:25 Spec da MAME (legionna.cpp godzilla machine config :1295-1355): - Z80 @ 14.318180/4 = 3.579545 MHz (seibu_sound_map + godzilla_sound_io_map) - YM2151/OPM (jt51) @ 3.579545 MHz, route ch0+ch1 0.50 su mono - OKI M6295 (jt6295) @ 20MHz/20 = 1.
- rtl/Godzilla/Godzilla_audio_z80.sv:57 Godzilla pcm.922 = 512KB: bit 18 = bank (Z80 IO port 0, MAME godzilla_oki_bank_w: set_rom_bank(data&1)).
- rtl/Godzilla/Godzilla_audio_z80.sv:364 MAME seibu_sound_device::main_r (seibusound.cpp:279): case 2,3: return sub2main[offset-2] (soundlatch data: coin/input dal Z80) case 5: return main2sub_pending ?
- rtl/Godzilla/Godzilla_audio_z80.sv:379 ─── YM2151 (jt51) — GODZILLA usa OPM, non OPL2 (legionna.cpp:1340) ────── Il driver Z80 programma i timer OPM (reg 0x10-0x14): su jtopl2 non scattava mai l'IRQ → RST10 morto → sequencer musica fermo.
- rtl/Godzilla/Godzilla_audio_z80.sv:419 MAME: route 0.50+0.50 su mono (legionna.cpp:1342-1343)
- rtl/Godzilla/Godzilla_audio_z80.sv:422 ─── OKI bank — GODZILLA: Z80 "OUT (0),A" → banco ROM OKI (512KB = 2×256KB) MAME godzilla_sound_io_map (legionna.cpp:282-286) port 0 → godzilla_oki_bank_w: m_oki->set_rom_bank(data & 1) (write tipica 0x02/0x03).
- rtl/Godzilla/Godzilla_audio_z80.sv:434 ─── OKI M6295 (jt6295) — PIN7_HIGH (20MHz/20 = 1.0 MHz, legionna.cpp:1345)
- rtl/Godzilla/Godzilla_cop3.sv:4 MAME-faithful implementation of the Seibu SEI300 chip as used by the `legionna` driver (Godzilla 1992 — Banpresto/TAD).
- rtl/Godzilla/Godzilla_cop3.sv:7 Reference (in this repo): MAME seibucop.cpp MAME seibucop_cmd.ipp MAME seibucop_dma.ipp MAME legionna.cpp
- rtl/Godzilla/Godzilla_cop3.sv:136 MAME cop_itoa_digits[10]: BCD digits of cop_itoa (low<<0 | high<<16).
- rtl/Godzilla/Godzilla_cop3.sv:140 Il vecchio loop a sottrazioni ripetute era O(valore) (~valore/9 clk): con i long 32-bit di godzilla (score, writer $156E/$1F93E) il 68k restava congelato (dma_busy include bcd_pending) fino a MILLISECONDI per chiamata — su MAME/HW reale i d
- rtl/Godzilla/Godzilla_cop3.sv:153 MAME cop_program command table (seibucop.cpp lines 318-457) At boot, game code uploads 32 macro slots × 8 micro-op words via pgm_addr (0x100434) → slot*8 + sub-index pgm_data (0x100432) → micro-op word pgm_value (0x100438) → cop_func_valu
- rtl/Godzilla/Godzilla_cop3.sv:160 MAME calls find_trigger_match(triggerval, 0xff00) to find the slot whose cop_func_trigger matches.
- rtl/Godzilla/Godzilla_cop3.sv:256 Triggers (write-only addresses) MAME legionna.cpp:172 maps cop_cmd_w to $100500-$100505 (3 words).
- rtl/Godzilla/Godzilla_cop3.sv:330 0x100410 sprite_dma_inc (MAME cop_sprite_dma_inc_w): if x_clip in [-160, 320): cop_regs[4] += 8.
- rtl/Godzilla/Godzilla_cop3.sv:331 MA in MAME sprite_x e' uint16_t assegnato a int -> MAI negativo -> il -160 e' codice morto: check EFFETTIVO = unsigned < 320 (X "negative" 0xFFxx NON avanzano il puntatore entry).
- rtl/Godzilla/Godzilla_cop3.sv:336 0 : 1 (unsigned <320 provato su HW = REGRESSIONE; il signed [-160,320) dell'intento MAME e' il comportamento giusto sul core)
- rtl/Godzilla/Godzilla_cop3.sv:343 A size==0 NON wrappare (il size-- uint di MAME wrapperebbe a $FFFF: il loop del builder su status[1] andrebbe in livelock — provato peggio).
- rtl/Godzilla/Godzilla_cop3.sv:378 Macro program upload — MAME seibucop.cpp lines 318-457 pgm_data writes one micro-op word to cop_program[latch_addr] AND latches the slot's trigger/value/mask from current latch regs.
- rtl/Godzilla/Godzilla_cop3.sv:479 itoa_digits (MAME 0x100590-99, 5 word).
- rtl/Godzilla/Godzilla_cop3.sv:491 Status / dist / angle (seibucop.cpp:916 cop_status_r → cop_status)
- rtl/Godzilla/Godzilla_cop3.sv:502 MAME open bus
- rtl/Godzilla/Godzilla_cop3.sv:569 commit write al dst ASSOLUTO (fill/mr), 1:1 MAME write_word(dst)
- rtl/Godzilla/Godzilla_cop3.sv:605 LEGACY sprite-DMA (seibucop_cmd.ipp): 6880 (carica rel_xy), c480 (single-step: compone l'entry sprite a cop_regs[4]+offs con X/Y = rel + (obj - abs)).
- rtl/Godzilla/Godzilla_cop3.sv:629 write angolo (word {0,angle} come MAME host_endian)
- rtl/Godzilla/Godzilla_cop3.sv:641 Trigger latches — MAME seibucop.cpp cop_cmd_w line 1069.
- rtl/Godzilla/Godzilla_cop3.sv:642 MAME dispatches on raw data after clearing cop_status bit 15.
- rtl/Godzilla/Godzilla_cop3.sv:696 DMA mode 0x80-0x87: MAME dma_palette_brightness() fa FADE solo con pal_brightness_mode 4/5; con qualsiasi altro valore fa una COPIA SEMPLICE src->dst (ramo else, seibucop_dma.ipp:119-123) verso QUALUNQUE dst — incl.
- rtl/Godzilla/Godzilla_cop3.sv:704 DMA generici 0x09/0x0E: MAME write_word(dst) va nello spazio host = arriva a QUALSIASI RAM mappata, incluse le BRAM video ($101000-$105FFF: staging tilemap, palette-stage $104000, sprite $105000).
- rtl/Godzilla/Godzilla_cop3.sv:712 Output del fade/blend 0x8x: MAME dma_palette_brightness fa write_word(dst) nello SPAZIO HOST = raggiunge QUALUNQUE RAM mappata (pal-stage $104000, sprite $105800, Main RAM...).
- rtl/Godzilla/Godzilla_cop3.sv:715 Ora: pal_val registrato in D_FADE_WRITE e committato in D_FADE_COMMIT via canale fill (decode per dst assoluto in main_top: bg/fg/mg/txt/pal/spr) o mr (dst in Main RAM) — 1:1 MAME.
- rtl/Godzilla/Godzilla_cop3.sv:718 (Il vecchio dma80_to_spr era INVERTITO: il blit pietre e' src=$105800 dst=$104000, non il contrario — MAME map: $100478=SRC, $10047C=DST.)
- rtl/Godzilla/Godzilla_cop3.sv:721 LEGACY sprite-DMA state (MAME m_sprite_dma_rel_x/y, m_sprite_dma_x_clip)
- rtl/Godzilla/Godzilla_cop3.sv:824 MAME cop_cmd_w (seibucop.cpp:1075):
- rtl/Godzilla/Godzilla_cop3.sv:858 find_trigger_match (seibucop.cpp:464) Cerca slot N tale che (trigger & 0xf800) == (cop_func_trigger[N] & 0xf800) && cop_func_trigger[N] != 0.
- rtl/Godzilla/Godzilla_cop3.sv:860 Restituisce canonical trigger value del slot (NB: MAME LEGACY_cop_cmd_w usa il match slot per dispatchare; in pratica equivale a restituire cop_func_trigger[slot]).
- rtl/Godzilla/Godzilla_cop3.sv:881 fade_table — MAME seibucop.cpp:733 (reverse engineered from Seibu Cup Soccer bootleg) v = pal_channel(5-bit) | (brightness_val_xor_X) [10-bit input] low = v & 0x1F high = v & 0x3E0 return (low * (high | (high>>5)) + 0x210) >> 10 [8-bit o
- rtl/Godzilla/Godzilla_cop3.sv:920 ── Hitbox b100/b900 scratch (MAME cop_collision_update_hitbox) ────────────── dx[i] = int8 (signed) byte basso, size[i] = uint8 (unsigned) byte alto del word descrittore @ hitadr2+2*i. 3 assi (Y,X,Z) per Godzilla.
- rtl/Godzilla/Godzilla_cop3.sv:927 num_axis: MAME seibucop.cpp:1010 "if (data & 0x100) num_axis = 3" else 2.
- rtl/Godzilla/Godzilla_cop3.sv:929 res init 7 vs 3 (seibucop.cpp:1038-39).
- rtl/Godzilla/Godzilla_cop3.sv:956 Con 16-bit frac + 24 iter + z>>16: 0 divergenze di decisione vs MAME int(atan(dx/dy)*128/pi) su ~640k casi (dimostrato numericamente).
- rtl/Godzilla/Godzilla_cop3.sv:1199 MAME cop_dma_trigger_w: NON modifica cop_status (vedi seibucop.cpp:741).
- rtl/Godzilla/Godzilla_cop3.sv:1207 MAME dma_tilemap_buffer: copy staging RAM → renderer BRAM src = cop_dma_src[mode] << 6 (byte addr 0x101000+ = staging) dst = i (loop counter 0..0x13FF = renderer index) count = 0x2800/2 = 5120 words
- rtl/Godzilla/Godzilla_cop3.sv:1217 MAME dma_palette_buffer: copy staging palette → renderer src = cop_dma_src[mode] << 6 (0x104000 = palette staging) dst = i (loop counter 0..0x7FF = renderer index) count = 0x1000/2 = 2048 words
- rtl/Godzilla/Godzilla_cop3.sv:1227 MAME write_word(dst) su spazio host: con dst nelle BRAM video ($101000-$105FFF: staging/pal/spr, es.
- rtl/Godzilla/Godzilla_cop3.sv:1240 simplified, MAME size>>1
- rtl/Godzilla/Godzilla_cop3.sv:1245 MAME seibucop_dma.ipp dma_palette_brightness() mode 5/4.
- rtl/Godzilla/Godzilla_cop3.sv:1248 MAME formulas: src = cop_dma_src[mode] << 6 dst = cop_dma_dst[mode] << 6 size = ((cop_dma_size << 5) - (cop_dma_dst << 6) + $20)/2 Init: src=$106000, dst=$104000, size=($827F<<5 - $4100<<6 + $20)/2 = ($104FE0 - $104000 + $20)/2 = $1000
- rtl/Godzilla/Godzilla_cop3.sv:1259 MAME size = (((size<<5) - (dst<<6) + 0x20)/2)
- rtl/Godzilla/Godzilla_cop3.sv:1265 MAME: mode 4/5 = fade palette; QUALSIASI ALTRO = copia semplice src->dst (seibucop_dma.ipp:119-123).
- rtl/Godzilla/Godzilla_cop3.sv:1275 MAME seibucop.cpp cop_dma_trigger_w case 0x116 — GODZILLA: fill come 0x118 ma SENZA guard dst!=0 e length bytes = (size+1)<<4 (metà).
- rtl/Godzilla/Godzilla_cop3.sv:1277 legionna.cpp:56-61: "The COP-MCU appears to write to the work ram area, otherwise it RESETS in mid-animation of the title screen" → senza questo fill il gioco torna al logo da solo.
- rtl/Godzilla/Godzilla_cop3.sv:1288 Skip if dst != 0 (MAME guard, dma.ipp:135)
- rtl/Godzilla/Godzilla_cop3.sv:1301 MAME cop_cmd_w (seibucop.cpp:1073): cop_status &= 0x7fff (clear bit 15).
- rtl/Godzilla/Godzilla_cop3.sv:1303 MAME: cop_status &= 0x7fff (clear bit 15).
- rtl/Godzilla/Godzilla_cop3.sv:1318 MAME LEGACY_cop_cmd_w: find_trigger_match(data, 0xF800) → slot per GRUPPO f800, poi handler dal microcodice caricato.
- rtl/Godzilla/Godzilla_cop3.sv:1344 MAME execute_0205: read dword at cop_regs[0]+4+offset*4 (ppos)
- rtl/Godzilla/Godzilla_cop3.sv:1365 0x138e / 0x338e — atan(dx/dy) MAME execute_338e.
- rtl/Godzilla/Godzilla_cop3.sv:1367 Parte da r1+4 hi (offset 0x0004), come 3BB0/MAME.
- rtl/Godzilla/Godzilla_cop3.sv:1375 r1+4 hi (MAME read_dword(r1+4) primo)
- rtl/Godzilla/Godzilla_cop3.sv:1390 MAME: raw_angle = cop_read_word(r0+0x34) = host_read_word(0x34^2 = 0x36); amp = cop_read_word(r0+0x36) = host_read_word(0x36^2 = 0x34).
- rtl/Godzilla/Godzilla_cop3.sv:1407 0xa180 — collision read pos for slot 0 MAME cop_collision_read_pos: cop_read_word(spradr+N) = host_read_word((spradr+N)^2) per host_endian=true.
- rtl/Godzilla/Godzilla_cop3.sv:1428 b000 NON e' un no-op: il dispatcher LEGACY di godzilla (seibucop.cpp:1365) matcha con mask 0xf800, quindi la patch init_godzilla (b100->b000) ESEGUE comunque l'update ma con num_axis=2 (bit8=0 = Z disattivata).
- rtl/Godzilla/Godzilla_cop3.sv:1536 Mode 4 (GODZILLA/Denjin, seibucop_dma.ipp:87-117): indice = (val*2)[4:0], val 0x0010/0xFFFF = TARGET PURO, NESSUN bypass bit15.
- rtl/Godzilla/Godzilla_cop3.sv:1583 MAME: m_host_space->write_word(dst, pal_val) — dst ASSOLUTO.
- rtl/Godzilla/Godzilla_cop3.sv:1617 MAME (0x118 e 0x116): write_dword(i, v1 | v2<<16) su spazio BE 68k → word a i = v2, word a i+2 = v1 (alternati).
- rtl/Godzilla/Godzilla_cop3.sv:1630 Macro 0x0205 — linear movement (MAME execute_0205) ppos = read_dword(cop_regs[0]+0x04) vel = read_dword(cop_regs[0]+0x10) npos = ppos + vel write_dword(cop_regs[0]+0x04, npos) delta = (npos>>16) - (ppos>>16) write_word(cop_regs[0]+0x1E, re
- rtl/Godzilla/Godzilla_cop3.sv:1673 MAME cop_read/write_word(cop_regs[0]+0x1e) = host word @ (0x1e^2)=0x1c (host endianness word^2; conferma doc 06 micro-op 'addmem16 0x1C(r0)').
- rtl/Godzilla/Godzilla_cop3.sv:1691 Macro 0x0905/0x0904 — jump (MAME execute_0904) write_dword(cop_regs[0]+0x10, read_dword(cop_regs[0]+0x10) ± read_dword(cop_regs[0]+0x28)) 0x0905 (bit 0=1) = +, 0x0904 (bit 0=0) = -
- rtl/Godzilla/Godzilla_cop3.sv:1717 MAME execute_0904: bit 0 di data = 1 → add, =0 → sub tmp32_a = vel ± grav.
- rtl/Godzilla/Godzilla_cop3.sv:1748 0x138E/0x338E atan(dx/dy) — MAME execute_338e (cmd.ipp:159) dx = read_dword(r1+4) - read_dword(r0+4) dy = read_dword(r1+8) - read_dword(r0+8) if(!dy){status|=0x8000; angle=0} else angle=atan(dx/dy)*128/pi; dy<0→+0x80 if(data&0x80) write_byt
- rtl/Godzilla/Godzilla_cop3.sv:1796 MAME: angle = atan(dx/dy)*128/pi (+0x80 se dy<0).
- rtl/Godzilla/Godzilla_cop3.sv:1798 Cosi' z = atan(dx/dy) e il +0x80 (in WR) copre solo il quadrante, come MAME.
- rtl/Godzilla/Godzilla_cop3.sv:1800 NIENTE prescale: i dword diff sono FIXED-POINT coord<<16 (come il 3BB0 che usa dx32[31:16] e MAME dx>>16), NON interi piccoli.
- rtl/Godzilla/Godzilla_cop3.sv:1841 MAME (int)(...) tronca VERSO ZERO.
- rtl/Godzilla/Godzilla_cop3.sv:1843 BUG TROVATO (validato vs MAME su 29241 casi): il CORDIC SOTTO-CONVERGE di 1 LSB sulle DIAGONALI (es.
- rtl/Godzilla/Godzilla_cop3.sv:1848 Compenso l'epsilon di sotto-convergenza con +1 toward-zero PRIMA del troncamento: bias=1 azzera tutte le 133 divergenze (bias=0) -> 0/29241 vs MAME.
- rtl/Godzilla/Godzilla_cop3.sv:1857 MAME execute_338e (seibucop_cmd.ipp:175-188): la write dell'angolo in RAM (obj+0x34 host, gated da data&0x80) e' FUORI dall'if/else di dy -> avviene SEMPRE, anche a dy==0 (dove cop_angle=0 -> scrive 0^0x80 = 0x80).
- rtl/Godzilla/Godzilla_cop3.sv:1863 Ora calcolo ang_byte in entrambi i rami e scrivo SEMPRE, come MAME.
- rtl/Godzilla/Godzilla_cop3.sv:1870 Scrivere l'angolo anche a dy==0 ("1:1 MAME") REGREDISCE: il martello scivola/moonwalk.
- rtl/Godzilla/Godzilla_cop3.sv:1873 MAME: dy==0 -> cop_angle=0
- rtl/Godzilla/Godzilla_cop3.sv:1896 0x3BB0 dist — MAME execute_3b30 (cmd.ipp:197) dx = (read_dword(r1+4) - read_dword(r0+4)) >> 16 (aritmetico) dy = (read_dword(r1+8) - read_dword(r0+8)) >> 16 cop_dist = sqrt(dx*dx + dy*dy) if(data&0x80) write_word(r0 + (data&0x200?0x3a:0x38
- rtl/Godzilla/Godzilla_cop3.sv:2005 (Il fix MAME-aligned 0x3a:0x38 faceva fuggire i nemici -> MAME invertito vs HW.
- rtl/Godzilla/Godzilla_cop3.sv:2012 MAME: macro completata → cop_status = 7 (gate-poll del gioco).
- rtl/Godzilla/Godzilla_cop3.sv:2098 0x8100/0x8900 sin/cos (MAME execute_8100/8900) raw_angle = cop_read_word(cop_regs[0]+0x34) & 0xff amp = (65536>>5) * (cop_read_word(cop_regs[0]+0x36) & 0xff) = 2048 * amp_byte if (raw_angle == 0xC0 sin / 0x80 cos): amp *= 2 res = int(
- rtl/Godzilla/Godzilla_cop3.sv:2137 MAME special-case: sin && raw==0xC0 OR cos && raw==0x80 → amp *= 2
- rtl/Godzilla/Godzilla_cop3.sv:2183 0xa180/0xa980 — read pos (MAME cop_collision_read_pos) flags_swap = cop_read_word(spradr+2) → host_read_word(spradr+0) pos[0] = cop_read_word(spradr+6) → host_read_word(spradr+4) pos[1] = cop_read_word(spradr+10) → host_read_word(
- rtl/Godzilla/Godzilla_cop3.sv:2190 Però MAME cop_read_word(+2) = host_read_word(+2^2) = host_read_word(+0).
- rtl/Godzilla/Godzilla_cop3.sv:2201 rdata = word @ host+0 = flags (MAME cop_read_word(spradr+2) ^ 2).
- rtl/Godzilla/Godzilla_cop3.sv:2210 rdata = word @ host+4 = pos[0] (Y axis per MAME)
- rtl/Godzilla/Godzilla_cop3.sv:2230 0xb100/0xb900 — update hitbox & compute intersection (1:1 MAME cop_collision_update_hitbox, seibucop.cpp:1003-1065).
- rtl/Godzilla/Godzilla_cop3.sv:2277 2 assi (b000/b800): terza word NON letta, dx/size azzerati (seibucop.cpp:1014-1022)
- rtl/Godzilla/Godzilla_cop3.sv:2316 2 assi: l'asse 2 (Z) NON viene aggiornato (loop MAME i<num_axis)
- rtl/Godzilla/Godzilla_cop3.sv:2335 res init: 3 assi = 111, 2 assi = 011 (seibucop.cpp:1038-39: bit Z gia' 0 = "collide banale" -> hit deciso solo da X/Y)
- rtl/Godzilla/Godzilla_cop3.sv:2359 LEGACY 6880 — carica rel_xy per il prossimo c480 (MAME LEGACY_execute_6980: rel_xy = read_word(spr_src+4+offs))
- rtl/Godzilla/Godzilla_cop3.sv:2372 LEGACY c480 — single-step sprite DMA (MAME LEGACY_execute_c480): info = read(spr_src+offs) + (param & 0x3f) -> entry+0 abs = read(regs[0]+8/+4) - spr_dma_abs_x/y X(fx/dx/rel_x) -> entry+4 (+ x_clip per l'inc $410) Y(fy/rel_y) -> entry+6
- rtl/Godzilla/Godzilla_cop3.sv:2478 6200 — rotate-towards (MAME execute_6200, variante grainbow che godzilla CARICA nella tabella): angle(obj host+0x37) ruota verso cop_angle_target di cop_angle_step; flags(host+2) bit2=raggiunto.
- rtl/Godzilla/Godzilla_cop3.sv:2481 Dominio angolo: il nostro 138e scrive in RAM plain^0x80 (is_yflip) -> lavoro nel dominio stored con target^0x80: il DELTA e' rotazione-invariante => matematica IDENTICA a MAME.
- rtl/Godzilla/Godzilla_cop3.sv:2484 Write angolo = WORD {0,angle} (MAME host_endian write-word).
- rtl/Godzilla/Godzilla_cop3.sv:2505 wrap a signed 8-bit (MAME: +=/-=256 su int)
- rtl/Godzilla/Godzilla_main_top.sv:213 VBLANK IRQ4 — MAME legionna.cpp: m_maincpu->set_vblank_int(irq4_line_hold) MAME HOLD_LINE: IRQ asserted on edge, released ONLY at IACK (= when CPU fetches vector).
- rtl/Godzilla/Godzilla_main_top.sv:218 VBLANK IRQ4 — MAME legionna.cpp: m_maincpu->set_vblank_int(irq4_line_hold) MAME HOLD_LINE: IRQ asserted on edge, released ONLY at IACK (= when CPU fetches vector).
- rtl/Godzilla/Godzilla_main_top.sv:473 COP3 cmd 0x14 dma_tilemap_buffer (legionna_v.cpp:86 videowrite_cb_w): offset 0x000..0x3FF → BG (back_data) offset 0x400..0x7FF → FG (fore_data) offset 0x800..0xBFF → MG (mid_data) offset 0xC00..0x13FF → Text (textram, 0x800 word) SRC
- rtl/Godzilla/Godzilla_main_top.sv:497 Il fill scrive le BRAM STAGING (= la host RAM di MAME): il per-frame DMA 0x14/0x15 le propaga al renderer.
- rtl/Godzilla/Godzilla_main_top.sv:510 ── SPLIT STAGING vs RENDERER (semantica MAME 2-stadi, come la palette) ───── MAME godzilla: $101000-$103FFF e' .ram() PURO (handler background_w/… COMMENTATI nel map, legionna.cpp) — le scritture CPU NON toccano i tilemap.
- rtl/Godzilla/Godzilla_main_top.sv:513 I tilemap leggono m_back/fore/mid_data/m_textram = buffer SEPARATI (make_unique_clear, legionna_v.cpp) scritti SOLO da videowrite_cb_w = DMA 0x14.
- rtl/Godzilla/Godzilla_main_top.sv:518 u_XX_ram = STAGING: porta A = CPU (+fill 0x116/0x118, come MAME che filla la host RAM), porta B = sorgente del DMA 0x14.
- rtl/Godzilla/Godzilla_main_top.sv:521 Coppia contenuto/scroll = atomica a livello ISR, come MAME.
- rtl/Godzilla/Godzilla_main_top.sv:593 ── Palette: split STAGING ($104000) vs RENDERER (semantica MAME 2-stadi) ─── MAME: la CPU e il fade (cmd 0x80) scrivono la STAGING RAM a $104000.
- rtl/Godzilla/Godzilla_main_top.sv:617 MAME godzilla: $104000 e' RAM pura (legionna.cpp:262, handler palette commentato) — la palette VISIBILE si aggiorna SOLO via paletteramout_cb = dma_palette_buffer 0x15 (seibucop_dma.ipp:27); il fade DMA scrive lo STAGING (host RAM, dma.ipp:
- rtl/Godzilla/Godzilla_maincpu_map.sv:23 Main CPU memory map Godzilla (legionna.cpp legionna_map): $000000-$07FFFF ROM 68K (512KB) → SDRAM via bridge $100000-$1003FF RAM scratch (1KB) → BRAM (Main RAM low) $100400-$1006FF COP3 region → m
- rtl/Godzilla/Godzilla_maincpu_map.sv:129 Text VRAM: $102800-$1037FF = 4KB = 2048 word (MAME common_video_allocate_ptr alloca textram a 0x1000/2 word, videowrite_cb_w smista offset < 0x2800/2).
- rtl/Godzilla/Godzilla_maincpu_map.sv:139 godzilla_map (legionna.cpp:257): 0x100800-0x100FFF .ram() — SOLO godzilla, legionna non ce l'ha (buco ereditato dal porting).
- rtl/Godzilla/Godzilla_maincpu_map.sv:215 MAME legionna_map: main_r/main_w(offset>>1) con umask16(0x00ff).
- rtl/Godzilla/Godzilla_maincpu_map.sv:219 Vedi seibusound.cpp main_r/main_w.
- rtl/Godzilla/Godzilla_maincpu_map.sv:226 MAME godzilla_setgfxbank: (data&0x4000)>>2
- rtl/Godzilla/Godzilla_maincpu_map.sv:267 ─── init_godzilla (legionna.cpp:2624-2634) ───────────────── Kludge Z-axis collisioni (seibucop.cpp:52-54: "Super X missiles, Tokyo's tower ...
- rtl/Godzilla/Godzilla_maincpu_map.sv:322 Replica la latenza-zero-osservabile di MAME (cop_cmd_w sincrono): il gioco legge cop_hit_val_stat/cop_angle ($188/$1b4) nell'istruzione dopo il trigger.
- rtl/Godzilla/Godzilla_palette.sv:25 MAME: PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 128*16); (legionna.cpp:1212, 128*16 = 2048 entry) Address space CPU: 0x104000..0x104FFF (4 KB = 2048 word).
- rtl/Godzilla/Godzilla_palette.sv:35 Espansione 5→8 standard MAME palette_device: {val5, val5[4:2]} (bit replication che riempie i 3 LSB con i 3 MSB del valore 5-bit).
- rtl/Godzilla/Godzilla_palette.sv:85 Godzilla: xBGR_555 → RGB888 (legionna.cpp:1212) Layout: bit[4:0]=R, bit[9:5]=G, bit[14:10]=B. 5 bit per canale.
- rtl/Godzilla/Godzilla_palette.sv:87 Espansione 5→8 standard MAME palette_device: {val5, val5[4:2]} (replica i 3 MSB nei 3 LSB → range 0..255 con monotonia preservata).
- rtl/Godzilla/Godzilla_seibu_crtc.sv:23 Seibu CRTC fedele a MAME (seibu_crtc.cpp).
- rtl/Godzilla/Godzilla_seibu_crtc.sv:120 MAME mappa: bit0=screen0(BG), bit1=screen2(MG), bit2=screen1(FG), bit3=screen3(Text) (vedi seibu_crtc.cpp commento "screen 0=BG, screen 1=FG, screen 2=MG, screen 3=Text") In SD Gundam dcon.cpp layer_en_w gira la maschera così: ~layer_en bit
- rtl/Godzilla/Godzilla_seibu_crtc.sv:129 Il dispatcher MAME usa "if (BIT(~m_layer_en, n))" per saltare = layer disabilitato quando il bit è 1.
- rtl/Godzilla/Godzilla_seibu_crtc.sv:134 Godzilla layer ordering (legionna_v.cpp:384-390 screen_update_GODZILLA): bit 0 = BG (background) bit 1 = MG (midground) bit 2 = FG (foreground) bit 3 = Text bit 4 = Sprites ATTENZIONE: e' l'OPPOSTO di legionna (screen_update_legionna :342-3
- rtl/Godzilla/Godzilla_seibu_crtc.sv:155 Scroll-base Screen3(text) Y = reg 0x3A (blocco layer_scroll_base 0x2C-0x3B, offset word 7 — MAME seibu_crtc.cpp:243 + legionna_v.cpp:58-65 godzilla-only: text set_scrolldy(0x1ef - data).
- rtl/Godzilla/Godzilla_sprite_renderer.sv:25 Formato spriteram quasi identico (entrambi MAME sei021x_sei0220_spr.cpp) — differenze: - Spriteram @ 0x105000-0x105FFF (4KB, 1024 word, 256 entry × 4 word) - w3 bit 15 = tile bank extra bit (denjinmk usa, Godzilla base = 0)
- rtl/Godzilla/Godzilla_sprite_renderer.sv:30 Format word (legionna_v.cpp:288-312): w0 bit 15 = enable (0=draw, 1=skip — TODO verify Godzilla) w0 bit 14 = flip_x w0 bit 13 = flip_y (???
- rtl/Godzilla/Godzilla_sprite_renderer.sv:46 Priority callback legionna_v.cpp:314-317: pri_mask[0] = 0x0000 (sopra tutto) pri_mask[1] = 0xFFF0 pri_mask[2] = 0xFFFC pri_mask[3] = 0xFFFE
- rtl/Godzilla/Godzilla_sprite_renderer.sv:140 0..511 (MAME size/2/4 = 4096/2/4 = 512)
- rtl/Godzilla/Godzilla_sprite_renderer.sv:145 Decoded fields — MAME sei0210_device::draw (non-alt format, riga 143): if (BIT(~spriteram[i], 15)) continue; → draw quando w0[15]==1.
- rtl/Godzilla/Godzilla_sprite_renderer.sv:165 MAME SEI0211 default m_xoffset/m_yoffset = 0 (sei021x_sei0220_spr.cpp:40-41).
- rtl/Godzilla/Godzilla_sprite_renderer.sv:166 Godzilla NON chiama set_offset (legionna.cpp:1214) → offset 0,0.
- rtl/Godzilla/Godzilla_sprite_renderer.sv:198 Tile code finale Y-MAJOR (MAME draw_internal: ax=outer, ay=inner, code++): sub_index = ax*sizey + ay → cur_tile = code + eff_tile_x*sp_h + eff_tile_y Banking godzilla_tile_cb (legionna_v.cpp:327-334): ext→|0x4000, y→|0x8000, applicato PRI
- rtl/Godzilla/Godzilla_sprite_renderer.sv:538 MAME gfx_legionna_spr: color base = 64*16 = 0x400 (64 colorset × 16 pen).
- rtl/Godzilla/Godzilla_text_renderer.sv:25 Specifiche da MAME (legionna.cpp:1117-1126, 1167):
- rtl/Godzilla/Godzilla_text_renderer.sv:47 Char ROM in MAME: "char" region 64KB = ROM_COPY user1[0x10000..0x1FFFF].
- rtl/Godzilla/Godzilla_text_renderer.sv:140 MAME `legionna_v.cpp:214`: text tilemap = 64×32 (8x8 tiles, TILEMAP_SCAN_ROWS).
- rtl/Godzilla/Godzilla_text_renderer.sv:186 --- Stage 3: pen decode (charlayout planes packed in nibbles) --- Per col c (0..3 dentro la half-tile), bit position = 3 - c. pen[0] = word[bit_pos + 0] (plane 0) pen[1] = word[bit_pos + 4] (plane 1) pen[2] = word[bit_pos + 8] (plane
- rtl/Godzilla/Godzilla_text_renderer.sv:192 MAME readbit usa MSB-first: bit_offs N → byte[N/8] bit (7-N%8).
- rtl/Godzilla/Godzilla_text_renderer.sv:193 In Verilog word concat (lo=byte0[7:0], hi=byte1[7:0]) → MAME pos N = word[(7-N%8) + (N>=8?8:0)].
- rtl/Godzilla/Godzilla_text_renderer.sv:210 MAME GFXDECODE char: color base = 48*16 = 0x300 (16 colorset × 16 pen).
- rtl/Godzilla/Godzilla_tile_layer.sv:25 Differenze fra layer (da MAME dcon.cpp):
- rtl/Godzilla/Godzilla_tile_layer.sv:58 BB FG hardcoded +0x1000 (MAME bloodbro fg_tile_info)
- rtl/Godzilla/Godzilla_tile_layer.sv:221 Tile index con eventuale gfx_bank (MG ha bit 12 = 13-bit totali, BG/FG = 12 bit) + TILE_CODE_OFS hardcoded (BB FG aggiunge 0x1000 secondo MAME bloodbro fg_tile_info).
- rtl/Godzilla/Godzilla_video_timing.sv:35 Active area da MAME (sdgndmps_map): visarea 0..40*8-1, 2*8..30*8-1 quindi 320×224, V offset = 16 (top blank).
- rtl/Godzilla/Godzilla_video_timing.sv:60 ── Pixel clock enable: 96 MHz / 14 = 6.857 MHz ───────────────────────── Godzilla reale (legionna.cpp:1318 set_raw): pclk 14.318180/2 = 7.15909 MHz.
- rtl/Godzilla/Godzilla_video_timing.sv:78 ── Constants timing ───────────────────────────────────────────────────── Godzilla REALE (legionna.cpp:1318): set_raw(14318180/2, 455, 0, 320, 258, 0, 224) = 320x224, HTotal 455 @7.159MHz = 15.734 kHz, VTotal 258 → 60.985 Hz.
- rtl/Godzilla/sdram_bridge.sv:308 --- FG address descramble (legionna.cpp:1129 descramble_legionnaire_gfx) --- MAME applica un bitswap<24> agli indirizzi della ROM "fore" durante init: src_descrambled[i] = src_raw[bitswap<24>(i, ...
- rtl/Godzilla/sdram_bridge.sv:355 bitswap MAME del byte offset
- README.md:6 Godzilla is a licensed Toho kaiju action game running on the **Seibu `legionna.cpp` hardware family** — an M68000 board with a Seibu CRTC, the SEI252 sprite chi
- README.md:12 This core reimplements the hardware in SystemVerilog from MAME references (`seibu/legionna.cpp`, `seibu/legionna_v.cpp`, `seibu/seibu_crtc.cpp`, `seibu/seibucop
Says it matches, follows or was checked against MAME — 6
Says it was translated, ported or taken from MAME — 2
- rtl/Godzilla/Godzilla_cop3.sv:1904 0x3BB0 dist — MAME execute_3b30 (cmd.ipp:197): 1:1 dx = (read_dword(r1+4) - read_dword(r0+4)) >> 16 (signed) dy = (read_dword(r1+8) - read_dword(r0+8)) >> 16 cop_dist = floor(sqrt(dx*dx + dy*dy)) if(data&0x80) write_word(r0+(data&0x200?0x3
- rtl/Godzilla/Godzilla_cop3.sv:2021 0x42C2/0x4AA0 divide — MAME execute_42c2/4aa0 (cmd.ipp:219/247): 1:1 DIVIDEND = cop_dist << (5 - cop_scale) (cop_scale 0..3 → shift 5..2) 42c2: div=cop_read_word(r0+0x36)→host 0x34; if(!div){status|=0x8000; write 0 a host 0x3a} else write
Shares text with the MAME driver without saying so — 9
- Godzilla.sv:817 HAS_TRANSP=1 perché m_background_layer->set_transparent_pen(15) in — shares text with seibu/legionna_v.cpp:216
- Godzilla.sv:840 get_mid_tile_info_share_bgrom (legionna_v.cpp:158): MG share BG ROM, — shares text with seibu/legionna.h:80
- rtl/Godzilla/Godzilla_audio_z80.sv:424 godzilla_oki_bank_w: m_oki->set_rom_bank(data & 1) (write tipica 0x02/0x03). — shares text with seibu/legionna.cpp:277
- rtl/Godzilla/Godzilla_maincpu_map.sv:269 Tokyo's tower ... Z axis check makes no sense"): le 2 call-site — shares text with seibu/seibucop.cpp:54
- rtl/Godzilla/Godzilla_palette.sv:23 Palette RAM Seibu Godzilla (xBGR_555, 2048 entries).
MAME: PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 128*16);
(legionna.cpp — shares text with seibu/legionna.cpp:1212
- rtl/Godzilla/Godzilla_sprite_renderer.sv:146 if (BIT(~spriteram[i], 15)) continue; → draw quando w0[15]==1. — shares text with seibu/sei021x_sei0220_spr.cpp:128
- rtl/Godzilla/Godzilla_text_renderer.sv:23 Text layer renderer Seibu Godzilla (8x8, 4bpp, 64x32).
Specifiche da MAME (legionna.cpp:1117-1126, 1167):
// charlayout
8x8, RGN_FRAC(1,1), 4 — shares text with seibu/legionna.cpp
- rtl/Godzilla/Godzilla_video_timing.sv:23 Video timing single-screen Seibu D-Con.
SD Gundam Psycho Salamander gira su Seibu D-Con (PB91008), stessa famiglia
di Blood Bros (1990). PCB measuremen — shares text with seibu/seibu_crtc.cpp:14
- rtl/Godzilla/Godzilla_video_timing.sv:79 Godzilla REALE (legionna.cpp:1318): set_raw(14318180/2, 455, 0, — shares text with seibu/legionna.cpp:1318