summaryrefslogtreecommitdiff
path: root/constants
diff options
context:
space:
mode:
Diffstat (limited to 'constants')
-rwxr-xr-xconstants/connection_constants.asm4
-rwxr-xr-xconstants/event_macros.asm16
-rw-r--r--constants/hardware_constants.asm1
-rwxr-xr-xconstants/hide_show_constants.asm2
-rwxr-xr-xconstants/item_constants.asm20
-rw-r--r--constants/misc_constants.asm30
-rw-r--r--constants/music_constants.asm39
-rwxr-xr-xconstants/palette_constants.asm16
-rw-r--r--constants/pokedex_constants.asm2
-rw-r--r--constants/pokemon_constants.asm2
-rwxr-xr-xconstants/trainer_constants.asm101
-rw-r--r--constants/wram_constants.asm10
12 files changed, 165 insertions, 78 deletions
diff --git a/constants/connection_constants.asm b/constants/connection_constants.asm
index 916d6c4f..154c4163 100755
--- a/constants/connection_constants.asm
+++ b/constants/connection_constants.asm
@@ -1,3 +1,7 @@
+; width of east/west connections
+; height of north/south connections
+MAP_BORDER EQU 3
+
; connection directions
EAST EQU 1
WEST EQU 2
diff --git a/constants/event_macros.asm b/constants/event_macros.asm
index cc7c03f5..90a6a59b 100755
--- a/constants/event_macros.asm
+++ b/constants/event_macros.asm
@@ -163,14 +163,13 @@ event_byte = ((\1) / 8)
;\1 = event index
;\2 = event index
-;\3 = event index (optional)
+;\3, \4, ... = additional (optional) event indices
SetEvents: MACRO
SetEvent \1
+ rept (_NARG + -1)
SetEventReuseHL \2
-
- IF _NARG > 2
- SetEventReuseHL \3
- ENDC
+ shift
+ endr
ENDM
;\1 = event index
@@ -214,11 +213,10 @@ event_byte = ((\1) / 8)
;\3 = event index (optional)
ResetEvents: MACRO
ResetEvent \1
+ rept (_NARG + -1)
ResetEventReuseHL \2
-
- IF _NARG > 2
- ResetEventReuseHL \3
- ENDC
+ shift
+ endr
ENDM
;\1 = event index
diff --git a/constants/hardware_constants.asm b/constants/hardware_constants.asm
index f9e3fe19..21a3ad93 100644
--- a/constants/hardware_constants.asm
+++ b/constants/hardware_constants.asm
@@ -107,4 +107,3 @@ 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)
-
diff --git a/constants/hide_show_constants.asm b/constants/hide_show_constants.asm
index 5a517afc..1a44b1e7 100755
--- a/constants/hide_show_constants.asm
+++ b/constants/hide_show_constants.asm
@@ -2,7 +2,7 @@
; sprites marked with an X are constants that are never used
; because those sprites are not (de)activated in a map's script
; (they are either items or sprites that deactivate after battle
-; and are detected in W_MISSABLEOBJECTLIST)
+; and are detected in wMissableObjectList)
const_value = 0
diff --git a/constants/item_constants.asm b/constants/item_constants.asm
index dd321b45..fe6fcb15 100755
--- a/constants/item_constants.asm
+++ b/constants/item_constants.asm
@@ -56,7 +56,7 @@ SAFARI_ROCK EQU $16 ; overload
const FULL_HEAL ; $34
const REVIVE ; $35
const MAX_REVIVE ; $36
- const GUARD_SPEC_ ; $37
+ const GUARD_SPEC ; $37
const SUPER_REPEL ; $38
const MAX_REPEL ; $39
const DIRE_HIT ; $3A
@@ -64,7 +64,7 @@ SAFARI_ROCK EQU $16 ; overload
const FRESH_WATER ; $3C
const SODA_POP ; $3D
const LEMONADE ; $3E
- const S_S__TICKET ; $3F
+ const S_S_TICKET ; $3F
const GOLD_TEETH ; $40
const X_ATTACK ; $41
const X_DEFEND ; $42
@@ -76,7 +76,7 @@ SAFARI_ROCK EQU $16 ; overload
const SILPH_SCOPE ; $48
const POKE_FLUTE ; $49
const LIFT_KEY ; $4A
- const EXP__ALL ; $4B
+ const EXP_ALL ; $4B
const OLD_ROD ; $4C
const GOOD_ROD ; $4D
const SUPER_ROD ; $4E
@@ -85,6 +85,20 @@ SAFARI_ROCK EQU $16 ; overload
const MAX_ETHER ; $51
const ELIXER ; $52
const MAX_ELIXER ; $53
+ const FLOOR_B2F ; $54
+ const FLOOR_B1F ; $55
+ const FLOOR_1F ; $56
+ const FLOOR_2F ; $57
+ const FLOOR_3F ; $58
+ const FLOOR_4F ; $59
+ const FLOOR_5F ; $5A
+ const FLOOR_6F ; $5B
+ const FLOOR_7F ; $5C
+ const FLOOR_8F ; $5D
+ const FLOOR_9F ; $5E
+ const FLOOR_10F ; $5F
+ const FLOOR_11F ; $60
+ const FLOOR_B4F ; $61
const_value = $C4
diff --git a/constants/misc_constants.asm b/constants/misc_constants.asm
index ef9e6ba3..de777c5d 100644
--- a/constants/misc_constants.asm
+++ b/constants/misc_constants.asm
@@ -10,10 +10,16 @@ PARTY_LENGTH EQU 6
MONS_PER_BOX EQU 20
NUM_BOXES EQU 12
+BAG_ITEM_CAPACITY EQU 20
+PC_ITEM_CAPACITY EQU 50
+
HOF_MON EQU $10
HOF_TEAM EQU PARTY_LENGTH * HOF_MON
HOF_TEAM_CAPACITY EQU 50
+NAME_LENGTH EQU 11
+ITEM_NAME_LENGTH EQU 13
+
A_BUTTON EQU %00000001
B_BUTTON EQU %00000010
SELECT EQU %00000100
@@ -23,13 +29,16 @@ D_LEFT EQU %00100000
D_UP EQU %01000000
D_DOWN EQU %10000000
-PIXELS_PER_TILE EQU 8
-
SCREEN_WIDTH EQU 20
SCREEN_HEIGHT EQU 18
-SCREEN_WIDTH_PIXELS EQU SCREEN_WIDTH * PIXELS_PER_TILE
-SCREEN_HEIGHT_PIXELS EQU SCREEN_HEIGHT * PIXELS_PER_TILE
+SCREEN_WIDTH_PIXELS EQU SCREEN_WIDTH * 8
+SCREEN_HEIGHT_PIXELS EQU SCREEN_HEIGHT * 8
+
+BG_MAP_WIDTH EQU 32
+BG_MAP_HEIGHT EQU 32
+
+SPRITEBUFFERSIZE EQU 7*7 * 8 ; 7 * 7 (tiles) * 8 (bytes per tile)
NPC_MOVEMENT_DOWN EQU $00
NPC_MOVEMENT_UP EQU $40
@@ -157,6 +166,19 @@ BIT_LEADING_ZEROES EQU 7
LEFT_ALIGN EQU (1 << BIT_LEFT_ALIGN)
LEADING_ZEROES EQU (1 << BIT_LEADING_ZEROES)
+; HP bar
+HP_BAR_GREEN EQU 0
+HP_BAR_YELLOW EQU 1
+HP_BAR_RED EQU 2
+
+; D733 flags
+BIT_TEST_BATTLE EQU 0
+
+; battle type constants
+BATTLE_TYPE_NORMAL EQU 0
+BATTLE_TYPE_OLD_MAN EQU 1
+BATTLE_TYPE_SAFARI EQU 2
+
; serial
ESTABLISH_CONNECTION_WITH_INTERNAL_CLOCK EQU $01
diff --git a/constants/music_constants.asm b/constants/music_constants.asm
index f239acea..57ad230d 100644
--- a/constants/music_constants.asm
+++ b/constants/music_constants.asm
@@ -1,3 +1,42 @@
+; HW sound channel register base addresses
+HW_CH1_BASE EQU (rNR10 % $100)
+HW_CH2_BASE EQU ((rNR21 % $100) - 1)
+HW_CH3_BASE EQU (rNR30 % $100)
+HW_CH4_BASE EQU ((rNR41 % $100) - 1)
+
+; HW sound channel enable bit masks
+HW_CH1_ENABLE_MASK EQU %00010001
+HW_CH2_ENABLE_MASK EQU %00100010
+HW_CH3_ENABLE_MASK EQU %01000100
+HW_CH4_ENABLE_MASK EQU %10001000
+
+; HW sound channel disable bit masks
+HW_CH1_DISABLE_MASK EQU (~HW_CH1_ENABLE_MASK & $ff)
+HW_CH2_DISABLE_MASK EQU (~HW_CH2_ENABLE_MASK & $ff)
+HW_CH3_DISABLE_MASK EQU (~HW_CH3_ENABLE_MASK & $ff)
+HW_CH4_DISABLE_MASK EQU (~HW_CH4_ENABLE_MASK & $ff)
+
+REG_DUTY_SOUND_LEN EQU 1
+REG_VOLUME_ENVELOPE EQU 2
+REG_FREQUENCY_LO EQU 3
+
+MAX_SFX_ID EQU $B9
+
+CRY_SFX_START EQU $14
+CRY_SFX_END EQU $86
+
+; wChannelFlags1 constants
+BIT_PERFECT_PITCH EQU 0 ; controlled by toggleperfectpitch command
+BIT_CHANNEL_CALL EQU 1 ; if in channel call
+BIT_NOISE_OR_SFX EQU 2 ; if channel is the music noise channel or an SFX channel
+BIT_VIBRATO_DIRECTION EQU 3 ; if the pitch is above or below normal (cycles)
+BIT_PITCH_BEND_ON EQU 4 ; if pitch bend is active
+BIT_PITCH_BEND_DECREASING EQU 5 ; if the pitch bend frequency is decreasing (instead of increasing)
+BIT_ROTATE_DUTY EQU 6 ; if rotating duty
+
+; wChannelFlags2 constant (only has one flag)
+BIT_EXECUTE_MUSIC EQU 0 ; if in execute music
+
; Song ids are calculated by address to save space.
music_const: MACRO
diff --git a/constants/palette_constants.asm b/constants/palette_constants.asm
index 2a871462..ca2e103a 100755
--- a/constants/palette_constants.asm
+++ b/constants/palette_constants.asm
@@ -1,3 +1,19 @@
+SET_PAL_BATTLE_BLACK EQU $00
+SET_PAL_BATTLE EQU $01
+SET_PAL_TOWN_MAP EQU $02
+SET_PAL_STATUS_SCREEN EQU $03
+SET_PAL_POKEDEX EQU $04
+SET_PAL_SLOTS EQU $05
+SET_PAL_TITLE_SCREEN EQU $06
+SET_PAL_NIDORINO_INTRO EQU $07
+SET_PAL_GENERIC EQU $08
+SET_PAL_OVERWORLD EQU $09
+SET_PAL_PARTY_MENU EQU $0A
+SET_PAL_POKEMON_WHOLE_SCREEN EQU $0B
+SET_PAL_GAME_FREAK_INTRO EQU $0C
+SET_PAL_TRAINER_CARD EQU $0D
+UPDATE_PARTY_MENU_BLK_PACKET EQU $FC
+
; super game boy palettes
const_value = 0
diff --git a/constants/pokedex_constants.asm b/constants/pokedex_constants.asm
index 036426ed..360fbb4c 100644
--- a/constants/pokedex_constants.asm
+++ b/constants/pokedex_constants.asm
@@ -82,7 +82,7 @@ const_value = 1
const DEX_SLOWBRO ; 80
const DEX_MAGNEMITE ; 81
const DEX_MAGNETON ; 82
- const DEX_FARFETCH_D ; 83
+ const DEX_FARFETCHD ; 83
const DEX_DODUO ; 84
const DEX_DODRIO ; 85
const DEX_SEEL ; 86
diff --git a/constants/pokemon_constants.asm b/constants/pokemon_constants.asm
index 255d601a..96d44ef5 100644
--- a/constants/pokemon_constants.asm
+++ b/constants/pokemon_constants.asm
@@ -63,7 +63,7 @@ const_value = 1
const MISSINGNO_3D ; $3D
const MISSINGNO_3E ; $3E
const MISSINGNO_3F ; $3F
- const FARFETCH_D ; $40
+ const FARFETCHD ; $40
const VENONAT ; $41
const DRAGONITE ; $42
const MISSINGNO_43 ; $43
diff --git a/constants/trainer_constants.asm b/constants/trainer_constants.asm
index 7df95bb5..ee890282 100755
--- a/constants/trainer_constants.asm
+++ b/constants/trainer_constants.asm
@@ -1,50 +1,55 @@
-; sometimes it's necessary to add $C8 to these values
+trainer_const: MACRO
+\1 EQU const_value
+OPP_\1 EQU const_value + 200
+const_value = const_value + 1
+ENDM
+
const_value = 1
- const YOUNGSTER ; $01
- const BUG_CATCHER ; $02
- const LASS ; $03
- const SAILOR ; $04
- const JR__TRAINER_M ; $05
- const JR__TRAINER_F ; $06
- const POKEMANIAC ; $07
- const SUPER_NERD ; $08
- const HIKER ; $09
- const BIKER ; $0A
- const BURGLAR ; $0B
- const ENGINEER ; $0C
- const JUGGLER_X ; $0D
- const FISHER ; $0E
- const SWIMMER ; $0F
- const CUE_BALL ; $10
- const GAMBLER ; $11
- const BEAUTY ; $12
- const PSYCHIC_TR ; $13
- const ROCKER ; $14
- const JUGGLER ; $15
- const TAMER ; $16
- const BIRD_KEEPER ; $17
- const BLACKBELT ; $18
- const SONY1 ; $19
- const PROF_OAK ; $1A
- const CHIEF ; $1B
- const SCIENTIST ; $1C
- const GIOVANNI ; $1D
- const ROCKET ; $1E
- const COOLTRAINER_M ; $1F
- const COOLTRAINER_F ; $20
- const BRUNO ; $21
- const BROCK ; $22
- const MISTY ; $23
- const LT__SURGE ; $24
- const ERIKA ; $25
- const KOGA ; $26
- const BLAINE ; $27
- const SABRINA ; $28
- const GENTLEMAN ; $29
- const SONY2 ; $2A
- const SONY3 ; $2B
- const LORELEI ; $2C
- const CHANNELER ; $2D
- const AGATHA ; $2E
- const LANCE ; $2F
+ trainer_const YOUNGSTER ; $01
+ trainer_const BUG_CATCHER ; $02
+ trainer_const LASS ; $03
+ trainer_const SAILOR ; $04
+ trainer_const JR_TRAINER_M ; $05
+ trainer_const JR_TRAINER_F ; $06
+ trainer_const POKEMANIAC ; $07
+ trainer_const SUPER_NERD ; $08
+ trainer_const HIKER ; $09
+ trainer_const BIKER ; $0A
+ trainer_const BURGLAR ; $0B
+ trainer_const ENGINEER ; $0C
+ trainer_const JUGGLER_X ; $0D
+ trainer_const FISHER ; $0E
+ trainer_const SWIMMER ; $0F
+ trainer_const CUE_BALL ; $10
+ trainer_const GAMBLER ; $11
+ trainer_const BEAUTY ; $12
+ trainer_const PSYCHIC_TR ; $13
+ trainer_const ROCKER ; $14
+ trainer_const JUGGLER ; $15
+ trainer_const TAMER ; $16
+ trainer_const BIRD_KEEPER ; $17
+ trainer_const BLACKBELT ; $18
+ trainer_const SONY1 ; $19
+ trainer_const PROF_OAK ; $1A
+ trainer_const CHIEF ; $1B
+ trainer_const SCIENTIST ; $1C
+ trainer_const GIOVANNI ; $1D
+ trainer_const ROCKET ; $1E
+ trainer_const COOLTRAINER_M ; $1F
+ trainer_const COOLTRAINER_F ; $20
+ trainer_const BRUNO ; $21
+ trainer_const BROCK ; $22
+ trainer_const MISTY ; $23
+ trainer_const LT_SURGE ; $24
+ trainer_const ERIKA ; $25
+ trainer_const KOGA ; $26
+ trainer_const BLAINE ; $27
+ trainer_const SABRINA ; $28
+ trainer_const GENTLEMAN ; $29
+ trainer_const SONY2 ; $2A
+ trainer_const SONY3 ; $2B
+ trainer_const LORELEI ; $2C
+ trainer_const CHANNELER ; $2D
+ trainer_const AGATHA ; $2E
+ trainer_const LANCE ; $2F
diff --git a/constants/wram_constants.asm b/constants/wram_constants.asm
deleted file mode 100644
index 067c8707..00000000
--- a/constants/wram_constants.asm
+++ /dev/null
@@ -1,10 +0,0 @@
-
-SPRITEBUFFERSIZE EQU 7*7 * 8 ; 7 * 7 (tiles) * 8 (bytes per tile)
-
-; Overload W_GRASSMONS
-wSerialEnemyDataBlock EQU $d893 ; W_GRASSMONS + 11
-
-; Overload enemy party data
-W_WATERRATE EQU $d8a4 ; wEnemyMon1Species
-W_WATERMONS EQU $d8a5 ; wEnemyMon1Species + 1
-