← All cores
tecmosys (decoryah)
Cites MAME source — 98
- TecmoSys.sv:5 Written for MiSTer from MAME 0.289's driver (src/mame/tecmo/tecmosys.cpp, tecmosys_v.cpp, tecmosys_m.cpp).
- TecmoSys.sv:168 keyboard: 1 / 2 start, 5 coin, 9 service coin, F2 test (MAME's defaults; the board has one coin slot)
- TecmoSys.sv:187 MAME's ports (tecmosys.cpp INPUT_PORTS, all active low): P1 bit 0 up, 1 down, 2 left, 3 right, 4 - 6 buttons 1 - 3, 7 start 1, 8 coin 1, 9 SERVICE (the test switch), 10 button 4 P2 the same for player 2, bit 8 unused, 9 SERVICE1 (service
- TecmoSys.sv:193 Start 1P+2P presses both starts: Angel Eyes' I/O check ("1P & 2P START TO EXIT") leaves only when start 1 and start 2 go down in the same frame (its input routine at 0x30C0, run from the vblank interrupt, reads P1 then P2 about 40 us apart
- TecmoSys.sv:217 The BG tile ROMs (image 0x0300000 - 0x05FFFFF) are written with each 16 x 16 tile's rows contiguous: MAME's tile is four 8 x 8 blocks (TL, TR, BL, BR, 32 bytes each, 4 bytes a row); byte o of a tile goes to {o[6], o[4:2], o[5], o[1:0]}, so
- TecmoSys.sv:219 MRA index 2: the 93C46 image (128 bytes, little-endian words: MAME's nvram/<set>/eeprom), saved by the core after the game stored it.
- rtl/ts_audio48.sv:1 The sound board's mix (MAME 0.289 tecmosys.cpp's routes) and its 48 kHz output for the MiSTer framework.
- rtl/ts_audio48.sv:3 MAME mixes floating-point streams: the YMZ280B's at 0.30 (its 16-bit scale: jchan-mister's ts_ymz280b `out_*` = MAME's sample * 32768), the YMF262's four outputs at 0.50 (A + C left, B + D right: ts_opl3 already sums them), the OKI's single
- rtl/ts_audio48.sv:10 opl_l is on the chip's own scale (ts_opl3: opl3_fpga, as Nuked OPL3 and MAME's YMF262 before ymfm), the scale the driver's balance was made on: MAME 0.224 routed it at 1.00 with the OKI at 0.50 and the YMZ280B at 0.30 (a YMZ280B twice today
- rtl/ts_audio48.sv:15 M = 1.5 keeps the loudness of the test builds before the release, which mixed MAME 0.289's balance (the FM doubled) with M = 1 (simulation, Angel Eyes' fight: RMS 0.1 dB apart, the peaks the same, no clipping); M = 2 would be MAME 0.224's l
- rtl/ts_audio48.sv:19 To 48 kHz (96 MHz / 48 kHz = 2000 clocks per output sample): * the YMZ280B (88.2 kHz) and the YMF262 (49.7 kHz): their held outputs are mixed every clock and averaged over each 48 kHz period (an exact box filter, as the owner's jchan_audio4
- rtl/ts_audio48.sv:23 Held and box-averaged, as in the test builds, its output kept the images of a 15 kHz staircase: 15 - 28 dB more than MAME between 10 and 22 kHz on Deroon's coin sound (hiss on every voice).
- rtl/ts_audio48.sv:115 The OKI's output resampled as MAME 0.289's audio_resampler_lofi resamples a stream slower than the output: from the last four input samples s0..s3 (s3 the newest), the value between s1 and s2 at the phase p of the output time,
- rtl/ts_audio48.sv:120 Here the output time runs two input samples behind: p = clocks since s3 came / the input period (6,336 clocks: 96 MHz / 48 / 132), in Q16; the weights in Q16 (MAME's table: 4,096 phases in float).
- rtl/ts_cen.sv:1 The board's crystals (tecmosys.cpp): 16 MHz (X3: the 68000, the Z80 at 16 / 2, the OKI at 16 / 8), 28 MHz (X2: the video), 14.31818 MHz (X1: the YMF262, its own clock domain here: ts_opl3.sv) and 16.9344 MHz (X4: the YMZ280B, whose sample t
- rtl/ts_core.sv:52 inputs (MAME's P1 / P2 port values, active low)
- rtl/ts_core.sv:87 The watchdog's reset (MAME: a soft reset of the whole machine; the RAMs keep their contents -- the cold boot relies on it, see docs/status.md flaw 10) is held for 2048 clocks: the 68000 (fx68k) takes a reset only over many of its own clocks
- rtl/ts_eeprom.sv:1 (Tecmo System core: the owner's metro-mister rtl/metro_eeprom.sv, renamed; the board's 93C46 in 16-bit mode, as MAME's EEPROM_93C46_16BIT.) 93C46 serial EEPROM, 16-bit organisation (64 words), as used by Mahjong Doukyuusei Special (and Gaku
- rtl/ts_eeprom.sv:2 Written from the chip's data sheet (and MAME's eeprom_serial_93cxx behaviour: the bits are clocked by the 68000's accesses, metro.cpp dokyusp_eeprom_* / gakusai_eeprom_*).
- rtl/ts_eeprom.sv:11 The contents at power-up come from the image: the loader sends the 128 bytes (big-endian words) of MAME's "eeprom" region (i_ld_*).
- rtl/ts_eeprom.sv:11 The saved file (the MRA's <nvram>, Metro.sv) is MAME's nvram/<set>/eeprom: 128 bytes, little-endian words (i_nv_* writes it in, o_nv_rdata reads it back for the save, o_written marks a write of the game).
- rtl/ts_eeprom.sv:23 the saved file, one byte per clock: byte address 0..127, little-endian words (MAME's nvram file)
- rtl/ts_m68k.sv:9 iack one clock when the CPU starts the acknowledge cycle of level iack_lvl: the board clears that level's latch (MAME's HOLD_LINE: the line stays asserted until the CPU takes it).
- rtl/ts_main.sv:1 The Tecmo System main board as the 68000 sees it (MAME 0.289 tecmo/tecmosys.cpp, tecmosys_state::main_map): address decode, the work RAM, the video RAMs / palettes / sprite RAM with their video-side ports, the scroll and sprite registers, t
- rtl/ts_main.sv:23 Everything else reads 0 and ignores writes (MAME's unmapped space; the write-only registers read 0).
- rtl/ts_main.sv:25 Interrupt: level 1 at the start of the vertical blank (MAME's irq1_line_hold on the screen's vblank: held until acknowledged), autovectored.
- rtl/ts_main.sv:49 inputs (MAME's port values, active low)
- rtl/ts_main.sv:53 93C46 image: the saved file in (little-endian words, MAME's nvram/<set>/eeprom) and out
- rtl/ts_main.sv:239 ---------------------------------------------------------------- watchdog (MAME: vblank count 400)
- rtl/ts_mem.sv:4 SDRAM image (byte addresses; tools/ts_rom.py builds the same image, tools/make_mra.py the MRA stream that the loader writes into it): 0x0000000 68000 program 1 MB (big-endian words) 0x0200000 text tiles ("layer0") 1 MB (512 KB set
- rtl/ts_opl3.sv:5 Z80 side (clk): wr = one clock per I/O write to ports 00-03 (a = port & 3: 0 / 2 address of bank 0 / 1, 1 / 3 data); dout = the status byte for port 0 (IRQ, FT1, FT2 in bits 7-5) and 0xff for ports 1-3, as MAME's ymfm, valid one clock afte
- rtl/ts_opl3.sv:7 irq_n the chip's IRQ output (timer flags), synchronised to clk: the Z80's INT (MAME: ymf.irq_handler -> audiocpu line 0) out_l / out_r the chip's output, A + C on the left and B + D on the right as MAME routes the four outputs
- rtl/ts_opl3.sv:10 On the chip's own scale: opl3_fpga makes an operator's output ((exp | 0x400) << 1) >> shift (at most 4,084), as Nuked OPL3 (traced from the die) and as MAME's own YMF262 until ymfm replaced it in 0.231 ("12 bits here (as in real chip)").
- rtl/ts_opl3.sv:12 MAME 0.289 plays these games' FM 6 dB louder against the YMZ280B and the OKI than the driver's balance (docs/status.md, MAME flaw 11: a 0.225 output bug doubled it, 0.227's rebalance kept the doubling, ymfm's scale kept it since); ts_audio4
- rtl/ts_opl3.sv:15 X2 = 1 doubles the output to ymfm's scale (saturated to 16 bits, as ymfm clamps): MAME 0.289's balance, as in the test builds before the release.
- rtl/ts_prot.sv:1 The Tecmo System protection device (a 68HC11A8 on the game board, not dumped), as MAME 0.289 simulates it (tecmo/tecmosys_m.cpp, protection simulation by nuapete): a password, the upload of a short code, four checksum ranges and their four
- rtl/ts_prot.sv:5 b80000 (r) status: a word / high-byte read returns 0, a low-byte read 0xc0 (bit 7 = ready to write, bit 6 = ready to read: always ready) b80000 (w) status write: ignored e80000 (w) data in: the high byte of the word (MAME's data >> 8) f8
- rtl/ts_prot.sv:10 The tables are those of MAME's deroon_data / tkdensho_data / tkdensha_data, selected by `game` (0 deroon, 1 tkdensho, 2 tkdenshoa: the ROM image's header byte, tools/make_mra.py).
- rtl/ts_prot.sv:11 MAME resets the state on a machine reset (prot_reset): so does `rst` here.
- rtl/ts_prot.sv:24 ---------------------------------------------------------------- MAME's tables
- rtl/ts_sound.sv:1 The Tecmo System sound section (MAME 0.289 tecmosys.cpp: sound_map, io_map): a Z80 at 8 MHz, its 256 KB program (32 KB fixed + a 16 KB window on one of 16 banks) read from the SDRAM through a line cache (wait states on a miss), 6 KB of RAM,
- rtl/ts_sound.sv:9 Interrupts: INT = the YMF262's IRQ (level; the acknowledge reads 0xff: RST 38h); NMI = the latch's "data pending" AND the NMI enable (MAME's INPUT_MERGER_ALL_HIGH: both start high, so the NMI is enabled after a reset until the Z80 writes ff
- rtl/ts_sprites.sv:1 Sprite engine of the Tecmo System video, written from MAME 0.289 tecmosys_v.cpp (render_sprites_to_bitmap), drawing line by line.
- rtl/ts_sprites.sv:3 MAME draws the whole sprite list into a bitmap at the start of the vertical blank (screen_update, after the tilemaps of that frame were mixed) and mixes that bitmap into the NEXT frame: the sprites are one frame behind the tilemaps ("preven
- rtl/ts_sprites.sv:7 The result is MAME's bitmap, line by line.
- rtl/ts_sprites.sv:9 Sprite entry (16 bytes, MAME's comment):
- rtl/ts_sprites.sv:16 MAME's drawing (both of its paths are the same thing with the zoom 0x100 taken as 1.0): source row r goes to screen line ((y << 8) + r * zoomy) >> 8, source column c of that row to screen x ((x << 8) + c * zoomx) >> 8, for every row / colum
- rtl/ts_sprites.sv:19 So a zoom below 0x100 draws several source rows / columns onto one line / pixel (the last opaque one wins), a zoom above 0x100 leaves gaps (MAME's behaviour, kept here: see docs/status.md).
- rtl/ts_sprites.sv:23 Graphics: MAME's "sprites" region decoded to one byte per pixel (descramble) is the pixel address space here; address = (ROM offset << 8) + row * width + column, masked to the region (32 or 64 M pixels).
- rtl/ts_sprites.sv:24 It is split into eight slots of 8 M pixels (address bits 25-23); the slot table (`slots`, from the ROM image's header) says per slot where its data is in the SDRAM and how it is stored: mode 2 8 bpp: the two 16-bit ROMs interleaved word by
- rtl/ts_sprites.sv:99 ================================================================ copy + set-up (vertical blank) The first visible row / column of a sprite whose y / x is negative: MAME steps through the rows (columns) until the position reaches 0; here the
- rtl/ts_sprites.sv:103 MAME FLAW 1 FIXED (docs/status.md, tools/flip_study.py): bit 15 of 880000 / 880002 flips the sprite layer.
- rtl/ts_sprites.sv:103 The games' inverted screen (tkdensho 0x2e5e) sets it and adds 0x30 / 0xf4 to the offsets; MAME masks it away.
- rtl/ts_sprites.sv:104 Flipped, a pixel MAME would put at x (y) is put at 271 - x (-5 - y): the picture turns exactly 180 degrees with the tilemaps (ts_tiles).
- rtl/ts_sprites.sv:105 Here: x + 48 (y + 244) is drawn into the window 0..319 (0..239) and the line buffer address is mirrored (319 - x); with the Y flip the screen's lines meet the sprite's rows from its bottom, so the scanner steps the rows downwards ("reverse"
- rtl/ts_tiles.sv:1 Tilemap line renderer of the Tecmo System video (MAME 0.289 tecmosys_v.cpp: get_tile_info, the scroll / flip set-up of screen_update, and tilemap_copy_to_compose).
- rtl/ts_tiles.sv:2 It draws one line of the four tilemaps, in MAME's order, into the compose line buffer:
- rtl/ts_tiles.sv:10 Compose entry = {pri[1:0], palette index[10:0]}: BG layers colour * 16 + pen (tilemap palette 000-3ff), the text layer 400 + colour * 16 + pen (MAME's gfx bases 0x4000 / 0x4400 masked with 0x7ff).
- rtl/ts_tiles.sv:13 MAME FLAW 1 FIXED (docs/status.md): the screen flip.
- rtl/ts_tiles.sv:15 The games' inverted screen (tkdensho 0x2e5e) adds 0x20 / 0x116 to every scroll and sets the flips: these origins (319 - 0x20, 239 - 0x116) turn the picture exactly 180 degrees (tools/flip_study.py: 0 pixels against MAME's normal picture tur
- rtl/ts_tiles.sv:17 MAME uses 511 for all.
- rtl/ts_tiles.sv:18 The text layer's scroll registers are ignored as MAME does: the games write 018e / 01ee (tkdensho) and 018e / 01ef (deroon), which a real scroll with offsets 114 / 18 would make one line apart -- the flip test cannot tell the two apart (doc
- rtl/ts_tiles.sv:77 sample the layer's registers: scroll X / Y with MAME's offsets, flip
- rtl/ts_video.sv:1 The Tecmo System video: raster, the tilemap and sprite line renderers (ts_tiles, ts_sprites) a line ahead of the display, and the final mix of MAME 0.289 tecmosys_v.cpp (do_final_mix) with the two palettes.
- rtl/ts_video.sv:4 The picture is dots 0-319 of lines 0-239 (MAME's visible area) in both; the vertical blank (lines 240 to the last) starts with the 68000's interrupt and the moment the sprite list is taken (ev_vbl); 880000 reads 0 during it (`vblank`).
- rtl/ts_video.sv:6 Sync positions are this core's choice (the board's are not documented): Original 448 dots x 272 lines (7 MHz dots, 15.625 kHz, 57.4449 Hz: MAME's 57.4458 Hz screen): hsync dots 344-375, vsync lines 248-250 RT4K DV1 395 dots x 264 lines (6
- rtl/ts_video.sv:11 Line L is drawn into bank L & 1 of the two line buffers during line L - 1 (line 0 during the last line) and displayed from it during line L: compose buffer {pri[1:0], tilemap palette index[10:0]} of the topmost tilemap pixel (ts_tiles; til
- rtl/ts_video.sv:19 (MAME's other combinations reduce to these.) Colours are xGGGGGRRRRRBBBBB, each 5-bit channel expanded to 8 bits as (c << 3) | (c >> 2).
- rtl/ts_ymz280b.sv:1 (Tecmo System core: the owner's jchan-mister rtl/jchan_ymz280b.sv, with three changes for this board, marked TECMOSYS: the 16.9344 MHz chip's sample tick, 88.2 kHz, as a fractional enable of the machine clock (TICK_CLKS is no longer an inte
- rtl/ts_ymz280b.sv:6 Yamaha YMZ280B (8-voice ADPCM / PCM8 / PCM16 player), written from MAME 0.289 devices/sound/ymz280b.cpp, which is its reference: every register, the three decoders, the per-voice linear interpolation and the level / pan maths follow that fi
- rtl/ts_ymz280b.sv:7 Output: one stereo sample every TICK_CLKS clocks (MAME's stream rate, 16 MHz / 384 * 2 = 83.33 kHz; 96 MHz / 1152), as the 27-bit sum of the voices' `interp * level / 2` terms (`dbg_l` / `dbg_r`, exactly what MAME's `add_int(..., 32768 * 25
- rtl/ts_ymz280b.sv:11 What is and is not modelled (jchan's board reaches only the write side of the chip: sub 68000 800001 = register select, 800003 = data): modelled voice registers 00-7f, global register ff (key-on enable, the "stop everything" side effect),
- rtl/ts_ymz280b.sv:17 How MAME's chunked stream is mapped onto a sample-by-sample machine (the argument is in docs/sound.md): * MAME generates samples in chunks that end at every data-port write and every 1/50 s (sound manager update); a write at stream index N
- rtl/ts_ymz280b.sv:21 * at a chunk start MAME parks idle voices (not playing, last two samples zero) at output_pos = 1.0 and skips them; the "ramp to zero" that fills the rest of a chunk after the end of a sample (t = t * 15 / 16 per decoded sample) ends at the
- rtl/ts_ymz280b.sv:24 * the interpolation position is advanced eagerly (right after an output that wrapped it) as MAME does, so a chunk always ends with output_pos < 1.0.
- rtl/ts_ymz280b.sv:33 the stream rate MAME uses (16.9344 MHz / 192); 50 Hz timer events derive from it
- rtl/ts_ymz280b.sv:83 ---------------------------------------------------------------- TECMOSYS: the read side status (MAME compute_status): bit v = voice v reached its end; a read of the status byte returns it and clears it.
- rtl/ts_ymz280b.sv:105 MAME's sound manager updates every stream at k / 50 s (k >= 1); a stream index N = floor(k * TIMER_RATE / 50).
- rtl/ts_ymz280b.sv:247 the first sample starts a chunk (MAME's first stream update parks the idle voices)
- rtl/ts_ymz280b.sv:531 TECMOSYS: the end flag (MAME's update_irq_state_timer_common)
- README.md:3 MAME's `tecmo/tecmosys.cpp` driver, Tecmo's 1995-1996 Tecmo System board (68000 at 16 MHz; a Z80 sound board at 8 MHz with a YMF262 (OPL3), a YMZ280B and an OKI
- README.md:15 Written for MiSTer from MAME 0.289's driver (`tecmosys.cpp`, `tecmosys_v.cpp`, `tecmosys_m.cpp`) on the owner's Jackie Chan core (the platform layer: SDRAM cont
- README.md:30 The pictures are MAME 0.289's (`tools/capture.py --play`).
- README.md:42 What was checked besides, in simulation and in the Quartus tool flow, against MAME 0.289 (details and numbers in `docs/status.md`):
- README.md:51 The sound: the Z80's 2,689 writes to the three chips in MAME's order.
- README.md:51 The two sample chips come first in the SDRAM's queue, because the OKI M6295 takes each ADPCM byte at a fixed moment, ready or not: in a 1,000-frame Deroon run a
- README.md:54 The OKI's 15 kHz output is interpolated to 48 kHz as MAME 0.289's resampler does it (against MAME's formula: largest error 0.39 of one OKI step); the coin sound
- README.md:58 **Beyond MAME** (`docs/status.md`, "MAME's flaws"): the **screen flip** (the games' "inverted" setting) works.
- README.md:58 MAME leaves the sprites unflipped; the board flips the sprite layer with bit 15 of its offset registers, which MAME masks away, and the tilemaps flip about the
- README.md:61 The **music does not drown the voices**: MAME has played this board's FM 6 dB too loud against the sample chips since 0.225 (a YMF262 output bug, then a rebalan
- README.md:82 The first start of each game shows its own "READ ERROR!" lines and then "INITIALIZED": the game setting up its blank EEPROM (MAME shows the same).
- README.md:98 The names come from the games themselves: their I/O tests, Deroon's how-to-play and each button pressed in MAME (`docs/status.md`).
- README.md:115 **Volume**: Normal (about MAME 0.289's loudness), -6 dB, -12 dB, +6 dB.
- README.md:123 The sprites are drawn one frame behind the tilemaps, as MAME draws them.
- README.md:154 one frozen MAME state through the video (tools/bench_video.py runs a list of them)
- README.md:157 sim/lint.sh # Verilator lint of the core sim/tb_oki_interp.sv + sim/check_oki_interp.py # the OKI's interpolation against MAME
- README.md:160 `tools/capture.py` (with `tools/lua/dump_state.lua`) makes MAME 0.289's states, pictures and input holds; `tools/ts_ref.py` (a reference renderer written from t
- README.md:174 **MAME** (the tecmosys driver by Farfetch'd, David Haywood and Tomasz Slanina, the protection simulation by nuapete; the ymz280b device by Aaron Giles; BSD-3-Cl
Says it matches, follows or was checked against MAME — 4
- README.md:32 The core's video, given the same machine state, draws each of the four game pictures identically to MAME (`tools/bench_video.py`).
- README.md:44 The ROM path: the five sets' images assembled from the MRAs are byte-identical to those built from MAME's ROM tables; the graphics as the core reads them match
- README.md:46 The video: a reference renderer written from MAME's video code identical to MAME on 21 frames; the RTL on frozen MAME states pixel-identical on 26 attract and f
- README.md:65 Known differences: the YMF262 is opl3_fpga, not MAME's ymfm (the same notes, not sample-identical), and mixed 6 dB softer against the samples than MAME 0.289 (a
Says it was translated, ported or taken from MAME — 1
- README.md:143 The MRAs are written by `python tools/make_mra.py` from the set tables of `tools/ts_rom.py` (taken from MAME 0.289's `src/mame/tecmo/tecmosys.cpp`; `tools/paths
Keeps a MAME approximation — 3
- rtl/ts_cen.sv:47 mode 0, Original (the first release's): the board's 7 MHz dots (28 MHz / 4) on 13-clock steps, 448 a line after a 320-clock gap; 6144 clocks a line (64 us: 15.625 kHz), 272 lines = 57.4449 Hz (MAME: 57.4458 Hz on a placeholder 512 x 512 ras
- rtl/ts_main.sv:26 Watchdog: MAME's WATCHDOG_TIMER with a vblank count of 400 (a guess in the driver): 400 vertical blanks without a write to 880022 reset the machine (wd_rst, one clock).
- README.md:126 The picture is 320 x 240 in both Video Timings (MAME 0.289: 57.4458 Hz on a placeholder 512 x 512 raster; the board's totals are not documented):
Shares text with the MAME driver without saying so — 3