22
22
; Define the include guard and the current hardware.inc version
23
23
; (do this after the RGBDS version check since the `def` syntax depends on it)
24
24
def HARDWARE_INC equ 1
25
- def HARDWARE_INC_VERSION equs "5.1 .0"
25
+ def HARDWARE_INC_VERSION equs "5.2 .0"
26
26
27
27
; Usage: rev_Check_hardware_inc <min_ver>
28
28
; Examples:
@@ -66,7 +66,7 @@ def B_JOYP_DOWN equ 3 ; 0 = Down is pressed (if reading Control Pad) [ro]
66
66
def B_JOYP_UP equ 2 ; 0 = Up is pressed (if reading Control Pad) [ro]
67
67
def B_JOYP_LEFT equ 1 ; 0 = Left is pressed (if reading Control Pad) [ro]
68
68
def B_JOYP_RIGHT equ 0 ; 0 = Right is pressed (if reading Control Pad) [ro]
69
- def JOYP_INPUTS equ %0000_1111
69
+ def JOYP_INPUTS equ %0000_1111 ; bits equal to 0 indicate pressed (when reading inputs)
70
70
def JOYP_START equ 1 << B_JOYP_START
71
71
def JOYP_SELECT equ 1 << B_JOYP_SELECT
72
72
def JOYP_B equ 1 << B_JOYP_B
@@ -422,8 +422,6 @@ def B_AUDENA_ENABLE_CH1 equ 0 ; 1 = channel 1 is running [ro]
422
422
423
423
; -- AUD3WAVE ($FF30-$FF3F) ---------------------------------------------------
424
424
; Audio channel 3 wave pattern RAM [r/w]
425
- def _AUD3WAVERAM equ $ FF30 ; $FF30-$FF3F
426
-
427
425
def rAUD3WAVE_0 equ $ FF30
428
426
def rAUD3WAVE_1 equ $ FF31
429
427
def rAUD3WAVE_2 equ $ FF32
@@ -441,8 +439,6 @@ def rAUD3WAVE_D equ $FF3D
441
439
def rAUD3WAVE_E equ $ FF3E
442
440
def rAUD3WAVE_F equ $ FF3F
443
441
444
- def AUD3WAVE_SIZE equ 16
445
-
446
442
; -- LCDC ($FF40) -------------------------------------------------------------
447
443
; PPU graphics control
448
444
def rLCDC equ $ FF40
@@ -551,7 +547,7 @@ def rWY equ $FF4A
551
547
; X coordinate of the Window's top-left pixel, plus 7 (7-166) [r/w]
552
548
def rWX equ $ FF4B
553
549
554
- def WX_OFS equ 7 ; subtract this to get the actual Window Y coordinate
550
+ def WX_OFS equ 7 ; subtract this to get the actual Window X coordinate
555
551
556
552
; -- SYS / KEY0 ($FF4C) -------------------------------------------------------
557
553
; (CGB boot ROM only) CPU mode select
@@ -606,7 +602,7 @@ def rVDMA_SRC_LOW equ $FF52
606
602
; (CGB only) VRAM DMA destination address (high 8 bits) [wo]
607
603
def rVDMA_DEST_HIGH equ $ FF53
608
604
609
- ; -- VDMA_DEST_LOW / HDMA3 ($FF54) --------------------------------------------
605
+ ; -- VDMA_DEST_LOW / HDMA4 ($FF54) --------------------------------------------
610
606
; (CGB only) VRAM DMA destination address (low 8 bits) [wo]
611
607
def rVDMA_DEST_LOW equ $ FF54
612
608
@@ -812,7 +808,7 @@ def rRTCREG equ $A000
812
808
813
809
; ** MBC5 only ****************************************************************
814
810
815
- ; -- ROMB0 ($2000-$3FFF ) ------------------------------------------------------
811
+ ; -- ROMB0 ($2000-$2FFF ) ------------------------------------------------------
816
812
; ROM bank number low byte (bits 0-7) [wo]
817
813
def rROMB0 equ $ 2000
818
814
@@ -868,12 +864,14 @@ def RAMREG_ENABLE equ $40
868
864
; Latch accelerometer start [wo]
869
865
def rACCLATCH0 equ $ A000
870
866
867
+ ; Write $55 to ACCLATCH0 to erase the latched data
871
868
def ACCLATCH0_START equ $ 55
872
869
873
870
; -- ACCLATCH1 ($Ax1x) --------------------------------------------------------
874
871
; Latch accelerometer finish [wo]
875
872
def rACCLATCH1 equ $ A010
876
873
874
+ ; Write $AA to ACCLATCH1 to latch the accelerometer and update ACCEL*
877
875
def ACCLATCH1_FINISH equ $ AA
878
876
879
877
; -- ACCELX0 ($Ax2x) ----------------------------------------------------------
@@ -903,6 +901,7 @@ def rEEPROM equ $A080
903
901
; IR register [r/w]
904
902
def rIRREG equ $ A000
905
903
904
+ ; whether the IR transmitter sees light
906
905
def IR_LED_OFF equ $ C0
907
906
def IR_LED_ON equ $ C1
908
907
@@ -938,6 +937,12 @@ def COLOR_SIZE equ 2 ; size of color in bytes (little-endian BGR555)
938
937
def PAL_COLORS equ 4 ; colors per palette
939
938
def PAL_SIZE equ COLOR_SIZE * PAL_COLORS ; size of palette in bytes
940
939
940
+ ; (DMG only) grayscale shade indexes for BGP, OBP0, and OBP1
941
+ def SHADE_WHITE equ %00
942
+ def SHADE_LIGHT equ % 01
943
+ def SHADE_DARK equ % 10
944
+ def SHADE_BLACK equ % 11
945
+
941
946
; Tilemaps the BG or Window can read from (controlled by LCDC)
942
947
def TILEMAP0 equ $ 9800 ; $9800-$9BFF
943
948
def TILEMAP1 equ $ 9C00 ; $9C00-$9FFF
@@ -986,6 +991,20 @@ def OAM_COUNT equ 40 ; how many OBJs there are room for in OAM
986
991
def OAM_SIZE equ OBJ_SIZE * OAM_COUNT
987
992
988
993
994
+ ;******************************************************************************
995
+ ; Audio channel RAM addresses
996
+ ;******************************************************************************
997
+
998
+ def AUD1RAM equ $ FF10 ; $FF10-$FF14
999
+ def AUD2RAM equ $ FF15 ; $FF15-$FF19
1000
+ def AUD3RAM equ $ FF1A ; $FF1A-$FF1E
1001
+ def AUD4RAM equ $ FF1F ; $FF1F-$FF23
1002
+ def AUDRAM_SIZE equ 5 ; size of each audio channel RAM in bytes
1003
+
1004
+ def _AUD3WAVERAM equ $ FF30 ; $FF30-$FF3F
1005
+ def AUD3WAVE_SIZE equ 16 ; size of wave pattern RAM in bytes
1006
+
1007
+
989
1008
;******************************************************************************
990
1009
; Interrupt vector addresses
991
1010
;******************************************************************************
0 commit comments