Expand description
The machine table and the clock constants every module shares
(machine.py).
One board, a table of rows: the PC Engine and the TurboGrafx-16 differ by a pin (the reference’s docs/start-here.md). Add-ons (SuperGrafx, CD) add rows or build on this board; they do not fork it.
Differences forced by Rust: time is i64 master clocks everywhere (the
reference’s unbounded int; a line’s start may be negative with
start_offset).
Structs§
- Machine
- One row of the machine table.
Constants§
- ACTIVE_
LINES - ADDRESS_
MASK - CPU_
CLOCKS_ HIGH - [hw: pcetech 2.4] CPU clock is master/3 (high) or master/12 (low); power-up is low.
- CPU_
CLOCKS_ LOW - FRAME_
LINES_ LONG - [hw: pcetech 7; doc: wiki] 263-line frame; the 262-line form follows VCE bit 2 (C3).
- FRAME_
LINES_ SHORT - HARDWARE_
BASE - The hardware page, bank $FF: physical $1FE000-$1FFFFF (pages 0x1FE0-0x1FFF).
- HARDWARE_
FIRST_ PAGE - HSYNC_
CLOCKS - [emu: Mednafen vce.cpp l.561
hblank_counter = hblank ? 237 : 1128] the VCE’s horizontal sync is 237 master clocks at the start of a line. Tier 5; the real width is not published (U19). - LINE_
CLOCKS - [doc: wiki “Timing”; emu: Mednafen vce.cpp] a line is 1365 master clocks whatever the dot clock (C5: “roughly 342 dots” at 5 MHz is 1365 / 4 = 341.25).
- MASTER_
HZ - [hw: pcetech 2.4] 21.47727 MHz master clock (6 x NTSC colour burst).
- PAGE_
BITS - A page of the page table is 256 bytes over the 21-bit space: 8192 pages (docs/sockets.md).
- PAGE_
COUNT - PC_
ENGINE - TIMER_
TICK_ CLOCKS - [hw: pcetech 2.2] the timer counts once per 1024 high-speed CPU cycles, whatever the CPU speed.
- TOP_
BLANK_ LINES - [hw: pcetech 7] the frame layout: 14 top blank, 242 active, 4 bottom blank, 3 sync.
- TURBOGRAFX_
16 - VSYNC_
LINES - [emu: Mednafen vce.cpp
vblank_counter = vblank ? 4095 : ...] the vertical sync is the last three lines of a frame (4095 = 3 x 1365). [hw: pcetech 7] “3 lines for the sync area”.
Functions§
- py_
floordiv - Python’s
//on integers: the quotient rounded toward minus infinity. - round_
ties_ even - Python’s
round()of a float: ties to even.