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

View file

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

View file

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

View file

@ -578,7 +578,7 @@ TradeCenter_SelectMon:
ReturnToCableClubRoom: ; 577d (1:577d)
call GBPalWhiteOutWithDelay3
ld hl, wcfc4
ld hl, wCharRAMInUseForText
ld a, [hl]
push af
push hl
@ -808,7 +808,7 @@ TradeCenter_Trade:
ld a, c
ld bc, wEnemyMon2 - wEnemyMon1
call AddNTimes
ld de, wcf98
ld de, wLoadedMon
ld bc, wEnemyMon2 - wEnemyMon1
call CopyData
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
ld a, [hli] ; level requirement
ld b, a
ld a, [wcfb9]
ld a, [wLoadedMonLevel]
cp b ; is the mon's level greater than the evolution requirement?
jp c, Evolution_PartyMonLoop ; if so, go the next mon
jr .asm_3adb6
@ -101,7 +101,7 @@ Evolution_PartyMonLoop: ; loop over party mons
.checkLevel
ld a, [hli] ; level requirement
ld b, a
ld a, [wcfb9]
ld a, [wLoadedMonLevel]
cp b ; is the mon's level greater than the evolution requirement?
jp c, .nextEvoEntry2 ; if so, go the next evolution entry
.asm_3adb6
@ -136,7 +136,7 @@ Evolution_PartyMonLoop: ; loop over party mons
pop hl
ld a, [hl]
ld [wd0b5], a
ld [wcf98], a
ld [wLoadedMonSpecies], a
ld [wHPBarMaxHP + 1], a
ld a, MONSTER_NAME
ld [W_LISTTYPE], a
@ -169,8 +169,8 @@ Evolution_PartyMonLoop: ; loop over party mons
ld [W_MONHDEXNUM], a
pop af
ld [wd11e], a
ld hl, wcfa8
ld de, wcfba
ld hl, wLoadedMonHPExp - 1
ld de, wLoadedMonStats
ld b, $1
call CalcStats
ld a, [wWhichPokemon]
@ -186,14 +186,14 @@ Evolution_PartyMonLoop: ; loop over party mons
ld a, [hli]
ld b, a
ld c, [hl]
ld hl, wcfbb
ld hl, wLoadedMonMaxHP + 1
ld a, [hld]
sub c
ld c, a
ld a, [hl]
sbc b
ld b, a
ld hl, wcf9a
ld hl, wLoadedMonHP + 1
ld a, [hl]
add c
ld [hld], a
@ -226,7 +226,7 @@ Evolution_PartyMonLoop: ; loop over party mons
call Evolution_FlagAction
pop de
pop hl
ld a, [wcf98]
ld a, [wLoadedMonSpecies]
ld [hl], a
push hl
ld l, e

View file

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

View file

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

View file

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

View file

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

View file

@ -308,10 +308,10 @@ StartMenu_Item: ; 13302 (4:7302)
jr .exitMenu
.notInCableClubRoom
ld bc,wNumBagItems
ld hl,wcf8b
ld hl,wList
ld a,c
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
ld [wcf93],a
ld a,ITEMLISTMENU

View file

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

View file

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

View file

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

View file

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

View file

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