@@ -689,7 +689,54 @@ def rWBK equ $FF70
689689
690690def WBK_BANK equ %00000_111 ; mapped WRAM bank (0-7) [r/w]
691691
692- ; -- $FF71-$FF75 are unused ---------------------------------------------------
692+ ; -- PSW ($FF71) --------------------------------------------------------------
693+ ; (CGB boot ROM's DMG mode only) Palette Selection Window and NMI control. [r/w]
694+ ; Bits 1-6 are always 1.
695+ ; In CGB mode, reads return $FF and writes are ignored.
696+ def rPSW equ $ FF71
697+
698+ def B_PSW_WINDOW equ 7 ; whether the Palette Selection Window is enabled [r/w]
699+ def B_PSW_NMI equ 0 ; whether the NMI is enabled [r/w]
700+ def PSW_WINDOW equ 1 << B_PSW_WINDOW
701+ def PSW_WIN_OFF equ 0 << B_PSW_WINDOW
702+ def PSW_WIN_ON equ 1 << B_PSW_WINDOW
703+ def PSW_NMI equ 1 << B_PSW_NMI
704+ def PSW_NMI_DISABLE equ 0 << B_PSW_NMI
705+ def PSW_NMI_ENABLE equ 1 << B_PSW_NMI
706+
707+ ; -- PSWX ($FF72) -------------------------------------------------------------
708+ ; (CGB boot ROM only) X coordinate of the Palette Selection Window's top-left pixel, plus 7 (7-166) [r/w]
709+ ; Readable and writable in both CGB and DMG mode.
710+ def rPSWX equ $ FF72
711+
712+ ; -- PSWY ($FF73) -------------------------------------------------------------
713+ ; (CGB boot ROM only) Y coordinate of the Palette Selection Window's top-left pixel (0-143) [r/w]
714+ ; Readable and writable in both CGB and DMG mode.
715+ def rPSWY equ $ FF73
716+
717+ ; -- PSM ($FF74) --------------------------------------------------------------
718+ ; (CGB boot ROM only) Set the Palette Selection Window button mask (triggers NMI when pressed) [r/w]
719+ ; Readable and writable in both CGB and DMG mode.
720+ def rPSM equ $ FF74
721+
722+ def B_PSM_START equ 7
723+ def B_PSM_SELECT equ 6
724+ def B_PSM_B equ 5
725+ def B_PSM_A equ 4
726+ def B_PSM_DOWN equ 3
727+ def B_PSM_UP equ 2
728+ def B_PSM_LEFT equ 1
729+ def B_PSM_RIGHT equ 0
730+ def PSM_START equ 1 << B_PSM_START
731+ def PSM_SELECT equ 1 << B_PSM_SELECT
732+ def PSM_B equ 1 << B_PSM_B
733+ def PSM_A equ 1 << B_PSM_A
734+ def PSM_DOWN equ 1 << B_PSM_DOWN
735+ def PSM_UP equ 1 << B_PSM_UP
736+ def PSM_LEFT equ 1 << B_PSM_LEFT
737+ def PSM_RIGHT equ 1 << B_PSM_RIGHT
738+
739+ ; -- $FF75 is unused ----------------------------------------------------------
693740
694741; -- PCM12 ($FF76) ------------------------------------------------------------
695742; Audio channels 1 and 2 output
0 commit comments