Named wram symbols

This commit is contained in:
YamaArashi 2015-02-07 18:37:40 -08:00
parent 4fd7a42b23
commit 32f7cf12de
20 changed files with 132 additions and 136 deletions

View file

@ -26,9 +26,9 @@ Func_128f6: ; 128f6 (4:68f6)
asm_128fb: ; 128fb (4:68fb) asm_128fb: ; 128fb (4:68fb)
ld [wListMenuID], a ld [wListMenuID], a
push hl push hl
ld a, [wcf99] ld a, [wLoadedMonHP]
ld b, a ld b, a
ld a, [wcf9a] ld a, [wLoadedMonHP + 1]
ld c, a ld c, a
or b or b
jr nz, .asm_12913 jr nz, .asm_12913
@ -39,9 +39,9 @@ asm_128fb: ; 128fb (4:68fb)
ld d, a ld d, a
jp DrawHPBarAndFraction jp DrawHPBarAndFraction
.asm_12913 .asm_12913
ld a, [wcfba] ld a, [wLoadedMonMaxHP]
ld d, a ld d, a
ld a, [wcfbb] ld a, [wLoadedMonMaxHP + 1]
ld e, a ld e, a
predef HPBarLength predef HPBarLength
ld a, $6 ld a, $6
@ -64,12 +64,12 @@ DrawHPBarAndFraction: ; 12924 (4:6924)
ld bc, SCREEN_WIDTH + 1 ; below bar ld bc, SCREEN_WIDTH + 1 ; below bar
.printHPFraction .printHPFraction
add hl, bc add hl, bc
ld de, wcf99 ld de, wLoadedMonHP
ld bc, $203 ld bc, $203
call PrintNumber call PrintNumber
ld a, "/" ld a, "/"
ld [hli], a ld [hli], a
ld de, wcfba ld de, wLoadedMonMaxHP
ld bc, $203 ld bc, $203
call PrintNumber call PrintNumber
pop hl pop hl

View file

@ -1899,23 +1899,23 @@ DrawPlayerHUDAndHPBar: ; 3cd60 (f:4d60)
call CenterMonName call CenterMonName
call PlaceString call PlaceString
ld hl, wBattleMonSpecies ld hl, wBattleMonSpecies
ld de, wcf98 ld de, wLoadedMon
ld bc, $c ld bc, $c
call CopyData call CopyData
ld hl, wBattleMonLevel ld hl, wBattleMonLevel
ld de, wcfb9 ld de, wLoadedMonLevel
ld bc, $b ld bc, $b
call CopyData call CopyData
hlCoord 14, 8 hlCoord 14, 8
push hl push hl
inc hl inc hl
ld de, wcf9c ld de, wLoadedMonStatus
call PrintStatusConditionNotFainted call PrintStatusConditionNotFainted
pop hl pop hl
jr nz, .asm_3cdae jr nz, .asm_3cdae
call PrintLevel call PrintLevel
.asm_3cdae .asm_3cdae
ld a, [wcf98] ld a, [wLoadedMonSpecies]
ld [wcf91], a ld [wcf91], a
hlCoord 10, 9 hlCoord 10, 9
predef DrawHP predef DrawHP
@ -1965,7 +1965,7 @@ DrawEnemyHUDAndHPBar: ; 3cdec (f:4dec)
pop hl pop hl
jr nz, .skipPrintLevel ; if the mon has a status condition, skip printing the level jr nz, .skipPrintLevel ; if the mon has a status condition, skip printing the level
ld a, [wEnemyMonLevel] ld a, [wEnemyMonLevel]
ld [wcfb9], a ld [wLoadedMonLevel], a
call PrintLevel call PrintLevel
.skipPrintLevel .skipPrintLevel
ld hl, wEnemyMonHP ld hl, wEnemyMonHP
@ -2270,9 +2270,9 @@ BagWasSelected:
jr nz, DisplayPlayerBag ; no, it is a normal battle jr nz, DisplayPlayerBag ; no, it is a normal battle
ld hl, OldManItemList ld hl, OldManItemList
ld a, l ld a, l
ld [wcf8b], a ld [wList], a
ld a, h ld a, h
ld [wcf8c], a ld [wList + 1], a
jr DisplayBagMenu jr DisplayBagMenu
OldManItemList: OldManItemList:
@ -2284,9 +2284,9 @@ DisplayPlayerBag:
; get the pointer to player's bag when in a normal battle ; get the pointer to player's bag when in a normal battle
ld hl, wNumBagItems ld hl, wNumBagItems
ld a, l ld a, l
ld [wcf8b], a ld [wList], a
ld a, h ld a, h
ld [wcf8c], a ld [wList + 1], a
DisplayBagMenu: DisplayBagMenu:
xor a xor a
@ -4451,7 +4451,7 @@ GetEnemyMonStat: ; 3df1c (f:5f1c)
ld [wd0b5], a ld [wd0b5], a
call GetMonHeader call GetMonHeader
ld hl, wEnemyMonDVs ld hl, wEnemyMonDVs
ld de, wcfaf ld de, wLoadedMonSpeedExp
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
inc de inc de
@ -4459,7 +4459,7 @@ GetEnemyMonStat: ; 3df1c (f:5f1c)
ld [de], a ld [de], a
pop bc pop bc
ld b, $0 ld b, $0
ld hl, wcfa4 ld hl, wLoadedMonSpeedExp - $b ; this base address makes CalcStat look in [wLoadedMonSpeedExp] for DVs
call CalcStat call CalcStat
pop de pop de
ret ret

View file

@ -665,18 +665,18 @@ Func_39bd5: ; 39bd5 (e:5bd5)
.asm_39c18 .asm_39c18
ld [W_LISTTYPE], a ld [W_LISTTYPE], a
ld a, l ld a, l
ld [wcf8b], a ld [wList], a
ld a, h ld a, h
ld [wcf8c], a ld [wList + 1], a
ld a, e ld a, e
ld [wcf8d], a ld [wcf8d], a
ld a, d ld a, d
ld [wcf8e], a ld [wcf8e], a
ld bc, ItemPrices ; $4608 ld bc, ItemPrices
ld a, c ld a, c
ld [wcf8f], a ld [wItemPrices], a
ld a, b ld a, b
ld [wcf90], a ld [wItemPrices + 1], a
ret ret
Func_39c37: ; 39c37 (e:5c37) Func_39c37: ; 39c37 (e:5c37)

View file

@ -578,7 +578,7 @@ TradeCenter_SelectMon:
ReturnToCableClubRoom: ; 577d (1:577d) ReturnToCableClubRoom: ; 577d (1:577d)
call GBPalWhiteOutWithDelay3 call GBPalWhiteOutWithDelay3
ld hl, wcfc4 ld hl, wCharRAMInUseForText
ld a, [hl] ld a, [hl]
push af push af
push hl push hl
@ -808,7 +808,7 @@ TradeCenter_Trade:
ld a, c ld a, c
ld bc, wEnemyMon2 - wEnemyMon1 ld bc, wEnemyMon2 - wEnemyMon1
call AddNTimes call AddNTimes
ld de, wcf98 ld de, wLoadedMon
ld bc, wEnemyMon2 - wEnemyMon1 ld bc, wEnemyMon2 - wEnemyMon1
call CopyData call CopyData
call AddEnemyMonToPlayerParty call AddEnemyMonToPlayerParty

View file

@ -88,7 +88,7 @@ Evolution_PartyMonLoop: ; loop over party mons
jp nz, .nextEvoEntry1 ; if not trading, go to the next evolution entry jp nz, .nextEvoEntry1 ; if not trading, go to the next evolution entry
ld a, [hli] ; level requirement ld a, [hli] ; level requirement
ld b, a ld b, a
ld a, [wcfb9] ld a, [wLoadedMonLevel]
cp b ; is the mon's level greater than the evolution requirement? cp b ; is the mon's level greater than the evolution requirement?
jp c, Evolution_PartyMonLoop ; if so, go the next mon jp c, Evolution_PartyMonLoop ; if so, go the next mon
jr .asm_3adb6 jr .asm_3adb6
@ -101,7 +101,7 @@ Evolution_PartyMonLoop: ; loop over party mons
.checkLevel .checkLevel
ld a, [hli] ; level requirement ld a, [hli] ; level requirement
ld b, a ld b, a
ld a, [wcfb9] ld a, [wLoadedMonLevel]
cp b ; is the mon's level greater than the evolution requirement? cp b ; is the mon's level greater than the evolution requirement?
jp c, .nextEvoEntry2 ; if so, go the next evolution entry jp c, .nextEvoEntry2 ; if so, go the next evolution entry
.asm_3adb6 .asm_3adb6
@ -136,7 +136,7 @@ Evolution_PartyMonLoop: ; loop over party mons
pop hl pop hl
ld a, [hl] ld a, [hl]
ld [wd0b5], a ld [wd0b5], a
ld [wcf98], a ld [wLoadedMonSpecies], a
ld [wHPBarMaxHP + 1], a ld [wHPBarMaxHP + 1], a
ld a, MONSTER_NAME ld a, MONSTER_NAME
ld [W_LISTTYPE], a ld [W_LISTTYPE], a
@ -169,8 +169,8 @@ Evolution_PartyMonLoop: ; loop over party mons
ld [W_MONHDEXNUM], a ld [W_MONHDEXNUM], a
pop af pop af
ld [wd11e], a ld [wd11e], a
ld hl, wcfa8 ld hl, wLoadedMonHPExp - 1
ld de, wcfba ld de, wLoadedMonStats
ld b, $1 ld b, $1
call CalcStats call CalcStats
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
@ -186,14 +186,14 @@ Evolution_PartyMonLoop: ; loop over party mons
ld a, [hli] ld a, [hli]
ld b, a ld b, a
ld c, [hl] ld c, [hl]
ld hl, wcfbb ld hl, wLoadedMonMaxHP + 1
ld a, [hld] ld a, [hld]
sub c sub c
ld c, a ld c, a
ld a, [hl] ld a, [hl]
sbc b sbc b
ld b, a ld b, a
ld hl, wcf9a ld hl, wLoadedMonHP + 1
ld a, [hl] ld a, [hl]
add c add c
ld [hld], a ld [hld], a
@ -226,7 +226,7 @@ Evolution_PartyMonLoop: ; loop over party mons
call Evolution_FlagAction call Evolution_FlagAction
pop de pop de
pop hl pop hl
ld a, [wcf98] ld a, [wLoadedMonSpecies]
ld [hl], a ld [hl], a
push hl push hl
ld l, e ld l, e

View file

@ -1,6 +1,6 @@
; calculates the level a mon should be based on its current exp ; calculates the level a mon should be based on its current exp
CalcLevelFromExperience: ; 58f43 (16:4f43) CalcLevelFromExperience: ; 58f43 (16:4f43)
ld a, [wcf98] ld a, [wLoadedMonSpecies]
ld [wd0b5], a ld [wd0b5], a
call GetMonHeader call GetMonHeader
ld d, $1 ; init level to 1 ld d, $1 ; init level to 1
@ -8,7 +8,7 @@ CalcLevelFromExperience: ; 58f43 (16:4f43)
inc d ; increment level inc d ; increment level
call CalcExperience call CalcExperience
push hl push hl
ld hl, wcfa8 ; current exp ld hl, wLoadedMonExp + 2 ; current exp
; compare exp needed for level d with current exp ; compare exp needed for level d with current exp
ld a, [H_MULTIPLICAND + 2] ld a, [H_MULTIPLICAND + 2]
ld c, a ld c, a

View file

@ -325,9 +325,9 @@ Func_216b3: ; 216b3 (8:56b3)
Func_216be: ; 216be (8:56be) Func_216be: ; 216be (8:56be)
ld a, l ld a, l
ld [wcf8b], a ld [wList], a
ld a, h ld a, h
ld [wcf8c], a ld [wList + 1], a
xor a xor a
ld [wcf93], a ld [wcf93], a
ld [wListMenuID], a ; wListMenuID ld [wListMenuID], a ; wListMenuID

View file

@ -83,7 +83,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
push hl push hl
ld bc,14 ; 14 columns to the right ld bc,14 ; 14 columns to the right
add hl,bc add hl,bc
ld de,wcf9c ld de,wLoadedMonStatus
call PrintStatusCondition call PrintStatusCondition
pop hl pop hl
push hl push hl
@ -134,7 +134,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
push hl push hl
ld hl,EvosMovesPointerTable ld hl,EvosMovesPointerTable
ld b,0 ld b,0
ld a,[wcf98] ; pokemon ID ld a,[wLoadedMonSpecies]
dec a dec a
add a add a
rl b rl b

View file

@ -97,9 +97,9 @@ Func_79ab: ; 79ab (1:79ab)
call PrintText call PrintText
ld hl, wNumBagItems ; wNumBagItems ld hl, wNumBagItems ; wNumBagItems
ld a, l ld a, l
ld [wcf8b], a ld [wList], a
ld a, h ld a, h
ld [wcf8c], a ld [wList + 1], a
xor a xor a
ld [wcf93], a ld [wcf93], a
ld a, $3 ld a, $3
@ -151,9 +151,9 @@ Func_7a28: ; 7a28 (1:7a28)
call PrintText call PrintText
ld hl, wNumBoxItems ; wNumBoxItems ld hl, wNumBoxItems ; wNumBoxItems
ld a, l ld a, l
ld [wcf8b], a ld [wList], a
ld a, h ld a, h
ld [wcf8c], a ld [wList + 1], a
xor a xor a
ld [wcf93], a ld [wcf93], a
ld a, $3 ld a, $3
@ -205,9 +205,9 @@ Func_7aa5: ; 7aa5 (1:7aa5)
call PrintText call PrintText
ld hl, wNumBoxItems ; wNumBoxItems ld hl, wNumBoxItems ; wNumBoxItems
ld a, l ld a, l
ld [wcf8b], a ld [wList], a
ld a, h ld a, h
ld [wcf8c], a ld [wList + 1], a
xor a xor a
ld [wcf93], a ld [wcf93], a
ld a, $3 ld a, $3

View file

@ -308,10 +308,10 @@ StartMenu_Item: ; 13302 (4:7302)
jr .exitMenu jr .exitMenu
.notInCableClubRoom .notInCableClubRoom
ld bc,wNumBagItems ld bc,wNumBagItems
ld hl,wcf8b ld hl,wList
ld a,c ld a,c
ld [hli],a ld [hli],a
ld [hl],b ; store item bag pointer at wcf8b (for DisplayListMenuID) ld [hl],b ; store item bag pointer at wList (for DisplayListMenuID)
xor a xor a
ld [wcf93],a ld [wcf93],a
ld a,ITEMLISTMENU ld a,ITEMLISTMENU

View file

@ -4,11 +4,11 @@ StatusScreen: ; 12953 (4:6953)
ld a, [wcc49] ld a, [wcc49]
cp $2 ; 2 means we're in a PC box cp $2 ; 2 means we're in a PC box
jr c, .DontRecalculate ; 0x1295b $14 jr c, .DontRecalculate ; 0x1295b $14
ld a, [wcf9b] ld a, [wLoadedMonBoxLevel]
ld [wcfb9], a ld [wLoadedMonLevel], a
ld [W_CURENEMYLVL], a ld [W_CURENEMYLVL], a
ld hl, wcfa8 ld hl, wLoadedMonHPExp - 1
ld de, wcfba ld de, wLoadedMonStats
ld b, $1 ld b, $1
call CalcStats ; Recalculate stats call CalcStats ; Recalculate stats
.DontRecalculate .DontRecalculate
@ -61,7 +61,7 @@ StatusScreen: ; 12953 (4:6953)
ld b, $3 ld b, $3
call GoPAL_SET ; SGB palette call GoPAL_SET ; SGB palette
hlCoord 16, 6 hlCoord 16, 6
ld de, wcf9c ld de, wLoadedMonStatus
call PrintStatusCondition call PrintStatusCondition
jr nz, .StatusWritten ; 0x129fc $9 jr nz, .StatusWritten ; 0x129fc $9
hlCoord 16, 6 hlCoord 16, 6
@ -96,7 +96,7 @@ StatusScreen: ; 12953 (4:6953)
hlCoord 12, 16 hlCoord 12, 16
call PlaceString ; OT call PlaceString ; OT
hlCoord 12, 14 hlCoord 12, 14
ld de, wcfa4 ld de, wLoadedMonOTID
ld bc, $8205 ; 5 ld bc, $8205 ; 5
call PrintNumber ; ID Number call PrintNumber ; ID Number
ld d, $0 ld d, $0
@ -203,14 +203,14 @@ PrintStatsBox: ; 12ae4 (4:6ae4)
pop hl pop hl
pop bc pop bc
add hl, bc add hl, bc
ld de, wcfbc ld de, wLoadedMonAttack
ld bc, $0203 ; three digits ld bc, $0203 ; three digits
call PrintStat call PrintStat
ld de, wcfbe ld de, wLoadedMonDefense
call PrintStat call PrintStat
ld de, wcfc0 ld de, wLoadedMonSpeed
call PrintStat call PrintStat
ld de, wcfc2 ld de, wLoadedMonSpecial
jp PrintNumber jp PrintNumber
PrintStat PrintStat
push hl push hl
@ -235,7 +235,7 @@ StatusScreen2: ; 12b57 (4:6b57)
ld bc, $0005 ld bc, $0005
ld hl, wd0dc ld hl, wd0dc
call FillMemory call FillMemory
ld hl, wcfa0 ld hl, wLoadedMonMoves
ld de, wd0dc ld de, wd0dc
ld bc, $0004 ld bc, $0004
call CopyData call CopyData
@ -269,7 +269,7 @@ StatusScreen2: ; 12b57 (4:6b57)
ld a, "-" ld a, "-"
call Func_12ccb ; Fill the rest with -- call Func_12ccb ; Fill the rest with --
.InitPP ; 12bbb .InitPP ; 12bbb
ld hl, wcfa0 ld hl, wLoadedMonMoves
deCoord 14, 10 deCoord 14, 10
ld b, $0 ld b, $0
.PrintPP ; 12bc3 .PrintPP ; 12bc3
@ -323,12 +323,12 @@ StatusScreen2: ; 12b57 (4:6b57)
hlCoord 9, 3 hlCoord 9, 3
ld de, EXPPointsText ld de, EXPPointsText
call PlaceString call PlaceString
ld a, [wcfb9] ; level ld a, [wLoadedMonLevel] ; level
push af push af
cp MAX_LEVEL cp MAX_LEVEL
jr z, .Level100 ; 0x12c20 $4 jr z, .Level100 ; 0x12c20 $4
inc a inc a
ld [wcfb9], a ; Increase temporarily if not 100 ld [wLoadedMonLevel], a ; Increase temporarily if not 100
.Level100 .Level100
hlCoord 14, 6 hlCoord 14, 6
ld [hl], $70 ; 1-tile "to" ld [hl], $70 ; 1-tile "to"
@ -336,13 +336,13 @@ StatusScreen2: ; 12b57 (4:6b57)
inc hl inc hl
call PrintLevel call PrintLevel
pop af pop af
ld [wcfb9], a ld [wLoadedMonLevel], a
ld de, wcfa6 ld de, wLoadedMonExp
hlCoord 12, 4 hlCoord 12, 4
ld bc, $0307 ld bc, $0307
call PrintNumber ; exp call PrintNumber ; exp
call .asm_12c86 call .asm_12c86
ld de, wcfa6 ld de, wLoadedMonExp
hlCoord 7, 6 hlCoord 7, 6
ld bc, $0307 ld bc, $0307
call PrintNumber call PrintNumber
@ -368,13 +368,13 @@ StatusScreen2: ; 12b57 (4:6b57)
call GBPalWhiteOut call GBPalWhiteOut
jp ClearScreen jp ClearScreen
.asm_12c86 ; This does some magic with lvl/exp? .asm_12c86 ; This does some magic with lvl/exp?
ld a, [wcfb9] ; Load level ld a, [wLoadedMonLevel] ; Load level
cp MAX_LEVEL cp MAX_LEVEL
jr z, .asm_12ca7 ; 0x12c8b $1a ; If 100 jr z, .asm_12ca7 ; 0x12c8b $1a ; If 100
inc a inc a
ld d, a ld d, a
callab CalcExperience callab CalcExperience
ld hl, wcfa8 ld hl, wLoadedMonExp + 2
ld a, [$ff98] ld a, [$ff98]
sub [hl] sub [hl]
ld [hld], a ld [hld], a
@ -386,7 +386,7 @@ StatusScreen2: ; 12b57 (4:6b57)
ld [hld], a ld [hld], a
ret ret
.asm_12ca7 .asm_12ca7
ld hl, wcfa6 ld hl, wLoadedMonExp
xor a xor a
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a

View file

@ -159,7 +159,7 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871)
ld l,e ld l,e
pop de pop de
ld b,a ld b,a
ld a,[wcfc4] ld a,[wCharRAMInUseForText]
bit 0,a ; reloading upper half of tile patterns after displaying text? bit 0,a ; reloading upper half of tile patterns after displaying text?
jr nz,.skipFirstLoad ; if so, skip loading data into the lower half jr nz,.skipFirstLoad ; if so, skip loading data into the lower half
ld a,b ld a,b
@ -180,7 +180,7 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871)
jr nc,.noCarry3 jr nc,.noCarry3
inc d inc d
.noCarry3 .noCarry3
ld a,[wcfc4] ld a,[wCharRAMInUseForText]
bit 0,a ; reloading upper half of tile patterns after displaying text? bit 0,a ; reloading upper half of tile patterns after displaying text?
jr nz,.loadWhileLCDOn jr nz,.loadWhileLCDOn
pop af pop af
@ -264,7 +264,7 @@ InitOutsideMapSprites: ; 1797b (5:797b)
cp a,$f0 ; does the map have 2 sprite sets? cp a,$f0 ; does the map have 2 sprite sets?
call nc,GetSplitMapSpriteSetID ; if so, choose the appropriate one call nc,GetSplitMapSpriteSetID ; if so, choose the appropriate one
ld b,a ; b = spriteSetID ld b,a ; b = spriteSetID
ld a,[wcfc4] ld a,[wCharRAMInUseForText]
bit 0,a ; reloading upper half of tile patterns after displaying text? bit 0,a ; reloading upper half of tile patterns after displaying text?
jr nz,.loadSpriteSet ; if so, forcibly reload the sprite set jr nz,.loadSpriteSet ; if so, forcibly reload the sprite set
ld a,[W_SPRITESETID] ld a,[W_SPRITESETID]

View file

@ -52,7 +52,7 @@ UpdatePlayerSprite: ; 4e31 (1:4e31)
jr .asm_4eab jr .asm_4eab
.asm_4e86 .asm_4e86
ld [wSpriteStateData1 + 9], a ld [wSpriteStateData1 + 9], a
ld a, [wcfc4] ld a, [wCharRAMInUseForText]
bit 0, a bit 0, a
jr nz, .asm_4e7d jr nz, .asm_4e7d
.asm_4e90 .asm_4e90
@ -130,7 +130,7 @@ Func_4ed1: ; 4ed1 (1:4ed1)
bit 7, a bit 7, a
jp nz, InitializeSpriteFacingDirection ; c1x1 >= $80 jp nz, InitializeSpriteFacingDirection ; c1x1 >= $80
ld b, a ld b, a
ld a, [wcfc4] ld a, [wCharRAMInUseForText]
bit 0, a bit 0, a
jp nz, notYetMoving jp nz, notYetMoving
ld a, b ld a, b

View file

@ -50,9 +50,9 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
call DisplayTextBoxID ; draw money text box call DisplayTextBoxID ; draw money text box
ld hl,wNumBagItems ld hl,wNumBagItems
ld a,l ld a,l
ld [wcf8b],a ld [wList],a
ld a,h ld a,h
ld [wcf8c],a ld [wList + 1],a
xor a xor a
ld [wcf93],a ld [wcf93],a
ld [wCurrentMenuItem],a ld [wCurrentMenuItem],a
@ -124,9 +124,9 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
call DisplayTextBoxID ; draw money text box call DisplayTextBoxID ; draw money text box
ld hl,wStringBuffer2 + 11 ld hl,wStringBuffer2 + 11
ld a,l ld a,l
ld [wcf8b],a ld [wList],a
ld a,h ld a,h
ld [wcf8c],a ld [wList + 1],a
xor a xor a
ld [wCurrentMenuItem],a ld [wCurrentMenuItem],a
inc a inc a

View file

@ -3,9 +3,9 @@ Func_1c9c6: ; 1c9c6 (7:49c6)
call PrintText call PrintText
ld hl, wStringBuffer2 + 11 ld hl, wStringBuffer2 + 11
ld a, l ld a, l
ld [wcf8b], a ld [wList], a
ld a, h ld a, h
ld [wcf8c], a ld [wList + 1], a
ld a, [wListScrollOffset] ; wcc36 ld a, [wListScrollOffset] ; wcc36
push af push af
xor a xor a

View file

@ -239,7 +239,7 @@ DrawHPBar:: ; 1336 (0:1336)
ret ret
; loads pokemon data from one of multiple sources to wcf98 ; loads pokemon data from one of multiple sources to wLoadedMon
; loads base stats to W_MONHDEXNUM ; loads base stats to W_MONHDEXNUM
; INPUT: ; INPUT:
; [wWhichPokemon] = index of pokemon within party/box ; [wWhichPokemon] = index of pokemon within party/box
@ -250,7 +250,7 @@ DrawHPBar:: ; 1336 (0:1336)
; 03: daycare ; 03: daycare
; OUTPUT: ; OUTPUT:
; [wcf91] = pokemon ID ; [wcf91] = pokemon ID
; wcf98 = base address of pokemon data ; wLoadedMon = base address of pokemon data
; W_MONHDEXNUM = base address of base stats ; W_MONHDEXNUM = base address of base stats
LoadMonData:: ; 1372 (0:1372) LoadMonData:: ; 1372 (0:1372)
ld hl, LoadMonData_ ld hl, LoadMonData_
@ -515,12 +515,12 @@ PrintStatusConditionNotFainted ; 14f6
; function to print pokemon level, leaving off the ":L" if the level is at least 100 ; function to print pokemon level, leaving off the ":L" if the level is at least 100
; INPUT: ; INPUT:
; hl = destination address ; hl = destination address
; [wcfb9] = level ; [wLoadedMonLevel] = level
PrintLevel:: ; 150b (0:150b) PrintLevel:: ; 150b (0:150b)
ld a,$6e ; ":L" tile ID ld a,$6e ; ":L" tile ID
ld [hli],a ld [hli],a
ld c,2 ; number of digits ld c,2 ; number of digits
ld a,[wcfb9] ; level ld a,[wLoadedMonLevel] ; level
cp a,100 cp a,100
jr c,PrintLevelCommon jr c,PrintLevelCommon
; if level at least 100, write over the ":L" tile ; if level at least 100, write over the ":L" tile
@ -531,12 +531,12 @@ PrintLevel:: ; 150b (0:150b)
; prints the level without leaving off ":L" regardless of level ; prints the level without leaving off ":L" regardless of level
; INPUT: ; INPUT:
; hl = destination address ; hl = destination address
; [wcfb9] = level ; [wLoadedMonLevel] = level
PrintLevelFull:: ; 151b (0:151b) PrintLevelFull:: ; 151b (0:151b)
ld a,$6e ; ":L" tile ID ld a,$6e ; ":L" tile ID
ld [hli],a ld [hli],a
ld c,3 ; number of digits ld c,3 ; number of digits
ld a,[wcfb9] ; level ld a,[wLoadedMonLevel] ; level
PrintLevelCommon:: ; 1523 (0:1523) PrintLevelCommon:: ; 1523 (0:1523)
ld [wd11e],a ld [wd11e],a
@ -1183,7 +1183,7 @@ CloseTextDisplay:: ; 29e8 (0:29e8)
ld [H_LOADEDROMBANK],a ld [H_LOADEDROMBANK],a
ld [$2000],a ld [$2000],a
call InitMapSprites ; reload sprite tile pattern data (since it was partially overwritten by text tile patterns) call InitMapSprites ; reload sprite tile pattern data (since it was partially overwritten by text tile patterns)
ld hl,wcfc4 ld hl,wCharRAMInUseForText
res 0,[hl] res 0,[hl]
ld a,[wd732] ld a,[wd732]
bit 3,a ; used fly warp bit 3,a ; used fly warp
@ -1372,7 +1372,7 @@ AddItemToInventory:: ; 2bcf (0:2bcf)
; INPUT: ; INPUT:
; [wListMenuID] = list menu ID ; [wListMenuID] = list menu ID
; [wcf8b] = address of the list (2 bytes) ; [wList] = address of the list (2 bytes)
DisplayListMenuID:: ; 2be6 (0:2be6) DisplayListMenuID:: ; 2be6 (0:2be6)
xor a xor a
ld [H_AUTOBGTRANSFERENABLED],a ; disable auto-transfer ld [H_AUTOBGTRANSFERENABLED],a ; disable auto-transfer
@ -1392,9 +1392,9 @@ DisplayListMenuID:: ; 2be6 (0:2be6)
xor a xor a
ld [wMenuItemToSwap],a ; 0 means no item is currently being swapped ld [wMenuItemToSwap],a ; 0 means no item is currently being swapped
ld [wd12a],a ld [wd12a],a
ld a,[wcf8b] ld a,[wList]
ld l,a ld l,a
ld a,[wcf8c] ld a,[wList + 1]
ld h,a ; hl = address of the list ld h,a ; hl = address of the list
ld a,[hl] ld a,[hl]
ld [wd12a],a ; [wd12a] = number of list entries ld [wd12a],a ; [wd12a] = number of list entries
@ -1485,9 +1485,9 @@ DisplayListMenuIDLoop:: ; 2c53 (0:2c53)
; if it's an item menu ; if it's an item menu
sla c ; item entries are 2 bytes long, so multiply by 2 sla c ; item entries are 2 bytes long, so multiply by 2
.skipMultiplying .skipMultiplying
ld a,[wcf8b] ld a,[wList]
ld l,a ld l,a
ld a,[wcf8c] ld a,[wList + 1]
ld h,a ld h,a
inc hl ; hl = beginning of list entries inc hl ; hl = beginning of list entries
ld b,0 ld b,0
@ -1516,7 +1516,7 @@ DisplayListMenuIDLoop:: ; 2c53 (0:2c53)
jr .storeChosenEntry jr .storeChosenEntry
.pokemonList .pokemonList
ld hl,wPartyCount ld hl,wPartyCount
ld a,[wcf8b] ld a,[wList]
cp l ; is it a list of party pokemon or box pokemon? cp l ; is it a list of party pokemon or box pokemon?
ld hl,wPartyMonNicks ld hl,wPartyMonNicks
jr z,.getPokemonName jr z,.getPokemonName
@ -1707,9 +1707,9 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a)
ld b,$09 ld b,$09
ld c,$0e ld c,$0e
call ClearScreenArea call ClearScreenArea
ld a,[wcf8b] ld a,[wList]
ld e,a ld e,a
ld a,[wcf8c] ld a,[wList + 1]
ld d,a ld d,a
inc de ; de = beginning of list entries inc de ; de = beginning of list entries
ld a,[wListScrollOffset] ld a,[wListScrollOffset]
@ -1753,7 +1753,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a)
.pokemonPCMenu .pokemonPCMenu
push hl push hl
ld hl,wPartyCount ld hl,wPartyCount
ld a,[wcf8b] ld a,[wList]
cp l ; is it a list of party pokemon or box pokemon? cp l ; is it a list of party pokemon or box pokemon?
ld hl,wPartyMonNicks ld hl,wPartyMonNicks
jr z,.getPokemonName jr z,.getPokemonName
@ -1798,7 +1798,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a)
push af push af
push hl push hl
ld hl,wPartyCount ld hl,wPartyCount
ld a,[wcf8b] ld a,[wList]
cp l ; is it a list of party pokemon or box pokemon? cp l ; is it a list of party pokemon or box pokemon?
ld a,$00 ld a,$00
jr z,.next jr z,.next
@ -1819,8 +1819,8 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a)
and a ; is it a list of party pokemon or box pokemon? and a ; is it a list of party pokemon or box pokemon?
jr z,.skipCopyingLevel jr z,.skipCopyingLevel
.copyLevel .copyLevel
ld a,[wcf9b] ld a,[wLoadedMonBoxLevel]
ld [wcfb9],a ld [wLoadedMonLevel],a
.skipCopyingLevel .skipCopyingLevel
pop hl pop hl
ld bc,$001c ld bc,$001c
@ -3335,11 +3335,11 @@ GetName:: ; 376b (0:376b)
ret ret
GetItemPrice:: ; 37df (0:37df) GetItemPrice:: ; 37df (0:37df)
; Stores item's price as BCD in [H_DOWNARROWBLINKCNT1] and [[H_DOWNARROWBLINKCNT2] ; Stores item's price as BCD at hItemPrice (3 bytes)
; Input: [wcf91] = item id ; Input: [wcf91] = item id
ld a, [H_LOADEDROMBANK] ld a, [H_LOADEDROMBANK]
push af push af
ld a, [wListMenuID] ; wListMenuID ld a, [wListMenuID]
cp MOVESLISTMENU cp MOVESLISTMENU
ld a, BANK(ItemPrices) ld a, BANK(ItemPrices)
jr nz, .asm_37ed jr nz, .asm_37ed
@ -3347,7 +3347,7 @@ GetItemPrice:: ; 37df (0:37df)
.asm_37ed .asm_37ed
ld [H_LOADEDROMBANK], a ld [H_LOADEDROMBANK], a
ld [$2000], a ld [$2000], a
ld hl, wcf8f ld hl, wItemPrices
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
@ -3361,11 +3361,11 @@ GetItemPrice:: ; 37df (0:37df)
jr nz, .asm_3802 jr nz, .asm_3802
dec hl dec hl
ld a, [hld] ld a, [hld]
ld [$ff8d], a ld [hItemPrice + 2], a
ld a, [hld] ld a, [hld]
ld [H_DOWNARROWBLINKCNT2], a ; $ff8c ld [hItemPrice + 1], a
ld a, [hl] ld a, [hl]
ld [H_DOWNARROWBLINKCNT1], a ; $ff8b ld [hItemPrice], a
jr .asm_381c jr .asm_381c
.getTMPrice .getTMPrice
ld a, Bank(GetMachinePrice) ld a, Bank(GetMachinePrice)
@ -3373,7 +3373,7 @@ GetItemPrice:: ; 37df (0:37df)
ld [$2000], a ld [$2000], a
call GetMachinePrice call GetMachinePrice
.asm_381c .asm_381c
ld de, H_DOWNARROWBLINKCNT1 ; $ff8b ld de, hItemPrice
pop af pop af
ld [H_LOADEDROMBANK], a ld [H_LOADEDROMBANK], a
ld [$2000], a ld [$2000], a
@ -4540,7 +4540,7 @@ GetHealthBarColor::
; Copy the current map's sprites' tile patterns to VRAM again after they have ; Copy the current map's sprites' tile patterns to VRAM again after they have
; been overwritten by other tile patterns. ; been overwritten by other tile patterns.
ReloadMapSpriteTilePatterns:: ; 3e08 (0:3e08) ReloadMapSpriteTilePatterns:: ; 3e08 (0:3e08)
ld hl, wcfc4 ld hl, wCharRAMInUseForText
ld a, [hl] ld a, [hl]
push af push af
res 0, [hl] res 0, [hl]

View file

@ -12,6 +12,8 @@ hSoftReset EQU $FF8A
hBaseTileID EQU $FF8B hBaseTileID EQU $FF8B
hItemPrice EQU $FF8B
; counters for blinking down arrow ; counters for blinking down arrow
H_DOWNARROWBLINKCNT1 EQU $FF8B H_DOWNARROWBLINKCNT1 EQU $FF8B
H_DOWNARROWBLINKCNT2 EQU $FF8C H_DOWNARROWBLINKCNT2 EQU $FF8C
@ -152,6 +154,7 @@ H_CURRENTSPRITEOFFSET EQU $FFDA ; multiple of $10
H_WHOSETURN EQU $FFF3 ; 0 on players turn, 1 on enemys turn H_WHOSETURN EQU $FFF3 ; 0 on players turn, 1 on enemys turn
; bit 0: draw HP fraction to the right of bar instead of below (for party menu) ; bit 0: draw HP fraction to the right of bar instead of below (for party menu)
; bit 1: menu is double spaced
hFlags_0xFFF6 EQU $FFF6 hFlags_0xFFF6 EQU $FFF6
hJoyInput EQU $FFF8 hJoyInput EQU $FFF8

View file

@ -85,7 +85,7 @@ LoadMonData_:
; 1: enemymon ; 1: enemymon
; 2: boxmon ; 2: boxmon
; 3: daycaremon ; 3: daycaremon
; Return monster id at wcf91 and its data at wcf98. ; Return monster id at wcf91 and its data at wLoadedMon.
; Also load base stats at W_MONHDEXNUM for convenience. ; Also load base stats at W_MONHDEXNUM for convenience.
ld a, [wDayCareMonSpecies] ld a, [wDayCareMonSpecies]
@ -125,7 +125,7 @@ LoadMonData_:
call AddNTimes call AddNTimes
.copyMonData .copyMonData
ld de, wcf98 ld de, wLoadedMon
ld bc, wPartyMon2 - wPartyMon1 ld bc, wPartyMon2 - wPartyMon1
jp CopyData jp CopyData
@ -808,7 +808,7 @@ HandleItemListSwapping: ; 6b44 (1:6b44)
cp a,ITEMLISTMENU cp a,ITEMLISTMENU
jp nz,DisplayListMenuIDLoop ; only rearrange item list menus jp nz,DisplayListMenuIDLoop ; only rearrange item list menus
push hl push hl
ld hl,wcf8b ld hl,wList
ld a,[hli] ld a,[hli]
ld h,[hl] ld h,[hl]
ld l,a ld l,a
@ -854,7 +854,7 @@ HandleItemListSwapping: ; 6b44 (1:6b44)
call DelayFrames call DelayFrames
push hl push hl
push de push de
ld hl,wcf8b ld hl,wList
ld a,[hli] ld a,[hli]
ld h,[hl] ld h,[hl]
ld l,a ld l,a
@ -916,7 +916,7 @@ HandleItemListSwapping: ; 6b44 (1:6b44)
jr .done jr .done
.combineItemSlots .combineItemSlots
ld [hl],a ; put the sum in the second item slot ld [hl],a ; put the sum in the second item slot
ld hl,wcf8b ld hl,wList
ld a,[hli] ld a,[hli]
ld h,[hl] ld h,[hl]
ld l,a ld l,a
@ -1022,7 +1022,7 @@ DisplayTextIDInit: ; 7096 (1:7096)
.drawTextBoxBorder .drawTextBoxBorder
call TextBoxBorder call TextBoxBorder
.skipDrawingTextBoxBorder .skipDrawingTextBoxBorder
ld hl,wcfc4 ld hl,wCharRAMInUseForText
set 0,[hl] set 0,[hl]
ld hl,wFlags_0xcd60 ld hl,wFlags_0xcd60
bit 4,[hl] bit 4,[hl]
@ -3823,8 +3823,8 @@ _AddEnemyMonToPlayerParty: ; f49d (3:749d)
call AddNTimes call AddNTimes
ld e, l ld e, l
ld d, h ld d, h
ld hl, wcf98 ld hl, wLoadedMon
call CopyData ; write new mon's data (from wcf98) call CopyData ; write new mon's data (from wLoadedMon)
ld hl, wPartyMonOT ld hl, wPartyMonOT
ld a, [wPartyCount] ld a, [wPartyCount]
dec a dec a

View file

@ -22,9 +22,9 @@ CeruleanHouse2Text1: ; 74e15 (1d:4e15)
call LoadItemList call LoadItemList
ld hl, wStringBuffer2 + 11 ld hl, wStringBuffer2 + 11
ld a, l ld a, l
ld [wcf8b], a ld [wList], a
ld a, h ld a, h
ld [wcf8c], a ld [wList + 1], a
xor a xor a
ld [wcf93], a ld [wcf93], a
ld [wMenuItemToSwap], a ld [wMenuItemToSwap], a

View file

@ -786,12 +786,15 @@ wStringBuffer2:: ; cf70
wStringBuffer3:: ; cf81 wStringBuffer3:: ; cf81
ds 9 + 1 ds 9 + 1
wcf8b:: ds 1 wList:: ; cf8b
wcf8c:: ds 1 ds 2
wcf8d:: ds 1 wcf8d:: ds 1
wcf8e:: ds 1 wcf8e:: ds 1
wcf8f:: ds 1
wcf90:: ds 1 wItemPrices:: ; cf8f
ds 2
wcf91:: ds 1 wcf91:: ds 1
wWhichPokemon:: ; cf92 wWhichPokemon:: ; cf92
@ -807,25 +810,15 @@ wListMenuID:: ; cf94
wcf95:: ds 1 wcf95:: ds 1
wcf96:: ds 1 wcf96:: ds 1
wcf97:: ds 1 wcf97:: ds 1
wcf98:: ds 1
wcf99:: ds 1
wcf9a:: ds 1
wcf9b:: ds 1
wcf9c:: ds 4
wcfa0:: ds 4
wcfa4:: ds 2
wcfa6:: ds 2
wcfa8:: ds 7
wcfaf:: ds 10
wcfb9:: ds 1
wcfba:: ds 1
wcfbb:: ds 1
wcfbc:: ds 2
wcfbe:: ds 2
wcfc0:: ds 2
wcfc2:: ds 2
wcfc4:: ds 1 ; LoadMonData copies mon data here
wLoadedMon:: party_struct wLoadedMon ; cf98
wCharRAMInUseForText:: ; cfc4
; bit 0: the space in VRAM that is used to store walking tile patterns for
; the player and NPCs is in use for text tile patterns. this means
; that movement must be disabled.
ds 1
wWalkCounter:: ; cfc5 wWalkCounter:: ; cfc5
; walk animation counter ; walk animation counter