2222; Define the include guard and the current hardware.inc version 
2323; (do this after the RGBDS version check since the `def` syntax depends on it) 
2424def HARDWARE_INC equ  1 
25- def HARDWARE_INC_VERSION equs  "5.1 .0" 
25+ def HARDWARE_INC_VERSION equs  "5.2 .0" 
2626
2727; Usage: rev_Check_hardware_inc <min_ver> 
2828; Examples: 
@@ -66,7 +66,7 @@ def B_JOYP_DOWN   equ 3 ; 0 = Down is pressed   (if reading Control Pad) [ro]
6666def B_JOYP_UP     equ  2  ; 0 = Up is pressed     (if reading Control Pad) [ro] 
6767def B_JOYP_LEFT   equ  1  ; 0 = Left is pressed   (if reading Control Pad) [ro] 
6868def 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) 
7070    def JOYP_START  equ  1  << B_JOYP_START 
7171    def JOYP_SELECT equ  1  << B_JOYP_SELECT 
7272    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]
422422
423423; -- AUD3WAVE ($FF30-$FF3F) --------------------------------------------------- 
424424; Audio channel 3 wave pattern RAM [r/w] 
425- def _AUD3WAVERAM equ  $ FF30  ; $FF30-$FF3F 
426- 
427425def rAUD3WAVE_0 equ  $ FF30 
428426def rAUD3WAVE_1 equ  $ FF31 
429427def rAUD3WAVE_2 equ  $ FF32 
@@ -441,8 +439,6 @@ def rAUD3WAVE_D equ $FF3D
441439def rAUD3WAVE_E equ  $ FF3E 
442440def rAUD3WAVE_F equ  $ FF3F 
443441
444- def AUD3WAVE_SIZE equ  16 
445- 
446442; -- LCDC ($FF40) ------------------------------------------------------------- 
447443; PPU graphics control 
448444def rLCDC equ  $ FF40 
@@ -551,7 +547,7 @@ def rWY equ $FF4A
551547; X coordinate of the Window's top-left pixel, plus 7 (7-166) [r/w] 
552548def rWX equ  $ FF4B 
553549
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 
555551
556552; -- SYS / KEY0 ($FF4C) ------------------------------------------------------- 
557553; (CGB boot ROM only) CPU mode select 
@@ -606,7 +602,7 @@ def rVDMA_SRC_LOW equ $FF52
606602; (CGB only) VRAM DMA destination address (high 8 bits) [wo] 
607603def rVDMA_DEST_HIGH equ  $ FF53 
608604
609- ; -- VDMA_DEST_LOW / HDMA3  ($FF54) -------------------------------------------- 
605+ ; -- VDMA_DEST_LOW / HDMA4  ($FF54) -------------------------------------------- 
610606; (CGB only) VRAM DMA destination address (low 8 bits) [wo] 
611607def rVDMA_DEST_LOW equ  $ FF54 
612608
@@ -812,7 +808,7 @@ def rRTCREG equ $A000
812808
813809; ** MBC5 only **************************************************************** 
814810
815- ; -- ROMB0 ($2000-$3FFF ) ------------------------------------------------------ 
811+ ; -- ROMB0 ($2000-$2FFF ) ------------------------------------------------------ 
816812; ROM bank number low byte (bits 0-7) [wo] 
817813def rROMB0 equ  $ 2000 
818814
@@ -868,12 +864,14 @@ def RAMREG_ENABLE equ $40
868864; Latch accelerometer start [wo] 
869865def rACCLATCH0 equ  $ A000 
870866
867+ ; Write $55 to ACCLATCH0 to erase the latched data 
871868def ACCLATCH0_START equ  $ 55 
872869
873870; -- ACCLATCH1 ($Ax1x) -------------------------------------------------------- 
874871; Latch accelerometer finish [wo] 
875872def rACCLATCH1 equ  $ A010 
876873
874+ ; Write $AA to ACCLATCH1 to latch the accelerometer and update ACCEL* 
877875def ACCLATCH1_FINISH equ  $ AA 
878876
879877; -- ACCELX0 ($Ax2x) ---------------------------------------------------------- 
@@ -903,6 +901,7 @@ def rEEPROM equ $A080
903901; IR register [r/w] 
904902def rIRREG equ  $ A000 
905903
904+ ; whether the IR transmitter sees light 
906905def IR_LED_OFF equ  $ C0 
907906def IR_LED_ON  equ  $ C1 
908907
@@ -938,6 +937,12 @@ def COLOR_SIZE equ 2 ; size of color in bytes (little-endian BGR555)
938937def PAL_COLORS equ  4  ; colors per palette 
939938def PAL_SIZE   equ COLOR_SIZE  *  PAL_COLORS  ; size of palette in bytes 
940939
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+ 
941946; Tilemaps the BG or Window can read from (controlled by LCDC) 
942947def TILEMAP0 equ  $ 9800  ; $9800-$9BFF 
943948def TILEMAP1 equ  $ 9C00  ; $9C00-$9FFF 
@@ -986,6 +991,20 @@ def OAM_COUNT equ 40 ; how many OBJs there are room for in OAM
986991def OAM_SIZE  equ OBJ_SIZE  *  OAM_COUNT 
987992
988993
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+ 
9891008;****************************************************************************** 
9901009; Interrupt vector addresses 
9911010;****************************************************************************** 
0 commit comments