Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,5 @@
- Added `JOYP_SGB_*` constants
- Added more `BOOTUP_*` value constants
- Corrected comments on some audio registers
- **Rev 5.4.0** - 2025-12-31 *(mattcurrie)*
- Added registers and constants for PSW
Comment thread
mattcurrie marked this conversation as resolved.
Outdated
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ Breaking changes increase the major version, backwards-compatible changes (typic
* Carsten Sørensen (whose ideas Jeff based his file on)
* Jeff Frohwein
* AntonioND
* BlitterObjectBob, tobiasvl, ISSOtm, Rangi42, avivace, Eievui, QuinnPainter, rondnelson99, daid, Hacktix, sukus21, alvaro-cuesta, basxto
* BlitterObjectBob, tobiasvl, ISSOtm, Rangi42, avivace, Eievui, QuinnPainter, rondnelson99, daid, Hacktix, sukus21, alvaro-cuesta, basxto, mattcurrie
* Probably lots of other people who have added to the file throughout the years
51 changes: 49 additions & 2 deletions hardware.inc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ endc
; Define the include guard and the current hardware.inc version
; (do this after the RGBDS version check since the `def` syntax depends on it)
def HARDWARE_INC equ 1
def HARDWARE_INC_VERSION equs "5.3.0"
def HARDWARE_INC_VERSION equs "5.4.0"
Comment thread
mattcurrie marked this conversation as resolved.
Outdated

; Usage: rev_Check_hardware_inc <min_ver>
; Examples:
Expand Down Expand Up @@ -689,7 +689,54 @@ def rWBK equ $FF70

def WBK_BANK equ %00000_111 ; mapped WRAM bank (0-7) [r/w]

; -- $FF71-$FF75 are unused ---------------------------------------------------
; -- PSW ($FF71) --------------------------------------------------------------
; (CGB boot ROM only) Palette Selection Window and NMI control. [r/w CGB's DMG mode only]
; In the CGB's CGB mode reads return $FF and writes are ignored.
; Bits 1-6 are always 1.
Comment thread
mattcurrie marked this conversation as resolved.
Outdated
def rPSW equ $FF71

def B_PSW_WINDOW equ 7 ; whether the Palette Selection Window is enabled [r/w CGB's DMG mode only]
def B_PSW_NMI equ 0 ; whether the NMI is enabled [r/w CGB's DMG mode only]
Comment thread
mattcurrie marked this conversation as resolved.
Outdated
def PSW_WINDOW equ 1 << B_PSW_WINDOW
def PSW_WIN_OFF equ 0 << B_PSW_WINDOW
def PSW_WIN_ON equ 1 << B_PSW_WINDOW
def PSW_NMI equ 1 << B_PSW_NMI
def PSW_NMI_DISABLE equ 0 << B_PSW_NMI
def PSW_NMI_ENABLE equ 1 << B_PSW_NMI

; -- PSWX ($FF72) -------------------------------------------------------------
; (CGB boot ROM only) X coordinate of the Palette Selection Window's top-left pixel, plus 7 (7-166) [r/w]
; Readable and writable in both CGB and DMG mode.
def rPSWX equ $FF72

; -- PSWY ($FF73) -------------------------------------------------------------
; (CGB boot ROM only) Y coordinate of the Palette Selection Window's top-left pixel (0-143) [r/w]
; Readable and writable in both CGB and DMG mode.
def rPSWY equ $FF73

; -- PSM ($FF74) --------------------------------------------------------------
; (CGB boot ROM only) Set the Palette Selection Window button mask (triggers NMI when pressed) [r/w]
; Readable and writable in both CGB and DMG mode.
def rPSM equ $FF74

def B_PSM_START equ 7
def B_PSM_SELECT equ 6
def B_PSM_B equ 5
def B_PSM_A equ 4
def B_PSM_DOWN equ 3
def B_PSM_UP equ 2
def B_PSM_LEFT equ 1
def B_PSM_RIGHT equ 0
def PSM_START equ 1 << B_PSM_START
def PSM_SELECT equ 1 << B_PSM_SELECT
def PSM_B equ 1 << B_PSM_B
def PSM_A equ 1 << B_PSM_A
def PSM_DOWN equ 1 << B_PSM_DOWN
def PSM_UP equ 1 << B_PSM_UP
def PSM_LEFT equ 1 << B_PSM_LEFT
def PSM_RIGHT equ 1 << B_PSM_RIGHT

; -- $FF75 is unused ----------------------------------------------------------

; -- PCM12 ($FF76) ------------------------------------------------------------
; Audio channels 1 and 2 output
Expand Down