mirror of
https://github.com/MiSTer-devel/GameAndWatch_MiSTer.git
synced 2026-06-07 03:03:44 +00:00
2.5 KiB
2.5 KiB
Registers
Note: This document has not been edited and may contain inaccuracies. More information can be found in Instructions.
ROM
Pages are arranged as 4 columns (Pu) with 10 values each (Pm). Pages contain 63 values indexed by Pl
RAM
512 bits, in the form of 8 files (Bm) with 16 words (Bl) of 4 bits
The last two files are reserved for display RAM (referred to as R, S)
Registers
PC
Pu- 2 bits - Part of pagePm- 4 bits - Part of pagePl- 6 bits - Polynomial counter - TODO: How does this work?
Appears to increment like: { Pl[0] == Pl[1], Pl[5:1] }, but MAME has more
Initializes to Pu = 3, Pm = 7, Pl = 0 (3_7_0)
Restoring from clock halt, starts at 1_0_0
SP
Hardware registers for maintaining stack depth and values. S is the first level, and R is the second
Su- 2 bitsSm- 4 bitsSl- 6 bitsRu- 2 bitsRm- 4 bitsRl- 6 bits
General
Acc- 4 bits - AccumulatorW- 8 bits - Shift register - TODO: Is this necessary?Bm- 3 bits - Upper 3 bits of RAM addressBl- 4 bits - Lower 4 bits of RAM addressL,Y- 4 bits - Flip flop - TODO: Is this necessary
IO
Inputs
K- 4 bits. Arbitrary 4 bitsBA- 1 bit. Arbitrary 1 bit - Has a pull-up resistor by default, so if unused/unspecified, should be highBETA- 1 bit. Arbitrary 1 bit - Has a pull-up resistor by default, so if unused/unspecified, should be high
Outputs
H- 4 bits - Controls which bit (out of 4) for each word in display memory is being used to drive the segments. Docs say it has a 1/4 duty cycle, so each bit is high 1/4th of the time, so it's driven by a counter up to 4. An aside lists the frame frequency as 64HzS- 8 bits - Directly driven by theWregister (the SM510 docs talk about theW'register andPTWinstruction, but those don't exist on this hardware)- Each bit selects a row of the input matrix, and multiple set bits means the matrix lines are ORed together
- Sometimes hardware grounds one of the lines, so it is always active and ORed to the rest of the active input
BS- 1 bit - Somehow driven by "the contents of theLorYregister", but it doesn't describe how. It uses the same 1/4 duty cycle, so assumedly it changes along withH. MAME ANDs the two registers, but only sometime. TODO: This is implemented with onlyLat the moment