Skip to content

Commit

Permalink
power up sequence: accurately reflect which registers are available (#…
Browse files Browse the repository at this point in the history
…535)

* Fix initial register table

While the current table is technically correct, it doesn't tell *why*
those values are the way they are. This edit should mitigate that.

* Missed SVBK, correct its initial value as well

* Clarify CGB-mode regs with a new footnote
  • Loading branch information
SonoSooS authored Jan 19, 2024
1 parent 16bb7e8 commit bc65aa3
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/Power_Up_Sequence.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,19 +312,19 @@ Name | Address | DMG0 | DMG / MGB | SGB / SGB2 | CGB / AGB
[`OBP1`] | $FF49 | ??[^obp] | ??[^obp] | ??[^obp] | ??[^obp]
[`WY`] | $FF4A | $00 | $00 | $00 | $00
[`WX`] | $FF4B | $00 | $00 | $00 | $00
[`KEY1`] | $FF4D | $FF | $FF | $FF | $FF
[`VBK`] | $FF4F | $FF | $FF | $FF | $FF
[`HDMA1`] | $FF51 | $FF | $FF | $FF | $FF
[`HDMA2`] | $FF52 | $FF | $FF | $FF | $FF
[`HDMA3`] | $FF53 | $FF | $FF | $FF | $FF
[`HDMA4`] | $FF54 | $FF | $FF | $FF | $FF
[`HDMA5`] | $FF55 | $FF | $FF | $FF | $FF
[`RP`] | $FF56 | $FF | $FF | $FF | $FF
[`BCPS`] | $FF68 | $FF | $FF | $FF | ??[^compat]
[`BCPD`] | $FF69 | $FF | $FF | $FF | ??[^compat]
[`OCPS`] | $FF6A | $FF | $FF | $FF | ??[^compat]
[`OCPD`] | $FF6B | $FF | $FF | $FF | ??[^compat]
[`SVBK`] | $FF70 | $FF | $FF | $FF | $FF
[`KEY1`] | $FF4D | --- | --- | --- | $7E[^cgb_only]
[`VBK`] | $FF4F | --- | --- | --- | $FE[^cgb_only]
[`HDMA1`] | $FF51 | --- | --- | --- | $FF[^cgb_only]
[`HDMA2`] | $FF52 | --- | --- | --- | $FF[^cgb_only]
[`HDMA3`] | $FF53 | --- | --- | --- | $FF[^cgb_only]
[`HDMA4`] | $FF54 | --- | --- | --- | $FF[^cgb_only]
[`HDMA5`] | $FF55 | --- | --- | --- | $FF[^cgb_only]
[`RP`] | $FF56 | --- | --- | --- | $3E[^cgb_only]
[`BCPS`] | $FF68 | --- | --- | --- | ??[^compat]
[`BCPD`] | $FF69 | --- | --- | --- | ??[^compat]
[`OCPS`] | $FF6A | --- | --- | --- | ??[^compat]
[`OCPD`] | $FF6B | --- | --- | --- | ??[^compat]
[`SVBK`] | $FF70 | --- | --- | --- | $F8[^cgb_only]
[`IE`] | $FFFF | $00 | $00 | $00 | $00

[^unk]:
Expand All @@ -343,6 +343,8 @@ Make sure to always set those before displaying objects for the first time.
[^compat]:
These depend on whether compatibility mode is enabled.

[^cgb_only]: These registers are only available in CGB Mode, and will read \$FF in Non-CGB Mode.

The table above was obtained from Mooneye-GB tests [`acceptance/boot_hwio-dmg0`](https://github.com/Gekkio/mooneye-gb/blob/ca7ff30b52fd3de4f1527397f27a729ffd848dfa/tests/acceptance/boot_hwio-dmg0.s), [`acceptance/boot_hwio-dmgABCmgb`](https://github.com/Gekkio/mooneye-gb/blob/ca7ff30b52fd3de4f1527397f27a729ffd848dfa/tests/acceptance/boot_hwio-dmgABCmgb.s), [`acceptance/boot_hwio-S`](https://github.com/Gekkio/mooneye-gb/blob/ca7ff30b52fd3de4f1527397f27a729ffd848dfa/tests/acceptance/boot_hwio-S.s), and [`misc/boot_hwio-C`](https://github.com/Gekkio/mooneye-gb/blob/ca7ff30b52fd3de4f1527397f27a729ffd848dfa/tests/misc/boot_hwio-C.s), plus some extra testing.

[`P1`]: <#FF00 — P1/JOYP: Joypad>
Expand Down

0 comments on commit bc65aa3

Please sign in to comment.