More annotations of HP bar animations, including an oversight by GameFreak resulting in super-slow HP bars for Pokemon with over 48 HP

This commit is contained in:
pikalaxalt
2016-03-08 19:54:06 -05:00
parent f31da089bb
commit f2fa5349d5
10 changed files with 56 additions and 49 deletions

View File

@@ -2924,7 +2924,9 @@ TruncateHL_BC: ; 3534d
ld a, [wLinkMode] ld a, [wLinkMode]
cp 3 cp 3
jr z, .done jr z, .done
; If we go back to the loop point,
; it's the same as doing this exact
; same check twice.
ld a, h ld a, h
or b or b
jr nz, .loop jr nz, .loop

View File

@@ -1232,7 +1232,7 @@
const EVENT_BEAT_BLACKBELT_LUNG const EVENT_BEAT_BLACKBELT_LUNG
const EVENT_BEAT_BLACKBELT_KENJI const EVENT_BEAT_BLACKBELT_KENJI
const EVENT_BEAT_BLACKBELT_WAI const EVENT_BEAT_BLACKBELT_WAI
; Beauti ; Beauty
const EVENT_BEAT_BEAUTY_VICTORIA const EVENT_BEAT_BEAUTY_VICTORIA
const EVENT_BEAT_BEAUTY_SAMANTHA const EVENT_BEAT_BEAUTY_SAMANTHA
const EVENT_BEAT_BEAUTY_JULIE const EVENT_BEAT_BEAUTY_JULIE

View File

@@ -707,3 +707,5 @@ CMDQUEUE_04 EQU 4
CMDQUEUE_05 EQU 5 CMDQUEUE_05 EQU 5
CMDQUEUE_ENTRY_SIZE EQU 6 CMDQUEUE_ENTRY_SIZE EQU 6
CMDQUEUE_CAPACITY EQU 4 CMDQUEUE_CAPACITY EQU 4
CMDQUEUE_STONETABLE EQU 2

View File

@@ -5,14 +5,14 @@ _AnimateHPBar: ; d627
.ShortAnimLoop .ShortAnimLoop
push bc push bc
push hl push hl
call Functiond6e2 call ShortAnim_UpdateVariables
pop hl pop hl
pop bc pop bc
push af push af
push bc push bc
push hl push hl
call Functiond730 call ShortHPBarAnim_UpdateTiles
call Functiond7c9 call HPBarAnim_BGMapUpdate
pop hl pop hl
pop bc pop bc
pop af pop af
@@ -24,15 +24,15 @@ _AnimateHPBar: ; d627
.LongAnimLoop .LongAnimLoop
push bc push bc
push hl push hl
call Functiond6f5 call LongAnim_UpdateVariables
pop hl pop hl
pop bc pop bc
ret c ret c
push af push af
push bc push bc
push hl push hl
call Functiond749 call LongHPBarAnim_UpdateTiles
call Functiond7c9 call HPBarAnim_BGMapUpdate
pop hl pop hl
pop bc pop bc
pop af pop af
@@ -132,7 +132,7 @@ _AnimateHPBar: ; d627
ret ret
; d6e2 ; d6e2
Functiond6e2: ; d6e2 ShortAnim_UpdateVariables: ; d6e2
ld hl, wCurHPBarPixels ld hl, wCurHPBarPixels
ld a, [wNewHPBarPixels] ld a, [wNewHPBarPixels]
cp [hl] cp [hl]
@@ -144,12 +144,12 @@ Functiond6e2: ; d6e2
ld a, c ld a, c
add [hl] add [hl]
ld [hl], a ld [hl], a
call Functiond839 call ShortHPBar_CalcPixelFrame
and a and a
ret ret
; d6f5 ; d6f5
Functiond6f5: ; d6f5 LongAnim_UpdateVariables: ; d6f5
.loop .loop
ld hl, Buffer3 ld hl, Buffer3
ld a, [hli] ld a, [hli]
@@ -186,6 +186,10 @@ Functiond6f5: ; d6f5
ld c, a ld c, a
ld a, [hli] ld a, [hli]
ld b, a ld b, a
; This routine is buggy. The result from ComputeHPBarPixels is stored
; in e. However, the pop de opcode deletes this result before it is even
; used. The game then proceeds as though it never deleted that output.
; To fix, move the line "ld a, e" to here.
call ComputeHPBarPixels call ComputeHPBarPixels
pop bc pop bc
pop de pop de
@@ -199,8 +203,8 @@ Functiond6f5: ; d6f5
ret ret
; d730 ; d730
Functiond730: ; d730 ShortHPBarAnim_UpdateTiles: ; d730
call Functiond784 call HPBarAnim_UpdateHPRemaining
ld d, $6 ld d, $6
ld a, [wWhichHPBar] ld a, [wWhichHPBar]
and $1 and $1
@@ -209,14 +213,14 @@ Functiond730: ; d730
ld e, a ld e, a
ld c, a ld c, a
push de push de
call Functiond771 call HPBarAnim_RedrawHPBar
pop de pop de
call Functiond7b4 call HPBarAnim_PaletteUpdate
ret ret
; d749 ; d749
Functiond749: ; d749 LongHPBarAnim_UpdateTiles: ; d749
call Functiond784 call HPBarAnim_UpdateHPRemaining
ld a, [Buffer3] ld a, [Buffer3]
ld c, a ld c, a
ld a, [Buffer4] ld a, [Buffer4]
@@ -232,20 +236,20 @@ Functiond749: ; d749
and $1 and $1
ld b, a ld b, a
push de push de
call Functiond771 call HPBarAnim_RedrawHPBar
pop de pop de
call Functiond7b4 call HPBarAnim_PaletteUpdate
ret ret
; d771 ; d771
Functiond771: ; d771 HPBarAnim_RedrawHPBar: ; d771
ld a, [wWhichHPBar] ld a, [wWhichHPBar]
cp $2 cp $2
jr nz, .skip jr nz, .skip
ld a, $28 ld a, 2 * SCREEN_WIDTH
add l add l
ld l, a ld l, a
ld a, $0 ld a, 0
adc h adc h
ld h, a ld h, a
.skip .skip
@@ -253,17 +257,17 @@ Functiond771: ; d771
ret ret
; d784 ; d784
Functiond784: ; d784 HPBarAnim_UpdateHPRemaining: ; d784
ld a, [wWhichHPBar] ld a, [wWhichHPBar]
and a and a
ret z ret z
cp $1 cp $1
jr z, .load_15 jr z, .load_15
ld de, $16 ld de, SCREEN_WIDTH + 2
jr .loaded_de jr .loaded_de
.load_15 .load_15
ld de, $15 ld de, SCREEN_WIDTH + 1
.loaded_de .loaded_de
push hl push hl
add hl, de add hl, de
@@ -284,7 +288,7 @@ endr
ret ret
; d7b4 ; d7b4
Functiond7b4: ; d7b4 HPBarAnim_PaletteUpdate: ; d7b4
ld a, [hCGB] ld a, [hCGB]
and a and a
ret z ret z
@@ -296,7 +300,7 @@ Functiond7b4: ; d7b4
ret ret
; d7c9 ; d7c9
Functiond7c9: ; d7c9 HPBarAnim_BGMapUpdate: ; d7c9
ld a, [hCGB] ld a, [hCGB]
and a and a
jr nz, .cgb jr nz, .cgb
@@ -312,13 +316,13 @@ Functiond7c9: ; d7c9
jr z, .load_1 jr z, .load_1
ld a, [CurPartyMon] ld a, [CurPartyMon]
cp $3 cp $3
jr nc, .c_is_1 jr nc, .bottom_half_of_screen
ld c, $0 ld c, $0
jr .c_is_0 jr .got_third
.c_is_1 .bottom_half_of_screen
ld c, $1 ld c, $1
.c_is_0 .got_third
push af push af
cp $2 cp $2
jr z, .skip_delay jr z, .skip_delay
@@ -370,14 +374,14 @@ Functiond7c9: ; d7c9
ret ret
; d839 ; d839
Functiond839: ; d839 ShortHPBar_CalcPixelFrame: ; d839
ld a, [Buffer1] ld a, [Buffer1]
ld c, a ld c, a
ld b, 0 ld b, 0
ld hl, 0 ld hl, 0
ld a, [wCurHPBarPixels] ld a, [wCurHPBarPixels]
cp 6 * 8 cp 6 * 8
jr nc, .coppy_buffer jr nc, .return_max
and a and a
jr z, .return_zero jr z, .return_zero
call AddNTimes call AddNTimes
@@ -423,7 +427,7 @@ Functiond839: ; d839
ld [Buffer3], a ld [Buffer3], a
ret ret
.coppy_buffer .return_max
ld a, [Buffer1] ld a, [Buffer1]
ld [Buffer3], a ld [Buffer3], a
ret ret

View File

@@ -124,10 +124,8 @@ endr
jr z, .RestartKenjiBreakCountdown jr z, .RestartKenjiBreakCountdown
dec [hl] dec [hl]
jr nz, .DontRestartKenjiBreakCountdown jr nz, .DontRestartKenjiBreakCountdown
.RestartKenjiBreakCountdown .RestartKenjiBreakCountdown
call Special_SampleKenjiBreakCountdown call Special_SampleKenjiBreakCountdown
.DontRestartKenjiBreakCountdown .DontRestartKenjiBreakCountdown
jr RestartDailyResetTimer jr RestartDailyResetTimer
; 11485 ; 11485

2
extras

Submodule extras updated: 68edf51f10...adbc204d74

View File

@@ -2008,7 +2008,7 @@ HealPartyMon: ; c677
ret ret
ComputeHPBarPixels: ; c699 ComputeHPBarPixels: ; c699
; bc * (6 * 8) / de ; e = bc * (6 * 8) / de
ld a, b ld a, b
or c or c
jr z, .zero jr z, .zero

View File

@@ -23,8 +23,8 @@ BlackthornGym2F_MapScriptHeader:
return return
.BoulderCmdQueue .BoulderCmdQueue
dbw MAPCALLBACK_OBJECTS, .BoulderTable ; check if any stones are sitting on a warp dbw CMDQUEUE_STONETABLE, .BoulderTable ; check if any stones are sitting on a warp
db 0, 0 ; filler dw 0 ; filler
.BoulderTable .BoulderTable
stonetable 5, BLACKTHORNGYM2F_BOULDER1, .Disappear4 stonetable 5, BLACKTHORNGYM2F_BOULDER1, .Disappear4
@@ -137,9 +137,9 @@ BlackthornGym2F_MapEventHeader:
db 5 db 5
warp_def $7, $1, 3, BLACKTHORN_GYM_1F warp_def $7, $1, 3, BLACKTHORN_GYM_1F
warp_def $9, $7, 4, BLACKTHORN_GYM_1F warp_def $9, $7, 4, BLACKTHORN_GYM_1F
warp_def $5, $2, 5, BLACKTHORN_GYM_1F warp_def $5, $2, 5, BLACKTHORN_GYM_1F ; hole
warp_def $7, $8, 6, BLACKTHORN_GYM_1F warp_def $7, $8, 6, BLACKTHORN_GYM_1F ; hole
warp_def $3, $8, 7, BLACKTHORN_GYM_1F warp_def $3, $8, 7, BLACKTHORN_GYM_1F ; hole
.XYTriggers: .XYTriggers:
db 0 db 0

View File

@@ -21,8 +21,8 @@ IcePathB1F_MapScriptHeader:
return return
.CommandQueue: .CommandQueue:
dbw MAPCALLBACK_OBJECTS, .StoneTable ; check if any stones are sitting on a warp dbw CMDQUEUE_STONETABLE, .StoneTable ; check if any stones are sitting on a warp
db 0, 0 ; filler dw 0 ; filler
.StoneTable: .StoneTable:
stonetable 3, ICEPATHB1F_BOULDER1, .Boulder1 stonetable 3, ICEPATHB1F_BOULDER1, .Boulder1
@@ -90,10 +90,10 @@ IcePathB1F_MapEventHeader:
db 8 db 8
warp_def $f, $3, 3, ICE_PATH_1F warp_def $f, $3, 3, ICE_PATH_1F
warp_def $3, $11, 1, ICE_PATH_B2F_MAHOGANY_SIDE warp_def $3, $11, 1, ICE_PATH_B2F_MAHOGANY_SIDE
warp_def $2, $b, 3, ICE_PATH_B2F_MAHOGANY_SIDE warp_def $2, $b, 3, ICE_PATH_B2F_MAHOGANY_SIDE ; hole
warp_def $7, $4, 4, ICE_PATH_B2F_MAHOGANY_SIDE warp_def $7, $4, 4, ICE_PATH_B2F_MAHOGANY_SIDE ; hole
warp_def $c, $5, 5, ICE_PATH_B2F_MAHOGANY_SIDE warp_def $c, $5, 5, ICE_PATH_B2F_MAHOGANY_SIDE ; hole
warp_def $d, $c, 6, ICE_PATH_B2F_MAHOGANY_SIDE warp_def $d, $c, 6, ICE_PATH_B2F_MAHOGANY_SIDE ; hole
warp_def $19, $5, 4, ICE_PATH_1F warp_def $19, $5, 4, ICE_PATH_1F
warp_def $1b, $b, 1, ICE_PATH_B2F_BLACKTHORN_SIDE warp_def $1b, $b, 1, ICE_PATH_B2F_BLACKTHORN_SIDE

View File

@@ -1806,6 +1806,7 @@ CurPartyMon:: ; d109
wWhichHPBar:: wWhichHPBar::
; 0: Enemy ; 0: Enemy
; 1: Player ; 1: Player
; 2: Party Menu
ds 1 ds 1
wPokemonWithdrawDepositParameter:: wPokemonWithdrawDepositParameter::
; 0: Take from PC ; 0: Take from PC