Skip to content

Commit 1db4188

Browse files
Rangi42ISSOtm
andauthored
Version 5.2.0 (#65)
* Changed `_AUD3WAVERAM` to `AUD3WAVERAM` * Fix comment * Add more comments * Update comment Co-authored-by: Eldred Habert <[email protected]> * Add constants for color shades * Fix comment * Add `AUD1RAM`-`AUD4RAM` audio channel RAM address constants * Correct comments * Do not rename `_AUD3WAVERAM` * Reduce version number --------- Co-authored-by: Eldred Habert <[email protected]>
1 parent db8a1c0 commit 1db4188

File tree

2 files changed

+32
-9
lines changed

2 files changed

+32
-9
lines changed

HISTORY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,7 @@
104104
- Added `PAD_*` constants for combined button and Control Pad masks
105105
- Added `B_COLOR_*` red/green/blue bit numbers
106106
- Corrected comments on `B_BG_PRIO` and `B_OAM_PRIO`
107+
- **Rev 5.2.0** - 2025-07-22 *(Rangi42)*
108+
- Added `AUD1RAM`-`AUD4RAM` address constants
109+
- Added `SHADE_*` constants for grayscale shades
110+
- Corrected comments on `WX_OFS`, `VDMA_DEST_LOW`, and `ROMB0`

hardware.inc

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ endc
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)
2424
def 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]
6666
def B_JOYP_UP equ 2 ; 0 = Up is pressed (if reading Control Pad) [ro]
6767
def B_JOYP_LEFT equ 1 ; 0 = Left is pressed (if reading Control Pad) [ro]
6868
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)
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-
427425
def rAUD3WAVE_0 equ $FF30
428426
def rAUD3WAVE_1 equ $FF31
429427
def rAUD3WAVE_2 equ $FF32
@@ -441,8 +439,6 @@ def rAUD3WAVE_D equ $FF3D
441439
def rAUD3WAVE_E equ $FF3E
442440
def rAUD3WAVE_F equ $FF3F
443441

444-
def AUD3WAVE_SIZE equ 16
445-
446442
; -- LCDC ($FF40) -------------------------------------------------------------
447443
; PPU graphics control
448444
def 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]
552548
def 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]
607603
def 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]
611607
def 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]
817813
def rROMB0 equ $2000
818814

@@ -868,12 +864,14 @@ def RAMREG_ENABLE equ $40
868864
; Latch accelerometer start [wo]
869865
def rACCLATCH0 equ $A000
870866

867+
; Write $55 to ACCLATCH0 to erase the latched data
871868
def ACCLATCH0_START equ $55
872869

873870
; -- ACCLATCH1 ($Ax1x) --------------------------------------------------------
874871
; Latch accelerometer finish [wo]
875872
def rACCLATCH1 equ $A010
876873

874+
; Write $AA to ACCLATCH1 to latch the accelerometer and update ACCEL*
877875
def ACCLATCH1_FINISH equ $AA
878876

879877
; -- ACCELX0 ($Ax2x) ----------------------------------------------------------
@@ -903,6 +901,7 @@ def rEEPROM equ $A080
903901
; IR register [r/w]
904902
def rIRREG equ $A000
905903

904+
; whether the IR transmitter sees light
906905
def IR_LED_OFF equ $C0
907906
def IR_LED_ON equ $C1
908907

@@ -938,6 +937,12 @@ def COLOR_SIZE equ 2 ; size of color in bytes (little-endian BGR555)
938937
def PAL_COLORS equ 4 ; colors per palette
939938
def 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)
942947
def TILEMAP0 equ $9800 ; $9800-$9BFF
943948
def TILEMAP1 equ $9C00 ; $9C00-$9FFF
@@ -986,6 +991,20 @@ def OAM_COUNT equ 40 ; how many OBJs there are room for in OAM
986991
def 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

Comments
 (0)