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]
cp 3
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
or b
jr nz, .loop

View File

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

View File

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

View File

@ -5,14 +5,14 @@ _AnimateHPBar: ; d627
.ShortAnimLoop
push bc
push hl
call Functiond6e2
call ShortAnim_UpdateVariables
pop hl
pop bc
push af
push bc
push hl
call Functiond730
call Functiond7c9
call ShortHPBarAnim_UpdateTiles
call HPBarAnim_BGMapUpdate
pop hl
pop bc
pop af
@ -24,15 +24,15 @@ _AnimateHPBar: ; d627
.LongAnimLoop
push bc
push hl
call Functiond6f5
call LongAnim_UpdateVariables
pop hl
pop bc
ret c
push af
push bc
push hl
call Functiond749
call Functiond7c9
call LongHPBarAnim_UpdateTiles
call HPBarAnim_BGMapUpdate
pop hl
pop bc
pop af
@ -132,7 +132,7 @@ _AnimateHPBar: ; d627
ret
; d6e2
Functiond6e2: ; d6e2
ShortAnim_UpdateVariables: ; d6e2
ld hl, wCurHPBarPixels
ld a, [wNewHPBarPixels]
cp [hl]
@ -144,12 +144,12 @@ Functiond6e2: ; d6e2
ld a, c
add [hl]
ld [hl], a
call Functiond839
call ShortHPBar_CalcPixelFrame
and a
ret
; d6f5
Functiond6f5: ; d6f5
LongAnim_UpdateVariables: ; d6f5
.loop
ld hl, Buffer3
ld a, [hli]
@ -186,6 +186,10 @@ Functiond6f5: ; d6f5
ld c, a
ld a, [hli]
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
pop bc
pop de
@ -199,8 +203,8 @@ Functiond6f5: ; d6f5
ret
; d730
Functiond730: ; d730
call Functiond784
ShortHPBarAnim_UpdateTiles: ; d730
call HPBarAnim_UpdateHPRemaining
ld d, $6
ld a, [wWhichHPBar]
and $1
@ -209,14 +213,14 @@ Functiond730: ; d730
ld e, a
ld c, a
push de
call Functiond771
call HPBarAnim_RedrawHPBar
pop de
call Functiond7b4
call HPBarAnim_PaletteUpdate
ret
; d749
Functiond749: ; d749
call Functiond784
LongHPBarAnim_UpdateTiles: ; d749
call HPBarAnim_UpdateHPRemaining
ld a, [Buffer3]
ld c, a
ld a, [Buffer4]
@ -232,20 +236,20 @@ Functiond749: ; d749
and $1
ld b, a
push de
call Functiond771
call HPBarAnim_RedrawHPBar
pop de
call Functiond7b4
call HPBarAnim_PaletteUpdate
ret
; d771
Functiond771: ; d771
HPBarAnim_RedrawHPBar: ; d771
ld a, [wWhichHPBar]
cp $2
jr nz, .skip
ld a, $28
ld a, 2 * SCREEN_WIDTH
add l
ld l, a
ld a, $0
ld a, 0
adc h
ld h, a
.skip
@ -253,17 +257,17 @@ Functiond771: ; d771
ret
; d784
Functiond784: ; d784
HPBarAnim_UpdateHPRemaining: ; d784
ld a, [wWhichHPBar]
and a
ret z
cp $1
jr z, .load_15
ld de, $16
ld de, SCREEN_WIDTH + 2
jr .loaded_de
.load_15
ld de, $15
ld de, SCREEN_WIDTH + 1
.loaded_de
push hl
add hl, de
@ -284,7 +288,7 @@ endr
ret
; d7b4
Functiond7b4: ; d7b4
HPBarAnim_PaletteUpdate: ; d7b4
ld a, [hCGB]
and a
ret z
@ -296,7 +300,7 @@ Functiond7b4: ; d7b4
ret
; d7c9
Functiond7c9: ; d7c9
HPBarAnim_BGMapUpdate: ; d7c9
ld a, [hCGB]
and a
jr nz, .cgb
@ -312,13 +316,13 @@ Functiond7c9: ; d7c9
jr z, .load_1
ld a, [CurPartyMon]
cp $3
jr nc, .c_is_1
jr nc, .bottom_half_of_screen
ld c, $0
jr .c_is_0
jr .got_third
.c_is_1
.bottom_half_of_screen
ld c, $1
.c_is_0
.got_third
push af
cp $2
jr z, .skip_delay
@ -370,14 +374,14 @@ Functiond7c9: ; d7c9
ret
; d839
Functiond839: ; d839
ShortHPBar_CalcPixelFrame: ; d839
ld a, [Buffer1]
ld c, a
ld b, 0
ld hl, 0
ld a, [wCurHPBarPixels]
cp 6 * 8
jr nc, .coppy_buffer
jr nc, .return_max
and a
jr z, .return_zero
call AddNTimes
@ -423,7 +427,7 @@ Functiond839: ; d839
ld [Buffer3], a
ret
.coppy_buffer
.return_max
ld a, [Buffer1]
ld [Buffer3], a
ret

View File

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

2
extras

@ -1 +1 @@
Subproject commit 68edf51f1070b056c281471242220f9c6142e1b6
Subproject commit adbc204d741bec7a68c1e6cd67751f226d0347cb

View File

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

View File

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

View File

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

View File

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