mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-04-16 23:23:21 +12:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b65c6e8156
49 changed files with 965 additions and 890 deletions
|
|
@ -28,6 +28,26 @@ NPC_MOVEMENT_UP EQU $40
|
||||||
NPC_MOVEMENT_LEFT EQU $80
|
NPC_MOVEMENT_LEFT EQU $80
|
||||||
NPC_MOVEMENT_RIGHT EQU $C0
|
NPC_MOVEMENT_RIGHT EQU $C0
|
||||||
|
|
||||||
|
; text box IDs
|
||||||
|
MESSAGE_BOX EQU $01
|
||||||
|
FIELD_MOVE_MON_MENU EQU $04
|
||||||
|
JP_MOCHIMONO_MENU_TEMPLATE EQU $05
|
||||||
|
USE_TOSS_MENU_TEMPLATE EQU $06
|
||||||
|
JP_SAVE_MESSAGE_MENU_TEMPLATE EQU $08
|
||||||
|
JP_SPEED_OPTIONS_MENU_TEMPLATE EQU $09
|
||||||
|
BATTLE_MENU_TEMPLATE EQU $0b
|
||||||
|
SWITCH_STATS_CANCEL_MENU_TEMPLATE EQU $0c
|
||||||
|
LIST_MENU_BOX EQU $0d
|
||||||
|
BUY_SELL_QUIT_MENU_TEMPLATE EQU $0e
|
||||||
|
MONEY_BOX_TEMPLATE EQU $0f
|
||||||
|
MON_SPRITE_POPUP EQU $11
|
||||||
|
JP_AH_MENU_TEMPLATE EQU $12
|
||||||
|
MONEY_BOX EQU $13
|
||||||
|
TWO_OPTION_MENU EQU $14
|
||||||
|
BUY_SELL_QUIT_MENU EQU $15
|
||||||
|
JP_POKEDEX_MENU_TEMPLATE EQU $1a
|
||||||
|
SAFARI_BATTLE_MENU_TEMPLATE EQU $1b
|
||||||
|
|
||||||
; two option menu constants
|
; two option menu constants
|
||||||
YES_NO_MENU EQU 0
|
YES_NO_MENU EQU 0
|
||||||
NORTH_WEST_MENU EQU 1
|
NORTH_WEST_MENU EQU 1
|
||||||
|
|
@ -62,4 +82,4 @@ LINK_STATE_START_TRADE EQU $02 ; pre-trade selection screen initialisation
|
||||||
LINK_STATE_START_BATTLE EQU $03 ; pre-battle initialisation
|
LINK_STATE_START_BATTLE EQU $03 ; pre-battle initialisation
|
||||||
LINK_STATE_BATTLING EQU $04 ; in a link battle
|
LINK_STATE_BATTLING EQU $04 ; in a link battle
|
||||||
LINK_STATE_RESET EQU $05 ; reset game (unused)
|
LINK_STATE_RESET EQU $05 ; reset game (unused)
|
||||||
LINK_STATE_TRADING EQU $32 ; in a link trade
|
LINK_STATE_TRADING EQU $32 ; in a link trade
|
||||||
|
|
|
||||||
|
|
@ -6,26 +6,28 @@ DrainHPEffect_: ; 783f (1:783f)
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
rr a
|
rr a
|
||||||
ld [hld], a
|
ld [hld], a
|
||||||
or [hl]
|
or [hl] ; is damage 0?
|
||||||
jr nz, .asm_784f
|
jr nz, .getAttackerHP
|
||||||
|
; if damage is 0, increase to 1 so that the attacker gains at least 1 HP
|
||||||
inc hl
|
inc hl
|
||||||
inc [hl]
|
inc [hl]
|
||||||
.asm_784f
|
.getAttackerHP
|
||||||
ld hl, wBattleMonHP ; wd015
|
ld hl, wBattleMonHP
|
||||||
ld de, wBattleMonMaxHP ; wd023
|
ld de, wBattleMonMaxHP
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jp z, Func_7861
|
jp z, .addDamageToAttackerHP
|
||||||
ld hl, wEnemyMonHP
|
ld hl, wEnemyMonHP
|
||||||
ld de, wEnemyMonMaxHP
|
ld de, wEnemyMonMaxHP
|
||||||
|
.addDamageToAttackerHP
|
||||||
Func_7861: ; 7861 (1:7861)
|
|
||||||
ld bc, wHPBarOldHP+1
|
ld bc, wHPBarOldHP+1
|
||||||
|
; copy current HP to wHPBarOldHP
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld [bc], a
|
ld [bc], a
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
dec bc
|
dec bc
|
||||||
ld [bc], a
|
ld [bc], a
|
||||||
|
; copy max HP to wHPBarMaxHP
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
dec bc
|
dec bc
|
||||||
ld [bc], a
|
ld [bc], a
|
||||||
|
|
@ -33,7 +35,8 @@ Func_7861: ; 7861 (1:7861)
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
dec bc
|
dec bc
|
||||||
ld [bc], a
|
ld [bc], a
|
||||||
ld a, [wd0d8]
|
; add damage to attacker's HP and copy new HP to wHPBarNewHP
|
||||||
|
ld a, [W_DAMAGE + 1]
|
||||||
ld b, [hl]
|
ld b, [hl]
|
||||||
add b
|
add b
|
||||||
ld [hld], a
|
ld [hld], a
|
||||||
|
|
@ -43,7 +46,8 @@ Func_7861: ; 7861 (1:7861)
|
||||||
adc b
|
adc b
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [wHPBarNewHP+1], a
|
ld [wHPBarNewHP+1], a
|
||||||
jr c, .asm_7890
|
jr c, .capToMaxHP ; if HP > 65,535, cap to max HP
|
||||||
|
; compare HP with max HP
|
||||||
ld a, [hld]
|
ld a, [hld]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
|
|
@ -54,8 +58,8 @@ Func_7861: ; 7861 (1:7861)
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
inc de
|
inc de
|
||||||
sbc b
|
sbc b
|
||||||
jr nc, .asm_789c
|
jr nc, .next
|
||||||
.asm_7890
|
.capToMaxHP
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
ld [hld], a
|
ld [hld], a
|
||||||
ld [wHPBarNewHP], a
|
ld [wHPBarNewHP], a
|
||||||
|
|
@ -64,31 +68,31 @@ Func_7861: ; 7861 (1:7861)
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [wHPBarNewHP+1], a
|
ld [wHPBarNewHP+1], a
|
||||||
inc de
|
inc de
|
||||||
.asm_789c
|
.next
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
hlCoord 10, 9
|
hlCoord 10, 9
|
||||||
ld a, $1
|
ld a, $1
|
||||||
jr z, .asm_78aa
|
jr z, .next2
|
||||||
hlCoord 2, 2
|
hlCoord 2, 2
|
||||||
xor a
|
xor a
|
||||||
.asm_78aa
|
.next2
|
||||||
ld [wListMenuID], a ; wListMenuID
|
ld [wHPBarType], a
|
||||||
predef UpdateHPBar2
|
predef UpdateHPBar2
|
||||||
predef DrawPlayerHUDAndHPBar
|
predef DrawPlayerHUDAndHPBar
|
||||||
predef DrawEnemyHUDAndHPBar
|
predef DrawEnemyHUDAndHPBar
|
||||||
callab ReadPlayerMonCurHPAndStatus
|
callab ReadPlayerMonCurHPAndStatus
|
||||||
ld hl, SuckedHealthText ; $78dc
|
ld hl, SuckedHealthText
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
ld a, [W_PLAYERMOVEEFFECT] ; wcfd3
|
ld a, [W_PLAYERMOVEEFFECT]
|
||||||
jr z, .asm_78d2
|
jr z, .next3
|
||||||
ld a, [W_ENEMYMOVEEFFECT]
|
ld a, [W_ENEMYMOVEEFFECT]
|
||||||
.asm_78d2
|
.next3
|
||||||
cp DREAM_EATER_EFFECT
|
cp DREAM_EATER_EFFECT
|
||||||
jr nz, .asm_78d9
|
jr nz, .printText
|
||||||
ld hl, DreamWasEatenText
|
ld hl, DreamWasEatenText
|
||||||
.asm_78d9
|
.printText
|
||||||
jp PrintText
|
jp PrintText
|
||||||
|
|
||||||
SuckedHealthText: ; 78dc (1:78dc)
|
SuckedHealthText: ; 78dc (1:78dc)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
Func_525af: ; 525af (14:65af)
|
InitBattleVariables: ; 525af (14:65af)
|
||||||
ld a, [hTilesetType]
|
ld a, [hTilesetType]
|
||||||
ld [wd0d4], a
|
ld [wd0d4], a
|
||||||
xor a
|
xor a
|
||||||
|
|
@ -9,7 +9,7 @@ Func_525af: ; 525af (14:65af)
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld [wListScrollOffset], a ; wcc36
|
ld [wListScrollOffset], a
|
||||||
ld [wCriticalHitOrOHKO], a
|
ld [wCriticalHitOrOHKO], a
|
||||||
ld [wBattleMonSpecies], a
|
ld [wBattleMonSpecies], a
|
||||||
ld [wPartyGainExpFlags], a
|
ld [wPartyGainExpFlags], a
|
||||||
|
|
@ -21,73 +21,73 @@ Func_525af: ; 525af (14:65af)
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld hl, wccd3
|
ld hl, wccd3
|
||||||
ld b, $3c
|
ld b, $3c
|
||||||
.asm_525e1
|
.loop
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
dec b
|
dec b
|
||||||
jr nz, .asm_525e1
|
jr nz, .loop
|
||||||
inc a
|
inc a
|
||||||
ld [wccd9], a
|
ld [wccd9], a
|
||||||
ld a, [W_CURMAP]
|
ld a, [W_CURMAP]
|
||||||
cp SAFARI_ZONE_EAST
|
cp SAFARI_ZONE_EAST
|
||||||
jr c, .asm_525f9
|
jr c, .notSafariBattle
|
||||||
cp SAFARI_ZONE_REST_HOUSE_1
|
cp SAFARI_ZONE_REST_HOUSE_1
|
||||||
jr nc, .asm_525f9
|
jr nc, .notSafariBattle
|
||||||
ld a, $2
|
ld a, $2 ; safari battle
|
||||||
ld [W_BATTLETYPE], a ; wd05a
|
ld [W_BATTLETYPE], a
|
||||||
.asm_525f9
|
.notSafariBattle
|
||||||
ld hl, PlayBattleMusic
|
ld hl, PlayBattleMusic
|
||||||
ld b, BANK(PlayBattleMusic)
|
ld b, BANK(PlayBattleMusic)
|
||||||
jp Bankswitch
|
jp Bankswitch
|
||||||
|
|
||||||
ParalyzeEffect_: ; 52601 (14:6601)
|
ParalyzeEffect_: ; 52601 (14:6601)
|
||||||
ld hl, wEnemyMonStatus ; wcfe9
|
ld hl, wEnemyMonStatus
|
||||||
ld de, W_PLAYERMOVETYPE ; wcfd5
|
ld de, W_PLAYERMOVETYPE
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jp z, .asm_52613
|
jp z, .next
|
||||||
ld hl, wBattleMonStatus
|
ld hl, wBattleMonStatus
|
||||||
ld de, W_ENEMYMOVETYPE ; wcfcf
|
ld de, W_ENEMYMOVETYPE
|
||||||
|
.next
|
||||||
.asm_52613
|
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
and a
|
and a ; does the target already have a status ailment?
|
||||||
jr nz, .asm_52659
|
jr nz, .didntAffect
|
||||||
|
; check if the target is immune due to types
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
cp EVASION_DOWN1_EFFECT
|
cp ELECTRIC
|
||||||
jr nz, .asm_5262a
|
jr nz, .hitTest
|
||||||
ld b, h
|
ld b, h
|
||||||
ld c, l
|
ld c, l
|
||||||
inc bc
|
inc bc
|
||||||
ld a, [bc]
|
ld a, [bc]
|
||||||
cp $4
|
cp GROUND
|
||||||
jr z, .asm_52666
|
jr z, .doesntAffect
|
||||||
inc bc
|
inc bc
|
||||||
ld a, [bc]
|
ld a, [bc]
|
||||||
cp $4
|
cp GROUND
|
||||||
jr z, .asm_52666
|
jr z, .doesntAffect
|
||||||
.asm_5262a
|
.hitTest
|
||||||
push hl
|
push hl
|
||||||
callab MoveHitTest
|
callab MoveHitTest
|
||||||
pop hl
|
pop hl
|
||||||
ld a, [W_MOVEMISSED]
|
ld a, [W_MOVEMISSED]
|
||||||
and a
|
and a
|
||||||
jr nz, .asm_52659
|
jr nz, .didntAffect
|
||||||
set PAR, [hl]
|
set PAR, [hl]
|
||||||
callab QuarterSpeedDueToParalysis
|
callab QuarterSpeedDueToParalysis
|
||||||
ld c, $1e
|
ld c, 30
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
callab Func_3fba8
|
callab PlayCurrentMoveAnimation
|
||||||
ld hl, PrintMayNotAttackText
|
ld hl, PrintMayNotAttackText
|
||||||
ld b, BANK(PrintMayNotAttackText)
|
ld b, BANK(PrintMayNotAttackText)
|
||||||
jp Bankswitch
|
jp Bankswitch
|
||||||
.asm_52659
|
.didntAffect
|
||||||
ld c, $32
|
ld c, 50
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld hl, PrintDidntAffectText
|
ld hl, PrintDidntAffectText
|
||||||
ld b, BANK(PrintDidntAffectText)
|
ld b, BANK(PrintDidntAffectText)
|
||||||
jp Bankswitch
|
jp Bankswitch
|
||||||
.asm_52666
|
.doesntAffect
|
||||||
ld c, $32
|
ld c, 50
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld hl, PrintDoesntAffectText
|
ld hl, PrintDoesntAffectText
|
||||||
ld b, BANK(PrintDoesntAffectText)
|
ld b, BANK(PrintDoesntAffectText)
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ PrintBeginningBattleText: ; 58d99 (16:4d99)
|
||||||
ld hl, UnveiledGhostText
|
ld hl, UnveiledGhostText
|
||||||
call PrintText
|
call PrintText
|
||||||
callab LoadEnemyMonData
|
callab LoadEnemyMonData
|
||||||
callab Func_708ca
|
callab MarowakAnim
|
||||||
ld hl, WildMonAppearedText
|
ld hl, WildMonAppearedText
|
||||||
call PrintText
|
call PrintText
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,85 +1,91 @@
|
||||||
Func_708ca: ; 708ca (1c:48ca)
|
MarowakAnim: ; 708ca (1c:48ca)
|
||||||
|
; animate the ghost being unveiled as a Marowak
|
||||||
ld a, $e4
|
ld a, $e4
|
||||||
ld [rOBP1], a ; $ff49
|
ld [rOBP1], a
|
||||||
call Func_7092a
|
call CopyMonPicFromBGToSpriteVRAM ; cover the BG ghost pic with a sprite ghost pic that looks the same
|
||||||
|
; now that the ghost pic is being displayed using sprites, clear the ghost pic from the BG tilemap
|
||||||
hlCoord 12, 0
|
hlCoord 12, 0
|
||||||
ld bc, $707
|
ld bc, $707
|
||||||
call ClearScreenArea
|
call ClearScreenArea
|
||||||
call Delay3
|
call Delay3
|
||||||
xor a
|
xor a
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
|
ld [H_AUTOBGTRANSFERENABLED], a ; disable BG transfer so we don't see the Marowak too soon
|
||||||
ld a, $91
|
; replace ghost pic with Marowak in BG
|
||||||
|
ld a, MAROWAK
|
||||||
ld [wHPBarMaxHP], a
|
ld [wHPBarMaxHP], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [H_WHOSETURN], a ; $fff3
|
ld [H_WHOSETURN], a
|
||||||
callab Func_79793
|
callab Func_79793
|
||||||
|
; alternate between black and light grey 8 times.
|
||||||
|
; this makes the ghost's body appear to flash
|
||||||
ld d, $80
|
ld d, $80
|
||||||
call Func_704f3
|
call FlashSprite8Times
|
||||||
.asm_708f6
|
.fadeOutGhostLoop
|
||||||
ld c, $a
|
ld c, 10
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld a, [rOBP1] ; $ff49
|
ld a, [rOBP1]
|
||||||
sla a
|
sla a
|
||||||
sla a
|
sla a
|
||||||
ld [rOBP1], a ; $ff49
|
ld [rOBP1], a
|
||||||
jr nz, .asm_708f6
|
jr nz, .fadeOutGhostLoop
|
||||||
call ClearSprites
|
call ClearSprites
|
||||||
call Func_7092a
|
call CopyMonPicFromBGToSpriteVRAM ; copy Marowak pic from BG to sprite VRAM
|
||||||
ld b, $e4
|
ld b, $e4
|
||||||
.asm_7090d
|
.fadeInMarowakLoop
|
||||||
ld c, $a
|
ld c, 10
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld a, [rOBP1] ; $ff49
|
ld a, [rOBP1]
|
||||||
srl b
|
srl b
|
||||||
rra
|
rra
|
||||||
srl b
|
srl b
|
||||||
rra
|
rra
|
||||||
ld [rOBP1], a ; $ff49
|
ld [rOBP1], a
|
||||||
ld a, b
|
ld a, b
|
||||||
and a
|
and a
|
||||||
jr nz, .asm_7090d
|
jr nz, .fadeInMarowakLoop
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
|
ld [H_AUTOBGTRANSFERENABLED], a ; enable BG transfer so the BG Marowak pic will be visible after the sprite one is cleared
|
||||||
call Delay3
|
call Delay3
|
||||||
jp ClearSprites
|
jp ClearSprites
|
||||||
|
|
||||||
Func_7092a: ; 7092a (1c:492a)
|
; copies a mon pic's from background VRAM to sprite VRAM and sets up OAM
|
||||||
|
CopyMonPicFromBGToSpriteVRAM: ; 7092a (1c:492a)
|
||||||
ld de, vFrontPic
|
ld de, vFrontPic
|
||||||
ld hl, vSprites
|
ld hl, vSprites
|
||||||
ld bc, 7 * 7
|
ld bc, 7 * 7
|
||||||
call CopyVideoData
|
call CopyVideoData
|
||||||
ld a, $10
|
ld a, $10
|
||||||
ld [W_BASECOORDY], a ; wd082
|
ld [W_BASECOORDY], a
|
||||||
ld a, $70
|
ld a, $70
|
||||||
ld [W_BASECOORDX], a ; wd081
|
ld [W_BASECOORDX], a
|
||||||
ld hl, wOAMBuffer
|
ld hl, wOAMBuffer
|
||||||
ld bc, $606
|
ld bc, $606
|
||||||
ld d, $8
|
ld d, $8
|
||||||
.asm_70948
|
.oamLoop
|
||||||
push bc
|
push bc
|
||||||
ld a, [W_BASECOORDY] ; wd082
|
ld a, [W_BASECOORDY]
|
||||||
ld e, a
|
ld e, a
|
||||||
.asm_7094d
|
.oamInnerLoop
|
||||||
ld a, e
|
ld a, e
|
||||||
add $8
|
add $8
|
||||||
ld e, a
|
ld e, a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld a, [W_BASECOORDX] ; wd081
|
ld a, [W_BASECOORDX]
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld a, d
|
ld a, d
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld a, $10
|
ld a, $10 ; use OBP1
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
inc d
|
inc d
|
||||||
dec c
|
dec c
|
||||||
jr nz, .asm_7094d
|
jr nz, .oamInnerLoop
|
||||||
inc d
|
inc d
|
||||||
ld a, [W_BASECOORDX] ; wd081
|
ld a, [W_BASECOORDX]
|
||||||
add $8
|
add $8
|
||||||
ld [W_BASECOORDX], a ; wd081
|
ld [W_BASECOORDX], a
|
||||||
pop bc
|
pop bc
|
||||||
dec b
|
dec b
|
||||||
jr nz, .asm_70948
|
jr nz, .oamLoop
|
||||||
ret
|
ret
|
||||||
|
|
||||||
BattleTransition: ; 7096d (1c:496d)
|
BattleTransition: ; 7096d (1c:496d)
|
||||||
|
|
@ -270,9 +276,9 @@ BattleTransitionTile: ; 70a59 (1c:4a59)
|
||||||
|
|
||||||
BattleTransition_BlackScreen: ; 70a69 (1c:4a69)
|
BattleTransition_BlackScreen: ; 70a69 (1c:4a69)
|
||||||
ld a, $ff
|
ld a, $ff
|
||||||
ld [rBGP], a ; $ff47
|
ld [rBGP], a
|
||||||
ld [rOBP0], a ; $ff48
|
ld [rOBP0], a
|
||||||
ld [rOBP1], a ; $ff49
|
ld [rOBP1], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; for non-dungeon trainer battles
|
; for non-dungeon trainer battles
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
Func_128d8: ; 128d8 (4:68d8)
|
; returns whether the player is one tile outside the map in Z
|
||||||
ld a, [W_YCOORD] ; wd361
|
IsPlayerJustOutsideMap: ; 128d8 (4:68d8)
|
||||||
|
ld a, [W_YCOORD]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [W_CURMAPHEIGHT] ; wd368
|
ld a, [W_CURMAPHEIGHT]
|
||||||
call Func_128ea
|
call .compareCoordWithMapDimension
|
||||||
ret z
|
ret z
|
||||||
ld a, [W_XCOORD] ; wd362
|
ld a, [W_XCOORD]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [W_CURMAPWIDTH] ; wd369
|
ld a, [W_CURMAPWIDTH]
|
||||||
|
.compareCoordWithMapDimension
|
||||||
Func_128ea: ; 128ea (4:68ea)
|
|
||||||
add a
|
add a
|
||||||
cp b
|
cp b
|
||||||
ret z
|
ret z
|
||||||
|
|
@ -18,58 +18,58 @@ Func_128ea: ; 128ea (4:68ea)
|
||||||
DrawHP: ; 128ef (4:68ef)
|
DrawHP: ; 128ef (4:68ef)
|
||||||
call GetPredefRegisters
|
call GetPredefRegisters
|
||||||
ld a, $1
|
ld a, $1
|
||||||
jr asm_128fb
|
jr DrawHP_
|
||||||
|
|
||||||
Func_128f6: ; 128f6 (4:68f6)
|
DrawHP2: ; 128f6 (4:68f6)
|
||||||
call GetPredefRegisters
|
call GetPredefRegisters
|
||||||
ld a, $2
|
ld a, $2
|
||||||
asm_128fb: ; 128fb (4:68fb)
|
|
||||||
ld [wListMenuID], a ; wListMenuID
|
DrawHP_: ; 128fb (4:68fb)
|
||||||
|
ld [wHPBarType], a
|
||||||
push hl
|
push hl
|
||||||
ld a, [wcf99]
|
ld a, [wLoadedMonHP]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [wcf9a]
|
ld a, [wLoadedMonHP + 1]
|
||||||
ld c, a
|
ld c, a
|
||||||
or b
|
or b
|
||||||
jr nz, .asm_12913
|
jr nz, .nonzeroHP
|
||||||
xor a
|
xor a
|
||||||
ld c, a
|
ld c, a
|
||||||
ld e, a
|
ld e, a
|
||||||
ld a, $6
|
ld a, $6
|
||||||
ld d, a
|
ld d, a
|
||||||
jp Func_12924
|
jp .drawHPBarAndPrintFraction
|
||||||
.asm_12913
|
.nonzeroHP
|
||||||
ld a, [wcfba]
|
ld a, [wLoadedMonMaxHP]
|
||||||
ld d, a
|
ld d, a
|
||||||
ld a, [wcfbb]
|
ld a, [wLoadedMonMaxHP + 1]
|
||||||
ld e, a
|
ld e, a
|
||||||
predef HPBarLength
|
predef HPBarLength
|
||||||
ld a, $6
|
ld a, $6
|
||||||
ld d, a
|
ld d, a
|
||||||
ld c, a
|
ld c, a
|
||||||
|
.drawHPBarAndPrintFraction
|
||||||
Func_12924: ; 12924 (4:6924)
|
|
||||||
pop hl
|
pop hl
|
||||||
push de
|
push de
|
||||||
push hl
|
push hl
|
||||||
push hl
|
push hl
|
||||||
call DrawHPBar
|
call DrawHPBar
|
||||||
pop hl
|
pop hl
|
||||||
ld a, [$fff6]
|
ld a, [hFlags_0xFFF6]
|
||||||
bit 0, a
|
bit 0, a
|
||||||
jr z, .asm_12937
|
jr z, .printFractionBelowBar
|
||||||
ld bc, $9
|
ld bc, $9 ; right of bar
|
||||||
jr .asm_1293a
|
jr .printFraction
|
||||||
.asm_12937
|
.printFractionBelowBar
|
||||||
ld bc, $15
|
ld bc, SCREEN_WIDTH + 1 ; below bar
|
||||||
.asm_1293a
|
.printFraction
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld de, wcf99
|
ld de, wLoadedMonHP
|
||||||
ld bc, $203
|
ld bc, $203
|
||||||
call PrintNumber
|
call PrintNumber
|
||||||
ld a, "/"
|
ld a, "/"
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld de, wcfba
|
ld de, wLoadedMonMaxHP
|
||||||
ld bc, $203
|
ld bc, $203
|
||||||
call PrintNumber
|
call PrintNumber
|
||||||
pop hl
|
pop hl
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ EndOfBattle: ; 137aa (4:77aa)
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld [wListScrollOffset], a
|
ld [wListScrollOffset], a
|
||||||
ld hl, wd060
|
ld hl, wPlayerStatsToDouble
|
||||||
ld b, $18
|
ld b, $18
|
||||||
.loop
|
.loop
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
|
@ -87,7 +87,9 @@ PickUpPayDayMoneyText: ; 1386b (4:786b)
|
||||||
TX_FAR _PickUpPayDayMoneyText
|
TX_FAR _PickUpPayDayMoneyText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
Func_13870: ; 13870 (4:7870)
|
; try to initiate a wild pokemon encounter
|
||||||
|
; returns success in Z
|
||||||
|
TryDoWildEncounter: ; 13870 (4:7870)
|
||||||
ld a, [wNPCMovementScriptPointerTableNum]
|
ld a, [wNPCMovementScriptPointerTableNum]
|
||||||
and a
|
and a
|
||||||
ret nz
|
ret nz
|
||||||
|
|
@ -95,14 +97,14 @@ Func_13870: ; 13870 (4:7870)
|
||||||
and a
|
and a
|
||||||
ret nz
|
ret nz
|
||||||
callab IsPlayerStandingOnDoorTileOrWarpTile
|
callab IsPlayerStandingOnDoorTileOrWarpTile
|
||||||
jr nc, .asm_13888
|
jr nc, .notStandingOnDoorOrWarpTile
|
||||||
.asm_13884
|
.CantEncounter
|
||||||
ld a, $1
|
ld a, $1
|
||||||
and a
|
and a
|
||||||
ret
|
ret
|
||||||
.asm_13888
|
.notStandingOnDoorOrWarpTile
|
||||||
callab Func_128d8
|
callab IsPlayerJustOutsideMap
|
||||||
jr z, .asm_13884
|
jr z, .CantEncounter
|
||||||
ld a, [wRepelRemainingSteps]
|
ld a, [wRepelRemainingSteps]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_1389e
|
jr z, .asm_1389e
|
||||||
|
|
@ -110,8 +112,8 @@ Func_13870: ; 13870 (4:7870)
|
||||||
jr z, .lastRepelStep
|
jr z, .lastRepelStep
|
||||||
ld [wRepelRemainingSteps], a
|
ld [wRepelRemainingSteps], a
|
||||||
.asm_1389e
|
.asm_1389e
|
||||||
; determine if wild pokémon can appear in the half-block we’re standing
|
; determine if wild pokémon can appear in the half-block we’re standing in
|
||||||
; is the bottom right tile (9,9) of the half-block are we standing a grass/water tile?
|
; is the bottom right tile (9,9) of the half-block we're standing in a grass/water tile?
|
||||||
hlCoord 9, 9
|
hlCoord 9, 9
|
||||||
ld c, [hl]
|
ld c, [hl]
|
||||||
ld a, [W_GRASSTILE]
|
ld a, [W_GRASSTILE]
|
||||||
|
|
@ -127,17 +129,17 @@ Func_13870: ; 13870 (4:7870)
|
||||||
; …as long as it’s not Viridian Forest or Safari Zone.
|
; …as long as it’s not Viridian Forest or Safari Zone.
|
||||||
ld a, [W_CURMAP]
|
ld a, [W_CURMAP]
|
||||||
cp REDS_HOUSE_1F ; is this an indoor map?
|
cp REDS_HOUSE_1F ; is this an indoor map?
|
||||||
jr c, .CantEncounter
|
jr c, .CantEncounter2
|
||||||
ld a, [W_CURMAPTILESET]
|
ld a, [W_CURMAPTILESET]
|
||||||
cp FOREST ; Viridian Forest/Safari Zone
|
cp FOREST ; Viridian Forest/Safari Zone
|
||||||
jr z, .CantEncounter
|
jr z, .CantEncounter2
|
||||||
ld a, [W_GRASSRATE]
|
ld a, [W_GRASSRATE]
|
||||||
.CanEncounter
|
.CanEncounter
|
||||||
; weigh encounter chance to a random number to determine if there will be an encounter
|
; compare encounter chance with a random number to determine if there will be an encounter
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [hRandomAdd]
|
ld a, [hRandomAdd]
|
||||||
cp b
|
cp b
|
||||||
jr nc, .CantEncounter
|
jr nc, .CantEncounter2
|
||||||
ld a, [hRandomSub]
|
ld a, [hRandomSub]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld hl, WildMonEncounterSlotChances
|
ld hl, WildMonEncounterSlotChances
|
||||||
|
|
@ -148,15 +150,15 @@ Func_13870: ; 13870 (4:7870)
|
||||||
inc hl
|
inc hl
|
||||||
jr .determineEncounterSlot
|
jr .determineEncounterSlot
|
||||||
.gotEncounterSlot
|
.gotEncounterSlot
|
||||||
; determine which wild pokémon (grass or water) can appear in the half-block we’re standing
|
; determine which wild pokémon (grass or water) can appear in the half-block we’re standing in
|
||||||
ld c, [hl]
|
ld c, [hl]
|
||||||
ld hl, W_GRASSMONS
|
ld hl, W_GRASSMONS
|
||||||
aCoord 8, 9
|
aCoord 8, 9
|
||||||
cp $14 ; is the bottom left tile (8,9) of the half-block are we standing a water tile?
|
cp $14 ; is the bottom left tile (8,9) of the half-block we're standing in a water tile?
|
||||||
jr nz, .gotWildEncounterType ; else, it's treated as a grass tile by default
|
jr nz, .gotWildEncounterType ; else, it's treated as a grass tile by default
|
||||||
ld hl, W_WATERMONS
|
ld hl, W_WATERMONS
|
||||||
; since the bottom right tile of a "left shore" half-block is $14 but the bottom left tile is not,
|
; since the bottom right tile of a "left shore" half-block is $14 but the bottom left tile is not,
|
||||||
; "left shore" half-blocks (such as the one in the east coast of Cinnabar), load grass encounters.
|
; "left shore" half-blocks (such as the one in the east coast of Cinnabar) load grass encounters.
|
||||||
.gotWildEncounterType
|
.gotWildEncounterType
|
||||||
ld b, $0
|
ld b, $0
|
||||||
add hl, bc
|
add hl, bc
|
||||||
|
|
@ -172,15 +174,15 @@ Func_13870: ; 13870 (4:7870)
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [W_CURENEMYLVL]
|
ld a, [W_CURENEMYLVL]
|
||||||
cp b
|
cp b
|
||||||
jr c, .CantEncounter
|
jr c, .CantEncounter2 ; repel prevents encounters if the leading party mon's level is higher than the wild mon
|
||||||
jr .willEncounter
|
jr .willEncounter
|
||||||
.lastRepelStep
|
.lastRepelStep
|
||||||
ld [wRepelRemainingSteps], a
|
ld [wRepelRemainingSteps], a
|
||||||
ld a, $d2
|
ld a, $d2
|
||||||
ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
|
ld [H_DOWNARROWBLINKCNT2], a
|
||||||
call EnableAutoTextBoxDrawing
|
call EnableAutoTextBoxDrawing
|
||||||
call DisplayTextID
|
call DisplayTextID
|
||||||
.CantEncounter
|
.CantEncounter2
|
||||||
ld a, $1
|
ld a, $1
|
||||||
and a
|
and a
|
||||||
ret
|
ret
|
||||||
|
|
@ -205,16 +207,16 @@ WildMonEncounterSlotChances: ; 13918 (4:7918)
|
||||||
db $FF, $12 ; 3/256 = 1.2% chance of slot 9
|
db $FF, $12 ; 3/256 = 1.2% chance of slot 9
|
||||||
|
|
||||||
RecoilEffect_: ; 1392c (4:792c)
|
RecoilEffect_: ; 1392c (4:792c)
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
ld a, [W_PLAYERMOVENUM] ; wcfd2
|
ld a, [W_PLAYERMOVENUM]
|
||||||
ld hl, wBattleMonMaxHP ; wd023
|
ld hl, wBattleMonMaxHP
|
||||||
jr z, .asm_1393d
|
jr z, .asm_1393d
|
||||||
ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM
|
ld a, [W_ENEMYMOVENUM]
|
||||||
ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP
|
ld hl, wEnemyMonMaxHP
|
||||||
.asm_1393d
|
.asm_1393d
|
||||||
ld d, a
|
ld d, a
|
||||||
ld a, [W_DAMAGE] ; W_DAMAGE
|
ld a, [W_DAMAGE]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [W_DAMAGE + 1]
|
ld a, [W_DAMAGE + 1]
|
||||||
ld c, a
|
ld c, a
|
||||||
|
|
@ -258,16 +260,16 @@ RecoilEffect_: ; 1392c (4:792c)
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
.asm_13982
|
.asm_13982
|
||||||
hlCoord 10, 9
|
hlCoord 10, 9
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
jr z, .asm_13990
|
jr z, .asm_13990
|
||||||
hlCoord 2, 2
|
hlCoord 2, 2
|
||||||
xor a
|
xor a
|
||||||
.asm_13990
|
.asm_13990
|
||||||
ld [wListMenuID], a ; wListMenuID
|
ld [wHPBarType], a
|
||||||
predef UpdateHPBar2
|
predef UpdateHPBar2
|
||||||
ld hl, HitWithRecoilText ; $799e
|
ld hl, HitWithRecoilText
|
||||||
jp PrintText
|
jp PrintText
|
||||||
HitWithRecoilText: ; 1399e (4:799e)
|
HitWithRecoilText: ; 1399e (4:799e)
|
||||||
TX_FAR _HitWithRecoilText
|
TX_FAR _HitWithRecoilText
|
||||||
|
|
@ -293,8 +295,8 @@ ConversionEffect_: ; 139a3 (4:79a3)
|
||||||
inc de
|
inc de
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [de], a
|
ld [de], a
|
||||||
ld hl, Func_3fba8
|
ld hl, PlayCurrentMoveAnimation
|
||||||
call Func_139d5
|
call CallBankF
|
||||||
ld hl, ConvertedTypeText
|
ld hl, ConvertedTypeText
|
||||||
jp PrintText
|
jp PrintText
|
||||||
|
|
||||||
|
|
@ -304,22 +306,22 @@ ConvertedTypeText: ; 139cd (4:79cd)
|
||||||
|
|
||||||
PrintButItFailedText: ; 139d2 (4:79d2)
|
PrintButItFailedText: ; 139d2 (4:79d2)
|
||||||
ld hl, PrintButItFailedText_
|
ld hl, PrintButItFailedText_
|
||||||
Func_139d5: ; 139d5 (4:79d5)
|
CallBankF: ; 139d5 (4:79d5)
|
||||||
ld b, BANK(PrintButItFailedText_)
|
ld b, BANK(PrintButItFailedText_)
|
||||||
jp Bankswitch
|
jp Bankswitch
|
||||||
|
|
||||||
HazeEffect_: ; 139da (4:79da)
|
HazeEffect_: ; 139da (4:79da)
|
||||||
ld a, $7
|
ld a, $7
|
||||||
ld hl, wPlayerMonAttackMod
|
ld hl, wPlayerMonAttackMod
|
||||||
call Func_13a43
|
call ResetStatMods
|
||||||
ld hl, wEnemyMonAttackMod
|
ld hl, wEnemyMonAttackMod
|
||||||
call Func_13a43
|
call ResetStatMods
|
||||||
ld hl, wPlayerMonUnmodifiedAttack
|
ld hl, wPlayerMonUnmodifiedAttack
|
||||||
ld de, wBattleMonAttack
|
ld de, wBattleMonAttack
|
||||||
call Func_13a4a
|
call ResetStats
|
||||||
ld hl, wEnemyMonUnmodifiedAttack
|
ld hl, wEnemyMonUnmodifiedAttack
|
||||||
ld de, wEnemyMonAttack
|
ld de, wEnemyMonAttack
|
||||||
call Func_13a4a
|
call ResetStats
|
||||||
ld hl, wEnemyMonStatus
|
ld hl, wEnemyMonStatus
|
||||||
ld de, wEnemySelectedMove
|
ld de, wEnemySelectedMove
|
||||||
ld a, [H_WHOSETURN]
|
ld a, [H_WHOSETURN]
|
||||||
|
|
@ -347,8 +349,8 @@ HazeEffect_: ; 139da (4:79da)
|
||||||
call CureStatuses
|
call CureStatuses
|
||||||
ld hl, W_ENEMYBATTSTATUS1
|
ld hl, W_ENEMYBATTSTATUS1
|
||||||
call CureStatuses
|
call CureStatuses
|
||||||
ld hl, Func_3fba8
|
ld hl, PlayCurrentMoveAnimation
|
||||||
call Func_139d5
|
call CallBankF
|
||||||
ld hl, StatusChangesEliminatedText
|
ld hl, StatusChangesEliminatedText
|
||||||
jp PrintText
|
jp PrintText
|
||||||
|
|
||||||
|
|
@ -363,7 +365,7 @@ CureStatuses: ; 13a37 (4:7a37)
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_13a43: ; 13a43 (4:7a43)
|
ResetStatMods: ; 13a43 (4:7a43)
|
||||||
ld b, $8
|
ld b, $8
|
||||||
.loop
|
.loop
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
|
@ -371,7 +373,7 @@ Func_13a43: ; 13a43 (4:7a43)
|
||||||
jr nz, .loop
|
jr nz, .loop
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_13a4a: ; 13a4a (4:7a4a)
|
ResetStats: ; 13a4a (4:7a4a)
|
||||||
ld b, $8
|
ld b, $8
|
||||||
.loop
|
.loop
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
|
|
@ -390,8 +392,8 @@ GetTrainerName_: ; 13a58 (4:7a58)
|
||||||
ld a, [wLinkState]
|
ld a, [wLinkState]
|
||||||
and a
|
and a
|
||||||
jr nz, .rival
|
jr nz, .rival
|
||||||
ld hl, W_RIVALNAME ; wd34a
|
ld hl, W_RIVALNAME
|
||||||
ld a, [W_TRAINERCLASS] ; wd031
|
ld a, [W_TRAINERCLASS]
|
||||||
cp SONY1
|
cp SONY1
|
||||||
jr z, .rival
|
jr z, .rival
|
||||||
cp SONY2
|
cp SONY2
|
||||||
|
|
@ -400,7 +402,7 @@ GetTrainerName_: ; 13a58 (4:7a58)
|
||||||
jr z, .rival
|
jr z, .rival
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
ld a, TRAINER_NAME
|
ld a, TRAINER_NAME
|
||||||
ld [W_LISTTYPE], a
|
ld [wNameListType], a
|
||||||
ld a, BANK(TrainerNames)
|
ld a, BANK(TrainerNames)
|
||||||
ld [wPredefBank], a
|
ld [wPredefBank], a
|
||||||
call GetName
|
call GetName
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ SubstituteEffectHandler: ; 17dad (5:7dad)
|
||||||
ld hl, wBattleMonMaxHP
|
ld hl, wBattleMonMaxHP
|
||||||
ld de, wPlayerSubstituteHP
|
ld de, wPlayerSubstituteHP
|
||||||
ld bc, W_PLAYERBATTSTATUS2
|
ld bc, W_PLAYERBATTSTATUS2
|
||||||
ld a, [$fff3] ;whose turn?
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr z, .notEnemy
|
jr z, .notEnemy
|
||||||
ld hl, wEnemyMonMaxHP
|
ld hl, wEnemyMonMaxHP
|
||||||
|
|
@ -23,8 +23,8 @@ SubstituteEffectHandler: ; 17dad (5:7dad)
|
||||||
srl a
|
srl a
|
||||||
rr b
|
rr b
|
||||||
push de
|
push de
|
||||||
ld de, $fff2 ;subtract 8 to point to [current hp] instead of [max hp]
|
ld de, wBattleMonHP - wBattleMonMaxHP
|
||||||
add hl, de ;HL -= 8
|
add hl, de ; point hl to current HP
|
||||||
pop de
|
pop de
|
||||||
ld a, b
|
ld a, b
|
||||||
ld [de], a ;save copy of HP to subtract in ccd7/ccd8 [how much HP substitute has]
|
ld [de], a ;save copy of HP to subtract in ccd7/ccd8 [how much HP substitute has]
|
||||||
|
|
@ -44,8 +44,8 @@ SubstituteEffectHandler: ; 17dad (5:7dad)
|
||||||
set HasSubstituteUp, [hl] ;set bit 4 of flags, user now has substitute
|
set HasSubstituteUp, [hl] ;set bit 4 of flags, user now has substitute
|
||||||
ld a, [W_OPTIONS] ;load options
|
ld a, [W_OPTIONS] ;load options
|
||||||
bit 7, a ;battle animation is enabled?
|
bit 7, a ;battle animation is enabled?
|
||||||
ld hl, Func_3fba8 ;animation enabled: 0F:7BA8
|
ld hl, PlayCurrentMoveAnimation ;animation enabled: 0F:7BA8
|
||||||
ld b, BANK(Func_3fba8)
|
ld b, BANK(PlayCurrentMoveAnimation)
|
||||||
jr z, .animationEnabled
|
jr z, .animationEnabled
|
||||||
ld hl, AnimationSubstitute ;animation disabled: 1E:56E0
|
ld hl, AnimationSubstitute ;animation disabled: 1E:56E0
|
||||||
ld b, BANK(AnimationSubstitute)
|
ld b, BANK(AnimationSubstitute)
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,43 @@
|
||||||
Func_27d6b: ; 27d6b (9:7d6b)
|
; [wd0b5] = pokemon ID
|
||||||
|
; hl = dest addr
|
||||||
|
PrintMonType: ; 27d6b (9:7d6b)
|
||||||
call GetPredefRegisters
|
call GetPredefRegisters
|
||||||
push hl
|
push hl
|
||||||
call GetMonHeader
|
call GetMonHeader
|
||||||
pop hl
|
pop hl
|
||||||
push hl
|
push hl
|
||||||
ld a, [W_MONHTYPE1]
|
ld a, [W_MONHTYPE1]
|
||||||
call Func_27d89
|
call PrintType
|
||||||
ld a, [W_MONHTYPE1]
|
ld a, [W_MONHTYPE1]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [W_MONHTYPE2]
|
ld a, [W_MONHTYPE2]
|
||||||
cp b
|
cp b
|
||||||
pop hl
|
pop hl
|
||||||
jr z, asm_27d8c
|
jr z, EraseType2Text
|
||||||
ld bc, $28
|
ld bc, SCREEN_WIDTH * 2
|
||||||
add hl, bc
|
add hl, bc
|
||||||
|
|
||||||
Func_27d89: ; 27d89 (9:7d89)
|
; a = type
|
||||||
|
; hl = dest addr
|
||||||
|
PrintType: ; 27d89 (9:7d89)
|
||||||
push hl
|
push hl
|
||||||
jr asm_27d9f
|
jr PrintType_
|
||||||
asm_27d8c: ; 27d8c (9:7d8c)
|
|
||||||
ld a, $7f
|
; erase "TYPE2/" if the mon only has 1 type
|
||||||
|
EraseType2Text: ; 27d8c (9:7d8c)
|
||||||
|
ld a, " "
|
||||||
ld bc, $13
|
ld bc, $13
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld bc, $6
|
ld bc, $6
|
||||||
jp FillMemory
|
jp FillMemory
|
||||||
|
|
||||||
Func_27d98: ; 27d98 (9:7d98)
|
PrintMoveType: ; 27d98 (9:7d98)
|
||||||
call GetPredefRegisters
|
call GetPredefRegisters
|
||||||
push hl
|
push hl
|
||||||
ld a, [W_PLAYERMOVETYPE] ; wcfd5
|
ld a, [W_PLAYERMOVETYPE]
|
||||||
asm_27d9f: ; 27d9f (9:7d9f)
|
; fall through
|
||||||
|
|
||||||
|
PrintType_: ; 27d9f (9:7d9f)
|
||||||
add a
|
add a
|
||||||
ld hl, TypeNames
|
ld hl, TypeNames
|
||||||
ld e, a
|
ld e, a
|
||||||
|
|
@ -157,19 +165,19 @@ CooltrainerFName: ; 27f79 (9:7f79)
|
||||||
db "COOLTRAINER♀@"
|
db "COOLTRAINER♀@"
|
||||||
|
|
||||||
FocusEnergyEffect_: ; 27f86 (9:7f86)
|
FocusEnergyEffect_: ; 27f86 (9:7f86)
|
||||||
ld hl, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2
|
ld hl, W_PLAYERBATTSTATUS2
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_27f91
|
jr z, .notEnemy
|
||||||
ld hl, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2
|
ld hl, W_ENEMYBATTSTATUS2
|
||||||
.asm_27f91
|
.notEnemy
|
||||||
bit GettingPumped, [hl] ; is mon already using focus energy?
|
bit GettingPumped, [hl] ; is mon already using focus energy?
|
||||||
jr nz, .asm_27fa5
|
jr nz, .alreadyUsing
|
||||||
set GettingPumped, [hl] ; mon is now using focus energy
|
set GettingPumped, [hl] ; mon is now using focus energy
|
||||||
callab Func_3fba8
|
callab PlayCurrentMoveAnimation
|
||||||
ld hl, GettingPumpedText ; $7fb2
|
ld hl, GettingPumpedText
|
||||||
jp PrintText
|
jp PrintText
|
||||||
.asm_27fa5
|
.alreadyUsing
|
||||||
ld c, $32
|
ld c, $32
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld hl, PrintButItFailedText_
|
ld hl, PrintButItFailedText_
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ LeechSeedEffect_: ; 2bea9 (a:7ea9)
|
||||||
bit Seeded, [hl]
|
bit Seeded, [hl]
|
||||||
jr nz, .asm_2bee7
|
jr nz, .asm_2bee7
|
||||||
set Seeded, [hl]
|
set Seeded, [hl]
|
||||||
callab Func_3fba8
|
callab PlayCurrentMoveAnimation
|
||||||
ld hl, WasSeededText ; $7ef2
|
ld hl, WasSeededText ; $7ef2
|
||||||
jp PrintText
|
jp PrintText
|
||||||
.asm_2bee7
|
.asm_2bee7
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ MistEffect_: ; 33f2b (c:7f2b)
|
||||||
bit ProtectedByMist, [hl] ; is mon protected by mist?
|
bit ProtectedByMist, [hl] ; is mon protected by mist?
|
||||||
jr nz, .asm_33f4a
|
jr nz, .asm_33f4a
|
||||||
set ProtectedByMist, [hl] ; mon is now protected by mist
|
set ProtectedByMist, [hl] ; mon is now protected by mist
|
||||||
callab Func_3fba8
|
callab PlayCurrentMoveAnimation
|
||||||
ld hl, ShroudedInMistText
|
ld hl, ShroudedInMistText
|
||||||
jp PrintText
|
jp PrintText
|
||||||
.asm_33f4a
|
.asm_33f4a
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ SpecialEffectsCont: ; 3c049 (f:4049)
|
||||||
|
|
||||||
SlidePlayerAndEnemySilhouettesOnScreen: ; 3c04c (f:404c)
|
SlidePlayerAndEnemySilhouettesOnScreen: ; 3c04c (f:404c)
|
||||||
call LoadPlayerBackPic
|
call LoadPlayerBackPic
|
||||||
ld a, $1 ; the usual text box at the bottom of the screen
|
ld a, MESSAGE_BOX ; the usual text box at the bottom of the screen
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
hlCoord 1, 5
|
hlCoord 1, 5
|
||||||
|
|
@ -768,7 +768,7 @@ UpdateCurMonHPBar: ; 3c4f6 (f:44f6)
|
||||||
xor a
|
xor a
|
||||||
.playersTurn
|
.playersTurn
|
||||||
push bc
|
push bc
|
||||||
ld [wListMenuID], a
|
ld [wHPBarType], a
|
||||||
predef UpdateHPBar2
|
predef UpdateHPBar2
|
||||||
pop bc
|
pop bc
|
||||||
ret
|
ret
|
||||||
|
|
@ -839,7 +839,7 @@ FaintEnemyPokemon ; 0x3c567
|
||||||
res AttackingMultipleTimes, [hl]
|
res AttackingMultipleTimes, [hl]
|
||||||
xor a
|
xor a
|
||||||
ld [wPlayerNumHits], a
|
ld [wPlayerNumHits], a
|
||||||
ld hl, wd065 ; clear enemy statuses
|
ld hl, wEnemyStatsToDouble ; clear enemy statuses
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
|
@ -1137,7 +1137,7 @@ DoUseNextMonDialogue: ; 3c79b (f:479b)
|
||||||
.displayYesNoBox
|
.displayYesNoBox
|
||||||
hlCoord 13, 9
|
hlCoord 13, 9
|
||||||
ld bc, $a0e
|
ld bc, $a0e
|
||||||
ld a, $14 ; yes/no text box
|
ld a, TWO_OPTION_MENU
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
ld a, [wd12e]
|
ld a, [wd12e]
|
||||||
|
|
@ -1366,7 +1366,7 @@ EnemySendOut: ; 3c90e (f:490e)
|
||||||
; don't change wPartyGainExpFlags or wPartyFoughtCurrentEnemyFlags
|
; don't change wPartyGainExpFlags or wPartyFoughtCurrentEnemyFlags
|
||||||
EnemySendOutFirstMon: ; 3c92a (f:492a)
|
EnemySendOutFirstMon: ; 3c92a (f:492a)
|
||||||
xor a
|
xor a
|
||||||
ld hl,wd065 ; clear enemy statuses
|
ld hl,wEnemyStatsToDouble ; clear enemy statuses
|
||||||
ld [hli],a
|
ld [hli],a
|
||||||
ld [hli],a
|
ld [hli],a
|
||||||
ld [hli],a
|
ld [hli],a
|
||||||
|
|
@ -1454,7 +1454,7 @@ EnemySendOutFirstMon: ; 3c92a (f:492a)
|
||||||
call PrintText
|
call PrintText
|
||||||
hlCoord 0, 7
|
hlCoord 0, 7
|
||||||
ld bc,$0801
|
ld bc,$0801
|
||||||
ld a,$14
|
ld a,TWO_OPTION_MENU
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
ld a,[wCurrentMenuItem]
|
ld a,[wCurrentMenuItem]
|
||||||
|
|
@ -1815,7 +1815,7 @@ SendOutMon: ; 3cc91 (f:4c91)
|
||||||
ld hl, wPlayerUsedMove
|
ld hl, wPlayerUsedMove
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld hl, wd060
|
ld hl, wPlayerStatsToDouble
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
|
@ -1899,23 +1899,23 @@ DrawPlayerHUDAndHPBar: ; 3cd60 (f:4d60)
|
||||||
call CenterMonName
|
call CenterMonName
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld hl, wBattleMonSpecies
|
ld hl, wBattleMonSpecies
|
||||||
ld de, wcf98
|
ld de, wLoadedMon
|
||||||
ld bc, $c
|
ld bc, $c
|
||||||
call CopyData
|
call CopyData
|
||||||
ld hl, wBattleMonLevel
|
ld hl, wBattleMonLevel
|
||||||
ld de, wcfb9
|
ld de, wLoadedMonLevel
|
||||||
ld bc, $b
|
ld bc, $b
|
||||||
call CopyData
|
call CopyData
|
||||||
hlCoord 14, 8
|
hlCoord 14, 8
|
||||||
push hl
|
push hl
|
||||||
inc hl
|
inc hl
|
||||||
ld de, wcf9c
|
ld de, wLoadedMonStatus
|
||||||
call PrintStatusConditionNotFainted
|
call PrintStatusConditionNotFainted
|
||||||
pop hl
|
pop hl
|
||||||
jr nz, .asm_3cdae
|
jr nz, .asm_3cdae
|
||||||
call PrintLevel
|
call PrintLevel
|
||||||
.asm_3cdae
|
.asm_3cdae
|
||||||
ld a, [wcf98]
|
ld a, [wLoadedMonSpecies]
|
||||||
ld [wcf91], a
|
ld [wcf91], a
|
||||||
hlCoord 10, 9
|
hlCoord 10, 9
|
||||||
predef DrawHP
|
predef DrawHP
|
||||||
|
|
@ -1965,7 +1965,7 @@ DrawEnemyHUDAndHPBar: ; 3cdec (f:4dec)
|
||||||
pop hl
|
pop hl
|
||||||
jr nz, .skipPrintLevel ; if the mon has a status condition, skip printing the level
|
jr nz, .skipPrintLevel ; if the mon has a status condition, skip printing the level
|
||||||
ld a, [wEnemyMonLevel]
|
ld a, [wEnemyMonLevel]
|
||||||
ld [wcfb9], a
|
ld [wLoadedMonLevel], a
|
||||||
call PrintLevel
|
call PrintLevel
|
||||||
.skipPrintLevel
|
.skipPrintLevel
|
||||||
ld hl, wEnemyMonHP
|
ld hl, wEnemyMonHP
|
||||||
|
|
@ -2029,7 +2029,7 @@ DrawEnemyHUDAndHPBar: ; 3cdec (f:4dec)
|
||||||
ld c, a
|
ld c, a
|
||||||
.drawHPBar
|
.drawHPBar
|
||||||
xor a
|
xor a
|
||||||
ld [wListMenuID], a
|
ld [wHPBarType], a
|
||||||
hlCoord 2, 2
|
hlCoord 2, 2
|
||||||
call DrawHPBar
|
call DrawHPBar
|
||||||
ld a, $1
|
ld a, $1
|
||||||
|
|
@ -2080,9 +2080,9 @@ DisplayBattleMenu: ; 3ceb3 (f:4eb3)
|
||||||
.nonstandardbattle
|
.nonstandardbattle
|
||||||
ld a, [W_BATTLETYPE]
|
ld a, [W_BATTLETYPE]
|
||||||
cp $2 ; safari
|
cp $2 ; safari
|
||||||
ld a, $b ; safari menu id
|
ld a, BATTLE_MENU_TEMPLATE
|
||||||
jr nz, .menuselected
|
jr nz, .menuselected
|
||||||
ld a, $1b ; regular menu id
|
ld a, SAFARI_BATTLE_MENU_TEMPLATE
|
||||||
.menuselected
|
.menuselected
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
|
|
@ -2270,9 +2270,9 @@ BagWasSelected:
|
||||||
jr nz, DisplayPlayerBag ; no, it is a normal battle
|
jr nz, DisplayPlayerBag ; no, it is a normal battle
|
||||||
ld hl, OldManItemList
|
ld hl, OldManItemList
|
||||||
ld a, l
|
ld a, l
|
||||||
ld [wcf8b], a
|
ld [wList], a
|
||||||
ld a, h
|
ld a, h
|
||||||
ld [wcf8c], a
|
ld [wList + 1], a
|
||||||
jr DisplayBagMenu
|
jr DisplayBagMenu
|
||||||
|
|
||||||
OldManItemList:
|
OldManItemList:
|
||||||
|
|
@ -2284,9 +2284,9 @@ DisplayPlayerBag:
|
||||||
; get the pointer to player's bag when in a normal battle
|
; get the pointer to player's bag when in a normal battle
|
||||||
ld hl, wNumBagItems
|
ld hl, wNumBagItems
|
||||||
ld a, l
|
ld a, l
|
||||||
ld [wcf8b], a
|
ld [wList], a
|
||||||
ld a, h
|
ld a, h
|
||||||
ld [wcf8c], a
|
ld [wList + 1], a
|
||||||
|
|
||||||
DisplayBagMenu:
|
DisplayBagMenu:
|
||||||
xor a
|
xor a
|
||||||
|
|
@ -2402,7 +2402,7 @@ PartyMenuOrRockOrRun:
|
||||||
call GoBackToPartyMenu
|
call GoBackToPartyMenu
|
||||||
jr .checkIfPartyMonWasSelected
|
jr .checkIfPartyMonWasSelected
|
||||||
.partyMonWasSelected
|
.partyMonWasSelected
|
||||||
ld a, $c ; switch/stats/cancel menu
|
ld a, SWITCH_STATS_CANCEL_MENU_TEMPLATE
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
ld hl, wTopMenuItemY
|
ld hl, wTopMenuItemY
|
||||||
|
|
@ -2533,21 +2533,21 @@ MoveSelectionMenu: ; 3d219 (f:5219)
|
||||||
jr .regularmenu
|
jr .regularmenu
|
||||||
|
|
||||||
.loadmoves
|
.loadmoves
|
||||||
ld de, wd0dc
|
ld de, wMoves
|
||||||
ld bc, $4
|
ld bc, NUM_MOVES
|
||||||
call CopyData
|
call CopyData
|
||||||
callab Func_39b87
|
callab FormatMovesString
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.writemoves
|
.writemoves
|
||||||
ld de, wd0e1
|
ld de, wMovesString
|
||||||
ld a, [$fff6]
|
ld a, [hFlags_0xFFF6]
|
||||||
set 2, a
|
set 2, a
|
||||||
ld [$fff6], a
|
ld [hFlags_0xFFF6], a
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld a, [$fff6]
|
ld a, [hFlags_0xFFF6]
|
||||||
res 2, a
|
res 2, a
|
||||||
ld [$fff6], a
|
ld [hFlags_0xFFF6], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.regularmenu
|
.regularmenu
|
||||||
|
|
@ -2666,10 +2666,10 @@ SelectMenuItem: ; 3d2fe (f:52fe)
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
ld [hl], $ec
|
ld [hl], $ec
|
||||||
.select
|
.select
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
set 1, [hl]
|
set 1, [hl]
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
res 1, [hl]
|
res 1, [hl]
|
||||||
bit 6, a
|
bit 6, a
|
||||||
jp nz, CursorUp ; up
|
jp nz, CursorUp ; up
|
||||||
|
|
@ -2959,7 +2959,7 @@ PrintMenuItem: ; 3d4b6 (f:54b6)
|
||||||
call PrintNumber
|
call PrintNumber
|
||||||
call GetCurrentMove
|
call GetCurrentMove
|
||||||
hlCoord 2, 10
|
hlCoord 2, 10
|
||||||
predef Func_27d98
|
predef PrintMoveType
|
||||||
.moveDisabled
|
.moveDisabled
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
|
|
@ -3554,7 +3554,7 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854)
|
||||||
ld a,[hld]
|
ld a,[hld]
|
||||||
add a
|
add a
|
||||||
ld b,a
|
ld b,a
|
||||||
ld [wd0d8],a
|
ld [W_DAMAGE + 1],a
|
||||||
ld a,[hl]
|
ld a,[hl]
|
||||||
rl a ; double the damage
|
rl a ; double the damage
|
||||||
ld [W_DAMAGE],a
|
ld [W_DAMAGE],a
|
||||||
|
|
@ -4451,7 +4451,7 @@ GetEnemyMonStat: ; 3df1c (f:5f1c)
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
call GetMonHeader
|
call GetMonHeader
|
||||||
ld hl, wEnemyMonDVs
|
ld hl, wEnemyMonDVs
|
||||||
ld de, wcfaf
|
ld de, wLoadedMonSpeedExp
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
|
|
@ -4459,7 +4459,7 @@ GetEnemyMonStat: ; 3df1c (f:5f1c)
|
||||||
ld [de], a
|
ld [de], a
|
||||||
pop bc
|
pop bc
|
||||||
ld b, $0
|
ld b, $0
|
||||||
ld hl, wcfa4
|
ld hl, wLoadedMonSpeedExp - $b ; this base address makes CalcStat look in [wLoadedMonSpeedExp] for DVs
|
||||||
call CalcStat
|
call CalcStat
|
||||||
pop de
|
pop de
|
||||||
ret
|
ret
|
||||||
|
|
@ -4899,7 +4899,7 @@ ApplyDamageToEnemyPokemon: ; 3e142 (f:6142)
|
||||||
ld [wHPBarNewHP],a
|
ld [wHPBarNewHP],a
|
||||||
hlCoord 2, 2
|
hlCoord 2, 2
|
||||||
xor a
|
xor a
|
||||||
ld [wListMenuID],a
|
ld [wHPBarType],a
|
||||||
predef UpdateHPBar2 ; animate the HP bar shortening
|
predef UpdateHPBar2 ; animate the HP bar shortening
|
||||||
ApplyAttackToEnemyPokemonDone: ; 3e19d (f:619d)
|
ApplyAttackToEnemyPokemonDone: ; 3e19d (f:619d)
|
||||||
jp DrawHUDsAndHPBars
|
jp DrawHUDsAndHPBars
|
||||||
|
|
@ -5017,7 +5017,7 @@ ApplyDamageToPlayerPokemon: ; 3e200 (f:6200)
|
||||||
ld [wHPBarMaxHP],a
|
ld [wHPBarMaxHP],a
|
||||||
hlCoord 10, 9
|
hlCoord 10, 9
|
||||||
ld a,$01
|
ld a,$01
|
||||||
ld [wListMenuID],a
|
ld [wHPBarType],a
|
||||||
predef UpdateHPBar2 ; animate the HP bar shortening
|
predef UpdateHPBar2 ; animate the HP bar shortening
|
||||||
ApplyAttackToPlayerPokemonDone
|
ApplyAttackToPlayerPokemonDone
|
||||||
jp DrawHUDsAndHPBars
|
jp DrawHUDsAndHPBars
|
||||||
|
|
@ -5671,7 +5671,7 @@ EnemyCanExecuteChargingMove: ; 3e70b (f:670b)
|
||||||
ld a, BANK(MoveNames)
|
ld a, BANK(MoveNames)
|
||||||
ld [wPredefBank], a
|
ld [wPredefBank], a
|
||||||
ld a, MOVE_NAME
|
ld a, MOVE_NAME
|
||||||
ld [W_LISTTYPE], a
|
ld [wNameListType], a
|
||||||
call GetName
|
call GetName
|
||||||
ld de, wcd6d
|
ld de, wcd6d
|
||||||
call CopyStringToCF4B
|
call CopyStringToCF4B
|
||||||
|
|
@ -6053,7 +6053,7 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
|
||||||
ld a, [hld]
|
ld a, [hld]
|
||||||
add a
|
add a
|
||||||
ld b, a
|
ld b, a
|
||||||
ld [wd0d8], a
|
ld [W_DAMAGE + 1], a
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
rl a
|
rl a
|
||||||
ld [W_DAMAGE], a
|
ld [W_DAMAGE], a
|
||||||
|
|
@ -6148,7 +6148,7 @@ GetCurrentMove: ; 3eabe (f:6abe)
|
||||||
ld a, BANK(MoveNames)
|
ld a, BANK(MoveNames)
|
||||||
ld [wPredefBank], a
|
ld [wPredefBank], a
|
||||||
ld a, MOVE_NAME
|
ld a, MOVE_NAME
|
||||||
ld [W_LISTTYPE], a
|
ld [wNameListType], a
|
||||||
call GetName
|
call GetName
|
||||||
ld de, wcd6d
|
ld de, wcd6d
|
||||||
jp CopyStringToCF4B
|
jp CopyStringToCF4B
|
||||||
|
|
@ -6339,7 +6339,7 @@ DoBattleTransitionAndInitBattleVariables: ; 3ec32 (f:6c32)
|
||||||
ld [hWY], a
|
ld [hWY], a
|
||||||
ld [rWY], a
|
ld [rWY], a
|
||||||
ld [hTilesetType], a
|
ld [hTilesetType], a
|
||||||
ld hl, wd060
|
ld hl, wPlayerStatsToDouble
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
|
@ -6423,10 +6423,11 @@ LoadPlayerBackPic: ; 3ec92 (f:6c92)
|
||||||
hlCoord 1, 5
|
hlCoord 1, 5
|
||||||
predef_jump Func_3f0c6
|
predef_jump Func_3f0c6
|
||||||
|
|
||||||
Func_3ed02: ; 3ed02 (f:6d02)
|
; does nothing since no stats are ever selected (barring glitches)
|
||||||
callab Func_39680
|
DoubleOrHalveSelectedStats: ; 3ed02 (f:6d02)
|
||||||
ld hl, Func_396a7
|
callab DoubleSelectedStats
|
||||||
ld b, BANK(Func_396a7)
|
ld hl, HalveSelectedStats
|
||||||
|
ld b, BANK(HalveSelectedStats)
|
||||||
jp Bankswitch
|
jp Bankswitch
|
||||||
|
|
||||||
ScrollTrainerPicAfterBattle: ; 3ed12 (f:6d12)
|
ScrollTrainerPicAfterBattle: ; 3ed12 (f:6d12)
|
||||||
|
|
@ -6814,7 +6815,7 @@ asm_3ef23: ; 3ef23 (f:6f23)
|
||||||
ld a, [wNumberOfNoRandomBattleStepsLeft]
|
ld a, [wNumberOfNoRandomBattleStepsLeft]
|
||||||
and a
|
and a
|
||||||
ret nz
|
ret nz
|
||||||
callab Func_13870
|
callab TryDoWildEncounter
|
||||||
ret nz
|
ret nz
|
||||||
asm_3ef3d: ; 3ef3d (f:6f3d)
|
asm_3ef3d: ; 3ef3d (f:6f3d)
|
||||||
ld a, [wMapPalOffset]
|
ld a, [wMapPalOffset]
|
||||||
|
|
@ -6823,7 +6824,7 @@ asm_3ef3d: ; 3ef3d (f:6f3d)
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af
|
push af
|
||||||
res 1, [hl]
|
res 1, [hl]
|
||||||
callab Func_525af
|
callab InitBattleVariables
|
||||||
ld a, [wEnemyMonSpecies2]
|
ld a, [wEnemyMonSpecies2]
|
||||||
sub $c8
|
sub $c8
|
||||||
jp c, InitWildBattle
|
jp c, InitWildBattle
|
||||||
|
|
@ -7637,7 +7638,7 @@ UpdateStatDone: ; 3f4ca (f:74ca)
|
||||||
call nz, Bankswitch ; play Minimize animation unless there's Substitute involved
|
call nz, Bankswitch ; play Minimize animation unless there's Substitute involved
|
||||||
pop de
|
pop de
|
||||||
.asm_3f4f9
|
.asm_3f4f9
|
||||||
call Func_3fba8
|
call PlayCurrentMoveAnimation
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
cp MINIMIZE
|
cp MINIMIZE
|
||||||
jr nz, .applyBadgeBoostsAndStatusPenalties
|
jr nz, .applyBadgeBoostsAndStatusPenalties
|
||||||
|
|
@ -8451,7 +8452,7 @@ MimicEffect: ; 3f9ed (f:79ed)
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
call GetMoveName
|
call GetMoveName
|
||||||
call Func_3fba8
|
call PlayCurrentMoveAnimation
|
||||||
ld hl, MimicLearnedMoveText
|
ld hl, MimicLearnedMoveText
|
||||||
jp PrintText
|
jp PrintText
|
||||||
.asm_3fa74
|
.asm_3fa74
|
||||||
|
|
@ -8467,7 +8468,7 @@ LeechSeedEffect: ; 3fa7c (f:7a7c)
|
||||||
jp Bankswitch
|
jp Bankswitch
|
||||||
|
|
||||||
SplashEffect: ; 3fa84 (f:7a84)
|
SplashEffect: ; 3fa84 (f:7a84)
|
||||||
call Func_3fba8
|
call PlayCurrentMoveAnimation
|
||||||
jp PrintNoEffectText
|
jp PrintNoEffectText
|
||||||
|
|
||||||
DisableEffect: ; 3fa8a (f:7a8a)
|
DisableEffect: ; 3fa8a (f:7a8a)
|
||||||
|
|
@ -8662,15 +8663,15 @@ Func_3fb96: ; 3fb96 (f:7b96)
|
||||||
ld [wcc5b], a
|
ld [wcc5b], a
|
||||||
jp Func_3fbbc
|
jp Func_3fbbc
|
||||||
|
|
||||||
Func_3fba8: ; 3fba8 (f:7ba8)
|
PlayCurrentMoveAnimation: ; 3fba8 (f:7ba8)
|
||||||
xor a
|
xor a
|
||||||
ld [wcc5b], a
|
ld [wcc5b], a
|
||||||
ld a, [H_WHOSETURN]
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
ld a, [W_PLAYERMOVENUM]
|
ld a, [W_PLAYERMOVENUM]
|
||||||
jr z, .asm_3fbb7
|
jr z, .notEnemyTurn
|
||||||
ld a, [W_ENEMYMOVENUM]
|
ld a, [W_ENEMYMOVENUM]
|
||||||
.asm_3fbb7
|
.notEnemyTurn
|
||||||
and a
|
and a
|
||||||
ret z
|
ret z
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,25 @@
|
||||||
Func_39680: ; 39680 (e:5680)
|
; does nothing since no stats are ever selected (barring glitches)
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
DoubleSelectedStats: ; 39680 (e:5680)
|
||||||
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
ld a, [wd060]
|
ld a, [wPlayerStatsToDouble]
|
||||||
ld hl, wBattleMonAttack + 1
|
ld hl, wBattleMonAttack + 1
|
||||||
jr z, .asm_39691
|
jr z, .notEnemyTurn
|
||||||
ld a, [wd065]
|
ld a, [wEnemyStatsToDouble]
|
||||||
ld hl, wEnemyMonAttack + 1
|
ld hl, wEnemyMonAttack + 1
|
||||||
.asm_39691
|
.notEnemyTurn
|
||||||
ld c, $4
|
ld c, 4
|
||||||
ld b, a
|
ld b, a
|
||||||
.asm_39694
|
.loop
|
||||||
srl b
|
srl b
|
||||||
call c, Func_3969f
|
call c, .doubleStat
|
||||||
inc hl
|
inc hl
|
||||||
inc hl
|
inc hl
|
||||||
dec c
|
dec c
|
||||||
ret z
|
ret z
|
||||||
jr .asm_39694
|
jr .loop
|
||||||
|
|
||||||
Func_3969f: ; 3969f (e:569f)
|
.doubleStat
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
add a
|
add a
|
||||||
ld [hld], a
|
ld [hld], a
|
||||||
|
|
@ -27,35 +28,36 @@ Func_3969f: ; 3969f (e:569f)
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_396a7: ; 396a7 (e:56a7)
|
; does nothing since no stats are ever selected (barring glitches)
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
HalveSelectedStats: ; 396a7 (e:56a7)
|
||||||
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
ld a, [wd061]
|
ld a, [wPlayerStatsToHalve]
|
||||||
ld hl, wBattleMonAttack
|
ld hl, wBattleMonAttack
|
||||||
jr z, .asm_396b8
|
jr z, .notEnemyTurn
|
||||||
ld a, [wd066]
|
ld a, [wEnemyStatsToHalve]
|
||||||
ld hl, wEnemyMonAttack
|
ld hl, wEnemyMonAttack
|
||||||
.asm_396b8
|
.notEnemyTurn
|
||||||
ld c, $4
|
ld c, 4
|
||||||
ld b, a
|
ld b, a
|
||||||
.asm_396bb
|
.loop
|
||||||
srl b
|
srl b
|
||||||
call c, Func_396c6
|
call c, .halveStat
|
||||||
inc hl
|
inc hl
|
||||||
inc hl
|
inc hl
|
||||||
dec c
|
dec c
|
||||||
ret z
|
ret z
|
||||||
jr .asm_396bb
|
jr .loop
|
||||||
|
|
||||||
Func_396c6: ; 396c6 (e:56c6)
|
.halveStat
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
srl a
|
srl a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
rr [hl]
|
rr [hl]
|
||||||
or [hl]
|
or [hl]
|
||||||
jr nz, .asm_396d1
|
jr nz, .nonzeroStat
|
||||||
ld [hl], $1
|
ld [hl], 1
|
||||||
.asm_396d1
|
.nonzeroStat
|
||||||
dec hl
|
dec hl
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
@ -69,41 +71,42 @@ _ScrollTrainerPicAfterBattle: ; 396d3 (e:56d3)
|
||||||
callab _LoadTrainerPic
|
callab _LoadTrainerPic
|
||||||
hlCoord 19, 0
|
hlCoord 19, 0
|
||||||
ld c, $0
|
ld c, $0
|
||||||
.asm_396e9
|
.scrollLoop
|
||||||
inc c
|
inc c
|
||||||
ld a, c
|
ld a, c
|
||||||
cp $7
|
cp 7
|
||||||
ret z
|
ret z
|
||||||
ld d, $0
|
ld d, $0
|
||||||
push bc
|
push bc
|
||||||
push hl
|
push hl
|
||||||
.asm_396f2
|
.drawTrainerPicLoop
|
||||||
call Func_39707
|
call DrawTrainerPicColumn
|
||||||
inc hl
|
inc hl
|
||||||
ld a, $7
|
ld a, 7
|
||||||
add d
|
add d
|
||||||
ld d, a
|
ld d, a
|
||||||
dec c
|
dec c
|
||||||
jr nz, .asm_396f2
|
jr nz, .drawTrainerPicLoop
|
||||||
ld c, $4
|
ld c, 4
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
pop hl
|
pop hl
|
||||||
pop bc
|
pop bc
|
||||||
dec hl
|
dec hl
|
||||||
jr .asm_396e9
|
jr .scrollLoop
|
||||||
|
|
||||||
Func_39707: ; 39707 (e:5707)
|
; write one 7-tile column of the trainer pic to the tilemap
|
||||||
|
DrawTrainerPicColumn: ; 39707 (e:5707)
|
||||||
push hl
|
push hl
|
||||||
push de
|
push de
|
||||||
push bc
|
push bc
|
||||||
ld e, $7
|
ld e, 7
|
||||||
.asm_3970c
|
.loop
|
||||||
ld [hl], d
|
ld [hl], d
|
||||||
ld bc, $14
|
ld bc, SCREEN_WIDTH
|
||||||
add hl, bc
|
add hl, bc
|
||||||
inc d
|
inc d
|
||||||
dec e
|
dec e
|
||||||
jr nz, .asm_3970c
|
jr nz, .loop
|
||||||
pop bc
|
pop bc
|
||||||
pop de
|
pop de
|
||||||
pop hl
|
pop hl
|
||||||
|
|
@ -577,121 +580,124 @@ TrainerPicAndMoneyPointers: ; 39914 (e:5914)
|
||||||
|
|
||||||
INCLUDE "text/trainer_names.asm"
|
INCLUDE "text/trainer_names.asm"
|
||||||
|
|
||||||
Func_39b87: ; 39b87 (e:5b87)
|
; formats a string at wMovesString that lists the moves at wMoves
|
||||||
ld hl, wd0dc
|
FormatMovesString: ; 39b87 (e:5b87)
|
||||||
ld de, wd0e1
|
ld hl, wMoves
|
||||||
|
ld de, wMovesString
|
||||||
ld b, $0
|
ld b, $0
|
||||||
.asm_39b8f
|
.printMoveNameLoop
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
and a
|
and a ; end of move list?
|
||||||
jr z, .asm_39bc1
|
jr z, .printDashLoop ; print dashes when no moves are left
|
||||||
push hl
|
push hl
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
ld a, BANK(MoveNames)
|
ld a, BANK(MoveNames)
|
||||||
ld [wPredefBank], a
|
ld [wPredefBank], a
|
||||||
ld a, MOVE_NAME
|
ld a, MOVE_NAME
|
||||||
ld [W_LISTTYPE], a
|
ld [wNameListType], a
|
||||||
call GetName
|
call GetName
|
||||||
ld hl, wcd6d
|
ld hl, wcd6d
|
||||||
.asm_39ba7
|
.copyNameLoop
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
cp $50
|
cp $50
|
||||||
jr z, .asm_39bb0
|
jr z, .doneCopyingName
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
jr .asm_39ba7
|
jr .copyNameLoop
|
||||||
.asm_39bb0
|
.doneCopyingName
|
||||||
ld a, b
|
ld a, b
|
||||||
ld [wcd6c], a
|
ld [wcd6c], a
|
||||||
inc b
|
inc b
|
||||||
ld a, $4e
|
ld a, $4e ; line break
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
pop hl
|
pop hl
|
||||||
ld a, b
|
ld a, b
|
||||||
cp $4
|
cp NUM_MOVES
|
||||||
jr z, .asm_39bd1
|
jr z, .done
|
||||||
jr .asm_39b8f
|
jr .printMoveNameLoop
|
||||||
.asm_39bc1
|
.printDashLoop
|
||||||
ld a, "-"
|
ld a, "-"
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
inc b
|
inc b
|
||||||
ld a, b
|
ld a, b
|
||||||
cp $4
|
cp NUM_MOVES
|
||||||
jr z, .asm_39bd1
|
jr z, .done
|
||||||
ld a, $4e
|
ld a, $4e ; line break
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
jr .asm_39bc1
|
jr .printDashLoop
|
||||||
.asm_39bd1
|
.done
|
||||||
ld a, "@"
|
ld a, "@"
|
||||||
ld [de], a
|
ld [de], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
; XXX this is called in a few places, but it doesn't appear to do anything useful
|
||||||
Func_39bd5: ; 39bd5 (e:5bd5)
|
Func_39bd5: ; 39bd5 (e:5bd5)
|
||||||
ld a, [wd11b]
|
ld a, [wd11b]
|
||||||
cp $1
|
cp $1
|
||||||
jr nz, .asm_39be6
|
jr nz, .asm_39be6
|
||||||
ld hl, wEnemyPartyCount ; wEnemyPartyCount
|
ld hl, wEnemyPartyCount
|
||||||
ld de, wEnemyMonOT ; wd9ac OT names of other player
|
ld de, wEnemyMonOT
|
||||||
ld a, $6
|
ld a, ENEMYOT_NAME
|
||||||
jr .asm_39c18
|
jr .asm_39c18
|
||||||
.asm_39be6
|
.asm_39be6
|
||||||
cp $4
|
cp $4
|
||||||
jr nz, .calcAttackStat4
|
jr nz, .calcAttackStat4
|
||||||
ld hl, wPartyCount ; wPartyCount
|
ld hl, wPartyCount
|
||||||
ld de, wPartyMonOT ; wd273
|
ld de, wPartyMonOT
|
||||||
ld a, $5
|
ld a, PLAYEROT_NAME
|
||||||
jr .asm_39c18
|
jr .asm_39c18
|
||||||
.calcAttackStat4
|
.calcAttackStat4
|
||||||
cp $5
|
cp $5
|
||||||
jr nz, .asm_39c02
|
jr nz, .asm_39c02
|
||||||
ld hl, wStringBuffer2 + 11
|
ld hl, wStringBuffer2 + 11
|
||||||
ld de, MonsterNames ; $421e
|
ld de, MonsterNames
|
||||||
ld a, $1
|
ld a, MONSTER_NAME
|
||||||
jr .asm_39c18
|
jr .asm_39c18
|
||||||
.asm_39c02
|
.asm_39c02
|
||||||
cp $2
|
cp $2
|
||||||
jr nz, .asm_39c10
|
jr nz, .asm_39c10
|
||||||
ld hl, wNumBagItems ; wNumBagItems
|
ld hl, wNumBagItems
|
||||||
ld de, ItemNames ; $472b
|
ld de, ItemNames
|
||||||
ld a, $4
|
ld a, ITEM_NAME
|
||||||
jr .asm_39c18
|
jr .asm_39c18
|
||||||
.asm_39c10
|
.asm_39c10
|
||||||
ld hl, wStringBuffer2 + 11
|
ld hl, wStringBuffer2 + 11
|
||||||
ld de, ItemNames ; $472b
|
ld de, ItemNames
|
||||||
ld a, ITEM_NAME
|
ld a, ITEM_NAME
|
||||||
.asm_39c18
|
.asm_39c18
|
||||||
ld [W_LISTTYPE], a
|
ld [wNameListType], a
|
||||||
ld a, l
|
ld a, l
|
||||||
ld [wcf8b], a
|
ld [wList], a
|
||||||
ld a, h
|
ld a, h
|
||||||
ld [wcf8c], a
|
ld [wList + 1], a
|
||||||
ld a, e
|
ld a, e
|
||||||
ld [wcf8d], a
|
ld [wcf8d], a
|
||||||
ld a, d
|
ld a, d
|
||||||
ld [wcf8e], a
|
ld [wcf8e], a
|
||||||
ld bc, ItemPrices ; $4608
|
ld bc, ItemPrices
|
||||||
ld a, c
|
ld a, c
|
||||||
ld [wcf8f], a
|
ld [wItemPrices], a
|
||||||
ld a, b
|
ld a, b
|
||||||
ld [wcf90], a
|
ld [wItemPrices + 1], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_39c37: ; 39c37 (e:5c37)
|
; get species of mon e in list [wcc49] for LoadMonData
|
||||||
|
GetMonSpecies: ; 39c37 (e:5c37)
|
||||||
ld hl, wPartySpecies
|
ld hl, wPartySpecies
|
||||||
ld a, [wcc49]
|
ld a, [wcc49]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_39c4b
|
jr z, .getSpecies
|
||||||
dec a
|
dec a
|
||||||
jr z, .asm_39c48
|
jr z, .enemyParty
|
||||||
ld hl, wBoxSpecies
|
ld hl, wBoxSpecies
|
||||||
jr .asm_39c4b
|
jr .getSpecies
|
||||||
.asm_39c48
|
.enemyParty
|
||||||
ld hl, wEnemyPartyMons
|
ld hl, wEnemyPartyMons
|
||||||
.asm_39c4b
|
.getSpecies
|
||||||
ld d, $0
|
ld d, 0
|
||||||
add hl, de
|
add hl, de
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [wcf91], a
|
ld [wcf91], a
|
||||||
|
|
@ -954,7 +960,7 @@ TrainerAIPointers: ; 3a55c (e:655c)
|
||||||
JugglerAI: ; 3a5e9 (e:65e9)
|
JugglerAI: ; 3a5e9 (e:65e9)
|
||||||
cp $40
|
cp $40
|
||||||
ret nc
|
ret nc
|
||||||
jp Func_3a72a
|
jp AISwitchIfEnoughMons
|
||||||
|
|
||||||
BlackbeltAI: ; 3a5ef (e:65ef)
|
BlackbeltAI: ; 3a5ef (e:65ef)
|
||||||
cp $20
|
cp $20
|
||||||
|
|
@ -974,12 +980,12 @@ CooltrainerMAI: ; 3a5fb (e:65fb)
|
||||||
CooltrainerFAI: ; 3a601 (e:6601)
|
CooltrainerFAI: ; 3a601 (e:6601)
|
||||||
cp $40
|
cp $40
|
||||||
ld a,$A
|
ld a,$A
|
||||||
call Func_3a7cf
|
call AICheckIfHPBelowFraction
|
||||||
jp c,AIUseHyperPotion
|
jp c,AIUseHyperPotion
|
||||||
ld a,5
|
ld a,5
|
||||||
call Func_3a7cf
|
call AICheckIfHPBelowFraction
|
||||||
ret nc
|
ret nc
|
||||||
jp Func_3a72a
|
jp AISwitchIfEnoughMons
|
||||||
|
|
||||||
BrockAI: ; 3a614 (e:6614)
|
BrockAI: ; 3a614 (e:6614)
|
||||||
; if his active monster has a status condition, use a full heal
|
; if his active monster has a status condition, use a full heal
|
||||||
|
|
@ -1002,7 +1008,7 @@ ErikaAI: ; 3a628 (e:6628)
|
||||||
cp $80
|
cp $80
|
||||||
ret nc
|
ret nc
|
||||||
ld a,$A
|
ld a,$A
|
||||||
call Func_3a7cf
|
call AICheckIfHPBelowFraction
|
||||||
ret nc
|
ret nc
|
||||||
jp AIUseSuperPotion
|
jp AIUseSuperPotion
|
||||||
|
|
||||||
|
|
@ -1020,7 +1026,7 @@ SabrinaAI: ; 3a640 (e:6640)
|
||||||
cp $40
|
cp $40
|
||||||
ret nc
|
ret nc
|
||||||
ld a,$A
|
ld a,$A
|
||||||
call Func_3a7cf
|
call AICheckIfHPBelowFraction
|
||||||
ret nc
|
ret nc
|
||||||
jp AIUseHyperPotion
|
jp AIUseHyperPotion
|
||||||
|
|
||||||
|
|
@ -1028,7 +1034,7 @@ Sony2AI: ; 3a64c (e:664c)
|
||||||
cp $20
|
cp $20
|
||||||
ret nc
|
ret nc
|
||||||
ld a,5
|
ld a,5
|
||||||
call Func_3a7cf
|
call AICheckIfHPBelowFraction
|
||||||
ret nc
|
ret nc
|
||||||
jp AIUsePotion
|
jp AIUsePotion
|
||||||
|
|
||||||
|
|
@ -1036,7 +1042,7 @@ Sony3AI: ; 3a658 (e:6658)
|
||||||
cp $20
|
cp $20
|
||||||
ret nc
|
ret nc
|
||||||
ld a,5
|
ld a,5
|
||||||
call Func_3a7cf
|
call AICheckIfHPBelowFraction
|
||||||
ret nc
|
ret nc
|
||||||
jp AIUseFullRestore
|
jp AIUseFullRestore
|
||||||
|
|
||||||
|
|
@ -1044,7 +1050,7 @@ LoreleiAI: ; 3a664 (e:6664)
|
||||||
cp $80
|
cp $80
|
||||||
ret nc
|
ret nc
|
||||||
ld a,5
|
ld a,5
|
||||||
call Func_3a7cf
|
call AICheckIfHPBelowFraction
|
||||||
ret nc
|
ret nc
|
||||||
jp AIUseSuperPotion
|
jp AIUseSuperPotion
|
||||||
|
|
||||||
|
|
@ -1055,11 +1061,11 @@ BrunoAI: ; 3a670 (e:6670)
|
||||||
|
|
||||||
AgathaAI: ; 3a676 (e:6676)
|
AgathaAI: ; 3a676 (e:6676)
|
||||||
cp $14
|
cp $14
|
||||||
jp c,Func_3a72a
|
jp c,AISwitchIfEnoughMons
|
||||||
cp $80
|
cp $80
|
||||||
ret nc
|
ret nc
|
||||||
ld a,4
|
ld a,4
|
||||||
call Func_3a7cf
|
call AICheckIfHPBelowFraction
|
||||||
ret nc
|
ret nc
|
||||||
jp AIUseSuperPotion
|
jp AIUseSuperPotion
|
||||||
|
|
||||||
|
|
@ -1067,7 +1073,7 @@ LanceAI: ; 3a687 (e:6687)
|
||||||
cp $80
|
cp $80
|
||||||
ret nc
|
ret nc
|
||||||
ld a,5
|
ld a,5
|
||||||
call Func_3a7cf
|
call AICheckIfHPBelowFraction
|
||||||
ret nc
|
ret nc
|
||||||
jp AIUseHyperPotion
|
jp AIUseHyperPotion
|
||||||
|
|
||||||
|
|
@ -1109,7 +1115,7 @@ AIUseFullRestore: ; 3a6a0 (e:66a0)
|
||||||
ld [de],a
|
ld [de],a
|
||||||
ld [wHPBarMaxHP+1],a
|
ld [wHPBarMaxHP+1],a
|
||||||
ld [wEnemyMonHP],a
|
ld [wEnemyMonHP],a
|
||||||
jr Func_3a718
|
jr AIPrintItemUseAndUpdateHPBar
|
||||||
|
|
||||||
AIUsePotion: ; 3a6ca (e:66ca)
|
AIUsePotion: ; 3a6ca (e:66ca)
|
||||||
; enemy trainer heals his monster with a potion
|
; enemy trainer heals his monster with a potion
|
||||||
|
|
@ -1159,7 +1165,7 @@ AIRecoverHP: ; 3a6da (e:66da)
|
||||||
ld a,[de]
|
ld a,[de]
|
||||||
ld [wHPBarMaxHP+1],a
|
ld [wHPBarMaxHP+1],a
|
||||||
sbc b
|
sbc b
|
||||||
jr nc,Func_3a718
|
jr nc,AIPrintItemUseAndUpdateHPBar
|
||||||
inc de
|
inc de
|
||||||
ld a,[de]
|
ld a,[de]
|
||||||
dec de
|
dec de
|
||||||
|
|
@ -1170,15 +1176,16 @@ AIRecoverHP: ; 3a6da (e:66da)
|
||||||
ld [wHPBarNewHP+1],a
|
ld [wHPBarNewHP+1],a
|
||||||
; fallthrough
|
; fallthrough
|
||||||
|
|
||||||
Func_3a718: ; 3a718 (e:6718)
|
AIPrintItemUseAndUpdateHPBar: ; 3a718 (e:6718)
|
||||||
call AIPrintItemUse_
|
call AIPrintItemUse_
|
||||||
hlCoord 2, 2
|
hlCoord 2, 2
|
||||||
xor a
|
xor a
|
||||||
ld [wListMenuID],a
|
ld [wHPBarType],a
|
||||||
predef UpdateHPBar2
|
predef UpdateHPBar2
|
||||||
jp DecrementAICount
|
jp DecrementAICount
|
||||||
|
|
||||||
Func_3a72a: ; 3a72a (e:672a)
|
AISwitchIfEnoughMons: ; 3a72a (e:672a)
|
||||||
|
; enemy trainer switches if there are 3 or more unfainted mons in party
|
||||||
ld a,[wEnemyPartyCount]
|
ld a,[wEnemyPartyCount]
|
||||||
ld c,a
|
ld c,a
|
||||||
ld hl,wEnemyMon1HP
|
ld hl,wEnemyMon1HP
|
||||||
|
|
@ -1280,7 +1287,8 @@ AIUseDireHit: ; 0x3a7c2 unused
|
||||||
ld a,DIRE_HIT
|
ld a,DIRE_HIT
|
||||||
jp AIPrintItemUse
|
jp AIPrintItemUse
|
||||||
|
|
||||||
Func_3a7cf: ; 3a7cf (e:67cf)
|
AICheckIfHPBelowFraction: ; 3a7cf (e:67cf)
|
||||||
|
; return carry if enemy trainer's current HP is below 1 / a of the maximum
|
||||||
ld [H_DIVISOR],a
|
ld [H_DIVISOR],a
|
||||||
ld hl,wEnemyMonMaxHP
|
ld hl,wEnemyMonMaxHP
|
||||||
ld a,[hli]
|
ld a,[hli]
|
||||||
|
|
@ -1394,7 +1402,7 @@ SetupOwnPartyPokeballs: ; 3a869 (e:6869)
|
||||||
ld a, $8
|
ld a, $8
|
||||||
ld [wTrainerEngageDistance], a
|
ld [wTrainerEngageDistance], a
|
||||||
ld hl, wOAMBuffer
|
ld hl, wOAMBuffer
|
||||||
jp Func_3a8e1
|
jp WritePokeballOAMData
|
||||||
|
|
||||||
SetupEnemyPartyPokeballs: ; 3a887 (e:6887)
|
SetupEnemyPartyPokeballs: ; 3a887 (e:6887)
|
||||||
call PlaceEnemyHUDTiles
|
call PlaceEnemyHUDTiles
|
||||||
|
|
@ -1408,7 +1416,7 @@ SetupEnemyPartyPokeballs: ; 3a887 (e:6887)
|
||||||
ld a, $f8
|
ld a, $f8
|
||||||
ld [wTrainerEngageDistance], a
|
ld [wTrainerEngageDistance], a
|
||||||
ld hl, wOAMBuffer + PARTY_LENGTH * 4
|
ld hl, wOAMBuffer + PARTY_LENGTH * 4
|
||||||
jp Func_3a8e1
|
jp WritePokeballOAMData
|
||||||
|
|
||||||
SetupPokeballs: ; 0x3a8a6
|
SetupPokeballs: ; 0x3a8a6
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
|
|
@ -1420,7 +1428,7 @@ SetupPokeballs: ; 0x3a8a6
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
dec c
|
dec c
|
||||||
jr nz, .emptyloop ; 0x3a8b2 $fb
|
jr nz, .emptyloop
|
||||||
pop af
|
pop af
|
||||||
ld de, wBuffer
|
ld de, wBuffer
|
||||||
.monloop
|
.monloop
|
||||||
|
|
@ -1460,10 +1468,10 @@ PickPokeball: ; 3a8c2 (e:68c2)
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_3a8e1: ; 3a8e1 (e:68e1)
|
WritePokeballOAMData: ; 3a8e1 (e:68e1)
|
||||||
ld de, wHPBarMaxHP
|
ld de, wBuffer
|
||||||
ld c, PARTY_LENGTH
|
ld c, PARTY_LENGTH
|
||||||
.asm_3a8e6
|
.loop
|
||||||
ld a, [W_BASECOORDY] ; wd082
|
ld a, [W_BASECOORDY] ; wd082
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld a, [W_BASECOORDX] ; wd081
|
ld a, [W_BASECOORDX] ; wd081
|
||||||
|
|
@ -1479,7 +1487,7 @@ Func_3a8e1: ; 3a8e1 (e:68e1)
|
||||||
ld [W_BASECOORDX], a ; wd081
|
ld [W_BASECOORDX], a ; wd081
|
||||||
inc de
|
inc de
|
||||||
dec c
|
dec c
|
||||||
jr nz, .asm_3a8e6
|
jr nz, .loop
|
||||||
ret
|
ret
|
||||||
|
|
||||||
PlacePlayerHUDTiles: ; 3a902 (e:6902)
|
PlacePlayerHUDTiles: ; 3a902 (e:6902)
|
||||||
|
|
@ -1541,7 +1549,7 @@ SetupPlayerAndEnemyPokeballs: ; 3a948 (e:6948)
|
||||||
ld a, $8
|
ld a, $8
|
||||||
ld [wTrainerEngageDistance], a
|
ld [wTrainerEngageDistance], a
|
||||||
ld hl, wOAMBuffer
|
ld hl, wOAMBuffer
|
||||||
call Func_3a8e1
|
call WritePokeballOAMData
|
||||||
ld hl, wEnemyMons ; wEnemyMon1Species
|
ld hl, wEnemyMons ; wEnemyMon1Species
|
||||||
ld de, wEnemyPartyCount ; wEnemyPartyCount
|
ld de, wEnemyPartyCount ; wEnemyPartyCount
|
||||||
call SetupPokeballs
|
call SetupPokeballs
|
||||||
|
|
@ -1550,7 +1558,7 @@ SetupPlayerAndEnemyPokeballs: ; 3a948 (e:6948)
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], $68
|
ld [hl], $68
|
||||||
ld hl, wOAMBuffer + $18
|
ld hl, wOAMBuffer + $18
|
||||||
jp Func_3a8e1
|
jp WritePokeballOAMData
|
||||||
|
|
||||||
; four tiles: pokeball, black pokeball (status ailment), crossed out pokeball (faited) and pokeball slot (no mon)
|
; four tiles: pokeball, black pokeball (status ailment), crossed out pokeball (faited) and pokeball slot (no mon)
|
||||||
PokeballTileGraphics:: ; 3a97e (e:697e)
|
PokeballTileGraphics:: ; 3a97e (e:697e)
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
HealEffect_: ; 3b9ec (e:79ec)
|
HealEffect_: ; 3b9ec (e:79ec)
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
ld de, wBattleMonHP ; wd015
|
ld de, wBattleMonHP
|
||||||
ld hl, wBattleMonMaxHP ; wd023
|
ld hl, wBattleMonMaxHP
|
||||||
ld a, [W_PLAYERMOVENUM] ; wcfd2
|
ld a, [W_PLAYERMOVENUM]
|
||||||
jr z, .asm_3ba03
|
jr z, .asm_3ba03
|
||||||
ld de, wEnemyMonHP ; wEnemyMonHP
|
ld de, wEnemyMonHP
|
||||||
ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP
|
ld hl, wEnemyMonMaxHP
|
||||||
ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM
|
ld a, [W_ENEMYMOVENUM]
|
||||||
.asm_3ba03
|
.asm_3ba03
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
|
|
@ -16,27 +16,27 @@ HealEffect_: ; 3b9ec (e:79ec)
|
||||||
inc hl
|
inc hl
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
sbc [hl]
|
sbc [hl]
|
||||||
jp z, Func_3ba97
|
jp z, .failed
|
||||||
ld a, b
|
ld a, b
|
||||||
cp REST
|
cp REST
|
||||||
jr nz, .asm_3ba37
|
jr nz, .asm_3ba37
|
||||||
push hl
|
push hl
|
||||||
push de
|
push de
|
||||||
push af
|
push af
|
||||||
ld c, $32
|
ld c, 50
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld hl, wBattleMonStatus ; wBattleMonStatus
|
ld hl, wBattleMonStatus
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_3ba25
|
jr z, .asm_3ba25
|
||||||
ld hl, wEnemyMonStatus ; wcfe9
|
ld hl, wEnemyMonStatus
|
||||||
.asm_3ba25
|
.asm_3ba25
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
and a
|
and a
|
||||||
ld [hl], 2 ; Number of turns from Rest
|
ld [hl], 2 ; Number of turns from Rest
|
||||||
ld hl, StartedSleepingEffect ; $7aa2
|
ld hl, StartedSleepingEffect
|
||||||
jr z, .asm_3ba31
|
jr z, .asm_3ba31
|
||||||
ld hl, FellAsleepBecameHealthyText ; $7aa7
|
ld hl, FellAsleepBecameHealthyText
|
||||||
.asm_3ba31
|
.asm_3ba31
|
||||||
call PrintText
|
call PrintText
|
||||||
pop af
|
pop af
|
||||||
|
|
@ -81,9 +81,9 @@ HealEffect_: ; 3b9ec (e:79ec)
|
||||||
ld [de], a
|
ld [de], a
|
||||||
ld [wHPBarNewHP], a
|
ld [wHPBarNewHP], a
|
||||||
.asm_3ba6f
|
.asm_3ba6f
|
||||||
ld hl, Func_3fba8 ; $7ba8
|
ld hl, PlayCurrentMoveAnimation
|
||||||
call BankswitchEtoF
|
call BankswitchEtoF
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
hlCoord 10, 9
|
hlCoord 10, 9
|
||||||
ld a, $1
|
ld a, $1
|
||||||
|
|
@ -91,15 +91,14 @@ HealEffect_: ; 3b9ec (e:79ec)
|
||||||
hlCoord 2, 2
|
hlCoord 2, 2
|
||||||
xor a
|
xor a
|
||||||
.asm_3ba83
|
.asm_3ba83
|
||||||
ld [wListMenuID], a ; wListMenuID
|
ld [wHPBarType], a
|
||||||
predef UpdateHPBar2
|
predef UpdateHPBar2
|
||||||
ld hl, DrawHUDsAndHPBars ; $4d5a
|
ld hl, DrawHUDsAndHPBars
|
||||||
call BankswitchEtoF
|
call BankswitchEtoF
|
||||||
ld hl, RegainedHealthText ; $7aac
|
ld hl, RegainedHealthText
|
||||||
jp PrintText
|
jp PrintText
|
||||||
|
.failed
|
||||||
Func_3ba97: ; 3ba97 (e:7a97)
|
ld c, 50
|
||||||
ld c, $32
|
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld hl, PrintButItFailedText_
|
ld hl, PrintButItFailedText_
|
||||||
jp BankswitchEtoF
|
jp BankswitchEtoF
|
||||||
|
|
@ -119,37 +118,37 @@ RegainedHealthText: ; 3baac (e:7aac)
|
||||||
TransformEffect_: ; 3bab1 (e:7ab1)
|
TransformEffect_: ; 3bab1 (e:7ab1)
|
||||||
ld hl, wBattleMonSpecies
|
ld hl, wBattleMonSpecies
|
||||||
ld de, wEnemyMonSpecies
|
ld de, wEnemyMonSpecies
|
||||||
ld bc, W_ENEMYBATTSTATUS3 ; W_ENEMYBATTSTATUS3
|
ld bc, W_ENEMYBATTSTATUS3
|
||||||
ld a, [W_ENEMYBATTSTATUS1] ; W_ENEMYBATTSTATUS1
|
ld a, [W_ENEMYBATTSTATUS1]
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr nz, .asm_3bad1
|
jr nz, .asm_3bad1
|
||||||
ld hl, wEnemyMonSpecies
|
ld hl, wEnemyMonSpecies
|
||||||
ld de, wBattleMonSpecies
|
ld de, wBattleMonSpecies
|
||||||
ld bc, W_PLAYERBATTSTATUS3 ; W_PLAYERBATTSTATUS3
|
ld bc, W_PLAYERBATTSTATUS3
|
||||||
ld [wPlayerMoveListIndex], a ; wPlayerMoveListIndex
|
ld [wPlayerMoveListIndex], a
|
||||||
ld a, [W_PLAYERBATTSTATUS1] ; W_PLAYERBATTSTATUS1
|
ld a, [W_PLAYERBATTSTATUS1]
|
||||||
.asm_3bad1
|
.asm_3bad1
|
||||||
bit Invulnerable, a ; is mon invulnerable to typical attacks? (fly/dig)
|
bit Invulnerable, a ; is mon invulnerable to typical attacks? (fly/dig)
|
||||||
jp nz, Func_3bb8c
|
jp nz, .failed
|
||||||
push hl
|
push hl
|
||||||
push de
|
push de
|
||||||
push bc
|
push bc
|
||||||
ld hl, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2
|
ld hl, W_PLAYERBATTSTATUS2
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_3bae4
|
jr z, .asm_3bae4
|
||||||
ld hl, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2
|
ld hl, W_ENEMYBATTSTATUS2
|
||||||
.asm_3bae4
|
.asm_3bae4
|
||||||
bit HasSubstituteUp, [hl]
|
bit HasSubstituteUp, [hl]
|
||||||
push af
|
push af
|
||||||
ld hl, Func_79747
|
ld hl, Func_79747
|
||||||
ld b, BANK(Func_79747)
|
ld b, BANK(Func_79747)
|
||||||
call nz, Bankswitch
|
call nz, Bankswitch
|
||||||
ld a, [W_OPTIONS] ; W_OPTIONS
|
ld a, [W_OPTIONS]
|
||||||
add a
|
add a
|
||||||
ld hl, Func_3fba8 ; $7ba8
|
ld hl, PlayCurrentMoveAnimation
|
||||||
ld b, BANK(Func_3fba8)
|
ld b, BANK(PlayCurrentMoveAnimation)
|
||||||
jr nc, .asm_3baff
|
jr nc, .asm_3baff
|
||||||
ld hl, AnimationTransformMon
|
ld hl, AnimationTransformMon
|
||||||
ld b, BANK(AnimationTransformMon)
|
ld b, BANK(AnimationTransformMon)
|
||||||
|
|
@ -178,7 +177,7 @@ TransformEffect_: ; 3bab1 (e:7ab1)
|
||||||
inc bc
|
inc bc
|
||||||
inc bc
|
inc bc
|
||||||
call CopyData
|
call CopyData
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_3bb32
|
jr z, .asm_3bb32
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
|
|
@ -228,15 +227,15 @@ TransformEffect_: ; 3bab1 (e:7ab1)
|
||||||
call GetMonName
|
call GetMonName
|
||||||
ld hl, wEnemyMonUnmodifiedAttack
|
ld hl, wEnemyMonUnmodifiedAttack
|
||||||
ld de, wPlayerMonUnmodifiedAttack
|
ld de, wPlayerMonUnmodifiedAttack
|
||||||
call Func_3bb7d
|
call .copyBasedOnTurn
|
||||||
ld hl, wEnemyMonStatMods ; wcd2e
|
ld hl, wEnemyMonStatMods
|
||||||
ld de, wPlayerMonStatMods ; wcd1a
|
ld de, wPlayerMonStatMods
|
||||||
call Func_3bb7d
|
call .copyBasedOnTurn
|
||||||
ld hl, TransformedText ; $7b92
|
ld hl, TransformedText
|
||||||
jp PrintText
|
jp PrintText
|
||||||
|
|
||||||
Func_3bb7d: ; 3bb7d (e:7b7d)
|
.copyBasedOnTurn
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_3bb86
|
jr z, .asm_3bb86
|
||||||
push hl
|
push hl
|
||||||
|
|
@ -247,8 +246,8 @@ Func_3bb7d: ; 3bb7d (e:7b7d)
|
||||||
ld bc, $8
|
ld bc, $8
|
||||||
jp CopyData
|
jp CopyData
|
||||||
|
|
||||||
Func_3bb8c: ; 3bb8c (e:7b8c)
|
.failed
|
||||||
ld hl, PrintButItFailedText_ ; $7b53
|
ld hl, PrintButItFailedText_
|
||||||
jp BankswitchEtoF
|
jp BankswitchEtoF
|
||||||
|
|
||||||
TransformedText: ; 3bb92 (e:7b92)
|
TransformedText: ; 3bb92 (e:7b92)
|
||||||
|
|
@ -256,13 +255,13 @@ TransformedText: ; 3bb92 (e:7b92)
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
ReflectLightScreenEffect_: ; 3bb97 (e:7b97)
|
ReflectLightScreenEffect_: ; 3bb97 (e:7b97)
|
||||||
ld hl, W_PLAYERBATTSTATUS3 ; W_PLAYERBATTSTATUS3
|
ld hl, W_PLAYERBATTSTATUS3
|
||||||
ld de, W_PLAYERMOVEEFFECT ; wcfd3
|
ld de, W_PLAYERMOVEEFFECT
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_3bba8
|
jr z, .asm_3bba8
|
||||||
ld hl, W_ENEMYBATTSTATUS3 ; W_ENEMYBATTSTATUS3
|
ld hl, W_ENEMYBATTSTATUS3
|
||||||
ld de, W_ENEMYMOVEEFFECT ; W_ENEMYMOVEEFFECT
|
ld de, W_ENEMYMOVEEFFECT
|
||||||
.asm_3bba8
|
.asm_3bba8
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
cp LIGHT_SCREEN_EFFECT
|
cp LIGHT_SCREEN_EFFECT
|
||||||
|
|
@ -270,23 +269,23 @@ ReflectLightScreenEffect_: ; 3bb97 (e:7b97)
|
||||||
bit HasLightScreenUp, [hl] ; is mon already protected by light screen?
|
bit HasLightScreenUp, [hl] ; is mon already protected by light screen?
|
||||||
jr nz, .moveFailed
|
jr nz, .moveFailed
|
||||||
set HasLightScreenUp, [hl] ; mon is now protected by light screen
|
set HasLightScreenUp, [hl] ; mon is now protected by light screen
|
||||||
ld hl, LightScreenProtectedText ; $7bd7
|
ld hl, LightScreenProtectedText
|
||||||
jr .asm_3bbc1
|
jr .asm_3bbc1
|
||||||
.reflect
|
.reflect
|
||||||
bit HasReflectUp, [hl] ; is mon already protected by reflect?
|
bit HasReflectUp, [hl] ; is mon already protected by reflect?
|
||||||
jr nz, .moveFailed
|
jr nz, .moveFailed
|
||||||
set HasReflectUp, [hl] ; mon is now protected by reflect
|
set HasReflectUp, [hl] ; mon is now protected by reflect
|
||||||
ld hl, ReflectGainedArmorText ; $7bdc
|
ld hl, ReflectGainedArmorText
|
||||||
.asm_3bbc1
|
.asm_3bbc1
|
||||||
push hl
|
push hl
|
||||||
ld hl, Func_3fba8 ; $7ba8
|
ld hl, PlayCurrentMoveAnimation
|
||||||
call BankswitchEtoF
|
call BankswitchEtoF
|
||||||
pop hl
|
pop hl
|
||||||
jp PrintText
|
jp PrintText
|
||||||
.moveFailed
|
.moveFailed
|
||||||
ld c, $32
|
ld c, $32
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld hl, PrintButItFailedText_ ; $7b53
|
ld hl, PrintButItFailedText_
|
||||||
jp BankswitchEtoF
|
jp BankswitchEtoF
|
||||||
|
|
||||||
LightScreenProtectedText: ; 3bbd7 (e:7bd7)
|
LightScreenProtectedText: ; 3bbd7 (e:7bd7)
|
||||||
|
|
|
||||||
|
|
@ -338,10 +338,10 @@ TradeCenter_SelectMon:
|
||||||
ld a, 1
|
ld a, 1
|
||||||
ld [wTopMenuItemX], a
|
ld [wTopMenuItemX], a
|
||||||
.enemyMonMenu_HandleInput
|
.enemyMonMenu_HandleInput
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
set 1, [hl]
|
set 1, [hl]
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
res 1, [hl]
|
res 1, [hl]
|
||||||
and a
|
and a
|
||||||
jp z, .getNewInput
|
jp z, .getNewInput
|
||||||
|
|
@ -403,10 +403,10 @@ TradeCenter_SelectMon:
|
||||||
ld bc, $0601
|
ld bc, $0601
|
||||||
call ClearScreenArea
|
call ClearScreenArea
|
||||||
.playerMonMenu_HandleInput
|
.playerMonMenu_HandleInput
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
set 1, [hl]
|
set 1, [hl]
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
res 1, [hl]
|
res 1, [hl]
|
||||||
and a ; was anything pressed?
|
and a ; was anything pressed?
|
||||||
jr nz, .playerMonMenu_SomethingPressed
|
jr nz, .playerMonMenu_SomethingPressed
|
||||||
|
|
@ -578,7 +578,7 @@ TradeCenter_SelectMon:
|
||||||
|
|
||||||
ReturnToCableClubRoom: ; 577d (1:577d)
|
ReturnToCableClubRoom: ; 577d (1:577d)
|
||||||
call GBPalWhiteOutWithDelay3
|
call GBPalWhiteOutWithDelay3
|
||||||
ld hl, wcfc4
|
ld hl, wFontLoaded
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af
|
push af
|
||||||
push hl
|
push hl
|
||||||
|
|
@ -716,7 +716,7 @@ TradeCenter_Trade:
|
||||||
ld bc, $080b
|
ld bc, $080b
|
||||||
ld a, TRADE_CANCEL_MENU
|
ld a, TRADE_CANCEL_MENU
|
||||||
ld [wTwoOptionMenuID], a
|
ld [wTwoOptionMenuID], a
|
||||||
ld a, $14
|
ld a, TWO_OPTION_MENU
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
call LoadScreenTilesFromBuffer1
|
call LoadScreenTilesFromBuffer1
|
||||||
|
|
@ -808,7 +808,7 @@ TradeCenter_Trade:
|
||||||
ld a, c
|
ld a, c
|
||||||
ld bc, wEnemyMon2 - wEnemyMon1
|
ld bc, wEnemyMon2 - wEnemyMon1
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
ld de, wcf98
|
ld de, wLoadedMon
|
||||||
ld bc, wEnemyMon2 - wEnemyMon1
|
ld bc, wEnemyMon2 - wEnemyMon1
|
||||||
call CopyData
|
call CopyData
|
||||||
call AddEnemyMonToPlayerParty
|
call AddEnemyMonToPlayerParty
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
Func_1c98a: ; 1c98a (7:498a)
|
DoClearSaveDialogue: ; 1c98a (7:498a)
|
||||||
call ClearScreen
|
call ClearScreen
|
||||||
call GoPAL_SET_CF1C
|
call GoPAL_SET_CF1C
|
||||||
call LoadFontTilePatterns
|
call LoadFontTilePatterns
|
||||||
|
|
@ -9,13 +9,13 @@ Func_1c98a: ; 1c98a (7:498a)
|
||||||
ld bc, $80f
|
ld bc, $80f
|
||||||
ld a, NO_YES_MENU
|
ld a, NO_YES_MENU
|
||||||
ld [wTwoOptionMenuID], a
|
ld [wTwoOptionMenuID], a
|
||||||
ld a, $14
|
ld a, TWO_OPTION_MENU
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
and a
|
and a
|
||||||
jp z, Init
|
jp z, Init
|
||||||
callba Func_73b6a
|
callba ClearSAV
|
||||||
jp Init
|
jp Init
|
||||||
|
|
||||||
ClearSaveDataText: ; 1c9c1 (7:49c1)
|
ClearSaveDataText: ; 1c9c1 (7:49c1)
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ Evolution_PartyMonLoop: ; loop over party mons
|
||||||
jp nz, .nextEvoEntry1 ; if not trading, go to the next evolution entry
|
jp nz, .nextEvoEntry1 ; if not trading, go to the next evolution entry
|
||||||
ld a, [hli] ; level requirement
|
ld a, [hli] ; level requirement
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [wcfb9]
|
ld a, [wLoadedMonLevel]
|
||||||
cp b ; is the mon's level greater than the evolution requirement?
|
cp b ; is the mon's level greater than the evolution requirement?
|
||||||
jp c, Evolution_PartyMonLoop ; if so, go the next mon
|
jp c, Evolution_PartyMonLoop ; if so, go the next mon
|
||||||
jr .asm_3adb6
|
jr .asm_3adb6
|
||||||
|
|
@ -101,7 +101,7 @@ Evolution_PartyMonLoop: ; loop over party mons
|
||||||
.checkLevel
|
.checkLevel
|
||||||
ld a, [hli] ; level requirement
|
ld a, [hli] ; level requirement
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [wcfb9]
|
ld a, [wLoadedMonLevel]
|
||||||
cp b ; is the mon's level greater than the evolution requirement?
|
cp b ; is the mon's level greater than the evolution requirement?
|
||||||
jp c, .nextEvoEntry2 ; if so, go the next evolution entry
|
jp c, .nextEvoEntry2 ; if so, go the next evolution entry
|
||||||
.asm_3adb6
|
.asm_3adb6
|
||||||
|
|
@ -136,10 +136,10 @@ Evolution_PartyMonLoop: ; loop over party mons
|
||||||
pop hl
|
pop hl
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
ld [wcf98], a
|
ld [wLoadedMonSpecies], a
|
||||||
ld [wHPBarMaxHP + 1], a
|
ld [wHPBarMaxHP + 1], a
|
||||||
ld a, MONSTER_NAME
|
ld a, MONSTER_NAME
|
||||||
ld [W_LISTTYPE], a
|
ld [wNameListType], a
|
||||||
ld a, BANK(TrainerNames) ; bank is not used for monster names
|
ld a, BANK(TrainerNames) ; bank is not used for monster names
|
||||||
ld [wPredefBank], a
|
ld [wPredefBank], a
|
||||||
call GetName
|
call GetName
|
||||||
|
|
@ -169,8 +169,8 @@ Evolution_PartyMonLoop: ; loop over party mons
|
||||||
ld [W_MONHDEXNUM], a
|
ld [W_MONHDEXNUM], a
|
||||||
pop af
|
pop af
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
ld hl, wcfa8
|
ld hl, wLoadedMonHPExp - 1
|
||||||
ld de, wcfba
|
ld de, wLoadedMonStats
|
||||||
ld b, $1
|
ld b, $1
|
||||||
call CalcStats
|
call CalcStats
|
||||||
ld a, [wWhichPokemon]
|
ld a, [wWhichPokemon]
|
||||||
|
|
@ -186,14 +186,14 @@ Evolution_PartyMonLoop: ; loop over party mons
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld c, [hl]
|
ld c, [hl]
|
||||||
ld hl, wcfbb
|
ld hl, wLoadedMonMaxHP + 1
|
||||||
ld a, [hld]
|
ld a, [hld]
|
||||||
sub c
|
sub c
|
||||||
ld c, a
|
ld c, a
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
sbc b
|
sbc b
|
||||||
ld b, a
|
ld b, a
|
||||||
ld hl, wcf9a
|
ld hl, wLoadedMonHP + 1
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
add c
|
add c
|
||||||
ld [hld], a
|
ld [hld], a
|
||||||
|
|
@ -226,7 +226,7 @@ Evolution_PartyMonLoop: ; loop over party mons
|
||||||
call Evolution_FlagAction
|
call Evolution_FlagAction
|
||||||
pop de
|
pop de
|
||||||
pop hl
|
pop hl
|
||||||
ld a, [wcf98]
|
ld a, [wLoadedMonSpecies]
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
push hl
|
push hl
|
||||||
ld l, e
|
ld l, e
|
||||||
|
|
@ -364,7 +364,7 @@ LearnMoveFromLevelUp: ; 3af5b (e:6f5b)
|
||||||
dec b
|
dec b
|
||||||
jr nz, .checkCurrentMovesLoop
|
jr nz, .checkCurrentMovesLoop
|
||||||
ld a, d
|
ld a, d
|
||||||
ld [wd0e0], a
|
ld [wMoveNum], a
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
call GetMoveName
|
call GetMoveName
|
||||||
call CopyStringToCF4B
|
call CopyStringToCF4B
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
; calculates the level a mon should be based on its current exp
|
; calculates the level a mon should be based on its current exp
|
||||||
CalcLevelFromExperience: ; 58f43 (16:4f43)
|
CalcLevelFromExperience: ; 58f43 (16:4f43)
|
||||||
ld a, [wcf98]
|
ld a, [wLoadedMonSpecies]
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
call GetMonHeader
|
call GetMonHeader
|
||||||
ld d, $1 ; init level to 1
|
ld d, $1 ; init level to 1
|
||||||
|
|
@ -8,7 +8,7 @@ CalcLevelFromExperience: ; 58f43 (16:4f43)
|
||||||
inc d ; increment level
|
inc d ; increment level
|
||||||
call CalcExperience
|
call CalcExperience
|
||||||
push hl
|
push hl
|
||||||
ld hl, wcfa8 ; current exp
|
ld hl, wLoadedMonExp + 2 ; current exp
|
||||||
; compare exp needed for level d with current exp
|
; compare exp needed for level d with current exp
|
||||||
ld a, [H_MULTIPLICAND + 2]
|
ld a, [H_MULTIPLICAND + 2]
|
||||||
ld c, a
|
ld c, a
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ _GivePokemon: ; 4fda5 (13:7da5)
|
||||||
ld [wEnemyMonSpecies2], a
|
ld [wEnemyMonSpecies2], a
|
||||||
callab LoadEnemyMonData
|
callab LoadEnemyMonData
|
||||||
call SetPokedexOwnedFlag
|
call SetPokedexOwnedFlag
|
||||||
callab Func_e7a4
|
callab SendNewMonToBox
|
||||||
ld hl, wcf4b
|
ld hl, wcf4b
|
||||||
ld a, [wd5a0]
|
ld a, [wd5a0]
|
||||||
and $7f
|
and $7f
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,7 @@ Func_702f0: ; 702f0 (1c:42f0)
|
||||||
ld a, [wWhichTrade] ; wWhichTrade
|
ld a, [wWhichTrade] ; wWhichTrade
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
hlCoord 3, 9
|
hlCoord 3, 9
|
||||||
predef Func_27d6b
|
predef PrintMonType
|
||||||
ld a, [wWhichTrade] ; wWhichTrade
|
ld a, [wWhichTrade] ; wWhichTrade
|
||||||
jp PlayCry
|
jp PlayCry
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ DisplayMonFrontSpriteInBox: ; 5dbd9 (17:5bd9)
|
||||||
xor a
|
xor a
|
||||||
ld [hWY], a
|
ld [hWY], a
|
||||||
call SaveScreenTilesToBuffer1
|
call SaveScreenTilesToBuffer1
|
||||||
ld a, $11
|
ld a, MON_SPRITE_POPUP
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
call UpdateSprites
|
call UpdateSprites
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ UpdateHPBar_CalcHPDifference: ; fad7 (3:7ad7)
|
||||||
UpdateHPBar_PrintHPNumber: ; faf5 (3:7af5)
|
UpdateHPBar_PrintHPNumber: ; faf5 (3:7af5)
|
||||||
push af
|
push af
|
||||||
push de
|
push de
|
||||||
ld a, [wListMenuID] ; wListMenuID
|
ld a, [wHPBarType]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_fb2d
|
jr z, .asm_fb2d
|
||||||
ld a, [wHPBarOldHP]
|
ld a, [wHPBarOldHP]
|
||||||
|
|
@ -211,7 +211,7 @@ UpdateHPBar_PrintHPNumber: ; faf5 (3:7af5)
|
||||||
ld a, [wHPBarOldHP+1]
|
ld a, [wHPBarOldHP+1]
|
||||||
ld [wcef0], a
|
ld [wcef0], a
|
||||||
push hl
|
push hl
|
||||||
ld a, [$fff6]
|
ld a, [hFlags_0xFFF6]
|
||||||
bit 0, a
|
bit 0, a
|
||||||
jr z, .asm_fb15
|
jr z, .asm_fb15
|
||||||
ld de, $9
|
ld de, $9
|
||||||
|
|
|
||||||
|
|
@ -430,7 +430,7 @@ ItemUseBall: ; d687 (3:5687)
|
||||||
jr .End
|
jr .End
|
||||||
.sendToBox ;$5907
|
.sendToBox ;$5907
|
||||||
call ClearSprites
|
call ClearSprites
|
||||||
call Func_e7a4
|
call SendNewMonToBox
|
||||||
ld hl,ItemUseBallText07
|
ld hl,ItemUseBallText07
|
||||||
ld a,[wd7f1]
|
ld a,[wd7f1]
|
||||||
bit 0,a ;already met Bill?
|
bit 0,a ;already met Bill?
|
||||||
|
|
@ -777,7 +777,7 @@ ItemUseMedicine: ; dabb (3:5abb)
|
||||||
ld de,wBattleMonMaxHP
|
ld de,wBattleMonMaxHP
|
||||||
ld bc,10
|
ld bc,10
|
||||||
call CopyData ; copy party stats to in-battle stat data
|
call CopyData ; copy party stats to in-battle stat data
|
||||||
predef Func_3ed02
|
predef DoubleOrHalveSelectedStats
|
||||||
jp .doneHealing
|
jp .doneHealing
|
||||||
.healHP
|
.healHP
|
||||||
inc hl ; hl = address of current HP
|
inc hl ; hl = address of current HP
|
||||||
|
|
@ -919,15 +919,15 @@ ItemUseMedicine: ; dabb (3:5abb)
|
||||||
call AddNTimes ; calculate coordinates of HP bar of pokemon that used Softboiled
|
call AddNTimes ; calculate coordinates of HP bar of pokemon that used Softboiled
|
||||||
ld a,(SFX_02_3d - SFX_Headers_02) / 3
|
ld a,(SFX_02_3d - SFX_Headers_02) / 3
|
||||||
call PlaySoundWaitForCurrent ; play sound
|
call PlaySoundWaitForCurrent ; play sound
|
||||||
ld a,[$fff6]
|
ld a,[hFlags_0xFFF6]
|
||||||
set 0,a
|
set 0,a
|
||||||
ld [$fff6],a
|
ld [hFlags_0xFFF6],a
|
||||||
ld a,$02
|
ld a,$02
|
||||||
ld [wListMenuID],a
|
ld [wHPBarType],a
|
||||||
predef UpdateHPBar2 ; animate HP bar decrease of pokemon that used Softboiled
|
predef UpdateHPBar2 ; animate HP bar decrease of pokemon that used Softboiled
|
||||||
ld a,[$fff6]
|
ld a,[hFlags_0xFFF6]
|
||||||
res 0,a
|
res 0,a
|
||||||
ld [$fff6],a
|
ld [hFlags_0xFFF6],a
|
||||||
pop af
|
pop af
|
||||||
ld b,a ; store heal amount (1/5 of max HP)
|
ld b,a ; store heal amount (1/5 of max HP)
|
||||||
ld hl,wHPBarOldHP + 1
|
ld hl,wHPBarOldHP + 1
|
||||||
|
|
@ -1069,15 +1069,15 @@ ItemUseMedicine: ; dabb (3:5abb)
|
||||||
jr z,.playStatusAilmentCuringSound
|
jr z,.playStatusAilmentCuringSound
|
||||||
ld a,(SFX_02_3d - SFX_Headers_02) / 3 ; HP healing sound
|
ld a,(SFX_02_3d - SFX_Headers_02) / 3 ; HP healing sound
|
||||||
call PlaySoundWaitForCurrent ; play sound
|
call PlaySoundWaitForCurrent ; play sound
|
||||||
ld a,[$fff6]
|
ld a,[hFlags_0xFFF6]
|
||||||
set 0,a
|
set 0,a
|
||||||
ld [$fff6],a
|
ld [hFlags_0xFFF6],a
|
||||||
ld a,$02
|
ld a,$02
|
||||||
ld [wListMenuID],a
|
ld [wHPBarType],a
|
||||||
predef UpdateHPBar2 ; animate the HP bar lengthening
|
predef UpdateHPBar2 ; animate the HP bar lengthening
|
||||||
ld a,[$fff6]
|
ld a,[hFlags_0xFFF6]
|
||||||
res 0,a
|
res 0,a
|
||||||
ld [$fff6],a
|
ld [hFlags_0xFFF6],a
|
||||||
ld a,$f7 ; revived message
|
ld a,$f7 ; revived message
|
||||||
ld [wd07d],a
|
ld [wd07d],a
|
||||||
ld a,[wcf91]
|
ld a,[wcf91]
|
||||||
|
|
@ -1090,7 +1090,7 @@ ItemUseMedicine: ; dabb (3:5abb)
|
||||||
jr .showHealingItemMessage
|
jr .showHealingItemMessage
|
||||||
.playStatusAilmentCuringSound
|
.playStatusAilmentCuringSound
|
||||||
ld a,(SFX_02_3e - SFX_Headers_02) / 3 ; status ailment curing sound
|
ld a,(SFX_02_3e - SFX_Headers_02) / 3 ; status ailment curing sound
|
||||||
call PlaySoundWaitForCurrent ; play sound
|
call PlaySoundWaitForCurrent
|
||||||
.showHealingItemMessage
|
.showHealingItemMessage
|
||||||
xor a
|
xor a
|
||||||
ld [H_AUTOBGTRANSFERENABLED],a
|
ld [H_AUTOBGTRANSFERENABLED],a
|
||||||
|
|
@ -1102,7 +1102,7 @@ ItemUseMedicine: ; dabb (3:5abb)
|
||||||
ld [H_AUTOBGTRANSFERENABLED],a
|
ld [H_AUTOBGTRANSFERENABLED],a
|
||||||
ld c,50
|
ld c,50
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
call WaitForTextScrollButtonPress ; wait for a button press
|
call WaitForTextScrollButtonPress
|
||||||
jr .done
|
jr .done
|
||||||
.canceledItemUse
|
.canceledItemUse
|
||||||
xor a
|
xor a
|
||||||
|
|
@ -1118,7 +1118,7 @@ ItemUseMedicine: ; dabb (3:5abb)
|
||||||
ld a,[W_ISINBATTLE]
|
ld a,[W_ISINBATTLE]
|
||||||
and a
|
and a
|
||||||
ret nz
|
ret nz
|
||||||
jp ReloadMapData ; restore saved screen
|
jp ReloadMapData
|
||||||
.useVitamin
|
.useVitamin
|
||||||
push hl
|
push hl
|
||||||
ld a,[hl]
|
ld a,[hl]
|
||||||
|
|
@ -2084,7 +2084,7 @@ ItemUseTMHM: ; e479 (3:6479)
|
||||||
ld [wd11e],a
|
ld [wd11e],a
|
||||||
predef TMToMove ; get move ID from TM/HM ID
|
predef TMToMove ; get move ID from TM/HM ID
|
||||||
ld a,[wd11e]
|
ld a,[wd11e]
|
||||||
ld [wd0e0],a
|
ld [wMoveNum],a
|
||||||
call GetMoveName
|
call GetMoveName
|
||||||
call CopyStringToCF4B ; copy name to wcf4b
|
call CopyStringToCF4B ; copy name to wcf4b
|
||||||
pop af
|
pop af
|
||||||
|
|
@ -2097,7 +2097,7 @@ ItemUseTMHM: ; e479 (3:6479)
|
||||||
call PrintText
|
call PrintText
|
||||||
hlCoord 14, 7
|
hlCoord 14, 7
|
||||||
ld bc,$080f
|
ld bc,$080f
|
||||||
ld a,$14
|
ld a,TWO_OPTION_MENU
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; yes/no menu
|
call DisplayTextBoxID ; yes/no menu
|
||||||
ld a,[wCurrentMenuItem]
|
ld a,[wCurrentMenuItem]
|
||||||
|
|
@ -2488,7 +2488,7 @@ TossItem_: ; e6f1 (3:66f1)
|
||||||
call PrintText
|
call PrintText
|
||||||
hlCoord 14, 7
|
hlCoord 14, 7
|
||||||
ld bc,$080f
|
ld bc,$080f
|
||||||
ld a,$14
|
ld a,TWO_OPTION_MENU
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; yes/no menu
|
call DisplayTextBoxID ; yes/no menu
|
||||||
ld a,[wd12e]
|
ld a,[wd12e]
|
||||||
|
|
@ -2567,7 +2567,7 @@ IsKeyItem_: ; e764 (3:6764)
|
||||||
|
|
||||||
INCLUDE "data/key_items.asm"
|
INCLUDE "data/key_items.asm"
|
||||||
|
|
||||||
Func_e7a4: ; e7a4 (3:67a4)
|
SendNewMonToBox: ; e7a4 (3:67a4)
|
||||||
ld de, W_NUMINBOX ; wda80
|
ld de, W_NUMINBOX ; wda80
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
inc a
|
inc a
|
||||||
|
|
@ -2818,49 +2818,51 @@ ItemUseReloadOverworldData: ; e9c5 (3:69c5)
|
||||||
call LoadCurrentMapView
|
call LoadCurrentMapView
|
||||||
jp UpdateSprites
|
jp UpdateSprites
|
||||||
|
|
||||||
Func_e9cb: ; e9cb (3:69cb)
|
; creates a list at wBuffer of maps where the mon in [wd11e] can be found.
|
||||||
ld hl, WildDataPointers ; $4eeb
|
; this is used by the pokedex to display locations the mon can be found on the map.
|
||||||
ld de, wHPBarMaxHP
|
FindWildLocationsOfMon: ; e9cb (3:69cb)
|
||||||
|
ld hl, WildDataPointers
|
||||||
|
ld de, wBuffer
|
||||||
ld c, $0
|
ld c, $0
|
||||||
.asm_e9d3
|
.loop
|
||||||
inc hl
|
inc hl
|
||||||
ld a, [hld]
|
ld a, [hld]
|
||||||
inc a
|
inc a
|
||||||
jr z, .asm_e9ec
|
jr z, .done
|
||||||
push hl
|
push hl
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld h, [hl]
|
ld h, [hl]
|
||||||
ld l, a
|
ld l, a
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
and a
|
and a
|
||||||
call nz, Func_e9f0
|
call nz, CheckMapForMon ; land
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
and a
|
and a
|
||||||
call nz, Func_e9f0
|
call nz, CheckMapForMon ; water
|
||||||
pop hl
|
pop hl
|
||||||
inc hl
|
inc hl
|
||||||
inc hl
|
inc hl
|
||||||
inc c
|
inc c
|
||||||
jr .asm_e9d3
|
jr .loop
|
||||||
.asm_e9ec
|
.done
|
||||||
ld a, $ff
|
ld a, $ff ; list terminator
|
||||||
ld [de], a
|
ld [de], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_e9f0: ; e9f0 (3:69f0)
|
CheckMapForMon: ; e9f0 (3:69f0)
|
||||||
inc hl
|
inc hl
|
||||||
ld b, $a
|
ld b, $a
|
||||||
.asm_e9f3
|
.loop
|
||||||
ld a, [wd11e]
|
ld a, [wd11e]
|
||||||
cp [hl]
|
cp [hl]
|
||||||
jr nz, .asm_e9fc
|
jr nz, .nextEntry
|
||||||
ld a, c
|
ld a, c
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
.asm_e9fc
|
.nextEntry
|
||||||
inc hl
|
inc hl
|
||||||
inc hl
|
inc hl
|
||||||
dec b
|
dec b
|
||||||
jr nz, .asm_e9f3
|
jr nz, .loop
|
||||||
dec hl
|
dec hl
|
||||||
ret
|
ret
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
; checks if the mon in wWhichPokemon already knows the move in wd0e0
|
; checks if the mon in [wWhichPokemon] already knows the move in [wMoveNum]
|
||||||
CheckIfMoveIsKnown: ; 2fe18 (b:7e18)
|
CheckIfMoveIsKnown: ; 2fe18 (b:7e18)
|
||||||
ld a, [wWhichPokemon]
|
ld a, [wWhichPokemon]
|
||||||
ld hl, wPartyMon1Moves
|
ld hl, wPartyMon1Moves
|
||||||
ld bc, $2c
|
ld bc, wPartyMon2 - wPartyMon1
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
ld a, [wd0e0]
|
ld a, [wMoveNum]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld c, $4 ; nubmer of moves
|
ld c, NUM_MOVES
|
||||||
.loop
|
.loop
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
cp b
|
cp b
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
; tests if mon [wcf91] can learn move [wd0e0]
|
; tests if mon [wcf91] can learn move [wMoveNum]
|
||||||
CanLearnTM: ; 1373e (4:773e)
|
CanLearnTM: ; 1373e (4:773e)
|
||||||
ld a, [wcf91]
|
ld a, [wcf91]
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
call GetMonHeader
|
call GetMonHeader
|
||||||
ld hl, W_MONHLEARNSET
|
ld hl, W_MONHLEARNSET
|
||||||
push hl
|
push hl
|
||||||
ld a, [wd0e0]
|
ld a, [wMoveNum]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld c, $0
|
ld c, $0
|
||||||
ld hl, TechnicalMachines
|
ld hl, TechnicalMachines
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
LearnMove: ; 6e43 (1:6e43)
|
LearnMove: ; 6e43 (1:6e43)
|
||||||
call SaveScreenTilesToBuffer1
|
call SaveScreenTilesToBuffer1
|
||||||
ld a, [wWhichPokemon] ; wWhichPokemon
|
ld a, [wWhichPokemon]
|
||||||
ld hl, wPartyMonNicks ; wPartyMonNicks
|
ld hl, wPartyMonNicks
|
||||||
call GetPartyMonName
|
call GetPartyMonName
|
||||||
ld hl, wcd6d
|
ld hl, wcd6d
|
||||||
ld de, wd036
|
ld de, wd036
|
||||||
|
|
@ -9,9 +9,9 @@ LearnMove: ; 6e43 (1:6e43)
|
||||||
call CopyData
|
call CopyData
|
||||||
|
|
||||||
DontAbandonLearning: ; 6e5b (1:6e5b)
|
DontAbandonLearning: ; 6e5b (1:6e5b)
|
||||||
ld hl, wPartyMon1Moves ; wPartyMon1Moves
|
ld hl, wPartyMon1Moves
|
||||||
ld bc, $2c
|
ld bc, $2c
|
||||||
ld a, [wWhichPokemon] ; wWhichPokemon
|
ld a, [wWhichPokemon]
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
ld d, h
|
ld d, h
|
||||||
ld e, l
|
ld e, l
|
||||||
|
|
@ -36,14 +36,14 @@ DontAbandonLearning: ; 6e5b (1:6e5b)
|
||||||
pop de
|
pop de
|
||||||
pop hl
|
pop hl
|
||||||
.asm_6e8b
|
.asm_6e8b
|
||||||
ld a, [wd0e0]
|
ld a, [wMoveNum]
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld bc, $15
|
ld bc, $15
|
||||||
add hl, bc
|
add hl, bc
|
||||||
push hl
|
push hl
|
||||||
push de
|
push de
|
||||||
dec a
|
dec a
|
||||||
ld hl, Moves ; $4000
|
ld hl, Moves
|
||||||
ld bc, $6
|
ld bc, $6
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
ld de, wHPBarMaxHP
|
ld de, wHPBarMaxHP
|
||||||
|
|
@ -53,22 +53,22 @@ DontAbandonLearning: ; 6e5b (1:6e5b)
|
||||||
pop de
|
pop de
|
||||||
pop hl
|
pop hl
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld a, [W_ISINBATTLE] ; W_ISINBATTLE
|
ld a, [W_ISINBATTLE]
|
||||||
and a
|
and a
|
||||||
jp z, PrintLearnedMove
|
jp z, PrintLearnedMove
|
||||||
ld a, [wWhichPokemon] ; wWhichPokemon
|
ld a, [wWhichPokemon]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [wPlayerMonNumber] ; wPlayerMonNumber
|
ld a, [wPlayerMonNumber]
|
||||||
cp b
|
cp b
|
||||||
jp nz, PrintLearnedMove
|
jp nz, PrintLearnedMove
|
||||||
ld h, d
|
ld h, d
|
||||||
ld l, e
|
ld l, e
|
||||||
ld de, wBattleMonMoves
|
ld de, wBattleMonMoves
|
||||||
ld bc, $4
|
ld bc, NUM_MOVES
|
||||||
call CopyData
|
call CopyData
|
||||||
ld bc, $11
|
ld bc, $11
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld de, wBattleMonPP ; wBattleMonPP
|
ld de, wBattleMonPP
|
||||||
ld bc, $4
|
ld bc, $4
|
||||||
call CopyData
|
call CopyData
|
||||||
jp PrintLearnedMove
|
jp PrintLearnedMove
|
||||||
|
|
@ -78,10 +78,10 @@ AbandonLearning: ; 6eda (1:6eda)
|
||||||
call PrintText
|
call PrintText
|
||||||
hlCoord 14, 7
|
hlCoord 14, 7
|
||||||
ld bc, $80f
|
ld bc, $80f
|
||||||
ld a, $14
|
ld a, TWO_OPTION_MENU
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID ; yes/no menu
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
and a
|
and a
|
||||||
jp nz, DontAbandonLearning
|
jp nz, DontAbandonLearning
|
||||||
ld hl, DidNotLearnText
|
ld hl, DidNotLearnText
|
||||||
|
|
@ -101,20 +101,20 @@ TryingToLearn: ; 6f07 (1:6f07)
|
||||||
call PrintText
|
call PrintText
|
||||||
hlCoord 14, 7
|
hlCoord 14, 7
|
||||||
ld bc, $80f
|
ld bc, $80f
|
||||||
ld a, $14
|
ld a, TWO_OPTION_MENU
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID ; yes/no menu
|
||||||
pop hl
|
pop hl
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
rra
|
rra
|
||||||
ret c
|
ret c
|
||||||
ld bc, $fffc
|
ld bc, $fffc
|
||||||
add hl, bc
|
add hl, bc
|
||||||
push hl
|
push hl
|
||||||
ld de, wd0dc
|
ld de, wMoves
|
||||||
ld bc, $4
|
ld bc, NUM_MOVES
|
||||||
call CopyData
|
call CopyData
|
||||||
callab Func_39b87
|
callab FormatMovesString
|
||||||
pop hl
|
pop hl
|
||||||
.asm_6f39
|
.asm_6f39
|
||||||
push hl
|
push hl
|
||||||
|
|
@ -125,15 +125,15 @@ TryingToLearn: ; 6f07 (1:6f07)
|
||||||
ld c, $e
|
ld c, $e
|
||||||
call TextBoxBorder
|
call TextBoxBorder
|
||||||
hlCoord 6, 8
|
hlCoord 6, 8
|
||||||
ld de, wd0e1
|
ld de, wMovesString
|
||||||
ld a, [$fff6]
|
ld a, [hFlags_0xFFF6]
|
||||||
set 2, a
|
set 2, a
|
||||||
ld [$fff6], a
|
ld [hFlags_0xFFF6], a
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld a, [$fff6]
|
ld a, [hFlags_0xFFF6]
|
||||||
res 2, a
|
res 2, a
|
||||||
ld [$fff6], a
|
ld [hFlags_0xFFF6], a
|
||||||
ld hl, wTopMenuItemY ; wTopMenuItemY
|
ld hl, wTopMenuItemY
|
||||||
ld a, $8
|
ld a, $8
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld a, $5
|
ld a, $5
|
||||||
|
|
@ -146,10 +146,10 @@ TryingToLearn: ; 6f07 (1:6f07)
|
||||||
ld a, $3
|
ld a, $3
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], $0
|
ld [hl], $0
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
set 1, [hl]
|
set 1, [hl]
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
res 1, [hl]
|
res 1, [hl]
|
||||||
push af
|
push af
|
||||||
call LoadScreenTilesFromBuffer1
|
call LoadScreenTilesFromBuffer1
|
||||||
|
|
@ -158,7 +158,7 @@ TryingToLearn: ; 6f07 (1:6f07)
|
||||||
bit 1, a
|
bit 1, a
|
||||||
jr nz, .asm_6fab
|
jr nz, .asm_6fab
|
||||||
push hl
|
push hl
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
ld c, a
|
ld c, a
|
||||||
ld b, $0
|
ld b, $0
|
||||||
add hl, bc
|
add hl, bc
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
Func_213c8:: ; 213c8 (8:53c8)
|
Func_213c8:: ; 213c8 (8:53c8)
|
||||||
xor a
|
xor a
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
call SaveScreenTilesToBuffer2
|
call SaveScreenTilesToBuffer2
|
||||||
ld a, [wd5a2]
|
ld a, [wd5a2]
|
||||||
and a
|
and a
|
||||||
|
|
@ -28,64 +28,64 @@ Func_213c8:: ; 213c8 (8:53c8)
|
||||||
call TextBoxBorder
|
call TextBoxBorder
|
||||||
call UpdateSprites
|
call UpdateSprites
|
||||||
ld a, $3
|
ld a, $3
|
||||||
ld [wMaxMenuItem], a ; wMaxMenuItem
|
ld [wMaxMenuItem], a
|
||||||
ld a, [wd7f1]
|
ld a, [wd7f1]
|
||||||
bit 0, a
|
bit 0, a
|
||||||
jr nz, .asm_21414
|
jr nz, .asm_21414
|
||||||
hlCoord 2, 2
|
hlCoord 2, 2
|
||||||
ld de, SomeonesPCText ; $548b
|
ld de, SomeonesPCText
|
||||||
jr .asm_2141a
|
jr .asm_2141a
|
||||||
.asm_21414
|
.asm_21414
|
||||||
hlCoord 2, 2
|
hlCoord 2, 2
|
||||||
ld de, BillsPCText ; $5497
|
ld de, BillsPCText
|
||||||
.asm_2141a
|
.asm_2141a
|
||||||
call PlaceString
|
call PlaceString
|
||||||
hlCoord 2, 4
|
hlCoord 2, 4
|
||||||
ld de, wPlayerName ; wd158
|
ld de, wPlayerName
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld l, c
|
ld l, c
|
||||||
ld h, b
|
ld h, b
|
||||||
ld de, PlayersPCText ; $54a0
|
ld de, PlayersPCText
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld a, [wd74b]
|
ld a, [wd74b]
|
||||||
bit 5, a
|
bit 5, a
|
||||||
jr z, .asm_21462
|
jr z, .asm_21462
|
||||||
hlCoord 2, 6
|
hlCoord 2, 6
|
||||||
ld de, OaksPCText ; $54a5
|
ld de, OaksPCText
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld a, [wd5a2]
|
ld a, [wd5a2]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_2145a
|
jr z, .asm_2145a
|
||||||
ld a, $4
|
ld a, $4
|
||||||
ld [wMaxMenuItem], a ; wMaxMenuItem
|
ld [wMaxMenuItem], a
|
||||||
hlCoord 2, 8
|
hlCoord 2, 8
|
||||||
ld de, PKMNLeaguePCText ; $54b2
|
ld de, PKMNLeaguePCText
|
||||||
call PlaceString
|
call PlaceString
|
||||||
hlCoord 2, 10
|
hlCoord 2, 10
|
||||||
ld de, LogOffPCText ; $54ba
|
ld de, LogOffPCText
|
||||||
jr .asm_2146d
|
jr .asm_2146d
|
||||||
.asm_2145a
|
.asm_2145a
|
||||||
hlCoord 2, 8
|
hlCoord 2, 8
|
||||||
ld de, LogOffPCText ; $54ba
|
ld de, LogOffPCText
|
||||||
jr .asm_2146d
|
jr .asm_2146d
|
||||||
.asm_21462
|
.asm_21462
|
||||||
ld a, $2
|
ld a, $2
|
||||||
ld [wMaxMenuItem], a ; wMaxMenuItem
|
ld [wMaxMenuItem], a
|
||||||
hlCoord 2, 6
|
hlCoord 2, 6
|
||||||
ld de, LogOffPCText ; $54ba
|
ld de, LogOffPCText
|
||||||
.asm_2146d
|
.asm_2146d
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld a, $3
|
ld a, $3
|
||||||
ld [wMenuWatchedKeys], a ; wMenuWatchedKeys
|
ld [wMenuWatchedKeys], a
|
||||||
ld a, $2
|
ld a, $2
|
||||||
ld [wTopMenuItemY], a ; wTopMenuItemY
|
ld [wTopMenuItemY], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wTopMenuItemX], a ; wTopMenuItemX
|
ld [wTopMenuItemX], a
|
||||||
xor a
|
xor a
|
||||||
ld [wCurrentMenuItem], a ; wCurrentMenuItem
|
ld [wCurrentMenuItem], a
|
||||||
ld [wLastMenuItem], a ; wLastMenuItem
|
ld [wLastMenuItem], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
SomeonesPCText: db "SOMEONE's PC@"
|
SomeonesPCText: db "SOMEONE's PC@"
|
||||||
|
|
@ -101,9 +101,9 @@ BillsPC_:: ; 0x214c2
|
||||||
xor a
|
xor a
|
||||||
ld [wccd3], a
|
ld [wccd3], a
|
||||||
inc a ; MONSTER_NAME
|
inc a ; MONSTER_NAME
|
||||||
ld [W_LISTTYPE], a
|
ld [wNameListType], a
|
||||||
call LoadHpBarAndStatusTilePatterns
|
call LoadHpBarAndStatusTilePatterns
|
||||||
ld a, [wListScrollOffset] ; wcc36
|
ld a, [wListScrollOffset]
|
||||||
push af
|
push af
|
||||||
ld a, [wFlags_0xcd60]
|
ld a, [wFlags_0xcd60]
|
||||||
bit 3, a
|
bit 3, a
|
||||||
|
|
@ -116,9 +116,9 @@ BillsPC_:: ; 0x214c2
|
||||||
Func_214e8: ; 214e8 (8:54e8)
|
Func_214e8: ; 214e8 (8:54e8)
|
||||||
BillsPCMenu:
|
BillsPCMenu:
|
||||||
ld a, [wccd3]
|
ld a, [wccd3]
|
||||||
ld [wCurrentMenuItem], a ; wCurrentMenuItem
|
ld [wCurrentMenuItem], a
|
||||||
ld hl, vChars2 + $780
|
ld hl, vChars2 + $780
|
||||||
ld de, PokeballTileGraphics ; $697e
|
ld de, PokeballTileGraphics
|
||||||
ld bc, (BANK(PokeballTileGraphics) << 8) + $01
|
ld bc, (BANK(PokeballTileGraphics) << 8) + $01
|
||||||
call CopyVideoData
|
call CopyVideoData
|
||||||
call LoadScreenTilesFromBuffer2DisableBGTransfer
|
call LoadScreenTilesFromBuffer2DisableBGTransfer
|
||||||
|
|
@ -127,9 +127,9 @@ BillsPCMenu:
|
||||||
ld c, $c
|
ld c, $c
|
||||||
call TextBoxBorder
|
call TextBoxBorder
|
||||||
hlCoord 2, 2
|
hlCoord 2, 2
|
||||||
ld de, BillsPCMenuText ; $56e1
|
ld de, BillsPCMenuText
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld hl, wTopMenuItemY ; wTopMenuItemY
|
ld hl, wTopMenuItemY
|
||||||
ld a, $2
|
ld a, $2
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
dec a
|
dec a
|
||||||
|
|
@ -143,10 +143,10 @@ BillsPCMenu:
|
||||||
xor a
|
xor a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld hl, wListScrollOffset ; wcc36
|
ld hl, wListScrollOffset
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld [wPlayerMonNumber], a ; wPlayerMonNumber
|
ld [wPlayerMonNumber], a
|
||||||
ld hl, WhatText
|
ld hl, WhatText
|
||||||
call PrintText
|
call PrintText
|
||||||
hlCoord 9, 14
|
hlCoord 9, 14
|
||||||
|
|
@ -167,16 +167,16 @@ BillsPCMenu:
|
||||||
.asm_21551
|
.asm_21551
|
||||||
Coorda 18, 16
|
Coorda 18, 16
|
||||||
hlCoord 10, 16
|
hlCoord 10, 16
|
||||||
ld de, BoxNoPCText ; $5713
|
ld de, BoxNoPCText
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
call Delay3
|
call Delay3
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
bit 1, a
|
bit 1, a
|
||||||
jp nz, Func_21588 ; b button
|
jp nz, Func_21588 ; b button
|
||||||
call PlaceUnfilledArrowMenuCursor
|
call PlaceUnfilledArrowMenuCursor
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
ld [wccd3], a
|
ld [wccd3], a
|
||||||
and a
|
and a
|
||||||
jp z, Func_21618 ; withdraw
|
jp z, Func_21618 ; withdraw
|
||||||
|
|
@ -200,28 +200,28 @@ Func_21588: ; 21588 (8:5588)
|
||||||
res 5, [hl]
|
res 5, [hl]
|
||||||
call LoadScreenTilesFromBuffer2
|
call LoadScreenTilesFromBuffer2
|
||||||
pop af
|
pop af
|
||||||
ld [wListScrollOffset], a ; wcc36
|
ld [wListScrollOffset], a
|
||||||
ld hl, wd730
|
ld hl, wd730
|
||||||
res 6, [hl]
|
res 6, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_215ac: ; 215ac (8:55ac)
|
Func_215ac: ; 215ac (8:55ac)
|
||||||
BillsPCDeposit:
|
BillsPCDeposit:
|
||||||
ld a, [wPartyCount] ; wPartyCount
|
ld a, [wPartyCount]
|
||||||
dec a
|
dec a
|
||||||
jr nz, .asm_215bb
|
jr nz, .asm_215bb
|
||||||
ld hl, CantDepositLastMonText
|
ld hl, CantDepositLastMonText
|
||||||
call PrintText
|
call PrintText
|
||||||
jp BillsPCMenu
|
jp BillsPCMenu
|
||||||
.asm_215bb
|
.asm_215bb
|
||||||
ld a, [W_NUMINBOX] ; wda80
|
ld a, [W_NUMINBOX]
|
||||||
cp MONS_PER_BOX
|
cp MONS_PER_BOX
|
||||||
jr nz, .asm_215cb
|
jr nz, .asm_215cb
|
||||||
ld hl, BoxFullText ; $5802
|
ld hl, BoxFullText
|
||||||
call PrintText
|
call PrintText
|
||||||
jp BillsPCMenu
|
jp BillsPCMenu
|
||||||
.asm_215cb
|
.asm_215cb
|
||||||
ld hl, wPartyCount ; wPartyCount
|
ld hl, wPartyCount
|
||||||
call Func_216be
|
call Func_216be
|
||||||
jp c, BillsPCMenu
|
jp c, BillsPCMenu
|
||||||
call Func_2174b
|
call Func_2174b
|
||||||
|
|
@ -236,7 +236,7 @@ BillsPCDeposit:
|
||||||
ld [wcf95], a
|
ld [wcf95], a
|
||||||
call RemovePokemon
|
call RemovePokemon
|
||||||
call WaitForSoundToFinish
|
call WaitForSoundToFinish
|
||||||
ld hl, wWhichTrade ; wWhichTrade
|
ld hl, wWhichTrade
|
||||||
ld a, [wd5a0]
|
ld a, [wd5a0]
|
||||||
and $7f
|
and $7f
|
||||||
cp 9
|
cp 9
|
||||||
|
|
@ -251,31 +251,31 @@ BillsPCDeposit:
|
||||||
.asm_2160c
|
.asm_2160c
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], $50
|
ld [hl], $50
|
||||||
ld hl, MonWasStoredText ; $57f8
|
ld hl, MonWasStoredText
|
||||||
call PrintText
|
call PrintText
|
||||||
jp BillsPCMenu
|
jp BillsPCMenu
|
||||||
|
|
||||||
Func_21618: ; 21618 (8:5618)
|
Func_21618: ; 21618 (8:5618)
|
||||||
ld a, [W_NUMINBOX] ; wda80
|
ld a, [W_NUMINBOX]
|
||||||
and a
|
and a
|
||||||
jr nz, .asm_21627
|
jr nz, .asm_21627
|
||||||
ld hl, NoMonText ; $580c
|
ld hl, NoMonText
|
||||||
call PrintText
|
call PrintText
|
||||||
jp Func_214e8
|
jp Func_214e8
|
||||||
.asm_21627
|
.asm_21627
|
||||||
ld a, [wPartyCount] ; wPartyCount
|
ld a, [wPartyCount]
|
||||||
cp PARTY_LENGTH
|
cp PARTY_LENGTH
|
||||||
jr nz, .asm_21637
|
jr nz, .asm_21637
|
||||||
ld hl, CantTakeMonText ; $5811
|
ld hl, CantTakeMonText
|
||||||
call PrintText
|
call PrintText
|
||||||
jp Func_214e8
|
jp Func_214e8
|
||||||
.asm_21637
|
.asm_21637
|
||||||
ld hl, W_NUMINBOX ; wda80
|
ld hl, W_NUMINBOX
|
||||||
call Func_216be
|
call Func_216be
|
||||||
jp c, Func_214e8
|
jp c, Func_214e8
|
||||||
call Func_2174b
|
call Func_2174b
|
||||||
jp nc, Func_214e8
|
jp nc, Func_214e8
|
||||||
ld a, [wWhichPokemon] ; wWhichPokemon
|
ld a, [wWhichPokemon]
|
||||||
ld hl, wBoxMonNicks
|
ld hl, wBoxMonNicks
|
||||||
call GetPartyMonName
|
call GetPartyMonName
|
||||||
ld a, [wcf91]
|
ld a, [wcf91]
|
||||||
|
|
@ -288,25 +288,25 @@ Func_21618: ; 21618 (8:5618)
|
||||||
ld [wcf95], a
|
ld [wcf95], a
|
||||||
call RemovePokemon
|
call RemovePokemon
|
||||||
call WaitForSoundToFinish
|
call WaitForSoundToFinish
|
||||||
ld hl, MonIsTakenOutText ; $5807
|
ld hl, MonIsTakenOutText
|
||||||
call PrintText
|
call PrintText
|
||||||
jp Func_214e8
|
jp Func_214e8
|
||||||
|
|
||||||
Func_21673: ; 21673 (8:5673)
|
Func_21673: ; 21673 (8:5673)
|
||||||
ld a, [W_NUMINBOX] ; wda80
|
ld a, [W_NUMINBOX]
|
||||||
and a
|
and a
|
||||||
jr nz, .asm_21682
|
jr nz, .asm_21682
|
||||||
ld hl, NoMonText ; $580c
|
ld hl, NoMonText
|
||||||
call PrintText
|
call PrintText
|
||||||
jp Func_214e8
|
jp Func_214e8
|
||||||
.asm_21682
|
.asm_21682
|
||||||
ld hl, W_NUMINBOX ; wda80
|
ld hl, W_NUMINBOX
|
||||||
call Func_216be
|
call Func_216be
|
||||||
jp c, Func_214e8
|
jp c, Func_214e8
|
||||||
ld hl, OnceReleasedText ; $581b
|
ld hl, OnceReleasedText
|
||||||
call PrintText
|
call PrintText
|
||||||
call YesNoChoice
|
call YesNoChoice
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
and a
|
and a
|
||||||
jr nz, .asm_21682
|
jr nz, .asm_21682
|
||||||
inc a
|
inc a
|
||||||
|
|
@ -315,7 +315,7 @@ Func_21673: ; 21673 (8:5673)
|
||||||
call WaitForSoundToFinish
|
call WaitForSoundToFinish
|
||||||
ld a, [wcf91]
|
ld a, [wcf91]
|
||||||
call PlayCry
|
call PlayCry
|
||||||
ld hl, MonWasReleasedText ; $5820
|
ld hl, MonWasReleasedText
|
||||||
call PrintText
|
call PrintText
|
||||||
jp Func_214e8
|
jp Func_214e8
|
||||||
|
|
||||||
|
|
@ -325,18 +325,18 @@ Func_216b3: ; 216b3 (8:56b3)
|
||||||
|
|
||||||
Func_216be: ; 216be (8:56be)
|
Func_216be: ; 216be (8:56be)
|
||||||
ld a, l
|
ld a, l
|
||||||
ld [wcf8b], a
|
ld [wList], a
|
||||||
ld a, h
|
ld a, h
|
||||||
ld [wcf8c], a
|
ld [wList + 1], a
|
||||||
xor a
|
xor a
|
||||||
ld [wcf93], a
|
ld [wcf93], a
|
||||||
ld [wListMenuID], a ; wListMenuID
|
ld [wListMenuID], a
|
||||||
inc a ; MONSTER_NAME
|
inc a ; MONSTER_NAME
|
||||||
ld [W_LISTTYPE], a
|
ld [wNameListType], a
|
||||||
ld a, [wcc2b]
|
ld a, [wcc2b]
|
||||||
ld [wCurrentMenuItem], a ; wCurrentMenuItem
|
ld [wCurrentMenuItem], a
|
||||||
call DisplayListMenuID
|
call DisplayListMenuID
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
ld [wcc2b], a
|
ld [wcc2b], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
@ -368,7 +368,7 @@ Func_2171b:: ; 2171b (8:571b)
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
push hl
|
push hl
|
||||||
push bc
|
push bc
|
||||||
ld hl, HMMoveArray ; $5745
|
ld hl, HMMoveArray
|
||||||
ld de, 1
|
ld de, 1
|
||||||
call IsInArray
|
call IsInArray
|
||||||
pop bc
|
pop bc
|
||||||
|
|
@ -394,16 +394,16 @@ Func_2174b: ; 2174b (8:574b)
|
||||||
call TextBoxBorder
|
call TextBoxBorder
|
||||||
ld a, [wccd3]
|
ld a, [wccd3]
|
||||||
and a
|
and a
|
||||||
ld de, DepositPCText ; $57cb
|
ld de, DepositPCText
|
||||||
jr nz, .asm_21761
|
jr nz, .asm_21761
|
||||||
ld de, WithdrawPCText ; $57d3
|
ld de, WithdrawPCText
|
||||||
.asm_21761
|
.asm_21761
|
||||||
hlCoord 11, 12
|
hlCoord 11, 12
|
||||||
call PlaceString
|
call PlaceString
|
||||||
hlCoord 11, 14
|
hlCoord 11, 14
|
||||||
ld de, StatsCancelPCText ; $57dc
|
ld de, StatsCancelPCText
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld hl, wTopMenuItemY ; wTopMenuItemY
|
ld hl, wTopMenuItemY
|
||||||
ld a, $c
|
ld a, $c
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld a, $a
|
ld a, $a
|
||||||
|
|
@ -417,16 +417,16 @@ Func_2174b: ; 2174b (8:574b)
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
xor a
|
xor a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld hl, wListScrollOffset ; wcc36
|
ld hl, wListScrollOffset
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld [wPlayerMonNumber], a ; wPlayerMonNumber
|
ld [wPlayerMonNumber], a
|
||||||
ld [wcc2b], a
|
ld [wcc2b], a
|
||||||
.asm_2178f
|
.asm_2178f
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
bit 1, a
|
bit 1, a
|
||||||
jr nz, .asm_2179f
|
jr nz, .asm_2179f
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_217a1
|
jr z, .asm_217a1
|
||||||
dec a
|
dec a
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ AskName: ; 64eb (1:64eb)
|
||||||
call SaveScreenTilesToBuffer1
|
call SaveScreenTilesToBuffer1
|
||||||
call GetPredefRegisters
|
call GetPredefRegisters
|
||||||
push hl
|
push hl
|
||||||
ld a, [W_ISINBATTLE] ; W_ISINBATTLE
|
ld a, [W_ISINBATTLE]
|
||||||
dec a
|
dec a
|
||||||
ld hl, wTileMap
|
ld hl, wTileMap
|
||||||
ld b, $4
|
ld b, $4
|
||||||
|
|
@ -15,11 +15,11 @@ AskName: ; 64eb (1:64eb)
|
||||||
call PrintText
|
call PrintText
|
||||||
hlCoord 14, 7
|
hlCoord 14, 7
|
||||||
ld bc, $80f
|
ld bc, $80f
|
||||||
ld a, $14
|
ld a, TWO_OPTION_MENU
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
pop hl
|
pop hl
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
and a
|
and a
|
||||||
jr nz, .asm_654c
|
jr nz, .asm_654c
|
||||||
ld a, [wUpdateSpritesEnabled]
|
ld a, [wUpdateSpritesEnabled]
|
||||||
|
|
@ -30,7 +30,7 @@ AskName: ; 64eb (1:64eb)
|
||||||
ld a, $2
|
ld a, $2
|
||||||
ld [wd07d], a
|
ld [wd07d], a
|
||||||
call DisplayNamingScreen
|
call DisplayNamingScreen
|
||||||
ld a, [W_ISINBATTLE] ; W_ISINBATTLE
|
ld a, [W_ISINBATTLE]
|
||||||
and a
|
and a
|
||||||
jr nz, .asm_653e
|
jr nz, .asm_653e
|
||||||
call ReloadMapSpriteTilePatterns
|
call ReloadMapSpriteTilePatterns
|
||||||
|
|
@ -66,9 +66,9 @@ Func_655c: ; 655c (1:655c)
|
||||||
ld a, [wcf4b]
|
ld a, [wcf4b]
|
||||||
cp $50
|
cp $50
|
||||||
jr z, .asm_6594
|
jr z, .asm_6594
|
||||||
ld hl, wPartyMonNicks ; wPartyMonNicks
|
ld hl, wPartyMonNicks
|
||||||
ld bc, $b
|
ld bc, $b
|
||||||
ld a, [wWhichPokemon] ; wWhichPokemon
|
ld a, [wWhichPokemon]
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
ld e, l
|
ld e, l
|
||||||
ld d, h
|
ld d, h
|
||||||
|
|
@ -99,22 +99,22 @@ DisplayNamingScreen: ; 6596 (1:6596)
|
||||||
call TextBoxBorder
|
call TextBoxBorder
|
||||||
call PrintNamingText
|
call PrintNamingText
|
||||||
ld a, $3
|
ld a, $3
|
||||||
ld [wTopMenuItemY], a ; wTopMenuItemY
|
ld [wTopMenuItemY], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wTopMenuItemX], a ; wTopMenuItemX
|
ld [wTopMenuItemX], a
|
||||||
ld [wLastMenuItem], a ; wLastMenuItem
|
ld [wLastMenuItem], a
|
||||||
ld [wCurrentMenuItem], a ; wCurrentMenuItem
|
ld [wCurrentMenuItem], a
|
||||||
ld a, $ff
|
ld a, $ff
|
||||||
ld [wMenuWatchedKeys], a ; wMenuWatchedKeys
|
ld [wMenuWatchedKeys], a
|
||||||
ld a, $7
|
ld a, $7
|
||||||
ld [wMaxMenuItem], a ; wMaxMenuItem
|
ld [wMaxMenuItem], a
|
||||||
ld a, $50
|
ld a, $50
|
||||||
ld [wcf4b], a
|
ld [wcf4b], a
|
||||||
xor a
|
xor a
|
||||||
ld hl, wHPBarMaxHP + 1
|
ld hl, wHPBarMaxHP + 1
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [W_SUBANIMTRANSFORM], a ; W_SUBANIMTRANSFORM
|
ld [W_SUBANIMTRANSFORM], a
|
||||||
.asm_65ed
|
.asm_65ed
|
||||||
call PrintAlphabet
|
call PrintAlphabet
|
||||||
call GBPalNormal
|
call GBPalNormal
|
||||||
|
|
@ -126,16 +126,16 @@ DisplayNamingScreen: ; 6596 (1:6596)
|
||||||
.asm_65fc
|
.asm_65fc
|
||||||
call PlaceMenuCursor
|
call PlaceMenuCursor
|
||||||
.asm_65ff
|
.asm_65ff
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
push af
|
push af
|
||||||
callba AnimatePartyMon_ForceSpeed1
|
callba AnimatePartyMon_ForceSpeed1
|
||||||
pop af
|
pop af
|
||||||
ld [wCurrentMenuItem], a ; wCurrentMenuItem
|
ld [wCurrentMenuItem], a
|
||||||
call JoypadLowSensitivity
|
call JoypadLowSensitivity
|
||||||
ld a, [hJoyPressed]
|
ld a, [hJoyPressed]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_65ff
|
jr z, .asm_65ff
|
||||||
ld hl, .unknownPointerTable_665e ; $665e
|
ld hl, .unknownPointerTable_665e
|
||||||
.asm_661a
|
.asm_661a
|
||||||
sla a
|
sla a
|
||||||
jr c, .asm_6624
|
jr c, .asm_6624
|
||||||
|
|
@ -165,10 +165,10 @@ DisplayNamingScreen: ; 6596 (1:6596)
|
||||||
call GoPAL_SET_CF1C
|
call GoPAL_SET_CF1C
|
||||||
call GBPalNormal
|
call GBPalNormal
|
||||||
xor a
|
xor a
|
||||||
ld [W_SUBANIMTRANSFORM], a ; W_SUBANIMTRANSFORM
|
ld [W_SUBANIMTRANSFORM], a
|
||||||
ld hl, wd730
|
ld hl, wd730
|
||||||
res 6, [hl]
|
res 6, [hl]
|
||||||
ld a, [W_ISINBATTLE] ; W_ISINBATTLE
|
ld a, [W_ISINBATTLE]
|
||||||
and a
|
and a
|
||||||
jp z, LoadTextBoxTilePatterns
|
jp z, LoadTextBoxTilePatterns
|
||||||
ld hl, LoadHudTilePatterns
|
ld hl, LoadHudTilePatterns
|
||||||
|
|
@ -207,21 +207,21 @@ DisplayNamingScreen: ; 6596 (1:6596)
|
||||||
ld [wHPBarMaxHP + 1], a
|
ld [wHPBarMaxHP + 1], a
|
||||||
ret
|
ret
|
||||||
.asm_6692
|
.asm_6692
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
cp $5
|
cp $5
|
||||||
jr nz, .asm_66a0
|
jr nz, .asm_66a0
|
||||||
ld a, [wTopMenuItemX] ; wTopMenuItemX
|
ld a, [wTopMenuItemX]
|
||||||
cp $11
|
cp $11
|
||||||
jr z, .asm_668c
|
jr z, .asm_668c
|
||||||
.asm_66a0
|
.asm_66a0
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
cp $6
|
cp $6
|
||||||
jr nz, .asm_66ae
|
jr nz, .asm_66ae
|
||||||
ld a, [wTopMenuItemX] ; wTopMenuItemX
|
ld a, [wTopMenuItemX]
|
||||||
cp $1
|
cp $1
|
||||||
jr z, .asm_667e
|
jr z, .asm_667e
|
||||||
.asm_66ae
|
.asm_66ae
|
||||||
ld hl, wMenuCursorLocation ; wMenuCursorLocation
|
ld hl, wMenuCursorLocation
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld h, [hl]
|
ld h, [hl]
|
||||||
ld l, a
|
ld l, a
|
||||||
|
|
@ -270,10 +270,10 @@ DisplayNamingScreen: ; 6596 (1:6596)
|
||||||
ld [hl], $50
|
ld [hl], $50
|
||||||
ret
|
ret
|
||||||
.asm_6702
|
.asm_6702
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
cp $6
|
cp $6
|
||||||
ret z
|
ret z
|
||||||
ld a, [wTopMenuItemX] ; wTopMenuItemX
|
ld a, [wTopMenuItemX]
|
||||||
cp $11
|
cp $11
|
||||||
jp z, .asm_6714
|
jp z, .asm_6714
|
||||||
inc a
|
inc a
|
||||||
|
|
@ -283,10 +283,10 @@ DisplayNamingScreen: ; 6596 (1:6596)
|
||||||
ld a, $1
|
ld a, $1
|
||||||
jr .asm_6755
|
jr .asm_6755
|
||||||
.asm_6718
|
.asm_6718
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
cp $6
|
cp $6
|
||||||
ret z
|
ret z
|
||||||
ld a, [wTopMenuItemX] ; wTopMenuItemX
|
ld a, [wTopMenuItemX]
|
||||||
dec a
|
dec a
|
||||||
jp z, .asm_6728
|
jp z, .asm_6728
|
||||||
dec a
|
dec a
|
||||||
|
|
@ -295,30 +295,30 @@ DisplayNamingScreen: ; 6596 (1:6596)
|
||||||
ld a, $11
|
ld a, $11
|
||||||
jr .asm_6755
|
jr .asm_6755
|
||||||
.asm_672c
|
.asm_672c
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
dec a
|
dec a
|
||||||
ld [wCurrentMenuItem], a ; wCurrentMenuItem
|
ld [wCurrentMenuItem], a
|
||||||
and a
|
and a
|
||||||
ret nz
|
ret nz
|
||||||
ld a, $6
|
ld a, $6
|
||||||
ld [wCurrentMenuItem], a ; wCurrentMenuItem
|
ld [wCurrentMenuItem], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
jr .asm_6755
|
jr .asm_6755
|
||||||
.asm_673e
|
.asm_673e
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
inc a
|
inc a
|
||||||
ld [wCurrentMenuItem], a ; wCurrentMenuItem
|
ld [wCurrentMenuItem], a
|
||||||
cp $7
|
cp $7
|
||||||
jr nz, .asm_6750
|
jr nz, .asm_6750
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wCurrentMenuItem], a ; wCurrentMenuItem
|
ld [wCurrentMenuItem], a
|
||||||
jr .asm_6755
|
jr .asm_6755
|
||||||
.asm_6750
|
.asm_6750
|
||||||
cp $6
|
cp $6
|
||||||
ret nz
|
ret nz
|
||||||
ld a, $1
|
ld a, $1
|
||||||
.asm_6755
|
.asm_6755
|
||||||
ld [wTopMenuItemX], a ; wTopMenuItemX
|
ld [wTopMenuItemX], a
|
||||||
jp EraseMenuCursor
|
jp EraseMenuCursor
|
||||||
|
|
||||||
LoadEDTile: ; 675b (1:675b)
|
LoadEDTile: ; 675b (1:675b)
|
||||||
|
|
@ -402,9 +402,9 @@ Func_680e: ; 680e (1:680e)
|
||||||
jr nz, .asm_6867
|
jr nz, .asm_6867
|
||||||
call EraseMenuCursor
|
call EraseMenuCursor
|
||||||
ld a, $11
|
ld a, $11
|
||||||
ld [wTopMenuItemX], a ; wTopMenuItemX
|
ld [wTopMenuItemX], a
|
||||||
ld a, $5
|
ld a, $5
|
||||||
ld [wCurrentMenuItem], a ; wCurrentMenuItem
|
ld [wCurrentMenuItem], a
|
||||||
ld a, [wd07d]
|
ld a, [wd07d]
|
||||||
cp $2
|
cp $2
|
||||||
ld a, $9
|
ld a, $9
|
||||||
|
|
@ -463,10 +463,10 @@ CalcStringLength: ; 68eb (1:68eb)
|
||||||
PrintNamingText: ; 68f8 (1:68f8)
|
PrintNamingText: ; 68f8 (1:68f8)
|
||||||
hlCoord 0, 1
|
hlCoord 0, 1
|
||||||
ld a, [wd07d]
|
ld a, [wd07d]
|
||||||
ld de, YourTextString ; $693f
|
ld de, YourTextString
|
||||||
and a
|
and a
|
||||||
jr z, .notNickname
|
jr z, .notNickname
|
||||||
ld de, RivalsTextString ; $6945
|
ld de, RivalsTextString
|
||||||
dec a
|
dec a
|
||||||
jr z, .notNickname
|
jr z, .notNickname
|
||||||
ld a, [wcf91]
|
ld a, [wcf91]
|
||||||
|
|
@ -482,13 +482,13 @@ PrintNamingText: ; 68f8 (1:68f8)
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], $c9
|
ld [hl], $c9
|
||||||
hlCoord 1, 3
|
hlCoord 1, 3
|
||||||
ld de, NicknameTextString ; $6953
|
ld de, NicknameTextString
|
||||||
jr .placeString
|
jr .placeString
|
||||||
.notNickname
|
.notNickname
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld l, c
|
ld l, c
|
||||||
ld h, b
|
ld h, b
|
||||||
ld de, NameTextString ; $694d
|
ld de, NameTextString
|
||||||
.placeString
|
.placeString
|
||||||
jp PlaceString
|
jp PlaceString
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,19 +83,19 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
|
||||||
push hl
|
push hl
|
||||||
ld bc,14 ; 14 columns to the right
|
ld bc,14 ; 14 columns to the right
|
||||||
add hl,bc
|
add hl,bc
|
||||||
ld de,wcf9c
|
ld de,wLoadedMonStatus
|
||||||
call PrintStatusCondition
|
call PrintStatusCondition
|
||||||
pop hl
|
pop hl
|
||||||
push hl
|
push hl
|
||||||
ld bc,20 + 1 ; down 1 row and right 1 column
|
ld bc,20 + 1 ; down 1 row and right 1 column
|
||||||
ld a,[$FFF6]
|
ld a,[hFlags_0xFFF6]
|
||||||
set 0,a
|
set 0,a
|
||||||
ld [$FFF6],a
|
ld [hFlags_0xFFF6],a
|
||||||
add hl,bc
|
add hl,bc
|
||||||
predef Func_128f6 ; draw HP bar and prints current / max HP
|
predef DrawHP2 ; draw HP bar and prints current / max HP
|
||||||
ld a,[$FFF6]
|
ld a,[hFlags_0xFFF6]
|
||||||
res 0,a
|
res 0,a
|
||||||
ld [$FFF6],a
|
ld [hFlags_0xFFF6],a
|
||||||
call SetPartyMenuHealthBarColor ; color the HP bar (on SGB)
|
call SetPartyMenuHealthBarColor ; color the HP bar (on SGB)
|
||||||
pop hl
|
pop hl
|
||||||
jr .printLevel
|
jr .printLevel
|
||||||
|
|
@ -134,7 +134,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
|
||||||
push hl
|
push hl
|
||||||
ld hl,EvosMovesPointerTable
|
ld hl,EvosMovesPointerTable
|
||||||
ld b,0
|
ld b,0
|
||||||
ld a,[wcf98] ; pokemon ID
|
ld a,[wLoadedMonSpecies]
|
||||||
dec a
|
dec a
|
||||||
add a
|
add a
|
||||||
rl b
|
rl b
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ PlayerPC: ; 78e6 (1:78e6)
|
||||||
ld hl, wd730
|
ld hl, wd730
|
||||||
set 6, [hl]
|
set 6, [hl]
|
||||||
ld a, ITEM_NAME
|
ld a, ITEM_NAME
|
||||||
ld [W_LISTTYPE], a
|
ld [wNameListType], a
|
||||||
call SaveScreenTilesToBuffer1
|
call SaveScreenTilesToBuffer1
|
||||||
xor a
|
xor a
|
||||||
ld [wcc2c], a
|
ld [wcc2c], a
|
||||||
|
|
@ -17,7 +17,7 @@ PlayerPC: ; 78e6 (1:78e6)
|
||||||
|
|
||||||
Func_790c: ; 790c (1:790c)
|
Func_790c: ; 790c (1:790c)
|
||||||
ld a, [wccd3]
|
ld a, [wccd3]
|
||||||
ld [wCurrentMenuItem], a ; wCurrentMenuItem
|
ld [wCurrentMenuItem], a
|
||||||
ld hl, wFlags_0xcd60
|
ld hl, wFlags_0xcd60
|
||||||
set 5, [hl]
|
set 5, [hl]
|
||||||
call LoadScreenTilesFromBuffer2
|
call LoadScreenTilesFromBuffer2
|
||||||
|
|
@ -27,9 +27,9 @@ Func_790c: ; 790c (1:790c)
|
||||||
call TextBoxBorder
|
call TextBoxBorder
|
||||||
call UpdateSprites
|
call UpdateSprites
|
||||||
hlCoord 2, 2
|
hlCoord 2, 2
|
||||||
ld de, PlayersPCMenuEntries ; $7af5
|
ld de, PlayersPCMenuEntries
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld hl, wTopMenuItemY ; wTopMenuItemY
|
ld hl, wTopMenuItemY
|
||||||
ld a, $2
|
ld a, $2
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
dec a
|
dec a
|
||||||
|
|
@ -42,17 +42,17 @@ Func_790c: ; 790c (1:790c)
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
xor a
|
xor a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld hl, wListScrollOffset ; wcc36
|
ld hl, wListScrollOffset
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld [wPlayerMonNumber], a ; wPlayerMonNumber
|
ld [wPlayerMonNumber], a
|
||||||
ld hl, WhatDoYouWantText
|
ld hl, WhatDoYouWantText
|
||||||
call PrintText
|
call PrintText
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
bit 1, a
|
bit 1, a
|
||||||
jp nz, Func_796d
|
jp nz, Func_796d
|
||||||
call PlaceUnfilledArrowMenuCursor
|
call PlaceUnfilledArrowMenuCursor
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
ld [wccd3], a
|
ld [wccd3], a
|
||||||
and a
|
and a
|
||||||
jp z, Func_7a12
|
jp z, Func_7a12
|
||||||
|
|
@ -73,7 +73,7 @@ Func_796d: ; 796d (1:796d)
|
||||||
res 5, [hl]
|
res 5, [hl]
|
||||||
call LoadScreenTilesFromBuffer2
|
call LoadScreenTilesFromBuffer2
|
||||||
xor a
|
xor a
|
||||||
ld [wListScrollOffset], a ; wcc36
|
ld [wListScrollOffset], a
|
||||||
ld [wcc2c], a
|
ld [wcc2c], a
|
||||||
ld hl, wd730
|
ld hl, wd730
|
||||||
res 6, [hl]
|
res 6, [hl]
|
||||||
|
|
@ -83,9 +83,9 @@ Func_796d: ; 796d (1:796d)
|
||||||
|
|
||||||
Func_7995: ; 7995 (1:7995)
|
Func_7995: ; 7995 (1:7995)
|
||||||
xor a
|
xor a
|
||||||
ld [wCurrentMenuItem], a ; wCurrentMenuItem
|
ld [wCurrentMenuItem], a
|
||||||
ld [wListScrollOffset], a ; wcc36
|
ld [wListScrollOffset], a
|
||||||
ld a, [wNumBagItems] ; wNumBagItems
|
ld a, [wNumBagItems]
|
||||||
and a
|
and a
|
||||||
jr nz, Func_79ab
|
jr nz, Func_79ab
|
||||||
ld hl, NothingToDepositText
|
ld hl, NothingToDepositText
|
||||||
|
|
@ -95,15 +95,15 @@ Func_7995: ; 7995 (1:7995)
|
||||||
Func_79ab: ; 79ab (1:79ab)
|
Func_79ab: ; 79ab (1:79ab)
|
||||||
ld hl, WhatToDepositText
|
ld hl, WhatToDepositText
|
||||||
call PrintText
|
call PrintText
|
||||||
ld hl, wNumBagItems ; wNumBagItems
|
ld hl, wNumBagItems
|
||||||
ld a, l
|
ld a, l
|
||||||
ld [wcf8b], a
|
ld [wList], a
|
||||||
ld a, h
|
ld a, h
|
||||||
ld [wcf8c], a
|
ld [wList + 1], a
|
||||||
xor a
|
xor a
|
||||||
ld [wcf93], a
|
ld [wcf93], a
|
||||||
ld a, $3
|
ld a, $3
|
||||||
ld [wListMenuID], a ; wListMenuID
|
ld [wListMenuID], a
|
||||||
call DisplayListMenuID
|
call DisplayListMenuID
|
||||||
jp c, Func_790c
|
jp c, Func_790c
|
||||||
call IsKeyItem
|
call IsKeyItem
|
||||||
|
|
@ -118,14 +118,14 @@ Func_79ab: ; 79ab (1:79ab)
|
||||||
cp $ff
|
cp $ff
|
||||||
jp z, Func_79ab
|
jp z, Func_79ab
|
||||||
.asm_79e7
|
.asm_79e7
|
||||||
ld hl, wNumBoxItems ; wNumBoxItems
|
ld hl, wNumBoxItems
|
||||||
call AddItemToInventory
|
call AddItemToInventory
|
||||||
jr c, .asm_79f8
|
jr c, .asm_79f8
|
||||||
ld hl, NoRoomToStoreText
|
ld hl, NoRoomToStoreText
|
||||||
call PrintText
|
call PrintText
|
||||||
jp Func_79ab
|
jp Func_79ab
|
||||||
.asm_79f8
|
.asm_79f8
|
||||||
ld hl, wNumBagItems ; wNumBagItems
|
ld hl, wNumBagItems
|
||||||
call RemoveItemFromInventory
|
call RemoveItemFromInventory
|
||||||
call WaitForSoundToFinish
|
call WaitForSoundToFinish
|
||||||
ld a, (SFX_02_55 - SFX_Headers_02) / 3
|
ld a, (SFX_02_55 - SFX_Headers_02) / 3
|
||||||
|
|
@ -137,9 +137,9 @@ Func_79ab: ; 79ab (1:79ab)
|
||||||
|
|
||||||
Func_7a12: ; 7a12 (1:7a12)
|
Func_7a12: ; 7a12 (1:7a12)
|
||||||
xor a
|
xor a
|
||||||
ld [wCurrentMenuItem], a ; wCurrentMenuItem
|
ld [wCurrentMenuItem], a
|
||||||
ld [wListScrollOffset], a ; wcc36
|
ld [wListScrollOffset], a
|
||||||
ld a, [wNumBoxItems] ; wNumBoxItems
|
ld a, [wNumBoxItems]
|
||||||
and a
|
and a
|
||||||
jr nz, Func_7a28
|
jr nz, Func_7a28
|
||||||
ld hl, NothingStoredText
|
ld hl, NothingStoredText
|
||||||
|
|
@ -149,15 +149,15 @@ Func_7a12: ; 7a12 (1:7a12)
|
||||||
Func_7a28: ; 7a28 (1:7a28)
|
Func_7a28: ; 7a28 (1:7a28)
|
||||||
ld hl, WhatToWithdrawText
|
ld hl, WhatToWithdrawText
|
||||||
call PrintText
|
call PrintText
|
||||||
ld hl, wNumBoxItems ; wNumBoxItems
|
ld hl, wNumBoxItems
|
||||||
ld a, l
|
ld a, l
|
||||||
ld [wcf8b], a
|
ld [wList], a
|
||||||
ld a, h
|
ld a, h
|
||||||
ld [wcf8c], a
|
ld [wList + 1], a
|
||||||
xor a
|
xor a
|
||||||
ld [wcf93], a
|
ld [wcf93], a
|
||||||
ld a, $3
|
ld a, $3
|
||||||
ld [wListMenuID], a ; wListMenuID
|
ld [wListMenuID], a
|
||||||
call DisplayListMenuID
|
call DisplayListMenuID
|
||||||
jp c, Func_790c
|
jp c, Func_790c
|
||||||
call IsKeyItem
|
call IsKeyItem
|
||||||
|
|
@ -172,14 +172,14 @@ Func_7a28: ; 7a28 (1:7a28)
|
||||||
cp $ff
|
cp $ff
|
||||||
jp z, Func_7a28
|
jp z, Func_7a28
|
||||||
.asm_7a64
|
.asm_7a64
|
||||||
ld hl, wNumBagItems ; wNumBagItems
|
ld hl, wNumBagItems
|
||||||
call AddItemToInventory
|
call AddItemToInventory
|
||||||
jr c, .asm_7a75
|
jr c, .asm_7a75
|
||||||
ld hl, CantCarryMoreText
|
ld hl, CantCarryMoreText
|
||||||
call PrintText
|
call PrintText
|
||||||
jp Func_7a28
|
jp Func_7a28
|
||||||
.asm_7a75
|
.asm_7a75
|
||||||
ld hl, wNumBoxItems ; wNumBoxItems
|
ld hl, wNumBoxItems
|
||||||
call RemoveItemFromInventory
|
call RemoveItemFromInventory
|
||||||
call WaitForSoundToFinish
|
call WaitForSoundToFinish
|
||||||
ld a, (SFX_02_55 - SFX_Headers_02) / 3
|
ld a, (SFX_02_55 - SFX_Headers_02) / 3
|
||||||
|
|
@ -191,9 +191,9 @@ Func_7a28: ; 7a28 (1:7a28)
|
||||||
|
|
||||||
Func_7a8f: ; 7a8f (1:7a8f)
|
Func_7a8f: ; 7a8f (1:7a8f)
|
||||||
xor a
|
xor a
|
||||||
ld [wCurrentMenuItem], a ; wCurrentMenuItem
|
ld [wCurrentMenuItem], a
|
||||||
ld [wListScrollOffset], a ; wcc36
|
ld [wListScrollOffset], a
|
||||||
ld a, [wNumBoxItems] ; wNumBoxItems
|
ld a, [wNumBoxItems]
|
||||||
and a
|
and a
|
||||||
jr nz, Func_7aa5
|
jr nz, Func_7aa5
|
||||||
ld hl, NothingStoredText
|
ld hl, NothingStoredText
|
||||||
|
|
@ -203,15 +203,15 @@ Func_7a8f: ; 7a8f (1:7a8f)
|
||||||
Func_7aa5: ; 7aa5 (1:7aa5)
|
Func_7aa5: ; 7aa5 (1:7aa5)
|
||||||
ld hl, WhatToTossText
|
ld hl, WhatToTossText
|
||||||
call PrintText
|
call PrintText
|
||||||
ld hl, wNumBoxItems ; wNumBoxItems
|
ld hl, wNumBoxItems
|
||||||
ld a, l
|
ld a, l
|
||||||
ld [wcf8b], a
|
ld [wList], a
|
||||||
ld a, h
|
ld a, h
|
||||||
ld [wcf8c], a
|
ld [wList + 1], a
|
||||||
xor a
|
xor a
|
||||||
ld [wcf93], a
|
ld [wcf93], a
|
||||||
ld a, $3
|
ld a, $3
|
||||||
ld [wListMenuID], a ; wListMenuID
|
ld [wListMenuID], a
|
||||||
push hl
|
push hl
|
||||||
call DisplayListMenuID
|
call DisplayListMenuID
|
||||||
pop hl
|
pop hl
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
|
||||||
call LoadGBPal
|
call LoadGBPal
|
||||||
jp RedisplayStartMenu
|
jp RedisplayStartMenu
|
||||||
.chosePokemon
|
.chosePokemon
|
||||||
call SaveScreenTilesToBuffer1 ; save screen
|
call SaveScreenTilesToBuffer1
|
||||||
ld a,$04
|
ld a,FIELD_MOVE_MON_MENU
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; display pokemon menu options
|
call DisplayTextBoxID ; display pokemon menu options
|
||||||
ld hl,wWhichTrade
|
ld hl,wWhichTrade
|
||||||
|
|
@ -308,10 +308,10 @@ StartMenu_Item: ; 13302 (4:7302)
|
||||||
jr .exitMenu
|
jr .exitMenu
|
||||||
.notInCableClubRoom
|
.notInCableClubRoom
|
||||||
ld bc,wNumBagItems
|
ld bc,wNumBagItems
|
||||||
ld hl,wcf8b
|
ld hl,wList
|
||||||
ld a,c
|
ld a,c
|
||||||
ld [hli],a
|
ld [hli],a
|
||||||
ld [hl],b ; store item bag pointer at wcf8b (for DisplayListMenuID)
|
ld [hl],b ; store item bag pointer at wList (for DisplayListMenuID)
|
||||||
xor a
|
xor a
|
||||||
ld [wcf93],a
|
ld [wcf93],a
|
||||||
ld a,ITEMLISTMENU
|
ld a,ITEMLISTMENU
|
||||||
|
|
@ -341,7 +341,7 @@ StartMenu_Item: ; 13302 (4:7302)
|
||||||
cp a,BICYCLE
|
cp a,BICYCLE
|
||||||
jp z,.useOrTossItem
|
jp z,.useOrTossItem
|
||||||
.notBicycle1
|
.notBicycle1
|
||||||
ld a,$06 ; use/toss menu
|
ld a,USE_TOSS_MENU_TEMPLATE
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
ld hl,wTopMenuItemY
|
ld hl,wTopMenuItemY
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,11 @@ StatusScreen: ; 12953 (4:6953)
|
||||||
ld a, [wcc49]
|
ld a, [wcc49]
|
||||||
cp $2 ; 2 means we're in a PC box
|
cp $2 ; 2 means we're in a PC box
|
||||||
jr c, .DontRecalculate ; 0x1295b $14
|
jr c, .DontRecalculate ; 0x1295b $14
|
||||||
ld a, [wcf9b]
|
ld a, [wLoadedMonBoxLevel]
|
||||||
ld [wcfb9], a
|
ld [wLoadedMonLevel], a
|
||||||
ld [W_CURENEMYLVL], a
|
ld [W_CURENEMYLVL], a
|
||||||
ld hl, wcfa8
|
ld hl, wLoadedMonHPExp - 1
|
||||||
ld de, wcfba
|
ld de, wLoadedMonStats
|
||||||
ld b, $1
|
ld b, $1
|
||||||
call CalcStats ; Recalculate stats
|
call CalcStats ; Recalculate stats
|
||||||
.DontRecalculate
|
.DontRecalculate
|
||||||
|
|
@ -55,13 +55,13 @@ StatusScreen: ; 12953 (4:6953)
|
||||||
ld de, Type1Text
|
ld de, Type1Text
|
||||||
call PlaceString ; "TYPE1/"
|
call PlaceString ; "TYPE1/"
|
||||||
hlCoord 11, 3
|
hlCoord 11, 3
|
||||||
predef DrawHP ; predef $5f
|
predef DrawHP
|
||||||
ld hl, wcf25
|
ld hl, wcf25
|
||||||
call GetHealthBarColor
|
call GetHealthBarColor
|
||||||
ld b, $3
|
ld b, $3
|
||||||
call GoPAL_SET ; SGB palette
|
call GoPAL_SET ; SGB palette
|
||||||
hlCoord 16, 6
|
hlCoord 16, 6
|
||||||
ld de, wcf9c
|
ld de, wLoadedMonStatus
|
||||||
call PrintStatusCondition
|
call PrintStatusCondition
|
||||||
jr nz, .StatusWritten ; 0x129fc $9
|
jr nz, .StatusWritten ; 0x129fc $9
|
||||||
hlCoord 16, 6
|
hlCoord 16, 6
|
||||||
|
|
@ -82,7 +82,7 @@ StatusScreen: ; 12953 (4:6953)
|
||||||
ld bc, $8103 ; Zero-padded, 3
|
ld bc, $8103 ; Zero-padded, 3
|
||||||
call PrintNumber ; Pokémon no.
|
call PrintNumber ; Pokémon no.
|
||||||
hlCoord 11, 10
|
hlCoord 11, 10
|
||||||
predef Func_27d6b ; Prints the type (?)
|
predef PrintMonType
|
||||||
ld hl, NamePointers2 ; $6a9d
|
ld hl, NamePointers2 ; $6a9d
|
||||||
call .unk_12a7e
|
call .unk_12a7e
|
||||||
ld d, h
|
ld d, h
|
||||||
|
|
@ -96,7 +96,7 @@ StatusScreen: ; 12953 (4:6953)
|
||||||
hlCoord 12, 16
|
hlCoord 12, 16
|
||||||
call PlaceString ; OT
|
call PlaceString ; OT
|
||||||
hlCoord 12, 14
|
hlCoord 12, 14
|
||||||
ld de, wcfa4
|
ld de, wLoadedMonOTID
|
||||||
ld bc, $8205 ; 5
|
ld bc, $8205 ; 5
|
||||||
call PrintNumber ; ID Number
|
call PrintNumber ; ID Number
|
||||||
ld d, $0
|
ld d, $0
|
||||||
|
|
@ -203,14 +203,14 @@ PrintStatsBox: ; 12ae4 (4:6ae4)
|
||||||
pop hl
|
pop hl
|
||||||
pop bc
|
pop bc
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld de, wcfbc
|
ld de, wLoadedMonAttack
|
||||||
ld bc, $0203 ; three digits
|
ld bc, $0203 ; three digits
|
||||||
call PrintStat
|
call PrintStat
|
||||||
ld de, wcfbe
|
ld de, wLoadedMonDefense
|
||||||
call PrintStat
|
call PrintStat
|
||||||
ld de, wcfc0
|
ld de, wLoadedMonSpeed
|
||||||
call PrintStat
|
call PrintStat
|
||||||
ld de, wcfc2
|
ld de, wLoadedMonSpecial
|
||||||
jp PrintNumber
|
jp PrintNumber
|
||||||
PrintStat
|
PrintStat
|
||||||
push hl
|
push hl
|
||||||
|
|
@ -233,13 +233,13 @@ StatusScreen2: ; 12b57 (4:6b57)
|
||||||
ld [hTilesetType], a
|
ld [hTilesetType], a
|
||||||
ld [$ffba], a
|
ld [$ffba], a
|
||||||
ld bc, $0005
|
ld bc, $0005
|
||||||
ld hl, wd0dc
|
ld hl, wMoves
|
||||||
call FillMemory
|
call FillMemory
|
||||||
ld hl, wcfa0
|
ld hl, wLoadedMonMoves
|
||||||
ld de, wd0dc
|
ld de, wMoves
|
||||||
ld bc, $0004
|
ld bc, NUM_MOVES
|
||||||
call CopyData
|
call CopyData
|
||||||
callab Func_39b87
|
callab FormatMovesString
|
||||||
hlCoord 9, 2
|
hlCoord 9, 2
|
||||||
ld bc, $050a
|
ld bc, $050a
|
||||||
call ClearScreenArea ; Clear under name
|
call ClearScreenArea ; Clear under name
|
||||||
|
|
@ -250,7 +250,7 @@ StatusScreen2: ; 12b57 (4:6b57)
|
||||||
ld c, $12
|
ld c, $12
|
||||||
call TextBoxBorder ; Draw move container
|
call TextBoxBorder ; Draw move container
|
||||||
hlCoord 2, 9
|
hlCoord 2, 9
|
||||||
ld de, wd0e1
|
ld de, wMovesString
|
||||||
call PlaceString ; Print moves
|
call PlaceString ; Print moves
|
||||||
ld a, [wcd6c]
|
ld a, [wcd6c]
|
||||||
inc a
|
inc a
|
||||||
|
|
@ -269,7 +269,7 @@ StatusScreen2: ; 12b57 (4:6b57)
|
||||||
ld a, "-"
|
ld a, "-"
|
||||||
call Func_12ccb ; Fill the rest with --
|
call Func_12ccb ; Fill the rest with --
|
||||||
.InitPP ; 12bbb
|
.InitPP ; 12bbb
|
||||||
ld hl, wcfa0
|
ld hl, wLoadedMonMoves
|
||||||
deCoord 14, 10
|
deCoord 14, 10
|
||||||
ld b, $0
|
ld b, $0
|
||||||
.PrintPP ; 12bc3
|
.PrintPP ; 12bc3
|
||||||
|
|
@ -323,12 +323,12 @@ StatusScreen2: ; 12b57 (4:6b57)
|
||||||
hlCoord 9, 3
|
hlCoord 9, 3
|
||||||
ld de, EXPPointsText
|
ld de, EXPPointsText
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld a, [wcfb9] ; level
|
ld a, [wLoadedMonLevel] ; level
|
||||||
push af
|
push af
|
||||||
cp MAX_LEVEL
|
cp MAX_LEVEL
|
||||||
jr z, .Level100 ; 0x12c20 $4
|
jr z, .Level100 ; 0x12c20 $4
|
||||||
inc a
|
inc a
|
||||||
ld [wcfb9], a ; Increase temporarily if not 100
|
ld [wLoadedMonLevel], a ; Increase temporarily if not 100
|
||||||
.Level100
|
.Level100
|
||||||
hlCoord 14, 6
|
hlCoord 14, 6
|
||||||
ld [hl], $70 ; 1-tile "to"
|
ld [hl], $70 ; 1-tile "to"
|
||||||
|
|
@ -336,13 +336,13 @@ StatusScreen2: ; 12b57 (4:6b57)
|
||||||
inc hl
|
inc hl
|
||||||
call PrintLevel
|
call PrintLevel
|
||||||
pop af
|
pop af
|
||||||
ld [wcfb9], a
|
ld [wLoadedMonLevel], a
|
||||||
ld de, wcfa6
|
ld de, wLoadedMonExp
|
||||||
hlCoord 12, 4
|
hlCoord 12, 4
|
||||||
ld bc, $0307
|
ld bc, $0307
|
||||||
call PrintNumber ; exp
|
call PrintNumber ; exp
|
||||||
call .asm_12c86
|
call .asm_12c86
|
||||||
ld de, wcfa6
|
ld de, wLoadedMonExp
|
||||||
hlCoord 7, 6
|
hlCoord 7, 6
|
||||||
ld bc, $0307
|
ld bc, $0307
|
||||||
call PrintNumber
|
call PrintNumber
|
||||||
|
|
@ -368,13 +368,13 @@ StatusScreen2: ; 12b57 (4:6b57)
|
||||||
call GBPalWhiteOut
|
call GBPalWhiteOut
|
||||||
jp ClearScreen
|
jp ClearScreen
|
||||||
.asm_12c86 ; This does some magic with lvl/exp?
|
.asm_12c86 ; This does some magic with lvl/exp?
|
||||||
ld a, [wcfb9] ; Load level
|
ld a, [wLoadedMonLevel] ; Load level
|
||||||
cp MAX_LEVEL
|
cp MAX_LEVEL
|
||||||
jr z, .asm_12ca7 ; 0x12c8b $1a ; If 100
|
jr z, .asm_12ca7 ; 0x12c8b $1a ; If 100
|
||||||
inc a
|
inc a
|
||||||
ld d, a
|
ld d, a
|
||||||
callab CalcExperience
|
callab CalcExperience
|
||||||
ld hl, wcfa8
|
ld hl, wLoadedMonExp + 2
|
||||||
ld a, [$ff98]
|
ld a, [$ff98]
|
||||||
sub [hl]
|
sub [hl]
|
||||||
ld [hld], a
|
ld [hld], a
|
||||||
|
|
@ -386,7 +386,7 @@ StatusScreen2: ; 12b57 (4:6b57)
|
||||||
ld [hld], a
|
ld [hld], a
|
||||||
ret
|
ret
|
||||||
.asm_12ca7
|
.asm_12ca7
|
||||||
ld hl, wcfa6
|
ld hl, wLoadedMonExp
|
||||||
xor a
|
xor a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
VendingMachineMenu: ; 74ee0 (1d:4ee0)
|
VendingMachineMenu: ; 74ee0 (1d:4ee0)
|
||||||
ld hl, VendingMachineText1
|
ld hl, VendingMachineText1
|
||||||
call PrintText
|
call PrintText
|
||||||
ld a, $13
|
ld a, MONEY_BOX
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
xor a
|
xor a
|
||||||
ld [wCurrentMenuItem], a ; wCurrentMenuItem
|
ld [wCurrentMenuItem], a
|
||||||
ld [wLastMenuItem], a ; wLastMenuItem
|
ld [wLastMenuItem], a
|
||||||
ld a, $3
|
ld a, $3
|
||||||
ld [wMenuWatchedKeys], a ; wMenuWatchedKeys
|
ld [wMenuWatchedKeys], a
|
||||||
ld a, $3
|
ld a, $3
|
||||||
ld [wMaxMenuItem], a ; wMaxMenuItem
|
ld [wMaxMenuItem], a
|
||||||
ld a, $5
|
ld a, $5
|
||||||
ld [wTopMenuItemY], a ; wTopMenuItemY
|
ld [wTopMenuItemY], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wTopMenuItemX], a ; wTopMenuItemX
|
ld [wTopMenuItemX], a
|
||||||
ld hl, wd730
|
ld hl, wd730
|
||||||
set 6, [hl]
|
set 6, [hl]
|
||||||
hlCoord 0, 3
|
hlCoord 0, 3
|
||||||
|
|
@ -33,7 +33,7 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0)
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
bit 1, a
|
bit 1, a
|
||||||
jr nz, .asm_74f93
|
jr nz, .asm_74f93
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
cp $3
|
cp $3
|
||||||
jr z, .asm_74f93
|
jr z, .asm_74f93
|
||||||
xor a
|
xor a
|
||||||
|
|
@ -66,10 +66,10 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0)
|
||||||
ld hl, VendingMachineText5
|
ld hl, VendingMachineText5
|
||||||
call PrintText
|
call PrintText
|
||||||
ld hl, $ffde
|
ld hl, $ffde
|
||||||
ld de, wPlayerMoney + 2 ; wd349
|
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
|
||||||
jp DisplayTextBoxID
|
jp DisplayTextBoxID
|
||||||
.BagFull
|
.BagFull
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ AnimateHealingMachine: ; 70433 (1c:4433)
|
||||||
ld [wc0ee], a
|
ld [wc0ee], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
ld d, $28
|
ld d, $28
|
||||||
call Func_704f3
|
call FlashSprite8Times
|
||||||
.asm_704a2
|
.asm_704a2
|
||||||
ld a, [wc026]
|
ld a, [wc026]
|
||||||
cp MUSIC_PKMN_HEALED
|
cp MUSIC_PKMN_HEALED
|
||||||
|
|
@ -74,16 +74,17 @@ PokeCenterOAMData: ; 704d7 (1c:44d7)
|
||||||
db $35,$30,$7D,$10
|
db $35,$30,$7D,$10
|
||||||
db $35,$38,$7D,$30
|
db $35,$38,$7D,$30
|
||||||
|
|
||||||
Func_704f3: ; 704f3 (1c:44f3)
|
; d = value to xor with palette
|
||||||
ld b, $8
|
FlashSprite8Times: ; 704f3 (1c:44f3)
|
||||||
.asm_704f5
|
ld b, 8
|
||||||
ld a, [rOBP1] ; $ff49
|
.loop
|
||||||
|
ld a, [rOBP1]
|
||||||
xor d
|
xor d
|
||||||
ld [rOBP1], a ; $ff49
|
ld [rOBP1], a
|
||||||
ld c, $a
|
ld c, 10
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
dec b
|
dec b
|
||||||
jr nz, .asm_704f5
|
jr nz, .loop
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_70503: ; 70503 (1c:4503)
|
Func_70503: ; 70503 (1c:4503)
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,7 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871)
|
||||||
ld l,e
|
ld l,e
|
||||||
pop de
|
pop de
|
||||||
ld b,a
|
ld b,a
|
||||||
ld a,[wcfc4]
|
ld a,[wFontLoaded]
|
||||||
bit 0,a ; reloading upper half of tile patterns after displaying text?
|
bit 0,a ; reloading upper half of tile patterns after displaying text?
|
||||||
jr nz,.skipFirstLoad ; if so, skip loading data into the lower half
|
jr nz,.skipFirstLoad ; if so, skip loading data into the lower half
|
||||||
ld a,b
|
ld a,b
|
||||||
|
|
@ -180,7 +180,7 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871)
|
||||||
jr nc,.noCarry3
|
jr nc,.noCarry3
|
||||||
inc d
|
inc d
|
||||||
.noCarry3
|
.noCarry3
|
||||||
ld a,[wcfc4]
|
ld a,[wFontLoaded]
|
||||||
bit 0,a ; reloading upper half of tile patterns after displaying text?
|
bit 0,a ; reloading upper half of tile patterns after displaying text?
|
||||||
jr nz,.loadWhileLCDOn
|
jr nz,.loadWhileLCDOn
|
||||||
pop af
|
pop af
|
||||||
|
|
@ -264,7 +264,7 @@ InitOutsideMapSprites: ; 1797b (5:797b)
|
||||||
cp a,$f0 ; does the map have 2 sprite sets?
|
cp a,$f0 ; does the map have 2 sprite sets?
|
||||||
call nc,GetSplitMapSpriteSetID ; if so, choose the appropriate one
|
call nc,GetSplitMapSpriteSetID ; if so, choose the appropriate one
|
||||||
ld b,a ; b = spriteSetID
|
ld b,a ; b = spriteSetID
|
||||||
ld a,[wcfc4]
|
ld a,[wFontLoaded]
|
||||||
bit 0,a ; reloading upper half of tile patterns after displaying text?
|
bit 0,a ; reloading upper half of tile patterns after displaying text?
|
||||||
jr nz,.loadSpriteSet ; if so, forcibly reload the sprite set
|
jr nz,.loadSpriteSet ; if so, forcibly reload the sprite set
|
||||||
ld a,[W_SPRITESETID]
|
ld a,[W_SPRITESETID]
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ UpdatePlayerSprite: ; 4e31 (1:4e31)
|
||||||
jr .asm_4eab
|
jr .asm_4eab
|
||||||
.asm_4e86
|
.asm_4e86
|
||||||
ld [wSpriteStateData1 + 9], a
|
ld [wSpriteStateData1 + 9], a
|
||||||
ld a, [wcfc4]
|
ld a, [wFontLoaded]
|
||||||
bit 0, a
|
bit 0, a
|
||||||
jr nz, .asm_4e7d
|
jr nz, .asm_4e7d
|
||||||
.asm_4e90
|
.asm_4e90
|
||||||
|
|
@ -130,7 +130,7 @@ Func_4ed1: ; 4ed1 (1:4ed1)
|
||||||
bit 7, a
|
bit 7, a
|
||||||
jp nz, InitializeSpriteFacingDirection ; c1x1 >= $80
|
jp nz, InitializeSpriteFacingDirection ; c1x1 >= $80
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [wcfc4]
|
ld a, [wFontLoaded]
|
||||||
bit 0, a
|
bit 0, a
|
||||||
jp nz, notYetMoving
|
jp nz, notYetMoving
|
||||||
ld a, b
|
ld a, b
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
|
||||||
ld [wPlayerMonNumber],a
|
ld [wPlayerMonNumber],a
|
||||||
inc a
|
inc a
|
||||||
ld [wcf93],a
|
ld [wcf93],a
|
||||||
ld a,$13
|
ld a,MONEY_BOX
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; draw money text box
|
call DisplayTextBoxID ; draw money text box
|
||||||
ld a,$15
|
ld a,BUY_SELL_QUIT_MENU
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; do buy/sell/quit menu
|
call DisplayTextBoxID ; do buy/sell/quit menu
|
||||||
ld hl,wd128 ; pointer to this pokemart's inventory
|
ld hl,wd128 ; pointer to this pokemart's inventory
|
||||||
|
|
@ -45,14 +45,14 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
|
||||||
call SaveScreenTilesToBuffer1 ; save screen
|
call SaveScreenTilesToBuffer1 ; save screen
|
||||||
.sellMenuLoop
|
.sellMenuLoop
|
||||||
call LoadScreenTilesFromBuffer1 ; restore saved screen
|
call LoadScreenTilesFromBuffer1 ; restore saved screen
|
||||||
ld a,$13
|
ld a,MONEY_BOX
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; draw money text box
|
call DisplayTextBoxID ; draw money text box
|
||||||
ld hl,wNumBagItems
|
ld hl,wNumBagItems
|
||||||
ld a,l
|
ld a,l
|
||||||
ld [wcf8b],a
|
ld [wList],a
|
||||||
ld a,h
|
ld a,h
|
||||||
ld [wcf8c],a
|
ld [wList + 1],a
|
||||||
xor a
|
xor a
|
||||||
ld [wcf93],a
|
ld [wcf93],a
|
||||||
ld [wCurrentMenuItem],a
|
ld [wCurrentMenuItem],a
|
||||||
|
|
@ -79,7 +79,7 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
|
||||||
call PrintText
|
call PrintText
|
||||||
hlCoord 14, 7
|
hlCoord 14, 7
|
||||||
ld bc,$080f
|
ld bc,$080f
|
||||||
ld a,$14
|
ld a,TWO_OPTION_MENU
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; yes/no menu
|
call DisplayTextBoxID ; yes/no menu
|
||||||
ld a,[wd12e]
|
ld a,[wd12e]
|
||||||
|
|
@ -119,14 +119,14 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
|
||||||
call SaveScreenTilesToBuffer1 ; save screen
|
call SaveScreenTilesToBuffer1 ; save screen
|
||||||
.buyMenuLoop
|
.buyMenuLoop
|
||||||
call LoadScreenTilesFromBuffer1 ; restore saved screen
|
call LoadScreenTilesFromBuffer1 ; restore saved screen
|
||||||
ld a,$13
|
ld a,MONEY_BOX
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; draw money text box
|
call DisplayTextBoxID ; draw money text box
|
||||||
ld hl,wStringBuffer2 + 11
|
ld hl,wStringBuffer2 + 11
|
||||||
ld a,l
|
ld a,l
|
||||||
ld [wcf8b],a
|
ld [wList],a
|
||||||
ld a,h
|
ld a,h
|
||||||
ld [wcf8c],a
|
ld [wList + 1],a
|
||||||
xor a
|
xor a
|
||||||
ld [wCurrentMenuItem],a
|
ld [wCurrentMenuItem],a
|
||||||
inc a
|
inc a
|
||||||
|
|
@ -150,7 +150,7 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
|
||||||
call PrintText
|
call PrintText
|
||||||
hlCoord 14, 7
|
hlCoord 14, 7
|
||||||
ld bc,$080f
|
ld bc,$080f
|
||||||
ld a,$14
|
ld a,TWO_OPTION_MENU
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; yes/no menu
|
call DisplayTextBoxID ; yes/no menu
|
||||||
ld a,[wd12e]
|
ld a,[wd12e]
|
||||||
|
|
@ -180,7 +180,7 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
|
||||||
jp .buyMenuLoop
|
jp .buyMenuLoop
|
||||||
.returnToMainPokemartMenu
|
.returnToMainPokemartMenu
|
||||||
call LoadScreenTilesFromBuffer1
|
call LoadScreenTilesFromBuffer1
|
||||||
ld a,$13
|
ld a,MONEY_BOX
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; draw money text box
|
call DisplayTextBoxID ; draw money text box
|
||||||
ld hl,PokemartAnythingElseText
|
ld hl,PokemartAnythingElseText
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ PredefPointers:: ; 4fe79 (13:7e79)
|
||||||
add_predef UpdateHPBar
|
add_predef UpdateHPBar
|
||||||
add_predef HPBarLength
|
add_predef HPBarLength
|
||||||
add_predef Diploma_TextBoxBorder
|
add_predef Diploma_TextBoxBorder
|
||||||
add_predef Func_3ed02
|
add_predef DoubleOrHalveSelectedStats
|
||||||
add_predef ShowPokedexMenu
|
add_predef ShowPokedexMenu
|
||||||
add_predef EvolutionAfterBattle
|
add_predef EvolutionAfterBattle
|
||||||
add_predef SaveSAVtoSRAM0
|
add_predef SaveSAVtoSRAM0
|
||||||
|
|
@ -127,7 +127,7 @@ PredefPointers:: ; 4fe79 (13:7e79)
|
||||||
add_predef UpdateHPBar2
|
add_predef UpdateHPBar2
|
||||||
add_predef DrawEnemyHUDAndHPBar
|
add_predef DrawEnemyHUDAndHPBar
|
||||||
add_predef LoadTownMap_Nest
|
add_predef LoadTownMap_Nest
|
||||||
add_predef Func_27d6b
|
add_predef PrintMonType
|
||||||
add_predef EmotionBubble; 4C player exclamation
|
add_predef EmotionBubble; 4C player exclamation
|
||||||
add_predef EmptyFunc3; return immediately
|
add_predef EmptyFunc3; return immediately
|
||||||
add_predef AskName
|
add_predef AskName
|
||||||
|
|
@ -145,9 +145,9 @@ PredefPointers:: ; 4fe79 (13:7e79)
|
||||||
add_predef CheckForCollisionWhenPushingBoulder
|
add_predef CheckForCollisionWhenPushingBoulder
|
||||||
add_predef PrintStrengthTxt
|
add_predef PrintStrengthTxt
|
||||||
add_predef PickupItem
|
add_predef PickupItem
|
||||||
add_predef Func_27d98
|
add_predef PrintMoveType
|
||||||
add_predef LoadMovePPs
|
add_predef LoadMovePPs
|
||||||
add_predef DrawHP ; 5F
|
add_predef DrawHP ; 5F
|
||||||
add_predef Func_128f6
|
add_predef DrawHP2
|
||||||
add_predef Func_1c9c6
|
add_predef Func_1c9c6
|
||||||
add_predef OaksAideScript
|
add_predef OaksAideScript
|
||||||
|
|
|
||||||
|
|
@ -3,26 +3,26 @@ Func_1c9c6: ; 1c9c6 (7:49c6)
|
||||||
call PrintText
|
call PrintText
|
||||||
ld hl, wStringBuffer2 + 11
|
ld hl, wStringBuffer2 + 11
|
||||||
ld a, l
|
ld a, l
|
||||||
ld [wcf8b], a
|
ld [wList], a
|
||||||
ld a, h
|
ld a, h
|
||||||
ld [wcf8c], a
|
ld [wList + 1], a
|
||||||
ld a, [wListScrollOffset] ; wcc36
|
ld a, [wListScrollOffset]
|
||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
ld [wCurrentMenuItem], a ; wCurrentMenuItem
|
ld [wCurrentMenuItem], a
|
||||||
ld [wListScrollOffset], a ; wcc36
|
ld [wListScrollOffset], a
|
||||||
ld [wcf93], a
|
ld [wcf93], a
|
||||||
ld a, $4
|
ld a, $4
|
||||||
ld [wListMenuID], a ; wListMenuID
|
ld [wListMenuID], a
|
||||||
call DisplayListMenuID
|
call DisplayListMenuID
|
||||||
pop bc
|
pop bc
|
||||||
ld a, b
|
ld a, b
|
||||||
ld [wListScrollOffset], a ; wcc36
|
ld [wListScrollOffset], a
|
||||||
ret c
|
ret c
|
||||||
ld hl, wd126
|
ld hl, wd126
|
||||||
set 7, [hl]
|
set 7, [hl]
|
||||||
ld hl, wcc5b
|
ld hl, wcc5b
|
||||||
ld a, [wWhichPokemon] ; wWhichPokemon
|
ld a, [wWhichPokemon]
|
||||||
add a
|
add a
|
||||||
ld d, $0
|
ld d, $0
|
||||||
ld e, a
|
ld e, a
|
||||||
|
|
|
||||||
|
|
@ -173,10 +173,10 @@ NowSavingString:
|
||||||
SaveSAVConfirm: ; 73768 (1c:7768)
|
SaveSAVConfirm: ; 73768 (1c:7768)
|
||||||
call PrintText
|
call PrintText
|
||||||
hlCoord 0, 7
|
hlCoord 0, 7
|
||||||
ld bc,$0801 ;arrow's coordinates |b = Y|c = X|
|
ld bc,$0801
|
||||||
ld a,$14 ;one line shifting ($28 = 2 lines)
|
ld a,TWO_OPTION_MENU
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ;handle Yes/No KeyPress
|
call DisplayTextBoxID ; yes/no menu
|
||||||
ld a,[wCurrentMenuItem]
|
ld a,[wCurrentMenuItem]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
@ -346,10 +346,10 @@ ChangeBox:: ; 738a1 (1c:78a1)
|
||||||
call z, Func_73a29
|
call z, Func_73a29
|
||||||
call Func_7393f
|
call Func_7393f
|
||||||
call UpdateSprites
|
call UpdateSprites
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
set 1, [hl]
|
set 1, [hl]
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
res 1, [hl]
|
res 1, [hl]
|
||||||
bit 1, a
|
bit 1, a
|
||||||
ret nz
|
ret nz
|
||||||
|
|
@ -436,12 +436,12 @@ Func_7393f: ; 7393f (1c:793f)
|
||||||
ld b, $c
|
ld b, $c
|
||||||
ld c, $7
|
ld c, $7
|
||||||
call TextBoxBorder
|
call TextBoxBorder
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
set 2, [hl]
|
set 2, [hl]
|
||||||
ld de, BoxNames ; $79d9
|
ld de, BoxNames ; $79d9
|
||||||
hlCoord 13, 1
|
hlCoord 13, 1
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
res 2, [hl]
|
res 2, [hl]
|
||||||
ld a, [wd5a0]
|
ld a, [wd5a0]
|
||||||
and $7f
|
and $7f
|
||||||
|
|
@ -665,7 +665,7 @@ HallOfFame_Copy: ; 73b51 (1c:7b51)
|
||||||
ld [MBC1SRamEnable], a
|
ld [MBC1SRamEnable], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_73b6a: ; 73b6a (1c:7b6a)
|
ClearSAV: ; 73b6a (1c:7b6a)
|
||||||
ld a, SRAM_ENABLE
|
ld a, SRAM_ENABLE
|
||||||
ld [MBC1SRamEnable], a
|
ld [MBC1SRamEnable], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ MainSlotMachineLoop: ; 37395 (d:7395)
|
||||||
ld bc, $0d0f
|
ld bc, $0d0f
|
||||||
xor a ; YES_NO_MENU
|
xor a ; YES_NO_MENU
|
||||||
ld [wTwoOptionMenuID], a
|
ld [wTwoOptionMenuID], a
|
||||||
ld a, $14
|
ld a, TWO_OPTION_MENU
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
ld a, [wCurrentMenuItem]
|
ld a, [wCurrentMenuItem]
|
||||||
|
|
|
||||||
|
|
@ -237,14 +237,14 @@ ENDC
|
||||||
call LoadGBPal
|
call LoadGBPal
|
||||||
ld a, [hJoyHeld]
|
ld a, [hJoyHeld]
|
||||||
ld b, a
|
ld b, a
|
||||||
and $46
|
and D_UP | SELECT | B_BUTTON
|
||||||
cp $46
|
cp D_UP | SELECT | B_BUTTON
|
||||||
jp z, Func_448e
|
jp z, .doClearSaveDialogue
|
||||||
jp MainMenu
|
jp MainMenu
|
||||||
|
|
||||||
Func_448e: ; 448e (1:448e)
|
.doClearSaveDialogue
|
||||||
ld b, BANK(Func_1c98a)
|
ld b, BANK(DoClearSaveDialogue)
|
||||||
ld hl, Func_1c98a
|
ld hl, DoClearSaveDialogue
|
||||||
jp Bankswitch
|
jp Bankswitch
|
||||||
|
|
||||||
Func_4496: ; 4496 (1:4496)
|
Func_4496: ; 4496 (1:4496)
|
||||||
|
|
|
||||||
|
|
@ -364,10 +364,10 @@ Func_711c4: ; 711c4 (1c:51c4)
|
||||||
jp CopyData
|
jp CopyData
|
||||||
|
|
||||||
Func_711ef: ; 711ef (1c:51ef)
|
Func_711ef: ; 711ef (1c:51ef)
|
||||||
callba Func_e9cb
|
callba FindWildLocationsOfMon
|
||||||
call Func_712d9
|
call Func_712d9
|
||||||
ld hl, wOAMBuffer
|
ld hl, wOAMBuffer
|
||||||
ld de, wHPBarMaxHP
|
ld de, wBuffer
|
||||||
.asm_71200
|
.asm_71200
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
cp $ff
|
cp $ff
|
||||||
|
|
|
||||||
88
home.asm
88
home.asm
|
|
@ -173,7 +173,7 @@ LoadDestinationWarpPosition:: ; 1313 (0:1313)
|
||||||
DrawHPBar:: ; 1336 (0:1336)
|
DrawHPBar:: ; 1336 (0:1336)
|
||||||
; Draw an HP bar d tiles long, and fill it to e pixels.
|
; Draw an HP bar d tiles long, and fill it to e pixels.
|
||||||
; If c is nonzero, show at least a sliver regardless.
|
; If c is nonzero, show at least a sliver regardless.
|
||||||
; The right end of the bar changes with [wListMenuID].
|
; The right end of the bar changes with [wHPBarType].
|
||||||
|
|
||||||
push hl
|
push hl
|
||||||
push de
|
push de
|
||||||
|
|
@ -195,7 +195,7 @@ DrawHPBar:: ; 1336 (0:1336)
|
||||||
jr nz, .draw
|
jr nz, .draw
|
||||||
|
|
||||||
; Right
|
; Right
|
||||||
ld a,[wListMenuID]
|
ld a,[wHPBarType]
|
||||||
dec a
|
dec a
|
||||||
ld a, $6d ; status screen and battle
|
ld a, $6d ; status screen and battle
|
||||||
jr z, .ok
|
jr z, .ok
|
||||||
|
|
@ -239,7 +239,7 @@ DrawHPBar:: ; 1336 (0:1336)
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
; loads pokemon data from one of multiple sources to wcf98
|
; loads pokemon data from one of multiple sources to wLoadedMon
|
||||||
; loads base stats to W_MONHDEXNUM
|
; loads base stats to W_MONHDEXNUM
|
||||||
; INPUT:
|
; INPUT:
|
||||||
; [wWhichPokemon] = index of pokemon within party/box
|
; [wWhichPokemon] = index of pokemon within party/box
|
||||||
|
|
@ -250,7 +250,7 @@ DrawHPBar:: ; 1336 (0:1336)
|
||||||
; 03: daycare
|
; 03: daycare
|
||||||
; OUTPUT:
|
; OUTPUT:
|
||||||
; [wcf91] = pokemon ID
|
; [wcf91] = pokemon ID
|
||||||
; wcf98 = base address of pokemon data
|
; wLoadedMon = base address of pokemon data
|
||||||
; W_MONHDEXNUM = base address of base stats
|
; W_MONHDEXNUM = base address of base stats
|
||||||
LoadMonData:: ; 1372 (0:1372)
|
LoadMonData:: ; 1372 (0:1372)
|
||||||
ld hl, LoadMonData_
|
ld hl, LoadMonData_
|
||||||
|
|
@ -259,8 +259,8 @@ LoadMonData:: ; 1372 (0:1372)
|
||||||
|
|
||||||
|
|
||||||
Func_137a:: ; 137a (0:137a)
|
Func_137a:: ; 137a (0:137a)
|
||||||
; Write c to [wd0dc + b]. Unused.
|
; Write c to [wMoves + b]. Unused.
|
||||||
ld hl, wd0dc
|
ld hl, wMoves
|
||||||
ld e, b
|
ld e, b
|
||||||
ld d, 0
|
ld d, 0
|
||||||
add hl, de
|
add hl, de
|
||||||
|
|
@ -515,12 +515,12 @@ PrintStatusConditionNotFainted ; 14f6
|
||||||
; function to print pokemon level, leaving off the ":L" if the level is at least 100
|
; function to print pokemon level, leaving off the ":L" if the level is at least 100
|
||||||
; INPUT:
|
; INPUT:
|
||||||
; hl = destination address
|
; hl = destination address
|
||||||
; [wcfb9] = level
|
; [wLoadedMonLevel] = level
|
||||||
PrintLevel:: ; 150b (0:150b)
|
PrintLevel:: ; 150b (0:150b)
|
||||||
ld a,$6e ; ":L" tile ID
|
ld a,$6e ; ":L" tile ID
|
||||||
ld [hli],a
|
ld [hli],a
|
||||||
ld c,2 ; number of digits
|
ld c,2 ; number of digits
|
||||||
ld a,[wcfb9] ; level
|
ld a,[wLoadedMonLevel] ; level
|
||||||
cp a,100
|
cp a,100
|
||||||
jr c,PrintLevelCommon
|
jr c,PrintLevelCommon
|
||||||
; if level at least 100, write over the ":L" tile
|
; if level at least 100, write over the ":L" tile
|
||||||
|
|
@ -531,12 +531,12 @@ PrintLevel:: ; 150b (0:150b)
|
||||||
; prints the level without leaving off ":L" regardless of level
|
; prints the level without leaving off ":L" regardless of level
|
||||||
; INPUT:
|
; INPUT:
|
||||||
; hl = destination address
|
; hl = destination address
|
||||||
; [wcfb9] = level
|
; [wLoadedMonLevel] = level
|
||||||
PrintLevelFull:: ; 151b (0:151b)
|
PrintLevelFull:: ; 151b (0:151b)
|
||||||
ld a,$6e ; ":L" tile ID
|
ld a,$6e ; ":L" tile ID
|
||||||
ld [hli],a
|
ld [hli],a
|
||||||
ld c,3 ; number of digits
|
ld c,3 ; number of digits
|
||||||
ld a,[wcfb9] ; level
|
ld a,[wLoadedMonLevel] ; level
|
||||||
|
|
||||||
PrintLevelCommon:: ; 1523 (0:1523)
|
PrintLevelCommon:: ; 1523 (0:1523)
|
||||||
ld [wd11e],a
|
ld [wd11e],a
|
||||||
|
|
@ -546,7 +546,7 @@ PrintLevelCommon:: ; 1523 (0:1523)
|
||||||
|
|
||||||
Func_152e:: ; 152e (0:152e)
|
Func_152e:: ; 152e (0:152e)
|
||||||
; Unused.
|
; Unused.
|
||||||
ld hl,wd0dc
|
ld hl,wMoves
|
||||||
ld c,a
|
ld c,a
|
||||||
ld b,0
|
ld b,0
|
||||||
add hl,bc
|
add hl,bc
|
||||||
|
|
@ -1183,7 +1183,7 @@ CloseTextDisplay:: ; 29e8 (0:29e8)
|
||||||
ld [H_LOADEDROMBANK],a
|
ld [H_LOADEDROMBANK],a
|
||||||
ld [$2000],a
|
ld [$2000],a
|
||||||
call InitMapSprites ; reload sprite tile pattern data (since it was partially overwritten by text tile patterns)
|
call InitMapSprites ; reload sprite tile pattern data (since it was partially overwritten by text tile patterns)
|
||||||
ld hl,wcfc4
|
ld hl,wFontLoaded
|
||||||
res 0,[hl]
|
res 0,[hl]
|
||||||
ld a,[wd732]
|
ld a,[wd732]
|
||||||
bit 3,a ; used fly warp
|
bit 3,a ; used fly warp
|
||||||
|
|
@ -1325,7 +1325,7 @@ AddAmountSoldToMoney:: ; 2b9e (0:2b9e)
|
||||||
ld hl,$ffa1 ; total price of items
|
ld hl,$ffa1 ; total price of items
|
||||||
ld c,3 ; length of money in bytes
|
ld c,3 ; length of money in bytes
|
||||||
predef AddBCDPredef ; add total price to money
|
predef AddBCDPredef ; add total price to money
|
||||||
ld a,$13
|
ld a,MONEY_BOX
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; redraw money text box
|
call DisplayTextBoxID ; redraw money text box
|
||||||
ld a, (SFX_02_5a - SFX_Headers_02) / 3
|
ld a, (SFX_02_5a - SFX_Headers_02) / 3
|
||||||
|
|
@ -1372,7 +1372,7 @@ AddItemToInventory:: ; 2bcf (0:2bcf)
|
||||||
|
|
||||||
; INPUT:
|
; INPUT:
|
||||||
; [wListMenuID] = list menu ID
|
; [wListMenuID] = list menu ID
|
||||||
; [wcf8b] = address of the list (2 bytes)
|
; [wList] = address of the list (2 bytes)
|
||||||
DisplayListMenuID:: ; 2be6 (0:2be6)
|
DisplayListMenuID:: ; 2be6 (0:2be6)
|
||||||
xor a
|
xor a
|
||||||
ld [H_AUTOBGTRANSFERENABLED],a ; disable auto-transfer
|
ld [H_AUTOBGTRANSFERENABLED],a ; disable auto-transfer
|
||||||
|
|
@ -1392,13 +1392,13 @@ DisplayListMenuID:: ; 2be6 (0:2be6)
|
||||||
xor a
|
xor a
|
||||||
ld [wMenuItemToSwap],a ; 0 means no item is currently being swapped
|
ld [wMenuItemToSwap],a ; 0 means no item is currently being swapped
|
||||||
ld [wd12a],a
|
ld [wd12a],a
|
||||||
ld a,[wcf8b]
|
ld a,[wList]
|
||||||
ld l,a
|
ld l,a
|
||||||
ld a,[wcf8c]
|
ld a,[wList + 1]
|
||||||
ld h,a ; hl = address of the list
|
ld h,a ; hl = address of the list
|
||||||
ld a,[hl]
|
ld a,[hl]
|
||||||
ld [wd12a],a ; [wd12a] = number of list entries
|
ld [wd12a],a ; [wd12a] = number of list entries
|
||||||
ld a,$0d ; list menu text box ID
|
ld a,LIST_MENU_BOX
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; draw the menu text box
|
call DisplayTextBoxID ; draw the menu text box
|
||||||
call UpdateSprites ; disable sprites behind the text box
|
call UpdateSprites ; disable sprites behind the text box
|
||||||
|
|
@ -1485,9 +1485,9 @@ DisplayListMenuIDLoop:: ; 2c53 (0:2c53)
|
||||||
; if it's an item menu
|
; if it's an item menu
|
||||||
sla c ; item entries are 2 bytes long, so multiply by 2
|
sla c ; item entries are 2 bytes long, so multiply by 2
|
||||||
.skipMultiplying
|
.skipMultiplying
|
||||||
ld a,[wcf8b]
|
ld a,[wList]
|
||||||
ld l,a
|
ld l,a
|
||||||
ld a,[wcf8c]
|
ld a,[wList + 1]
|
||||||
ld h,a
|
ld h,a
|
||||||
inc hl ; hl = beginning of list entries
|
inc hl ; hl = beginning of list entries
|
||||||
ld b,0
|
ld b,0
|
||||||
|
|
@ -1516,7 +1516,7 @@ DisplayListMenuIDLoop:: ; 2c53 (0:2c53)
|
||||||
jr .storeChosenEntry
|
jr .storeChosenEntry
|
||||||
.pokemonList
|
.pokemonList
|
||||||
ld hl,wPartyCount
|
ld hl,wPartyCount
|
||||||
ld a,[wcf8b]
|
ld a,[wList]
|
||||||
cp l ; is it a list of party pokemon or box pokemon?
|
cp l ; is it a list of party pokemon or box pokemon?
|
||||||
ld hl,wPartyMonNicks
|
ld hl,wPartyMonNicks
|
||||||
jr z,.getPokemonName
|
jr z,.getPokemonName
|
||||||
|
|
@ -1707,9 +1707,9 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a)
|
||||||
ld b,$09
|
ld b,$09
|
||||||
ld c,$0e
|
ld c,$0e
|
||||||
call ClearScreenArea
|
call ClearScreenArea
|
||||||
ld a,[wcf8b]
|
ld a,[wList]
|
||||||
ld e,a
|
ld e,a
|
||||||
ld a,[wcf8c]
|
ld a,[wList + 1]
|
||||||
ld d,a
|
ld d,a
|
||||||
inc de ; de = beginning of list entries
|
inc de ; de = beginning of list entries
|
||||||
ld a,[wListScrollOffset]
|
ld a,[wListScrollOffset]
|
||||||
|
|
@ -1753,7 +1753,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a)
|
||||||
.pokemonPCMenu
|
.pokemonPCMenu
|
||||||
push hl
|
push hl
|
||||||
ld hl,wPartyCount
|
ld hl,wPartyCount
|
||||||
ld a,[wcf8b]
|
ld a,[wList]
|
||||||
cp l ; is it a list of party pokemon or box pokemon?
|
cp l ; is it a list of party pokemon or box pokemon?
|
||||||
ld hl,wPartyMonNicks
|
ld hl,wPartyMonNicks
|
||||||
jr z,.getPokemonName
|
jr z,.getPokemonName
|
||||||
|
|
@ -1798,7 +1798,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a)
|
||||||
push af
|
push af
|
||||||
push hl
|
push hl
|
||||||
ld hl,wPartyCount
|
ld hl,wPartyCount
|
||||||
ld a,[wcf8b]
|
ld a,[wList]
|
||||||
cp l ; is it a list of party pokemon or box pokemon?
|
cp l ; is it a list of party pokemon or box pokemon?
|
||||||
ld a,$00
|
ld a,$00
|
||||||
jr z,.next
|
jr z,.next
|
||||||
|
|
@ -1819,8 +1819,8 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a)
|
||||||
and a ; is it a list of party pokemon or box pokemon?
|
and a ; is it a list of party pokemon or box pokemon?
|
||||||
jr z,.skipCopyingLevel
|
jr z,.skipCopyingLevel
|
||||||
.copyLevel
|
.copyLevel
|
||||||
ld a,[wcf9b]
|
ld a,[wLoadedMonBoxLevel]
|
||||||
ld [wcfb9],a
|
ld [wLoadedMonLevel],a
|
||||||
.skipCopyingLevel
|
.skipCopyingLevel
|
||||||
pop hl
|
pop hl
|
||||||
ld bc,$001c
|
ld bc,$001c
|
||||||
|
|
@ -1931,7 +1931,7 @@ GetItemName:: ; 2fcf (0:2fcf)
|
||||||
|
|
||||||
ld [wd0b5],a
|
ld [wd0b5],a
|
||||||
ld a,ITEM_NAME
|
ld a,ITEM_NAME
|
||||||
ld [W_LISTTYPE],a
|
ld [wNameListType],a
|
||||||
ld a,BANK(ItemNames)
|
ld a,BANK(ItemNames)
|
||||||
ld [wPredefBank],a
|
ld [wPredefBank],a
|
||||||
call GetName
|
call GetName
|
||||||
|
|
@ -2028,7 +2028,7 @@ HMMoves:: ; 3052 (0:3052)
|
||||||
GetMoveName:: ; 3058 (0:3058)
|
GetMoveName:: ; 3058 (0:3058)
|
||||||
push hl
|
push hl
|
||||||
ld a,MOVE_NAME
|
ld a,MOVE_NAME
|
||||||
ld [W_LISTTYPE],a
|
ld [wNameListType],a
|
||||||
ld a,[wd11e]
|
ld a,[wd11e]
|
||||||
ld [wd0b5],a
|
ld [wd0b5],a
|
||||||
ld a,BANK(MoveNames)
|
ld a,BANK(MoveNames)
|
||||||
|
|
@ -2996,7 +2996,7 @@ YesNoChoice:: ; 35ec (0:35ec)
|
||||||
jr DisplayYesNoChoice
|
jr DisplayYesNoChoice
|
||||||
|
|
||||||
Func_35f4:: ; 35f4 (0:35f4)
|
Func_35f4:: ; 35f4 (0:35f4)
|
||||||
ld a, $14
|
ld a, TWO_OPTION_MENU
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call InitYesNoTextBoxParameters
|
call InitYesNoTextBoxParameters
|
||||||
jp DisplayTextBoxID
|
jp DisplayTextBoxID
|
||||||
|
|
@ -3023,7 +3023,7 @@ Func_361a:: ; 361a (0:361a)
|
||||||
hlCoord 12, 7
|
hlCoord 12, 7
|
||||||
ld bc, $080d
|
ld bc, $080d
|
||||||
DisplayYesNoChoice:: ; 3628 (0:3628)
|
DisplayYesNoChoice:: ; 3628 (0:3628)
|
||||||
ld a, $14
|
ld a, TWO_OPTION_MENU
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
jp LoadScreenTilesFromBuffer1
|
jp LoadScreenTilesFromBuffer1
|
||||||
|
|
@ -3252,7 +3252,7 @@ NamePointers:: ; 375d (0:375d)
|
||||||
GetName:: ; 376b (0:376b)
|
GetName:: ; 376b (0:376b)
|
||||||
; arguments:
|
; arguments:
|
||||||
; [wd0b5] = which name
|
; [wd0b5] = which name
|
||||||
; [wd0b6] = which list (W_LISTTYPE)
|
; [wNameListType] = which list
|
||||||
; [wPredefBank] = bank of list
|
; [wPredefBank] = bank of list
|
||||||
;
|
;
|
||||||
; returns pointer to name in de
|
; returns pointer to name in de
|
||||||
|
|
@ -3269,7 +3269,7 @@ GetName:: ; 376b (0:376b)
|
||||||
push hl
|
push hl
|
||||||
push bc
|
push bc
|
||||||
push de
|
push de
|
||||||
ld a,[W_LISTTYPE] ;List3759_entrySelector
|
ld a,[wNameListType] ;List3759_entrySelector
|
||||||
dec a
|
dec a
|
||||||
jr nz,.otherEntries
|
jr nz,.otherEntries
|
||||||
;1 = MON_NAMES
|
;1 = MON_NAMES
|
||||||
|
|
@ -3284,7 +3284,7 @@ GetName:: ; 376b (0:376b)
|
||||||
ld a,[wPredefBank]
|
ld a,[wPredefBank]
|
||||||
ld [H_LOADEDROMBANK],a
|
ld [H_LOADEDROMBANK],a
|
||||||
ld [$2000],a
|
ld [$2000],a
|
||||||
ld a,[W_LISTTYPE] ;VariousNames' entryID
|
ld a,[wNameListType] ;VariousNames' entryID
|
||||||
dec a
|
dec a
|
||||||
add a
|
add a
|
||||||
ld d,0
|
ld d,0
|
||||||
|
|
@ -3335,11 +3335,11 @@ GetName:: ; 376b (0:376b)
|
||||||
ret
|
ret
|
||||||
|
|
||||||
GetItemPrice:: ; 37df (0:37df)
|
GetItemPrice:: ; 37df (0:37df)
|
||||||
; Stores item's price as BCD in [H_DOWNARROWBLINKCNT1] and [[H_DOWNARROWBLINKCNT2]
|
; Stores item's price as BCD at hItemPrice (3 bytes)
|
||||||
; Input: [wcf91] = item id
|
; Input: [wcf91] = item id
|
||||||
ld a, [H_LOADEDROMBANK]
|
ld a, [H_LOADEDROMBANK]
|
||||||
push af
|
push af
|
||||||
ld a, [wListMenuID] ; wListMenuID
|
ld a, [wListMenuID]
|
||||||
cp MOVESLISTMENU
|
cp MOVESLISTMENU
|
||||||
ld a, BANK(ItemPrices)
|
ld a, BANK(ItemPrices)
|
||||||
jr nz, .asm_37ed
|
jr nz, .asm_37ed
|
||||||
|
|
@ -3347,7 +3347,7 @@ GetItemPrice:: ; 37df (0:37df)
|
||||||
.asm_37ed
|
.asm_37ed
|
||||||
ld [H_LOADEDROMBANK], a
|
ld [H_LOADEDROMBANK], a
|
||||||
ld [$2000], a
|
ld [$2000], a
|
||||||
ld hl, wcf8f
|
ld hl, wItemPrices
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld h, [hl]
|
ld h, [hl]
|
||||||
ld l, a
|
ld l, a
|
||||||
|
|
@ -3361,11 +3361,11 @@ GetItemPrice:: ; 37df (0:37df)
|
||||||
jr nz, .asm_3802
|
jr nz, .asm_3802
|
||||||
dec hl
|
dec hl
|
||||||
ld a, [hld]
|
ld a, [hld]
|
||||||
ld [$ff8d], a
|
ld [hItemPrice + 2], a
|
||||||
ld a, [hld]
|
ld a, [hld]
|
||||||
ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
|
ld [hItemPrice + 1], a
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [H_DOWNARROWBLINKCNT1], a ; $ff8b
|
ld [hItemPrice], a
|
||||||
jr .asm_381c
|
jr .asm_381c
|
||||||
.getTMPrice
|
.getTMPrice
|
||||||
ld a, Bank(GetMachinePrice)
|
ld a, Bank(GetMachinePrice)
|
||||||
|
|
@ -3373,7 +3373,7 @@ GetItemPrice:: ; 37df (0:37df)
|
||||||
ld [$2000], a
|
ld [$2000], a
|
||||||
call GetMachinePrice
|
call GetMachinePrice
|
||||||
.asm_381c
|
.asm_381c
|
||||||
ld de, H_DOWNARROWBLINKCNT1 ; $ff8b
|
ld de, hItemPrice
|
||||||
pop af
|
pop af
|
||||||
ld [H_LOADEDROMBANK], a
|
ld [H_LOADEDROMBANK], a
|
||||||
ld [$2000], a
|
ld [$2000], a
|
||||||
|
|
@ -4046,7 +4046,7 @@ PlaceMenuCursor:: ; 3b7c (0:3b7c)
|
||||||
and a ; was the previous menu id 0?
|
and a ; was the previous menu id 0?
|
||||||
jr z,.checkForArrow1
|
jr z,.checkForArrow1
|
||||||
push af
|
push af
|
||||||
ld a,[$fff6]
|
ld a,[hFlags_0xFFF6]
|
||||||
bit 1,a ; is the menu double spaced?
|
bit 1,a ; is the menu double spaced?
|
||||||
jr z,.doubleSpaced1
|
jr z,.doubleSpaced1
|
||||||
ld bc,20
|
ld bc,20
|
||||||
|
|
@ -4072,7 +4072,7 @@ PlaceMenuCursor:: ; 3b7c (0:3b7c)
|
||||||
and a
|
and a
|
||||||
jr z,.checkForArrow2
|
jr z,.checkForArrow2
|
||||||
push af
|
push af
|
||||||
ld a,[$fff6]
|
ld a,[hFlags_0xFFF6]
|
||||||
bit 1,a ; is the menu double spaced?
|
bit 1,a ; is the menu double spaced?
|
||||||
jr z,.doubleSpaced2
|
jr z,.doubleSpaced2
|
||||||
ld bc,20
|
ld bc,20
|
||||||
|
|
@ -4193,7 +4193,7 @@ AutoTextBoxDrawingCommon:: ; 3c41 (0:3c41)
|
||||||
PrintText:: ; 3c49 (0:3c49)
|
PrintText:: ; 3c49 (0:3c49)
|
||||||
; Print text hl at (1, 14).
|
; Print text hl at (1, 14).
|
||||||
push hl
|
push hl
|
||||||
ld a,1
|
ld a,MESSAGE_BOX
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
call UpdateSprites
|
call UpdateSprites
|
||||||
|
|
@ -4540,7 +4540,7 @@ GetHealthBarColor::
|
||||||
; Copy the current map's sprites' tile patterns to VRAM again after they have
|
; Copy the current map's sprites' tile patterns to VRAM again after they have
|
||||||
; been overwritten by other tile patterns.
|
; been overwritten by other tile patterns.
|
||||||
ReloadMapSpriteTilePatterns:: ; 3e08 (0:3e08)
|
ReloadMapSpriteTilePatterns:: ; 3e08 (0:3e08)
|
||||||
ld hl, wcfc4
|
ld hl, wFontLoaded
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af
|
push af
|
||||||
res 0, [hl]
|
res 0, [hl]
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ PlaceNextChar:: ; 1956 (0:1956)
|
||||||
cp $4E
|
cp $4E
|
||||||
jr nz,.next
|
jr nz,.next
|
||||||
ld bc,$0028
|
ld bc,$0028
|
||||||
ld a,[$FFF6]
|
ld a,[hFlags_0xFFF6]
|
||||||
bit 2,a
|
bit 2,a
|
||||||
jr z,.next2
|
jr z,.next2
|
||||||
ld bc,$14
|
ld bc,$14
|
||||||
|
|
|
||||||
6
hram.asm
6
hram.asm
|
|
@ -12,6 +12,8 @@ hSoftReset EQU $FF8A
|
||||||
|
|
||||||
hBaseTileID EQU $FF8B
|
hBaseTileID EQU $FF8B
|
||||||
|
|
||||||
|
hItemPrice EQU $FF8B
|
||||||
|
|
||||||
; counters for blinking down arrow
|
; counters for blinking down arrow
|
||||||
H_DOWNARROWBLINKCNT1 EQU $FF8B
|
H_DOWNARROWBLINKCNT1 EQU $FF8B
|
||||||
H_DOWNARROWBLINKCNT2 EQU $FF8C
|
H_DOWNARROWBLINKCNT2 EQU $FF8C
|
||||||
|
|
@ -151,5 +153,9 @@ H_CURRENTSPRITEOFFSET EQU $FFDA ; multiple of $10
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
; bit 0: draw HP fraction to the right of bar instead of below (for party menu)
|
||||||
|
; bit 1: menu is double spaced
|
||||||
|
hFlags_0xFFF6 EQU $FFF6
|
||||||
|
|
||||||
hJoyInput EQU $FFF8
|
hJoyInput EQU $FFF8
|
||||||
|
|
||||||
|
|
|
||||||
130
main.asm
130
main.asm
|
|
@ -85,7 +85,7 @@ LoadMonData_:
|
||||||
; 1: enemymon
|
; 1: enemymon
|
||||||
; 2: boxmon
|
; 2: boxmon
|
||||||
; 3: daycaremon
|
; 3: daycaremon
|
||||||
; Return monster id at wcf91 and its data at wcf98.
|
; Return monster id at wcf91 and its data at wLoadedMon.
|
||||||
; Also load base stats at W_MONHDEXNUM for convenience.
|
; Also load base stats at W_MONHDEXNUM for convenience.
|
||||||
|
|
||||||
ld a, [wDayCareMonSpecies]
|
ld a, [wDayCareMonSpecies]
|
||||||
|
|
@ -96,7 +96,7 @@ LoadMonData_:
|
||||||
|
|
||||||
ld a, [wWhichPokemon]
|
ld a, [wWhichPokemon]
|
||||||
ld e, a
|
ld e, a
|
||||||
callab Func_39c37 ; get pokemon ID
|
callab GetMonSpecies
|
||||||
|
|
||||||
.GetMonHeader
|
.GetMonHeader
|
||||||
ld a, [wcf91]
|
ld a, [wcf91]
|
||||||
|
|
@ -125,8 +125,8 @@ LoadMonData_:
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
|
|
||||||
.copyMonData
|
.copyMonData
|
||||||
ld de, wcf98
|
ld de, wLoadedMon
|
||||||
ld bc, 44
|
ld bc, wPartyMon2 - wPartyMon1
|
||||||
jp CopyData
|
jp CopyData
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -797,7 +797,7 @@ SubtractAmountPaidFromMoney_: ; 6b21 (1:6b21)
|
||||||
ld hl,$ffa1 ; total price of items
|
ld hl,$ffa1 ; total price of items
|
||||||
ld c,3 ; length of money in bytes
|
ld c,3 ; length of money in bytes
|
||||||
predef SubBCDPredef ; subtract total price from money
|
predef SubBCDPredef ; subtract total price from money
|
||||||
ld a,$13
|
ld a,MONEY_BOX
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; redraw money text box
|
call DisplayTextBoxID ; redraw money text box
|
||||||
and a
|
and a
|
||||||
|
|
@ -808,7 +808,7 @@ HandleItemListSwapping: ; 6b44 (1:6b44)
|
||||||
cp a,ITEMLISTMENU
|
cp a,ITEMLISTMENU
|
||||||
jp nz,DisplayListMenuIDLoop ; only rearrange item list menus
|
jp nz,DisplayListMenuIDLoop ; only rearrange item list menus
|
||||||
push hl
|
push hl
|
||||||
ld hl,wcf8b
|
ld hl,wList
|
||||||
ld a,[hli]
|
ld a,[hli]
|
||||||
ld h,[hl]
|
ld h,[hl]
|
||||||
ld l,a
|
ld l,a
|
||||||
|
|
@ -854,7 +854,7 @@ HandleItemListSwapping: ; 6b44 (1:6b44)
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
push hl
|
push hl
|
||||||
push de
|
push de
|
||||||
ld hl,wcf8b
|
ld hl,wList
|
||||||
ld a,[hli]
|
ld a,[hli]
|
||||||
ld h,[hl]
|
ld h,[hl]
|
||||||
ld l,a
|
ld l,a
|
||||||
|
|
@ -916,7 +916,7 @@ HandleItemListSwapping: ; 6b44 (1:6b44)
|
||||||
jr .done
|
jr .done
|
||||||
.combineItemSlots
|
.combineItemSlots
|
||||||
ld [hl],a ; put the sum in the second item slot
|
ld [hl],a ; put the sum in the second item slot
|
||||||
ld hl,wcf8b
|
ld hl,wList
|
||||||
ld a,[hli]
|
ld a,[hli]
|
||||||
ld h,[hl]
|
ld h,[hl]
|
||||||
ld l,a
|
ld l,a
|
||||||
|
|
@ -1022,7 +1022,7 @@ DisplayTextIDInit: ; 7096 (1:7096)
|
||||||
.drawTextBoxBorder
|
.drawTextBoxBorder
|
||||||
call TextBoxBorder
|
call TextBoxBorder
|
||||||
.skipDrawingTextBoxBorder
|
.skipDrawingTextBoxBorder
|
||||||
ld hl,wcfc4
|
ld hl,wFontLoaded
|
||||||
set 0,[hl]
|
set 0,[hl]
|
||||||
ld hl,wFlags_0xcd60
|
ld hl,wFlags_0xcd60
|
||||||
bit 4,[hl]
|
bit 4,[hl]
|
||||||
|
|
@ -1166,7 +1166,7 @@ INCLUDE "engine/overworld/cable_club_npc.asm"
|
||||||
; function to draw various text boxes
|
; function to draw various text boxes
|
||||||
DisplayTextBoxID_: ; 72ea (1:72ea)
|
DisplayTextBoxID_: ; 72ea (1:72ea)
|
||||||
ld a,[wTextBoxID]
|
ld a,[wTextBoxID]
|
||||||
cp a,$14
|
cp a,TWO_OPTION_MENU
|
||||||
jp z,DisplayTwoOptionMenu
|
jp z,DisplayTwoOptionMenu
|
||||||
ld c,a
|
ld c,a
|
||||||
ld hl,TextBoxFunctionTable
|
ld hl,TextBoxFunctionTable
|
||||||
|
|
@ -1294,9 +1294,9 @@ GetAddressOfScreenCoords: ; 7375 (1:7375)
|
||||||
; 00: text box ID
|
; 00: text box ID
|
||||||
; 01-02: function address
|
; 01-02: function address
|
||||||
TextBoxFunctionTable: ; 7387 (1:7387)
|
TextBoxFunctionTable: ; 7387 (1:7387)
|
||||||
dbw $13, Func_74ba
|
dbw MONEY_BOX, DisplayMoneyBox
|
||||||
dbw $15, Func_74ea
|
dbw BUY_SELL_QUIT_MENU, DoBuySellQuitMenu
|
||||||
dbw $04, Func_76e1
|
dbw FIELD_MOVE_MON_MENU, DisplayFieldMoveMonMenu
|
||||||
db $ff ; terminator
|
db $ff ; terminator
|
||||||
|
|
||||||
; Format:
|
; Format:
|
||||||
|
|
@ -1306,12 +1306,12 @@ TextBoxFunctionTable: ; 7387 (1:7387)
|
||||||
; 03: column of lower right corner
|
; 03: column of lower right corner
|
||||||
; 04: row of lower right corner
|
; 04: row of lower right corner
|
||||||
TextBoxCoordTable: ; 7391 (1:7391)
|
TextBoxCoordTable: ; 7391 (1:7391)
|
||||||
db $01, 0, 12, 19, 17
|
db MESSAGE_BOX, 0, 12, 19, 17
|
||||||
db $03, 0, 0, 19, 14
|
db $03, 0, 0, 19, 14
|
||||||
db $07, 0, 0, 11, 6
|
db $07, 0, 0, 11, 6
|
||||||
db $0d, 4, 2, 19, 12
|
db LIST_MENU_BOX, 4, 2, 19, 12
|
||||||
db $10, 7, 0, 19, 17
|
db $10, 7, 0, 19, 17
|
||||||
db $11, 6, 4, 14, 13
|
db MON_SPRITE_POPUP, 6, 4, 14, 13
|
||||||
db $ff ; terminator
|
db $ff ; terminator
|
||||||
|
|
||||||
; Format:
|
; Format:
|
||||||
|
|
@ -1325,57 +1325,57 @@ TextBoxCoordTable: ; 7391 (1:7391)
|
||||||
; 08: row of beginning of text
|
; 08: row of beginning of text
|
||||||
; table of window positions and corresponding text [key, start column, start row, end column, end row, text pointer [2 bytes], text column, text row]
|
; table of window positions and corresponding text [key, start column, start row, end column, end row, text pointer [2 bytes], text column, text row]
|
||||||
TextBoxTextAndCoordTable: ; 73b0 (1:73b0)
|
TextBoxTextAndCoordTable: ; 73b0 (1:73b0)
|
||||||
db $05 ; text box ID
|
db JP_MOCHIMONO_MENU_TEMPLATE
|
||||||
db 0,0,14,17 ; text box coordinates
|
db 0,0,14,17 ; text box coordinates
|
||||||
dw JapaneseMochimonoText
|
dw JapaneseMochimonoText
|
||||||
db 3,0 ; text coordinates
|
db 3,0 ; text coordinates
|
||||||
|
|
||||||
db $06 ; text box ID
|
db USE_TOSS_MENU_TEMPLATE
|
||||||
db 13,10,19,14 ; text box coordinates
|
db 13,10,19,14 ; text box coordinates
|
||||||
dw UseTossText
|
dw UseTossText
|
||||||
db 15,11 ; text coordinates
|
db 15,11 ; text coordinates
|
||||||
|
|
||||||
db $08 ; text box ID
|
db JP_SAVE_MESSAGE_MENU_TEMPLATE
|
||||||
db 0,0,7,5 ; text box coordinates
|
db 0,0,7,5 ; text box coordinates
|
||||||
dw JapaneseSaveMessageText
|
dw JapaneseSaveMessageText
|
||||||
db 2,2 ; text coordinates
|
db 2,2 ; text coordinates
|
||||||
|
|
||||||
db $09 ; text box ID
|
db JP_SPEED_OPTIONS_MENU_TEMPLATE
|
||||||
db 0,6,5,10 ; text box coordinates
|
db 0,6,5,10 ; text box coordinates
|
||||||
dw JapaneseSpeedOptionsText
|
dw JapaneseSpeedOptionsText
|
||||||
db 2,7 ; text coordinates
|
db 2,7 ; text coordinates
|
||||||
|
|
||||||
db $0b ; text box ID
|
db BATTLE_MENU_TEMPLATE
|
||||||
db 8,12,19,17 ; text box coordinates
|
db 8,12,19,17 ; text box coordinates
|
||||||
dw BattleMenuText
|
dw BattleMenuText
|
||||||
db 10,14 ; text coordinates
|
db 10,14 ; text coordinates
|
||||||
|
|
||||||
db $1b ; text box ID
|
db SAFARI_BATTLE_MENU_TEMPLATE
|
||||||
db 0,12,19,17 ; text box coordinates
|
db 0,12,19,17 ; text box coordinates
|
||||||
dw SafariZoneBattleMenuText
|
dw SafariZoneBattleMenuText
|
||||||
db 2,14 ; text coordinates
|
db 2,14 ; text coordinates
|
||||||
|
|
||||||
db $0c ; text box ID
|
db SWITCH_STATS_CANCEL_MENU_TEMPLATE
|
||||||
db 11,11,19,17 ; text box coordinates
|
db 11,11,19,17 ; text box coordinates
|
||||||
dw SwitchStatsCancelText
|
dw SwitchStatsCancelText
|
||||||
db 13,12 ; text coordinates
|
db 13,12 ; text coordinates
|
||||||
|
|
||||||
db $0e ; text box ID
|
db BUY_SELL_QUIT_MENU_TEMPLATE
|
||||||
db 0,0,10,6 ; text box coordinates
|
db 0,0,10,6 ; text box coordinates
|
||||||
dw BuySellQuitText
|
dw BuySellQuitText
|
||||||
db 2,1 ; text coordinates
|
db 2,1 ; text coordinates
|
||||||
|
|
||||||
db $0f ; text box ID
|
db MONEY_BOX_TEMPLATE
|
||||||
db 11,0,19,2 ; text box coordinates
|
db 11,0,19,2 ; text box coordinates
|
||||||
dw MoneyText
|
dw MoneyText
|
||||||
db 13,0 ; text coordinates
|
db 13,0 ; text coordinates
|
||||||
|
|
||||||
db $12 ; text box ID
|
db JP_AH_MENU_TEMPLATE
|
||||||
db 7,6,11,10 ; text box coordinates
|
db 7,6,11,10 ; text box coordinates
|
||||||
dw JapaneseAhText
|
dw JapaneseAhText
|
||||||
db 8,8 ; text coordinates
|
db 8,8 ; text coordinates
|
||||||
|
|
||||||
db $1a ; text box ID
|
db JP_POKEDEX_MENU_TEMPLATE
|
||||||
db 11,8,19,17 ; text box coordinates
|
db 11,8,19,17 ; text box coordinates
|
||||||
dw JapanesePokedexMenu
|
dw JapanesePokedexMenu
|
||||||
db 12,10 ; text coordinates
|
db 12,10 ; text coordinates
|
||||||
|
|
@ -1431,10 +1431,10 @@ JapanesePokedexMenu: ; 74a1 (1:74a1)
|
||||||
next "ぶんぷをみる"
|
next "ぶんぷをみる"
|
||||||
next "キャンセル@"
|
next "キャンセル@"
|
||||||
|
|
||||||
Func_74ba: ; 74ba (1:74ba)
|
DisplayMoneyBox: ; 74ba (1:74ba)
|
||||||
ld hl, wd730
|
ld hl, wd730
|
||||||
set 6, [hl]
|
set 6, [hl]
|
||||||
ld a, $f
|
ld a, MONEY_BOX_TEMPLATE
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
hlCoord 13, 1
|
hlCoord 13, 1
|
||||||
|
|
@ -1442,7 +1442,7 @@ Func_74ba: ; 74ba (1:74ba)
|
||||||
ld c, $6
|
ld c, $6
|
||||||
call ClearScreenArea
|
call ClearScreenArea
|
||||||
hlCoord 12, 1
|
hlCoord 12, 1
|
||||||
ld de, wPlayerMoney ; wPlayerMoney
|
ld de, wPlayerMoney
|
||||||
ld c, $a3
|
ld c, $a3
|
||||||
call PrintBCDNumber
|
call PrintBCDNumber
|
||||||
ld hl, wd730
|
ld hl, wd730
|
||||||
|
|
@ -1452,53 +1452,53 @@ Func_74ba: ; 74ba (1:74ba)
|
||||||
CurrencyString: ; 74e2 (1:74e2)
|
CurrencyString: ; 74e2 (1:74e2)
|
||||||
db " ¥@"
|
db " ¥@"
|
||||||
|
|
||||||
Func_74ea: ; 74ea (1:74ea)
|
DoBuySellQuitMenu: ; 74ea (1:74ea)
|
||||||
ld a, [wd730]
|
ld a, [wd730]
|
||||||
set 6, a ; no printing delay
|
set 6, a ; no printing delay
|
||||||
ld [wd730], a
|
ld [wd730], a
|
||||||
xor a
|
xor a
|
||||||
ld [wd12d], a
|
ld [wd12d], a
|
||||||
ld a, $e
|
ld a, BUY_SELL_QUIT_MENU_TEMPLATE
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
ld a, $3
|
ld a, A_BUTTON | B_BUTTON
|
||||||
ld [wMenuWatchedKeys], a ; wMenuWatchedKeys
|
ld [wMenuWatchedKeys], a
|
||||||
ld a, $2
|
ld a, $2
|
||||||
ld [wMaxMenuItem], a ; wMaxMenuItem
|
ld [wMaxMenuItem], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wTopMenuItemY], a ; wTopMenuItemY
|
ld [wTopMenuItemY], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wTopMenuItemX], a ; wTopMenuItemX
|
ld [wTopMenuItemX], a
|
||||||
xor a
|
xor a
|
||||||
ld [wCurrentMenuItem], a ; wCurrentMenuItem
|
ld [wCurrentMenuItem], a
|
||||||
ld [wLastMenuItem], a ; wLastMenuItem
|
ld [wLastMenuItem], a
|
||||||
ld [wcc37], a
|
ld [wcc37], a
|
||||||
ld a, [wd730]
|
ld a, [wd730]
|
||||||
res 6, a ; turn on the printing delay
|
res 6, a ; turn on the printing delay
|
||||||
ld [wd730], a
|
ld [wd730], a
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
call PlaceUnfilledArrowMenuCursor
|
call PlaceUnfilledArrowMenuCursor
|
||||||
bit 0, a
|
bit 0, a ; was A pressed?
|
||||||
jr nz, .asm_7539
|
jr nz, .pressedA
|
||||||
bit 1, a
|
bit 1, a ; was B pressed? (always true since only A/B are watched)
|
||||||
jr z, .asm_7539
|
jr z, .pressedA
|
||||||
ld a, $2
|
ld a, $2
|
||||||
ld [wd12e], a
|
ld [wd12e], a
|
||||||
jr .asm_754c
|
jr .quit
|
||||||
.asm_7539
|
.pressedA
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wd12e], a
|
ld [wd12e], a
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
ld [wd12d], a
|
ld [wd12d], a
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [wMaxMenuItem] ; wMaxMenuItem
|
ld a, [wMaxMenuItem]
|
||||||
cp b
|
cp b
|
||||||
jr z, .asm_754c
|
jr z, .quit
|
||||||
ret
|
ret
|
||||||
.asm_754c
|
.quit
|
||||||
ld a, $2
|
ld a, $2
|
||||||
ld [wd12e], a
|
ld [wd12e], a
|
||||||
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
ld a, [wCurrentMenuItem]
|
||||||
ld [wd12d], a
|
ld [wd12d], a
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
|
|
@ -1716,9 +1716,9 @@ TwoOptionMenuStrings: ; 7671 (1:7671)
|
||||||
.HealCancelMenu ; 76d5 (1:36d5)
|
.HealCancelMenu ; 76d5 (1:36d5)
|
||||||
db "HEAL",$4E,"CANCEL@"
|
db "HEAL",$4E,"CANCEL@"
|
||||||
|
|
||||||
Func_76e1: ; 76e1 (1:36e1)
|
DisplayFieldMoveMonMenu: ; 76e1 (1:36e1)
|
||||||
xor a
|
xor a
|
||||||
ld hl, wWhichTrade ; wWhichTrade
|
ld hl, wWhichTrade
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
|
@ -1737,7 +1737,7 @@ Func_76e1: ; 76e1 (1:36e1)
|
||||||
ld a, $c
|
ld a, $c
|
||||||
ld [$fff7], a
|
ld [$fff7], a
|
||||||
hlCoord 13, 12
|
hlCoord 13, 12
|
||||||
ld de, PokemonMenuEntries ; $77c2
|
ld de, PokemonMenuEntries
|
||||||
jp PlaceString
|
jp PlaceString
|
||||||
.asm_770f
|
.asm_770f
|
||||||
push af
|
push af
|
||||||
|
|
@ -1778,10 +1778,10 @@ Func_76e1: ; 76e1 (1:36e1)
|
||||||
jr nz, .asm_7747
|
jr nz, .asm_7747
|
||||||
xor a
|
xor a
|
||||||
ld [wTrainerScreenX], a
|
ld [wTrainerScreenX], a
|
||||||
ld de, wWhichTrade ; wWhichTrade
|
ld de, wWhichTrade
|
||||||
.asm_7752
|
.asm_7752
|
||||||
push hl
|
push hl
|
||||||
ld hl, FieldMoveNames ; $778d
|
ld hl, FieldMoveNames
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_7776
|
jr z, .asm_7776
|
||||||
|
|
@ -1817,7 +1817,7 @@ Func_76e1: ; 76e1 (1:36e1)
|
||||||
ld e, a
|
ld e, a
|
||||||
ld d, $0
|
ld d, $0
|
||||||
add hl, de
|
add hl, de
|
||||||
ld de, PokemonMenuEntries ; $77c2
|
ld de, PokemonMenuEntries
|
||||||
jp PlaceString
|
jp PlaceString
|
||||||
|
|
||||||
FieldMoveNames: ; 778d (1:778d)
|
FieldMoveNames: ; 778d (1:778d)
|
||||||
|
|
@ -1837,14 +1837,14 @@ PokemonMenuEntries: ; 77c2 (1:77c2)
|
||||||
next "CANCEL@"
|
next "CANCEL@"
|
||||||
|
|
||||||
GetMonFieldMoves: ; 77d6 (1:77d6)
|
GetMonFieldMoves: ; 77d6 (1:77d6)
|
||||||
ld a, [wWhichPokemon] ; wWhichPokemon
|
ld a, [wWhichPokemon]
|
||||||
ld hl, wPartyMon1Moves ; wPartyMon1Moves
|
ld hl, wPartyMon1Moves
|
||||||
ld bc, $2c
|
ld bc, $2c
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
ld d, h
|
ld d, h
|
||||||
ld e, l
|
ld e, l
|
||||||
ld c, $5
|
ld c, $5
|
||||||
ld hl, wWhichTrade ; wWhichTrade
|
ld hl, wWhichTrade
|
||||||
.asm_77e9
|
.asm_77e9
|
||||||
push hl
|
push hl
|
||||||
.asm_77ea
|
.asm_77ea
|
||||||
|
|
@ -1855,7 +1855,7 @@ GetMonFieldMoves: ; 77d6 (1:77d6)
|
||||||
jr z, .asm_7821
|
jr z, .asm_7821
|
||||||
ld b, a
|
ld b, a
|
||||||
inc de ; go to next move
|
inc de ; go to next move
|
||||||
ld hl, FieldMoveDisplayData ; $7823
|
ld hl, FieldMoveDisplayData
|
||||||
.asm_77f6
|
.asm_77f6
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
cp $ff
|
cp $ff
|
||||||
|
|
@ -3823,8 +3823,8 @@ _AddEnemyMonToPlayerParty: ; f49d (3:749d)
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
ld e, l
|
ld e, l
|
||||||
ld d, h
|
ld d, h
|
||||||
ld hl, wcf98
|
ld hl, wLoadedMon
|
||||||
call CopyData ; write new mon's data (from wcf98)
|
call CopyData ; write new mon's data (from wLoadedMon)
|
||||||
ld hl, wPartyMonOT
|
ld hl, wPartyMonOT
|
||||||
ld a, [wPartyCount]
|
ld a, [wPartyCount]
|
||||||
dec a
|
dec a
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,9 @@ CeruleanHouse2Text1: ; 74e15 (1d:4e15)
|
||||||
call LoadItemList
|
call LoadItemList
|
||||||
ld hl, wStringBuffer2 + 11
|
ld hl, wStringBuffer2 + 11
|
||||||
ld a, l
|
ld a, l
|
||||||
ld [wcf8b], a
|
ld [wList], a
|
||||||
ld a, h
|
ld a, h
|
||||||
ld [wcf8c], a
|
ld [wList + 1], a
|
||||||
xor a
|
xor a
|
||||||
ld [wcf93], a
|
ld [wcf93], a
|
||||||
ld [wMenuItemToSwap], a
|
ld [wMenuItemToSwap], a
|
||||||
|
|
|
||||||
84
wram.asm
84
wram.asm
|
|
@ -786,12 +786,15 @@ wStringBuffer2:: ; cf70
|
||||||
wStringBuffer3:: ; cf81
|
wStringBuffer3:: ; cf81
|
||||||
ds 9 + 1
|
ds 9 + 1
|
||||||
|
|
||||||
wcf8b:: ds 1
|
wList:: ; cf8b
|
||||||
wcf8c:: ds 1
|
ds 2
|
||||||
|
|
||||||
wcf8d:: ds 1
|
wcf8d:: ds 1
|
||||||
wcf8e:: ds 1
|
wcf8e:: ds 1
|
||||||
wcf8f:: ds 1
|
|
||||||
wcf90:: ds 1
|
wItemPrices:: ; cf8f
|
||||||
|
ds 2
|
||||||
|
|
||||||
wcf91:: ds 1
|
wcf91:: ds 1
|
||||||
|
|
||||||
wWhichPokemon:: ; cf92
|
wWhichPokemon:: ; cf92
|
||||||
|
|
@ -800,6 +803,12 @@ wWhichPokemon:: ; cf92
|
||||||
|
|
||||||
wcf93:: ds 1
|
wcf93:: ds 1
|
||||||
|
|
||||||
|
wHPBarType:: ; cf94
|
||||||
|
; type of HP bar
|
||||||
|
; $00 = enemy HUD in battle
|
||||||
|
; $01 = player HUD in battle / status screen
|
||||||
|
; $02 = party menu
|
||||||
|
|
||||||
wListMenuID:: ; cf94
|
wListMenuID:: ; cf94
|
||||||
; ID used by DisplayListMenuID
|
; ID used by DisplayListMenuID
|
||||||
ds 1
|
ds 1
|
||||||
|
|
@ -807,24 +816,16 @@ wListMenuID:: ; cf94
|
||||||
wcf95:: ds 1
|
wcf95:: ds 1
|
||||||
wcf96:: ds 1
|
wcf96:: ds 1
|
||||||
wcf97:: ds 1
|
wcf97:: ds 1
|
||||||
wcf98:: ds 1
|
|
||||||
wcf99:: ds 1
|
; LoadMonData copies mon data here
|
||||||
wcf9a:: ds 1
|
wLoadedMon:: party_struct wLoadedMon ; cf98
|
||||||
wcf9b:: ds 1
|
|
||||||
wcf9c:: ds 4
|
wFontLoaded:: ; cfc4
|
||||||
wcfa0:: ds 4
|
; bit 0: The space in VRAM that is used to store walk animation tile patterns
|
||||||
wcfa4:: ds 2
|
; for the player and NPCs is in use for font tile patterns.
|
||||||
wcfa6:: ds 2
|
; This means that NPC movement must be disabled.
|
||||||
wcfa8:: ds 7
|
; The other bits are unused.
|
||||||
wcfaf:: ds 10
|
ds 1
|
||||||
wcfb9:: ds 1
|
|
||||||
wcfba:: ds 1
|
|
||||||
wcfbb:: ds 1
|
|
||||||
wcfbc:: ds 2
|
|
||||||
wcfbe:: ds 2
|
|
||||||
wcfc0:: ds 2
|
|
||||||
wcfc2:: ds 2
|
|
||||||
wcfc4:: ds 1
|
|
||||||
|
|
||||||
wWalkCounter:: ; cfc5
|
wWalkCounter:: ; cfc5
|
||||||
; walk animation counter
|
; walk animation counter
|
||||||
|
|
@ -979,8 +980,13 @@ wCriticalHitOrOHKO:: ; d05e
|
||||||
W_MOVEMISSED:: ; d05f
|
W_MOVEMISSED:: ; d05f
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
wd060:: ds 1
|
wPlayerStatsToDouble:: ; d060
|
||||||
wd061:: ds 1
|
; always 0
|
||||||
|
ds 1
|
||||||
|
|
||||||
|
wPlayerStatsToHalve:: ; d061
|
||||||
|
; always 0
|
||||||
|
ds 1
|
||||||
|
|
||||||
W_PLAYERBATTSTATUS1:: ; d062
|
W_PLAYERBATTSTATUS1:: ; d062
|
||||||
; bit 0 - bide
|
; bit 0 - bide
|
||||||
|
|
@ -1010,8 +1016,13 @@ W_PLAYERBATTSTATUS3:: ; d064
|
||||||
; bit 3 - tranformed
|
; bit 3 - tranformed
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
wd065:: ds 1
|
wEnemyStatsToDouble:: ; d065
|
||||||
wd066:: ds 1
|
; always 0
|
||||||
|
ds 1
|
||||||
|
|
||||||
|
wEnemyStatsToHalve:: ; d066
|
||||||
|
; always 0
|
||||||
|
ds 1
|
||||||
|
|
||||||
W_ENEMYBATTSTATUS1:: ; d067
|
W_ENEMYBATTSTATUS1:: ; d067
|
||||||
ds 1
|
ds 1
|
||||||
|
|
@ -1213,7 +1224,7 @@ W_SPRITEDECODETABLE1PTR:: ; d0b3
|
||||||
|
|
||||||
wd0b5:: ds 1
|
wd0b5:: ds 1
|
||||||
|
|
||||||
W_LISTTYPE:: ; d0b6
|
wNameListType:: ; d0b6
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
wPredefBank:: ; d0b7
|
wPredefBank:: ; d0b7
|
||||||
|
|
@ -1269,16 +1280,23 @@ W_MONHPADDING:: ; d0d7
|
||||||
|
|
||||||
|
|
||||||
W_DAMAGE:: ; d0d7
|
W_DAMAGE:: ; d0d7
|
||||||
ds 1
|
ds 2
|
||||||
|
|
||||||
wd0d8:: ds 3
|
ds 2
|
||||||
|
|
||||||
wRepelRemainingSteps:: ; wd0db
|
wRepelRemainingSteps:: ; wd0db
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
wd0dc:: ds 4
|
wMoves:: ; wd0dc
|
||||||
wd0e0:: ds 1
|
; list of moves for FormatMovesString
|
||||||
wd0e1:: ds 56
|
ds 4
|
||||||
|
|
||||||
|
wMoveNum:: ; d0e0
|
||||||
|
ds 1
|
||||||
|
|
||||||
|
wMovesString:: ; d0e1
|
||||||
|
ds 56
|
||||||
|
|
||||||
wd119:: ds 1
|
wd119:: ds 1
|
||||||
|
|
||||||
wWalkBikeSurfStateCopy:: ; d11a
|
wWalkBikeSurfStateCopy:: ; d11a
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue