diff options
author | Pokeglitch <pokeglitchx@gmail.com> | 2018-06-17 07:38:57 -0400 |
---|---|---|
committer | Pokeglitch <pokeglitchx@gmail.com> | 2018-06-17 07:38:57 -0400 |
commit | 2cb260953de9bc2f05e7016427b4d8e57c451fab (patch) | |
tree | c094a8e024b4645a3f826866c939ea3f5630db11 | |
parent | 0ddae2eac07d890bad3bfe79fa9e59cb9d214040 (diff) |
Added constants, removed TODOs to health.asm
-rw-r--r-- | constants/pokemon_data_constants.asm | 5 | ||||
-rwxr-xr-x | constants/script_constants.asm | 10 | ||||
-rwxr-xr-x | engine/events/overworld.asm | 4 | ||||
-rwxr-xr-x | engine/items/inventory.asm | 2 | ||||
-rwxr-xr-x | engine/pokemon/health.asm | 14 | ||||
-rw-r--r-- | shim.sym | 2 |
6 files changed, 23 insertions, 14 deletions
diff --git a/constants/pokemon_data_constants.asm b/constants/pokemon_data_constants.asm index 0b00f47..9038685 100644 --- a/constants/pokemon_data_constants.asm +++ b/constants/pokemon_data_constants.asm @@ -130,3 +130,8 @@ WATER_WILDDATA_LENGTH EQU (NUM_WATERMON * 2 + 1) * 1 + 2 PP_UP_MASK EQU %11000000 PP_UP_ONE EQU %01000000 PP_MASK EQU %00111111 + +; HP +ENEMY_HP_BAR EQU 0 +BATTLE_HP_BAR EQU 1 +POKEMON_MENU_HP_BAR EQU 2
\ No newline at end of file diff --git a/constants/script_constants.asm b/constants/script_constants.asm index 8045cc4..4a6390e 100755 --- a/constants/script_constants.asm +++ b/constants/script_constants.asm @@ -9,10 +9,14 @@ const SCRIPT_ID_05 ; 05
; Flags
-SCRIPT_FINISHED_FLAG EQU 7
+SCRIPT_FINISHED_F EQU 7
; Masks/Return Values
-SCRIPT_FINISHED_MASK EQU 1 << SCRIPT_FINISHED_FLAG
+SCRIPT_FINISHED_MASK EQU 1 << SCRIPT_FINISHED_F
SCRIPT_SUCCESS EQU $f
SCRIPT_FAIL EQU 0
-SCRIPT_FINISHED EQU $FF
\ No newline at end of file +
+; Some script don't combine the return value with the flag
+; Instead, they load this into the wFieldMoveScriptID, and keep
+; the return value in a
+SCRIPT_FINISHED EQU -1
\ No newline at end of file diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm index 6b5bbc7..0a6eaef 100755 --- a/engine/events/overworld.asm +++ b/engine/events/overworld.asm @@ -395,7 +395,7 @@ DigFunction: ; 03:5260 call .reset
.loop
ld a, [wFieldMoveScriptID]
- bit SCRIPT_FINISHED_FLAG, a
+ bit SCRIPT_FINISHED_F, a
jr nz, .finish
ld hl, DigTable
call CallJumptable
@@ -470,7 +470,7 @@ TeleportFunction: ; 03:52db ld [wFieldMoveScriptID], a
.loop
ld a, [wFieldMoveScriptID]
- bit SCRIPT_FINISHED_FLAG, a
+ bit SCRIPT_FINISHED_F, a
jr nz, .finish
ld hl, TeleportTable
call CallJumptable
diff --git a/engine/items/inventory.asm b/engine/items/inventory.asm index 729ba45..9524d70 100755 --- a/engine/items/inventory.asm +++ b/engine/items/inventory.asm @@ -1,6 +1,6 @@ INCLUDE "constants.asm"
-SECTION "AddItemToInventory_", ROMX[$4AA1], BANK[$03]
+SECTION "Inventory", ROMX[$4AA1], BANK[$03]
_ReceiveItem: ; 03:4AA1
call DoesHLEqualwNumBagItems
diff --git a/engine/pokemon/health.asm b/engine/pokemon/health.asm index 96616ae..2810fd5 100755 --- a/engine/pokemon/health.asm +++ b/engine/pokemon/health.asm @@ -21,7 +21,7 @@ HealParty: ; 03:4d6f ld [hl], a
; Reset the PP
- ld hl, MON_MAXHP - MON_HP ; TODO - This should point to the MOVES, not max HP...
+ ld hl, MON_MOVES
add hl, de
ld b, NUM_MOVES
@@ -105,7 +105,7 @@ ComputeHPBarPixels: ; 03:4e3c ldh [hMultiplicand + 1], a
ld a, c
ldh [hMultiplicand + 2], a
- ld a, 6 * 8
+ ld a, HP_BAR_LENGTH_PX
ldh [hMultiplier], a
call Multiply
; We need de to be under 256 because hDivisor is only 1 byte.
@@ -222,7 +222,7 @@ UpdateHPBar: ; 03:4e7c ld d, e
.mon_fainted
call UpdateHPBar_PrintHPNumber
- ld a, 1 ; TODO - Constant
+ ld a, 1
call UpdateHPBar_AnimateHPBar
jp WaitBGMap
@@ -235,9 +235,9 @@ UpdateHPBar_AnimateHPBar: ; 03:4F11 .bar_animation_loop
push af
push de
- ld d, 6 ; TODO - constant
+ ld d, HP_BAR_LENGTH
ld a, [wHPBarType]
- and $01 ; TODO - what mask is this?
+ and BATTLE_HP_BAR
ld b, a
call DrawBattleHPBar
ld c, 2
@@ -245,7 +245,7 @@ UpdateHPBar_AnimateHPBar: ; 03:4F11 pop de
ld a, [wHPBarDelta]
add e
- cp $31 ; TODO - constant
+ cp HP_BAR_LENGTH_PX + 1
jr nc, .bar_filled_up
ld e, a
pop af
@@ -308,7 +308,7 @@ UpdateHPBar_PrintHPNumber: ; 03:4F5B ld a, [wHPBarOldHP + 1]
ld [wHPBarTempHP], a
push hl
- ld de, $15 ; TODO - Constant
+ ld de, SCREEN_WIDTH + 1
add hl, de
push hl
ld a, " "
@@ -5,7 +5,7 @@ 00:3233 Function3233 00:323E Function323e 00:3240 Function3240 -00:3C43 GetPartyParamLocation +00:3C43 GetPartyParamLocation 00:3CA8 InitSpriteAnimStruct 00:3D86 WaitSFX 00:3D87 WaitSFX.wait |