← All cores
hexion (decoryah)
Cites MAME source — 71
- Hexion.sv:5 Written for MiSTer from MAME 0.289's driver (src/mame/konami/hexion.cpp, with src/devices/machine/k053252.cpp, src/devices/sound/k051649.cpp and okim6295.cpp).
- Hexion.sv:137 keyboard: 1 / 2 start, 5 / 6 coin, 9 service, F2 the service mode (MAME's defaults; F2 holds the DIP's "On" while pressed)
- Hexion.sv:159 MAME's P1 / P2 (f402 / f403, KONAMI8_B12_START), active low: 0 left, 1 right, 2 up, 3 down, 4 / 5 buttons 1 / 2, 6 unused, 7 start
- Hexion.sv:162 SYSTEM (f441): 0 / 1 coin 1 / 2, 2 service 1 (active low), 3 the PMC's busy flag (active high, MAME: 0), 7:4 unused (1)
- Hexion.sv:165 the DIP switches (the MRA's <switches>, ioctl index 254): DSW1, DSW2, DSW3 as MAME reads them; MAME's defaults until they come
- Hexion.sv:283 the OSD's volume steps on MAME's own level
- rtl/hexion_core.sv:2 Hexion (Konami GX122, 1992) and its Impeuropex bootleg: the machine, written from MAME 0.289's src/mame/konami/hexion.cpp.
- rtl/hexion_core.sv:4 Z80B at 6 MHz (24 MHz / 4); K053252 CCU (the raster at 12 MHz, the interrupts); 052591 PMC (only its RAM fills, as in MAME); two 64 x 32 tilemaps; K051649 SCC at 3 MHz and an MSM6295 at 1.056 MHz (pin 7 high); the bootleg has a second MSM62
- rtl/hexion_core.sv:8 Memory map (MAME's base_map): 0000-7fff ROM 8000-9fff ROM bank (bankswitch bits 3:0, 16 x 8 KB of the 128 KB program) a000-bfff RAM c000-dffe banked: the tile ROM window, VRAM bank 0 / 1, the PMC's RAM (b
- rtl/hexion_core.sv:15 Unmapped reads are 0 (MAME's unmapped value for this machine).
- rtl/hexion_core.sv:17 c000-dffe (MAME's bankedram_r / _w): reads give the tile ROM at ((window & 0x7f) << 12) + offset when the window register is non-zero and the offset is below 0x1000, else VRAM bank <rambank> when the bank control is 0, else the PMC RAM (2 K
- rtl/hexion_core.sv:23 Interrupts (MAME's scanline timer and the CCU's callbacks): the timer calls once a line, at dot 0, after its first call at 1/540 s (MAME's screen is 60 Hz until the game programs the CCU at 0.72 ms, and the timer's first call is set by that
- rtl/hexion_core.sv:26 MAME's Z80 takes an interrupt after the instruction during which (or at whose end) it was raised; tv80 decides at an instruction's last step on what it sampled at the step before, so it would take one raised during an instruction's last cyc
- rtl/hexion_core.sv:31 Clocking and MAME's timeline: the Z80 steps once per 16 clocks of 96 MHz, in phase with the raster as in MAME (the CPU and the screen both start at time 0).
- rtl/hexion_core.sv:32 MAME's memory is instant; here two things make the Z80 wait: a read of the tile ROM window (an SDRAM read) and the PMC's fill (2,048 clocks).
- rtl/hexion_core.sv:33 The Z80's clock enable is held for those, and the cycles it missed are given back right after at one per 8 clocks, so the program stays on MAME's timeline.
- rtl/hexion_core.sv:58 MAME's input ports (active low as read)
- rtl/hexion_core.sv:78 audio: MAME's mix (OKI 0.5, SCC 0.5) as 16 bits, 46.875 kHz
- rtl/hexion_core.sv:112 one step at the first clock: tv80 spends a step after reset before its first fetch, which then ends with the first nominal cycle, as MAME's Z80 starts executing at time 0
- rtl/hexion_core.sv:227 the byte in MAME's "tiles" region
- rtl/hexion_core.sv:257 MAME's read-back: vpos - VC (VC = 288)
- rtl/hexion_core.sv:260 MAME's scanline timer: the first call 1/540 s after reset (177,777.8 clocks), then at dot 0 of every line; both 25 clocks early (above): the line's call at dot 764 of the line before (cb_tick), the first at clock 177,766 (a Z80 instruction
- rtl/hexion_core.sv:264 The lines are raised on the Z80's own timeline: if it is behind (owed cycles, after a wait) when a call raises one, the line goes up only once it has taken those cycles, so it sees the line on the step MAME's Z80 would (without this, a call
- rtl/hexion_core.sv:401 the PROMs' 4 bits through the board's resistor network, as MAME's palette_init_rgb_444_proms weighs them
- rtl/hexion_core.sv:428 MAME's mono mix, both routes 0.5, as 16 bits (x 32768): 8 * OKI + 16 * SCC; the SCC's 3 MHz samples are averaged over 64 (one output sample every 2,048 clocks), MAME resamples its stream to the output rate
- rtl/hexion_loader.sv:5 The image (mra/*.mra, tools/hexion_rom.py), the same layout for both sets: 0x000000 maincpu 128 KB the Z80 program -> BRAM 0x020000 tiles 512 KB 122a07.1h, then 122a06.1g (MAME's "tiles") 0x0A0000 oki 256
- rtl/hexion_oki.sv:2 OKI MSM6295: four ADPCM voices from a 256 KB ROM, written from MAME 0.289's okim6295.cpp / okiadpcm.cpp.
- rtl/hexion_oki.sv:4 The command port: a byte with bit 7 set picks the phrase (its 8-byte entry in the ROM's table: start and end address, 3 bytes each, big-endian, 18 bits); the next byte starts it on the voices of bits 7:4 that are not playing, at the volume
- rtl/hexion_oki.sv:9 One output sample per tick (the chip's clock / 132 with pin 7 high, / 165 low): each playing voice decodes its next nibble (signal += the step's difference, clamped to -2048..2047; the step index moves by -1, -1, -1, -1, 2, 4, 6, 8, clamped
- rtl/hexion_oki.sv:11 The output is the sum of the four voices (MAME's sample is it / 2048).
- rtl/hexion_oki.sv:16 In MAME a command is instant: a voice started by a command before a tick plays its first nibble at that tick, as here.
- rtl/hexion_oki.sv:68 MAME's m_sample: the nibble count
- rtl/hexion_oki.sv:74 MAME's m_command != -1
- rtl/hexion_oki.sv:119 the command first when both wait: it came before the tick, or in the same clock (MAME: the stream update at the write generates the samples up to it with the voices as they were)
- rtl/hexion_scc.sv:2 Konami 051649 (SCC): five wavetable voices, 32 signed bytes each (voice 5 plays voice 4's table), written from MAME 0.289's k051649.cpp.
- rtl/hexion_scc.sv:5 The output is the sum of the five latched samples >> 4 (signed, -600..595; MAME scales it by 1/1024).
- rtl/hexion_scc.sv:6 A frequency write sets the clock counter to -1 (the sample reloads on the next clock); test register bit 5 also clears the position; bits 6 / 7 make the tables read-only and show them rotated by a position, as in MAME.
- rtl/hexion_scc.sv:9 Register map (the CPU at e800-e8ff, offset here): 00-7f tables (60-7f voices 4 and 5), 80-89 frequency (low byte, high 4 bits per voice), 8a-8e volume, 8f key on/off (bits 0-4), the same at 90-9f; e0-ff the test register (a read returns 0,
- rtl/hexion_scc.sv:13 A register write that comes while the engine is computing a sample waits for it to finish: in MAME the stream is brought up to the write's time first, so a write counts from the next sample on.
- rtl/hexion_scc.sv:41 MAME's k051649_waveform_r with test bits 6 / 7: the table rotated by a voice's position
- rtl/hexion_video.sv:4 The raster (MAME 0.289 k053252.cpp with the game's register values 02 FF 00 4D 00 73 00 00 01 1F 05 0E B7 7C): a 12 MHz dot (24 MHz / 2), 768 dots a line (HC 0x2FF + 1), 288 lines (VC 0x11F + 1): 15.625 kHz, 54.25 Hz.
- rtl/hexion_video.sv:7 MAME starts the machine at line 256 (its screen's first vblank begins at time 0): so does this raster, out of reset at dot 0 of line 256.
- rtl/hexion_video.sv:10 The tilemaps (hexion.cpp): VRAM bank k is layer k, 4 bytes a tile in rows of 64 tiles: code = byte 0 | (byte 1 & 0x3f) << 8, colour = byte 2 & 0x0f, byte 3 unused; no tile flip.
- rtl/hexion_video.sv:11 Layer 1 is drawn opaque, scrolled by MAME's set_scrollx(-4) / set_scrolly(4) (screen x shows layer x - 4, screen y layer y + 4); layer 0 over it with pen 0 transparent.
- rtl/hexion_video.sv:12 Flip screen (the coin counter register's bit 5) mirrors the whole picture, MAME's tilemap flip with its scroll rule (tilemap.cpp effective_rowscroll): screen (x, y) is the unflipped picture's (511 - x, 255 - y).
- rtl/hexion_video.sv:16 A tile's 8 x 8 x 4 bits are 16 bytes in each half of the tile ROMs (MAME's charlayout: x 0,1 from the second half's byte 0, x 2,3 from the first half's byte 0, x 4,5 / 6,7 the same with byte 1; the high nibble first).
- rtl/hexion_video.sv:21 Each line is fetched during the line before it into a ping-pong line buffer per layer (64 tiles a layer, 128 two-word bursts in about 1,500 of the line's 6,144 clocks), so a line shows the VRAM as it was one line earlier, as the board's til
- rtl/hexion_video.sv:25 The game's own raster (vpos, cb_tick, line_start: the interrupts and the CCU's read-back) runs on in every mode, so the machine's timeline stays MAME's; modes 1 and 2 draw the same picture on a raster of their own, for a RetroTINK 4K in dir
- rtl/hexion_video.sv:63 the colour PROMs (MAME's "proms": 0x000 red, 0x100 green, 0x200 blue, 4 bits each)
- rtl/hexion_video.sv:69 the line (0..287), as MAME's screen vpos()
- README.md:5 Written from MAME 0.289's driver (`src/mame/konami/hexion.cpp`, with `k053252.cpp`, `k051649.cpp`, `okim6295.cpp`), with MAME as the reference for everything; t
- README.md:46 The buttons are named by what they do (measured in MAME 0.289): **Rotate Left** (MAME's button 1) turns the falling piece counter-clockwise, **Rotate Right** (b
- README.md:57 | DIP switches | MAME's: Coin A, Coin B (Konami's table; 0 is Free Play), Difficulty (1 Easiest .. 8 Hardest, 4 Medium), Demo Sounds, Flip Screen, Service Mode
- README.md:60 The video is the board's: 512 x 256 in a 768 x 288 raster at a 12 MHz dot, 15.625 kHz and 54.25 Hz (MAME's own timing for this game, from the K053252's register
- README.md:72 | The Z80 against MAME, cycle by cycle | MAME's debugger trace with each instruction's cycle count against the bench's (`sim/tb_top.sv` +ITRACE, `tools/cmp_trac
- README.md:73 | Whole machine | `sim/run_sys.sh`: the Z80 running the game's program, the ROM image downloaded through the loader into the SDRAM controller and a behavioural
- README.md:74 | Sound | The bench's output (`AUDIO=1`) against MAME's `-wavwrite` recording of the same scripted play (`tools/audio_cmp.py`): the loudness envelopes (RMS per
- README.md:75 | MiSTer top level | `sim/emu/run_emu.sh`: `Hexion.sv` with the framework's video path (`arcade_video`, the scaler's input), `hps_io` and the PLL stubbed, the S
- README.md:79 Where the core is not MAME
- README.md:81 **The tilemaps are read as the beam runs** (each line is fetched during the line before it), as a board's tilemap hardware reads its VRAM; MAME draws the whole
- README.md:82 Hexion writes VRAM during the visible lines too (in a game, the animated arrows above the playfields at lines 60-100), so such a change shows from the next fram
- README.md:84 The machine's state is MAME's either way.
- README.md:86 263 lines (RT4K 54Hz) has the board's frame time, but its lines are 9.5 % longer than the board's and its vertical blank 7 lines instead of 32, so the beam pass
- README.md:91 **MAME's memory is instant.** The core's Z80 waits for two things MAME does in no time: a read of the tile ROM window (an SDRAM read, the test mode's MASK ROM C
- README.md:92 The cycles it misses are given back right after (a step every 8 clocks instead of 16), so the program stays on MAME's timeline (the test mode's state is MAME's
- README.md:94 **The sound's resampling.** The SCC runs at its 3 MHz and the core averages it over 64 samples (46.875 kHz output); MAME resamples its streams with its own filt
- README.md:95 The levels are MAME's mix (OKI and SCC at 0.5 each).
- README.md:103 | `modules/` | vendored: tv80 (with local changes: the NMI's T-states, MAME's power-on register values), rmonic79's CRT Adjust (`modules/VENDOR.md`) |
- README.md:108 | `docs/` | `hardware.md`: the hardware as MAME describes it and the measurements |
- README.md:129 The instruction trace: MAME's debugger with `trace <file>,maincpu,noloop,{tracelog "%d ",totalcycles}` (started from Lua, `manager.machine.debugger:command(...)
- README.md:138 **MAME**: the hexion driver (Nicola Salmoria), the K053252 (Angelo Salese, from Olivier Galibert's notes), the K051649 (Bryan McPhail), the MSM6295 and its ADPC
Says it matches, follows or was checked against MAME — 2
- README.md:24 In simulation the core is compared with MAME 0.289 (see "What is verified": the Z80 on MAME's cycle, the machine's RAM and VRAM byte for byte MAME's through 1,2
- README.md:71 | The picture's rules | `tools/hexion_ref.py`, MAME's tilemap, gfx layout and palette rules in Python, renders MAME's own VRAM (dumped with `tools/lua/dump.lua`