mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-22 07:02:17 +13:00
misc
This commit is contained in:
parent
b96ef8d2d4
commit
c169073eed
61 changed files with 743 additions and 612 deletions
|
|
@ -10,7 +10,6 @@ HOF_MON EQU $10
|
||||||
HOF_TEAM EQU PARTY_LENGTH * HOF_MON
|
HOF_TEAM EQU PARTY_LENGTH * HOF_MON
|
||||||
HOF_TEAM_CAPACITY EQU 50
|
HOF_TEAM_CAPACITY EQU 50
|
||||||
|
|
||||||
|
|
||||||
A_BUTTON EQU %00000001
|
A_BUTTON EQU %00000001
|
||||||
B_BUTTON EQU %00000010
|
B_BUTTON EQU %00000010
|
||||||
SELECT EQU %00000100
|
SELECT EQU %00000100
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ HallOfFamePC: ; 7405c (1d:405c)
|
||||||
ld c, 128
|
ld c, 128
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
xor a
|
xor a
|
||||||
ld [wWhichTrade], a
|
ld [wNumCreditsMonsDisplayed - 1], a ; not read
|
||||||
ld [wNumCreditsMonsDisplayed], a
|
ld [wNumCreditsMonsDisplayed], a
|
||||||
jp Credits
|
jp Credits
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -796,9 +796,9 @@ DoBallShakeSpecialEffects: ; 78f96 (1e:4f96)
|
||||||
dec a
|
dec a
|
||||||
ret nz
|
ret nz
|
||||||
; if it's the end of the ball shaking subanimation, check if more shakes are left and restart the subanimation
|
; if it's the end of the ball shaking subanimation, check if more shakes are left and restart the subanimation
|
||||||
ld a,[wWhichTrade] ; number of shakes
|
ld a,[wNumShakes] ; number of shakes
|
||||||
dec a ; decrement number of shakes
|
dec a ; decrement number of shakes
|
||||||
ld [wWhichTrade],a
|
ld [wNumShakes],a
|
||||||
ret z
|
ret z
|
||||||
; if there are shakes left, restart the subanimation
|
; if there are shakes left, restart the subanimation
|
||||||
ld a,[W_SUBANIMSUBENTRYADDR]
|
ld a,[W_SUBANIMSUBENTRYADDR]
|
||||||
|
|
@ -1998,11 +1998,11 @@ AnimationWavyScreen: ; 79666 (1e:5666)
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_796ae: ; 796ae (1e:56ae)
|
Func_796ae: ; 796ae (1e:56ae)
|
||||||
ld a, [$ff41]
|
ld a, [rSTAT]
|
||||||
and $3
|
and $3
|
||||||
jr nz, Func_796ae
|
jr nz, Func_796ae
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [$ff43], a
|
ld [rSCX], a
|
||||||
inc hl
|
inc hl
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
cp d
|
cp d
|
||||||
|
|
@ -2895,7 +2895,7 @@ TossBallAnimation: ; 79e16 (1e:5e16)
|
||||||
; store these for later
|
; store these for later
|
||||||
ld a,b
|
ld a,b
|
||||||
and a,$F
|
and a,$F
|
||||||
ld [wWhichTrade],a
|
ld [wNumShakes],a
|
||||||
|
|
||||||
ld hl,.PokeBallAnimations
|
ld hl,.PokeBallAnimations
|
||||||
; choose which toss animation to use
|
; choose which toss animation to use
|
||||||
|
|
|
||||||
|
|
@ -6298,7 +6298,7 @@ LoadEnemyMonData: ; 3eb01 (f:6b01)
|
||||||
dec de
|
dec de
|
||||||
dec de
|
dec de
|
||||||
xor a
|
xor a
|
||||||
ld [wHPBarMaxHP], a
|
ld [wLearningMovesFromDayCare], a
|
||||||
predef WriteMonMoves ; get moves based on current level
|
predef WriteMonMoves ; get moves based on current level
|
||||||
.loadMovePPs
|
.loadMovePPs
|
||||||
ld hl, wEnemyMonMoves
|
ld hl, wEnemyMonMoves
|
||||||
|
|
|
||||||
|
|
@ -254,7 +254,7 @@ GainExperience: ; 5524f (15:524f)
|
||||||
ld a, [wd0b5]
|
ld a, [wd0b5]
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
predef LearnMoveFromLevelUp
|
predef LearnMoveFromLevelUp
|
||||||
ld hl, wccd3
|
ld hl, wCanEvolveFlags
|
||||||
ld a, [wWhichPokemon]
|
ld a, [wWhichPokemon]
|
||||||
ld c, a
|
ld c, a
|
||||||
ld b, $1
|
ld b, $1
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ InitBattleVariables: ; 525af (14:65af)
|
||||||
ld hl, wcf1d
|
ld hl, wcf1d
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld hl, wccd3
|
ld hl, wCanEvolveFlags
|
||||||
ld b, $3c
|
ld b, $3c
|
||||||
.loop
|
.loop
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
|
|
||||||
|
|
@ -297,7 +297,7 @@ CallCurrentTradeCenterFunction:
|
||||||
ld b, 0
|
ld b, 0
|
||||||
ld a, [wTradeCenterPointerTableIndex]
|
ld a, [wTradeCenterPointerTableIndex]
|
||||||
cp $ff
|
cp $ff
|
||||||
jp z, LoadTitlescreenGraphics
|
jp z, DisplayTitleScreen
|
||||||
add a
|
add a
|
||||||
ld c, a
|
ld c, a
|
||||||
add hl, bc
|
add hl, bc
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,11 @@ EvolveMon: ; 7bde9 (1e:7de9)
|
||||||
xor a
|
xor a
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
ld [hTilesetType], a
|
ld [hTilesetType], a
|
||||||
ld a, [wHPBarMaxHP]
|
ld a, [wEvoOldSpecies]
|
||||||
ld [wcf1d], a
|
ld [wcf1d], a
|
||||||
ld c, $0
|
ld c, $0
|
||||||
call EvolutionSetWholeScreenPalette
|
call EvolutionSetWholeScreenPalette
|
||||||
ld a, [wHPBarMaxHP + 1]
|
ld a, [wEvoNewSpecies]
|
||||||
ld [wcf91], a
|
ld [wcf91], a
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
call Evolution_LoadPic
|
call Evolution_LoadPic
|
||||||
|
|
@ -32,13 +32,13 @@ EvolveMon: ; 7bde9 (1e:7de9)
|
||||||
ld hl, vBackPic
|
ld hl, vBackPic
|
||||||
ld bc, 7 * 7
|
ld bc, 7 * 7
|
||||||
call CopyVideoData
|
call CopyVideoData
|
||||||
ld a, [wHPBarMaxHP]
|
ld a, [wEvoOldSpecies]
|
||||||
ld [wcf91], a
|
ld [wcf91], a
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
call Evolution_LoadPic
|
call Evolution_LoadPic
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
ld a, [wHPBarMaxHP]
|
ld a, [wEvoOldSpecies]
|
||||||
call PlayCry
|
call PlayCry
|
||||||
call WaitForSoundToFinish
|
call WaitForSoundToFinish
|
||||||
ld c, BANK(Music_SafariZone)
|
ld c, BANK(Music_SafariZone)
|
||||||
|
|
@ -49,23 +49,23 @@ EvolveMon: ; 7bde9 (1e:7de9)
|
||||||
ld c, $1
|
ld c, $1
|
||||||
call EvolutionSetWholeScreenPalette
|
call EvolutionSetWholeScreenPalette
|
||||||
ld bc, $110
|
ld bc, $110
|
||||||
.asm_7be63
|
.animLoop
|
||||||
push bc
|
push bc
|
||||||
call Evolution_CheckForCancel
|
call Evolution_CheckForCancel
|
||||||
jr c, .evolutionCancelled
|
jr c, .evolutionCancelled
|
||||||
call Func_7bec2
|
call Evolution_BackAndForthAnim
|
||||||
pop bc
|
pop bc
|
||||||
inc b
|
inc b
|
||||||
dec c
|
dec c
|
||||||
dec c
|
dec c
|
||||||
jr nz, .asm_7be63
|
jr nz, .animLoop
|
||||||
xor a
|
xor a
|
||||||
ld [wHPBarOldHP + 1], a
|
ld [wEvoCancelled], a
|
||||||
ld a, $31
|
ld a, $31
|
||||||
ld [wHPBarOldHP], a
|
ld [wEvoMonTileOffset], a
|
||||||
call Func_7bed6
|
call Evolution_ChangeMonPic ; show the new species pic
|
||||||
ld a, [wHPBarMaxHP + 1]
|
ld a, [wEvoNewSpecies]
|
||||||
.afterCancellation
|
.done
|
||||||
ld [wcf1d], a
|
ld [wcf1d], a
|
||||||
ld a, $ff
|
ld a, $ff
|
||||||
ld [wc0ee], a
|
ld [wc0ee], a
|
||||||
|
|
@ -81,17 +81,17 @@ EvolveMon: ; 7bde9 (1e:7de9)
|
||||||
pop bc
|
pop bc
|
||||||
pop de
|
pop de
|
||||||
pop hl
|
pop hl
|
||||||
ld a, [wHPBarOldHP + 1]
|
ld a, [wEvoCancelled]
|
||||||
and a
|
and a
|
||||||
ret z
|
ret z
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
.evolutionCancelled
|
.evolutionCancelled
|
||||||
pop bc
|
pop bc
|
||||||
ld a, $1
|
ld a, 1
|
||||||
ld [wHPBarOldHP + 1], a
|
ld [wEvoCancelled], a
|
||||||
ld a, [wHPBarMaxHP]
|
ld a, [wEvoOldSpecies]
|
||||||
jr .afterCancellation
|
jr .done
|
||||||
|
|
||||||
EvolutionSetWholeScreenPalette: ; 7beb4 (1e:7eb4)
|
EvolutionSetWholeScreenPalette: ; 7beb4 (1e:7eb4)
|
||||||
ld b, $b
|
ld b, $b
|
||||||
|
|
@ -102,37 +102,38 @@ Evolution_LoadPic: ; 7beb9 (1e:7eb9)
|
||||||
coord hl, 7, 2
|
coord hl, 7, 2
|
||||||
jp LoadFlippedFrontSpriteByMonIndex
|
jp LoadFlippedFrontSpriteByMonIndex
|
||||||
|
|
||||||
Func_7bec2: ; 7bec2 (1e:7ec2)
|
Evolution_BackAndForthAnim: ; 7bec2 (1e:7ec2)
|
||||||
|
; show the mon change back and forth between the new and old species b times
|
||||||
ld a, $31
|
ld a, $31
|
||||||
ld [wHPBarOldHP], a
|
ld [wEvoMonTileOffset], a
|
||||||
call Func_7bed6
|
call Evolution_ChangeMonPic
|
||||||
ld a, $cf
|
ld a, -$31
|
||||||
ld [wHPBarOldHP], a
|
ld [wEvoMonTileOffset], a
|
||||||
call Func_7bed6
|
call Evolution_ChangeMonPic
|
||||||
dec b
|
dec b
|
||||||
jr nz, Func_7bec2
|
jr nz, Evolution_BackAndForthAnim
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_7bed6: ; 7bed6 (1e:7ed6)
|
Evolution_ChangeMonPic: ; 7bed6 (1e:7ed6)
|
||||||
push bc
|
push bc
|
||||||
xor a
|
xor a
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
coord hl, 7, 2
|
coord hl, 7, 2
|
||||||
ld bc, $707
|
lb bc, 7, 7
|
||||||
ld de, $d
|
ld de, SCREEN_WIDTH - 7
|
||||||
.asm_7bee3
|
.loop
|
||||||
push bc
|
push bc
|
||||||
.asm_7bee4
|
.innerLoop
|
||||||
ld a, [wHPBarOldHP]
|
ld a, [wEvoMonTileOffset]
|
||||||
add [hl]
|
add [hl]
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
dec c
|
dec c
|
||||||
jr nz, .asm_7bee4
|
jr nz, .innerLoop
|
||||||
pop bc
|
pop bc
|
||||||
add hl, de
|
add hl, de
|
||||||
dec b
|
dec b
|
||||||
jr nz, .asm_7bee3
|
jr nz, .loop
|
||||||
ld a, $1
|
ld a, 1
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
call Delay3
|
call Delay3
|
||||||
pop bc
|
pop bc
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
; try to evolve the mon in [wWhichPokemon]
|
; try to evolve the mon in [wWhichPokemon]
|
||||||
TryEvolvingMon: ; 3ad0e (e:6d0e)
|
TryEvolvingMon: ; 3ad0e (e:6d0e)
|
||||||
ld hl, wccd3
|
ld hl, wCanEvolveFlags
|
||||||
xor a
|
xor a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld a, [wWhichPokemon]
|
ld a, [wWhichPokemon]
|
||||||
|
|
@ -31,17 +31,17 @@ Evolution_PartyMonLoop: ; loop over party mons
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
cp $ff ; have we reached the end of the party?
|
cp $ff ; have we reached the end of the party?
|
||||||
jp z, .done
|
jp z, .done
|
||||||
ld [wHPBarMaxHP], a
|
ld [wEvoOldSpecies], a
|
||||||
push hl
|
push hl
|
||||||
ld a, [wWhichPokemon]
|
ld a, [wWhichPokemon]
|
||||||
ld c, a
|
ld c, a
|
||||||
ld hl, wccd3
|
ld hl, wCanEvolveFlags
|
||||||
ld b, $2
|
ld b, $2
|
||||||
call Evolution_FlagAction
|
call Evolution_FlagAction
|
||||||
ld a, c
|
ld a, c
|
||||||
and a ; is the mon's bit set?
|
and a ; is the mon's bit set?
|
||||||
jp z, Evolution_PartyMonLoop ; if not, go to the next mon
|
jp z, Evolution_PartyMonLoop ; if not, go to the next mon
|
||||||
ld a, [wHPBarMaxHP]
|
ld a, [wEvoOldSpecies]
|
||||||
dec a
|
dec a
|
||||||
ld b, 0
|
ld b, 0
|
||||||
ld hl, EvosMovesPointerTable
|
ld hl, EvosMovesPointerTable
|
||||||
|
|
@ -110,7 +110,7 @@ Evolution_PartyMonLoop: ; loop over party mons
|
||||||
ld [wd121], a
|
ld [wd121], a
|
||||||
push hl
|
push hl
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [wHPBarMaxHP + 1], a
|
ld [wEvoNewSpecies], a
|
||||||
ld a, [wWhichPokemon]
|
ld a, [wWhichPokemon]
|
||||||
ld hl, wPartyMonNicks
|
ld hl, wPartyMonNicks
|
||||||
call GetPartyMonName
|
call GetPartyMonName
|
||||||
|
|
@ -122,7 +122,7 @@ Evolution_PartyMonLoop: ; loop over party mons
|
||||||
xor a
|
xor a
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
coord hl, 0, 0
|
coord hl, 0, 0
|
||||||
ld bc, $c14
|
lb bc, 12, 20
|
||||||
call ClearScreenArea
|
call ClearScreenArea
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
|
|
@ -137,7 +137,7 @@ Evolution_PartyMonLoop: ; loop over party mons
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
ld [wLoadedMonSpecies], a
|
ld [wLoadedMonSpecies], a
|
||||||
ld [wHPBarMaxHP + 1], a
|
ld [wEvoNewSpecies], a
|
||||||
ld a, MONSTER_NAME
|
ld a, MONSTER_NAME
|
||||||
ld [wNameListType], a
|
ld [wNameListType], a
|
||||||
ld a, BANK(TrainerNames) ; bank is not used for monster names
|
ld a, BANK(TrainerNames) ; bank is not used for monster names
|
||||||
|
|
@ -357,7 +357,7 @@ LearnMoveFromLevelUp: ; 3af5b (e:6f5b)
|
||||||
ld bc, wPartyMon2 - wPartyMon1
|
ld bc, wPartyMon2 - wPartyMon1
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
.next
|
.next
|
||||||
ld b, $4
|
ld b, NUM_MOVES
|
||||||
.checkCurrentMovesLoop ; check if the move to learn is already known
|
.checkCurrentMovesLoop ; check if the move to learn is already known
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
cp d
|
cp d
|
||||||
|
|
@ -377,14 +377,13 @@ LearnMoveFromLevelUp: ; 3af5b (e:6f5b)
|
||||||
|
|
||||||
; writes the moves a mon has at level [W_CURENEMYLVL] to [de]
|
; writes the moves a mon has at level [W_CURENEMYLVL] to [de]
|
||||||
; move slots are being filled up sequentially and shifted if all slots are full
|
; move slots are being filled up sequentially and shifted if all slots are full
|
||||||
; [wHPBarMaxHP]: (?)
|
|
||||||
WriteMonMoves: ; 3afb8 (e:6fb8)
|
WriteMonMoves: ; 3afb8 (e:6fb8)
|
||||||
call GetPredefRegisters
|
call GetPredefRegisters
|
||||||
push hl
|
push hl
|
||||||
push de
|
push de
|
||||||
push bc
|
push bc
|
||||||
ld hl, EvosMovesPointerTable
|
ld hl, EvosMovesPointerTable
|
||||||
ld b, $0
|
ld b, 0
|
||||||
ld a, [wcf91] ; cur mon ID
|
ld a, [wcf91] ; cur mon ID
|
||||||
dec a
|
dec a
|
||||||
add a
|
add a
|
||||||
|
|
@ -411,25 +410,30 @@ WriteMonMoves: ; 3afb8 (e:6fb8)
|
||||||
ld a, [W_CURENEMYLVL]
|
ld a, [W_CURENEMYLVL]
|
||||||
cp b
|
cp b
|
||||||
jp c, .done ; mon level < move level (assumption: learnset is sorted by level)
|
jp c, .done ; mon level < move level (assumption: learnset is sorted by level)
|
||||||
ld a, [wHPBarMaxHP]
|
ld a, [wLearningMovesFromDayCare]
|
||||||
and a
|
and a
|
||||||
jr z, .skipMinLevelCheck
|
jr z, .skipMinLevelCheck
|
||||||
ld a, [wWhichTrade] ; min move level)
|
ld a, [wDayCareStartLevel]
|
||||||
cp b
|
cp b
|
||||||
jr nc, .nextMove2 ; min level >= move level
|
jr nc, .nextMove2 ; min level >= move level
|
||||||
|
|
||||||
.skipMinLevelCheck
|
.skipMinLevelCheck
|
||||||
|
|
||||||
|
; check if the move is already known
|
||||||
push de
|
push de
|
||||||
ld c, $4
|
ld c, NUM_MOVES
|
||||||
.moveAlreadyLearnedCheckLoop
|
.alreadyKnowsCheckLoop
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
inc de
|
inc de
|
||||||
cp [hl]
|
cp [hl]
|
||||||
jr z, .nextMove
|
jr z, .nextMove
|
||||||
dec c
|
dec c
|
||||||
jr nz, .moveAlreadyLearnedCheckLoop
|
jr nz, .alreadyKnowsCheckLoop
|
||||||
|
|
||||||
|
; try to find an empty move slot
|
||||||
pop de
|
pop de
|
||||||
push de
|
push de
|
||||||
ld c, $4
|
ld c, NUM_MOVES
|
||||||
.findEmptySlotLoop
|
.findEmptySlotLoop
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
and a
|
and a
|
||||||
|
|
@ -437,47 +441,55 @@ WriteMonMoves: ; 3afb8 (e:6fb8)
|
||||||
inc de
|
inc de
|
||||||
dec c
|
dec c
|
||||||
jr nz, .findEmptySlotLoop
|
jr nz, .findEmptySlotLoop
|
||||||
pop de ; no empty move slots found
|
|
||||||
|
; no empty move slots found
|
||||||
|
pop de
|
||||||
push de
|
push de
|
||||||
push hl
|
push hl
|
||||||
ld h, d
|
ld h, d
|
||||||
ld l, e
|
ld l, e
|
||||||
call WriteMonMoves_ShiftMoveData ; shift all moves one up (deleting move 1)
|
call WriteMonMoves_ShiftMoveData ; shift all moves one up (deleting move 1)
|
||||||
ld a, [wHPBarMaxHP]
|
ld a, [wLearningMovesFromDayCare]
|
||||||
and a
|
and a
|
||||||
jr z, .writeMoveToSlot
|
jr z, .writeMoveToSlot
|
||||||
|
|
||||||
|
; shift PP as well if learning moves from day care
|
||||||
push de
|
push de
|
||||||
ld bc, $12
|
ld bc, wPartyMon1PP - (wPartyMon1Moves + 3)
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld d, h
|
ld d, h
|
||||||
ld e, l
|
ld e, l
|
||||||
call WriteMonMoves_ShiftMoveData ; shift all move PP data one up
|
call WriteMonMoves_ShiftMoveData ; shift all move PP data one up
|
||||||
pop de
|
pop de
|
||||||
|
|
||||||
.writeMoveToSlot
|
.writeMoveToSlot
|
||||||
pop hl
|
pop hl
|
||||||
.writeMoveToSlot2
|
.writeMoveToSlot2
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [de], a
|
ld [de], a
|
||||||
ld a, [wHPBarMaxHP]
|
ld a, [wLearningMovesFromDayCare]
|
||||||
and a
|
and a
|
||||||
jr z, .nextMove
|
jr z, .nextMove
|
||||||
push hl ; write move PP value
|
|
||||||
|
; write move PP value if learning moves from day care
|
||||||
|
push hl
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld hl, $15
|
ld hl, wPartyMon1PP - wPartyMon1Moves
|
||||||
add hl, de
|
add hl, de
|
||||||
push hl
|
push hl
|
||||||
dec a
|
dec a
|
||||||
ld hl, Moves
|
ld hl, Moves
|
||||||
ld bc, $6
|
ld bc, 6
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
ld de, wHPBarMaxHP
|
ld de, wBuffer
|
||||||
ld a, BANK(Moves)
|
ld a, BANK(Moves)
|
||||||
call FarCopyData
|
call FarCopyData
|
||||||
ld a, [wHPBarNewHP + 1]
|
ld a, [wBuffer + 5]
|
||||||
pop hl
|
pop hl
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
pop hl
|
pop hl
|
||||||
jr .nextMove
|
jr .nextMove
|
||||||
|
|
||||||
.done
|
.done
|
||||||
pop bc
|
pop bc
|
||||||
pop de
|
pop de
|
||||||
|
|
@ -486,13 +498,13 @@ WriteMonMoves: ; 3afb8 (e:6fb8)
|
||||||
|
|
||||||
; shifts all move data one up (freeing 4th move slot)
|
; shifts all move data one up (freeing 4th move slot)
|
||||||
WriteMonMoves_ShiftMoveData: ; 3b04e (e:704e)
|
WriteMonMoves_ShiftMoveData: ; 3b04e (e:704e)
|
||||||
ld c, $3
|
ld c, NUM_MOVES - 1
|
||||||
.asm_3b050
|
.loop
|
||||||
inc de
|
inc de
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
dec c
|
dec c
|
||||||
jr nz, .asm_3b050
|
jr nz, .loop
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Evolution_FlagAction: ; 3b057 (e:7057)
|
Evolution_FlagAction: ; 3b057 (e:7057)
|
||||||
|
|
|
||||||
|
|
@ -10,15 +10,15 @@ CalcLevelFromExperience: ; 58f43 (16:4f43)
|
||||||
push hl
|
push hl
|
||||||
ld hl, wLoadedMonExp + 2 ; 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, [hExperience + 2]
|
||||||
ld c, a
|
ld c, a
|
||||||
ld a, [hld]
|
ld a, [hld]
|
||||||
sub c
|
sub c
|
||||||
ld a, [H_MULTIPLICAND + 1]
|
ld a, [hExperience + 1]
|
||||||
ld c, a
|
ld c, a
|
||||||
ld a, [hld]
|
ld a, [hld]
|
||||||
sbc c
|
sbc c
|
||||||
ld a, [H_MULTIPLICAND]
|
ld a, [hExperience]
|
||||||
ld c, a
|
ld c, a
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
sbc c
|
sbc c
|
||||||
|
|
@ -33,7 +33,7 @@ CalcExperience: ; 58f6a (16:4f6a)
|
||||||
add a
|
add a
|
||||||
add a
|
add a
|
||||||
ld c, a
|
ld c, a
|
||||||
ld b, $0
|
ld b, 0
|
||||||
ld hl, GrowthRateTable
|
ld hl, GrowthRateTable
|
||||||
add hl, bc
|
add hl, bc
|
||||||
call CalcDSquared
|
call CalcDSquared
|
||||||
|
|
@ -50,96 +50,100 @@ CalcExperience: ; 58f6a (16:4f6a)
|
||||||
ld [H_DIVISOR], a
|
ld [H_DIVISOR], a
|
||||||
ld b, $4
|
ld b, $4
|
||||||
call Divide
|
call Divide
|
||||||
ld a, [H_MULTIPLICAND] ; (aliases: H_NUMTOPRINT)
|
ld a, [H_QUOTIENT + 1]
|
||||||
push af
|
push af
|
||||||
ld a, [H_MULTIPLICAND+1]
|
ld a, [H_QUOTIENT + 2]
|
||||||
push af
|
push af
|
||||||
ld a, [H_MULTIPLICAND+2]
|
ld a, [H_QUOTIENT + 3]
|
||||||
push af
|
push af
|
||||||
call CalcDSquared
|
call CalcDSquared
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
and $7f
|
and $7f
|
||||||
ld [H_MULTIPLIER], a
|
ld [H_MULTIPLIER], a
|
||||||
call Multiply
|
call Multiply
|
||||||
ld a, [H_MULTIPLICAND] ; (aliases: H_NUMTOPRINT)
|
ld a, [H_PRODUCT + 1]
|
||||||
push af
|
push af
|
||||||
ld a, [H_MULTIPLICAND+1]
|
ld a, [H_PRODUCT + 2]
|
||||||
push af
|
push af
|
||||||
ld a, [H_MULTIPLICAND+2]
|
ld a, [H_PRODUCT + 3]
|
||||||
push af
|
push af
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
ld [H_MULTIPLICAND], a
|
ld [H_MULTIPLICAND], a
|
||||||
ld [H_MULTIPLICAND+1], a
|
ld [H_MULTIPLICAND + 1], a
|
||||||
ld a, d
|
ld a, d
|
||||||
ld [H_MULTIPLICAND+2], a
|
ld [H_MULTIPLICAND + 2], a
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld [H_MULTIPLIER], a
|
ld [H_MULTIPLIER], a
|
||||||
call Multiply
|
call Multiply
|
||||||
ld b, [hl]
|
ld b, [hl]
|
||||||
ld a, [H_MULTIPLICAND+2]
|
ld a, [H_PRODUCT + 3]
|
||||||
sub b
|
sub b
|
||||||
ld [H_MULTIPLICAND+2], a
|
ld [H_PRODUCT + 3], a
|
||||||
ld b, $0
|
ld b, $0
|
||||||
ld a, [H_MULTIPLICAND+1]
|
ld a, [H_PRODUCT + 2]
|
||||||
sbc b
|
sbc b
|
||||||
ld [H_MULTIPLICAND+1], a
|
ld [H_PRODUCT + 2], a
|
||||||
ld a, [H_MULTIPLICAND]
|
ld a, [H_PRODUCT + 1]
|
||||||
sbc b
|
sbc b
|
||||||
ld [H_MULTIPLICAND], a
|
ld [H_PRODUCT + 1], a
|
||||||
|
; The difference of the linear term and the constant term consists of 3 bytes
|
||||||
|
; starting at H_PRODUCT + 1. Below, hExperience (an alias of that address) will
|
||||||
|
; be used instead for the further work of adding or subtracting the squared
|
||||||
|
; term and adding the cubed term.
|
||||||
pop af
|
pop af
|
||||||
and $80
|
and $80
|
||||||
jr nz, .subtractSquaredTerm ; check sign
|
jr nz, .subtractSquaredTerm ; check sign
|
||||||
pop bc
|
pop bc
|
||||||
ld a, [H_MULTIPLICAND+2]
|
ld a, [hExperience + 2]
|
||||||
add b
|
add b
|
||||||
ld [H_MULTIPLICAND+2], a
|
ld [hExperience + 2], a
|
||||||
pop bc
|
pop bc
|
||||||
ld a, [H_MULTIPLICAND+1]
|
ld a, [hExperience + 1]
|
||||||
adc b
|
adc b
|
||||||
ld [H_MULTIPLICAND+1], a
|
ld [hExperience + 1], a
|
||||||
pop bc
|
pop bc
|
||||||
ld a, [H_MULTIPLICAND]
|
ld a, [hExperience]
|
||||||
adc b
|
adc b
|
||||||
ld [H_MULTIPLICAND], a
|
ld [hExperience], a
|
||||||
jr .addCubedTerm
|
jr .addCubedTerm
|
||||||
.subtractSquaredTerm
|
.subtractSquaredTerm
|
||||||
pop bc
|
pop bc
|
||||||
ld a, [H_MULTIPLICAND+2]
|
ld a, [hExperience + 2]
|
||||||
sub b
|
sub b
|
||||||
ld [H_MULTIPLICAND+2], a
|
ld [hExperience + 2], a
|
||||||
pop bc
|
pop bc
|
||||||
ld a, [H_MULTIPLICAND+1]
|
ld a, [hExperience + 1]
|
||||||
sbc b
|
sbc b
|
||||||
ld [H_MULTIPLICAND+1], a
|
ld [hExperience + 1], a
|
||||||
pop bc
|
pop bc
|
||||||
ld a, [H_MULTIPLICAND]
|
ld a, [hExperience]
|
||||||
sbc b
|
sbc b
|
||||||
ld [H_MULTIPLICAND], a
|
ld [hExperience], a
|
||||||
.addCubedTerm
|
.addCubedTerm
|
||||||
pop bc
|
pop bc
|
||||||
ld a, [H_MULTIPLICAND+2]
|
ld a, [hExperience + 2]
|
||||||
add b
|
add b
|
||||||
ld [H_MULTIPLICAND+2], a
|
ld [hExperience + 2], a
|
||||||
pop bc
|
pop bc
|
||||||
ld a, [H_MULTIPLICAND+1]
|
ld a, [hExperience + 1]
|
||||||
adc b
|
adc b
|
||||||
ld [H_MULTIPLICAND+1], a
|
ld [hExperience + 1], a
|
||||||
pop bc
|
pop bc
|
||||||
ld a, [H_MULTIPLICAND]
|
ld a, [hExperience]
|
||||||
adc b
|
adc b
|
||||||
ld [H_MULTIPLICAND], a
|
ld [hExperience], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; calculates d*d
|
; calculates d*d
|
||||||
CalcDSquared: ; 59010 (16:5010)
|
CalcDSquared: ; 59010 (16:5010)
|
||||||
xor a
|
xor a
|
||||||
ld [H_MULTIPLICAND], a ; (aliases: H_NUMTOPRINT)
|
ld [H_MULTIPLICAND], a
|
||||||
ld [H_MULTIPLICAND+1], a
|
ld [H_MULTIPLICAND + 1], a
|
||||||
ld a, d
|
ld a, d
|
||||||
ld [H_MULTIPLICAND+2], a
|
ld [H_MULTIPLICAND + 2], a
|
||||||
ld [H_MULTIPLIER], a ; (aliases: H_DIVISOR, H_REMAINDER, H_POWEROFTEN)
|
ld [H_MULTIPLIER], a
|
||||||
jp Multiply
|
jp Multiply
|
||||||
|
|
||||||
; each entry has the following scheme:
|
; each entry has the following scheme:
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ StartSlotMachine: ; 37e2d (d:7e2d)
|
||||||
cp $ff
|
cp $ff
|
||||||
jr z, .printSomeonesKeys
|
jr z, .printSomeonesKeys
|
||||||
callba AbleToPlaySlotsCheck
|
callba AbleToPlaySlotsCheck
|
||||||
ld a, [wHiddenObjectFunctionArgument]
|
ld a, [wCanPlaySlots]
|
||||||
and a
|
and a
|
||||||
ret z
|
ret z
|
||||||
ld a, [wLuckySlotHiddenObjectIndex]
|
ld a, [wLuckySlotHiddenObjectIndex]
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
AbleToPlaySlotsCheck ; 2ff09 (b:7f09)
|
AbleToPlaySlotsCheck: ; 2ff09 (b:7f09)
|
||||||
ld a, [wSpriteStateData1 + 2]
|
ld a, [wSpriteStateData1 + 2]
|
||||||
and $8
|
and $8
|
||||||
jr z, .done ; not able
|
jr z, .done ; not able
|
||||||
|
|
@ -19,7 +19,7 @@ AbleToPlaySlotsCheck ; 2ff09 (b:7f09)
|
||||||
call PrintPredefTextID
|
call PrintPredefTextID
|
||||||
xor a
|
xor a
|
||||||
.done
|
.done
|
||||||
ld [wWhichTrade], a
|
ld [wCanPlaySlots], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
GameCornerCoinCaseText: ; 2ff32 (b:7f32)
|
GameCornerCoinCaseText: ; 2ff32 (b:7f32)
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,16 @@
|
||||||
_GivePokemon: ; 4fda5 (13:7da5)
|
_GivePokemon: ; 4fda5 (13:7da5)
|
||||||
|
; returns success in carry
|
||||||
|
; and whether the mon was added to the party in [wAddedToParty]
|
||||||
call EnableAutoTextBoxDrawing
|
call EnableAutoTextBoxDrawing
|
||||||
xor a
|
xor a
|
||||||
ld [wccd3], a
|
ld [wAddedToParty], a
|
||||||
ld a, [wPartyCount]
|
ld a, [wPartyCount]
|
||||||
cp PARTY_LENGTH
|
cp PARTY_LENGTH
|
||||||
jr c, .asm_4fe01
|
jr c, .addToParty
|
||||||
ld a, [W_NUMINBOX]
|
ld a, [W_NUMINBOX]
|
||||||
cp MONS_PER_BOX
|
cp MONS_PER_BOX
|
||||||
jr nc, .asm_4fdf9
|
jr nc, .boxFull
|
||||||
|
; add to box
|
||||||
xor a
|
xor a
|
||||||
ld [W_ENEMYBATTSTATUS3], a
|
ld [W_ENEMYBATTSTATUS3], a
|
||||||
ld a, [wcf91]
|
ld a, [wcf91]
|
||||||
|
|
@ -19,32 +22,32 @@ _GivePokemon: ; 4fda5 (13:7da5)
|
||||||
ld a, [wCurrentBoxNum]
|
ld a, [wCurrentBoxNum]
|
||||||
and $7f
|
and $7f
|
||||||
cp 9
|
cp 9
|
||||||
jr c, .asm_4fdec
|
jr c, .singleDigitBoxNum
|
||||||
sub 9
|
sub 9
|
||||||
ld [hl], "1"
|
ld [hl], "1"
|
||||||
inc hl
|
inc hl
|
||||||
add "0"
|
add "0"
|
||||||
jr .asm_4fdee
|
jr .next
|
||||||
.asm_4fdec
|
.singleDigitBoxNum
|
||||||
add "1"
|
add "1"
|
||||||
.asm_4fdee
|
.next
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], "@"
|
ld [hl], "@"
|
||||||
ld hl, SetToBoxText
|
ld hl, SetToBoxText
|
||||||
call PrintText
|
call PrintText
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
.asm_4fdf9
|
.boxFull
|
||||||
ld hl, BoxIsFullText
|
ld hl, BoxIsFullText
|
||||||
call PrintText
|
call PrintText
|
||||||
and a
|
and a
|
||||||
ret
|
ret
|
||||||
.asm_4fe01
|
.addToParty
|
||||||
call SetPokedexOwnedFlag
|
call SetPokedexOwnedFlag
|
||||||
call AddPartyMon
|
call AddPartyMon
|
||||||
ld a, $1
|
ld a, 1
|
||||||
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
||||||
ld [wccd3], a
|
ld [wAddedToParty], a
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ KabutopsFossilText: ; 5dbd4 (17:5bd4)
|
||||||
DisplayMonFrontSpriteInBox: ; 5dbd9 (17:5bd9)
|
DisplayMonFrontSpriteInBox: ; 5dbd9 (17:5bd9)
|
||||||
; Displays a pokemon's front sprite in a pop-up window.
|
; Displays a pokemon's front sprite in a pop-up window.
|
||||||
; [wcf91] = pokemon interal id number
|
; [wcf91] = pokemon interal id number
|
||||||
ld a, $1
|
ld a, 1
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
call Delay3
|
call Delay3
|
||||||
xor a
|
xor a
|
||||||
|
|
@ -85,7 +85,7 @@ PrintBlackboardLinkCableText: ; 5dc1a (17:5c1a)
|
||||||
call EnableAutoTextBoxDrawing
|
call EnableAutoTextBoxDrawing
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
||||||
ld a, [wWhichTrade]
|
ld a, [wHiddenObjectFunctionArgument]
|
||||||
call PrintPredefTextID
|
call PrintPredefTextID
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
@ -310,7 +310,7 @@ VermilionGymTrashText: ; 5ddf7 (17:5df7)
|
||||||
|
|
||||||
GymTrashScript: ; 5ddfc (17:5dfc)
|
GymTrashScript: ; 5ddfc (17:5dfc)
|
||||||
call EnableAutoTextBoxDrawing
|
call EnableAutoTextBoxDrawing
|
||||||
ld a, [wWhichTrade]
|
ld a, [wHiddenObjectFunctionArgument]
|
||||||
ld [wcd5b], a
|
ld [wcd5b], a
|
||||||
|
|
||||||
; Don't do the trash can puzzle if it's already been done.
|
; Don't do the trash can puzzle if it's already been done.
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ CinnabarGymQuiz: ; 1ea25 (7:6a25)
|
||||||
TX_ASM
|
TX_ASM
|
||||||
xor a
|
xor a
|
||||||
ld [wda38], a
|
ld [wda38], a
|
||||||
ld a, [wWhichTrade]
|
ld a, [wHiddenObjectFunctionArgument]
|
||||||
push af
|
push af
|
||||||
and $f
|
and $f
|
||||||
ld [$ffdb], a
|
ld [$ffdb], a
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
HiddenItemNear: ; 7481f (1d:481f)
|
HiddenItemNear: ; 7481f (1d:481f)
|
||||||
ld hl, HiddenItemCoords
|
ld hl, HiddenItemCoords
|
||||||
ld b, $0
|
ld b, 0
|
||||||
.asm_74824
|
.loop
|
||||||
ld de, $0003
|
ld de, 3
|
||||||
ld a, [W_CURMAP]
|
ld a, [W_CURMAP]
|
||||||
call IsInRestOfArray
|
call IsInRestOfArray
|
||||||
ret nc ; return if current map has no hidden items
|
ret nc ; return if current map has no hidden items
|
||||||
push bc
|
push bc
|
||||||
push hl
|
push hl
|
||||||
ld hl, wd6f0
|
ld hl, wObtainedHiddenItemsFlags
|
||||||
ld c, b
|
ld c, b
|
||||||
ld b, $2
|
ld b, $2
|
||||||
predef FlagActionPredef
|
predef FlagActionPredef
|
||||||
|
|
@ -22,28 +22,30 @@ HiddenItemNear: ; 7481f (1d:481f)
|
||||||
inc hl
|
inc hl
|
||||||
ld e, [hl]
|
ld e, [hl]
|
||||||
inc hl
|
inc hl
|
||||||
jr nz, .asm_74824
|
jr nz, .loop ; if the item has already been obtained
|
||||||
|
; check if the item is within 4-5 tiles (depending on the direction of item)
|
||||||
ld a, [W_YCOORD]
|
ld a, [W_YCOORD]
|
||||||
call Func_7486b
|
call Sub5ClampTo0
|
||||||
cp d
|
cp d
|
||||||
jr nc, .asm_74824
|
jr nc, .loop
|
||||||
ld a, [W_YCOORD]
|
ld a, [W_YCOORD]
|
||||||
add $4
|
add 4
|
||||||
cp d
|
cp d
|
||||||
jr c, .asm_74824
|
jr c, .loop
|
||||||
ld a, [W_XCOORD]
|
ld a, [W_XCOORD]
|
||||||
call Func_7486b
|
call Sub5ClampTo0
|
||||||
cp e
|
cp e
|
||||||
jr nc, .asm_74824
|
jr nc, .loop
|
||||||
ld a, [W_XCOORD]
|
ld a, [W_XCOORD]
|
||||||
add $5
|
add 5
|
||||||
cp e
|
cp e
|
||||||
jr c, .asm_74824
|
jr c, .loop
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_7486b: ; 7486b (1d:486b)
|
Sub5ClampTo0: ; 7486b (1d:486b)
|
||||||
sub $5
|
; subtract 5 but clamp to 0
|
||||||
|
sub 5
|
||||||
cp $f0
|
cp $f0
|
||||||
ret c
|
ret c
|
||||||
xor a
|
xor a
|
||||||
|
|
|
||||||
|
|
@ -1216,11 +1216,11 @@ ItemUseMedicine: ; dabb (3:5abb)
|
||||||
ld bc,-19
|
ld bc,-19
|
||||||
add hl,bc ; hl now points to experience
|
add hl,bc ; hl now points to experience
|
||||||
; update experience to minimum for new level
|
; update experience to minimum for new level
|
||||||
ld a,[$ff96]
|
ld a,[hExperience]
|
||||||
ld [hli],a
|
ld [hli],a
|
||||||
ld a,[$ff97]
|
ld a,[hExperience + 1]
|
||||||
ld [hli],a
|
ld [hli],a
|
||||||
ld a,[$ff98]
|
ld a,[hExperience + 2]
|
||||||
ld [hl],a
|
ld [hl],a
|
||||||
pop hl
|
pop hl
|
||||||
ld a,[wWhichPokemon]
|
ld a,[wWhichPokemon]
|
||||||
|
|
@ -1618,8 +1618,8 @@ ItemUsePokeflute: ; e140 (3:6140)
|
||||||
jp PrintText
|
jp PrintText
|
||||||
.inBattle
|
.inBattle
|
||||||
xor a
|
xor a
|
||||||
ld [wWhichTrade],a ; initialize variable that indicates if any pokemon were woken up to zero
|
ld [wWereAnyMonsAsleep],a
|
||||||
ld b,~SLP & $FF
|
ld b,~SLP & $ff
|
||||||
ld hl,wPartyMon1Status
|
ld hl,wPartyMon1Status
|
||||||
call WakeUpEntireParty
|
call WakeUpEntireParty
|
||||||
ld a,[W_ISINBATTLE]
|
ld a,[W_ISINBATTLE]
|
||||||
|
|
@ -1638,7 +1638,7 @@ ItemUsePokeflute: ; e140 (3:6140)
|
||||||
and b ; remove Sleep status
|
and b ; remove Sleep status
|
||||||
ld [hl],a
|
ld [hl],a
|
||||||
call LoadScreenTilesFromBuffer2 ; restore saved screen
|
call LoadScreenTilesFromBuffer2 ; restore saved screen
|
||||||
ld a,[wWhichTrade]
|
ld a,[wWereAnyMonsAsleep]
|
||||||
and a ; were any pokemon asleep before playing the flute?
|
and a ; were any pokemon asleep before playing the flute?
|
||||||
ld hl,PlayedFluteNoEffectText
|
ld hl,PlayedFluteNoEffectText
|
||||||
jp z,PrintText ; if no pokemon were asleep
|
jp z,PrintText ; if no pokemon were asleep
|
||||||
|
|
@ -1662,9 +1662,9 @@ ItemUsePokeflute: ; e140 (3:6140)
|
||||||
; INPUT:
|
; INPUT:
|
||||||
; hl must point to status of first pokemon in party (player's or enemy's)
|
; hl must point to status of first pokemon in party (player's or enemy's)
|
||||||
; b must equal ~SLP
|
; b must equal ~SLP
|
||||||
; [wWhichTrade] should be initialized to 0
|
; [wWereAnyMonsAsleep] should be initialized to 0
|
||||||
; OUTPUT:
|
; OUTPUT:
|
||||||
; [wWhichTrade]: set to 1 if any pokemon were asleep
|
; [wWereAnyMonsAsleep]: set to 1 if any pokemon were asleep
|
||||||
WakeUpEntireParty: ; e1e5 (3:61e5)
|
WakeUpEntireParty: ; e1e5 (3:61e5)
|
||||||
ld de,44
|
ld de,44
|
||||||
ld c,6
|
ld c,6
|
||||||
|
|
@ -1674,7 +1674,7 @@ WakeUpEntireParty: ; e1e5 (3:61e5)
|
||||||
and a,SLP ; is pokemon asleep?
|
and a,SLP ; is pokemon asleep?
|
||||||
jr z,.notAsleep
|
jr z,.notAsleep
|
||||||
ld a,1
|
ld a,1
|
||||||
ld [wWhichTrade],a ; indicate that a pokemon had to be woken up
|
ld [wWereAnyMonsAsleep],a ; indicate that a pokemon had to be woken up
|
||||||
.notAsleep
|
.notAsleep
|
||||||
pop af
|
pop af
|
||||||
and b ; remove Sleep status
|
and b ; remove Sleep status
|
||||||
|
|
@ -1874,7 +1874,7 @@ ItemUsePPRestore: ; e31e (3:631e)
|
||||||
ld a,[wWhichPokemon]
|
ld a,[wWhichPokemon]
|
||||||
push af
|
push af
|
||||||
ld a,[wcf91]
|
ld a,[wcf91]
|
||||||
ld [wWhichTrade],a
|
ld [wPPRestoreItem],a
|
||||||
.chooseMon
|
.chooseMon
|
||||||
xor a
|
xor a
|
||||||
ld [wUpdateSpritesEnabled],a
|
ld [wUpdateSpritesEnabled],a
|
||||||
|
|
@ -1884,13 +1884,13 @@ ItemUsePPRestore: ; e31e (3:631e)
|
||||||
jr nc,.chooseMove
|
jr nc,.chooseMove
|
||||||
jp .itemNotUsed
|
jp .itemNotUsed
|
||||||
.chooseMove
|
.chooseMove
|
||||||
ld a,[wWhichTrade]
|
ld a,[wPPRestoreItem]
|
||||||
cp a,ELIXER
|
cp a,ELIXER
|
||||||
jp nc,.useElixir ; if Elixir or Max Elixir
|
jp nc,.useElixir ; if Elixir or Max Elixir
|
||||||
ld a,$02
|
ld a,$02
|
||||||
ld [wMoveMenuType],a
|
ld [wMoveMenuType],a
|
||||||
ld hl,RaisePPWhichTechniqueText
|
ld hl,RaisePPWhichTechniqueText
|
||||||
ld a,[wWhichTrade]
|
ld a,[wPPRestoreItem]
|
||||||
cp a,ETHER ; is it a PP Up?
|
cp a,ETHER ; is it a PP Up?
|
||||||
jr c,.printWhichTechniqueMessage ; if so, print the raise PP message
|
jr c,.printWhichTechniqueMessage ; if so, print the raise PP message
|
||||||
ld hl,RestorePPWhichTechniqueText ; otherwise, print the restore PP message
|
ld hl,RestorePPWhichTechniqueText ; otherwise, print the restore PP message
|
||||||
|
|
@ -1911,7 +1911,7 @@ ItemUsePPRestore: ; e31e (3:631e)
|
||||||
call GetMoveName
|
call GetMoveName
|
||||||
call CopyStringToCF4B ; copy name to wcf4b
|
call CopyStringToCF4B ; copy name to wcf4b
|
||||||
pop hl
|
pop hl
|
||||||
ld a,[wWhichTrade]
|
ld a,[wPPRestoreItem]
|
||||||
cp a,ETHER
|
cp a,ETHER
|
||||||
jr nc,.useEther ; if Ether or Max Ether
|
jr nc,.useEther ; if Ether or Max Ether
|
||||||
.usePPUp
|
.usePPUp
|
||||||
|
|
@ -1973,7 +1973,7 @@ ItemUsePPRestore: ; e31e (3:631e)
|
||||||
add hl,bc ; hl now points to move's PP
|
add hl,bc ; hl now points to move's PP
|
||||||
ld a,[wd11e]
|
ld a,[wd11e]
|
||||||
ld b,a ; b = max PP
|
ld b,a ; b = max PP
|
||||||
ld a,[wWhichTrade]
|
ld a,[wPPRestoreItem]
|
||||||
cp a,MAX_ETHER
|
cp a,MAX_ETHER
|
||||||
jr z,.fullyRestorePP
|
jr z,.fullyRestorePP
|
||||||
ld a,[hl] ; move PP
|
ld a,[hl] ; move PP
|
||||||
|
|
@ -2005,7 +2005,7 @@ ItemUsePPRestore: ; e31e (3:631e)
|
||||||
jr .storeNewAmount
|
jr .storeNewAmount
|
||||||
.useElixir
|
.useElixir
|
||||||
; decrement the item ID so that ELIXER becomes ETHER and MAX_ELIXER becomes MAX_ETHER
|
; decrement the item ID so that ELIXER becomes ETHER and MAX_ELIXER becomes MAX_ETHER
|
||||||
ld hl,wWhichTrade
|
ld hl,wPPRestoreItem
|
||||||
dec [hl]
|
dec [hl]
|
||||||
dec [hl]
|
dec [hl]
|
||||||
xor a
|
xor a
|
||||||
|
|
@ -2701,13 +2701,13 @@ SendNewMonToBox: ; e7a4 (3:67a4)
|
||||||
ld d, a
|
ld d, a
|
||||||
callab CalcExperience
|
callab CalcExperience
|
||||||
pop de
|
pop de
|
||||||
ld a, [H_NUMTOPRINT] ; (aliases: H_MULTIPLICAND)
|
ld a, [hExperience]
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
ld a, [$ff97]
|
ld a, [hExperience + 1]
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
ld a, [$ff98]
|
ld a, [hExperience + 2]
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
xor a
|
xor a
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ PKMNLeaguePC: ; 0x7657e
|
||||||
ld [hTilesetType], a
|
ld [hTilesetType], a
|
||||||
ld [W_SPRITEFLIPPED], a
|
ld [W_SPRITEFLIPPED], a
|
||||||
ld [wUpdateSpritesEnabled], a
|
ld [wUpdateSpritesEnabled], a
|
||||||
ld [wTrainerScreenX], a
|
ld [wHoFTeamIndex2], a
|
||||||
ld [wHoFTeamNo], a
|
ld [wHoFTeamNo], a
|
||||||
ld a, [wNumHoFTeams]
|
ld a, [wNumHoFTeams]
|
||||||
ld b, a
|
ld b, a
|
||||||
|
|
@ -27,13 +27,13 @@ PKMNLeaguePC: ; 0x7657e
|
||||||
ld hl, wHoFTeamNo
|
ld hl, wHoFTeamNo
|
||||||
inc [hl]
|
inc [hl]
|
||||||
push bc
|
push bc
|
||||||
ld a, [wTrainerScreenX]
|
ld a, [wHoFTeamIndex2]
|
||||||
ld [wHoFMonSpecies], a
|
ld [wHoFTeamIndex], a
|
||||||
callba LoadHallOfFameTeams
|
callba LoadHallOfFameTeams
|
||||||
call LeaguePCShowTeam
|
call LeaguePCShowTeam
|
||||||
pop bc
|
pop bc
|
||||||
jr c, .doneShowingTeams
|
jr c, .doneShowingTeams
|
||||||
ld hl, wTrainerScreenX
|
ld hl, wHoFTeamIndex2
|
||||||
inc [hl]
|
inc [hl]
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
cp b
|
cp b
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,16 @@
|
||||||
MainMenu: ; 5af2 (1:5af2)
|
MainMenu: ; 5af2 (1:5af2)
|
||||||
; Check save file
|
; Check save file
|
||||||
call Func_5bff
|
call InitOptions
|
||||||
xor a
|
xor a
|
||||||
ld [wd08a],a
|
ld [wOptionsInitialized],a
|
||||||
inc a
|
inc a
|
||||||
ld [wd088],a
|
ld [wSaveFileStatus],a
|
||||||
call Func_609e
|
call CheckForPlayerNameInSRAM
|
||||||
jr nc,.next0
|
jr nc,.mainMenuLoop
|
||||||
|
|
||||||
; Predef 52 loads the save from SRAM to RAM
|
|
||||||
predef LoadSAV
|
predef LoadSAV
|
||||||
|
|
||||||
.next0
|
.mainMenuLoop
|
||||||
ld c,20
|
ld c,20
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
xor a ; LINK_STATE_NONE
|
xor a ; LINK_STATE_NONE
|
||||||
|
|
@ -30,9 +29,10 @@ MainMenu: ; 5af2 (1:5af2)
|
||||||
call LoadFontTilePatterns
|
call LoadFontTilePatterns
|
||||||
ld hl,wd730
|
ld hl,wd730
|
||||||
set 6,[hl]
|
set 6,[hl]
|
||||||
ld a,[wd088]
|
ld a,[wSaveFileStatus]
|
||||||
cp a,1
|
cp a,1
|
||||||
jr z,.next1
|
jr z,.noSaveFile
|
||||||
|
; there's a save file
|
||||||
coord hl, 0, 0
|
coord hl, 0, 0
|
||||||
ld b,6
|
ld b,6
|
||||||
ld c,13
|
ld c,13
|
||||||
|
|
@ -41,7 +41,7 @@ MainMenu: ; 5af2 (1:5af2)
|
||||||
ld de,ContinueText
|
ld de,ContinueText
|
||||||
call PlaceString
|
call PlaceString
|
||||||
jr .next2
|
jr .next2
|
||||||
.next1
|
.noSaveFile
|
||||||
coord hl, 0, 0
|
coord hl, 0, 0
|
||||||
ld b,4
|
ld b,4
|
||||||
ld c,13
|
ld c,13
|
||||||
|
|
@ -63,31 +63,33 @@ MainMenu: ; 5af2 (1:5af2)
|
||||||
ld [wTopMenuItemY],a
|
ld [wTopMenuItemY],a
|
||||||
ld a,$B
|
ld a,$B
|
||||||
ld [wMenuWatchedKeys],a
|
ld [wMenuWatchedKeys],a
|
||||||
ld a,[wd088]
|
ld a,[wSaveFileStatus]
|
||||||
ld [wMaxMenuItem],a
|
ld [wMaxMenuItem],a
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
bit 1,a
|
bit 1,a ; pressed B?
|
||||||
jp nz,LoadTitlescreenGraphics ; load title screen (gfx and arrangement)
|
jp nz,DisplayTitleScreen ; if so, go back to the title screen
|
||||||
ld c,20
|
ld c,20
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld a,[wCurrentMenuItem]
|
ld a,[wCurrentMenuItem]
|
||||||
ld b,a
|
ld b,a
|
||||||
ld a,[wd088]
|
ld a,[wSaveFileStatus]
|
||||||
cp a,2
|
cp a,2
|
||||||
jp z,.next3
|
jp z,.skipInc
|
||||||
inc b ; adjust MenuArrow_Counter
|
; If there's no save file, increment the current menu item so that the numbers
|
||||||
.next3
|
; are the same whether or not there's a save file.
|
||||||
|
inc b
|
||||||
|
.skipInc
|
||||||
ld a,b
|
ld a,b
|
||||||
and a
|
and a
|
||||||
jr z,.next4 ; if press_A on Continue
|
jr z,.choseContinue
|
||||||
cp a,1
|
cp a,1
|
||||||
jp z,Func_5d52 ; if press_A on NewGame
|
jp z,StartNewGame
|
||||||
call DisplayOptionMenu ; if press_a on Options
|
call DisplayOptionMenu
|
||||||
ld a,1
|
ld a,1
|
||||||
ld [wd08a],a
|
ld [wOptionsInitialized],a
|
||||||
jp .next0
|
jp .mainMenuLoop
|
||||||
.next4
|
.choseContinue
|
||||||
call ContinueGame
|
call DisplayContinueGameInfo
|
||||||
ld hl,wd126
|
ld hl,wd126
|
||||||
set 5,[hl]
|
set 5,[hl]
|
||||||
.inputLoop
|
.inputLoop
|
||||||
|
|
@ -100,7 +102,7 @@ MainMenu: ; 5af2 (1:5af2)
|
||||||
bit 0,a
|
bit 0,a
|
||||||
jr nz,.pressedA
|
jr nz,.pressedA
|
||||||
bit 1,a
|
bit 1,a
|
||||||
jp nz,.next0 ; pressedB
|
jp nz,.mainMenuLoop ; pressed B
|
||||||
jr .inputLoop
|
jr .inputLoop
|
||||||
.pressedA
|
.pressedA
|
||||||
call GBPalWhiteOutWithDelay3
|
call GBPalWhiteOutWithDelay3
|
||||||
|
|
@ -122,10 +124,10 @@ MainMenu: ; 5af2 (1:5af2)
|
||||||
call SpecialWarpIn
|
call SpecialWarpIn
|
||||||
jp SpecialEnterMap
|
jp SpecialEnterMap
|
||||||
|
|
||||||
Func_5bff: ; 5bff (1:5bff)
|
InitOptions: ; 5bff (1:5bff)
|
||||||
ld a,1
|
ld a,1 ; no delay
|
||||||
ld [wLetterPrintingDelayFlags],a
|
ld [wLetterPrintingDelayFlags],a
|
||||||
ld a,3
|
ld a,3 ; medium speed
|
||||||
ld [W_OPTIONS],a
|
ld [W_OPTIONS],a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
@ -301,7 +303,7 @@ LinkCanceledText: ; 5d4d (1:5d4d)
|
||||||
TX_FAR _LinkCanceledText
|
TX_FAR _LinkCanceledText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
Func_5d52: ; 5d52 (1:5d52)
|
StartNewGame: ; 5d52 (1:5d52)
|
||||||
ld hl, wd732
|
ld hl, wd732
|
||||||
res 1, [hl]
|
res 1, [hl]
|
||||||
call OakSpeech
|
call OakSpeech
|
||||||
|
|
@ -337,12 +339,12 @@ CableClubOptionsText: ; 5d97 (1:5d97)
|
||||||
db "COLOSSEUM", $4e
|
db "COLOSSEUM", $4e
|
||||||
db "CANCEL@"
|
db "CANCEL@"
|
||||||
|
|
||||||
ContinueGame: ; 5db5 (1:5db5)
|
DisplayContinueGameInfo: ; 5db5 (1:5db5)
|
||||||
xor a
|
xor a
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
coord hl, 4, 7
|
coord hl, 4, 7
|
||||||
ld b, $8
|
ld b, 8
|
||||||
ld c, $e
|
ld c, 14
|
||||||
call TextBoxBorder
|
call TextBoxBorder
|
||||||
coord hl, 5, 9
|
coord hl, 5, 9
|
||||||
ld de, SaveScreenInfoText
|
ld de, SaveScreenInfoText
|
||||||
|
|
@ -351,12 +353,12 @@ ContinueGame: ; 5db5 (1:5db5)
|
||||||
ld de, wPlayerName
|
ld de, wPlayerName
|
||||||
call PlaceString
|
call PlaceString
|
||||||
coord hl, 17, 11
|
coord hl, 17, 11
|
||||||
call Func_5e2f
|
call PrintNumBadges
|
||||||
coord hl, 16, 13
|
coord hl, 16, 13
|
||||||
call Func_5e42
|
call PrintNumOwnedMons
|
||||||
coord hl, 13, 15
|
coord hl, 13, 15
|
||||||
call Func_5e55
|
call PrintPlayTime
|
||||||
ld a, $1
|
ld a, 1
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
ld c, 30
|
ld c, 30
|
||||||
jp DelayFrames
|
jp DelayFrames
|
||||||
|
|
@ -377,17 +379,17 @@ PrintSaveScreenText: ; 5def (1:5def)
|
||||||
ld de, wPlayerName
|
ld de, wPlayerName
|
||||||
call PlaceString
|
call PlaceString
|
||||||
coord hl, 17, 4
|
coord hl, 17, 4
|
||||||
call Func_5e2f
|
call PrintNumBadges
|
||||||
coord hl, 16, 6
|
coord hl, 16, 6
|
||||||
call Func_5e42
|
call PrintNumOwnedMons
|
||||||
coord hl, 13, 8
|
coord hl, 13, 8
|
||||||
call Func_5e55
|
call PrintPlayTime
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
ld c, 30
|
ld c, 30
|
||||||
jp DelayFrames
|
jp DelayFrames
|
||||||
|
|
||||||
Func_5e2f: ; 5e2f (1:5e2f)
|
PrintNumBadges: ; 5e2f (1:5e2f)
|
||||||
push hl
|
push hl
|
||||||
ld hl, W_OBTAINEDBADGES
|
ld hl, W_OBTAINEDBADGES
|
||||||
ld b, $1
|
ld b, $1
|
||||||
|
|
@ -397,7 +399,7 @@ Func_5e2f: ; 5e2f (1:5e2f)
|
||||||
ld bc, $102
|
ld bc, $102
|
||||||
jp PrintNumber
|
jp PrintNumber
|
||||||
|
|
||||||
Func_5e42: ; 5e42 (1:5e42)
|
PrintNumOwnedMons: ; 5e42 (1:5e42)
|
||||||
push hl
|
push hl
|
||||||
ld hl, wPokedexOwned
|
ld hl, wPokedexOwned
|
||||||
ld b, wPokedexOwnedEnd - wPokedexOwned
|
ld b, wPokedexOwnedEnd - wPokedexOwned
|
||||||
|
|
@ -407,7 +409,7 @@ Func_5e42: ; 5e42 (1:5e42)
|
||||||
ld bc, $103
|
ld bc, $103
|
||||||
jp PrintNumber
|
jp PrintNumber
|
||||||
|
|
||||||
Func_5e55: ; 5e55 (1:5e55)
|
PrintPlayTime: ; 5e55 (1:5e55)
|
||||||
ld de, W_PLAYTIMEHOURS + 1
|
ld de, W_PLAYTIMEHOURS + 1
|
||||||
ld bc, $103
|
ld bc, $103
|
||||||
call PrintNumber
|
call PrintNumber
|
||||||
|
|
@ -678,28 +680,32 @@ TextSpeedOptionData: ; 6096 (1:6096)
|
||||||
db 7 ; default X coordinate (Medium)
|
db 7 ; default X coordinate (Medium)
|
||||||
db $ff ; terminator
|
db $ff ; terminator
|
||||||
|
|
||||||
Func_609e: ; 609e (1:609e)
|
CheckForPlayerNameInSRAM: ; 609e (1:609e)
|
||||||
ld a, $a
|
; Check if the player name data in SRAM has a string terminator character
|
||||||
ld [$0], a
|
; (indicating that a name may have been saved there) and return whether it does
|
||||||
|
; in carry.
|
||||||
|
ld a, SRAM_ENABLE
|
||||||
|
ld [MBC1SRamEnable], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [$6000], a
|
ld [MBC1SRamBankingMode], a
|
||||||
ld [$4000], a
|
ld [MBC1SRamBank], a
|
||||||
ld b, $b
|
ld b, $b
|
||||||
ld hl, $a598
|
ld hl, sPlayerName
|
||||||
.asm_60b0
|
.loop
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
cp $50
|
cp "@"
|
||||||
jr z, .asm_60c1
|
jr z, .found
|
||||||
dec b
|
dec b
|
||||||
jr nz, .asm_60b0
|
jr nz, .loop
|
||||||
|
; not found
|
||||||
xor a
|
xor a
|
||||||
ld [$0], a
|
ld [MBC1SRamEnable], a
|
||||||
ld [$6000], a
|
ld [MBC1SRamBankingMode], a
|
||||||
and a
|
and a
|
||||||
ret
|
ret
|
||||||
.asm_60c1
|
.found
|
||||||
xor a
|
xor a
|
||||||
ld [$0], a
|
ld [MBC1SRamEnable], a
|
||||||
ld [$6000], a
|
ld [MBC1SRamBankingMode], a
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,8 @@ HandlePokedexSideMenu: ; 4006d (10:406d)
|
||||||
ld [wd11e],a
|
ld [wd11e],a
|
||||||
ld a,[wd11e]
|
ld a,[wd11e]
|
||||||
push af
|
push af
|
||||||
ld a,[wWhichTrade]
|
ld a,[wDexMaxSeenMon]
|
||||||
push af
|
push af ; this doesn't need to be preserved
|
||||||
ld hl,wPokedexSeen
|
ld hl,wPokedexSeen
|
||||||
call IsPokemonBitSet
|
call IsPokemonBitSet
|
||||||
ld b,2
|
ld b,2
|
||||||
|
|
@ -108,7 +108,7 @@ HandlePokedexSideMenu: ; 4006d (10:406d)
|
||||||
ld b,1
|
ld b,1
|
||||||
.exitSideMenu
|
.exitSideMenu
|
||||||
pop af
|
pop af
|
||||||
ld [wWhichTrade],a
|
ld [wDexMaxSeenMon],a
|
||||||
pop af
|
pop af
|
||||||
ld [wd11e],a
|
ld [wd11e],a
|
||||||
pop af
|
pop af
|
||||||
|
|
@ -207,7 +207,7 @@ HandlePokedexListMenu: ; 40111 (10:4111)
|
||||||
jr .maxSeenPokemonLoop
|
jr .maxSeenPokemonLoop
|
||||||
.storeMaxSeenPokemon
|
.storeMaxSeenPokemon
|
||||||
ld a,b
|
ld a,b
|
||||||
ld [wWhichTrade],a ; max seen pokemon
|
ld [wDexMaxSeenMon],a
|
||||||
.loop
|
.loop
|
||||||
xor a
|
xor a
|
||||||
ld [H_AUTOBGTRANSFERENABLED],a
|
ld [H_AUTOBGTRANSFERENABLED],a
|
||||||
|
|
@ -218,7 +218,7 @@ HandlePokedexListMenu: ; 40111 (10:4111)
|
||||||
ld a,[wListScrollOffset]
|
ld a,[wListScrollOffset]
|
||||||
ld [wd11e],a
|
ld [wd11e],a
|
||||||
ld d,7
|
ld d,7
|
||||||
ld a,[wWhichTrade]
|
ld a,[wDexMaxSeenMon]
|
||||||
cp a,7
|
cp a,7
|
||||||
jr nc,.printPokemonLoop
|
jr nc,.printPokemonLoop
|
||||||
ld d,a
|
ld d,a
|
||||||
|
|
@ -294,9 +294,9 @@ HandlePokedexListMenu: ; 40111 (10:4111)
|
||||||
bit 7,a ; was Down pressed?
|
bit 7,a ; was Down pressed?
|
||||||
jr z,.checkIfRightPressed
|
jr z,.checkIfRightPressed
|
||||||
.downPressed ; scroll down one row
|
.downPressed ; scroll down one row
|
||||||
ld a,[wWhichTrade]
|
ld a,[wDexMaxSeenMon]
|
||||||
cp a,7
|
cp a,7
|
||||||
jp c,.loop
|
jp c,.loop ; can't if the list is shorter than 7
|
||||||
sub a,7
|
sub a,7
|
||||||
ld b,a
|
ld b,a
|
||||||
ld a,[wListScrollOffset]
|
ld a,[wListScrollOffset]
|
||||||
|
|
@ -309,9 +309,9 @@ HandlePokedexListMenu: ; 40111 (10:4111)
|
||||||
bit 4,a ; was Right pressed?
|
bit 4,a ; was Right pressed?
|
||||||
jr z,.checkIfLeftPressed
|
jr z,.checkIfLeftPressed
|
||||||
.rightPressed ; scroll down 7 rows
|
.rightPressed ; scroll down 7 rows
|
||||||
ld a,[wWhichTrade]
|
ld a,[wDexMaxSeenMon]
|
||||||
cp a,7
|
cp a,7
|
||||||
jp c,.loop
|
jp c,.loop ; can't if the list is shorter than 7
|
||||||
sub a,6
|
sub a,6
|
||||||
ld b,a
|
ld b,a
|
||||||
ld a,[wListScrollOffset]
|
ld a,[wListScrollOffset]
|
||||||
|
|
|
||||||
|
|
@ -231,18 +231,24 @@ HandlePrizeChoice: ; 528c6 (14:68c6)
|
||||||
pop af
|
pop af
|
||||||
ld b,a
|
ld b,a
|
||||||
call GivePokemon
|
call GivePokemon
|
||||||
|
|
||||||
|
; If either the party or box was full, wait after displaying message.
|
||||||
push af
|
push af
|
||||||
ld a,[wccd3] ; XXX is there room?
|
ld a,[wAddedToParty]
|
||||||
and a
|
and a
|
||||||
call z,WaitForTextScrollButtonPress
|
call z,WaitForTextScrollButtonPress
|
||||||
pop af
|
pop af
|
||||||
|
|
||||||
|
; If the mon couldn't be given to the player (because both the party and box
|
||||||
|
; were full), return without subtracting coins.
|
||||||
ret nc
|
ret nc
|
||||||
|
|
||||||
.SubtractCoins
|
.SubtractCoins
|
||||||
call LoadCoinsToSubtract
|
call LoadCoinsToSubtract
|
||||||
ld hl,hCoins + 1
|
ld hl,hCoins + 1
|
||||||
ld de,wPlayerCoins + 1
|
ld de,wPlayerCoins + 1
|
||||||
ld c,$02 ; how many bytes
|
ld c,$02 ; how many bytes
|
||||||
predef SubBCDPredef ; subtract coins (BCD daa operations)
|
predef SubBCDPredef
|
||||||
jp PrintPrizePrice
|
jp PrintPrizePrice
|
||||||
.BagFull
|
.BagFull
|
||||||
ld hl,PrizeRoomBagIsFullTextPtr
|
ld hl,PrizeRoomBagIsFullTextPtr
|
||||||
|
|
|
||||||
|
|
@ -297,8 +297,8 @@ StatusScreen2: ; 12b57 (4:6b57)
|
||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
ld [hTilesetType], a
|
ld [hTilesetType], a
|
||||||
ld [$ffba], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
ld bc, $0005
|
ld bc, NUM_MOVES + 1
|
||||||
ld hl, wMoves
|
ld hl, wMoves
|
||||||
call FillMemory
|
call FillMemory
|
||||||
ld hl, wLoadedMonMoves
|
ld hl, wLoadedMonMoves
|
||||||
|
|
@ -307,13 +307,13 @@ StatusScreen2: ; 12b57 (4:6b57)
|
||||||
call CopyData
|
call CopyData
|
||||||
callab FormatMovesString
|
callab FormatMovesString
|
||||||
coord hl, 9, 2
|
coord hl, 9, 2
|
||||||
ld bc, $050a
|
lb bc, 5, 10
|
||||||
call ClearScreenArea ; Clear under name
|
call ClearScreenArea ; Clear under name
|
||||||
coord hl, 19, 3
|
coord hl, 19, 3
|
||||||
ld [hl], $78
|
ld [hl], $78
|
||||||
coord hl, 0, 8
|
coord hl, 0, 8
|
||||||
ld b, $8
|
ld b, 8
|
||||||
ld c, $12
|
ld c, 18
|
||||||
call TextBoxBorder ; Draw move container
|
call TextBoxBorder ; Draw move container
|
||||||
coord hl, 2, 9
|
coord hl, 2, 9
|
||||||
ld de, wMovesString
|
ld de, wMovesString
|
||||||
|
|
@ -387,9 +387,9 @@ StatusScreen2: ; 12b57 (4:6b57)
|
||||||
jr nz, .PrintPP
|
jr nz, .PrintPP
|
||||||
.PPDone
|
.PPDone
|
||||||
coord hl, 9, 3
|
coord hl, 9, 3
|
||||||
ld de, EXPPointsText
|
ld de, StatusScreenExpText
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld a, [wLoadedMonLevel] ; level
|
ld a, [wLoadedMonLevel]
|
||||||
push af
|
push af
|
||||||
cp MAX_LEVEL
|
cp MAX_LEVEL
|
||||||
jr z, .Level100
|
jr z, .Level100
|
||||||
|
|
@ -407,11 +407,11 @@ StatusScreen2: ; 12b57 (4:6b57)
|
||||||
coord hl, 12, 4
|
coord hl, 12, 4
|
||||||
ld bc, $0307
|
ld bc, $0307
|
||||||
call PrintNumber ; exp
|
call PrintNumber ; exp
|
||||||
call .asm_12c86
|
call CalcExpToLevelUp
|
||||||
ld de, wLoadedMonExp
|
ld de, wLoadedMonExp
|
||||||
coord hl, 7, 6
|
coord hl, 7, 6
|
||||||
ld bc, $0307
|
ld bc, $0307
|
||||||
call PrintNumber
|
call PrintNumber ; exp needed to level up
|
||||||
coord hl, 9, 0
|
coord hl, 9, 0
|
||||||
call StatusScreen_ClearName
|
call StatusScreen_ClearName
|
||||||
coord hl, 9, 1
|
coord hl, 9, 1
|
||||||
|
|
@ -422,7 +422,7 @@ StatusScreen2: ; 12b57 (4:6b57)
|
||||||
coord hl, 9, 1
|
coord hl, 9, 1
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [$ffba], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
call Delay3
|
call Delay3
|
||||||
call WaitForTextScrollButtonPress ; wait for button
|
call WaitForTextScrollButtonPress ; wait for button
|
||||||
pop af
|
pop af
|
||||||
|
|
@ -433,25 +433,26 @@ StatusScreen2: ; 12b57 (4:6b57)
|
||||||
ld [$ff24], a
|
ld [$ff24], a
|
||||||
call GBPalWhiteOut
|
call GBPalWhiteOut
|
||||||
jp ClearScreen
|
jp ClearScreen
|
||||||
.asm_12c86 ; This does some magic with lvl/exp?
|
|
||||||
ld a, [wLoadedMonLevel] ; Load level
|
CalcExpToLevelUp: ; 12c86 (4:6c86)
|
||||||
|
ld a, [wLoadedMonLevel]
|
||||||
cp MAX_LEVEL
|
cp MAX_LEVEL
|
||||||
jr z, .asm_12ca7 ; If 100
|
jr z, .atMaxLevel
|
||||||
inc a
|
inc a
|
||||||
ld d, a
|
ld d, a
|
||||||
callab CalcExperience
|
callab CalcExperience
|
||||||
ld hl, wLoadedMonExp + 2
|
ld hl, wLoadedMonExp + 2
|
||||||
ld a, [$ff98]
|
ld a, [hExperience + 2]
|
||||||
sub [hl]
|
sub [hl]
|
||||||
ld [hld], a
|
ld [hld], a
|
||||||
ld a, [$ff97]
|
ld a, [hExperience + 1]
|
||||||
sbc [hl]
|
sbc [hl]
|
||||||
ld [hld], a
|
ld [hld], a
|
||||||
ld a, [$ff96]
|
ld a, [hExperience]
|
||||||
sbc [hl]
|
sbc [hl]
|
||||||
ld [hld], a
|
ld [hld], a
|
||||||
ret
|
ret
|
||||||
.asm_12ca7
|
.atMaxLevel
|
||||||
ld hl, wLoadedMonExp
|
ld hl, wLoadedMonExp
|
||||||
xor a
|
xor a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
|
@ -459,11 +460,9 @@ StatusScreen2: ; 12b57 (4:6b57)
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
EXPPointsText: ; 12caf (4:6caf)
|
StatusScreenExpText: ; 12caf (4:6caf)
|
||||||
db "EXP POINTS", $4e
|
db "EXP POINTS"
|
||||||
|
next "LEVEL UP@"
|
||||||
LevelUpText: ; 12cba (4:6cba)
|
|
||||||
db "LEVEL UP@"
|
|
||||||
|
|
||||||
StatusScreen_ClearName: ; 12cc3 (4:6cc3)
|
StatusScreen_ClearName: ; 12cc3 (4:6cc3)
|
||||||
ld bc, 10
|
ld bc, 10
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,9 @@ SetDefaultNames: ; 60ca (1:60ca)
|
||||||
ld [W_OPTIONS], a
|
ld [W_OPTIONS], a
|
||||||
pop af
|
pop af
|
||||||
ld [wLetterPrintingDelayFlags], a
|
ld [wLetterPrintingDelayFlags], a
|
||||||
ld a, [wd08a]
|
ld a, [wOptionsInitialized]
|
||||||
and a
|
and a
|
||||||
call z, Func_5bff
|
call z, InitOptions
|
||||||
ld hl, NintenText
|
ld hl, NintenText
|
||||||
ld de, wPlayerName
|
ld de, wPlayerName
|
||||||
ld bc, $b
|
ld bc, $b
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ WriteDMACodeToHRAM:
|
||||||
DMARoutine:
|
DMARoutine:
|
||||||
; initiate DMA
|
; initiate DMA
|
||||||
ld a, wOAMBuffer / $100
|
ld a, wOAMBuffer / $100
|
||||||
ld [$ff46], a
|
ld [rDMA], a
|
||||||
|
|
||||||
; wait for DMA to finish
|
; wait for DMA to finish
|
||||||
ld a, $28
|
ld a, $28
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
HiddenItems: ; 76688 (1d:6688)
|
HiddenItems: ; 76688 (1d:6688)
|
||||||
ld hl, HiddenItemCoords
|
ld hl, HiddenItemCoords
|
||||||
call Func_76857
|
call FindHiddenItemOrCoinsIndex
|
||||||
ld [wTrainerScreenX], a
|
ld [wHiddenItemOrCoinsIndex], a
|
||||||
ld hl, wd6f0
|
ld hl, wObtainedHiddenItemsFlags
|
||||||
ld a, [wTrainerScreenX]
|
ld a, [wHiddenItemOrCoinsIndex]
|
||||||
ld c, a
|
ld c, a
|
||||||
ld b, $2
|
ld b, $2
|
||||||
predef FlagActionPredef
|
predef FlagActionPredef
|
||||||
|
|
@ -11,9 +11,9 @@ HiddenItems: ; 76688 (1d:6688)
|
||||||
and a
|
and a
|
||||||
ret nz
|
ret nz
|
||||||
call EnableAutoTextBoxDrawing
|
call EnableAutoTextBoxDrawing
|
||||||
ld a, $1
|
ld a, 1
|
||||||
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
||||||
ld a, [wWhichTrade] ; item ID
|
ld a, [wHiddenObjectFunctionArgument] ; item ID
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
call GetItemName
|
call GetItemName
|
||||||
tx_pre_jump FoundHiddenItemText
|
tx_pre_jump FoundHiddenItemText
|
||||||
|
|
@ -23,12 +23,12 @@ INCLUDE "data/hidden_item_coords.asm"
|
||||||
FoundHiddenItemText: ; 7675b (1d:675b)
|
FoundHiddenItemText: ; 7675b (1d:675b)
|
||||||
TX_FAR _FoundHiddenItemText
|
TX_FAR _FoundHiddenItemText
|
||||||
TX_ASM
|
TX_ASM
|
||||||
ld a, [wWhichTrade] ; item ID
|
ld a, [wHiddenObjectFunctionArgument] ; item ID
|
||||||
ld b, a
|
ld b, a
|
||||||
ld c, 1
|
ld c, 1
|
||||||
call GiveItem
|
call GiveItem
|
||||||
jr nc, .BagFull
|
jr nc, .BagFull
|
||||||
ld hl, wd6f0
|
ld hl, wObtainedHiddenItemsFlags
|
||||||
ld a, [wTrainerScreenX]
|
ld a, [wTrainerScreenX]
|
||||||
ld c, a
|
ld c, a
|
||||||
ld b, $1
|
ld b, $1
|
||||||
|
|
@ -56,10 +56,10 @@ HiddenCoins: ; 76799 (1d:6799)
|
||||||
and a
|
and a
|
||||||
ret z
|
ret z
|
||||||
ld hl, HiddenCoinCoords
|
ld hl, HiddenCoinCoords
|
||||||
call Func_76857
|
call FindHiddenItemOrCoinsIndex
|
||||||
ld [wTrainerScreenX], a
|
ld [wHiddenItemOrCoinsIndex], a
|
||||||
ld hl, wd6fe
|
ld hl, wObtainedHiddenCoinsFlags
|
||||||
ld a, [wTrainerScreenX]
|
ld a, [wHiddenItemOrCoinsIndex]
|
||||||
ld c, a
|
ld c, a
|
||||||
ld b, $2
|
ld b, $2
|
||||||
predef FlagActionPredef
|
predef FlagActionPredef
|
||||||
|
|
@ -70,7 +70,7 @@ HiddenCoins: ; 76799 (1d:6799)
|
||||||
ld [hCoins - 1], a
|
ld [hCoins - 1], a
|
||||||
ld [hCoins], a
|
ld [hCoins], a
|
||||||
ld [hCoins + 1], a
|
ld [hCoins + 1], a
|
||||||
ld a, [wWhichTrade]
|
ld a, [wHiddenObjectFunctionArgument]
|
||||||
sub COIN
|
sub COIN
|
||||||
cp 10
|
cp 10
|
||||||
jr z, .bcd10
|
jr z, .bcd10
|
||||||
|
|
@ -99,7 +99,7 @@ HiddenCoins: ; 76799 (1d:6799)
|
||||||
ld hl, hCoins + 1
|
ld hl, hCoins + 1
|
||||||
ld c, $2
|
ld c, $2
|
||||||
predef AddBCDPredef
|
predef AddBCDPredef
|
||||||
ld hl, wd6fe
|
ld hl, wObtainedHiddenCoinsFlags
|
||||||
ld a, [wTrainerScreenX]
|
ld a, [wTrainerScreenX]
|
||||||
ld c, a
|
ld c, a
|
||||||
ld b, $1
|
ld b, $1
|
||||||
|
|
@ -130,31 +130,31 @@ DroppedHiddenCoinsText: ; 7684d (1d:684d)
|
||||||
TX_FAR _DroppedHiddenCoinsText
|
TX_FAR _DroppedHiddenCoinsText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
Func_76857: ; 76857 (1d:6857)
|
FindHiddenItemOrCoinsIndex: ; 76857 (1d:6857)
|
||||||
ld a, [wTrainerScreenY]
|
ld a, [wHiddenObjectY]
|
||||||
ld d, a
|
ld d, a
|
||||||
ld a, [wTrainerScreenX]
|
ld a, [wHiddenObjectX]
|
||||||
ld e, a
|
ld e, a
|
||||||
ld a, [W_CURMAP]
|
ld a, [W_CURMAP]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld c, $ff
|
ld c, -1
|
||||||
.loop
|
.loop
|
||||||
inc c
|
inc c
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
cp $ff ; end of the list?
|
cp $ff ; end of the list?
|
||||||
ret z ; if so, we're done here
|
ret z ; if so, we're done here
|
||||||
cp b
|
cp b
|
||||||
jr nz, .asm_76877
|
jr nz, .next1
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
cp d
|
cp d
|
||||||
jr nz, .asm_76878
|
jr nz, .next2
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
cp e
|
cp e
|
||||||
jr nz, .loop
|
jr nz, .loop
|
||||||
ld a, c
|
ld a, c
|
||||||
ret
|
ret
|
||||||
.asm_76877
|
.next1
|
||||||
inc hl
|
inc hl
|
||||||
.asm_76878
|
.next2
|
||||||
inc hl
|
inc hl
|
||||||
jr .loop
|
jr .loop
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
Func_46981: ; 46981 (11:6981)
|
IsPlayerOnDungeonWarp: ; 46981 (11:6981)
|
||||||
xor a
|
xor a
|
||||||
ld [wWhichDungeonWarp], a
|
ld [wWhichDungeonWarp], a
|
||||||
ld a, [wd72d]
|
ld a, [wd72d]
|
||||||
|
|
@ -6,7 +6,7 @@ Func_46981: ; 46981 (11:6981)
|
||||||
ret nz
|
ret nz
|
||||||
call ArePlayerCoordsInArray
|
call ArePlayerCoordsInArray
|
||||||
ret nc
|
ret nc
|
||||||
ld a, [wWhichTrade]
|
ld a, [wCoordIndex]
|
||||||
ld [wWhichDungeonWarp], a
|
ld [wWhichDungeonWarp], a
|
||||||
ld hl, wd72d
|
ld hl, wd72d
|
||||||
set 4, [hl]
|
set 4, [hl]
|
||||||
|
|
@ -58,7 +58,7 @@ CheckForHiddenObject: ; 469a0 (11:69a0)
|
||||||
ld [wHiddenObjectX], a
|
ld [wHiddenObjectX], a
|
||||||
ld c, a
|
ld c, a
|
||||||
call CheckIfCoordsInFrontOfPlayerMatch
|
call CheckIfCoordsInFrontOfPlayerMatch
|
||||||
ld a, [$ffea]
|
ld a, [hCoordsInFrontOfPlayerMatch]
|
||||||
and a
|
and a
|
||||||
jr z, .foundMatchingObject
|
jr z, .foundMatchingObject
|
||||||
inc hl
|
inc hl
|
||||||
|
|
@ -85,7 +85,7 @@ CheckForHiddenObject: ; 469a0 (11:69a0)
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; checks if the coordinates in front of the player's sprite match Y in b and X in c
|
; checks if the coordinates in front of the player's sprite match Y in b and X in c
|
||||||
; [$ffea] = $00 if they match, $ff if they don't match
|
; [hCoordsInFrontOfPlayerMatch] = $00 if they match, $ff if they don't match
|
||||||
CheckIfCoordsInFrontOfPlayerMatch: ; 46a01 (11:6a01)
|
CheckIfCoordsInFrontOfPlayerMatch: ; 46a01 (11:6a01)
|
||||||
ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
|
ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
|
||||||
cp SPRITE_FACING_UP
|
cp SPRITE_FACING_UP
|
||||||
|
|
@ -127,7 +127,7 @@ CheckIfCoordsInFrontOfPlayerMatch: ; 46a01 (11:6a01)
|
||||||
.didNotMatch
|
.didNotMatch
|
||||||
ld a, $ff
|
ld a, $ff
|
||||||
.done
|
.done
|
||||||
ld [$ffea], a
|
ld [hCoordsInFrontOfPlayerMatch], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
INCLUDE "data/hidden_objects.asm"
|
INCLUDE "data/hidden_objects.asm"
|
||||||
|
|
|
||||||
|
|
@ -210,9 +210,8 @@ UpdateNPCSprite: ; 4ed1 (1:4ed1)
|
||||||
.moveDown
|
.moveDown
|
||||||
ld de, 2*SCREEN_WIDTH
|
ld de, 2*SCREEN_WIDTH
|
||||||
add hl, de ; move tile pointer two rows down
|
add hl, de ; move tile pointer two rows down
|
||||||
ld de, $100
|
lb de, 1, 0
|
||||||
|
lb bc, 4, SPRITE_FACING_DOWN
|
||||||
ld bc, $400
|
|
||||||
jr TryWalking
|
jr TryWalking
|
||||||
.notDown
|
.notDown
|
||||||
cp $80 ; $40 <= a < $80: up (or right)
|
cp $80 ; $40 <= a < $80: up (or right)
|
||||||
|
|
@ -223,8 +222,8 @@ UpdateNPCSprite: ; 4ed1 (1:4ed1)
|
||||||
.moveUp
|
.moveUp
|
||||||
ld de, -2*SCREEN_WIDTH
|
ld de, -2*SCREEN_WIDTH
|
||||||
add hl, de ; move tile pointer two rows up
|
add hl, de ; move tile pointer two rows up
|
||||||
ld de, $ff00
|
lb de, -1, 0
|
||||||
ld bc, $804
|
lb bc, 8, SPRITE_FACING_UP
|
||||||
jr TryWalking
|
jr TryWalking
|
||||||
.notUp
|
.notUp
|
||||||
cp $c0 ; $80 <= a < $c0: left (or up)
|
cp $c0 ; $80 <= a < $c0: left (or up)
|
||||||
|
|
@ -235,8 +234,8 @@ UpdateNPCSprite: ; 4ed1 (1:4ed1)
|
||||||
.moveLeft
|
.moveLeft
|
||||||
dec hl
|
dec hl
|
||||||
dec hl ; move tile pointer two columns left
|
dec hl ; move tile pointer two columns left
|
||||||
ld de, $ff
|
lb de, 0, -1
|
||||||
ld bc, $208
|
lb bc, 2, SPRITE_FACING_LEFT
|
||||||
jr TryWalking
|
jr TryWalking
|
||||||
.notLeft ; $c0 <= a: right (or down)
|
.notLeft ; $c0 <= a: right (or down)
|
||||||
ld a, [wCurSpriteMovement2]
|
ld a, [wCurSpriteMovement2]
|
||||||
|
|
@ -245,8 +244,8 @@ UpdateNPCSprite: ; 4ed1 (1:4ed1)
|
||||||
.moveRight
|
.moveRight
|
||||||
inc hl
|
inc hl
|
||||||
inc hl ; move tile pointer two columns right
|
inc hl ; move tile pointer two columns right
|
||||||
ld de, $1
|
lb de, 0, 1
|
||||||
ld bc, $10c
|
lb bc, 1, SPRITE_FACING_RIGHT
|
||||||
jr TryWalking
|
jr TryWalking
|
||||||
|
|
||||||
; changes facing direction by zeroing the movement delta and calling TryWalking
|
; changes facing direction by zeroing the movement delta and calling TryWalking
|
||||||
|
|
|
||||||
|
|
@ -328,10 +328,10 @@ SendSGBPacket: ; 71feb (1c:5feb)
|
||||||
ld [$fff9],a
|
ld [$fff9],a
|
||||||
; send RESET signal (P14=LOW, P15=LOW)
|
; send RESET signal (P14=LOW, P15=LOW)
|
||||||
xor a
|
xor a
|
||||||
ld [$ff00],a
|
ld [rJOYP],a
|
||||||
; set P14=HIGH, P15=HIGH
|
; set P14=HIGH, P15=HIGH
|
||||||
ld a,$30
|
ld a,$30
|
||||||
ld [$ff00],a
|
ld [rJOYP],a
|
||||||
;load length of packets (16 bytes)
|
;load length of packets (16 bytes)
|
||||||
ld b,$10
|
ld b,$10
|
||||||
.nextByte
|
.nextByte
|
||||||
|
|
@ -348,10 +348,10 @@ SendSGBPacket: ; 71feb (1c:5feb)
|
||||||
; else (if 0th bit is zero) set P14=LOW,P15=HIGH (send bit 0)
|
; else (if 0th bit is zero) set P14=LOW,P15=HIGH (send bit 0)
|
||||||
ld a,$20
|
ld a,$20
|
||||||
.next0
|
.next0
|
||||||
ld [$ff00],a
|
ld [rJOYP],a
|
||||||
; must set P14=HIGH,P15=HIGH between each "pulse"
|
; must set P14=HIGH,P15=HIGH between each "pulse"
|
||||||
ld a,$30
|
ld a,$30
|
||||||
ld [$ff00],a
|
ld [rJOYP],a
|
||||||
; rotation will put next bit in 0th position (so we can always use command
|
; rotation will put next bit in 0th position (so we can always use command
|
||||||
; "bit 0,d" to fetch the bit that has to be sent)
|
; "bit 0,d" to fetch the bit that has to be sent)
|
||||||
rr d
|
rr d
|
||||||
|
|
@ -362,10 +362,10 @@ SendSGBPacket: ; 71feb (1c:5feb)
|
||||||
jr nz,.nextByte
|
jr nz,.nextByte
|
||||||
; send bit 1 as a "stop bit" (end of parameter data)
|
; send bit 1 as a "stop bit" (end of parameter data)
|
||||||
ld a,$20
|
ld a,$20
|
||||||
ld [$ff00],a
|
ld [rJOYP],a
|
||||||
; set P14=HIGH,P15=HIGH
|
; set P14=HIGH,P15=HIGH
|
||||||
ld a,$30
|
ld a,$30
|
||||||
ld [$ff00],a
|
ld [rJOYP],a
|
||||||
xor a
|
xor a
|
||||||
ld [$fff9],a
|
ld [$fff9],a
|
||||||
; wait for about 70000 cycles
|
; wait for about 70000 cycles
|
||||||
|
|
@ -448,38 +448,38 @@ CheckSGB: ; 7209b (1c:609b)
|
||||||
ld [$fff9], a
|
ld [$fff9], a
|
||||||
ei
|
ei
|
||||||
call Wait7000
|
call Wait7000
|
||||||
ld a, [rJOYP] ; $ff0
|
ld a, [rJOYP]
|
||||||
and $3
|
and $3
|
||||||
cp $3
|
cp $3
|
||||||
jr nz, .asm_720fd
|
jr nz, .asm_720fd
|
||||||
ld a, $20
|
ld a, $20
|
||||||
ld [rJOYP], a ; $ff0
|
ld [rJOYP], a
|
||||||
ld a, [rJOYP] ; $ff0
|
ld a, [rJOYP]
|
||||||
ld a, [rJOYP] ; $ff0
|
ld a, [rJOYP]
|
||||||
call Wait7000
|
call Wait7000
|
||||||
call Wait7000
|
call Wait7000
|
||||||
ld a, $30
|
ld a, $30
|
||||||
ld [rJOYP], a ; $ff0
|
ld [rJOYP], a
|
||||||
call Wait7000
|
call Wait7000
|
||||||
call Wait7000
|
call Wait7000
|
||||||
ld a, $10
|
ld a, $10
|
||||||
ld [rJOYP], a ; $ff0
|
ld [rJOYP], a
|
||||||
ld a, [rJOYP] ; $ff0
|
ld a, [rJOYP]
|
||||||
ld a, [rJOYP] ; $ff0
|
ld a, [rJOYP]
|
||||||
ld a, [rJOYP] ; $ff0
|
ld a, [rJOYP]
|
||||||
ld a, [rJOYP] ; $ff0
|
ld a, [rJOYP]
|
||||||
ld a, [rJOYP] ; $ff0
|
ld a, [rJOYP]
|
||||||
ld a, [rJOYP] ; $ff0
|
ld a, [rJOYP]
|
||||||
call Wait7000
|
call Wait7000
|
||||||
call Wait7000
|
call Wait7000
|
||||||
ld a, $30
|
ld a, $30
|
||||||
ld [rJOYP], a ; $ff0
|
ld [rJOYP], a
|
||||||
ld a, [rJOYP] ; $ff0
|
ld a, [rJOYP]
|
||||||
ld a, [rJOYP] ; $ff0
|
ld a, [rJOYP]
|
||||||
ld a, [rJOYP] ; $ff0
|
ld a, [rJOYP]
|
||||||
call Wait7000
|
call Wait7000
|
||||||
call Wait7000
|
call Wait7000
|
||||||
ld a, [rJOYP] ; $ff0
|
ld a, [rJOYP]
|
||||||
and $3
|
and $3
|
||||||
cp $3
|
cp $3
|
||||||
jr nz, .asm_720fd
|
jr nz, .asm_720fd
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ PredefPointers:: ; 4fe79 (13:7e79)
|
||||||
add_predef InternalClockTradeAnim
|
add_predef InternalClockTradeAnim
|
||||||
add_predef TrainerEngage
|
add_predef TrainerEngage
|
||||||
add_predef IndexToPokedex
|
add_predef IndexToPokedex
|
||||||
add_predef DisplayPicCenteredOrUpperRight; 3B display pic?
|
add_predef DisplayPicCenteredOrUpperRight
|
||||||
add_predef UsedCut
|
add_predef UsedCut
|
||||||
add_predef ShowPokedexData
|
add_predef ShowPokedexData
|
||||||
add_predef WriteMonMoves
|
add_predef WriteMonMoves
|
||||||
|
|
@ -128,15 +128,15 @@ PredefPointers:: ; 4fe79 (13:7e79)
|
||||||
add_predef DrawEnemyHUDAndHPBar
|
add_predef DrawEnemyHUDAndHPBar
|
||||||
add_predef LoadTownMap_Nest
|
add_predef LoadTownMap_Nest
|
||||||
add_predef PrintMonType
|
add_predef PrintMonType
|
||||||
add_predef EmotionBubble; 4C player exclamation
|
add_predef EmotionBubble
|
||||||
add_predef EmptyFunc3; return immediately
|
add_predef EmptyFunc3; return immediately
|
||||||
add_predef AskName
|
add_predef AskName
|
||||||
add_predef PewterGuys
|
add_predef PewterGuys
|
||||||
add_predef SaveSAVtoSRAM2
|
add_predef SaveSAVtoSRAM2
|
||||||
add_predef LoadSAVCheckSum2
|
add_predef LoadSAV2
|
||||||
add_predef LoadSAV
|
add_predef LoadSAV
|
||||||
add_predef SaveSAVtoSRAM1
|
add_predef SaveSAVtoSRAM1
|
||||||
add_predef DoInGameTradeDialogue ; 54 initiate trade
|
add_predef DoInGameTradeDialogue
|
||||||
add_predef HallOfFamePC
|
add_predef HallOfFamePC
|
||||||
add_predef DisplayDexRating
|
add_predef DisplayDexRating
|
||||||
dbw $1E, _LeaveMapAnim ; wrong bank
|
dbw $1E, _LeaveMapAnim ; wrong bank
|
||||||
|
|
|
||||||
181
engine/save.asm
181
engine/save.asm
|
|
@ -4,11 +4,11 @@ LoadSAV: ; 735e8 (1c:75e8)
|
||||||
call ClearScreen
|
call ClearScreen
|
||||||
call LoadFontTilePatterns
|
call LoadFontTilePatterns
|
||||||
call LoadTextBoxTilePatterns
|
call LoadTextBoxTilePatterns
|
||||||
call LoadSAVCheckSum
|
call LoadSAV0
|
||||||
jr c, .badsum
|
jr c, .badsum
|
||||||
call LoadSAVCheckSum1
|
call LoadSAV1
|
||||||
jr c, .badsum
|
jr c, .badsum
|
||||||
call LoadSAVCheckSum2
|
call LoadSAV2
|
||||||
jr c, .badsum
|
jr c, .badsum
|
||||||
ld a, $2 ; good checksum
|
ld a, $2 ; good checksum
|
||||||
jr .goodsum
|
jr .goodsum
|
||||||
|
|
@ -24,14 +24,14 @@ LoadSAV: ; 735e8 (1c:75e8)
|
||||||
res 6, [hl]
|
res 6, [hl]
|
||||||
ld a, $1 ; bad checksum
|
ld a, $1 ; bad checksum
|
||||||
.goodsum
|
.goodsum
|
||||||
ld [wd088], a ; checksum flag
|
ld [wSaveFileStatus], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
FileDataDestroyedText: ; 7361e (1c:761e)
|
FileDataDestroyedText: ; 7361e (1c:761e)
|
||||||
TX_FAR _FileDataDestroyedText
|
TX_FAR _FileDataDestroyedText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
LoadSAVCheckSum: ; 73623 (1c:7623)
|
LoadSAV0: ; 73623 (1c:7623)
|
||||||
ld a, SRAM_ENABLE
|
ld a, SRAM_ENABLE
|
||||||
ld [MBC1SRamEnable], a
|
ld [MBC1SRamEnable], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
|
|
@ -43,7 +43,9 @@ LoadSAVCheckSum: ; 73623 (1c:7623)
|
||||||
ld c, a
|
ld c, a
|
||||||
ld a, [sMainDataCheckSum] ; SAV's checksum
|
ld a, [sMainDataCheckSum] ; SAV's checksum
|
||||||
cp c
|
cp c
|
||||||
jp z, .Func_73652
|
jp z, .checkSumsMatched
|
||||||
|
|
||||||
|
; If the computed checksum didn't match the saved on, try again.
|
||||||
ld hl, sPlayerName
|
ld hl, sPlayerName
|
||||||
ld bc, sMainDataCheckSum - sPlayerName
|
ld bc, sMainDataCheckSum - sPlayerName
|
||||||
call SAVCheckSum
|
call SAVCheckSum
|
||||||
|
|
@ -52,7 +54,7 @@ LoadSAVCheckSum: ; 73623 (1c:7623)
|
||||||
cp c
|
cp c
|
||||||
jp nz, SAVBadCheckSum
|
jp nz, SAVBadCheckSum
|
||||||
|
|
||||||
.Func_73652 ; 73652 (1c:7652)
|
.checkSumsMatched
|
||||||
ld hl, sPlayerName
|
ld hl, sPlayerName
|
||||||
ld de, wPlayerName
|
ld de, wPlayerName
|
||||||
ld bc, 11
|
ld bc, 11
|
||||||
|
|
@ -76,7 +78,7 @@ LoadSAVCheckSum: ; 73623 (1c:7623)
|
||||||
and a
|
and a
|
||||||
jp SAVGoodChecksum
|
jp SAVGoodChecksum
|
||||||
|
|
||||||
LoadSAVCheckSum1: ; 73690 (1c:7690)
|
LoadSAV1: ; 73690 (1c:7690)
|
||||||
ld a, SRAM_ENABLE
|
ld a, SRAM_ENABLE
|
||||||
ld [MBC1SRamEnable], a
|
ld [MBC1SRamEnable], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
|
|
@ -96,7 +98,7 @@ LoadSAVCheckSum1: ; 73690 (1c:7690)
|
||||||
and a
|
and a
|
||||||
jp SAVGoodChecksum
|
jp SAVGoodChecksum
|
||||||
|
|
||||||
LoadSAVCheckSum2: ; 736bd (1c:76bd)
|
LoadSAV2: ; 736bd (1c:76bd)
|
||||||
ld a, SRAM_ENABLE
|
ld a, SRAM_ENABLE
|
||||||
ld [MBC1SRamEnable], a
|
ld [MBC1SRamEnable], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
|
|
@ -129,10 +131,11 @@ SAVGoodChecksum: ; 736f8 (1c:76f8)
|
||||||
ld [MBC1SRamEnable], a
|
ld [MBC1SRamEnable], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_73701: ; 73701 (1c:7701)
|
LoadSAVIgnoreBadCheckSum: ; 73701 (1c:7701)
|
||||||
call LoadSAVCheckSum
|
; unused function that loads save data and ignores bad checksums
|
||||||
call LoadSAVCheckSum1
|
call LoadSAV0
|
||||||
jp LoadSAVCheckSum2
|
call LoadSAV1
|
||||||
|
jp LoadSAV2
|
||||||
|
|
||||||
SaveSAV: ; 7370a (1c:770a)
|
SaveSAV: ; 7370a (1c:770a)
|
||||||
callba PrintSaveScreenText
|
callba PrintSaveScreenText
|
||||||
|
|
@ -140,7 +143,7 @@ SaveSAV: ; 7370a (1c:770a)
|
||||||
call SaveSAVConfirm
|
call SaveSAVConfirm
|
||||||
and a ;|0 = Yes|1 = No|
|
and a ;|0 = Yes|1 = No|
|
||||||
ret nz
|
ret nz
|
||||||
ld a,[wd088]
|
ld a,[wSaveFileStatus]
|
||||||
dec a
|
dec a
|
||||||
jr z,.save
|
jr z,.save
|
||||||
call SAVCheckRandomID
|
call SAVCheckRandomID
|
||||||
|
|
@ -270,14 +273,14 @@ SaveSAVtoSRAM2: ; 7380f (1c:780f)
|
||||||
|
|
||||||
SaveSAVtoSRAM: ; 73848 (1c:7848)
|
SaveSAVtoSRAM: ; 73848 (1c:7848)
|
||||||
ld a, $2
|
ld a, $2
|
||||||
ld [wd088], a
|
ld [wSaveFileStatus], a
|
||||||
call SaveSAVtoSRAM0
|
call SaveSAVtoSRAM0
|
||||||
call SaveSAVtoSRAM1
|
call SaveSAVtoSRAM1
|
||||||
jp SaveSAVtoSRAM2
|
jp SaveSAVtoSRAM2
|
||||||
|
|
||||||
SAVCheckSum: ; 73856 (1c:7856)
|
SAVCheckSum: ; 73856 (1c:7856)
|
||||||
;Check Sum (result[1 byte] is complemented)
|
;Check Sum (result[1 byte] is complemented)
|
||||||
ld d, $0
|
ld d, 0
|
||||||
.loop
|
.loop
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
add d
|
add d
|
||||||
|
|
@ -290,11 +293,11 @@ SAVCheckSum: ; 73856 (1c:7856)
|
||||||
cpl
|
cpl
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_73863: ; 73863 (1c:7863)
|
CalcIndividualBoxCheckSums: ; 73863 (1c:7863)
|
||||||
ld hl, sBox1 ; sBox7
|
ld hl, sBox1 ; sBox7
|
||||||
ld de, sBoxes1CheckSum2 ; sBoxes2CheckSum2
|
ld de, sBank2IndividualBoxChecksums ; sBank3IndividualBoxChecksums
|
||||||
ld b, NUM_BOXES / 2
|
ld b, NUM_BOXES / 2
|
||||||
.asm_7386b
|
.loop
|
||||||
push bc
|
push bc
|
||||||
push de
|
push de
|
||||||
ld bc, wBoxMonNicksEnd - W_NUMINBOX
|
ld bc, wBoxMonNicksEnd - W_NUMINBOX
|
||||||
|
|
@ -304,21 +307,23 @@ Func_73863: ; 73863 (1c:7863)
|
||||||
inc de
|
inc de
|
||||||
pop bc
|
pop bc
|
||||||
dec b
|
dec b
|
||||||
jr nz, .asm_7386b
|
jr nz, .loop
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_7387b: ; 7387b (1c:787b)
|
GetBoxSRAMLocation: ; 7387b (1c:787b)
|
||||||
ld hl, PointerTable_73895
|
; in: a = box num
|
||||||
|
; out: b = box SRAM bank, hl = pointer to start of box
|
||||||
|
ld hl, BoxSRAMPointerTable
|
||||||
ld a, [wCurrentBoxNum]
|
ld a, [wCurrentBoxNum]
|
||||||
and $7f
|
and $7f
|
||||||
cp NUM_BOXES / 2
|
cp NUM_BOXES / 2
|
||||||
ld b, $2
|
ld b, 2
|
||||||
jr c, .asm_7388c
|
jr c, .next
|
||||||
inc b
|
inc b
|
||||||
sub NUM_BOXES / 2
|
sub NUM_BOXES / 2
|
||||||
.asm_7388c
|
.next
|
||||||
ld e, a
|
ld e, a
|
||||||
ld d, $0
|
ld d, 0
|
||||||
add hl, de
|
add hl, de
|
||||||
add hl, de
|
add hl, de
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
|
|
@ -326,7 +331,7 @@ Func_7387b: ; 7387b (1c:787b)
|
||||||
ld l, a
|
ld l, a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
PointerTable_73895: ; 73895 (1c:7895)
|
BoxSRAMPointerTable: ; 73895 (1c:7895)
|
||||||
dw sBox1 ; sBox7
|
dw sBox1 ; sBox7
|
||||||
dw sBox2 ; sBox8
|
dw sBox2 ; sBox8
|
||||||
dw sBox3 ; sBox9
|
dw sBox3 ; sBox9
|
||||||
|
|
@ -342,9 +347,9 @@ ChangeBox:: ; 738a1 (1c:78a1)
|
||||||
and a
|
and a
|
||||||
ret nz ; return if No was chosen
|
ret nz ; return if No was chosen
|
||||||
ld hl, wCurrentBoxNum
|
ld hl, wCurrentBoxNum
|
||||||
bit 7, [hl]
|
bit 7, [hl] ; is it the first time player is changing the box?
|
||||||
call z, Func_73a29
|
call z, EmptyAllSRAMBoxes ; if so, empty all boxes in SRAM
|
||||||
call Func_7393f
|
call DisplayChangeBoxMenu
|
||||||
call UpdateSprites
|
call UpdateSprites
|
||||||
ld hl, hFlags_0xFFF6
|
ld hl, hFlags_0xFFF6
|
||||||
set 1, [hl]
|
set 1, [hl]
|
||||||
|
|
@ -353,17 +358,17 @@ ChangeBox:: ; 738a1 (1c:78a1)
|
||||||
res 1, [hl]
|
res 1, [hl]
|
||||||
bit 1, a
|
bit 1, a
|
||||||
ret nz
|
ret nz
|
||||||
call Func_7387b
|
call GetBoxSRAMLocation
|
||||||
ld e, l
|
ld e, l
|
||||||
ld d, h
|
ld d, h
|
||||||
ld hl, W_NUMINBOX
|
ld hl, W_NUMINBOX
|
||||||
call Func_7390e
|
call CopyBoxToOrFromSRAM ; copy old box from WRAM to SRAM
|
||||||
ld a, [wCurrentMenuItem]
|
ld a, [wCurrentMenuItem]
|
||||||
set 7, a
|
set 7, a
|
||||||
ld [wCurrentBoxNum], a
|
ld [wCurrentBoxNum], a
|
||||||
call Func_7387b
|
call GetBoxSRAMLocation
|
||||||
ld de, W_NUMINBOX
|
ld de, W_NUMINBOX
|
||||||
call Func_7390e
|
call CopyBoxToOrFromSRAM ; copy new box from SRAM to WRAM
|
||||||
ld hl, W_MAPTEXTPTR
|
ld hl, W_MAPTEXTPTR
|
||||||
ld de, wChangeBoxSavedMapTextPointer
|
ld de, wChangeBoxSavedMapTextPointer
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
|
|
@ -384,7 +389,8 @@ WhenYouChangeBoxText: ; 73909 (1c:7909)
|
||||||
TX_FAR _WhenYouChangeBoxText
|
TX_FAR _WhenYouChangeBoxText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
Func_7390e: ; 7390e (1c:790e)
|
CopyBoxToOrFromSRAM: ; 7390e (1c:790e)
|
||||||
|
; copy an entire box from hl to de with b as the SRAM bank
|
||||||
push hl
|
push hl
|
||||||
ld a, SRAM_ENABLE
|
ld a, SRAM_ENABLE
|
||||||
ld [MBC1SRamEnable], a
|
ld [MBC1SRamEnable], a
|
||||||
|
|
@ -395,30 +401,33 @@ Func_7390e: ; 7390e (1c:790e)
|
||||||
ld bc, wBoxMonNicksEnd - W_NUMINBOX
|
ld bc, wBoxMonNicksEnd - W_NUMINBOX
|
||||||
call CopyData
|
call CopyData
|
||||||
pop hl
|
pop hl
|
||||||
|
|
||||||
|
; mark the memory that the box was copied from as am empty box
|
||||||
xor a
|
xor a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
dec a
|
dec a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
|
|
||||||
ld hl, sBox1 ; sBox7
|
ld hl, sBox1 ; sBox7
|
||||||
ld bc, sBoxes1CheckSum - sBox1
|
ld bc, sBank2AllBoxesChecksum - sBox1
|
||||||
call SAVCheckSum
|
call SAVCheckSum
|
||||||
ld [sBoxes1CheckSum], a ; sBoxes2CheckSum
|
ld [sBank2AllBoxesChecksum], a ; sBank3AllBoxesChecksum
|
||||||
call Func_73863
|
call CalcIndividualBoxCheckSums
|
||||||
xor a
|
xor a
|
||||||
ld [MBC1SRamBankingMode], a
|
ld [MBC1SRamBankingMode], a
|
||||||
ld [MBC1SRamEnable], a
|
ld [MBC1SRamEnable], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_7393f: ; 7393f (1c:793f)
|
DisplayChangeBoxMenu: ; 7393f (1c:793f)
|
||||||
xor a
|
xor a
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
ld a, $3
|
ld a, A_BUTTON | B_BUTTON
|
||||||
ld [wMenuWatchedKeys], a
|
ld [wMenuWatchedKeys], a
|
||||||
ld a, $b
|
ld a, 11
|
||||||
ld [wMaxMenuItem], a
|
ld [wMaxMenuItem], a
|
||||||
ld a, $1
|
ld a, 1
|
||||||
ld [wTopMenuItemY], a
|
ld [wTopMenuItemY], a
|
||||||
ld a, $c
|
ld a, 12
|
||||||
ld [wTopMenuItemX], a
|
ld [wTopMenuItemX], a
|
||||||
xor a
|
xor a
|
||||||
ld [wMenuWatchMovingOutOfBounds], a
|
ld [wMenuWatchMovingOutOfBounds], a
|
||||||
|
|
@ -427,14 +436,14 @@ Func_7393f: ; 7393f (1c:793f)
|
||||||
ld [wCurrentMenuItem], a
|
ld [wCurrentMenuItem], a
|
||||||
ld [wLastMenuItem], a
|
ld [wLastMenuItem], a
|
||||||
coord hl, 0, 0
|
coord hl, 0, 0
|
||||||
ld b, $2
|
ld b, 2
|
||||||
ld c, $9
|
ld c, 9
|
||||||
call TextBoxBorder
|
call TextBoxBorder
|
||||||
ld hl, ChooseABoxText
|
ld hl, ChooseABoxText
|
||||||
call PrintText
|
call PrintText
|
||||||
coord hl, 11, 0
|
coord hl, 11, 0
|
||||||
ld b, $c
|
ld b, 12
|
||||||
ld c, $7
|
ld c, 7
|
||||||
call TextBoxBorder
|
call TextBoxBorder
|
||||||
ld hl, hFlags_0xFFF6
|
ld hl, hFlags_0xFFF6
|
||||||
set 2, [hl]
|
set 2, [hl]
|
||||||
|
|
@ -446,37 +455,37 @@ Func_7393f: ; 7393f (1c:793f)
|
||||||
ld a, [wCurrentBoxNum]
|
ld a, [wCurrentBoxNum]
|
||||||
and $7f
|
and $7f
|
||||||
cp 9
|
cp 9
|
||||||
jr c, .asm_739a6
|
jr c, .singleDigitBoxNum
|
||||||
sub 9
|
sub 9
|
||||||
coord hl, 8, 2
|
coord hl, 8, 2
|
||||||
ld [hl], "1"
|
ld [hl], "1"
|
||||||
add "0"
|
add "0"
|
||||||
jr .asm_739a8
|
jr .next
|
||||||
.asm_739a6
|
.singleDigitBoxNum
|
||||||
add "1"
|
add "1"
|
||||||
.asm_739a8
|
.next
|
||||||
Coorda 9, 2
|
Coorda 9, 2
|
||||||
coord hl, 1, 2
|
coord hl, 1, 2
|
||||||
ld de, BoxNoText
|
ld de, BoxNoText
|
||||||
call PlaceString
|
call PlaceString
|
||||||
call Func_73a84
|
call GetMonCountsForAllBoxes
|
||||||
coord hl, 18, 1
|
coord hl, 18, 1
|
||||||
ld de, wWhichTrade
|
ld de, wBoxMonCounts
|
||||||
ld bc, SCREEN_WIDTH
|
ld bc, SCREEN_WIDTH
|
||||||
ld a, $c
|
ld a, $c
|
||||||
.asm_739c2
|
.loop
|
||||||
push af
|
push af
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
and a
|
and a ; is the box empty?
|
||||||
jr z, .asm_739c9
|
jr z, .skipPlacingPokeball
|
||||||
ld [hl], $78
|
ld [hl], $78 ; place pokeball tile next to box name if box not empty
|
||||||
.asm_739c9
|
.skipPlacingPokeball
|
||||||
add hl, bc
|
add hl, bc
|
||||||
inc de
|
inc de
|
||||||
pop af
|
pop af
|
||||||
dec a
|
dec a
|
||||||
jr nz, .asm_739c2
|
jr nz, .loop
|
||||||
ld a, $1
|
ld a, 1
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
@ -501,51 +510,54 @@ BoxNames: ; 739d9 (1c:79d9)
|
||||||
BoxNoText: ; 73a21 (1c:7a21)
|
BoxNoText: ; 73a21 (1c:7a21)
|
||||||
db "BOX No.@"
|
db "BOX No.@"
|
||||||
|
|
||||||
Func_73a29: ; 73a29 (1c:7a29)
|
EmptyAllSRAMBoxes: ; 73a29 (1c:7a29)
|
||||||
|
; marks all boxes in SRAM as empty (initialisation for the first time the
|
||||||
|
; player changes the box)
|
||||||
ld a, SRAM_ENABLE
|
ld a, SRAM_ENABLE
|
||||||
ld [MBC1SRamEnable], a
|
ld [MBC1SRamEnable], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [MBC1SRamBankingMode], a
|
ld [MBC1SRamBankingMode], a
|
||||||
ld a, $2
|
ld a, 2
|
||||||
ld [MBC1SRamBank], a
|
ld [MBC1SRamBank], a
|
||||||
call Func_73a4b
|
call EmptySRAMBoxesInBank
|
||||||
ld a, $3
|
ld a, 3
|
||||||
ld [MBC1SRamBank], a
|
ld [MBC1SRamBank], a
|
||||||
call Func_73a4b
|
call EmptySRAMBoxesInBank
|
||||||
xor a
|
xor a
|
||||||
ld [MBC1SRamBankingMode], a
|
ld [MBC1SRamBankingMode], a
|
||||||
ld [MBC1SRamEnable], a
|
ld [MBC1SRamEnable], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_73a4b: ; 73a4b (1c:7a4b)
|
EmptySRAMBoxesInBank: ; 73a4b (1c:7a4b)
|
||||||
|
; marks every box in the current SRAM bank as empty
|
||||||
ld hl, sBox1 ; sBox7
|
ld hl, sBox1 ; sBox7
|
||||||
call Func_73a7f
|
call EmptySRAMBox
|
||||||
ld hl, sBox2 ; sBox8
|
ld hl, sBox2 ; sBox8
|
||||||
call Func_73a7f
|
call EmptySRAMBox
|
||||||
ld hl, sBox3 ; sBox9
|
ld hl, sBox3 ; sBox9
|
||||||
call Func_73a7f
|
call EmptySRAMBox
|
||||||
ld hl, sBox4 ; sBox10
|
ld hl, sBox4 ; sBox10
|
||||||
call Func_73a7f
|
call EmptySRAMBox
|
||||||
ld hl, sBox5 ; sBox11
|
ld hl, sBox5 ; sBox11
|
||||||
call Func_73a7f
|
call EmptySRAMBox
|
||||||
ld hl, sBox6 ; sBox12
|
ld hl, sBox6 ; sBox12
|
||||||
call Func_73a7f
|
call EmptySRAMBox
|
||||||
ld hl, sBox1 ; sBox7
|
ld hl, sBox1 ; sBox7
|
||||||
ld bc, sBoxes1CheckSum - sBox1
|
ld bc, sBank2AllBoxesChecksum - sBox1
|
||||||
call SAVCheckSum
|
call SAVCheckSum
|
||||||
ld [sBoxes1CheckSum], a ; sBoxes2CheckSum
|
ld [sBank2AllBoxesChecksum], a ; sBank3AllBoxesChecksum
|
||||||
call Func_73863
|
call CalcIndividualBoxCheckSums
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_73a7f: ; 73a7f (1c:7a7f)
|
EmptySRAMBox: ; 73a7f (1c:7a7f)
|
||||||
xor a
|
xor a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
dec a
|
dec a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_73a84: ; 73a84 (1c:7a84)
|
GetMonCountsForAllBoxes: ; 73a84 (1c:7a84)
|
||||||
ld hl, wWhichTrade
|
ld hl, wBoxMonCounts
|
||||||
push hl
|
push hl
|
||||||
ld a, SRAM_ENABLE
|
ld a, SRAM_ENABLE
|
||||||
ld [MBC1SRamEnable], a
|
ld [MBC1SRamEnable], a
|
||||||
|
|
@ -553,24 +565,27 @@ Func_73a84: ; 73a84 (1c:7a84)
|
||||||
ld [MBC1SRamBankingMode], a
|
ld [MBC1SRamBankingMode], a
|
||||||
ld a, $2
|
ld a, $2
|
||||||
ld [MBC1SRamBank], a
|
ld [MBC1SRamBank], a
|
||||||
call Func_73ab8
|
call GetMonCountsForBoxesInBank
|
||||||
ld a, $3
|
ld a, $3
|
||||||
ld [MBC1SRamBank], a
|
ld [MBC1SRamBank], a
|
||||||
call Func_73ab8
|
call GetMonCountsForBoxesInBank
|
||||||
xor a
|
xor a
|
||||||
ld [MBC1SRamBankingMode], a
|
ld [MBC1SRamBankingMode], a
|
||||||
ld [MBC1SRamEnable], a
|
ld [MBC1SRamEnable], a
|
||||||
pop hl
|
pop hl
|
||||||
|
|
||||||
|
; copy the count for the current box from WRAM
|
||||||
ld a, [wCurrentBoxNum]
|
ld a, [wCurrentBoxNum]
|
||||||
and $7f
|
and $7f
|
||||||
ld c, a
|
ld c, a
|
||||||
ld b, $0
|
ld b, 0
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [W_NUMINBOX]
|
ld a, [W_NUMINBOX]
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_73ab8: ; 73ab8 (1c:7ab8)
|
GetMonCountsForBoxesInBank: ; 73ab8 (1c:7ab8)
|
||||||
ld a, [sBox1] ; sBox7
|
ld a, [sBox1] ; sBox7
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld a, [sBox2] ; sBox8
|
ld a, [sBox2] ; sBox8
|
||||||
|
|
@ -646,7 +661,7 @@ SaveHallOfFameTeams: ; 73b0d (1c:7b0d)
|
||||||
LoadHallOfFameTeams: ; 73b3f (1c:7b3f)
|
LoadHallOfFameTeams: ; 73b3f (1c:7b3f)
|
||||||
ld hl, sHallOfFame
|
ld hl, sHallOfFame
|
||||||
ld bc, HOF_TEAM
|
ld bc, HOF_TEAM
|
||||||
ld a, [wWhichTrade]
|
ld a, [wHoFTeamIndex]
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
ld de, wcc5b
|
ld de, wcc5b
|
||||||
ld bc, HOF_TEAM
|
ld bc, HOF_TEAM
|
||||||
|
|
|
||||||
|
|
@ -867,7 +867,7 @@ LoadSlotMachineTiles: ; 378a8 (d:78a8)
|
||||||
ld bc, $00f0
|
ld bc, $00f0
|
||||||
call CopyData
|
call CopyData
|
||||||
call EnableLCD
|
call EnableLCD
|
||||||
ld hl, wTrainerEngageDistance
|
ld hl, wSlotMachineWheel1Offset
|
||||||
ld a, $1c
|
ld a, $1c
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ SetDefaultNamesBeforeTitlescreen: ; 42b7 (1:42b7)
|
||||||
ld [wc0ef], a
|
ld [wc0ef], a
|
||||||
ld [wc0f0], a
|
ld [wc0f0], a
|
||||||
|
|
||||||
LoadTitlescreenGraphics: ; 42dd (1:42dd)
|
DisplayTitleScreen: ; 42dd (1:42dd)
|
||||||
call GBPalWhiteOut
|
call GBPalWhiteOut
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
|
|
|
||||||
|
|
@ -23,17 +23,17 @@ rLCDC_DEFAULT EQU %11100011
|
||||||
xor a
|
xor a
|
||||||
ld [rIF], a
|
ld [rIF], a
|
||||||
ld [rIE], a
|
ld [rIE], a
|
||||||
ld [$ff43], a
|
ld [rSCX], a
|
||||||
ld [$ff42], a
|
ld [rSCY], a
|
||||||
ld [rSB], a
|
ld [rSB], a
|
||||||
ld [rSC], a
|
ld [rSC], a
|
||||||
ld [rWX], a
|
ld [rWX], a
|
||||||
ld [$ff4a], a
|
ld [rWY], a
|
||||||
ld [$ff06], a
|
ld [rTMA], a
|
||||||
ld [$ff07], a
|
ld [rTAC], a
|
||||||
ld [rBGP], a
|
ld [rBGP], a
|
||||||
ld [rOBP0], a
|
ld [rOBP0], a
|
||||||
ld [$ff49], a
|
ld [rOBP1], a
|
||||||
|
|
||||||
ld a, rLCDC_ENABLE_MASK
|
ld a, rLCDC_ENABLE_MASK
|
||||||
ld [rLCDC], a
|
ld [rLCDC], a
|
||||||
|
|
@ -66,10 +66,10 @@ rLCDC_DEFAULT EQU %11100011
|
||||||
|
|
||||||
xor a
|
xor a
|
||||||
ld [hTilesetType], a
|
ld [hTilesetType], a
|
||||||
ld [$ff41], a
|
ld [rSTAT], a
|
||||||
ld [hSCX], a
|
ld [hSCX], a
|
||||||
ld [hSCY], a
|
ld [hSCY], a
|
||||||
ld [$ff0f], a
|
ld [rIF], a
|
||||||
ld a, 1 << VBLANK + 1 << TIMER + 1 << SERIAL
|
ld a, 1 << VBLANK + 1 << TIMER + 1 << SERIAL
|
||||||
ld [rIE], a
|
ld [rIE], a
|
||||||
|
|
||||||
|
|
|
||||||
4
hram.asm
4
hram.asm
|
|
@ -90,6 +90,8 @@ hNPCSpriteOffset EQU $FF95
|
||||||
; temp value used when swapping bytes
|
; temp value used when swapping bytes
|
||||||
hSwapTemp EQU $FF95
|
hSwapTemp EQU $FF95
|
||||||
|
|
||||||
|
hExperience EQU $FF96 ; 3 bytes, big endian
|
||||||
|
|
||||||
; Multiplcation and division variables are meant
|
; Multiplcation and division variables are meant
|
||||||
; to overlap for back-to-back usage. Big endian.
|
; to overlap for back-to-back usage. Big endian.
|
||||||
|
|
||||||
|
|
@ -261,6 +263,8 @@ hQuotient2 EQU $FFE7
|
||||||
|
|
||||||
hSpriteVRAMSlotAndFacing EQU $FFE9
|
hSpriteVRAMSlotAndFacing EQU $FFE9
|
||||||
|
|
||||||
|
hCoordsInFrontOfPlayerMatch EQU $FFEA
|
||||||
|
|
||||||
hSpriteAnimFrameCounter EQU $FFEA
|
hSpriteAnimFrameCounter EQU $FFEA
|
||||||
|
|
||||||
H_WHOSETURN EQU $FFF3 ; 0 on player’s turn, 1 on enemy’s turn
|
H_WHOSETURN EQU $FFF3 ; 0 on player’s turn, 1 on enemy’s turn
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ dex EQUS "db $5f, $50" ; End a Pokedex entry.
|
||||||
percent EQUS "* $ff / 100"
|
percent EQUS "* $ff / 100"
|
||||||
|
|
||||||
lb: MACRO ; r, hi, lo
|
lb: MACRO ; r, hi, lo
|
||||||
ld \1, (\2) << 8 + (\3)
|
ld \1, (\2) << 8 + ((\3) & $ff)
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
8
main.asm
8
main.asm
|
|
@ -3743,7 +3743,7 @@ _AddPartyMon: ; f2e5 (3:72e5)
|
||||||
dec de
|
dec de
|
||||||
dec de
|
dec de
|
||||||
xor a
|
xor a
|
||||||
ld [wHPBarMaxHP], a
|
ld [wLearningMovesFromDayCare], a
|
||||||
predef WriteMonMoves
|
predef WriteMonMoves
|
||||||
pop de
|
pop de
|
||||||
ld a, [wPlayerID] ; set trainer ID to player ID
|
ld a, [wPlayerID] ; set trainer ID to player ID
|
||||||
|
|
@ -3758,13 +3758,13 @@ _AddPartyMon: ; f2e5 (3:72e5)
|
||||||
callab CalcExperience
|
callab CalcExperience
|
||||||
pop de
|
pop de
|
||||||
inc de
|
inc de
|
||||||
ld a, [H_MULTIPLICAND] ; write experience
|
ld a, [hExperience] ; write experience
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
ld a, [H_MULTIPLICAND+1]
|
ld a, [hExperience + 1]
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
ld a, [H_MULTIPLICAND+2]
|
ld a, [hExperience + 2]
|
||||||
ld [de], a
|
ld [de], a
|
||||||
xor a
|
xor a
|
||||||
ld b, $a
|
ld b, $a
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ AgathaScript0: ; 76490 (1d:6490)
|
||||||
ld [hJoyHeld], a
|
ld [hJoyHeld], a
|
||||||
ld [wSimulatedJoypadStatesEnd], a
|
ld [wSimulatedJoypadStatesEnd], a
|
||||||
ld [wSimulatedJoypadStatesIndex], a
|
ld [wSimulatedJoypadStatesIndex], a
|
||||||
ld a, [wWhichTrade]
|
ld a, [wCoordIndex]
|
||||||
cp $3
|
cp $3
|
||||||
jr c, .asm_764b4
|
jr c, .asm_764b4
|
||||||
ld hl, wd865
|
ld hl, wd865
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ BrunoScript0: ; 76339 (1d:6339)
|
||||||
ld [hJoyHeld], a
|
ld [hJoyHeld], a
|
||||||
ld [wSimulatedJoypadStatesEnd], a
|
ld [wSimulatedJoypadStatesEnd], a
|
||||||
ld [wSimulatedJoypadStatesIndex], a
|
ld [wSimulatedJoypadStatesIndex], a
|
||||||
ld a, [wWhichTrade]
|
ld a, [wCoordIndex]
|
||||||
cp $3
|
cp $3
|
||||||
jr c, .asm_7635d
|
jr c, .asm_7635d
|
||||||
ld hl, wd864
|
ld hl, wd864
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ CeruleanCityScript0: ; 194c8 (6:54c8)
|
||||||
ld hl, CeruleanCityCoords1
|
ld hl, CeruleanCityCoords1
|
||||||
call ArePlayerCoordsInArray
|
call ArePlayerCoordsInArray
|
||||||
jr nc, .asm_194f7
|
jr nc, .asm_194f7
|
||||||
ld a, [wWhichTrade]
|
ld a, [wCoordIndex]
|
||||||
cp $1
|
cp $1
|
||||||
ld a, $8
|
ld a, $8
|
||||||
ld b, SPRITE_FACING_DOWN
|
ld b, SPRITE_FACING_DOWN
|
||||||
|
|
|
||||||
|
|
@ -9,19 +9,19 @@ DayCareMText1: ; 56254 (15:6254)
|
||||||
call SaveScreenTilesToBuffer2
|
call SaveScreenTilesToBuffer2
|
||||||
ld a, [W_DAYCARE_IN_USE]
|
ld a, [W_DAYCARE_IN_USE]
|
||||||
and a
|
and a
|
||||||
jp nz, DayCareMScript_562e1
|
jp nz, .daycareInUse
|
||||||
ld hl, DayCareMText_5640f
|
ld hl, DayCareIntroText
|
||||||
call PrintText
|
call PrintText
|
||||||
call YesNoChoice
|
call YesNoChoice
|
||||||
ld a, [wCurrentMenuItem]
|
ld a, [wCurrentMenuItem]
|
||||||
and a
|
and a
|
||||||
ld hl, DayCareMText_5643b
|
ld hl, DayCareComeAgainText
|
||||||
jp nz, DayCareMScript_56409
|
jp nz, .done
|
||||||
ld a, [wPartyCount]
|
ld a, [wPartyCount]
|
||||||
dec a
|
dec a
|
||||||
ld hl, DayCareMText_56445
|
ld hl, DayCareOnlyHaveOneMonText
|
||||||
jp z, DayCareMScript_56409
|
jp z, .done
|
||||||
ld hl, DayCareMText_56414
|
ld hl, DayCareWhichMonText
|
||||||
call PrintText
|
call PrintText
|
||||||
xor a
|
xor a
|
||||||
ld [wUpdateSpritesEnabled], a
|
ld [wUpdateSpritesEnabled], a
|
||||||
|
|
@ -33,17 +33,17 @@ DayCareMText1: ; 56254 (15:6254)
|
||||||
call RestoreScreenTilesAndReloadTilePatterns
|
call RestoreScreenTilesAndReloadTilePatterns
|
||||||
call LoadGBPal
|
call LoadGBPal
|
||||||
pop af
|
pop af
|
||||||
ld hl, DayCareMText_56437
|
ld hl, DayCareAllRightThenText
|
||||||
jp c, DayCareMScript_56409
|
jp c, .done
|
||||||
callab KnowsHMMove
|
callab KnowsHMMove
|
||||||
ld hl, DayCareMText_5644a
|
ld hl, DayCareCantAcceptMonWithHMText
|
||||||
jp c, DayCareMScript_56409
|
jp c, .done
|
||||||
xor a
|
xor a
|
||||||
ld [wPartyAndBillsPCSavedMenuItem], a
|
ld [wPartyAndBillsPCSavedMenuItem], a
|
||||||
ld a, [wWhichPokemon]
|
ld a, [wWhichPokemon]
|
||||||
ld hl, wPartyMonNicks
|
ld hl, wPartyMonNicks
|
||||||
call GetPartyMonName
|
call GetPartyMonName
|
||||||
ld hl, DayCareMText_56419
|
ld hl, DayCareWillLookAfterMonText
|
||||||
call PrintText
|
call PrintText
|
||||||
ld a, 1
|
ld a, 1
|
||||||
ld [W_DAYCARE_IN_USE], a
|
ld [W_DAYCARE_IN_USE], a
|
||||||
|
|
@ -55,10 +55,10 @@ DayCareMText1: ; 56254 (15:6254)
|
||||||
call RemovePokemon
|
call RemovePokemon
|
||||||
ld a, [wcf91]
|
ld a, [wcf91]
|
||||||
call PlayCry
|
call PlayCry
|
||||||
ld hl, DayCareMText_5641e
|
ld hl, DayCareComeSeeMeInAWhileText
|
||||||
jp DayCareMScript_56409
|
jp .done
|
||||||
|
|
||||||
DayCareMScript_562e1: ; 562e1 (15:62e1)
|
.daycareInUse
|
||||||
xor a
|
xor a
|
||||||
ld hl, W_DAYCAREMONNAME
|
ld hl, W_DAYCAREMONNAME
|
||||||
call GetPartyMonName
|
call GetPartyMonName
|
||||||
|
|
@ -68,40 +68,41 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
|
||||||
callab CalcLevelFromExperience
|
callab CalcLevelFromExperience
|
||||||
ld a, d
|
ld a, d
|
||||||
cp MAX_LEVEL
|
cp MAX_LEVEL
|
||||||
jr c, .asm_56315
|
jr c, .skipCalcExp
|
||||||
|
|
||||||
ld d, MAX_LEVEL
|
ld d, MAX_LEVEL
|
||||||
callab CalcExperience
|
callab CalcExperience
|
||||||
ld hl, wDayCareMonExp
|
ld hl, wDayCareMonExp
|
||||||
ld a, [H_NUMTOPRINT]
|
ld a, [hExperience]
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld a, [$ff97]
|
ld a, [hExperience + 1]
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld a, [$ff98]
|
ld a, [hExperience + 2]
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld d, MAX_LEVEL
|
ld d, MAX_LEVEL
|
||||||
|
|
||||||
.asm_56315
|
.skipCalcExp
|
||||||
xor a
|
xor a
|
||||||
ld [wTrainerEngageDistance], a
|
ld [wDayCareNumLevelsGrown], a
|
||||||
ld hl, wDayCareMonBoxLevel
|
ld hl, wDayCareMonBoxLevel
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [wTrainerSpriteOffset], a
|
ld [wDayCareStartLevel], a
|
||||||
cp d
|
cp d
|
||||||
ld [hl], d
|
ld [hl], d
|
||||||
ld hl, DayCareMText_56432
|
ld hl, DayCareMonNeedsMoreTimeText
|
||||||
jr z, .asm_56333
|
jr z, .next
|
||||||
ld a, [wTrainerSpriteOffset]
|
ld a, [wDayCareStartLevel]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, d
|
ld a, d
|
||||||
sub b
|
sub b
|
||||||
ld [wTrainerEngageDistance], a
|
ld [wDayCareNumLevelsGrown], a
|
||||||
ld hl, DayCareMText_56423
|
ld hl, DayCareMonHasGrownText
|
||||||
|
|
||||||
.asm_56333
|
.next
|
||||||
call PrintText
|
call PrintText
|
||||||
ld a, [wPartyCount]
|
ld a, [wPartyCount]
|
||||||
cp PARTY_LENGTH
|
cp PARTY_LENGTH
|
||||||
ld hl, DayCareMText_56440
|
ld hl, DayCareNoRoomForMonText
|
||||||
jp z, .asm_56403
|
jp z, .asm_56403
|
||||||
ld de, wTrainerFacingDirection
|
ld de, wTrainerFacingDirection
|
||||||
xor a
|
xor a
|
||||||
|
|
@ -112,7 +113,7 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], $0
|
ld [hl], $0
|
||||||
ld a, [wTrainerEngageDistance]
|
ld a, [wDayCareNumLevelsGrown]
|
||||||
inc a
|
inc a
|
||||||
ld b, a
|
ld b, a
|
||||||
ld c, $2
|
ld c, $2
|
||||||
|
|
@ -126,13 +127,13 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
|
||||||
pop hl
|
pop hl
|
||||||
dec b
|
dec b
|
||||||
jr nz, .asm_56357
|
jr nz, .asm_56357
|
||||||
ld hl, DayCareMText_56428
|
ld hl, DayCareOweMoneyText
|
||||||
call PrintText
|
call PrintText
|
||||||
ld a, $13
|
ld a, $13
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
call YesNoChoice
|
call YesNoChoice
|
||||||
ld hl, DayCareMText_56437
|
ld hl, DayCareAllRightThenText
|
||||||
ld a, [wCurrentMenuItem]
|
ld a, [wCurrentMenuItem]
|
||||||
and a
|
and a
|
||||||
jp nz, .asm_56403
|
jp nz, .asm_56403
|
||||||
|
|
@ -144,13 +145,13 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
|
||||||
ld [hMoney + 2], a
|
ld [hMoney + 2], a
|
||||||
call HasEnoughMoney
|
call HasEnoughMoney
|
||||||
jr nc, .asm_56396
|
jr nc, .asm_56396
|
||||||
ld hl, DayCareMText_56454
|
ld hl, DayCareNotEnoughMoneyText
|
||||||
jp .asm_56403
|
jp .asm_56403
|
||||||
|
|
||||||
.asm_56396
|
.asm_56396
|
||||||
xor a
|
xor a
|
||||||
ld [W_DAYCARE_IN_USE], a
|
ld [W_DAYCARE_IN_USE], a
|
||||||
ld hl, wTrainerEngageDistance
|
ld hl, wDayCareNumLevelsGrown
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
inc hl
|
inc hl
|
||||||
ld de, wPlayerMoney + 2
|
ld de, wPlayerMoney + 2
|
||||||
|
|
@ -161,7 +162,7 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
|
||||||
ld a, MONEY_BOX
|
ld a, MONEY_BOX
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
ld hl, DayCareMText_5644f
|
ld hl, DayCareHeresYourMonText
|
||||||
call PrintText
|
call PrintText
|
||||||
ld a, DAYCARE_TO_PARTY
|
ld a, DAYCARE_TO_PARTY
|
||||||
ld [wMoveMonType], a
|
ld [wMoveMonType], a
|
||||||
|
|
@ -178,10 +179,12 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
|
||||||
ld d, h
|
ld d, h
|
||||||
ld e, l
|
ld e, l
|
||||||
ld a, 1
|
ld a, 1
|
||||||
ld [wHPBarMaxHP], a
|
ld [wLearningMovesFromDayCare], a
|
||||||
predef WriteMonMoves
|
predef WriteMonMoves
|
||||||
pop bc
|
pop bc
|
||||||
pop af
|
pop af
|
||||||
|
|
||||||
|
; set mon's HP to max
|
||||||
ld hl, wPartyMon1HP
|
ld hl, wPartyMon1HP
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
ld d, h
|
ld d, h
|
||||||
|
|
@ -193,73 +196,74 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
|
||||||
inc de
|
inc de
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [de], a
|
ld [de], a
|
||||||
|
|
||||||
ld a, [wcf91]
|
ld a, [wcf91]
|
||||||
call PlayCry
|
call PlayCry
|
||||||
ld hl, DayCareMText_5642d
|
ld hl, DayCareGotMonBackText
|
||||||
jr DayCareMScript_56409
|
jr .done
|
||||||
|
|
||||||
.asm_56403
|
.asm_56403
|
||||||
ld a, [wTrainerSpriteOffset]
|
ld a, [wDayCareStartLevel]
|
||||||
ld [wDayCareMonBoxLevel], a
|
ld [wDayCareMonBoxLevel], a
|
||||||
|
|
||||||
DayCareMScript_56409: ; 56409 (15:6409)
|
.done
|
||||||
call PrintText
|
call PrintText
|
||||||
jp TextScriptEnd
|
jp TextScriptEnd
|
||||||
|
|
||||||
DayCareMText_5640f: ; 5640f (15:640f)
|
DayCareIntroText: ; 5640f (15:640f)
|
||||||
TX_FAR _DayCareMText_5640f
|
TX_FAR _DayCareIntroText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
DayCareMText_56414: ; 56414 (15:6414)
|
DayCareWhichMonText: ; 56414 (15:6414)
|
||||||
TX_FAR _DayCareMText_56414
|
TX_FAR _DayCareWhichMonText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
DayCareMText_56419: ; 56419 (15:6419)
|
DayCareWillLookAfterMonText: ; 56419 (15:6419)
|
||||||
TX_FAR _DayCareMText_56419
|
TX_FAR _DayCareWillLookAfterMonText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
DayCareMText_5641e: ; 5641e (15:641e)
|
DayCareComeSeeMeInAWhileText: ; 5641e (15:641e)
|
||||||
TX_FAR _DayCareMText_5641e
|
TX_FAR _DayCareComeSeeMeInAWhileText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
DayCareMText_56423: ; 56423 (15:6423)
|
DayCareMonHasGrownText: ; 56423 (15:6423)
|
||||||
TX_FAR _DayCareMText_56423
|
TX_FAR _DayCareMonHasGrownText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
DayCareMText_56428: ; 56428 (15:6428)
|
DayCareOweMoneyText: ; 56428 (15:6428)
|
||||||
TX_FAR _DayCareMText_56428
|
TX_FAR _DayCareOweMoneyText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
DayCareMText_5642d: ; 5642d (15:642d)
|
DayCareGotMonBackText: ; 5642d (15:642d)
|
||||||
TX_FAR _DayCareMText_5642d
|
TX_FAR _DayCareGotMonBackText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
DayCareMText_56432: ; 56432 (15:6432)
|
DayCareMonNeedsMoreTimeText: ; 56432 (15:6432)
|
||||||
TX_FAR _DayCareMText_56432
|
TX_FAR _DayCareMonNeedsMoreTimeText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
DayCareMText_56437: ; 56437 (15:6437)
|
DayCareAllRightThenText: ; 56437 (15:6437)
|
||||||
TX_FAR _DayCareMText_56437
|
TX_FAR _DayCareAllRightThenText
|
||||||
DayCareMText_5643b: ; 5643b (15:643b)
|
DayCareComeAgainText: ; 5643b (15:643b)
|
||||||
TX_FAR _DayCareMText_5643b
|
TX_FAR _DayCareComeAgainText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
DayCareMText_56440: ; 56440 (15:6440)
|
DayCareNoRoomForMonText: ; 56440 (15:6440)
|
||||||
TX_FAR _DayCareMText_56440
|
TX_FAR _DayCareNoRoomForMonText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
DayCareMText_56445: ; 56445 (15:6445)
|
DayCareOnlyHaveOneMonText: ; 56445 (15:6445)
|
||||||
TX_FAR _DayCareMText_56445
|
TX_FAR _DayCareOnlyHaveOneMonText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
DayCareMText_5644a: ; 5644a (15:644a)
|
DayCareCantAcceptMonWithHMText: ; 5644a (15:644a)
|
||||||
TX_FAR _DayCareMText_5644a
|
TX_FAR _DayCareCantAcceptMonWithHMText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
DayCareMText_5644f: ; 5644f (15:644f)
|
DayCareHeresYourMonText: ; 5644f (15:644f)
|
||||||
TX_FAR _DayCareMText_5644f
|
TX_FAR _DayCareHeresYourMonText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
DayCareMText_56454: ; 56454 (15:6454)
|
DayCareNotEnoughMoneyText: ; 56454 (15:6454)
|
||||||
TX_FAR _DayCareMText_56454
|
TX_FAR _DayCareNotEnoughMoneyText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ LanceScript0: ; 5a305 (16:6305)
|
||||||
jp nc, CheckFightingMapTrainers
|
jp nc, CheckFightingMapTrainers
|
||||||
xor a
|
xor a
|
||||||
ld [hJoyHeld], a
|
ld [hJoyHeld], a
|
||||||
ld a, [wWhichTrade]
|
ld a, [wCoordIndex]
|
||||||
cp $3
|
cp $3
|
||||||
jr nc, .asm_5a325
|
jr nc, .asm_5a325
|
||||||
ld a, $1
|
ld a, $1
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ LoreleiScript0: ; 761e2 (1d:61e2)
|
||||||
ld [hJoyHeld], a
|
ld [hJoyHeld], a
|
||||||
ld [wSimulatedJoypadStatesEnd], a
|
ld [wSimulatedJoypadStatesEnd], a
|
||||||
ld [wSimulatedJoypadStatesIndex], a
|
ld [wSimulatedJoypadStatesIndex], a
|
||||||
ld a, [wWhichTrade]
|
ld a, [wCoordIndex]
|
||||||
cp $3
|
cp $3
|
||||||
jr c, .asm_76206
|
jr c, .asm_76206
|
||||||
ld hl, wd863
|
ld hl, wd863
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ Mansion3Script_5225b: ; 5225b (14:625b)
|
||||||
ret nz
|
ret nz
|
||||||
call ArePlayerCoordsInArray
|
call ArePlayerCoordsInArray
|
||||||
ret nc
|
ret nc
|
||||||
ld a, [wWhichTrade]
|
ld a, [wCoordIndex]
|
||||||
ld [wWhichDungeonWarp], a
|
ld [wWhichDungeonWarp], a
|
||||||
ld hl, wd72d
|
ld hl, wd72d
|
||||||
set 4, [hl]
|
set 4, [hl]
|
||||||
|
|
|
||||||
|
|
@ -25,51 +25,51 @@ MtMoonPokecenterText4: ; 492ec (12:52ec)
|
||||||
TX_ASM
|
TX_ASM
|
||||||
ld a, [wd7c6]
|
ld a, [wd7c6]
|
||||||
add a
|
add a
|
||||||
jp c, .asm_49353
|
jp c, .alreadyBoughtMagikarp
|
||||||
ld hl, MtMoonPokecenterText_4935c
|
ld hl, MtMoonPokecenterText_4935c
|
||||||
call PrintText
|
call PrintText
|
||||||
ld a, $13
|
ld a, MONEY_BOX
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
call YesNoChoice
|
call YesNoChoice
|
||||||
ld a, [wCurrentMenuItem]
|
ld a, [wCurrentMenuItem]
|
||||||
and a
|
and a
|
||||||
jp nz, .asm_4934e
|
jp nz, .choseNo
|
||||||
ld [hMoney], a
|
ld [hMoney], a
|
||||||
ld [hMoney + 2], a
|
ld [hMoney + 2], a
|
||||||
ld a, $5
|
ld a, $5
|
||||||
ld [hMoney + 1], a
|
ld [hMoney + 1], a
|
||||||
call HasEnoughMoney
|
call HasEnoughMoney
|
||||||
jr nc, .asm_faa09
|
jr nc, .enoughMoney
|
||||||
ld hl, MtMoonPokecenterText_49366
|
ld hl, MtMoonPokecenterText_49366
|
||||||
jr .asm_49356
|
jr .printText
|
||||||
.asm_faa09
|
.enoughMoney
|
||||||
ld bc,(MAGIKARP << 8) | 5
|
ld bc,(MAGIKARP << 8) | 5
|
||||||
call GivePokemon
|
call GivePokemon
|
||||||
jr nc, .asm_49359
|
jr nc, .done
|
||||||
xor a
|
xor a
|
||||||
ld [wWhichTrade], a
|
ld [wPriceTemp], a
|
||||||
ld [wTrainerFacingDirection], a
|
ld [wPriceTemp + 2], a
|
||||||
ld a, $5
|
ld a, $5
|
||||||
ld [wTrainerEngageDistance], a
|
ld [wPriceTemp + 1], a
|
||||||
ld hl, wTrainerFacingDirection
|
ld hl, wPriceTemp + 2
|
||||||
ld de, wPlayerMoney + 2
|
ld de, wPlayerMoney + 2
|
||||||
ld c, $3
|
ld c, $3
|
||||||
predef SubBCDPredef
|
predef SubBCDPredef
|
||||||
ld a, $13
|
ld a, MONEY_BOX
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
ld hl, wd7c6
|
ld hl, wd7c6
|
||||||
set 7, [hl]
|
set 7, [hl]
|
||||||
jr .asm_49359
|
jr .done
|
||||||
.asm_4934e
|
.choseNo
|
||||||
ld hl, MtMoonPokecenterText_49361
|
ld hl, MtMoonPokecenterText_49361
|
||||||
jr .asm_49356
|
jr .printText
|
||||||
.asm_49353
|
.alreadyBoughtMagikarp
|
||||||
ld hl, MtMoonPokecenterText_4936b
|
ld hl, MtMoonPokecenterText_4936b
|
||||||
.asm_49356
|
.printText
|
||||||
call PrintText
|
call PrintText
|
||||||
.asm_49359
|
.done
|
||||||
jp TextScriptEnd
|
jp TextScriptEnd
|
||||||
|
|
||||||
MtMoonPokecenterText_4935c: ; 4935c (12:535c)
|
MtMoonPokecenterText_4935c: ; 4935c (12:535c)
|
||||||
|
|
|
||||||
|
|
@ -96,11 +96,11 @@ Museum1FText1: ; 5c135 (17:4135)
|
||||||
ld hl, wd754
|
ld hl, wd754
|
||||||
set 0, [hl]
|
set 0, [hl]
|
||||||
xor a
|
xor a
|
||||||
ld [wMuseumPriceTemp], a
|
ld [wPriceTemp], a
|
||||||
ld [wMuseumPriceTemp + 1], a
|
ld [wPriceTemp + 1], a
|
||||||
ld a, $50
|
ld a, $50
|
||||||
ld [wMuseumPriceTemp + 2], a
|
ld [wPriceTemp + 2], a
|
||||||
ld hl, wMuseumPriceTemp + 2
|
ld hl, wPriceTemp + 2
|
||||||
ld de, wPlayerMoney + 2
|
ld de, wPlayerMoney + 2
|
||||||
ld c, $3
|
ld c, $3
|
||||||
predef SubBCDPredef
|
predef SubBCDPredef
|
||||||
|
|
|
||||||
|
|
@ -307,7 +307,7 @@ OaksLabScript9: ; 1cd00 (7:4d00)
|
||||||
ld a, $d
|
ld a, $d
|
||||||
ld [hSpriteIndexOrTextID], a
|
ld [hSpriteIndexOrTextID], a
|
||||||
call DisplayTextID
|
call DisplayTextID
|
||||||
ld a, [wTrainerEngageDistance]
|
ld a, [wRivalStarterBallSpriteIndex]
|
||||||
cp $2
|
cp $2
|
||||||
jr nz, .asm_1cd28
|
jr nz, .asm_1cd28
|
||||||
ld a, HS_STARTER_BALL_1
|
ld a, HS_STARTER_BALL_1
|
||||||
|
|
@ -323,7 +323,7 @@ OaksLabScript9: ; 1cd00 (7:4d00)
|
||||||
ld [wcc4d], a
|
ld [wcc4d], a
|
||||||
predef HideObject
|
predef HideObject
|
||||||
call Delay3
|
call Delay3
|
||||||
ld a, [wWhichTrade]
|
ld a, [wRivalStarterTemp]
|
||||||
ld [W_RIVALSTARTER], a
|
ld [W_RIVALSTARTER], a
|
||||||
ld [wcf91], a
|
ld [wcf91], a
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
|
|
@ -806,9 +806,9 @@ OaksLabText29: ; 1d102 (7:5102)
|
||||||
OaksLabText2: ; 1d102 (7:5102)
|
OaksLabText2: ; 1d102 (7:5102)
|
||||||
TX_ASM
|
TX_ASM
|
||||||
ld a, STARTER2
|
ld a, STARTER2
|
||||||
ld [wWhichTrade], a
|
ld [wRivalStarterTemp], a
|
||||||
ld a, $3
|
ld a, $3
|
||||||
ld [wTrainerEngageDistance], a
|
ld [wRivalStarterBallSpriteIndex], a
|
||||||
ld a, STARTER1
|
ld a, STARTER1
|
||||||
ld b, $2
|
ld b, $2
|
||||||
jr OaksLabScript_1d133
|
jr OaksLabScript_1d133
|
||||||
|
|
@ -817,9 +817,9 @@ OaksLabText30: ; 1d113 (7:5113)
|
||||||
OaksLabText3: ; 1d113 (7:5113)
|
OaksLabText3: ; 1d113 (7:5113)
|
||||||
TX_ASM
|
TX_ASM
|
||||||
ld a, STARTER3
|
ld a, STARTER3
|
||||||
ld [wWhichTrade], a
|
ld [wRivalStarterTemp], a
|
||||||
ld a, $4
|
ld a, $4
|
||||||
ld [wTrainerEngageDistance], a
|
ld [wRivalStarterBallSpriteIndex], a
|
||||||
ld a, STARTER2
|
ld a, STARTER2
|
||||||
ld b, $3
|
ld b, $3
|
||||||
jr OaksLabScript_1d133
|
jr OaksLabScript_1d133
|
||||||
|
|
@ -828,9 +828,9 @@ OaksLabText31: ; 1d124 (7:5124)
|
||||||
OaksLabText4: ; 1d124 (7:5124)
|
OaksLabText4: ; 1d124 (7:5124)
|
||||||
TX_ASM
|
TX_ASM
|
||||||
ld a, STARTER1
|
ld a, STARTER1
|
||||||
ld [wWhichTrade], a
|
ld [wRivalStarterTemp], a
|
||||||
ld a, $2
|
ld a, $2
|
||||||
ld [wTrainerEngageDistance], a
|
ld [wRivalStarterBallSpriteIndex], a
|
||||||
ld a, STARTER3
|
ld a, STARTER3
|
||||||
ld b, $4
|
ld b, $4
|
||||||
|
|
||||||
|
|
@ -858,13 +858,13 @@ OaksLabScript_1d157: ; 1d157 (7:5157)
|
||||||
ld a, $9
|
ld a, $9
|
||||||
ld [H_SPRITEDATAOFFSET], a
|
ld [H_SPRITEDATAOFFSET], a
|
||||||
call GetPointerWithinSpriteStateData1
|
call GetPointerWithinSpriteStateData1
|
||||||
ld [hl], $0
|
ld [hl], SPRITE_FACING_DOWN
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [H_SPRITEINDEX], a
|
ld [H_SPRITEINDEX], a
|
||||||
ld a, $9
|
ld a, $9
|
||||||
ld [H_SPRITEDATAOFFSET], a
|
ld [H_SPRITEDATAOFFSET], a
|
||||||
call GetPointerWithinSpriteStateData1
|
call GetPointerWithinSpriteStateData1
|
||||||
ld [hl], $c
|
ld [hl], SPRITE_FACING_RIGHT
|
||||||
ld hl, wd730
|
ld hl, wd730
|
||||||
set 6, [hl]
|
set 6, [hl]
|
||||||
predef StarterDex ; StarterDex
|
predef StarterDex ; StarterDex
|
||||||
|
|
|
||||||
|
|
@ -26,39 +26,45 @@ PewterPokecenterText3: ; 5c59b (17:459b)
|
||||||
ld c, 32
|
ld c, 32
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld hl, JigglypuffFacingDirections
|
ld hl, JigglypuffFacingDirections
|
||||||
ld de, wTrainerFacingDirection
|
ld de, wJigglypuffFacingDirections
|
||||||
ld bc, $0004
|
ld bc, 4
|
||||||
call CopyData
|
call CopyData
|
||||||
ld a, [wSpriteStateData1 + $32]
|
|
||||||
ld hl, wTrainerFacingDirection
|
ld a, [wSpriteStateData1 + 3 * $10 + $2]
|
||||||
.asm_5c5c3
|
ld hl, wJigglypuffFacingDirections
|
||||||
|
.findMatchingFacingDirectionLoop
|
||||||
cp [hl]
|
cp [hl]
|
||||||
inc hl
|
inc hl
|
||||||
jr nz, .asm_5c5c3
|
jr nz, .findMatchingFacingDirectionLoop
|
||||||
dec hl
|
dec hl
|
||||||
push hl
|
push hl
|
||||||
ld c, BANK(Music_JigglypuffSong)
|
ld c, BANK(Music_JigglypuffSong)
|
||||||
ld a, MUSIC_JIGGLYPUFF_SONG
|
ld a, MUSIC_JIGGLYPUFF_SONG
|
||||||
call PlayMusic
|
call PlayMusic
|
||||||
pop hl
|
pop hl
|
||||||
.asm_5c5d1
|
.loop
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [wSpriteStateData1 + $32], a
|
ld [wSpriteStateData1 + 3 * $10 + $2], a
|
||||||
|
|
||||||
|
; rotate the array
|
||||||
push hl
|
push hl
|
||||||
ld hl, wTrainerFacingDirection
|
ld hl, wJigglypuffFacingDirections
|
||||||
ld de, wTrainerEngageDistance
|
ld de, wJigglypuffFacingDirections - 1
|
||||||
ld bc, $0004
|
ld bc, 4
|
||||||
call CopyData
|
call CopyData
|
||||||
ld a, [wTrainerEngageDistance]
|
ld a, [wJigglypuffFacingDirections - 1]
|
||||||
ld [wcd42], a
|
ld [wJigglypuffFacingDirections + 3], a
|
||||||
pop hl
|
pop hl
|
||||||
|
|
||||||
ld c, 24
|
ld c, 24
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
|
|
||||||
ld a, [wc026]
|
ld a, [wc026]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [wc027]
|
ld a, [wc027]
|
||||||
or b
|
or b
|
||||||
jr nz, .asm_5c5d1
|
jr nz, .loop
|
||||||
|
|
||||||
ld c, 48
|
ld c, 48
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
call PlayDefaultMusic
|
call PlayDefaultMusic
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ SafariZoneEntranceScriptPointers: ; 751d9 (1d:51d9)
|
||||||
ld [hJoyHeld], a
|
ld [hJoyHeld], a
|
||||||
ld a, SPRITE_FACING_RIGHT
|
ld a, SPRITE_FACING_RIGHT
|
||||||
ld [wSpriteStateData1 + 9], a
|
ld [wSpriteStateData1 + 9], a
|
||||||
ld a, [wWhichTrade]
|
ld a, [wCoordIndex]
|
||||||
cp $1
|
cp $1
|
||||||
jr z, .asm_7520f
|
jr z, .asm_7520f
|
||||||
ld a, $2
|
ld a, $2
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ SeafoamIslands1Script: ; 447e9 (11:47e9)
|
||||||
call CheckBoulderCoords
|
call CheckBoulderCoords
|
||||||
ret nc
|
ret nc
|
||||||
ld hl, wd7e8
|
ld hl, wd7e8
|
||||||
ld a, [wWhichTrade]
|
ld a, [wCoordIndex]
|
||||||
cp $1
|
cp $1
|
||||||
jr nz, .asm_44819
|
jr nz, .asm_44819
|
||||||
set 6, [hl]
|
set 6, [hl]
|
||||||
|
|
@ -36,7 +36,7 @@ SeafoamIslands1Script: ; 447e9 (11:47e9)
|
||||||
ld a, $9f
|
ld a, $9f
|
||||||
ld [wDungeonWarpDestinationMap], a
|
ld [wDungeonWarpDestinationMap], a
|
||||||
ld hl, Seafoam1HolesCoords
|
ld hl, Seafoam1HolesCoords
|
||||||
jp Func_46981
|
jp IsPlayerOnDungeonWarp
|
||||||
|
|
||||||
Seafoam1HolesCoords: ; 44846 (11:4846)
|
Seafoam1HolesCoords: ; 44846 (11:4846)
|
||||||
db $06,$11
|
db $06,$11
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ SeafoamIslands2Script: ; 46315 (11:6315)
|
||||||
call CheckBoulderCoords
|
call CheckBoulderCoords
|
||||||
ret nc
|
ret nc
|
||||||
ld hl, wd87f
|
ld hl, wd87f
|
||||||
ld a, [wWhichTrade]
|
ld a, [wCoordIndex]
|
||||||
cp $1
|
cp $1
|
||||||
jr nz, .asm_46340
|
jr nz, .asm_46340
|
||||||
set 0, [hl]
|
set 0, [hl]
|
||||||
|
|
@ -34,7 +34,7 @@ SeafoamIslands2Script: ; 46315 (11:6315)
|
||||||
ld a, $a0
|
ld a, $a0
|
||||||
ld [wDungeonWarpDestinationMap], a
|
ld [wDungeonWarpDestinationMap], a
|
||||||
ld hl, Seafoam2HolesCoords
|
ld hl, Seafoam2HolesCoords
|
||||||
jp Func_46981
|
jp IsPlayerOnDungeonWarp
|
||||||
|
|
||||||
Seafoam2HolesCoords: ; 4636d (11:636d)
|
Seafoam2HolesCoords: ; 4636d (11:636d)
|
||||||
db $06,$12
|
db $06,$12
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ SeafoamIslands3Script: ; 46451 (11:6451)
|
||||||
call CheckBoulderCoords
|
call CheckBoulderCoords
|
||||||
ret nc
|
ret nc
|
||||||
ld hl, wd880
|
ld hl, wd880
|
||||||
ld a, [wWhichTrade]
|
ld a, [wCoordIndex]
|
||||||
cp $1
|
cp $1
|
||||||
jr nz, .asm_4647c
|
jr nz, .asm_4647c
|
||||||
set 0, [hl]
|
set 0, [hl]
|
||||||
|
|
@ -34,7 +34,7 @@ SeafoamIslands3Script: ; 46451 (11:6451)
|
||||||
ld a, $a1
|
ld a, $a1
|
||||||
ld [wDungeonWarpDestinationMap], a
|
ld [wDungeonWarpDestinationMap], a
|
||||||
ld hl, Seafoam3HolesCoords
|
ld hl, Seafoam3HolesCoords
|
||||||
jp Func_46981
|
jp IsPlayerOnDungeonWarp
|
||||||
|
|
||||||
Seafoam3HolesCoords: ; 464a9 (11:64a9)
|
Seafoam3HolesCoords: ; 464a9 (11:64a9)
|
||||||
db $06,$13
|
db $06,$13
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ SeafoamIslands4Script: ; 4658d (11:658d)
|
||||||
call CheckBoulderCoords
|
call CheckBoulderCoords
|
||||||
ret nc
|
ret nc
|
||||||
ld hl, wd881
|
ld hl, wd881
|
||||||
ld a, [wWhichTrade]
|
ld a, [wCoordIndex]
|
||||||
cp $1
|
cp $1
|
||||||
jr nz, .asm_465b8
|
jr nz, .asm_465b8
|
||||||
set 0, [hl]
|
set 0, [hl]
|
||||||
|
|
@ -35,7 +35,7 @@ SeafoamIslands4Script: ; 4658d (11:658d)
|
||||||
ld a, $a2
|
ld a, $a2
|
||||||
ld [wDungeonWarpDestinationMap], a
|
ld [wDungeonWarpDestinationMap], a
|
||||||
ld hl, Seafoam4HolesCoords
|
ld hl, Seafoam4HolesCoords
|
||||||
call Func_46981
|
call IsPlayerOnDungeonWarp
|
||||||
ld a, [wd732]
|
ld a, [wd732]
|
||||||
bit 4, a
|
bit 4, a
|
||||||
ret nz
|
ret nz
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ SeafoamIslands5Script0: ; 467c7 (11:67c7)
|
||||||
ld hl, CoordsData_467fe
|
ld hl, CoordsData_467fe
|
||||||
call ArePlayerCoordsInArray
|
call ArePlayerCoordsInArray
|
||||||
ret nc
|
ret nc
|
||||||
ld a, [wWhichTrade]
|
ld a, [wCoordIndex]
|
||||||
cp $3
|
cp $3
|
||||||
jr nc, .asm_467e6
|
jr nc, .asm_467e6
|
||||||
ld a, $40
|
ld a, $40
|
||||||
|
|
@ -81,7 +81,7 @@ SeafoamIslands5Script2: ; 46816 (11:6816)
|
||||||
call ArePlayerCoordsInArray
|
call ArePlayerCoordsInArray
|
||||||
ld a, $0
|
ld a, $0
|
||||||
jr nc, .asm_46849
|
jr nc, .asm_46849
|
||||||
ld a, [wWhichTrade]
|
ld a, [wCoordIndex]
|
||||||
cp $1
|
cp $1
|
||||||
jr nz, .asm_46837
|
jr nz, .asm_46837
|
||||||
ld de, RLEMovementData_46859
|
ld de, RLEMovementData_46859
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ SilphCo7Script0: ; 51c23 (14:5c23)
|
||||||
ld [H_SPRITEINDEX], a
|
ld [H_SPRITEINDEX], a
|
||||||
call SetSpriteMovementBytesToFF
|
call SetSpriteMovementBytesToFF
|
||||||
ld de, MovementData_51c7d
|
ld de, MovementData_51c7d
|
||||||
ld a, [wWhichTrade]
|
ld a, [wCoordIndex]
|
||||||
ld [wcf0d], a
|
ld [wcf0d], a
|
||||||
cp $1
|
cp $1
|
||||||
jr z, .asm_51c6c
|
jr z, .asm_51c6c
|
||||||
|
|
|
||||||
|
|
@ -57,15 +57,15 @@ VermilionDock_1db9b: ; 1db9b (7:5b9b)
|
||||||
ld bc, $0078
|
ld bc, $0078
|
||||||
ld a, $14
|
ld a, $14
|
||||||
call FillMemory
|
call FillMemory
|
||||||
ld a, $1
|
ld a, 1
|
||||||
ld [$ffba], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
call Delay3
|
call Delay3
|
||||||
xor a
|
xor a
|
||||||
ld [$ffba], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
ld [wWhichTrade], a
|
ld [wSSAnneSmokeDriftAmount], a
|
||||||
ld [$ff49], a
|
ld [rOBP1], a
|
||||||
ld a, $58
|
ld a, 88
|
||||||
ld [wTrainerEngageDistance], a
|
ld [wSSAnneSmokeX], a
|
||||||
ld hl, wMapViewVRAMPointer
|
ld hl, wMapViewVRAMPointer
|
||||||
ld c, [hl]
|
ld c, [hl]
|
||||||
inc hl
|
inc hl
|
||||||
|
|
@ -88,11 +88,11 @@ VermilionDock_1db9b: ; 1db9b (7:5b9b)
|
||||||
push hl
|
push hl
|
||||||
push de
|
push de
|
||||||
call ScheduleEastColumnRedraw
|
call ScheduleEastColumnRedraw
|
||||||
call VermilionDock_1dc59
|
call VermilionDock_EmitSmokePuff
|
||||||
pop de
|
pop de
|
||||||
ld b, $10
|
ld b, $10
|
||||||
.asm_1dc11
|
.asm_1dc11
|
||||||
call VermilionDock_1dc42
|
call VermilionDock_AnimSmokePuffDriftRight
|
||||||
ld c, $8
|
ld c, $8
|
||||||
.asm_1dc16
|
.asm_1dc16
|
||||||
call VermilionDock_1dc7c
|
call VermilionDock_1dc7c
|
||||||
|
|
@ -105,7 +105,7 @@ VermilionDock_1db9b: ; 1db9b (7:5b9b)
|
||||||
dec e
|
dec e
|
||||||
jr nz, .asm_1dbfa
|
jr nz, .asm_1dbfa
|
||||||
xor a
|
xor a
|
||||||
ld [$ff4a], a
|
ld [rWY], a
|
||||||
ld [hWY], a
|
ld [hWY], a
|
||||||
call VermilionDock_1dc94
|
call VermilionDock_1dc94
|
||||||
ld a, $90
|
ld a, $90
|
||||||
|
|
@ -122,33 +122,34 @@ VermilionDock_1db9b: ; 1db9b (7:5b9b)
|
||||||
dec [hl]
|
dec [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
VermilionDock_1dc42: ; 1dc42 (7:5c42)
|
VermilionDock_AnimSmokePuffDriftRight: ; 1dc42 (7:5c42)
|
||||||
push bc
|
push bc
|
||||||
push de
|
push de
|
||||||
ld hl, wOAMBuffer + $11
|
ld hl, wOAMBuffer + $11
|
||||||
ld a, [wWhichTrade]
|
ld a, [wSSAnneSmokeDriftAmount]
|
||||||
swap a
|
swap a
|
||||||
ld c, a
|
ld c, a
|
||||||
ld de, $0004
|
ld de, 4
|
||||||
.asm_1dc50
|
.loop
|
||||||
inc [hl]
|
inc [hl]
|
||||||
inc [hl]
|
inc [hl]
|
||||||
add hl, de
|
add hl, de
|
||||||
dec c
|
dec c
|
||||||
jr nz, .asm_1dc50
|
jr nz, .loop
|
||||||
pop de
|
pop de
|
||||||
pop bc
|
pop bc
|
||||||
ret
|
ret
|
||||||
|
|
||||||
VermilionDock_1dc59: ; 1dc59 (7:5c59)
|
VermilionDock_EmitSmokePuff: ; 1dc59 (7:5c59)
|
||||||
ld a, [wTrainerEngageDistance]
|
; new smoke puff above the S.S. Anne's front smokestack
|
||||||
sub $10
|
ld a, [wSSAnneSmokeX]
|
||||||
ld [wTrainerEngageDistance], a
|
sub 16
|
||||||
|
ld [wSSAnneSmokeX], a
|
||||||
ld c, a
|
ld c, a
|
||||||
ld b, $64
|
ld b, 100 ; Y
|
||||||
ld a, [wWhichTrade]
|
ld a, [wSSAnneSmokeDriftAmount]
|
||||||
inc a
|
inc a
|
||||||
ld [wWhichTrade], a
|
ld [wSSAnneSmokeDriftAmount], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld de, VermilionDockOAMBlock
|
ld de, VermilionDockOAMBlock
|
||||||
call WriteOAMBlock
|
call WriteOAMBlock
|
||||||
|
|
@ -171,7 +172,7 @@ VermilionDock_1dc7c: ; 1dc7c (7:5c7c)
|
||||||
cp l
|
cp l
|
||||||
jr nz, .asm_1dc86
|
jr nz, .asm_1dc86
|
||||||
ld a, h
|
ld a, h
|
||||||
ld [$ff43], a
|
ld [rSCX], a
|
||||||
.asm_1dc8e
|
.asm_1dc8e
|
||||||
ld a, [rLY]
|
ld a, [rLY]
|
||||||
cp h
|
cp h
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ VictoryRoad2Script0: ; 517f1 (14:57f1)
|
||||||
call CheckBoulderCoords
|
call CheckBoulderCoords
|
||||||
jp nc, CheckFightingMapTrainers
|
jp nc, CheckFightingMapTrainers
|
||||||
ld hl, wd7ee
|
ld hl, wd7ee
|
||||||
ld a, [wWhichTrade]
|
ld a, [wCoordIndex]
|
||||||
cp $2
|
cp $2
|
||||||
jr z, .asm_5180b
|
jr z, .asm_5180b
|
||||||
bit 0, [hl]
|
bit 0, [hl]
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ VictoryRoad3Script0: ; 449b7 (11:49b7)
|
||||||
ld hl, .coordsData_449f9
|
ld hl, .coordsData_449f9
|
||||||
call CheckBoulderCoords
|
call CheckBoulderCoords
|
||||||
jp nc, .asm_449fe
|
jp nc, .asm_449fe
|
||||||
ld a, [wWhichTrade]
|
ld a, [wCoordIndex]
|
||||||
cp $1
|
cp $1
|
||||||
jr nz, .asm_449dc
|
jr nz, .asm_449dc
|
||||||
ld hl, wd126
|
ld hl, wd126
|
||||||
|
|
@ -60,11 +60,11 @@ VictoryRoad3Script0: ; 449b7 (11:49b7)
|
||||||
db $FF
|
db $FF
|
||||||
|
|
||||||
.asm_449fe
|
.asm_449fe
|
||||||
ld a, $c2
|
ld a, VICTORY_ROAD_2
|
||||||
ld [wDungeonWarpDestinationMap], a
|
ld [wDungeonWarpDestinationMap], a
|
||||||
ld hl, .coordsData_449f9
|
ld hl, .coordsData_449f9
|
||||||
call Func_46981
|
call IsPlayerOnDungeonWarp
|
||||||
ld a, [wWhichTrade]
|
ld a, [wCoordIndex]
|
||||||
cp $1
|
cp $1
|
||||||
jr nz, .asm_44a1b
|
jr nz, .asm_44a1b
|
||||||
ld hl, wd72d
|
ld hl, wd72d
|
||||||
|
|
|
||||||
8
sram.asm
8
sram.asm
|
|
@ -29,8 +29,8 @@ sBox3:: ds wBoxMonNicksEnd - W_NUMINBOX ; a8c4
|
||||||
sBox4:: ds wBoxMonNicksEnd - W_NUMINBOX ; ad26
|
sBox4:: ds wBoxMonNicksEnd - W_NUMINBOX ; ad26
|
||||||
sBox5:: ds wBoxMonNicksEnd - W_NUMINBOX ; b188
|
sBox5:: ds wBoxMonNicksEnd - W_NUMINBOX ; b188
|
||||||
sBox6:: ds wBoxMonNicksEnd - W_NUMINBOX ; b5ea
|
sBox6:: ds wBoxMonNicksEnd - W_NUMINBOX ; b5ea
|
||||||
sBoxes1CheckSum:: ds 1 ; ba4c
|
sBank2AllBoxesChecksum:: ds 1 ; ba4c
|
||||||
sBoxes1CheckSum2:: ds 6 ; ba4d
|
sBank2IndividualBoxChecksums:: ds 6 ; ba4d
|
||||||
|
|
||||||
|
|
||||||
SECTION "Saved Boxes 2", SRAM, BANK[3]
|
SECTION "Saved Boxes 2", SRAM, BANK[3]
|
||||||
|
|
@ -41,5 +41,5 @@ sBox9:: ds wBoxMonNicksEnd - W_NUMINBOX ; a8c4
|
||||||
sBox10:: ds wBoxMonNicksEnd - W_NUMINBOX ; ad26
|
sBox10:: ds wBoxMonNicksEnd - W_NUMINBOX ; ad26
|
||||||
sBox11:: ds wBoxMonNicksEnd - W_NUMINBOX ; b188
|
sBox11:: ds wBoxMonNicksEnd - W_NUMINBOX ; b188
|
||||||
sBox12:: ds wBoxMonNicksEnd - W_NUMINBOX ; b5ea
|
sBox12:: ds wBoxMonNicksEnd - W_NUMINBOX ; b5ea
|
||||||
sBoxes2CheckSum:: ds 1 ; ba4c
|
sBank3AllBoxesChecksum:: ds 1 ; ba4c
|
||||||
sBoxes2CheckSum2:: ds 6 ; ba4d
|
sBank3IndividualBoxChecksums:: ds 6 ; ba4d
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
_DayCareMText_5640f:: ; 8ab95 (22:6b95)
|
_DayCareIntroText:: ; 8ab95 (22:6b95)
|
||||||
text "I run a DAYCARE."
|
text "I run a DAYCARE."
|
||||||
line "Would you like me"
|
line "Would you like me"
|
||||||
cont "to raise one of"
|
cont "to raise one of"
|
||||||
cont "your #MON?"
|
cont "your #MON?"
|
||||||
done
|
done
|
||||||
|
|
||||||
_DayCareMText_56414:: ; 8abd4 (22:6bd4)
|
_DayCareWhichMonText:: ; 8abd4 (22:6bd4)
|
||||||
text "Which #MON"
|
text "Which #MON"
|
||||||
line "should I raise?"
|
line "should I raise?"
|
||||||
prompt
|
prompt
|
||||||
|
|
||||||
_DayCareMText_56419:: ; 8abf0 (22:6bf0)
|
_DayCareWillLookAfterMonText:: ; 8abf0 (22:6bf0)
|
||||||
text "Fine, I'll look"
|
text "Fine, I'll look"
|
||||||
line "after @"
|
line "after @"
|
||||||
TX_RAM wcd6d
|
TX_RAM wcd6d
|
||||||
|
|
@ -18,12 +18,12 @@ _DayCareMText_56419:: ; 8abf0 (22:6bf0)
|
||||||
cont "for a while."
|
cont "for a while."
|
||||||
prompt
|
prompt
|
||||||
|
|
||||||
_DayCareMText_5641e:: ; 8ac19 (22:6c19)
|
_DayCareComeSeeMeInAWhileText:: ; 8ac19 (22:6c19)
|
||||||
text "Come see me in"
|
text "Come see me in"
|
||||||
line "a while."
|
line "a while."
|
||||||
done
|
done
|
||||||
|
|
||||||
_DayCareMText_56423:: ; 8ac32 (22:6c32)
|
_DayCareMonHasGrownText:: ; 8ac32 (22:6c32)
|
||||||
text "Your @"
|
text "Your @"
|
||||||
TX_RAM wcd6d
|
TX_RAM wcd6d
|
||||||
db $0
|
db $0
|
||||||
|
|
@ -31,15 +31,13 @@ _DayCareMText_56423:: ; 8ac32 (22:6c32)
|
||||||
|
|
||||||
para "By level, it's"
|
para "By level, it's"
|
||||||
line "grown by @"
|
line "grown by @"
|
||||||
|
TX_NUM wDayCareNumLevelsGrown,$1,$3
|
||||||
DayCareMText_8ac67:: ; 8ac67 (22:6c67)
|
|
||||||
TX_NUM wTrainerEngageDistance,$1,$3
|
|
||||||
text "!"
|
text "!"
|
||||||
|
|
||||||
para "Aren't I great?"
|
para "Aren't I great?"
|
||||||
prompt
|
prompt
|
||||||
|
|
||||||
_DayCareMText_56428:: ; 8ac7d (22:6c7d)
|
_DayCareOweMoneyText:: ; 8ac7d (22:6c7d)
|
||||||
text "You owe me ¥@"
|
text "You owe me ¥@"
|
||||||
TX_BCD wcd3f, $c2
|
TX_BCD wcd3f, $c2
|
||||||
db $0
|
db $0
|
||||||
|
|
@ -47,14 +45,14 @@ _DayCareMText_56428:: ; 8ac7d (22:6c7d)
|
||||||
cont "of this #MON."
|
cont "of this #MON."
|
||||||
done
|
done
|
||||||
|
|
||||||
_DayCareMText_5642d:: ; 8acae (22:6cae)
|
_DayCareGotMonBackText:: ; 8acae (22:6cae)
|
||||||
text $52, " got"
|
text $52, " got"
|
||||||
line "@"
|
line "@"
|
||||||
TX_RAM W_DAYCAREMONNAME
|
TX_RAM W_DAYCAREMONNAME
|
||||||
text " back!"
|
text " back!"
|
||||||
done
|
done
|
||||||
|
|
||||||
_DayCareMText_56432:: ; 8acc1 (22:6cc1)
|
_DayCareMonNeedsMoreTimeText:: ; 8acc1 (22:6cc1)
|
||||||
text "Back already?"
|
text "Back already?"
|
||||||
line "Your @"
|
line "Your @"
|
||||||
TX_RAM wcd6d
|
TX_RAM wcd6d
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
_DayCareMText_56437:: ; 8c000 (23:4000)
|
_DayCareAllRightThenText:: ; 8c000 (23:4000)
|
||||||
text "All right then,"
|
text "All right then,"
|
||||||
line "@@"
|
line "@@"
|
||||||
|
|
||||||
_DayCareMText_5643b:: ; 8c013 (23:4013)
|
_DayCareComeAgainText:: ; 8c013 (23:4013)
|
||||||
IF DEF(_YELLOW)
|
IF DEF(_YELLOW)
|
||||||
text "Come again."
|
text "Come again."
|
||||||
ELSE
|
ELSE
|
||||||
|
|
@ -10,28 +10,28 @@ ELSE
|
||||||
ENDC
|
ENDC
|
||||||
done
|
done
|
||||||
|
|
||||||
_DayCareMText_56440:: ; 8c020 (23:4020)
|
_DayCareNoRoomForMonText:: ; 8c020 (23:4020)
|
||||||
text "You have no room"
|
text "You have no room"
|
||||||
line "for this #MON!"
|
line "for this #MON!"
|
||||||
done
|
done
|
||||||
|
|
||||||
_DayCareMText_56445:: ; 8c041 (23:4041)
|
_DayCareOnlyHaveOneMonText:: ; 8c041 (23:4041)
|
||||||
text "You only have one"
|
text "You only have one"
|
||||||
line "#MON with you."
|
line "#MON with you."
|
||||||
done
|
done
|
||||||
|
|
||||||
_DayCareMText_5644a:: ; 8c063 (23:4063)
|
_DayCareCantAcceptMonWithHMText:: ; 8c063 (23:4063)
|
||||||
text "I can't accept a"
|
text "I can't accept a"
|
||||||
line "#MON that"
|
line "#MON that"
|
||||||
cont "knows an HM move."
|
cont "knows an HM move."
|
||||||
done
|
done
|
||||||
|
|
||||||
_DayCareMText_5644f:: ; 8c090 (23:4090)
|
_DayCareHeresYourMonText:: ; 8c090 (23:4090)
|
||||||
text "Thank you! Here's"
|
text "Thank you! Here's"
|
||||||
line "your #MON!"
|
line "your #MON!"
|
||||||
prompt
|
prompt
|
||||||
|
|
||||||
_DayCareMText_56454:: ; 8c0ad (23:40ad)
|
_DayCareNotEnoughMoneyText:: ; 8c0ad (23:40ad)
|
||||||
text "Hey, you don't"
|
text "Hey, you don't"
|
||||||
line "have enough ¥!"
|
line "have enough ¥!"
|
||||||
done
|
done
|
||||||
|
|
|
||||||
86
wram.asm
86
wram.asm
|
|
@ -424,6 +424,10 @@ wNumStepsToTake:: ; cca1
|
||||||
wRLEByteCount:: ; ccd2
|
wRLEByteCount:: ; ccd2
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
|
wAddedToParty:: ; ccd3
|
||||||
|
; 0 = not added
|
||||||
|
; 1 = added
|
||||||
|
|
||||||
wSimulatedJoypadStatesEnd:: ; ccd3
|
wSimulatedJoypadStatesEnd:: ; ccd3
|
||||||
; this is the end of the joypad states
|
; this is the end of the joypad states
|
||||||
; the list starts above this address and extends downwards in memory until here
|
; the list starts above this address and extends downwards in memory until here
|
||||||
|
|
@ -431,7 +435,13 @@ wSimulatedJoypadStatesEnd:: ; ccd3
|
||||||
|
|
||||||
wParentMenuItem:: ; ccd3
|
wParentMenuItem:: ; ccd3
|
||||||
|
|
||||||
wccd3:: ds 1 ; used in battle, pokemon, PC and game corner stuff
|
wCanEvolveFlags:: ; ccd3
|
||||||
|
; 1 flag for each party member indicating whether it can evolve
|
||||||
|
; The purpose of these flags is to track which mons levelled up during the
|
||||||
|
; current battle at the end of the battle when evolution occurs.
|
||||||
|
; Other methods of evolution simply set it by calling TryEvolvingMon.
|
||||||
|
ds 1
|
||||||
|
|
||||||
wForceEvolution::
|
wForceEvolution::
|
||||||
wccd4:: ds 1 ; has a direct reference for simulated joypad stuff in vermillion and seafoam
|
wccd4:: ds 1 ; has a direct reference for simulated joypad stuff in vermillion and seafoam
|
||||||
|
|
||||||
|
|
@ -634,9 +644,33 @@ wOverrideSimulatedJoypadStatesMask:: ; cd3b
|
||||||
|
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
|
wHoFTeamIndex:: ; cd3d
|
||||||
|
|
||||||
|
wSSAnneSmokeDriftAmount:: ; cd3d
|
||||||
|
; multiplied by 16 to get the number of times to go right by 2 pixels
|
||||||
|
|
||||||
|
wRivalStarterTemp:: ; cd3d
|
||||||
|
|
||||||
|
wBoxMonCounts:: ; cd3d
|
||||||
|
; 12 bytes
|
||||||
|
; array of the number of mons in each box
|
||||||
|
|
||||||
|
wDexMaxSeenMon:: ; cd3d
|
||||||
|
|
||||||
|
wPPRestoreItem:: ; cd3d
|
||||||
|
|
||||||
|
wWereAnyMonsAsleep:: ; cd3d
|
||||||
|
|
||||||
|
wCanPlaySlots:: ; cd3d
|
||||||
|
|
||||||
|
wNumShakes:: ; cd3d
|
||||||
|
|
||||||
|
wDayCareStartLevel:: ; cd3d
|
||||||
|
; the level of the mon at the time it entered day care
|
||||||
|
|
||||||
wWhichBadge:: ; cd3d
|
wWhichBadge:: ; cd3d
|
||||||
|
|
||||||
wMuseumPriceTemp:: ; cd3d
|
wPriceTemp:: ; cd3d
|
||||||
; 3-byte BCD number
|
; 3-byte BCD number
|
||||||
|
|
||||||
wTitleMonSpecies:: ; cd3d
|
wTitleMonSpecies:: ; cd3d
|
||||||
|
|
@ -701,6 +735,12 @@ wWhichTrade:: ; cd3d
|
||||||
wTrainerSpriteOffset:: ; cd3d
|
wTrainerSpriteOffset:: ; cd3d
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
|
wSSAnneSmokeX:: ; cd3e
|
||||||
|
|
||||||
|
wRivalStarterBallSpriteIndex:: ; cd3e
|
||||||
|
|
||||||
|
wDayCareNumLevelsGrown:: ; cd3e
|
||||||
|
|
||||||
wOptionsBattleAnimCursorX:: ; cd3e
|
wOptionsBattleAnimCursorX:: ; cd3e
|
||||||
|
|
||||||
wTrainerInfoTextBoxWidth:: ; cd3e
|
wTrainerInfoTextBoxWidth:: ; cd3e
|
||||||
|
|
@ -733,6 +773,8 @@ wHiddenObjectFunctionRomBank:: ; cd3e
|
||||||
wTrainerEngageDistance:: ; cd3e
|
wTrainerEngageDistance:: ; cd3e
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
|
wJigglypuffFacingDirections:: ; cd3f
|
||||||
|
|
||||||
wOptionsBattleStyleCursorX:: ; cd3f
|
wOptionsBattleStyleCursorX:: ; cd3f
|
||||||
|
|
||||||
wTrainerInfoTextBoxNextRowOffset:: ; cd3f
|
wTrainerInfoTextBoxNextRowOffset:: ; cd3f
|
||||||
|
|
@ -774,6 +816,10 @@ wHiddenObjectY:: ; cd40
|
||||||
wTrainerScreenY:: ; cd40
|
wTrainerScreenY:: ; cd40
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
|
wHoFTeamIndex2:: ; cd41
|
||||||
|
|
||||||
|
wHiddenItemOrCoinsIndex:: ; cd41
|
||||||
|
|
||||||
wTradedPlayerMonOT:: ; cd41
|
wTradedPlayerMonOT:: ; cd41
|
||||||
|
|
||||||
wHiddenObjectX:: ; cd41
|
wHiddenObjectX:: ; cd41
|
||||||
|
|
@ -962,16 +1008,32 @@ wTileMapBackup2:: ; cd81
|
||||||
; second buffer for temporarily saving and restoring current screen's tiles (e.g. if menus are drawn on top)
|
; second buffer for temporarily saving and restoring current screen's tiles (e.g. if menus are drawn on top)
|
||||||
ds 20 * 18
|
ds 20 * 18
|
||||||
|
|
||||||
|
wEvoOldSpecies:: ; cee9
|
||||||
|
|
||||||
wBuffer:: ; cee9
|
wBuffer:: ; cee9
|
||||||
; Temporary storage area of 30 bytes.
|
; Temporary storage area of 30 bytes.
|
||||||
|
|
||||||
wTownMapCoords:: ; cee9
|
wTownMapCoords:: ; cee9
|
||||||
; lower nybble is x, upper nybble is y
|
; lower nybble is x, upper nybble is y
|
||||||
|
|
||||||
|
wLearningMovesFromDayCare:: ; cee9
|
||||||
|
; whether WriteMonMoves is being used to make a mon learn moves from day care
|
||||||
|
; non-zero if so
|
||||||
|
|
||||||
wHPBarMaxHP:: ; cee9
|
wHPBarMaxHP:: ; cee9
|
||||||
ds 2
|
ds 1
|
||||||
|
|
||||||
|
wEvoNewSpecies:: ; ceea
|
||||||
|
ds 1
|
||||||
|
|
||||||
|
wEvoMonTileOffset:: ; ceeb
|
||||||
|
|
||||||
wHPBarOldHP:: ; ceeb
|
wHPBarOldHP:: ; ceeb
|
||||||
ds 2
|
ds 1
|
||||||
|
|
||||||
|
wEvoCancelled:: ; ceec
|
||||||
|
ds 1
|
||||||
|
|
||||||
wHPBarNewHP:: ; ceed
|
wHPBarNewHP:: ; ceed
|
||||||
ds 2
|
ds 2
|
||||||
wHPBarDelta:: ; ceef
|
wHPBarDelta:: ; ceef
|
||||||
|
|
@ -1453,7 +1515,10 @@ W_SUBANIMCOUNTER:: ; d087
|
||||||
; counts the number of subentries left in the current subanimation
|
; counts the number of subentries left in the current subanimation
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
wd088:: ds 1 ; savefile checksum (if file is corrupted)
|
wSaveFileStatus::
|
||||||
|
; 1 = no save file or save file is corrupted
|
||||||
|
; 2 = save file exists and no corruption has been detected
|
||||||
|
ds 1
|
||||||
|
|
||||||
W_NUMFBTILES:: ; d089
|
W_NUMFBTILES:: ; d089
|
||||||
; number of tiles in current battle animation frame block
|
; number of tiles in current battle animation frame block
|
||||||
|
|
@ -1462,6 +1527,8 @@ W_NUMFBTILES:: ; d089
|
||||||
wTradedMonMovingRight:: ; d08a
|
wTradedMonMovingRight:: ; d08a
|
||||||
; $01 if mon is moving from left gameboy to right gameboy; $00 if vice versa
|
; $01 if mon is moving from left gameboy to right gameboy; $00 if vice versa
|
||||||
|
|
||||||
|
wOptionsInitialized:: ; d08a
|
||||||
|
|
||||||
wd08a:: ds 1 ; used with sprites and displaying the option menu on the main menu screen?
|
wd08a:: ds 1 ; used with sprites and displaying the option menu on the main menu screen?
|
||||||
|
|
||||||
wAnimCounter:: ; d08b
|
wAnimCounter:: ; d08b
|
||||||
|
|
@ -2079,6 +2146,8 @@ wBoxItems:: ; d53b
|
||||||
ds 1 ; end
|
ds 1 ; end
|
||||||
|
|
||||||
wCurrentBoxNum:: ; d5a0
|
wCurrentBoxNum:: ; d5a0
|
||||||
|
; bits 0-6: box number
|
||||||
|
; bit 7: whether the player has changed boxes before
|
||||||
ds 2
|
ds 2
|
||||||
|
|
||||||
wNumHoFTeams:: ; d5a2
|
wNumHoFTeams:: ; d5a2
|
||||||
|
|
@ -2319,8 +2388,11 @@ W_ROUTE18GATECURSCRIPT:: ; d669
|
||||||
|
|
||||||
ds 134
|
ds 134
|
||||||
|
|
||||||
wd6f0:: ds 14 ; flags for hidden items?
|
wObtainedHiddenItemsFlags::
|
||||||
wd6fe:: ds 2 ; flags for hidden coins?
|
ds 14
|
||||||
|
|
||||||
|
wObtainedHiddenCoinsFlags::
|
||||||
|
ds 2
|
||||||
|
|
||||||
wWalkBikeSurfState:: ; d700
|
wWalkBikeSurfState:: ; d700
|
||||||
; $00 = walking
|
; $00 = walking
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue