fixed hp bar wram label and misc

This commit is contained in:
YamaArashi 2015-02-07 22:18:42 -08:00
parent 32f7cf12de
commit 72bbaed99f
21 changed files with 169 additions and 161 deletions

View file

@ -77,7 +77,7 @@ DrainHPEffect_: ; 783f (1:783f)
hlCoord 2, 2 hlCoord 2, 2
xor a xor a
.next2 .next2
ld [wListMenuID], a ld [wHPBarType], a
predef UpdateHPBar2 predef UpdateHPBar2
predef DrawPlayerHUDAndHPBar predef DrawPlayerHUDAndHPBar
predef DrawEnemyHUDAndHPBar predef DrawEnemyHUDAndHPBar

View file

@ -18,27 +18,28 @@ IsPlayerJustOutsideMap: ; 128d8 (4:68d8)
DrawHP: ; 128ef (4:68ef) DrawHP: ; 128ef (4:68ef)
call GetPredefRegisters call GetPredefRegisters
ld a, $1 ld a, $1
jr asm_128fb jr DrawHP_
Func_128f6: ; 128f6 (4:68f6) DrawHP2: ; 128f6 (4:68f6)
call GetPredefRegisters call GetPredefRegisters
ld a, $2 ld a, $2
asm_128fb: ; 128fb (4:68fb)
ld [wListMenuID], a DrawHP_: ; 128fb (4:68fb)
ld [wHPBarType], a
push hl push hl
ld a, [wLoadedMonHP] ld a, [wLoadedMonHP]
ld b, a ld b, a
ld a, [wLoadedMonHP + 1] ld a, [wLoadedMonHP + 1]
ld c, a ld c, a
or b or b
jr nz, .asm_12913 jr nz, .nonzeroHP
xor a xor a
ld c, a ld c, a
ld e, a ld e, a
ld a, $6 ld a, $6
ld d, a ld d, a
jp DrawHPBarAndFraction jp .drawHPBarAndPrintFraction
.asm_12913 .nonzeroHP
ld a, [wLoadedMonMaxHP] ld a, [wLoadedMonMaxHP]
ld d, a ld d, a
ld a, [wLoadedMonMaxHP + 1] ld a, [wLoadedMonMaxHP + 1]
@ -47,8 +48,7 @@ asm_128fb: ; 128fb (4:68fb)
ld a, $6 ld a, $6
ld d, a ld d, a
ld c, a ld c, a
.drawHPBarAndPrintFraction
DrawHPBarAndFraction: ; 12924 (4:6924)
pop hl pop hl
push de push de
push hl push hl
@ -59,10 +59,10 @@ DrawHPBarAndFraction: ; 12924 (4:6924)
bit 0, a bit 0, a
jr z, .printFractionBelowBar jr z, .printFractionBelowBar
ld bc, $9 ; right of bar ld bc, $9 ; right of bar
jr .printHPFraction jr .printFraction
.printFractionBelowBar .printFractionBelowBar
ld bc, SCREEN_WIDTH + 1 ; below bar ld bc, SCREEN_WIDTH + 1 ; below bar
.printHPFraction .printFraction
add hl, bc add hl, bc
ld de, wLoadedMonHP ld de, wLoadedMonHP
ld bc, $203 ld bc, $203

View file

@ -207,16 +207,16 @@ WildMonEncounterSlotChances: ; 13918 (4:7918)
db $FF, $12 ; 3/256 = 1.2% chance of slot 9 db $FF, $12 ; 3/256 = 1.2% chance of slot 9
RecoilEffect_: ; 1392c (4:792c) RecoilEffect_: ; 1392c (4:792c)
ld a, [H_WHOSETURN] ; $fff3 ld a, [H_WHOSETURN]
and a and a
ld a, [W_PLAYERMOVENUM] ; wcfd2 ld a, [W_PLAYERMOVENUM]
ld hl, wBattleMonMaxHP ; wd023 ld hl, wBattleMonMaxHP
jr z, .asm_1393d jr z, .asm_1393d
ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM ld a, [W_ENEMYMOVENUM]
ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP ld hl, wEnemyMonMaxHP
.asm_1393d .asm_1393d
ld d, a ld d, a
ld a, [W_DAMAGE] ; W_DAMAGE ld a, [W_DAMAGE]
ld b, a ld b, a
ld a, [W_DAMAGE + 1] ld a, [W_DAMAGE + 1]
ld c, a ld c, a
@ -260,16 +260,16 @@ RecoilEffect_: ; 1392c (4:792c)
ld [hl], a ld [hl], a
.asm_13982 .asm_13982
hlCoord 10, 9 hlCoord 10, 9
ld a, [H_WHOSETURN] ; $fff3 ld a, [H_WHOSETURN]
and a and a
ld a, $1 ld a, $1
jr z, .asm_13990 jr z, .asm_13990
hlCoord 2, 2 hlCoord 2, 2
xor a xor a
.asm_13990 .asm_13990
ld [wListMenuID], a ; wListMenuID ld [wHPBarType], a
predef UpdateHPBar2 predef UpdateHPBar2
ld hl, HitWithRecoilText ; $799e ld hl, HitWithRecoilText
jp PrintText jp PrintText
HitWithRecoilText: ; 1399e (4:799e) HitWithRecoilText: ; 1399e (4:799e)
TX_FAR _HitWithRecoilText TX_FAR _HitWithRecoilText
@ -392,8 +392,8 @@ GetTrainerName_: ; 13a58 (4:7a58)
ld a, [wLinkState] ld a, [wLinkState]
and a and a
jr nz, .rival jr nz, .rival
ld hl, W_RIVALNAME ; wd34a ld hl, W_RIVALNAME
ld a, [W_TRAINERCLASS] ; wd031 ld a, [W_TRAINERCLASS]
cp SONY1 cp SONY1
jr z, .rival jr z, .rival
cp SONY2 cp SONY2

View file

@ -768,7 +768,7 @@ UpdateCurMonHPBar: ; 3c4f6 (f:44f6)
xor a xor a
.playersTurn .playersTurn
push bc push bc
ld [wListMenuID], a ld [wHPBarType], a
predef UpdateHPBar2 predef UpdateHPBar2
pop bc pop bc
ret ret
@ -2029,7 +2029,7 @@ DrawEnemyHUDAndHPBar: ; 3cdec (f:4dec)
ld c, a ld c, a
.drawHPBar .drawHPBar
xor a xor a
ld [wListMenuID], a ld [wHPBarType], a
hlCoord 2, 2 hlCoord 2, 2
call DrawHPBar call DrawHPBar
ld a, $1 ld a, $1
@ -4899,7 +4899,7 @@ ApplyDamageToEnemyPokemon: ; 3e142 (f:6142)
ld [wHPBarNewHP],a ld [wHPBarNewHP],a
hlCoord 2, 2 hlCoord 2, 2
xor a xor a
ld [wListMenuID],a ld [wHPBarType],a
predef UpdateHPBar2 ; animate the HP bar shortening predef UpdateHPBar2 ; animate the HP bar shortening
ApplyAttackToEnemyPokemonDone: ; 3e19d (f:619d) ApplyAttackToEnemyPokemonDone: ; 3e19d (f:619d)
jp DrawHUDsAndHPBars jp DrawHUDsAndHPBars
@ -5017,7 +5017,7 @@ ApplyDamageToPlayerPokemon: ; 3e200 (f:6200)
ld [wHPBarMaxHP],a ld [wHPBarMaxHP],a
hlCoord 10, 9 hlCoord 10, 9
ld a,$01 ld a,$01
ld [wListMenuID],a ld [wHPBarType],a
predef UpdateHPBar2 ; animate the HP bar shortening predef UpdateHPBar2 ; animate the HP bar shortening
ApplyAttackToPlayerPokemonDone ApplyAttackToPlayerPokemonDone
jp DrawHUDsAndHPBars jp DrawHUDsAndHPBars

View file

@ -1174,7 +1174,7 @@ Func_3a718: ; 3a718 (e:6718)
call AIPrintItemUse_ call AIPrintItemUse_
hlCoord 2, 2 hlCoord 2, 2
xor a xor a
ld [wListMenuID],a ld [wHPBarType],a
predef UpdateHPBar2 predef UpdateHPBar2
jp DecrementAICount jp DecrementAICount

View file

@ -91,7 +91,7 @@ HealEffect_: ; 3b9ec (e:79ec)
hlCoord 2, 2 hlCoord 2, 2
xor a xor a
.asm_3ba83 .asm_3ba83
ld [wListMenuID], a ld [wHPBarType], a
predef UpdateHPBar2 predef UpdateHPBar2
ld hl, DrawHUDsAndHPBars ld hl, DrawHUDsAndHPBars
call BankswitchEtoF call BankswitchEtoF

View file

@ -1,4 +1,4 @@
Func_1c98a: ; 1c98a (7:498a) DoClearSaveDialogue: ; 1c98a (7:498a)
call ClearScreen call ClearScreen
call GoPAL_SET_CF1C call GoPAL_SET_CF1C
call LoadFontTilePatterns call LoadFontTilePatterns
@ -15,7 +15,7 @@ Func_1c98a: ; 1c98a (7:498a)
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
and a and a
jp z, Init jp z, Init
callba Func_73b6a callba ClearSAV
jp Init jp Init
ClearSaveDataText: ; 1c9c1 (7:49c1) ClearSaveDataText: ; 1c9c1 (7:49c1)

View file

@ -14,7 +14,7 @@ _GivePokemon: ; 4fda5 (13:7da5)
ld [wEnemyMonSpecies2], a ld [wEnemyMonSpecies2], a
callab LoadEnemyMonData callab LoadEnemyMonData
call SetPokedexOwnedFlag call SetPokedexOwnedFlag
callab Func_e7a4 callab SendNewMonToBox
ld hl, wcf4b ld hl, wcf4b
ld a, [wd5a0] ld a, [wd5a0]
and $7f and $7f

View file

@ -203,7 +203,7 @@ UpdateHPBar_CalcHPDifference: ; fad7 (3:7ad7)
UpdateHPBar_PrintHPNumber: ; faf5 (3:7af5) UpdateHPBar_PrintHPNumber: ; faf5 (3:7af5)
push af push af
push de push de
ld a, [wListMenuID] ; wListMenuID ld a, [wHPBarType]
and a and a
jr z, .asm_fb2d jr z, .asm_fb2d
ld a, [wHPBarOldHP] ld a, [wHPBarOldHP]

View file

@ -430,7 +430,7 @@ ItemUseBall: ; d687 (3:5687)
jr .End jr .End
.sendToBox ;$5907 .sendToBox ;$5907
call ClearSprites call ClearSprites
call Func_e7a4 call SendNewMonToBox
ld hl,ItemUseBallText07 ld hl,ItemUseBallText07
ld a,[wd7f1] ld a,[wd7f1]
bit 0,a ;already met Bill? bit 0,a ;already met Bill?
@ -923,7 +923,7 @@ ItemUseMedicine: ; dabb (3:5abb)
set 0,a set 0,a
ld [hFlags_0xFFF6],a ld [hFlags_0xFFF6],a
ld a,$02 ld a,$02
ld [wListMenuID],a ld [wHPBarType],a
predef UpdateHPBar2 ; animate HP bar decrease of pokemon that used Softboiled predef UpdateHPBar2 ; animate HP bar decrease of pokemon that used Softboiled
ld a,[hFlags_0xFFF6] ld a,[hFlags_0xFFF6]
res 0,a res 0,a
@ -1073,7 +1073,7 @@ ItemUseMedicine: ; dabb (3:5abb)
set 0,a set 0,a
ld [hFlags_0xFFF6],a ld [hFlags_0xFFF6],a
ld a,$02 ld a,$02
ld [wListMenuID],a ld [wHPBarType],a
predef UpdateHPBar2 ; animate the HP bar lengthening predef UpdateHPBar2 ; animate the HP bar lengthening
ld a,[hFlags_0xFFF6] ld a,[hFlags_0xFFF6]
res 0,a res 0,a
@ -1090,7 +1090,7 @@ ItemUseMedicine: ; dabb (3:5abb)
jr .showHealingItemMessage jr .showHealingItemMessage
.playStatusAilmentCuringSound .playStatusAilmentCuringSound
ld a,(SFX_02_3e - SFX_Headers_02) / 3 ; status ailment curing sound ld a,(SFX_02_3e - SFX_Headers_02) / 3 ; status ailment curing sound
call PlaySoundWaitForCurrent ; play sound call PlaySoundWaitForCurrent
.showHealingItemMessage .showHealingItemMessage
xor a xor a
ld [H_AUTOBGTRANSFERENABLED],a ld [H_AUTOBGTRANSFERENABLED],a
@ -1102,7 +1102,7 @@ ItemUseMedicine: ; dabb (3:5abb)
ld [H_AUTOBGTRANSFERENABLED],a ld [H_AUTOBGTRANSFERENABLED],a
ld c,50 ld c,50
call DelayFrames call DelayFrames
call WaitForTextScrollButtonPress ; wait for a button press call WaitForTextScrollButtonPress
jr .done jr .done
.canceledItemUse .canceledItemUse
xor a xor a
@ -1118,7 +1118,7 @@ ItemUseMedicine: ; dabb (3:5abb)
ld a,[W_ISINBATTLE] ld a,[W_ISINBATTLE]
and a and a
ret nz ret nz
jp ReloadMapData ; restore saved screen jp ReloadMapData
.useVitamin .useVitamin
push hl push hl
ld a,[hl] ld a,[hl]
@ -2567,7 +2567,7 @@ IsKeyItem_: ; e764 (3:6764)
INCLUDE "data/key_items.asm" INCLUDE "data/key_items.asm"
Func_e7a4: ; e7a4 (3:67a4) SendNewMonToBox: ; e7a4 (3:67a4)
ld de, W_NUMINBOX ; wda80 ld de, W_NUMINBOX ; wda80
ld a, [de] ld a, [de]
inc a inc a
@ -2818,49 +2818,51 @@ ItemUseReloadOverworldData: ; e9c5 (3:69c5)
call LoadCurrentMapView call LoadCurrentMapView
jp UpdateSprites jp UpdateSprites
Func_e9cb: ; e9cb (3:69cb) ; creates a list at wBuffer of maps where the mon in [wd11e] can be found.
ld hl, WildDataPointers ; $4eeb ; this is used by the pokedex to display locations the mon can be found on the map.
ld de, wHPBarMaxHP FindWildLocationsOfMon: ; e9cb (3:69cb)
ld hl, WildDataPointers
ld de, wBuffer
ld c, $0 ld c, $0
.asm_e9d3 .loop
inc hl inc hl
ld a, [hld] ld a, [hld]
inc a inc a
jr z, .asm_e9ec jr z, .done
push hl push hl
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
ld a, [hli] ld a, [hli]
and a and a
call nz, Func_e9f0 call nz, CheckMapForMon ; land
ld a, [hli] ld a, [hli]
and a and a
call nz, Func_e9f0 call nz, CheckMapForMon ; water
pop hl pop hl
inc hl inc hl
inc hl inc hl
inc c inc c
jr .asm_e9d3 jr .loop
.asm_e9ec .done
ld a, $ff ld a, $ff ; list terminator
ld [de], a ld [de], a
ret ret
Func_e9f0: ; e9f0 (3:69f0) CheckMapForMon: ; e9f0 (3:69f0)
inc hl inc hl
ld b, $a ld b, $a
.asm_e9f3 .loop
ld a, [wd11e] ld a, [wd11e]
cp [hl] cp [hl]
jr nz, .asm_e9fc jr nz, .nextEntry
ld a, c ld a, c
ld [de], a ld [de], a
inc de inc de
.asm_e9fc .nextEntry
inc hl inc hl
inc hl inc hl
dec b dec b
jr nz, .asm_e9f3 jr nz, .loop
dec hl dec hl
ret ret

View file

@ -1,6 +1,6 @@
Func_213c8:: ; 213c8 (8:53c8) Func_213c8:: ; 213c8 (8:53c8)
xor a xor a
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
call SaveScreenTilesToBuffer2 call SaveScreenTilesToBuffer2
ld a, [wd5a2] ld a, [wd5a2]
and a and a
@ -28,64 +28,64 @@ Func_213c8:: ; 213c8 (8:53c8)
call TextBoxBorder call TextBoxBorder
call UpdateSprites call UpdateSprites
ld a, $3 ld a, $3
ld [wMaxMenuItem], a ; wMaxMenuItem ld [wMaxMenuItem], a
ld a, [wd7f1] ld a, [wd7f1]
bit 0, a bit 0, a
jr nz, .asm_21414 jr nz, .asm_21414
hlCoord 2, 2 hlCoord 2, 2
ld de, SomeonesPCText ; $548b ld de, SomeonesPCText
jr .asm_2141a jr .asm_2141a
.asm_21414 .asm_21414
hlCoord 2, 2 hlCoord 2, 2
ld de, BillsPCText ; $5497 ld de, BillsPCText
.asm_2141a .asm_2141a
call PlaceString call PlaceString
hlCoord 2, 4 hlCoord 2, 4
ld de, wPlayerName ; wd158 ld de, wPlayerName
call PlaceString call PlaceString
ld l, c ld l, c
ld h, b ld h, b
ld de, PlayersPCText ; $54a0 ld de, PlayersPCText
call PlaceString call PlaceString
ld a, [wd74b] ld a, [wd74b]
bit 5, a bit 5, a
jr z, .asm_21462 jr z, .asm_21462
hlCoord 2, 6 hlCoord 2, 6
ld de, OaksPCText ; $54a5 ld de, OaksPCText
call PlaceString call PlaceString
ld a, [wd5a2] ld a, [wd5a2]
and a and a
jr z, .asm_2145a jr z, .asm_2145a
ld a, $4 ld a, $4
ld [wMaxMenuItem], a ; wMaxMenuItem ld [wMaxMenuItem], a
hlCoord 2, 8 hlCoord 2, 8
ld de, PKMNLeaguePCText ; $54b2 ld de, PKMNLeaguePCText
call PlaceString call PlaceString
hlCoord 2, 10 hlCoord 2, 10
ld de, LogOffPCText ; $54ba ld de, LogOffPCText
jr .asm_2146d jr .asm_2146d
.asm_2145a .asm_2145a
hlCoord 2, 8 hlCoord 2, 8
ld de, LogOffPCText ; $54ba ld de, LogOffPCText
jr .asm_2146d jr .asm_2146d
.asm_21462 .asm_21462
ld a, $2 ld a, $2
ld [wMaxMenuItem], a ; wMaxMenuItem ld [wMaxMenuItem], a
hlCoord 2, 6 hlCoord 2, 6
ld de, LogOffPCText ; $54ba ld de, LogOffPCText
.asm_2146d .asm_2146d
call PlaceString call PlaceString
ld a, $3 ld a, $3
ld [wMenuWatchedKeys], a ; wMenuWatchedKeys ld [wMenuWatchedKeys], a
ld a, $2 ld a, $2
ld [wTopMenuItemY], a ; wTopMenuItemY ld [wTopMenuItemY], a
ld a, $1 ld a, $1
ld [wTopMenuItemX], a ; wTopMenuItemX ld [wTopMenuItemX], a
xor a xor a
ld [wCurrentMenuItem], a ; wCurrentMenuItem ld [wCurrentMenuItem], a
ld [wLastMenuItem], a ; wLastMenuItem ld [wLastMenuItem], a
ld a, $1 ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
ret ret
SomeonesPCText: db "SOMEONE's PC@" SomeonesPCText: db "SOMEONE's PC@"
@ -103,7 +103,7 @@ BillsPC_:: ; 0x214c2
inc a ; MONSTER_NAME inc a ; MONSTER_NAME
ld [W_LISTTYPE], a ld [W_LISTTYPE], a
call LoadHpBarAndStatusTilePatterns call LoadHpBarAndStatusTilePatterns
ld a, [wListScrollOffset] ; wcc36 ld a, [wListScrollOffset]
push af push af
ld a, [wFlags_0xcd60] ld a, [wFlags_0xcd60]
bit 3, a bit 3, a
@ -116,9 +116,9 @@ BillsPC_:: ; 0x214c2
Func_214e8: ; 214e8 (8:54e8) Func_214e8: ; 214e8 (8:54e8)
BillsPCMenu: BillsPCMenu:
ld a, [wccd3] ld a, [wccd3]
ld [wCurrentMenuItem], a ; wCurrentMenuItem ld [wCurrentMenuItem], a
ld hl, vChars2 + $780 ld hl, vChars2 + $780
ld de, PokeballTileGraphics ; $697e ld de, PokeballTileGraphics
ld bc, (BANK(PokeballTileGraphics) << 8) + $01 ld bc, (BANK(PokeballTileGraphics) << 8) + $01
call CopyVideoData call CopyVideoData
call LoadScreenTilesFromBuffer2DisableBGTransfer call LoadScreenTilesFromBuffer2DisableBGTransfer
@ -127,9 +127,9 @@ BillsPCMenu:
ld c, $c ld c, $c
call TextBoxBorder call TextBoxBorder
hlCoord 2, 2 hlCoord 2, 2
ld de, BillsPCMenuText ; $56e1 ld de, BillsPCMenuText
call PlaceString call PlaceString
ld hl, wTopMenuItemY ; wTopMenuItemY ld hl, wTopMenuItemY
ld a, $2 ld a, $2
ld [hli], a ld [hli], a
dec a dec a
@ -143,10 +143,10 @@ BillsPCMenu:
xor a xor a
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a
ld hl, wListScrollOffset ; wcc36 ld hl, wListScrollOffset
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld [wPlayerMonNumber], a ; wPlayerMonNumber ld [wPlayerMonNumber], a
ld hl, WhatText ld hl, WhatText
call PrintText call PrintText
hlCoord 9, 14 hlCoord 9, 14
@ -167,16 +167,16 @@ BillsPCMenu:
.asm_21551 .asm_21551
Coorda 18, 16 Coorda 18, 16
hlCoord 10, 16 hlCoord 10, 16
ld de, BoxNoPCText ; $5713 ld de, BoxNoPCText
call PlaceString call PlaceString
ld a, $1 ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
call Delay3 call Delay3
call HandleMenuInput call HandleMenuInput
bit 1, a bit 1, a
jp nz, Func_21588 ; b button jp nz, Func_21588 ; b button
call PlaceUnfilledArrowMenuCursor call PlaceUnfilledArrowMenuCursor
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem]
ld [wccd3], a ld [wccd3], a
and a and a
jp z, Func_21618 ; withdraw jp z, Func_21618 ; withdraw
@ -200,28 +200,28 @@ Func_21588: ; 21588 (8:5588)
res 5, [hl] res 5, [hl]
call LoadScreenTilesFromBuffer2 call LoadScreenTilesFromBuffer2
pop af pop af
ld [wListScrollOffset], a ; wcc36 ld [wListScrollOffset], a
ld hl, wd730 ld hl, wd730
res 6, [hl] res 6, [hl]
ret ret
Func_215ac: ; 215ac (8:55ac) Func_215ac: ; 215ac (8:55ac)
BillsPCDeposit: BillsPCDeposit:
ld a, [wPartyCount] ; wPartyCount ld a, [wPartyCount]
dec a dec a
jr nz, .asm_215bb jr nz, .asm_215bb
ld hl, CantDepositLastMonText ld hl, CantDepositLastMonText
call PrintText call PrintText
jp BillsPCMenu jp BillsPCMenu
.asm_215bb .asm_215bb
ld a, [W_NUMINBOX] ; wda80 ld a, [W_NUMINBOX]
cp MONS_PER_BOX cp MONS_PER_BOX
jr nz, .asm_215cb jr nz, .asm_215cb
ld hl, BoxFullText ; $5802 ld hl, BoxFullText
call PrintText call PrintText
jp BillsPCMenu jp BillsPCMenu
.asm_215cb .asm_215cb
ld hl, wPartyCount ; wPartyCount ld hl, wPartyCount
call Func_216be call Func_216be
jp c, BillsPCMenu jp c, BillsPCMenu
call Func_2174b call Func_2174b
@ -236,7 +236,7 @@ BillsPCDeposit:
ld [wcf95], a ld [wcf95], a
call RemovePokemon call RemovePokemon
call WaitForSoundToFinish call WaitForSoundToFinish
ld hl, wWhichTrade ; wWhichTrade ld hl, wWhichTrade
ld a, [wd5a0] ld a, [wd5a0]
and $7f and $7f
cp 9 cp 9
@ -251,31 +251,31 @@ BillsPCDeposit:
.asm_2160c .asm_2160c
ld [hli], a ld [hli], a
ld [hl], $50 ld [hl], $50
ld hl, MonWasStoredText ; $57f8 ld hl, MonWasStoredText
call PrintText call PrintText
jp BillsPCMenu jp BillsPCMenu
Func_21618: ; 21618 (8:5618) Func_21618: ; 21618 (8:5618)
ld a, [W_NUMINBOX] ; wda80 ld a, [W_NUMINBOX]
and a and a
jr nz, .asm_21627 jr nz, .asm_21627
ld hl, NoMonText ; $580c ld hl, NoMonText
call PrintText call PrintText
jp Func_214e8 jp Func_214e8
.asm_21627 .asm_21627
ld a, [wPartyCount] ; wPartyCount ld a, [wPartyCount]
cp PARTY_LENGTH cp PARTY_LENGTH
jr nz, .asm_21637 jr nz, .asm_21637
ld hl, CantTakeMonText ; $5811 ld hl, CantTakeMonText
call PrintText call PrintText
jp Func_214e8 jp Func_214e8
.asm_21637 .asm_21637
ld hl, W_NUMINBOX ; wda80 ld hl, W_NUMINBOX
call Func_216be call Func_216be
jp c, Func_214e8 jp c, Func_214e8
call Func_2174b call Func_2174b
jp nc, Func_214e8 jp nc, Func_214e8
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon]
ld hl, wBoxMonNicks ld hl, wBoxMonNicks
call GetPartyMonName call GetPartyMonName
ld a, [wcf91] ld a, [wcf91]
@ -288,25 +288,25 @@ Func_21618: ; 21618 (8:5618)
ld [wcf95], a ld [wcf95], a
call RemovePokemon call RemovePokemon
call WaitForSoundToFinish call WaitForSoundToFinish
ld hl, MonIsTakenOutText ; $5807 ld hl, MonIsTakenOutText
call PrintText call PrintText
jp Func_214e8 jp Func_214e8
Func_21673: ; 21673 (8:5673) Func_21673: ; 21673 (8:5673)
ld a, [W_NUMINBOX] ; wda80 ld a, [W_NUMINBOX]
and a and a
jr nz, .asm_21682 jr nz, .asm_21682
ld hl, NoMonText ; $580c ld hl, NoMonText
call PrintText call PrintText
jp Func_214e8 jp Func_214e8
.asm_21682 .asm_21682
ld hl, W_NUMINBOX ; wda80 ld hl, W_NUMINBOX
call Func_216be call Func_216be
jp c, Func_214e8 jp c, Func_214e8
ld hl, OnceReleasedText ; $581b ld hl, OnceReleasedText
call PrintText call PrintText
call YesNoChoice call YesNoChoice
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem]
and a and a
jr nz, .asm_21682 jr nz, .asm_21682
inc a inc a
@ -315,7 +315,7 @@ Func_21673: ; 21673 (8:5673)
call WaitForSoundToFinish call WaitForSoundToFinish
ld a, [wcf91] ld a, [wcf91]
call PlayCry call PlayCry
ld hl, MonWasReleasedText ; $5820 ld hl, MonWasReleasedText
call PrintText call PrintText
jp Func_214e8 jp Func_214e8
@ -330,13 +330,13 @@ Func_216be: ; 216be (8:56be)
ld [wList + 1], a ld [wList + 1], a
xor a xor a
ld [wcf93], a ld [wcf93], a
ld [wListMenuID], a ; wListMenuID ld [wListMenuID], a
inc a ; MONSTER_NAME inc a ; MONSTER_NAME
ld [W_LISTTYPE], a ld [W_LISTTYPE], a
ld a, [wcc2b] ld a, [wcc2b]
ld [wCurrentMenuItem], a ; wCurrentMenuItem ld [wCurrentMenuItem], a
call DisplayListMenuID call DisplayListMenuID
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem]
ld [wcc2b], a ld [wcc2b], a
ret ret
@ -368,7 +368,7 @@ Func_2171b:: ; 2171b (8:571b)
ld a, [hli] ld a, [hli]
push hl push hl
push bc push bc
ld hl, HMMoveArray ; $5745 ld hl, HMMoveArray
ld de, 1 ld de, 1
call IsInArray call IsInArray
pop bc pop bc
@ -394,16 +394,16 @@ Func_2174b: ; 2174b (8:574b)
call TextBoxBorder call TextBoxBorder
ld a, [wccd3] ld a, [wccd3]
and a and a
ld de, DepositPCText ; $57cb ld de, DepositPCText
jr nz, .asm_21761 jr nz, .asm_21761
ld de, WithdrawPCText ; $57d3 ld de, WithdrawPCText
.asm_21761 .asm_21761
hlCoord 11, 12 hlCoord 11, 12
call PlaceString call PlaceString
hlCoord 11, 14 hlCoord 11, 14
ld de, StatsCancelPCText ; $57dc ld de, StatsCancelPCText
call PlaceString call PlaceString
ld hl, wTopMenuItemY ; wTopMenuItemY ld hl, wTopMenuItemY
ld a, $c ld a, $c
ld [hli], a ld [hli], a
ld a, $a ld a, $a
@ -417,16 +417,16 @@ Func_2174b: ; 2174b (8:574b)
ld [hli], a ld [hli], a
xor a xor a
ld [hl], a ld [hl], a
ld hl, wListScrollOffset ; wcc36 ld hl, wListScrollOffset
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld [wPlayerMonNumber], a ; wPlayerMonNumber ld [wPlayerMonNumber], a
ld [wcc2b], a ld [wcc2b], a
.asm_2178f .asm_2178f
call HandleMenuInput call HandleMenuInput
bit 1, a bit 1, a
jr nz, .asm_2179f jr nz, .asm_2179f
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem]
and a and a
jr z, .asm_217a1 jr z, .asm_217a1
dec a dec a

View file

@ -92,7 +92,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
set 0,a set 0,a
ld [hFlags_0xFFF6],a ld [hFlags_0xFFF6],a
add hl,bc add hl,bc
predef Func_128f6 ; draw HP bar and prints current / max HP predef DrawHP2 ; draw HP bar and prints current / max HP
ld a,[hFlags_0xFFF6] ld a,[hFlags_0xFFF6]
res 0,a res 0,a
ld [hFlags_0xFFF6],a ld [hFlags_0xFFF6],a

View file

@ -17,7 +17,7 @@ PlayerPC: ; 78e6 (1:78e6)
Func_790c: ; 790c (1:790c) Func_790c: ; 790c (1:790c)
ld a, [wccd3] ld a, [wccd3]
ld [wCurrentMenuItem], a ; wCurrentMenuItem ld [wCurrentMenuItem], a
ld hl, wFlags_0xcd60 ld hl, wFlags_0xcd60
set 5, [hl] set 5, [hl]
call LoadScreenTilesFromBuffer2 call LoadScreenTilesFromBuffer2
@ -27,9 +27,9 @@ Func_790c: ; 790c (1:790c)
call TextBoxBorder call TextBoxBorder
call UpdateSprites call UpdateSprites
hlCoord 2, 2 hlCoord 2, 2
ld de, PlayersPCMenuEntries ; $7af5 ld de, PlayersPCMenuEntries
call PlaceString call PlaceString
ld hl, wTopMenuItemY ; wTopMenuItemY ld hl, wTopMenuItemY
ld a, $2 ld a, $2
ld [hli], a ld [hli], a
dec a dec a
@ -42,17 +42,17 @@ Func_790c: ; 790c (1:790c)
ld [hli], a ld [hli], a
xor a xor a
ld [hl], a ld [hl], a
ld hl, wListScrollOffset ; wcc36 ld hl, wListScrollOffset
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld [wPlayerMonNumber], a ; wPlayerMonNumber ld [wPlayerMonNumber], a
ld hl, WhatDoYouWantText ld hl, WhatDoYouWantText
call PrintText call PrintText
call HandleMenuInput call HandleMenuInput
bit 1, a bit 1, a
jp nz, Func_796d jp nz, Func_796d
call PlaceUnfilledArrowMenuCursor call PlaceUnfilledArrowMenuCursor
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem]
ld [wccd3], a ld [wccd3], a
and a and a
jp z, Func_7a12 jp z, Func_7a12
@ -73,7 +73,7 @@ Func_796d: ; 796d (1:796d)
res 5, [hl] res 5, [hl]
call LoadScreenTilesFromBuffer2 call LoadScreenTilesFromBuffer2
xor a xor a
ld [wListScrollOffset], a ; wcc36 ld [wListScrollOffset], a
ld [wcc2c], a ld [wcc2c], a
ld hl, wd730 ld hl, wd730
res 6, [hl] res 6, [hl]
@ -83,9 +83,9 @@ Func_796d: ; 796d (1:796d)
Func_7995: ; 7995 (1:7995) Func_7995: ; 7995 (1:7995)
xor a xor a
ld [wCurrentMenuItem], a ; wCurrentMenuItem ld [wCurrentMenuItem], a
ld [wListScrollOffset], a ; wcc36 ld [wListScrollOffset], a
ld a, [wNumBagItems] ; wNumBagItems ld a, [wNumBagItems]
and a and a
jr nz, Func_79ab jr nz, Func_79ab
ld hl, NothingToDepositText ld hl, NothingToDepositText
@ -95,7 +95,7 @@ Func_7995: ; 7995 (1:7995)
Func_79ab: ; 79ab (1:79ab) Func_79ab: ; 79ab (1:79ab)
ld hl, WhatToDepositText ld hl, WhatToDepositText
call PrintText call PrintText
ld hl, wNumBagItems ; wNumBagItems ld hl, wNumBagItems
ld a, l ld a, l
ld [wList], a ld [wList], a
ld a, h ld a, h
@ -103,7 +103,7 @@ Func_79ab: ; 79ab (1:79ab)
xor a xor a
ld [wcf93], a ld [wcf93], a
ld a, $3 ld a, $3
ld [wListMenuID], a ; wListMenuID ld [wListMenuID], a
call DisplayListMenuID call DisplayListMenuID
jp c, Func_790c jp c, Func_790c
call IsKeyItem call IsKeyItem
@ -118,14 +118,14 @@ Func_79ab: ; 79ab (1:79ab)
cp $ff cp $ff
jp z, Func_79ab jp z, Func_79ab
.asm_79e7 .asm_79e7
ld hl, wNumBoxItems ; wNumBoxItems ld hl, wNumBoxItems
call AddItemToInventory call AddItemToInventory
jr c, .asm_79f8 jr c, .asm_79f8
ld hl, NoRoomToStoreText ld hl, NoRoomToStoreText
call PrintText call PrintText
jp Func_79ab jp Func_79ab
.asm_79f8 .asm_79f8
ld hl, wNumBagItems ; wNumBagItems ld hl, wNumBagItems
call RemoveItemFromInventory call RemoveItemFromInventory
call WaitForSoundToFinish call WaitForSoundToFinish
ld a, (SFX_02_55 - SFX_Headers_02) / 3 ld a, (SFX_02_55 - SFX_Headers_02) / 3
@ -137,9 +137,9 @@ Func_79ab: ; 79ab (1:79ab)
Func_7a12: ; 7a12 (1:7a12) Func_7a12: ; 7a12 (1:7a12)
xor a xor a
ld [wCurrentMenuItem], a ; wCurrentMenuItem ld [wCurrentMenuItem], a
ld [wListScrollOffset], a ; wcc36 ld [wListScrollOffset], a
ld a, [wNumBoxItems] ; wNumBoxItems ld a, [wNumBoxItems]
and a and a
jr nz, Func_7a28 jr nz, Func_7a28
ld hl, NothingStoredText ld hl, NothingStoredText
@ -149,7 +149,7 @@ Func_7a12: ; 7a12 (1:7a12)
Func_7a28: ; 7a28 (1:7a28) Func_7a28: ; 7a28 (1:7a28)
ld hl, WhatToWithdrawText ld hl, WhatToWithdrawText
call PrintText call PrintText
ld hl, wNumBoxItems ; wNumBoxItems ld hl, wNumBoxItems
ld a, l ld a, l
ld [wList], a ld [wList], a
ld a, h ld a, h
@ -157,7 +157,7 @@ Func_7a28: ; 7a28 (1:7a28)
xor a xor a
ld [wcf93], a ld [wcf93], a
ld a, $3 ld a, $3
ld [wListMenuID], a ; wListMenuID ld [wListMenuID], a
call DisplayListMenuID call DisplayListMenuID
jp c, Func_790c jp c, Func_790c
call IsKeyItem call IsKeyItem
@ -172,14 +172,14 @@ Func_7a28: ; 7a28 (1:7a28)
cp $ff cp $ff
jp z, Func_7a28 jp z, Func_7a28
.asm_7a64 .asm_7a64
ld hl, wNumBagItems ; wNumBagItems ld hl, wNumBagItems
call AddItemToInventory call AddItemToInventory
jr c, .asm_7a75 jr c, .asm_7a75
ld hl, CantCarryMoreText ld hl, CantCarryMoreText
call PrintText call PrintText
jp Func_7a28 jp Func_7a28
.asm_7a75 .asm_7a75
ld hl, wNumBoxItems ; wNumBoxItems ld hl, wNumBoxItems
call RemoveItemFromInventory call RemoveItemFromInventory
call WaitForSoundToFinish call WaitForSoundToFinish
ld a, (SFX_02_55 - SFX_Headers_02) / 3 ld a, (SFX_02_55 - SFX_Headers_02) / 3
@ -191,9 +191,9 @@ Func_7a28: ; 7a28 (1:7a28)
Func_7a8f: ; 7a8f (1:7a8f) Func_7a8f: ; 7a8f (1:7a8f)
xor a xor a
ld [wCurrentMenuItem], a ; wCurrentMenuItem ld [wCurrentMenuItem], a
ld [wListScrollOffset], a ; wcc36 ld [wListScrollOffset], a
ld a, [wNumBoxItems] ; wNumBoxItems ld a, [wNumBoxItems]
and a and a
jr nz, Func_7aa5 jr nz, Func_7aa5
ld hl, NothingStoredText ld hl, NothingStoredText
@ -203,7 +203,7 @@ Func_7a8f: ; 7a8f (1:7a8f)
Func_7aa5: ; 7aa5 (1:7aa5) Func_7aa5: ; 7aa5 (1:7aa5)
ld hl, WhatToTossText ld hl, WhatToTossText
call PrintText call PrintText
ld hl, wNumBoxItems ; wNumBoxItems ld hl, wNumBoxItems
ld a, l ld a, l
ld [wList], a ld [wList], a
ld a, h ld a, h
@ -211,7 +211,7 @@ Func_7aa5: ; 7aa5 (1:7aa5)
xor a xor a
ld [wcf93], a ld [wcf93], a
ld a, $3 ld a, $3
ld [wListMenuID], a ; wListMenuID ld [wListMenuID], a
push hl push hl
call DisplayListMenuID call DisplayListMenuID
pop hl pop hl

View file

@ -55,7 +55,7 @@ StatusScreen: ; 12953 (4:6953)
ld de, Type1Text ld de, Type1Text
call PlaceString ; "TYPE1/" call PlaceString ; "TYPE1/"
hlCoord 11, 3 hlCoord 11, 3
predef DrawHP ; predef $5f predef DrawHP
ld hl, wcf25 ld hl, wcf25
call GetHealthBarColor call GetHealthBarColor
ld b, $3 ld b, $3

View file

@ -148,6 +148,6 @@ PredefPointers:: ; 4fe79 (13:7e79)
add_predef PrintMoveType add_predef PrintMoveType
add_predef LoadMovePPs add_predef LoadMovePPs
add_predef DrawHP ; 5F add_predef DrawHP ; 5F
add_predef Func_128f6 add_predef DrawHP2
add_predef Func_1c9c6 add_predef Func_1c9c6
add_predef OaksAideScript add_predef OaksAideScript

View file

@ -6,23 +6,23 @@ Func_1c9c6: ; 1c9c6 (7:49c6)
ld [wList], a ld [wList], a
ld a, h ld a, h
ld [wList + 1], a ld [wList + 1], a
ld a, [wListScrollOffset] ; wcc36 ld a, [wListScrollOffset]
push af push af
xor a xor a
ld [wCurrentMenuItem], a ; wCurrentMenuItem ld [wCurrentMenuItem], a
ld [wListScrollOffset], a ; wcc36 ld [wListScrollOffset], a
ld [wcf93], a ld [wcf93], a
ld a, $4 ld a, $4
ld [wListMenuID], a ; wListMenuID ld [wListMenuID], a
call DisplayListMenuID call DisplayListMenuID
pop bc pop bc
ld a, b ld a, b
ld [wListScrollOffset], a ; wcc36 ld [wListScrollOffset], a
ret c ret c
ld hl, wd126 ld hl, wd126
set 7, [hl] set 7, [hl]
ld hl, wcc5b ld hl, wcc5b
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon]
add a add a
ld d, $0 ld d, $0
ld e, a ld e, a

View file

@ -665,7 +665,7 @@ HallOfFame_Copy: ; 73b51 (1c:7b51)
ld [MBC1SRamEnable], a ld [MBC1SRamEnable], a
ret ret
Func_73b6a: ; 73b6a (1c:7b6a) ClearSAV: ; 73b6a (1c:7b6a)
ld a, SRAM_ENABLE ld a, SRAM_ENABLE
ld [MBC1SRamEnable], a ld [MBC1SRamEnable], a
ld a, $1 ld a, $1

View file

@ -237,14 +237,14 @@ ENDC
call LoadGBPal call LoadGBPal
ld a, [hJoyHeld] ld a, [hJoyHeld]
ld b, a ld b, a
and $46 and D_UP | SELECT | B_BUTTON
cp $46 cp D_UP | SELECT | B_BUTTON
jp z, Func_448e jp z, .doClearSaveDialogue
jp MainMenu jp MainMenu
Func_448e: ; 448e (1:448e) .doClearSaveDialogue
ld b, BANK(Func_1c98a) ld b, BANK(DoClearSaveDialogue)
ld hl, Func_1c98a ld hl, DoClearSaveDialogue
jp Bankswitch jp Bankswitch
Func_4496: ; 4496 (1:4496) Func_4496: ; 4496 (1:4496)

View file

@ -364,10 +364,10 @@ Func_711c4: ; 711c4 (1c:51c4)
jp CopyData jp CopyData
Func_711ef: ; 711ef (1c:51ef) Func_711ef: ; 711ef (1c:51ef)
callba Func_e9cb callba FindWildLocationsOfMon
call Func_712d9 call Func_712d9
ld hl, wOAMBuffer ld hl, wOAMBuffer
ld de, wHPBarMaxHP ld de, wBuffer
.asm_71200 .asm_71200
ld a, [de] ld a, [de]
cp $ff cp $ff

View file

@ -173,7 +173,7 @@ LoadDestinationWarpPosition:: ; 1313 (0:1313)
DrawHPBar:: ; 1336 (0:1336) DrawHPBar:: ; 1336 (0:1336)
; Draw an HP bar d tiles long, and fill it to e pixels. ; Draw an HP bar d tiles long, and fill it to e pixels.
; If c is nonzero, show at least a sliver regardless. ; If c is nonzero, show at least a sliver regardless.
; The right end of the bar changes with [wListMenuID]. ; The right end of the bar changes with [wHPBarType].
push hl push hl
push de push de
@ -195,7 +195,7 @@ DrawHPBar:: ; 1336 (0:1336)
jr nz, .draw jr nz, .draw
; Right ; Right
ld a,[wListMenuID] ld a,[wHPBarType]
dec a dec a
ld a, $6d ; status screen and battle ld a, $6d ; status screen and battle
jr z, .ok jr z, .ok

View file

@ -803,6 +803,12 @@ wWhichPokemon:: ; cf92
wcf93:: ds 1 wcf93:: ds 1
wHPBarType:: ; cf94
; type of HP bar
; $00 = enemy HUD in battle
; $01 = player HUD in battle / status screen
; $02 = party menu
wListMenuID:: ; cf94 wListMenuID:: ; cf94
; ID used by DisplayListMenuID ; ID used by DisplayListMenuID
ds 1 ds 1