RGBDS DEF Syntax Update

This commit is contained in:
vulcandth 2022-05-11 21:59:00 -05:00
parent fe3939e09a
commit 30fadfdd4c
26 changed files with 305 additions and 305 deletions

View File

@ -19,5 +19,5 @@ INCLUDE "constants/species_constants.asm"
INCLUDE "constants/stage_constants.asm"
INCLUDE "constants/special_collision_constants.asm"
FALSE EQU 0
TRUE EQU 1
DEF FALSE EQU 0
DEF TRUE EQU 1

View File

@ -1,4 +1,4 @@
POKE_BALL EQU $0
GREAT_BALL EQU $2
ULTRA_BALL EQU $3
MASTER_BALL EQU $5
DEF POKE_BALL EQU $0
DEF GREAT_BALL EQU $2
DEF ULTRA_BALL EQU $3
DEF MASTER_BALL EQU $5

View File

@ -1,6 +1,6 @@
; See wNextBonusStage
BONUS_STAGE_ORDER_GENGAR EQU 0
BONUS_STAGE_ORDER_MEWTWO EQU 1
BONUS_STAGE_ORDER_MEOWTH EQU 2
BONUS_STAGE_ORDER_DIGLETT EQU 3
BONUS_STAGE_ORDER_SEEL EQU 4
DEF BONUS_STAGE_ORDER_GENGAR EQU 0
DEF BONUS_STAGE_ORDER_MEWTWO EQU 1
DEF BONUS_STAGE_ORDER_MEOWTH EQU 2
DEF BONUS_STAGE_ORDER_DIGLETT EQU 3
DEF BONUS_STAGE_ORDER_SEEL EQU 4

View File

@ -1,4 +1,4 @@
const_value = 0
DEF const_value = 0
const CATCHEM_BULBASAUR ; $0
const CATCHEM_CHARMANDER ; $1

View File

@ -1,2 +1,2 @@
NUM_DIGLETTS EQU $1F ; 31 total digletts in the Diglett Bonus Stage
DIGLETT_INITIALIZE_DELAY EQU $88 ; number to delay how fast each diglett is initialized
DEF NUM_DIGLETTS EQU $1F ; 31 total digletts in the Diglett Bonus Stage
DEF DIGLETT_INITIALIZE_DELAY EQU $88 ; number to delay how fast each diglett is initialized

View File

@ -1,7 +1,7 @@
EVO_THUNDER_STONE EQU $01
EVO_MOON_STONE EQU $02
EVO_FIRE_STONE EQU $03
EVO_LEAF_STONE EQU $04
EVO_WATER_STONE EQU $05
EVO_LINK_CABLE EQU $06
EVO_EXPERIENCE EQU $07
DEF EVO_THUNDER_STONE EQU $01
DEF EVO_MOON_STONE EQU $02
DEF EVO_FIRE_STONE EQU $03
DEF EVO_LEAF_STONE EQU $04
DEF EVO_WATER_STONE EQU $05
DEF EVO_LINK_CABLE EQU $06
DEF EVO_EXPERIENCE EQU $07

View File

@ -1,21 +1,21 @@
BIT_A_BUTTON EQU 0
BIT_B_BUTTON EQU 1
BIT_SELECT EQU 2
BIT_START EQU 3
BIT_D_RIGHT EQU 4
BIT_D_LEFT EQU 5
BIT_D_UP EQU 6
BIT_D_DOWN EQU 7
DEF BIT_A_BUTTON EQU 0
DEF BIT_B_BUTTON EQU 1
DEF BIT_SELECT EQU 2
DEF BIT_START EQU 3
DEF BIT_D_RIGHT EQU 4
DEF BIT_D_LEFT EQU 5
DEF BIT_D_UP EQU 6
DEF BIT_D_DOWN EQU 7
A_BUTTON EQU %00000001
B_BUTTON EQU %00000010
SELECT EQU %00000100
START EQU %00001000
D_RIGHT EQU %00010000
D_LEFT EQU %00100000
D_UP EQU %01000000
D_DOWN EQU %10000000
DEF A_BUTTON EQU %00000001
DEF B_BUTTON EQU %00000010
DEF SELECT EQU %00000100
DEF START EQU %00001000
DEF D_RIGHT EQU %00010000
DEF D_LEFT EQU %00100000
DEF D_UP EQU %01000000
DEF D_DOWN EQU %10000000
R_FLIPPER EQU A_BUTTON
L_FLIPPER EQU D_LEFT
FLIPPERS EQU L_FLIPPER | R_FLIPPER
DEF R_FLIPPER EQU A_BUTTON
DEF L_FLIPPER EQU D_LEFT
DEF FLIPPERS EQU L_FLIPPER | R_FLIPPER

View File

@ -1,4 +1,4 @@
const_value = 0
DEF const_value = 0
const PALLET_TOWN ; $0
const VIRIDIAN_CITY ; $1

View File

@ -1,19 +1,19 @@
MAX_PIKACHU_SAVER_CHARGE EQU 15
DEF MAX_PIKACHU_SAVER_CHARGE EQU 15
CATCHEM_MODE_SLOT_REWARD EQU 1
EVOLUTION_MODE_SLOT_REWARD EQU 2
DEF CATCHEM_MODE_SLOT_REWARD EQU 1
DEF EVOLUTION_MODE_SLOT_REWARD EQU 2
SPECIAL_MODE_CATCHEM EQU 0
SPECIAL_MODE_EVOLUTION EQU 1
SPECIAL_MODE_MAP_MOVE EQU 2
DEF SPECIAL_MODE_CATCHEM EQU 0
DEF SPECIAL_MODE_EVOLUTION EQU 1
DEF SPECIAL_MODE_MAP_MOVE EQU 2
; To encounter Mew, you must first beat Mewtwo's bonus stage 2 times.
NUM_MEWTWO_COMPLETIONS_FOR_MEW EQU 2
DEF NUM_MEWTWO_COMPLETIONS_FOR_MEW EQU 2
MAX_BONUS_MULTIPLIER EQU 99
MAX_BONUS_MULTIPLIER_FIELD_EVENTS EQU 11
DEF MAX_BONUS_MULTIPLIER EQU 99
DEF MAX_BONUS_MULTIPLIER_FIELD_EVENTS EQU 11
MAP_MOVE_FRAMES_COUNTER EQU 480 ; 8 seconds until the map move counter decrease by 1
PINBALL_UPGRADE_FRAMES_COUNTER EQU 3600 ; ~1 minute until the pinball type degrades one stage. (e.g. Great Ball -> Pokeball)
DEF MAP_MOVE_FRAMES_COUNTER EQU 480 ; 8 seconds until the map move counter decrease by 1
DEF PINBALL_UPGRADE_FRAMES_COUNTER EQU 3600 ; ~1 minute until the pinball type degrades one stage. (e.g. Great Ball -> Pokeball)

View File

@ -1,4 +1,4 @@
const_value = 1
DEF const_value = 1
const BULBASAUR ; $1
const IVYSAUR ; $2
@ -152,4 +152,4 @@ const_value = 1
const MEWTWO ; $96
const MEW ; $97
NUM_POKEMON EQU 151
DEF NUM_POKEMON EQU 151

View File

@ -1,13 +1,13 @@
; See wCurrentScreen in wram.asm
; unreachable debug menu, which allows selecting DMG or Game Boy Color during boot
SCREEN_SELECT_GAMEBOY_TARGET EQU $0
DEF SCREEN_SELECT_GAMEBOY_TARGET EQU $0
SCREEN_ERASE_ALL_DATA EQU $1
SCREEN_COPYRIGHT EQU $2
SCREEN_TITLESCREEN EQU $3
SCREEN_PINBALL_GAME EQU $4
SCREEN_POKEDEX EQU $5
SCREEN_OPTIONS EQU $6
SCREEN_HIGH_SCORES EQU $7
SCREEN_FIELD_SELECT EQU $8
DEF SCREEN_ERASE_ALL_DATA EQU $1
DEF SCREEN_COPYRIGHT EQU $2
DEF SCREEN_TITLESCREEN EQU $3
DEF SCREEN_PINBALL_GAME EQU $4
DEF SCREEN_POKEDEX EQU $5
DEF SCREEN_OPTIONS EQU $6
DEF SCREEN_HIGH_SCORES EQU $7
DEF SCREEN_FIELD_SELECT EQU $8

View File

@ -1,35 +1,35 @@
NUM_SONGS EQU $17
DEF NUM_SONGS EQU $17
MUSIC_NOTHING EQU $00
DEF MUSIC_NOTHING EQU $00
; Bank $F Songs
MUSIC_RED_FIELD EQU $01
MUSIC_CATCH_EM_RED EQU $02
MUSIC_HURRY_UP_RED EQU $03
MUSIC_POKEDEX EQU $04
MUSIC_GASTLY_GRAVEYARD EQU $05
MUSIC_HAUNTER_GRAVEYARD EQU $06
MUSIC_GENGAR_GRAVEYARD EQU $07
DEF MUSIC_RED_FIELD EQU $01
DEF MUSIC_CATCH_EM_RED EQU $02
DEF MUSIC_HURRY_UP_RED EQU $03
DEF MUSIC_POKEDEX EQU $04
DEF MUSIC_GASTLY_GRAVEYARD EQU $05
DEF MUSIC_HAUNTER_GRAVEYARD EQU $06
DEF MUSIC_GENGAR_GRAVEYARD EQU $07
; Bank $10 Songs
MUSIC_BLUE_FIELD EQU $01
MUSIC_CATCH_EM_BLUE EQU $02
MUSIC_HURRY_UP_BLUE EQU $03
MUSIC_HI_SCORE EQU $04
MUSIC_GAME_OVER EQU $05
DEF MUSIC_BLUE_FIELD EQU $01
DEF MUSIC_CATCH_EM_BLUE EQU $02
DEF MUSIC_HURRY_UP_BLUE EQU $03
DEF MUSIC_HI_SCORE EQU $04
DEF MUSIC_GAME_OVER EQU $05
; Bank $11 Songs
MUSIC_WHACK_DIGLETT EQU $01
MUSIC_WHACK_DUGTRIO EQU $02
MUSIC_SEEL_STAGE EQU $03
MUSIC_TITLE_SCREEN EQU $04
DEF MUSIC_WHACK_DIGLETT EQU $01
DEF MUSIC_WHACK_DUGTRIO EQU $02
DEF MUSIC_SEEL_STAGE EQU $03
DEF MUSIC_TITLE_SCREEN EQU $04
; Bank $12 Songs
MUSIC_MEWTWO_STAGE EQU $01
MUSIC_OPTIONS EQU $02
MUSIC_FIELD_SELECT EQU $03
MUSIC_MEOWTH_STAGE EQU $04
DEF MUSIC_MEWTWO_STAGE EQU $01
DEF MUSIC_OPTIONS EQU $02
DEF MUSIC_FIELD_SELECT EQU $03
DEF MUSIC_MEOWTH_STAGE EQU $04
; Bank $13 Songs
MUSIC_END_CREDITS EQU $01
MUSIC_NAME_ENTRY EQU $02
DEF MUSIC_END_CREDITS EQU $01
DEF MUSIC_NAME_ENTRY EQU $02

View File

@ -1 +1 @@
NUM_SOUND_EFFECTS EQU $4e
DEF NUM_SOUND_EFFECTS EQU $4e

View File

@ -1,19 +1,19 @@
SPECIAL_COLLISION_NOTHING EQU 0
SPECIAL_COLLISION_LEFT_TRIGGER EQU 1
SPECIAL_COLLISION_RIGHT_TRIGGER EQU 2
SPECIAL_COLLISION_STARYU_ALLEY_TRIGGER EQU 3
SPECIAL_COLLISION_VOLTORB EQU 4
SPECIAL_COLLISION_SHELLDER EQU 4
SPECIAL_COLLISION_BELLSPROUT EQU 5
SPECIAL_COLLISION_STARYU EQU 6
SPECIAL_COLLISION_LEFT_DIGLETT EQU 7
SPECIAL_COLLISION_POLIWAG EQU 7
SPECIAL_COLLISION_RIGHT_DIGLETT EQU 8
SPECIAL_COLLISION_PSYDUCK EQU 8
SPECIAL_COLLISION_LEFT_BONUS_MULTIPLIER EQU 9
SPECIAL_COLLISION_RIGHT_BONUS_MULTIPLIER EQU 10
SPECIAL_COLLISION_BALL_UPGRADE EQU 11
SPECIAL_COLLISION_SPINNER EQU 12
SPECIAL_COLLISION_SLOT_HOLE EQU 13
SPECIAL_COLLISION_CLOYSTER EQU 14
SPECIAL_COLLISION_SLOWPOKE EQU 15
DEF SPECIAL_COLLISION_NOTHING EQU 0
DEF SPECIAL_COLLISION_LEFT_TRIGGER EQU 1
DEF SPECIAL_COLLISION_RIGHT_TRIGGER EQU 2
DEF SPECIAL_COLLISION_STARYU_ALLEY_TRIGGER EQU 3
DEF SPECIAL_COLLISION_VOLTORB EQU 4
DEF SPECIAL_COLLISION_SHELLDER EQU 4
DEF SPECIAL_COLLISION_BELLSPROUT EQU 5
DEF SPECIAL_COLLISION_STARYU EQU 6
DEF SPECIAL_COLLISION_LEFT_DIGLETT EQU 7
DEF SPECIAL_COLLISION_POLIWAG EQU 7
DEF SPECIAL_COLLISION_RIGHT_DIGLETT EQU 8
DEF SPECIAL_COLLISION_PSYDUCK EQU 8
DEF SPECIAL_COLLISION_LEFT_BONUS_MULTIPLIER EQU 9
DEF SPECIAL_COLLISION_RIGHT_BONUS_MULTIPLIER EQU 10
DEF SPECIAL_COLLISION_BALL_UPGRADE EQU 11
DEF SPECIAL_COLLISION_SPINNER EQU 12
DEF SPECIAL_COLLISION_SLOT_HOLE EQU 13
DEF SPECIAL_COLLISION_CLOYSTER EQU 14
DEF SPECIAL_COLLISION_SLOWPOKE EQU 15

View File

@ -1,4 +1,4 @@
const_value = 0
DEF const_value = 0
const SPECIES_SEED ; $0
const SPECIES_LIZARD ; $1

View File

@ -1,18 +1,18 @@
STAGE_RED_FIELD_TOP EQU $0
STAGE_RED_FIELD_BOTTOM EQU $1
DEF STAGE_RED_FIELD_TOP EQU $0
DEF STAGE_RED_FIELD_BOTTOM EQU $1
; XXX EQU $2
; XXX EQU $3
STAGE_BLUE_FIELD_TOP EQU $4
STAGE_BLUE_FIELD_BOTTOM EQU $5
DEF STAGE_BLUE_FIELD_TOP EQU $4
DEF STAGE_BLUE_FIELD_BOTTOM EQU $5
FIRST_BONUS_STAGE EQU $6
DEF FIRST_BONUS_STAGE EQU $6
; STAGE_GENGAR_BONUS EQU $6 ; buggy
STAGE_GENGAR_BONUS EQU $7
DEF STAGE_GENGAR_BONUS EQU $7
; STAGE_MEWTWO_BONUS EQU $8 ; buggy
STAGE_MEWTWO_BONUS EQU $9
DEF STAGE_MEWTWO_BONUS EQU $9
; STAGE_MEOWTH_BONUS EQU $a ; buggy
STAGE_MEOWTH_BONUS EQU $b
DEF STAGE_MEOWTH_BONUS EQU $b
; STAGE_DIGLETT_BONUS EQU $c ; buggy
STAGE_DIGLETT_BONUS EQU $d
DEF STAGE_DIGLETT_BONUS EQU $d
; STAGE_SEEL_BONUS EQU $e ; buggy
STAGE_SEEL_BONUS EQU $f
DEF STAGE_SEEL_BONUS EQU $f

View File

@ -12,7 +12,7 @@ endm
Data_9800:
w = $100
DEF w = $100
rept 8
macro_9800 w
DEF w = w >> 1

View File

@ -543,7 +543,7 @@ Func_f8d5: ; 0xf8d5
ret
AddBigBCD6: ; 0xf902
x = 0
DEF x = 0
rept 6
ld a, [de]
if x == 0
@ -551,7 +551,7 @@ if x == 0
else
adc [hl]
endc
x = x + 1
DEF x = x + 1
daa
ld [hli], a
inc de

View File

@ -83,7 +83,7 @@ AddBigBCD6FromQueue: ; 0x8588
ld b, $1
asm_8592:
push hl
x = 0
DEF x = 0
rept 6
ld a, [de]
if x == 0
@ -95,7 +95,7 @@ endc
ld [de], a
inc de
inc hl
x = x + 1
DEF x = x + 1
endr
ld a, e
cp wAddScoreQueueEnd % $100

220
gbhw.asm
View File

@ -1,124 +1,124 @@
; Graciously aped from http://nocash.emubase.de/pandocs.htm .
; MBC5
MBC5SRamEnable EQU $0000
MBC5RomBank EQU $2000
MBC5RomBankHi EQU $3000
MBC5SRamBank EQU $4000
MBC5RomBankOn EQU $6000
MBC5RTC EQU $a000
DEF MBC5SRamEnable EQU $0000
DEF MBC5RomBank EQU $2000
DEF MBC5RomBankHi EQU $3000
DEF MBC5SRamBank EQU $4000
DEF MBC5RomBankOn EQU $6000
DEF MBC5RTC EQU $a000
SRAM_DISABLE EQU $00
SRAM_ENABLE EQU $0a
DEF SRAM_DISABLE EQU $00
DEF SRAM_ENABLE EQU $0a
NUM_SRAM_BANKS EQU 4
DEF NUM_SRAM_BANKS EQU 4
; interrupt flags
VBLANK EQU 0
LCD_STAT EQU 1
TIMER EQU 2
SERIAL EQU 3
JOYPAD EQU 4
DEF VBLANK EQU 0
DEF LCD_STAT EQU 1
DEF TIMER EQU 2
DEF SERIAL EQU 3
DEF JOYPAD EQU 4
; OAM attribute flags
OAM_PALETTE EQU %111
OAM_TILE_BANK EQU 3
OAM_OBP_NUM EQU 4 ; Non CGB Mode Only
OAM_X_FLIP EQU 5
OAM_Y_FLIP EQU 6
OAM_PRIORITY EQU 7 ; 0: OBJ above BG, 1: OBJ behind BG (colors 1-3)
DEF OAM_PALETTE EQU %111
DEF OAM_TILE_BANK EQU 3
DEF OAM_OBP_NUM EQU 4 ; Non CGB Mode Only
DEF OAM_X_FLIP EQU 5
DEF OAM_Y_FLIP EQU 6
DEF OAM_PRIORITY EQU 7 ; 0: OBJ above BG, 1: OBJ behind BG (colors 1-3)
; Hardware registers
rJOYP EQU $ff00 ; Joypad (R/W)
rSB EQU $ff01 ; Serial transfer data (R/W)
rSC EQU $ff02 ; Serial Transfer Control (R/W)
rSC_ON EQU 7
rSC_CGB EQU 1
rSC_CLOCK EQU 0
rDIV EQU $ff04 ; Divider Register (R/W)
rTIMA EQU $ff05 ; Timer counter (R/W)
rTMA EQU $ff06 ; Timer Modulo (R/W)
rTAC EQU $ff07 ; Timer Control (R/W)
rTAC_ON EQU 2
rTAC_4096_HZ EQU 0
rTAC_262144_HZ EQU 1
rTAC_65536_HZ EQU 2
rTAC_16384_HZ EQU 3
rIF EQU $ff0f ; Interrupt Flag (R/W)
rNR10 EQU $ff10 ; Channel 1 Sweep register (R/W)
rNR11 EQU $ff11 ; Channel 1 Sound length/Wave pattern duty (R/W)
rNR12 EQU $ff12 ; Channel 1 Volume Envelope (R/W)
rNR13 EQU $ff13 ; Channel 1 Frequency lo (Write Only)
rNR14 EQU $ff14 ; Channel 1 Frequency hi (R/W)
rNR20 EQU $ff15 ; Channel 2 Sweep register (R/W)
rNR21 EQU $ff16 ; Channel 2 Sound Length/Wave Pattern Duty (R/W)
rNR22 EQU $ff17 ; Channel 2 Volume Envelope (R/W)
rNR23 EQU $ff18 ; Channel 2 Frequency lo data (W)
rNR24 EQU $ff19 ; Channel 2 Frequency hi data (R/W)
rNR30 EQU $ff1a ; Channel 3 Sound on/off (R/W)
rNR31 EQU $ff1b ; Channel 3 Sound Length
rNR32 EQU $ff1c ; Channel 3 Select output level (R/W)
rNR33 EQU $ff1d ; Channel 3 Frequency's lower data (W)
rNR34 EQU $ff1e ; Channel 3 Frequency's higher data (R/W)
rNR40 EQU $ff1f ; Channel 4 Sweep register (R/W)
rNR41 EQU $ff20 ; Channel 4 Sound Length (R/W)
rNR42 EQU $ff21 ; Channel 4 Volume Envelope (R/W)
rNR43 EQU $ff22 ; Channel 4 Polynomial Counter (R/W)
rNR44 EQU $ff23 ; Channel 4 Counter/consecutive; Inital (R/W)
rNR50 EQU $ff24 ; Channel control / ON-OFF / Volume (R/W)
rNR51 EQU $ff25 ; Selection of Sound output terminal (R/W)
rNR52 EQU $ff26 ; Sound on/off
rWave_0 EQU $ff30
rWave_1 EQU $ff31
rWave_2 EQU $ff32
rWave_3 EQU $ff33
rWave_4 EQU $ff34
rWave_5 EQU $ff35
rWave_6 EQU $ff36
rWave_7 EQU $ff37
rWave_8 EQU $ff38
rWave_9 EQU $ff39
rWave_a EQU $ff3a
rWave_b EQU $ff3b
rWave_c EQU $ff3c
rWave_d EQU $ff3d
rWave_e EQU $ff3e
rWave_f EQU $ff3f
rLCDC EQU $ff40 ; LCD Control (R/W)
rSTAT EQU $ff41 ; LCDC Status (R/W)
rSCY EQU $ff42 ; Scroll Y (R/W)
rSCX EQU $ff43 ; Scroll X (R/W)
rLY EQU $ff44 ; LCDC Y-Coordinate (R)
rLYC EQU $ff45 ; LY Compare (R/W)
rDMA EQU $ff46 ; DMA Transfer and Start Address (W)
rBGP EQU $ff47 ; BG Palette Data (R/W) - Non CGB Mode Only
rOBP0 EQU $ff48 ; Object Palette 0 Data (R/W) - Non CGB Mode Only
rOBP1 EQU $ff49 ; Object Palette 1 Data (R/W) - Non CGB Mode Only
rWY EQU $ff4a ; Window Y Position (R/W)
rWX EQU $ff4b ; Window X Position minus 7 (R/W)
rLCDMODE EQU $ff4c
rKEY1 EQU $ff4d ; CGB Mode Only - Prepare Speed Switch
rVBK EQU $ff4f ; CGB Mode Only - VRAM Bank
rBLCK EQU $ff50
rHDMA1 EQU $ff51 ; CGB Mode Only - New DMA Source, High
rHDMA2 EQU $ff52 ; CGB Mode Only - New DMA Source, Low
rHDMA3 EQU $ff53 ; CGB Mode Only - New DMA Destination, High
rHDMA4 EQU $ff54 ; CGB Mode Only - New DMA Destination, Low
rHDMA5 EQU $ff55 ; CGB Mode Only - New DMA Length/Mode/Start
rRP EQU $ff56 ; CGB Mode Only - Infrared Communications Port
rBGPI EQU $ff68 ; CGB Mode Only - Background Palette Index
rBGPD EQU $ff69 ; CGB Mode Only - Background Palette Data
rOBPI EQU $ff6a ; CGB Mode Only - Sprite Palette Index
rOBPD EQU $ff6b ; CGB Mode Only - Sprite Palette Data
rUNKNOWN1 EQU $ff6c ; (FEh) Bit 0 (Read/Write) - CGB Mode Only
rSVBK EQU $ff70 ; CGB Mode Only - WRAM Bank
rUNKNOWN2 EQU $ff72 ; (00h) - Bit 0-7 (Read/Write)
rUNKNOWN3 EQU $ff73 ; (00h) - Bit 0-7 (Read/Write)
rUNKNOWN4 EQU $ff74 ; (00h) - Bit 0-7 (Read/Write) - CGB Mode Only
rUNKNOWN5 EQU $ff75 ; (8Fh) - Bit 4-6 (Read/Write)
rUNKNOWN6 EQU $ff76 ; (00h) - Always 00h (Read Only)
rUNKNOWN7 EQU $ff77 ; (00h) - Always 00h (Read Only)
rIE EQU $ffff ; Interrupt Enable (R/W)
DEF rJOYP EQU $ff00 ; Joypad (R/W)
DEF rSB EQU $ff01 ; Serial transfer data (R/W)
DEF rSC EQU $ff02 ; Serial Transfer Control (R/W)
DEF rSC_ON EQU 7
DEF rSC_CGB EQU 1
DEF rSC_CLOCK EQU 0
DEF rDIV EQU $ff04 ; Divider Register (R/W)
DEF rTIMA EQU $ff05 ; Timer counter (R/W)
DEF rTMA EQU $ff06 ; Timer Modulo (R/W)
DEF rTAC EQU $ff07 ; Timer Control (R/W)
DEF rTAC_ON EQU 2
DEF rTAC_4096_HZ EQU 0
DEF rTAC_262144_HZ EQU 1
DEF rTAC_65536_HZ EQU 2
DEF rTAC_16384_HZ EQU 3
DEF rIF EQU $ff0f ; Interrupt Flag (R/W)
DEF rNR10 EQU $ff10 ; Channel 1 Sweep register (R/W)
DEF rNR11 EQU $ff11 ; Channel 1 Sound length/Wave pattern duty (R/W)
DEF rNR12 EQU $ff12 ; Channel 1 Volume Envelope (R/W)
DEF rNR13 EQU $ff13 ; Channel 1 Frequency lo (Write Only)
DEF rNR14 EQU $ff14 ; Channel 1 Frequency hi (R/W)
DEF rNR20 EQU $ff15 ; Channel 2 Sweep register (R/W)
DEF rNR21 EQU $ff16 ; Channel 2 Sound Length/Wave Pattern Duty (R/W)
DEF rNR22 EQU $ff17 ; Channel 2 Volume Envelope (R/W)
DEF rNR23 EQU $ff18 ; Channel 2 Frequency lo data (W)
DEF rNR24 EQU $ff19 ; Channel 2 Frequency hi data (R/W)
DEF rNR30 EQU $ff1a ; Channel 3 Sound on/off (R/W)
DEF rNR31 EQU $ff1b ; Channel 3 Sound Length
DEF rNR32 EQU $ff1c ; Channel 3 Select output level (R/W)
DEF rNR33 EQU $ff1d ; Channel 3 Frequency's lower data (W)
DEF rNR34 EQU $ff1e ; Channel 3 Frequency's higher data (R/W)
DEF rNR40 EQU $ff1f ; Channel 4 Sweep register (R/W)
DEF rNR41 EQU $ff20 ; Channel 4 Sound Length (R/W)
DEF rNR42 EQU $ff21 ; Channel 4 Volume Envelope (R/W)
DEF rNR43 EQU $ff22 ; Channel 4 Polynomial Counter (R/W)
DEF rNR44 EQU $ff23 ; Channel 4 Counter/consecutive; Inital (R/W)
DEF rNR50 EQU $ff24 ; Channel control / ON-OFF / Volume (R/W)
DEF rNR51 EQU $ff25 ; Selection of Sound output terminal (R/W)
DEF rNR52 EQU $ff26 ; Sound on/off
DEF rWave_0 EQU $ff30
DEF rWave_1 EQU $ff31
DEF rWave_2 EQU $ff32
DEF rWave_3 EQU $ff33
DEF rWave_4 EQU $ff34
DEF rWave_5 EQU $ff35
DEF rWave_6 EQU $ff36
DEF rWave_7 EQU $ff37
DEF rWave_8 EQU $ff38
DEF rWave_9 EQU $ff39
DEF rWave_a EQU $ff3a
DEF rWave_b EQU $ff3b
DEF rWave_c EQU $ff3c
DEF rWave_d EQU $ff3d
DEF rWave_e EQU $ff3e
DEF rWave_f EQU $ff3f
DEF rLCDC EQU $ff40 ; LCD Control (R/W)
DEF rSTAT EQU $ff41 ; LCDC Status (R/W)
DEF rSCY EQU $ff42 ; Scroll Y (R/W)
DEF rSCX EQU $ff43 ; Scroll X (R/W)
DEF rLY EQU $ff44 ; LCDC Y-Coordinate (R)
DEF rLYC EQU $ff45 ; LY Compare (R/W)
DEF rDMA EQU $ff46 ; DMA Transfer and Start Address (W)
DEF rBGP EQU $ff47 ; BG Palette Data (R/W) - Non CGB Mode Only
DEF rOBP0 EQU $ff48 ; Object Palette 0 Data (R/W) - Non CGB Mode Only
DEF rOBP1 EQU $ff49 ; Object Palette 1 Data (R/W) - Non CGB Mode Only
DEF rWY EQU $ff4a ; Window Y Position (R/W)
DEF rWX EQU $ff4b ; Window X Position minus 7 (R/W)
DEF rLCDMODE EQU $ff4c
DEF rKEY1 EQU $ff4d ; CGB Mode Only - Prepare Speed Switch
DEF rVBK EQU $ff4f ; CGB Mode Only - VRAM Bank
DEF rBLCK EQU $ff50
DEF rHDMA1 EQU $ff51 ; CGB Mode Only - New DMA Source, High
DEF rHDMA2 EQU $ff52 ; CGB Mode Only - New DMA Source, Low
DEF rHDMA3 EQU $ff53 ; CGB Mode Only - New DMA Destination, High
DEF rHDMA4 EQU $ff54 ; CGB Mode Only - New DMA Destination, Low
DEF rHDMA5 EQU $ff55 ; CGB Mode Only - New DMA Length/Mode/Start
DEF rRP EQU $ff56 ; CGB Mode Only - Infrared Communications Port
DEF rBGPI EQU $ff68 ; CGB Mode Only - Background Palette Index
DEF rBGPD EQU $ff69 ; CGB Mode Only - Background Palette Data
DEF rOBPI EQU $ff6a ; CGB Mode Only - Sprite Palette Index
DEF rOBPD EQU $ff6b ; CGB Mode Only - Sprite Palette Data
DEF rUNKNOWN1 EQU $ff6c ; (FEh) Bit 0 (Read/Write) - CGB Mode Only
DEF rSVBK EQU $ff70 ; CGB Mode Only - WRAM Bank
DEF rUNKNOWN2 EQU $ff72 ; (00h) - Bit 0-7 (Read/Write)
DEF rUNKNOWN3 EQU $ff73 ; (00h) - Bit 0-7 (Read/Write)
DEF rUNKNOWN4 EQU $ff74 ; (00h) - Bit 0-7 (Read/Write) - CGB Mode Only
DEF rUNKNOWN5 EQU $ff75 ; (8Fh) - Bit 4-6 (Read/Write)
DEF rUNKNOWN6 EQU $ff76 ; (00h) - Always 00h (Read Only)
DEF rUNKNOWN7 EQU $ff77 ; (00h) - Always 00h (Read Only)
DEF rIE EQU $ffff ; Interrupt Enable (R/W)

View File

@ -3301,16 +3301,16 @@ BottomRightBonusStageCollisionMasks:
; These two squares data arrays must be aligned to $100 bytes and appear contiguously.
SquaresLow:
x = 0
DEF x = 0
rept 256
db (x * x) % $100
x = x + 1
DEF x = x + 1
endr
SquaresHigh:
x = 0
DEF x = 0
rept 256
db (x * x) / $100
x = x + 1
DEF x = x + 1
endr

View File

@ -131,8 +131,8 @@ EvensAndOdds:
; The first 128 bytes are the first 128 even numbers starting at 0.
; The next 128 bytes are the first 128 odd numbers starting at 1.
; The (a)th element is essentially what you'd get from rlca.
x = 0
DEF x = 0
REPT 128
db x | ((x >> 7) & 1)
x = x + 2
DEF x = x + 2
ENDR

100
hram.asm
View File

@ -1,62 +1,62 @@
hPushOAM EQU $FF80
DEF hPushOAM EQU $FF80
hFarCallTempA EQU $FF8A
hFarCallTempE EQU $FF8B
hJoypadState EQU $FF98 ; current state of buttons. See joy_constants.asm for which bits
DEF hFarCallTempA EQU $FF8A
DEF hFarCallTempE EQU $FF8B
DEF hJoypadState EQU $FF98 ; current state of buttons. See joy_constants.asm for which bits
; correspond to which buttons.
hNewlyPressedButtons EQU $FF99 ; buttons that were pressed in the current frame.
hPressedButtons EQU $FF9A ; buttons that were pressed last frame and current frame(?)
hPrevPreviousJoypadState EQU $FF9B ; joypad state from two frames ago. See joy_constants.asm for
DEF hNewlyPressedButtons EQU $FF99 ; buttons that were pressed in the current frame.
DEF hPressedButtons EQU $FF9A ; buttons that were pressed last frame and current frame(?)
DEF hPrevPreviousJoypadState EQU $FF9B ; joypad state from two frames ago. See joy_constants.asm for
; which bits correspond to which buttons. (need a better name for this...)
hPreviousJoypadState EQU $FF9C ; prevoius frame's joypad state. See joy_constants.asm for
DEF hPreviousJoypadState EQU $FF9C ; prevoius frame's joypad state. See joy_constants.asm for
; which bits correspond to which buttons.
hJoyRepeatDelay EQU $FF9D
DEF hJoyRepeatDelay EQU $FF9D
hLCDC EQU $FF9E
hSTAT EQU $FF9F
hSCY EQU $FFA0
hSCX EQU $FFA1
hLYC EQU $FFA2
hBGP EQU $FFA3
hOBP0 EQU $FFA4
hOBP1 EQU $FFA5
hWY EQU $FFA6
hWX EQU $FFA7
hLastLYC EQU $FFA8
hNextLYCSub EQU $FFA9
hLYCSub EQU $FFAA
hNextFrameHBlankSCX EQU $FFAB
hHBlankSCX EQU $FFAC
hNextFrameHBlankSCY EQU $FFAD
hHBlankSCY EQU $FFAE
hLCDCMask EQU $FFAF
hStatIntrRoutine EQU $FFB0
DEF hLCDC EQU $FF9E
DEF hSTAT EQU $FF9F
DEF hSCY EQU $FFA0
DEF hSCX EQU $FFA1
DEF hLYC EQU $FFA2
DEF hBGP EQU $FFA3
DEF hOBP0 EQU $FFA4
DEF hOBP1 EQU $FFA5
DEF hWY EQU $FFA6
DEF hWX EQU $FFA7
DEF hLastLYC EQU $FFA8
DEF hNextLYCSub EQU $FFA9
DEF hLYCSub EQU $FFAA
DEF hNextFrameHBlankSCX EQU $FFAB
DEF hHBlankSCX EQU $FFAC
DEF hNextFrameHBlankSCY EQU $FFAD
DEF hHBlankSCY EQU $FFAE
DEF hLCDCMask EQU $FFAF
DEF hStatIntrRoutine EQU $FFB0
hNumFramesSinceLastVBlank EQU $FFB2
hNumFramesDropped EQU $FFB3
hVBlankCount EQU $FFB4
hStatIntrFired EQU $FFB5
hSignedMathSignBuffer EQU $FFB6
hSignedMathSignBuffer2 EQU $FFB7
DEF hNumFramesSinceLastVBlank EQU $FFB2
DEF hNumFramesDropped EQU $FFB3
DEF hVBlankCount EQU $FFB4
DEF hStatIntrFired EQU $FFB5
DEF hSignedMathSignBuffer EQU $FFB6
DEF hSignedMathSignBuffer2 EQU $FFB7
hBallXPos EQU $FFBA
hBallYPos EQU $FFBC
DEF hBallXPos EQU $FFBA
DEF hBallYPos EQU $FFBC
hFlipperStateChange EQU $FFC0
hPreviousFlipperState EQU $FFC2
hFlipperState EQU $FFC3
DEF hFlipperStateChange EQU $FFC0
DEF hPreviousFlipperState EQU $FFC2
DEF hFlipperState EQU $FFC3
hRotationAngleBuffer EQU $FF8C
hCosineResultBuffer EQU $FF8D
hSineResultBuffer EQU $FF8F
DEF hRotationAngleBuffer EQU $FF8C
DEF hCosineResultBuffer EQU $FF8D
DEF hSineResultBuffer EQU $FF8F
hFlipperCollisionRadius EQU $FFBF
DEF hFlipperCollisionRadius EQU $FFBF
hFFC4 = $FFC4
DEF hFFC4 = $FFC4
hLoadedROMBank EQU $FFF8 ; this is updated whenever the code switches ROM Banks
hROMBankBuffer EQU $FFFA
hSGBFlag EQU $FFFB
hSGBInit EQU $FFFC
hGameBoyColorFlagBackup EQU $FFFD
hGameBoyColorFlag EQU $FFFE ; this is set to $01 if a GameBoy Color is running the game. $00, otherwise.
DEF hLoadedROMBank EQU $FFF8 ; this is updated whenever the code switches ROM Banks
DEF hROMBankBuffer EQU $FFFA
DEF hSGBFlag EQU $FFFB
DEF hSGBInit EQU $FFFC
DEF hGameBoyColorFlagBackup EQU $FFFD
DEF hGameBoyColorFlag EQU $FFFE ; this is set to $01 if a GameBoy Color is running the game. $00, otherwise.

View File

@ -21,13 +21,13 @@ INCLUDE "macros/pokedex.asm"
INCLUDE "macros/scrolling_text.asm"
INCLUDE "macros/sound.asm"
AdvanceFrame EQUS "$10"
JumpTable EQUS "$18"
ReadHalfword EQUS "$20"
DEF AdvanceFrame EQUS "$10"
DEF JumpTable EQUS "$18"
DEF ReadHalfword EQUS "$20"
dex_text EQUS "db " ; Start beginning of pokedex description
dex_line EQUS "db $0d," ; Start new line in pokedex description
dex_end EQUS "db $00" ; Terminate the pokedex description
DEF dex_text EQUS "db " ; Start beginning of pokedex description
DEF dex_line EQUS "db $0d," ; Start new line in pokedex description
DEF dex_end EQUS "db $00" ; Terminate the pokedex description
MACRO dbw
db \1
@ -107,11 +107,11 @@ MACRO coord
ld \1, \4 + $20 * \3 + \2
ENDM
hlCoord EQUS "coord hl,"
deCoord EQUS "coord de,"
bcCoord EQUS "coord bc,"
DEF hlCoord EQUS "coord hl,"
DEF deCoord EQUS "coord de,"
DEF bcCoord EQUS "coord bc,"
tile EQUS "+ $10 *"
DEF tile EQUS "+ $10 *"
;\1 = 5-bit Blue value
;\2 = 5-bit Green value

View File

@ -41,7 +41,7 @@ MACRO noise_note
ENDM
const_def $d0
FIRST_MUSIC_CMD EQU const_value
DEF FIRST_MUSIC_CMD EQU const_value
const octave_cmd ; $d0
MACRO octave

View File

@ -1,5 +1,5 @@
vTilesOB EQU $8000
vTilesSH EQU $8800
vTilesBG EQU $9000
vBGMap EQU $9800
vBGWin EQU $9c00
DEF vTilesOB EQU $8000
DEF vTilesSH EQU $8800
DEF vTilesBG EQU $9000
DEF vBGMap EQU $9800
DEF vBGWin EQU $9c00