← All cores
Arcade-Atari-G1 (Gm0rk)
Cites hardware documentation that MAME's driver does not — 6
- Arcade-Atari-G1.sv:836 self_test is the same switch as IN0 bit 14: one /SELFTEST net joins JAMMA pin 15, the game PCB (AUD-29) and the JSA II's SW1 (J1-29), and the 6502 reads it through inverting buffer 2F (74LS240), so it is active high here.
- rtl/board/g1_cpu_timing.sv:5 The board ends every 68000 bus cycle through a wait-state counter (game PCB 045977, 95D 74F163 and 105C): it loads when AS is seen, counts CPU clocks to its terminal count, and DTACK follows half a clock later.
- rtl/jsa2/g1_jsa2.sv:6 Follows MAME's atari_jsa_ii_device (atarijsa.cpp) and the JSA II schematic (Pit Fighter manual, fig. 5-2).
- rtl/jsa2/g1_jsa2.sv:480 Bit 7 follows the schematic, not MAME (which always reads 0): the SELF-TEST net (low = test; shared with the game PCB and JAMMA pin 15) reaches SD7 through 2F, an inverting 74LS240, so test mode reads 1.
- rtl/jsa2/g1_jsa2.sv:487 0x80 self test, active high (via 74LS240)
- README.md:89 Atari Games: game PCB, JSA Audio II and wiring schematics
Cites hardware references or measurements that MAME's driver also gives — 1
- rtl/cpu/g1_addr_decode.sv:21 $FD8000-$FDFFFF RW EEPROM, 2 KB, low byte only (umask16 $00FF) $FE0000-$FE7FFF - Open bus (decode space of the A048490-01 "G1 OOPS" daughter card at 10P, which carries the Slapstic) $FE8000-$FE89FF RW Palette RAM, 1280 entries $FF000 — also in MAME: 10P atari/atarig1.cpp:666
Reports a measurement taken on the original PCB — 1
- rtl/board/g1_cpu_timing.sv:25 Replaying MAME's bus trace of the three attract-mode bursts, a cap of 3 cuts the wait time in them to 0.92 of the board model's, 2 to 0.74; the PCB footage measured 0.87 +- 0.07 of this core's loss (docs/CPU_TIMING_NOTES.md).
Cites MAME source — 116
- Arcade-Atari-G1.sv:11 Coins are not on the 68000's input ports: COIN1/2/3 are on the JSA II's RDIO port (6502 $2804, active high) and reach the 68000 only through the sound command latch (MAME port definitions).
- Arcade-Atari-G1.sv:90 MAME: its linear IRGB-1555 palette.
- Arcade-Atari-G1.sv:539 Bit assignments follow MAME's INPUT_PORTS.
- Arcade-Atari-G1.sv:553 MAME's PORT_SERVICE; both games check it at boot to enter the test menu.
- Arcade-Atari-G1.sv:561 Pit Fighter player port, MAME order: down, up, right, left, Punch, Kick, Jump/Start.
- Arcade-Atari-G1.sv:575 MAME order: Left Trigger, Right Trigger, Left Thumb, Right Thumb, Boost -- the same order as the MRA's buttons, so bit n is joystick bit n+4.
- Arcade-Atari-G1.sv:592 The JSA II's third coin input is counted by the 6502 but credited by neither game (MAME), so player 3's coin drops into the right mech and coin 3 reads 0: no switch is wired to it.
- Arcade-Atari-G1.sv:607 IN0 bits 11:8: unused in MAME, but on the PCB (manual fig. 5-1, buffer 35A) they repeat player 2's JAMMA lines through R15/R16/R13/R14: bit 8 JAM-Z (Punch 2), 9 JAM-a (Kick 2), 10 JAM-b (Jump 2), 11 JAM-c (spare, pulled up).
- Arcade-Atari-G1.sv:839 MAME reads 0 (it inverts the line twice).
- Arcade-Atari-G1.sv:943 It was OSD status[52], MAME or PCB, up to build 163, and that bit is now unused.
- Arcade-Atari-G1.sv:944 The MAME drawing is still in the RTL: tie this to 0 to get it back.
- Arcade-Atari-G1.sv:954 MAME uses vpos only through min(239, vpos) and partial = vpos, so any value >= 240 is exact for all of VBLANK (vis_y reads 0 there).
- rtl/board/g1_adc0809.sv:13 Timing follows MAME adc0808.cpp.
- rtl/board/g1_adc0809.sv:13 The ADC clock is 14.318181 MHz / 16 (894.9 kHz, atarig1.cpp) = 64 clk_sys.
- rtl/board/g1_adc0809.sv:101 EOC keeps its state until the sample point, as in MAME
- rtl/board/g1_ce.sv:14 The board clocks the 68000 from the 14.318 MHz oscillator at x1 (as MAME does), though the fitted part is an MC68HC000P12F (12.5 MHz grade); cpu_div2 selects 7.159 MHz instead at runtime.
- rtl/board/g1_ce.sv:33 0 = 68000 at 14.318181 MHz (MAME, default) 1 = 68000 at 7.159090 MHz Safe to change at any time: the divider is free-running.
- rtl/board/g1_cpu_timing.sv:18 MAME has no wait states, and neither does the fast input here: DTACK as soon as the data is there.
- rtl/board/g1_cpu_timing.sv:25 Replaying MAME's bus trace of the three attract-mode bursts, a cap of 3 cuts the wait time in them to 0.92 of the board model's, 2 to 0.74; the PCB footage measured 0.87 +- 0.07 of this core's loss (docs/CPU_TIMING_NOTES.md).
- rtl/board/g1_cpu_timing.sv:52 no board wait states (MAME); 0 in the core
- rtl/board/g1_eeprom.sv:5 CPU $FD8000-$FDFFFF, low byte only (MAME umask16 $00FF).
- rtl/board/g1_eeprom.sv:8 MAME: EEPROM_2816 with lock_after_write(true).
- rtl/board/g1_eeprom.sv:42 Power up as $FF like a blank part and MAME (eeprom.cpp nvram_default is ~0; atarig1 gives no default region).
- rtl/board/g1_hydra_controls.sv:6 The pedal is also the start control; there is no start button (manual TM-354 table 1-3, MAME hydra ports).
- rtl/board/g1_hydra_controls.sv:9 Inside its dead zone the d-pad ramps the axis out by 10 per frame and back to centre by 20 (MAME KEYDELTA 10).
- rtl/board/g1_hydra_controls.sv:15 Pedal (ADC channel 2): the largest of the Pedal button (ramps up 16 per frame while held, MAME KEYDELTA 16, down 32 after release), the right stick pushed up, and the paddle.
- rtl/board/g1_hydra_controls.sv:17 All rest at 0 (MAME's rest value).
- rtl/board/g1_top.sv:8 Follows MAME atarig1.cpp; bus cycles take the board's wait states (g1_cpu_timing).
- rtl/board/g1_top.sv:46 no board wait states (MAME timing); tied 0 in the core
- rtl/board/g1_top.sv:357 rle_cmd_wr is high exactly while rle_cmd holds a freshly written value; g1_rle latches its command on it (MAME: mo_command_w -> command_write on every write).
- rtl/board/g1_top.sv:537 $F90000 is a byte handler on an even address in MAME (map(0xf90000, 0xf90000)): D15:8 with UDS.
- rtl/board/g1_top.sv:555 As in MAME control_write, a write that leaves the byte unchanged is ignored, comparing all eight bits (Hydra ORs game state into bits 7:3 on its second write).
- rtl/board/g1_top.sv:689 Unmapped space also asserts DTACK and reads $0000, as in MAME (the G1 map does not set unmap_value_high).
- rtl/board/g1_top.sv:690 That includes $FE0000, whose MAME handler is commented out: Hydra tests bit 0 of $FE0001 at $70E2 and only enters its bit-bang routine when it reads 1.
- rtl/board/g1_watchdog.sv:5 MAME uses a WATCHDOG_TIMER with the default period: reset the CPU if no write is seen for 3 seconds (180 frames at 59.923 Hz).
- rtl/cpu/g1_addr_decode.sv:8 Memory map (MAME atarig1.cpp main_map / pitfight_map / hydra_map): $000000-$07FFFF R Program ROM (512 KB region) $038000-$039FFF R Slapstic window, Pit Fighter, mirrored every $2000 $078000-$079FFF R Slapstic window, Hydra, mirrore
- rtl/cpu/g1_addr_decode.sv:67 In the Slapstic window the bank replaces bits [14:13]: MAME configure_entries(0, 4, maincpu + $38000, $2000) puts the four banks at ROM $38000-$3FFFF, the window's own range.
- rtl/cpu/g1_addr_decode.sv:148 Palette is $A00 bytes of the $8000 slot; above entry 1279 is unmapped, not aliased (MAME: 1280 words).
- rtl/cpu/g1_addr_decode.sv:155 $FE0000-$FE7FFF is unmapped in MAME too (its map line is commented out).
- rtl/cpu/g1_slapstic.sv:10 MAME taps the whole address space (install_readwrite_tap over addrmask), because for types 111-118 the 1st and 3rd steps of the alt sequence match at any address.
- rtl/cpu/g1_slapstic.sv:50 Type tables: (mask, value) pairs tested against addr14, copied from slapstic.cpp.
- rtl/cpu/g1_slapstic.sv:159 MAME checker primitives
- rtl/cpu/g1_slapstic.sv:169 Sequence recognition FSM (types 111..118), after the slapstic.cpp state classes: IDLE wait for a reset access (offset 0 in range) ACTIVE direct bank select, or start alt (alt1, any address) or additive (add1, in range) ALT_VALID
- rtl/cpu/g1_slapstic.sv:189 MAME: loaded_bank = (addr >> (1 + altshift)) & 3, i.e. addr14 >> altshift
- rtl/cpu/g1_slapstic.sv:197 MAME: byte offset & 0x3FFF
- rtl/g1_pkg.sv:19 MAME set_raw(14.318181MHz/2, 456, 0, 336, 262, 0, 240): 7.159 MHz dot clock, 15.700 kHz line, 59.923 Hz frame.
- rtl/g1_pkg.sv:20 MAME's totals come from published specs; the porch/sync split of the blanking is chosen for a standard 15 kHz CRT.
- rtl/g1_pkg.sv:77 MAME gfx_element::get_data wraps (code % elements), so bank bit 2 is ignored.
- rtl/g1_pkg.sv:101 MAME's lookup tables all reduce to bit slicing (see g1_rle_decode.sv).
- rtl/g1_pkg.sv:130 MAME's general form is "if bit 15, XOR with $FFFF".
- rtl/jsa2/g1_jsa2.sv:6 Follows MAME's atari_jsa_ii_device (atarijsa.cpp) and the JSA II schematic (Pit Fighter manual, fig. 5-2).
- rtl/jsa2/g1_jsa2.sv:11 6502 memory map (MAME atarijsa2_map): $0000-$1FFF RAM (8 KB)
- rtl/jsa2/g1_jsa2.sv:33 WRIO ($2A04, MAME wrio_w): 0xC0 program ROM bank 0x04 OKI6295 reset, active low 0x20 coin counter 2 0x02 (JSA III only) 0x10 coin counter 1 0x01 YM2151 reset, active low 0x08 OKI6295 PIN7 (sample rate).
- rtl/jsa2/g1_jsa2.sv:40 MIX ($2A06): 0x20 low-pass filter enable (not emulated, nor by MAME) 0x0E YM2151 volume, 0-7 0x01 OKI6295 volume, 0 = half, 1 = full
- rtl/jsa2/g1_jsa2.sv:45 Analog filtering is not modelled (nor by MAME); the real board sounds duller than MAME, the ADPCM most of all.
- rtl/jsa2/g1_jsa2.sv:53 6502 IRQ = periodic timer (249.7 Hz) OR YM2151 IRQ, as MAME's update_sound_irq().
- rtl/jsa2/g1_jsa2.sv:170 The I/O block is mirrored as in MAME ($07FE for the YM, $01F9 for the rest).
- rtl/jsa2/g1_jsa2.sv:223 YM2151 CT1 output pin; gates the OKI as in MAME (see Mixer).
- rtl/jsa2/g1_jsa2.sv:475 All polarities are applied here (MAME jsa_ii_ioports).
- rtl/jsa2/g1_jsa2.sv:500 MAME (atarijsa.cpp, JSA II), mono: out = 0.60 * (L + R) * vol/7 + 0.75 * g * oki vol = MIX bits 3:1, g = 1.0 or 0.5 from MIX bit 0, one full-scale OKI voice = 1.0 (okim6295.cpp: 12-bit sample x volume 32 / 2).
- rtl/jsa2/g1_jsa2.sv:505 The schematic (fig. 5-2) has the same structure: YM3012 L and R are summed by 6B through equal resistor pairs switched 1:2:4 by MIX bits 1-3 (4066 3B), i.e. (L+R) * vol/7; the OKI half/full switch is ~2.4:1 at DC vs MAME's 2:1.
- rtl/jsa2/g1_jsa2.sv:508 The YM:OKI balance depends on DAC swings the schematic does not give, so MAME's 0.60/0.75 are used.
- rtl/jsa2/g1_jsa2.sv:511 MAME's ratio, halved for headroom:
- rtl/jsa2/g1_jsa2.sv:515 Full-scale YM at vol 7 gives 0.60 of full scale, one OKI voice 0.375; four loud voices can clip, as in MAME.
- rtl/jsa2/g1_jsa2.sv:522 OKI gated by YM2151 CT1, as in MAME's update_all_volumes() (gain = overall * oki volume * ct1).
- rtl/jsa2/g1_jsa2.sv:524 On the JSA II schematic CT1/CT2 are not connected (3A pins 8 and 9); MAME's gating comes from the JSA I. It makes no difference here: both games write $C0 to $1B during boot, before any OKI sample, and never clear it.
- rtl/video/g1_alpha.sv:5 Follows MAME get_alpha_tile_info.
- rtl/video/g1_alpha.sv:10 bits 15:12 colour bank -- four bits including the opaque bit, as in MAME's (data >> 12) & $0F bits 11:0 character code Palette index = $100 + (colour << 4) + pixel.
- rtl/video/g1_mixer.sv:5 Fixed order, no inter-layer priority, as MAME atarig1_state::screen_update (playfield draw, copybitmap_trans of the MO bitmap with colour 0 transparent, alpha draw).
- rtl/video/g1_pal_decode.sv:5 Two decodes, chosen by `mame` (the OSD's Color Palette):
- rtl/video/g1_pal_decode.sv:7 Original (mame = 0): the game board's colour, fitted to footage of a real board (tools/pcb_footage_fit.py; docs/PCB_COLOUR_FIT_NOTES.md).
- rtl/video/g1_pal_decode.sv:28 Against MAME this is darker (white is about R 190, G 188, B 195), has a lower pedestal (the first step is R 20, G 27, B 19) and a softer top end.
- rtl/video/g1_pal_decode.sv:33 MAME (mame = 1): MAME's raw_to_rgb_converter::IRRRRRGGGGGBBBBB_decoder.
- rtl/video/g1_pal_decode.sv:50 0 = Original (fitted to footage), 1 = MAME's linear decode
- rtl/video/g1_palette.sv:5 The conversion is g1_pal_decode.sv: the Original colour (the game board, fitted to footage) or MAME's linear decode (curve_mame).
- rtl/video/g1_palette.sv:8 CPU $FE8000-$FE89FF: 1280 16-bit entries in MAME palette format IRGB_1555.
- rtl/video/g1_palette.sv:23 OSD "Color Palette": 0 = Original (the board, fitted to footage), 1 = MAME's linear decode (g1_pal_decode.sv).
- rtl/video/g1_palette.sv:96 Reference values from MAME's decoder: $7C00 -> R = $FB (r6 = 62), $FC00 -> R = $FF (r6 = 63).
- rtl/video/g1_playfield.sv:6 Follows MAME get_playfield_tile_info.
- rtl/video/g1_playfield.sv:12 Only 16384 tiles exist and MAME wraps with code % elements, so bank bit 2 is a don't-care; the mask also keeps fetches inside the ROM region.
- rtl/video/g1_playfield.sv:17 5bpp ROM layout (MAME pflayout + pftoplayout + blend_gfx(0, 2, $0F, $10)): planeoffset {0, 0, 1, 2, 3} repeats offset 0 for the placeholder plane that blend_gfx masks off, so the four real planes are four consecutive bits and each nibble is
- rtl/video/g1_playfield.sv:134 Tile bit 15 is the flags argument of MAME's tileinfo.set, i.e. TILE_FLIPX; a flip just reverses the pixel index.
- rtl/video/g1_scroll.sv:6 From MAME atarig1_state::scanline_update:
- rtl/video/g1_scroll.sv:77 MAME's "if (offset >= 0x800) return": alpha RAM is 2048 words.
- rtl/video/g1_video_timing.sv:5 456 x 262 raster, 336 x 240 visible, from a 7.159090 MHz dot enable (MAME set_raw(14.318181 MHz / 2, 456, 0, 336, 262, 0, 240)).
- rtl/video/g1_video_timing.sv:18 MAME's totals come from published specs; the split is an estimate, so it is a parameter.
- rtl/video/mob/g1_rle.sv:15 Each write to $FF2000 (a work RAM word, snooped) latches the command as MAME mo_command_w does: CHECKSUM if 0 on Pit Fighter, else DRAW; NOP until the first write.
- rtl/video/mob/g1_rle.sv:95 MAME: m_rle->command_write((data == 0 && m_is_pitfight) ?
- rtl/video/mob/g1_rle.sv:171 Indexed by the object's code, not its slot (MAME: m_info[code]).
- rtl/video/mob/g1_rle.sv:265 MAME sort_and_render: x += m_cliprect.left().
- rtl/video/mob/g1_rle.sv:478 Skip null objects and out-of-range codes (MAME: if (code >= count) continue).
- rtl/video/mob/g1_rle.sv:499 Wait out any queued or running erase of the render buffer, so it completes before this object draws, as in MAME (g1_rle_fb).
- rtl/video/mob/g1_rle_checksum.sv:6 MAME atarirle.cpp:
- rtl/video/mob/g1_rle_decode.sv:5 MAME builds lookup tables for this (build_rle_tables()), but every entry is a bit-slice of its index, e.g. for 4bpp:
- rtl/video/mob/g1_rle_decode.sv:79 Simulation self-check against the arithmetic of MAME build_rle_tables()
- rtl/video/mob/g1_rle_fb.sv:15 MAME atarirle.cpp (control_write / vblank_callback): control_write(data), only if data != old bits: if old ERASE: clear buffer[old FRAME] over lines max(0, partial+1) ..
- rtl/video/mob/g1_rle_fb.sv:34 MAME's operations are instant; here each erase request latches its buffer and line range when made (FRAME can flip mid-erase) into a one-deep queue per buffer, where overlapping requests merge.
- rtl/video/mob/g1_rle_fb.sv:37 rnd_hold is high while an erase of the render target is queued or running; g1_rle waits for it before drawing each object, so the erase completes first, as in MAME.
- rtl/video/mob/g1_rle_fb.sv:91 MAME m_control_bits (low three)
- rtl/video/mob/g1_rle_fb.sv:100 Both use the current FRAME, so they merge into one range; the VBLANK request is evaluated first, as in MAME.
- rtl/video/mob/g1_rle_objram.sv:6 MAME reads them live during sort_and_render(); here a DRAW copies all 2048 words into BRAM in one burst and releases the work RAM video port, which would otherwise be contended with the tile fetchers for most of a frame.
- rtl/video/mob/g1_rle_objram.sv:164 X and Y: 10-bit signed fields in bits 15:6, sign extended (MAME: if (x & 0x200) x |= ~0x3ff).
- rtl/video/mob/g1_rle_prescan.sv:5 After the ROM download this walks every object once (MAME prescan_rle()) and fills a BRAM table that the render engine reads in one clock per object:
- rtl/video/mob/g1_rle_prescan.sv:19 MAME's general test is "bit 15 set, XOR with $FFFF"; in both G1 ROM sets $FFFF is the only value with bit 15 set, so an equality test is used.
- rtl/video/mob/g1_rle_prescan.sv:184 Null object (MAME prescan_rle): a data offset at or before the object's own header entry.
- rtl/video/mob/g1_rle_prescan.sv:223 MAME caps the walk at 1024 rows.
- rtl/video/mob/g1_rle_render.sv:6 Port of the inner loop of MAME draw_rle_zoom():
- rtl/video/mob/g1_rle_render.sv:33 PCB sprite scaling (hpcb, from g1_rle_scaler; the core ties it to 1 since build 164) uses the same loop with the board's rate multiplier in place of MAME's centre sampling (US patent 5,363,119, figs.
- rtl/video/mob/g1_rle_render.sv:45 Rows (vertical) are MAME's in both.
- rtl/video/mob/g1_rle_scaler.sv:6 Port of the setup half of MAME draw_rle_zoom():
- rtl/video/mob/g1_rle_scaler.sv:45 Vertical scaling stays MAME's. A scale of $4000 or more is outside the table: such an object is drawn MAME's way.
- rtl/video/mob/g1_rle_scaler.sv:192 MAME: if (scale == 0) continue
- README.md:3 **AI disclosure:** this core was developed using AI and MAME as a reference.
- README.md:73 **MAME** is MAME's linear palette.
- README.md:85 MAME Atari G1 driver and video (`atarig1.cpp`, `atarig1_v.cpp`), RLE engine (`atarirle.cpp`), `slapstic.cpp`, `atarijsa.cpp` and `eeprom.cpp`: Aaron Giles.
- README.md:87 The reference for this core's behaviour; no MAME code is compiled into it
Says it matches, follows or was checked against MAME — 2
- rtl/cpu/g1_slapstic.sv:15 Matching uses addr14 = cpu_addr[14:1], which absorbs MAME's shift of 1 for a 16-bit bus, so the table constants are identical to slapstic.cpp.
- rtl/jsa2/g1_jsa2.sv:527 Kept so the core matches MAME; removing it would match the board.
Says it was translated, ported or taken from MAME — 4
Shares text with the MAME driver without saying so — 3