serial/trade/misc

This commit is contained in:
YamaArashi 2015-02-07 02:43:08 -08:00
parent 9de54645c8
commit 3fdb8a0d89
74 changed files with 1934 additions and 1648 deletions

View file

@ -30,6 +30,9 @@ OAM_X_FLIP EQU 5
OAM_Y_FLIP EQU 6 OAM_Y_FLIP EQU 6
OAM_PRIORITY EQU 7 ; 0: OBJ above BG, 1: OBJ behind BG (colors 1-3) OAM_PRIORITY EQU 7 ; 0: OBJ above BG, 1: OBJ behind BG (colors 1-3)
; serial
START_TRANSFER_EXTERNAL_CLOCK EQU $80
START_TRANSFER_INTERNAL_CLOCK EQU $81
; Hardware registers ; Hardware registers
rJOYP EQU $ff00 ; Joypad (R/W) rJOYP EQU $ff00 ; Joypad (R/W)

View file

@ -27,3 +27,39 @@ NPC_MOVEMENT_DOWN EQU $00
NPC_MOVEMENT_UP EQU $40 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
; two option menu constants
YES_NO_MENU EQU 0
NORTH_WEST_MENU EQU 1
SOUTH_EAST_MENU EQU 2
WIDE_YES_NO_MENU EQU 3
NORTH_EAST_MENU EQU 4
TRADE_CANCEL_MENU EQU 5
HEAL_CANCEL_MENU EQU 6
NO_YES_MENU EQU 7
; serial
ESTABLISH_CONNECTION_WITH_INTERNAL_CLOCK EQU $01
ESTABLISH_CONNECTION_WITH_EXTERNAL_CLOCK EQU $02
USING_EXTERNAL_CLOCK EQU $01
USING_INTERNAL_CLOCK EQU $02
CONNECTION_NOT_ESTABLISHED EQU $ff
; signals the start of an array of bytes transferred over the link cable
SERIAL_PREAMBLE_BYTE EQU $FD
; this byte is used when there is no data to send
SERIAL_NO_DATA_BYTE EQU $FE
; signals the end of one part of a patch list (there are two parts) for player/enemy party data
SERIAL_PATCH_LIST_PART_TERMINATOR EQU $FF
LINK_STATE_NONE EQU $00 ; not using link
LINK_STATE_IN_CABLE_CLUB EQU $01 ; in a cable club room (Colosseum or Trade Centre)
LINK_STATE_START_TRADE EQU $02 ; pre-trade selection screen initialisation
LINK_STATE_START_BATTLE EQU $03 ; pre-battle initialisation
LINK_STATE_BATTLING EQU $04 ; in a link battle
LINK_STATE_RESET EQU $05 ; reset game (unused)
LINK_STATE_TRADING EQU $32 ; in a link trade

View file

@ -175,10 +175,10 @@ NUM_ATTACKS EQU const_value + -1
const STATUS_AFFECTED_ANIM const STATUS_AFFECTED_ANIM
const ANIM_A8 const ANIM_A8
const ANIM_A9 const ANIM_A9
const ANIM_AA const TRADE_BALL_DROP_ANIM
const ANIM_AB const TRADE_BALL_SHAKE_ANIM
const ANIM_AC const TRADE_BALL_TILT_ANIM
const ANIM_AD const TRADE_BALL_POOF_ANIM
const XSTATITEM_ANIM ; use X Attack/Defense/Speed/Special const XSTATITEM_ANIM ; use X Attack/Defense/Speed/Special
const ANIM_AF const ANIM_AF
const ANIM_B0 const ANIM_B0

View file

@ -2,13 +2,9 @@
SPRITEBUFFERSIZE EQU 7*7 * 8 ; 7 * 7 (tiles) * 8 (bytes per tile) SPRITEBUFFERSIZE EQU 7*7 * 8 ; 7 * 7 (tiles) * 8 (bytes per tile)
; Overload W_GRASSMONS ; Overload W_GRASSMONS
wd893 EQU $d893 ; W_GRASSMONS + 11 wSerialEnemyDataBlock EQU $d893 ; W_GRASSMONS + 11
wd896 EQU $d896 ; W_GRASSMONS + 14
; Overload enemy party data ; Overload enemy party data
W_WATERRATE EQU $d8a4 ; wEnemyMon1Species W_WATERRATE EQU $d8a4 ; wEnemyMon1Species
W_WATERMONS EQU $d8a5 ; wEnemyMon1Species + 1 W_WATERMONS EQU $d8a5 ; wEnemyMon1Species + 1
; Overload enemy stat modifiers
wTradeMonNick EQU $cd1e ; wPlayerMonAccuracyMod

View file

@ -177,19 +177,19 @@ HiddenObjectPointers: ; 46a96 (11:6a96)
; format: y-coord, x-coord, text id/item id, object routine ; format: y-coord, x-coord, text id/item id, object routine
BattleCenterHiddenObjects: ; 46b40 (11:6b40) BattleCenterHiddenObjects: ; 46b40 (11:6b40)
db $04,$05,$d0 db $04,$05,$d0
db BANK(PrintJustAMomentText2) db BANK(CableClubRightGameboy)
dw PrintJustAMomentText2 dw CableClubRightGameboy
db $04,$04,$d0 db $04,$04,$d0
db BANK(PrintJustAMomentText1) db BANK(CableClubLeftGameboy)
dw PrintJustAMomentText1 dw CableClubLeftGameboy
db $FF db $FF
TradeCenterHiddenObjects: ; 46b4d (11:6b4d) TradeCenterHiddenObjects: ; 46b4d (11:6b4d)
db $04,$05,$d0 db $04,$05,$d0
db BANK(PrintJustAMomentText2) db BANK(CableClubRightGameboy)
dw PrintJustAMomentText2 dw CableClubRightGameboy
db $04,$04,$d0 db $04,$04,$d0
db BANK(PrintJustAMomentText1) db BANK(CableClubLeftGameboy)
dw PrintJustAMomentText1 dw CableClubLeftGameboy
db $FF db $FF
RedsHouse2FHiddenObjects: ; 46b5a (11:6b5a) RedsHouse2FHiddenObjects: ; 46b5a (11:6b5a)
db $01,$00,$04 db $01,$00,$04

View file

@ -1,6 +1,6 @@
GainExperience: ; 5524f (15:524f) GainExperience: ; 5524f (15:524f)
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
ret z ; return if link battle ret z ; return if link battle
call DivideExpDataByNumMonsGainingExp call DivideExpDataByNumMonsGainingExp
ld hl, wPartyMon1 ld hl, wPartyMon1
@ -226,8 +226,8 @@ GainExperience: ; 5524f (15:524f)
ld a, [W_PLAYERBATTSTATUS3] ld a, [W_PLAYERBATTSTATUS3]
bit 3, a ; is the mon transformed? bit 3, a ; is the mon transformed?
jr nz, .recalcStatChanges jr nz, .recalcStatChanges
; the mon is transformed, so copy transformed data ; the mon is not transformed, so update the unmodified stats
ld de, wcd0f ld de, wPlayerMonUnmodifiedLevel
ld bc, $b ld bc, $b
call CopyData call CopyData
.recalcStatChanges .recalcStatChanges

View file

@ -127,8 +127,8 @@ BattleTransition: ; 7096d (1c:496d)
call Delay3 call Delay3
call LoadBattleTransitionTile call LoadBattleTransitionTile
ld bc, $0 ld bc, $0
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jr z, .linkBattle jr z, .linkBattle
call GetBattleTransitionID_WildOrTrainer call GetBattleTransitionID_WildOrTrainer
call GetBattleTransitionID_CompareLevels call GetBattleTransitionID_CompareLevels

View file

@ -1,6 +1,6 @@
EndOfBattle: ; 137aa (4:77aa) EndOfBattle: ; 137aa (4:77aa)
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jr nz, .notLinkBattle jr nz, .notLinkBattle
; link battle ; link battle
ld a, [wEnemyMonPartyPos] ld a, [wEnemyMonPartyPos]
@ -110,7 +110,7 @@ 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 were standing ; determine if wild pokémon can appear in the half-block were standing
; 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 are we standing a grass/water tile?
hlCoord 9, 9 hlCoord 9, 9
ld c, [hl] ld c, [hl]
@ -122,9 +122,9 @@ Func_13870: ; 13870 (4:7870)
cp c cp c
ld a, [W_WATERRATE] ld a, [W_WATERRATE]
jr z, .CanEncounter jr z, .CanEncounter
; even if not in grass/water, standing anywhere we can encounter pokémon ; even if not in grass/water, standing anywhere we can encounter pokémon
; so long as the map is “indoor” and has wild pokémon defined. ; so long as the map is “indoor” and has wild pokémon defined.
; …as long as its not Viridian Forest or Safari Zone. ; …as long as its 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, .CantEncounter
@ -148,7 +148,7 @@ 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 were standing ; determine which wild pokémon (grass or water) can appear in the half-block were standing
ld c, [hl] ld c, [hl]
ld hl, W_GRASSMONS ld hl, W_GRASSMONS
aCoord 8, 9 aCoord 8, 9
@ -314,7 +314,7 @@ HazeEffect_: ; 139da (4:79da)
call Func_13a43 call Func_13a43
ld hl, wEnemyMonAttackMod ld hl, wEnemyMonAttackMod
call Func_13a43 call Func_13a43
ld hl, wcd12 ld hl, wPlayerMonUnmodifiedAttack
ld de, wBattleMonAttack ld de, wBattleMonAttack
call Func_13a4a call Func_13a4a
ld hl, wEnemyMonUnmodifiedAttack ld hl, wEnemyMonUnmodifiedAttack
@ -387,7 +387,7 @@ StatusChangesEliminatedText: ; 13a53 (4:7a53)
GetTrainerName_: ; 13a58 (4:7a58) GetTrainerName_: ; 13a58 (4:7a58)
ld hl, W_GRASSRATE ld hl, W_GRASSRATE
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
and a and a
jr nz, .rival jr nz, .rival
ld hl, W_RIVALNAME ; wd34a ld hl, W_RIVALNAME ; wd34a

View file

@ -528,9 +528,9 @@ Func_78e23: ; 78e23 (1e:4e23)
ld [wcc79], a ld [wcc79], a
ld b, $e4 ld b, $e4
ld a, [W_ANIMATIONID] ; W_ANIMATIONID ld a, [W_ANIMATIONID] ; W_ANIMATIONID
cp ANIM_AA cp TRADE_BALL_DROP_ANIM
jr c, .asm_78e3f jr c, .asm_78e3f
cp ANIM_AD + 1 cp TRADE_BALL_POOF_ANIM + 1
jr nc, .asm_78e3f jr nc, .asm_78e3f
ld b, $f0 ld b, $f0
.asm_78e3f .asm_78e3f
@ -700,13 +700,13 @@ AnimationIdSpecialEffects: ; 78ef5 (1e:4ef5)
db ROCK_SLIDE db ROCK_SLIDE
dw DoRockSlideSpecialEffects dw DoRockSlideSpecialEffects
db ANIM_AA db TRADE_BALL_DROP_ANIM
dw Func_79041 dw Func_79041
db ANIM_AB db TRADE_BALL_SHAKE_ANIM
dw Func_7904c dw Func_7904c
db ANIM_AC db TRADE_BALL_TILT_ANIM
dw Func_7907c dw Func_7907c
db TOSS_ANIM db TOSS_ANIM
@ -960,9 +960,9 @@ Func_7907c ; 507C
ld c,5 ld c,5
call DelayFrames call DelayFrames
pop bc pop bc
ld a,[$ffae] ; background scroll X ld a,[hSCX] ; background scroll X
sub a,8 ; scroll to the left sub a,8 ; scroll to the left
ld [$ffae],a ld [hSCX],a
pop de pop de
jr .loop jr .loop
@ -1307,9 +1307,9 @@ AnimationSlideMonUp: ; 7927a (1e:527a)
AnimationSlideMonDown: ; 79297 (1e:5297) AnimationSlideMonDown: ; 79297 (1e:5297)
; Slides the mon's sprite down out of the screen. ; Slides the mon's sprite down out of the screen.
xor a xor a
call Func_79842 call GetTileIDList
.asm_7929b .asm_7929b
call Func_79820 call GetMonSpriteTileMapPointerFromRowCount
push bc push bc
push de push de
call Func_79aae call Func_79aae
@ -1498,8 +1498,8 @@ AnimationFlashEnemyMonPic: ; 79398 (1e:5398)
AnimationShowMonPic: ; 7939e (1e:539e) AnimationShowMonPic: ; 7939e (1e:539e)
xor a xor a
call Func_79842 call GetTileIDList
call Func_79820 call GetMonSpriteTileMapPointerFromRowCount
call Func_79aae call Func_79aae
jp Delay3 jp Delay3
@ -1533,7 +1533,7 @@ AnimationShakeBackAndForth: ; 793b1 (1e:53b1)
push af push af
push hl push hl
push hl push hl
call Func_79842 call GetTileIDList
pop hl pop hl
call Func_79aae call Func_79aae
call Delay3 call Delay3
@ -1541,7 +1541,7 @@ AnimationShakeBackAndForth: ; 793b1 (1e:53b1)
ld bc, $0709 ld bc, $0709
call ClearScreenArea call ClearScreenArea
pop af pop af
call Func_79842 call GetTileIDList
pop hl pop hl
call Func_79aae call Func_79aae
call Delay3 call Delay3
@ -1568,7 +1568,7 @@ AnimationMoveMonHorizontally: ; 793f9 (1e:53f9)
.asm_79407 .asm_79407
xor a xor a
push hl push hl
call Func_79842 call GetTileIDList
pop hl pop hl
call Func_79aae call Func_79aae
ld c, $3 ld c, $3
@ -1863,8 +1863,8 @@ AnimationSlideMonDownAndHide: ; 795c9 (1e:55c9)
call AnimationHideMonPic call AnimationHideMonPic
pop af pop af
push af push af
call Func_79842 call GetTileIDList
call Func_79820 call GetMonSpriteTileMapPointerFromRowCount
call Func_79aae call Func_79aae
ld c, $8 ld c, $8
call DelayFrames call DelayFrames
@ -2133,8 +2133,8 @@ Func_79793: ; 79793 (1e:5793)
call GetMonHeader call GetMonHeader
predef LoadMonBackPic predef LoadMonBackPic
xor a xor a
call Func_79842 call GetTileIDList
call Func_79820 call GetMonSpriteTileMapPointerFromRowCount
call Func_79aae call Func_79aae
pop af pop af
ld [wBattleMonSpecies2], a ld [wBattleMonSpecies2], a
@ -2194,37 +2194,46 @@ Func_7980c: ; 7980c (1e:580c)
pop hl pop hl
ret ret
Func_79820: ; 79820 (1e:5820) ; puts the tile map destination address of a mon sprite in hl, given the row count in b
; The usual row count is 7, but it may be smaller when sliding a mon sprite in/out,
; in order to show only a portion of the mon sprite.
GetMonSpriteTileMapPointerFromRowCount: ; 79820 (1e:5820)
push de push de
ld a, [H_WHOSETURN] ; $fff3 ld a, [H_WHOSETURN]
and a and a
jr nz, .asm_7982a jr nz, .enemyTurn
ld a, $65 ld a, 20 * 5 + 1
jr .asm_7982c jr .next
.asm_7982a .enemyTurn
ld a, $c ld a, 12
.asm_7982c .next
ld hl, wTileMap ld hl, wTileMap
ld e, a ld e, a
ld d, $0 ld d, 0
add hl, de add hl, de
ld a, $7 ld a, 7
sub b sub b
and a and a
jr z, .asm_79840 jr z, .done
ld de, $14 ld de, 20
.asm_7983c .loop
add hl, de add hl, de
dec a dec a
jr nz, .asm_7983c jr nz, .loop
.asm_79840 .done
pop de pop de
ret ret
Func_79842: ; 79842 (1e:5842) ; Input:
ld hl, PointerTable_79aea ; $5aea ; a = tile ID list index
; Output:
; de = tile ID list pointer
; b = number of rows
; c = number of columns
GetTileIDList: ; 79842 (1e:5842)
ld hl, TileIDListPointerTable
ld e, a ld e, a
ld d, $0 ld d, 0
add hl, de add hl, de
add hl, de add hl, de
add hl, de add hl, de
@ -2486,13 +2495,14 @@ MoveSoundTable: ; 798bc (1e:58bc)
db (SFX_08_4b - SFX_Headers_08) / 3,$00,$80 db (SFX_08_4b - SFX_Headers_08) / 3,$00,$80
Func_79aae: ; 79aae (1e:5aae) Func_79aae: ; 79aae (1e:5aae)
ld a, [H_WHOSETURN] ; $fff3 ld a, [H_WHOSETURN]
and a and a
ld a, $31 ld a, $31 ; base tile ID of player mon sprite
jr z, .asm_79ab6 jr z, .asm_79ab6
xor a ; enemy turn
xor a ; base tile ID of enemy mon sprite
.asm_79ab6 .asm_79ab6
ld [H_DOWNARROWBLINKCNT1], a ; $ff8b ld [hBaseTileID], a
jr asm_79acb jr asm_79acb
Func_79aba: ; 79aba (1e:5aba) Func_79aba: ; 79aba (1e:5aba)
@ -2506,34 +2516,36 @@ Func_79aba: ; 79aba (1e:5aba)
ld de, Unknown_79b1b ; $5b1b ld de, Unknown_79b1b ; $5b1b
asm_79acb: ; 79acb (1e:5acb) asm_79acb: ; 79acb (1e:5acb)
xor a xor a
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
Func_79ace: ; 79ace (1e:5ace) ; b = number of rows
; c = number of columns
CopyTileIDs: ; 79ace (1e:5ace)
push hl push hl
.asm_79acf .rowLoop
push bc push bc
push hl push hl
ld a, [H_DOWNARROWBLINKCNT1] ; $ff8b ld a, [hBaseTileID]
ld b, a ld b, a
.asm_79ad4 .columnLoop
ld a, [de] ld a, [de]
add b add b
inc de inc de
ld [hli], a ld [hli], a
dec c dec c
jr nz, .asm_79ad4 jr nz, .columnLoop
pop hl pop hl
ld bc, $14 ld bc, 20
add hl, bc add hl, bc
pop bc pop bc
dec b dec b
jr nz, .asm_79acf jr nz, .rowLoop
ld a, $1 ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
pop hl pop hl
ret ret
PointerTable_79aea: ; 79aea (1e:5aea) TileIDListPointerTable: ; 79aea (1e:5aea)
dw Unknown_79b24 dw Unknown_79b24
db $77 db $77
dw Unknown_79b55 dw Unknown_79b55
@ -2552,34 +2564,79 @@ PointerTable_79aea: ; 79aea (1e:5aea)
db $3C db $3C
Unknown_79b02: ; 79b02 (1e:5b02) Unknown_79b02: ; 79b02 (1e:5b02)
db $31,$38,$46,$54,$5B,$32,$39,$47,$55,$5C,$34,$3B,$49,$57,$5E,$36,$3D,$4B,$59,$60,$37,$3E,$4C,$5A,$61 db $31,$38,$46,$54,$5B
db $32,$39,$47,$55,$5C
db $34,$3B,$49,$57,$5E
db $36,$3D,$4B,$59,$60
db $37,$3E,$4C,$5A,$61
Unknown_79b1b: ; 79b1b (1e:5b1b) Unknown_79b1b: ; 79b1b (1e:5b1b)
db $31,$46,$5B,$34,$49,$5E,$37,$4C,$61 db $31,$46,$5B
db $34,$49,$5E
db $37,$4C,$61
Unknown_79b24: ; 79b24 (1e:5b24) Unknown_79b24: ; 79b24 (1e:5b24)
db $00,$07,$0E,$15,$1C,$23,$2A,$01,$08,$0F,$16,$1D,$24,$2B,$02,$09,$10,$17,$1E,$25,$2C,$03,$0A,$11,$18,$1F,$26,$2D,$04,$0B,$12,$19,$20,$27,$2E,$05,$0C,$13,$1A,$21,$28,$2F,$06,$0D,$14,$1B,$22,$29,$30 db $00,$07,$0E,$15,$1C,$23,$2A
db $01,$08,$0F,$16,$1D,$24,$2B
db $02,$09,$10,$17,$1E,$25,$2C
db $03,$0A,$11,$18,$1F,$26,$2D
db $04,$0B,$12,$19,$20,$27,$2E
db $05,$0C,$13,$1A,$21,$28,$2F
db $06,$0D,$14,$1B,$22,$29,$30
Unknown_79b55: ; 79b55 (1e:5b55) Unknown_79b55: ; 79b55 (1e:5b55)
db $00,$07,$0E,$15,$1C,$23,$2A,$01,$08,$0F,$16,$1D,$24,$2B,$03,$0A,$11,$18,$1F,$26,$2D,$04,$0B,$12,$19,$20,$27,$2E,$05,$0C,$13,$1A,$21,$28,$2F db $00,$07,$0E,$15,$1C,$23,$2A
db $01,$08,$0F,$16,$1D,$24,$2B
db $03,$0A,$11,$18,$1F,$26,$2D
db $04,$0B,$12,$19,$20,$27,$2E
db $05,$0C,$13,$1A,$21,$28,$2F
Unknown_79b78: ; 79b78 (1e:5b78) Unknown_79b78: ; 79b78 (1e:5b78)
db $00,$07,$0E,$15,$1C,$23,$2A,$02,$09,$10,$17,$1E,$25,$2C,$04,$0B,$12,$19,$20,$27,$2E db $00,$07,$0E,$15,$1C,$23,$2A
db $02,$09,$10,$17,$1E,$25,$2C
db $04,$0B,$12,$19,$20,$27,$2E
Unknown_79b8d: ; 79b8d (1e:5b8d) Unknown_79b8d: ; 79b8d (1e:5b8d)
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$19,$00,$02,$06,$0B,$10,$14,$1A,$00,$00,$07,$0C,$11,$15,$1B,$00,$03,$08,$0D,$12,$16,$1C,$00,$04,$09,$0E,$13,$17,$1D,$1F,$05,$0A,$0F,$01,$18,$1E,$20 db $00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$19,$00
db $02,$06,$0B,$10,$14,$1A,$00
db $00,$07,$0C,$11,$15,$1B,$00
db $03,$08,$0D,$12,$16,$1C,$00
db $04,$09,$0E,$13,$17,$1D,$1F
db $05,$0A,$0F,$01,$18,$1E,$20
Unknown_79bbe: ; 79bbe (1e:5bbe) Unknown_79bbe: ; 79bbe (1e:5bbe)
db $00,$00,$00,$30,$00,$37,$00,$00,$00,$2B,$31,$34,$38,$3D,$21,$26,$2C,$01,$35,$39,$3E,$22,$27,$2D,$32,$36,$01,$00,$23,$28,$2E,$33,$01,$3A,$00,$24,$29,$2F,$01,$01,$3B,$00,$25,$2A,$01,$01,$01,$3C,$00 db $00,$00,$00,$30,$00,$37,$00
db $00,$00,$2B,$31,$34,$38,$3D
db $21,$26,$2C,$01,$35,$39,$3E
db $22,$27,$2D,$32,$36,$01,$00
db $23,$28,$2E,$33,$01,$3A,$00
db $24,$29,$2F,$01,$01,$3B,$00
db $25,$2A,$01,$01,$01,$3C,$00
Unknown_79bef: ; 79bef (1e:5bef) Unknown_79bef: ; 79bef (1e:5bef)
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$47,$4D,$00,$00,$00,$00,$00,$48,$4E,$52,$56,$5B,$3F,$43,$49,$4F,$53,$57,$5C,$40,$44,$4A,$50,$54,$58,$00,$41,$45,$4B,$51,$4C,$59,$5D,$42,$46,$4C,$4C,$55,$5A,$5E db $00,$00,$00,$00,$00,$00,$00
db $00,$00,$47,$4D,$00,$00,$00
db $00,$00,$48,$4E,$52,$56,$5B
db $3F,$43,$49,$4F,$53,$57,$5C
db $40,$44,$4A,$50,$54,$58,$00
db $41,$45,$4B,$51,$4C,$59,$5D
db $42,$46,$4C,$4C,$55,$5A,$5E
Unknown_79c20: ; 79c20 (1e:5c20) Unknown_79c20: ; 79c20 (1e:5c20)
db $31,$32,$32,$32,$32,$33,$34,$35,$36,$36,$37,$38,$34,$39,$3A,$3A,$3B,$38,$3C,$3D,$3E,$3E,$3F,$40,$41,$42,$43,$43,$44,$45,$46,$47,$43,$48,$49,$4A,$41,$43,$4B,$4C,$4D,$4E,$4F,$50,$50,$50,$51,$52 db $31,$32,$32,$32,$32,$33
db $34,$35,$36,$36,$37,$38
db $34,$39,$3A,$3A,$3B,$38
db $3C,$3D,$3E,$3E,$3F,$40
db $41,$42,$43,$43,$44,$45
db $46,$47,$43,$48,$49,$4A
db $41,$43,$4B,$4C,$4D,$4E
db $4F,$50,$50,$50,$51,$52
Unknown_79c50: ; 79c50 (1e:5c50) Unknown_79c50: ; 79c50 (1e:5c50)
db $43,$55,$56,$53,$53,$53,$53,$53,$53,$53,$53,$53,$43,$57,$58,$54,$54,$54,$54,$54,$54,$54,$54,$54,$43,$59,$5A,$43,$43,$43,$43,$43,$43,$43,$43,$43 db $43,$55,$56,$53,$53,$53,$53,$53,$53,$53,$53,$53
db $43,$57,$58,$54,$54,$54,$54,$54,$54,$54,$54,$54
db $43,$59,$5A,$43,$43,$43,$43,$43,$43,$43,$43,$43
AnimationLeavesFalling: ; 79c74 (1e:5c74) AnimationLeavesFalling: ; 79c74 (1e:5c74)
; Makes leaves float down from the top of the screen. This is used ; Makes leaves float down from the top of the screen. This is used
@ -2743,7 +2800,7 @@ AnimationShakeEnemyHUD: ; 79d77 (1e:5d77)
ld bc, 7 * 7 ld bc, 7 * 7
call CopyVideoData call CopyVideoData
xor a xor a
ld [$ffae], a ld [hSCX], a
ld hl, vBGMap0 ld hl, vBGMap0
call Func_79e0d call Func_79e0d
ld a, $90 ld a, $90
@ -2776,34 +2833,36 @@ AnimationShakeEnemyHUD: ; 79d77 (1e:5d77)
ld hl, vBGMap1 ld hl, vBGMap1
jp Func_79e0d jp Func_79e0d
Func_79dda: ; 79dda (1e:5dda) ; b = tile ID list index
; c = base tile ID
CopyTileIDsFromList: ; 79dda (1e:5dda)
call GetPredefRegisters call GetPredefRegisters
ld a, c ld a, c
ld [H_DOWNARROWBLINKCNT1], a ; $ff8b ld [hBaseTileID], a
ld a, b ld a, b
push hl push hl
call Func_79842 call GetTileIDList
pop hl pop hl
jp Func_79ace jp CopyTileIDs
Func_79de9: ; 79de9 (1e:5de9) Func_79de9: ; 79de9 (1e:5de9)
ld a, [$ffae] ld a, [hSCX]
ld [wTrainerSpriteOffset], a ld [wTrainerSpriteOffset], a
.asm_79dee .asm_79dee
ld a, [wTrainerSpriteOffset] ld a, [wTrainerSpriteOffset]
add d add d
ld [$ffae], a ld [hSCX], a
ld c, $2 ld c, $2
call DelayFrames call DelayFrames
ld a, [wTrainerSpriteOffset] ld a, [wTrainerSpriteOffset]
sub d sub d
ld [$ffae], a ld [hSCX], a
ld c, $2 ld c, $2
call DelayFrames call DelayFrames
dec e dec e
jr nz, .asm_79dee jr nz, .asm_79dee
ld a, [wTrainerSpriteOffset] ld a, [wTrainerSpriteOffset]
ld [$ffae], a ld [hSCX], a
ret ret
Func_79e0d: ; 79e0d (1e:5e0d) Func_79e0d: ; 79e0d (1e:5e0d)

View file

@ -99,7 +99,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, $1 ; the usual text box at the bottom of the screen
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
hlCoord 1, 5 hlCoord 1, 5
ld bc, $307 ld bc, $307
@ -240,7 +240,7 @@ StartBattle: ; 3c11e (f:411e)
jr .findFirstAliveEnemyMonLoop jr .findFirstAliveEnemyMonLoop
.foundFirstAliveEnemyMon .foundFirstAliveEnemyMon
ld a, d ld a, d
ld [wcc3e], a ld [wSerialExchangeNybbleReceiveData], a
ld a, [W_ISINBATTLE] ld a, [W_ISINBATTLE]
dec a ; is it a trainer battle? dec a ; is it a trainer battle?
call nz, EnemySendOutFirstMon ; if it is a trainer battle, send out enemy mon call nz, EnemySendOutFirstMon ; if it is a trainer battle, send out enemy mon
@ -345,8 +345,8 @@ StartBattle: ; 3c11e (f:411e)
; wild mon or link battle enemy ran from battle ; wild mon or link battle enemy ran from battle
EnemyRan: ; 3c202 (f:4202) EnemyRan: ; 3c202 (f:4202)
call LoadScreenTilesFromBuffer1 call LoadScreenTilesFromBuffer1
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
ld hl, WildRanText ld hl, WildRanText
jr nz, .printText jr nz, .printText
; link battle ; link battle
@ -431,11 +431,11 @@ MainInBattleLoop: ; 3c233 (f:4233)
jr nz, MainInBattleLoop ; if the player didn't select a move, jump jr nz, MainInBattleLoop ; if the player didn't select a move, jump
.selectEnemyMove .selectEnemyMove
call SelectEnemyMove call SelectEnemyMove
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jr nz, .noLinkBattle jr nz, .noLinkBattle
; link battle ; link battle
ld a, [wcc3e] ld a, [wSerialExchangeNybbleReceiveData]
cp $f cp $f
jp z, EnemyRan jp z, EnemyRan
cp $e cp $e
@ -838,7 +838,7 @@ FaintEnemyPokemon ; 0x3c567
ld hl, W_PLAYERBATTSTATUS1 ld hl, W_PLAYERBATTSTATUS1
res AttackingMultipleTimes, [hl] res AttackingMultipleTimes, [hl]
xor a xor a
ld [W_NUMHITS], a ld [wPlayerNumHits], a
ld hl, wd065 ; clear enemy statuses ld hl, wd065 ; clear enemy statuses
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a
@ -976,12 +976,12 @@ ReplaceFaintedEnemyMon: ; 3c664 (f:4664)
ld e, $30 ld e, $30
call GetBattleHealthBarColor call GetBattleHealthBarColor
callab DrawEnemyPokeballs callab DrawEnemyPokeballs
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jr nz, .notLinkBattle jr nz, .notLinkBattle
; link battle ; link battle
call LinkBattleExchangeData call LinkBattleExchangeData
ld a, [wcc3e] ld a, [wSerialExchangeNybbleReceiveData]
cp $f cp $f
ret z ret z
call LoadScreenTilesFromBuffer1 call LoadScreenTilesFromBuffer1
@ -1009,14 +1009,14 @@ TrainerBattleVictory: ; 3c696 (f:4696)
ld hl, W_FLAGS_D733 ld hl, W_FLAGS_D733
set 1, [hl] set 1, [hl]
.notrival .notrival
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
ld a, b ld a, b
call nz, PlayBattleVictoryMusic call nz, PlayBattleVictoryMusic
ld hl, TrainerDefeatedText ld hl, TrainerDefeatedText
call PrintText call PrintText
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
ret z ret z
call ScrollTrainerPicAfterBattle call ScrollTrainerPicAfterBattle
ld c, $28 ld c, $28
@ -1096,7 +1096,7 @@ RemoveFaintedPlayerMon: ; 3c741 (f:4741)
ld [wd083], a ld [wd083], a
call WaitForSoundToFinish call WaitForSoundToFinish
.skipWaitForSound .skipWaitForSound
ld hl, wcd05 ld hl, wEnemyNumHits
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld [wBattleMonStatus], a ld [wBattleMonStatus], a
@ -1136,7 +1136,7 @@ DoUseNextMonDialogue: ; 3c79b (f:479b)
hlCoord 13, 9 hlCoord 13, 9
ld bc, $a0e ld bc, $a0e
ld a, $14 ; yes/no text box ld a, $14 ; yes/no text box
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
ld a, [wd12e] ld a, [wd12e]
cp $2 ; did the player choose NO? cp $2 ; did the player choose NO?
@ -1169,8 +1169,8 @@ ChooseNextMon: ; 3c7d8 (f:47d8)
.monChosen .monChosen
call HasMonFainted call HasMonFainted
jr z, .goBackToPartyMenu ; if mon fainted, you have to choose another jr z, .goBackToPartyMenu ; if mon fainted, you have to choose another
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jr nz, .notLinkBattle jr nz, .notLinkBattle
inc a inc a
ld [wcd6a], a ld [wcd6a], a
@ -1204,8 +1204,8 @@ ChooseNextMon: ; 3c7d8 (f:47d8)
; called when player is out of usable mons. ; called when player is out of usable mons.
; prints approriate lose message, sets carry flag if player blacked out (special case for initial rival fight) ; prints approriate lose message, sets carry flag if player blacked out (special case for initial rival fight)
HandlePlayerBlackOut: ; 3c837 (f:4837) HandlePlayerBlackOut: ; 3c837 (f:4837)
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jr z, .notSony1Battle jr z, .notSony1Battle
ld a, [W_CUROPPONENT] ld a, [W_CUROPPONENT]
cp $c8 + SONY1 cp $c8 + SONY1
@ -1225,8 +1225,8 @@ HandlePlayerBlackOut: ; 3c837 (f:4837)
ld b, $0 ld b, $0
call GoPAL_SET call GoPAL_SET
ld hl, PlayerBlackedOutText2 ld hl, PlayerBlackedOutText2
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jr nz, .noLinkBattle jr nz, .noLinkBattle
ld hl, LinkBattleLostText ld hl, LinkBattleLostText
.noLinkBattle .noLinkBattle
@ -1385,10 +1385,10 @@ EnemySendOutFirstMon: ; 3c92a (f:492a)
call SlideTrainerPicOffScreen call SlideTrainerPicOffScreen
call PrintEmptyString call PrintEmptyString
call SaveScreenTilesToBuffer1 call SaveScreenTilesToBuffer1
ld a,[W_ISLINKBATTLE] ld a,[wLinkState]
cp 4 cp LINK_STATE_BATTLING
jr nz,.next jr nz,.next
ld a,[wcc3e] ld a,[wSerialExchangeNybbleReceiveData]
sub 4 sub 4
ld [wWhichPokemon],a ld [wWhichPokemon],a
jr .next3 jr .next3
@ -1442,8 +1442,8 @@ EnemySendOutFirstMon: ; 3c92a (f:492a)
ld a,[wPartyCount] ld a,[wPartyCount]
dec a dec a
jr z,.next4 jr z,.next4
ld a,[W_ISLINKBATTLE] ld a,[wLinkState]
cp 4 cp LINK_STATE_BATTLING
jr z,.next4 jr z,.next4
ld a,[W_OPTIONS] ld a,[W_OPTIONS]
bit 6,a bit 6,a
@ -1453,7 +1453,7 @@ EnemySendOutFirstMon: ; 3c92a (f:492a)
hlCoord 0, 7 hlCoord 0, 7
ld bc,$0801 ld bc,$0801
ld a,$14 ld a,$14
ld [wd125],a ld [wTextBoxID],a
call DisplayTextBoxID call DisplayTextBoxID
ld a,[wCurrentMenuItem] ld a,[wCurrentMenuItem]
and a and a
@ -1572,8 +1572,8 @@ TryRunningFromBattle: ; 3cab9 (f:4ab9)
ld a, [W_BATTLETYPE] ld a, [W_BATTLETYPE]
cp $2 cp $2
jp z, .canEscape ; jump if it's a safari battle jp z, .canEscape ; jump if it's a safari battle
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jp z, .canEscape jp z, .canEscape
ld a, [W_ISINBATTLE] ld a, [W_ISINBATTLE]
dec a dec a
@ -1654,8 +1654,8 @@ TryRunningFromBattle: ; 3cab9 (f:4ab9)
and a ; reset carry and a ; reset carry
ret ret
.canEscape .canEscape
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
ld a, $2 ld a, $2
jr nz, .playSound jr nz, .playSound
; link battle ; link battle
@ -1666,7 +1666,7 @@ TryRunningFromBattle: ; 3cab9 (f:4ab9)
ld [wPlayerMoveListIndex], a ld [wPlayerMoveListIndex], a
call LinkBattleExchangeData call LinkBattleExchangeData
call LoadScreenTilesFromBuffer1 call LoadScreenTilesFromBuffer1
ld a, [wcc3e] ld a, [wSerialExchangeNybbleReceiveData]
cp $f cp $f
ld a, $2 ld a, $2
jr z, .playSound jr z, .playSound
@ -2082,7 +2082,7 @@ DisplayBattleMenu: ; 3ceb3 (f:4eb3)
jr nz, .menuselected jr nz, .menuselected
ld a, $1b ; regular menu id ld a, $1b ; regular menu id
.menuselected .menuselected
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
ld a, [W_BATTLETYPE] ld a, [W_BATTLETYPE]
dec a dec a
@ -2234,8 +2234,8 @@ DisplayBattleMenu: ; 3ceb3 (f:4eb3)
jp nz, PartyMenuOrRockOrRun jp nz, PartyMenuOrRockOrRun
; either the bag (normal battle) or bait (safari battle) was selected ; either the bag (normal battle) or bait (safari battle) was selected
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jr nz, .notLinkBattle jr nz, .notLinkBattle
; can't use items in link battles ; can't use items in link battles
@ -2401,7 +2401,7 @@ PartyMenuOrRockOrRun:
jr .checkIfPartyMonWasSelected jr .checkIfPartyMonWasSelected
.partyMonWasSelected .partyMonWasSelected
ld a, $c ; switch/stats/cancel menu ld a, $c ; switch/stats/cancel menu
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
ld hl, wTopMenuItemY ld hl, wTopMenuItemY
ld a, $c ld a, $c
@ -2620,8 +2620,8 @@ MoveSelectionMenu: ; 3d219 (f:5219)
dec a dec a
ld b, $c3 ld b, $c3
jr z, .matchedkeyspicked jr z, .matchedkeyspicked
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jr z, .matchedkeyspicked jr z, .matchedkeyspicked
ld a, [W_FLAGS_D733] ld a, [W_FLAGS_D733]
bit 0, a bit 0, a
@ -2974,14 +2974,14 @@ TypeText: ; 3d55f (f:555f)
db "TYPE@" db "TYPE@"
SelectEnemyMove: ; 3d564 (f:5564) SelectEnemyMove: ; 3d564 (f:5564)
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
sub $4 sub $4
jr nz, .noLinkBattle jr nz, .noLinkBattle
; link battle ; link battle
call SaveScreenTilesToBuffer1 call SaveScreenTilesToBuffer1
call LinkBattleExchangeData call LinkBattleExchangeData
call LoadScreenTilesFromBuffer1 call LoadScreenTilesFromBuffer1
ld a, [wcc3e] ld a, [wSerialExchangeNybbleReceiveData]
cp $e cp $e
jp z, .asm_3d601 jp z, .asm_3d601
cp $d cp $d
@ -3068,7 +3068,7 @@ SelectEnemyMove: ; 3d564 (f:5564)
; this appears to exchange data with the other gameboy during link battles ; this appears to exchange data with the other gameboy during link battles
LinkBattleExchangeData: ; 3d605 (f:5605) LinkBattleExchangeData: ; 3d605 (f:5605)
ld a, $ff ld a, $ff
ld [wcc3e], a ld [wSerialExchangeNybbleReceiveData], a
ld a, [wPlayerMoveListIndex] ld a, [wPlayerMoveListIndex]
cp $f ; is the player running from battle? cp $f ; is the player running from battle?
jr z, .asm_3d630 jr z, .asm_3d630
@ -3091,24 +3091,24 @@ LinkBattleExchangeData: ; 3d605 (f:5605)
.asm_3d62f .asm_3d62f
ld a, b ld a, b
.asm_3d630 .asm_3d630
ld [wcc42], a ld [wSerialExchangeNybbleSendData], a
callab PrintWaitingText callab PrintWaitingText
.asm_3d63b .asm_3d63b
call Func_22c3 call Serial_ExchangeNybble
call DelayFrame call DelayFrame
ld a, [wcc3e] ld a, [wSerialExchangeNybbleReceiveData]
inc a inc a
jr z, .asm_3d63b jr z, .asm_3d63b
ld b, $a ld b, $a
.asm_3d649 .asm_3d649
call DelayFrame call DelayFrame
call Func_22c3 call Serial_ExchangeNybble
dec b dec b
jr nz, .asm_3d649 jr nz, .asm_3d649
ld b, $a ld b, $a
.asm_3d654 .asm_3d654
call DelayFrame call DelayFrame
call Func_22ed call Serial_SendZeroByte
dec b dec b
jr nz, .asm_3d654 jr nz, .asm_3d654
ret ret
@ -3296,7 +3296,7 @@ MirrorMoveCheck
ld hl,MultiHitText ld hl,MultiHitText
call PrintText call PrintText
xor a xor a
ld [W_NUMHITS],a ld [wPlayerNumHits],a
.executeOtherEffects .executeOtherEffects
ld a,[W_PLAYERMOVEEFFECT] ld a,[W_PLAYERMOVEEFFECT]
and a and a
@ -3529,7 +3529,7 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854)
ld a,[hli] ld a,[hli]
ld b,a ld b,a
ld c,[hl] ld c,[hl]
ld hl,wd075 ld hl,wPlayerBideAccumulatedDamage + 1
ld a,[hl] ld a,[hl]
add c ; acumulate damage taken add c ; acumulate damage taken
ld [hld],a ld [hld],a
@ -3548,7 +3548,7 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854)
call PrintText call PrintText
ld a,1 ld a,1
ld [W_PLAYERMOVEPOWER],a ld [W_PLAYERMOVEPOWER],a
ld hl,wd075 ld hl,wPlayerBideAccumulatedDamage + 1
ld a,[hld] ld a,[hld]
add a add a
ld b,a ld b,a
@ -3998,8 +3998,8 @@ OHKOText: ; 3dc83 (f:5c83)
CheckForDisobedience: ; 3dc88 (f:5c88) CheckForDisobedience: ; 3dc88 (f:5c88)
xor a xor a
ld [wcced], a ld [wcced], a
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jr nz, .checkIfMonIsTraded jr nz, .checkIfMonIsTraded
ld a, $1 ld a, $1
and a and a
@ -4424,8 +4424,8 @@ GetDamageVarsForEnemyAttack: ; 3de75 (f:5e75)
GetEnemyMonStat: ; 3df1c (f:5f1c) GetEnemyMonStat: ; 3df1c (f:5f1c)
push de push de
push bc push bc
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jr nz, .notLinkBattle jr nz, .notLinkBattle
ld hl, wEnemyMon1Stats ld hl, wEnemyMon1Stats
dec c dec c
@ -5627,11 +5627,11 @@ ExecuteEnemyMove: ; 3e6bc (f:66bc)
jp z, ExecuteEnemyMoveDone jp z, ExecuteEnemyMoveDone
call PrintGhostText call PrintGhostText
jp z, ExecuteEnemyMoveDone jp z, ExecuteEnemyMoveDone
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jr nz, .executeEnemyMove jr nz, .executeEnemyMove
ld b, $1 ld b, $1
ld a, [wcc3e] ld a, [wSerialExchangeNybbleReceiveData]
cp $e cp $e
jr z, .executeEnemyMove jr z, .executeEnemyMove
cp $4 cp $4
@ -5819,7 +5819,7 @@ asm_3e7ef: ; 3e7ef (f:67ef)
ld hl, HitXTimesText ld hl, HitXTimesText
call PrintText call PrintText
xor a xor a
ld [wcd05], a ld [wEnemyNumHits], a
.asm_3e873 .asm_3e873
ld a, [W_ENEMYMOVEEFFECT] ld a, [W_ENEMYMOVEEFFECT]
and a and a
@ -6028,7 +6028,7 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
ld a, [hli] ld a, [hli]
ld b, a ld b, a
ld c, [hl] ld c, [hl]
ld hl, wcd06 ld hl, wEnemyBideAccumulatedDamage + 1
ld a, [hl] ld a, [hl]
add c add c
ld [hld], a ld [hld], a
@ -6047,7 +6047,7 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
call PrintText call PrintText
ld a, $1 ld a, $1
ld [W_ENEMYMOVEPOWER], a ld [W_ENEMYMOVEPOWER], a
ld hl, wcd06 ld hl, wEnemyBideAccumulatedDamage + 1
ld a, [hld] ld a, [hld]
add a add a
ld b, a ld b, a
@ -6152,8 +6152,8 @@ GetCurrentMove: ; 3eabe (f:6abe)
jp CopyStringToCF4B jp CopyStringToCF4B
LoadEnemyMonData: ; 3eb01 (f:6b01) LoadEnemyMonData: ; 3eb01 (f:6b01)
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jp z, LoadEnemyMonFromParty jp z, LoadEnemyMonFromParty
ld a, [wEnemyMonSpecies2] ld a, [wEnemyMonSpecies2]
ld [wEnemyMonSpecies], a ld [wEnemyMonSpecies], a
@ -6312,8 +6312,8 @@ LoadEnemyMonData: ; 3eb01 (f:6b01)
; calls BattleTransition to show the battle transition animation and initializes some battle variables ; calls BattleTransition to show the battle transition animation and initializes some battle variables
DoBattleTransitionAndInitBattleVariables: ; 3ec32 (f:6c32) DoBattleTransitionAndInitBattleVariables: ; 3ec32 (f:6c32)
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jr nz, .next jr nz, .next
; link battle ; link battle
xor a xor a
@ -6616,8 +6616,8 @@ CalculateModifiedStat: ; 3eda5 (f:6da5)
ret ret
ApplyBadgeStatBoosts: ; 3ee19 (f:6e19) ApplyBadgeStatBoosts: ; 3ee19 (f:6e19)
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
ret z ; return if link battle ret z ; return if link battle
ld a, [W_OBTAINEDBADGES] ld a, [W_OBTAINEDBADGES]
ld b, a ld b, a
@ -6706,19 +6706,19 @@ PrintEmptyString: ; 3ee94 (f:6e94)
BattleRandom: BattleRandom:
; Link battles use a shared PRNG. ; Link battles use a shared PRNG.
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jp nz, Random jp nz, Random
push hl push hl
push bc push bc
ld a, [wLinkBattleRNCount] ld a, [wLinkBattleRandomNumberListIndex]
ld c, a ld c, a
ld b, 0 ld b, 0
ld hl, wd148 ld hl, wLinkBattleRandomNumberList
add hl, bc add hl, bc
inc a inc a
ld [wLinkBattleRNCount], a ld [wLinkBattleRandomNumberListIndex], a
cp 9 cp 9
ld a, [hl] ld a, [hl]
pop bc pop bc
@ -6732,8 +6732,9 @@ BattleRandom:
; point to seed 0 so we pick the first number the next time ; point to seed 0 so we pick the first number the next time
xor a xor a
ld [wLinkBattleRNCount], a ld [wLinkBattleRandomNumberListIndex], a
ld hl, wd148
ld hl, wLinkBattleRandomNumberList
ld b, 9 ld b, 9
.loop .loop
ld a, [hl] ld a, [hl]
@ -6939,7 +6940,7 @@ _LoadTrainerPic: ; 3f04b (f:704b)
ld e, a ld e, a
ld a, [wd034] ld a, [wd034]
ld d, a ; de contains pointer to trainer pic ld d, a ; de contains pointer to trainer pic
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
and a and a
ld a, Bank(TrainerPics) ; this is where all the trainer pics are (not counting Red's) ld a, Bank(TrainerPics) ; this is where all the trainer pics are (not counting Red's)
jr z, .loadSprite jr z, .loadSprite
@ -7698,8 +7699,8 @@ StatModifierDownEffect: ; 3f54c (f:754c)
ld hl, wPlayerMonStatMods ld hl, wPlayerMonStatMods
ld de, W_ENEMYMOVEEFFECT ld de, W_ENEMYMOVEEFFECT
ld bc, W_PLAYERBATTSTATUS1 ld bc, W_PLAYERBATTSTATUS1
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jr z, .statModifierDownEffect jr z, .statModifierDownEffect
call BattleRandom call BattleRandom
cp $40 ; 1/4 chance to miss by in regular battle cp $40 ; 1/4 chance to miss by in regular battle
@ -7934,13 +7935,13 @@ StatModifierRatios: ; 3f6cb (f:76cb)
BideEffect: ; 3f6e5 (f:76e5) BideEffect: ; 3f6e5 (f:76e5)
ld hl, W_PLAYERBATTSTATUS1 ld hl, W_PLAYERBATTSTATUS1
ld de, W_NUMHITS ld de, wPlayerBideAccumulatedDamage
ld bc, wPlayerNumAttacksLeft ld bc, wPlayerNumAttacksLeft
ld a, [H_WHOSETURN] ld a, [H_WHOSETURN]
and a and a
jr z, .bideEffect jr z, .bideEffect
ld hl, W_ENEMYBATTSTATUS1 ld hl, W_ENEMYBATTSTATUS1
ld de, wcd05 ld de, wEnemyBideAccumulatedDamage
ld bc, wEnemyNumAttacksLeft ld bc, wEnemyNumAttacksLeft
.bideEffect .bideEffect
set StoringEnergy, [hl] ; mon is now using bide set StoringEnergy, [hl] ; mon is now using bide
@ -8096,13 +8097,13 @@ WasBlownAwayText: ; 3f80c (f:780c)
TwoToFiveAttacksEffect: ; 3f811 (f:7811) TwoToFiveAttacksEffect: ; 3f811 (f:7811)
ld hl, W_PLAYERBATTSTATUS1 ld hl, W_PLAYERBATTSTATUS1
ld de, wPlayerNumAttacksLeft ld de, wPlayerNumAttacksLeft
ld bc, W_NUMHITS ld bc, wPlayerNumHits
ld a, [H_WHOSETURN] ld a, [H_WHOSETURN]
and a and a
jr z, .twoToFiveAttacksEffect jr z, .twoToFiveAttacksEffect
ld hl, W_ENEMYBATTSTATUS1 ld hl, W_ENEMYBATTSTATUS1
ld de, wEnemyNumAttacksLeft ld de, wEnemyNumAttacksLeft
ld bc, wcd05 ld bc, wEnemyNumHits
.twoToFiveAttacksEffect .twoToFiveAttacksEffect
bit AttackingMultipleTimes, [hl] ; is mon attacking multiple times? bit AttackingMultipleTimes, [hl] ; is mon attacking multiple times?
ret nz ret nz
@ -8394,8 +8395,8 @@ MimicEffect: ; 3f9ed (f:79ed)
ld hl, wBattleMonMoves ld hl, wBattleMonMoves
ld a, [W_PLAYERBATTSTATUS1] ld a, [W_PLAYERBATTSTATUS1]
jr nz, .asm_3fa13 jr nz, .asm_3fa13
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jr nz, .asm_3fa3a jr nz, .asm_3fa3a
ld hl, wEnemyMonMoves ld hl, wEnemyMonMoves
ld a, [W_ENEMYBATTSTATUS1] ld a, [W_ENEMYBATTSTATUS1]
@ -8500,8 +8501,8 @@ DisableEffect: ; 3fa8a (f:7a8a)
and a and a
ld hl, wBattleMonPP ld hl, wBattleMonPP
jr nz, .asm_3facf jr nz, .asm_3facf
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
pop hl pop hl
jr nz, .asm_3fae1 jr nz, .asm_3fae1
push hl push hl
@ -8629,7 +8630,7 @@ ParalyzedMayNotAttackText: ; 3fb74 (f:7b74)
CheckTargetSubstitute: ; 3fb79 (f:7b79) CheckTargetSubstitute: ; 3fb79 (f:7b79)
push hl push hl
ld hl, W_ENEMYBATTSTATUS2 ld hl, W_ENEMYBATTSTATUS2
ld a, [$fff3] ld a, [H_WHOSETURN]
and a and a
jr z, .next1 jr z, .next1
ld hl, W_PLAYERBATTSTATUS2 ld hl, W_PLAYERBATTSTATUS2

View file

@ -9,7 +9,7 @@ DisplayLinkBattleVersusTextBox: ; 372d6 (d:72d6)
ld de, wPlayerName ld de, wPlayerName
call PlaceString call PlaceString
hlCoord 4, 10 hlCoord 4, 10
ld de, W_GRASSRATE ; enemy name ld de, wLinkEnemyTrainerName
call PlaceString call PlaceString
; place bold "VS" tiles between the names ; place bold "VS" tiles between the names
hlCoord 9, 8 hlCoord 9, 8

View file

@ -700,7 +700,7 @@ Func_39c37: ; 39c37 (e:5c37)
ReadTrainer: ; 39c53 (e:5c53) ReadTrainer: ; 39c53 (e:5c53)
; don't change any moves in a link battle ; don't change any moves in a link battle
ld a,[W_ISLINKBATTLE] ld a,[wLinkState]
and a and a
ret nz ret nz
@ -872,8 +872,8 @@ TrainerAI: ; 3a52e (e:652e)
ld a,[W_ISINBATTLE] ld a,[W_ISINBATTLE]
dec a dec a
ret z ; if not a trainer, we're done here ret z ; if not a trainer, we're done here
ld a,[W_ISLINKBATTLE] ld a,[wLinkState]
cp 4 cp LINK_STATE_BATTLING
ret z ret z
ld a,[W_TRAINERCLASS] ; what trainer class is this? ld a,[W_TRAINERCLASS] ; what trainer class is this?
dec a dec a
@ -1230,8 +1230,8 @@ SwitchEnemyMon: ; 3a74b (e:674b)
xor a xor a
ld [wd11d],a ld [wd11d],a
ld a,[W_ISLINKBATTLE] ld a,[wLinkState]
cp 4 cp LINK_STATE_BATTLING
ret z ret z
scf scf
ret ret

File diff suppressed because it is too large Load diff

View file

@ -7,10 +7,10 @@ Func_1c98a: ; 1c98a (7:498a)
call PrintText call PrintText
hlCoord 14, 7 hlCoord 14, 7
ld bc, $80f ld bc, $80f
ld a, $7 ld a, NO_YES_MENU
ld [wd12c], a ld [wTwoOptionMenuID], a
ld a, $14 ld a, $14
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem] ; wCurrentMenuItem
and a and a

View file

@ -17,7 +17,7 @@ EvolveTradeMon: ; 17d7d (5:7d7d)
; This was fixed in Yellow. ; This was fixed in Yellow.
ld a, [wTradeMonNick] ld a, [wInGameTradeReceiveMonName]
; GRAVELER ; GRAVELER
cp "G" cp "G"
@ -26,7 +26,7 @@ EvolveTradeMon: ; 17d7d (5:7d7d)
; "SPECTRE" (HAUNTER) ; "SPECTRE" (HAUNTER)
cp "S" cp "S"
ret nz ret nz
ld a, [wTradeMonNick + 1] ld a, [wInGameTradeReceiveMonName + 1]
cp "P" cp "P"
ret nz ret nz
@ -36,9 +36,9 @@ EvolveTradeMon: ; 17d7d (5:7d7d)
ld [wWhichPokemon], a ; wWhichPokemon ld [wWhichPokemon], a ; wWhichPokemon
ld a, $1 ld a, $1
ld [wccd4], a ld [wccd4], a
ld a, $32 ld a, LINK_STATE_TRADING
ld [W_ISLINKBATTLE], a ; W_ISLINKBATTLE ld [wLinkState], a
callab TryEvolvingMon callab TryEvolvingMon
xor a xor a ; LINK_STATE_NONE
ld [W_ISLINKBATTLE], a ; W_ISLINKBATTLE ld [wLinkState], a
jp PlayDefaultMusic jp PlayDefaultMusic

View file

@ -70,9 +70,9 @@ Evolution_PartyMonLoop: ; loop over party mons
cp EV_TRADE cp EV_TRADE
jr z, .checkTradeEvo jr z, .checkTradeEvo
; not trade evolution ; not trade evolution
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $32 ; in a trade? cp LINK_STATE_TRADING
jr z, Evolution_PartyMonLoop ; if so, go the next mon jr z, Evolution_PartyMonLoop ; if trading, go the next mon
ld a, b ld a, b
cp EV_ITEM cp EV_ITEM
jr z, .checkItemEvo jr z, .checkItemEvo
@ -83,9 +83,9 @@ Evolution_PartyMonLoop: ; loop over party mons
cp EV_LEVEL cp EV_LEVEL
jr z, .checkLevel jr z, .checkLevel
.checkTradeEvo .checkTradeEvo
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $32 ; in a trade? cp LINK_STATE_TRADING
jp nz, .nextEvoEntry1 ; if not, 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, [wcfb9]
@ -246,8 +246,8 @@ Evolution_PartyMonLoop: ; loop over party mons
pop hl pop hl
pop af pop af
ld [hTilesetType], a ld [hTilesetType], a
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $32 cp LINK_STATE_TRADING
ret z ret z
ld a, [W_ISINBATTLE] ld a, [W_ISINBATTLE]
and a and a
@ -312,9 +312,9 @@ IsEvolvingText: ; 3af4d (e:6f4d)
db "@" db "@"
Evolution_ReloadTilesetTilePatterns: ; 3af52 (e:6f52) Evolution_ReloadTilesetTilePatterns: ; 3af52 (e:6f52)
ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE ld a, [wLinkState]
cp $32 ; in a trade? cp LINK_STATE_TRADING
ret z ; if so, return ret z
jp ReloadTilesetTilePatterns jp ReloadTilesetTilePatterns
LearnMoveFromLevelUp: ; 3af5b (e:6f5b) LearnMoveFromLevelUp: ; 3af5b (e:6f5b)

View file

@ -10,7 +10,7 @@ StartSlotMachine: ; 37e2d (d:7e2d)
ld a, [wTrainerSpriteOffset] ld a, [wTrainerSpriteOffset]
and a and a
ret z ret z
ld a, [wcd05] ld a, [wUnknownSlotVar]
ld b, a ld b, a
ld a, [wTrainerFacingDirection] ld a, [wTrainerFacingDirection]
inc a inc a

View file

@ -97,9 +97,9 @@ HallOfFameText: ; 7026b (1c:426b)
Func_70278: ; 70278 (1c:4278) Func_70278: ; 70278 (1c:4278)
call ClearScreen call ClearScreen
ld a, $d0 ld a, $d0
ld [$ffaf], a ld [hSCY], a
ld a, $c0 ld a, $c0
ld [$ffae], a ld [hSCX], a
ld a, [wWhichTrade] ; wWhichTrade ld a, [wWhichTrade] ; wWhichTrade
ld [wcf91], a ld [wcf91], a
ld [wd0b5], a ld [wd0b5], a
@ -132,16 +132,16 @@ Func_70278: ; 70278 (1c:4278)
.asm_702c7 .asm_702c7
call .asm_702d5 call .asm_702d5
xor a xor a
ld [$ffaf], a ld [hSCY], a
ld c, a ld c, a
call Func_7036d call Func_7036d
ld d, $0 ld d, $0
ld e, $fc ld e, $fc
.asm_702d5 .asm_702d5
call DelayFrame call DelayFrame
ld a, [$ffae] ld a, [hSCX]
add e add e
ld [$ffae], a ld [hSCX], a
cp d cp d
jr nz, .asm_702d5 jr nz, .asm_702d5
ret ret
@ -200,7 +200,7 @@ Func_7033e: ; 7033e (1c:433e)
Func_7036d: ; 7036d (1c:436d) Func_7036d: ; 7036d (1c:436d)
ld b, $0 ld b, $0
hlCoord 12, 5 hlCoord 12, 5
predef_jump Func_79dda predef_jump CopyTileIDsFromList
Func_70377: ; 70377 (1c:4377) Func_70377: ; 70377 (1c:4377)
ld hl, wd747 ld hl, wd747

View file

@ -67,7 +67,7 @@ DisplayMonFrontSpriteInBox: ; 5dbd9 (17:5bd9)
ld [hWY], a ld [hWY], a
call SaveScreenTilesToBuffer1 call SaveScreenTilesToBuffer1
ld a, $11 ld a, $11
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
call UpdateSprites call UpdateSprites
ld a, [wcf91] ld a, [wcf91]

View file

@ -1,4 +1,4 @@
Predef54: ; 71ad9 (1c:5ad9) DoInGameTradeDialogue: ; 71ad9 (1c:5ad9)
; trigger the trade offer/action specified by wWhichTrade ; trigger the trade offer/action specified by wWhichTrade
call SaveScreenTilesToBuffer2 call SaveScreenTilesToBuffer2
ld hl,TradeMons ld hl,TradeMons
@ -8,15 +8,15 @@ Predef54: ; 71ad9 (1c:5ad9)
sub b sub b
sub b sub b
ld c,a ld c,a
ld b,$0 ld b,0
add hl,bc add hl,bc
ld a,[hli] ld a,[hli]
ld [wcd0f],a ld [wInGameTradeGiveMonSpecies],a
ld a,[hli] ld a,[hli]
ld [wcd34],a ld [wInGameTradeReceiveMonSpecies],a
ld a,[hli] ld a,[hli]
push af push af
ld de,wcd29 ld de,wInGameTradeMonNick
ld bc,$000b ld bc,$000b
call CopyData call CopyData
pop af pop af
@ -26,16 +26,16 @@ Predef54: ; 71ad9 (1c:5ad9)
add hl,hl add hl,hl
add hl,de add hl,de
ld a,[hli] ld a,[hli]
ld [wcd10],a ld [wInGameTradeTextPointerTablePointer],a
ld a,[hl] ld a,[hl]
ld [wcd11],a ld [wInGameTradeTextPointerTablePointer + 1],a
ld a,[wcd0f] ld a,[wInGameTradeGiveMonSpecies]
ld de,wcd13 ld de,wInGameTradeGiveMonName
call Func_71b6a call InGameTrade_GetMonName
ld a,[wcd34] ld a,[wInGameTradeReceiveMonSpecies]
ld de,wPlayerMonAccuracyMod ld de,wInGameTradeReceiveMonName
call Func_71b6a call InGameTrade_GetMonName
ld hl,wd737 ld hl,wCompletedInGameTradeFlags
ld a,[wWhichTrade] ld a,[wWhichTrade]
ld c,a ld c,a
ld b,$2 ld b,$2
@ -43,28 +43,29 @@ Predef54: ; 71ad9 (1c:5ad9)
ld a,c ld a,c
and a and a
ld a,$4 ld a,$4
ld [wcd12],a ld [wInGameTradeTextPointerTableIndex],a
jr nz,.asm_99bca ; 0x71b36 $20 jr nz,.printText
; if the trade hasn't been done yet
xor a xor a
ld [wcd12],a ld [wInGameTradeTextPointerTableIndex],a
call .asm_99bca call .printText
ld a,$1 ld a,$1
ld [wcd12],a ld [wInGameTradeTextPointerTableIndex],a
call YesNoChoice call YesNoChoice
ld a,[wCurrentMenuItem] ld a,[wCurrentMenuItem]
and a and a
jr nz,.asm_99bca ; 0x71b4b $b jr nz,.printText
call Func_71c07 call InGameTrade_DoTrade
jr c,.asm_99bca ; 0x71b50 $6 jr c,.printText
ld hl, TradedForText ld hl, TradedForText
call PrintText call PrintText
.asm_99bca ; 0x71b58 .printText
ld hl,wcd12 ld hl,wInGameTradeTextPointerTableIndex
ld a,[hld] ld a,[hld] ; wInGameTradeTextPointerTableIndex
ld e,a ld e,a
ld d,$0 ld d,0
ld a,[hld] ld a,[hld] ; wInGameTradeTextPointerTablePointer + 1
ld l,[hl] ld l,[hl] ; wInGameTradeTextPointerTablePointer
ld h,a ld h,a
add hl,de add hl,de
add hl,de add hl,de
@ -73,7 +74,8 @@ Predef54: ; 71ad9 (1c:5ad9)
ld l,a ld l,a
jp PrintText jp PrintText
Func_71b6a: ; 71b6a (1c:5b6a) ; copies name of species a to hl
InGameTrade_GetMonName: ; 71b6a (1c:5b6a)
push de push de
ld [wd11e],a ld [wd11e],a
call GetMonName call GetMonName
@ -84,30 +86,30 @@ Func_71b6a: ; 71b6a (1c:5b6a)
INCLUDE "data/trades.asm" INCLUDE "data/trades.asm"
Func_71c07: ; 71c07 (1c:5c07) InGameTrade_DoTrade: ; 71c07 (1c:5c07)
xor a xor a
ld [wd07d],a ld [wd07d],a
dec a dec a
ld [wUpdateSpritesEnabled],a ld [wUpdateSpritesEnabled],a
call DisplayPartyMenu call DisplayPartyMenu
push af push af
call Func_71ca2 call InGameTrade_RestoreScreen
pop af pop af
ld a,$1 ld a,$1
jp c,.asm_c4bc2 jp c,.tradeFailed ; jump if the player didn't select a pokemon
ld a,[wcd0f] ld a,[wInGameTradeGiveMonSpecies]
ld b,a ld b,a
ld a,[wcf91] ld a,[wcf91]
cp b cp b
ld a,$2 ld a,$2
jr nz,.asm_c4bc2 ; 0x71c26 $75 jr nz,.tradeFailed ; jump if the selected mon's species is not the required one
ld a,[wWhichPokemon] ld a,[wWhichPokemon]
ld hl,wPartyMon1Level ld hl,wPartyMon1Level
ld bc,$002c ld bc,$002c
call AddNTimes call AddNTimes
ld a,[hl] ld a,[hl]
ld [W_CURENEMYLVL],a ld [W_CURENEMYLVL],a
ld hl,wd737 ld hl,wCompletedInGameTradeFlags
ld a,[wWhichTrade] ld a,[wWhichTrade]
ld c,a ld c,a
ld b,$1 ld b,$1
@ -119,13 +121,13 @@ Func_71c07: ; 71c07 (1c:5c07)
ld a,[W_CURENEMYLVL] ld a,[W_CURENEMYLVL]
push af push af
call LoadHpBarAndStatusTilePatterns call LoadHpBarAndStatusTilePatterns
call Func_71cc1 call InGameTrade_PrepareTradeData
predef Func_410e2 predef Func_410e2
pop af pop af
ld [W_CURENEMYLVL],a ld [W_CURENEMYLVL],a
pop af pop af
ld [wWhichPokemon],a ld [wWhichPokemon],a
ld a,[wcd34] ld a,[wInGameTradeReceiveMonSpecies]
ld [wcf91],a ld [wcf91],a
xor a xor a
ld [wcc49],a ld [wcc49],a
@ -134,64 +136,64 @@ Func_71c07: ; 71c07 (1c:5c07)
ld a,$80 ld a,$80
ld [wcc49],a ld [wcc49],a
call AddPartyMon call AddPartyMon
call Func_71d19 call InGameTrade_CopyDataToReceivedMon
callab EvolveTradeMon callab EvolveTradeMon
call ClearScreen call ClearScreen
call Func_71ca2 call InGameTrade_RestoreScreen
callba RedrawMapView callba RedrawMapView
and a and a
ld a,$3 ld a,$3
jr .asm_ee803 ; 0x71c9b $1 jr .tradeSucceeded
.asm_c4bc2 ; 0x71c9d .tradeFailed
scf scf
.asm_ee803 ; 0x71c9e .tradeSucceeded
ld [wcd12],a ld [wInGameTradeTextPointerTableIndex],a
ret ret
Func_71ca2: ; 71ca2 (1c:5ca2) InGameTrade_RestoreScreen: ; 71ca2 (1c:5ca2)
call GBPalWhiteOutWithDelay3 call GBPalWhiteOutWithDelay3
call RestoreScreenTilesAndReloadTilePatterns call RestoreScreenTilesAndReloadTilePatterns
call ReloadTilesetTilePatterns call ReloadTilesetTilePatterns
call LoadScreenTilesFromBuffer2 call LoadScreenTilesFromBuffer2
call Delay3 call Delay3
call LoadGBPal call LoadGBPal
ld c, $a ld c, 10
call DelayFrames call DelayFrames
ld b, BANK(LoadWildData) ld b, BANK(LoadWildData)
ld hl, LoadWildData ld hl, LoadWildData
jp Bankswitch jp Bankswitch
Func_71cc1: ; 71cc1 (1c:5cc1) InGameTrade_PrepareTradeData: ; 71cc1 (1c:5cc1)
ld hl, wWhichTrade ; wWhichTrade ld hl, wTradedPlayerMonSpecies
ld a, [wcd0f] ld a, [wInGameTradeGiveMonSpecies]
ld [hli], a ld [hli], a ; wTradedPlayerMonSpecies
ld a, [wcd34] ld a, [wInGameTradeReceiveMonSpecies]
ld [hl], a ld [hl], a ; wTradedEnemyMonSpecies
ld hl, wPartyMonOT ; wd273 ld hl, wPartyMonOT
ld bc, $b ld bc, $b
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon]
call AddNTimes call AddNTimes
ld de, wTrainerScreenX ld de, wTradedPlayerMonOT
ld bc, $b ld bc, $b
call Func_71d11 call InGameTrade_CopyData
ld hl, String_71d59 ; $5d59 ld hl, InGameTrade_TrainerString
ld de, wcd4e ld de, wcd4e
call Func_71d11 call InGameTrade_CopyData
ld de, W_GRASSRATE ; W_GRASSRATE ld de, W_GRASSRATE
call Func_71d11 call InGameTrade_CopyData
ld hl, wPartyMon1OTID ; wPartyMon1OTID ld hl, wPartyMon1OTID
ld bc, $2c ld bc, wPartyMon2 - wPartyMon1
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon]
call AddNTimes call AddNTimes
ld de, wcd4c ld de, wTradedPlayerMonOTID
ld bc, $2 ld bc, $2
call Func_71d11 call InGameTrade_CopyData
call Random call Random
ld hl, hRandomAdd ld hl, hRandomAdd
ld de, wcd59 ld de, wTradedEnemyMonOTID
jp CopyData jp CopyData
Func_71d11: ; 71d11 (1c:5d11) InGameTrade_CopyData: ; 71d11 (1c:5d11)
push hl push hl
push bc push bc
call CopyData call CopyData
@ -199,35 +201,37 @@ Func_71d11: ; 71d11 (1c:5d11)
pop hl pop hl
ret ret
Func_71d19: ; 71d19 (1c:5d19) InGameTrade_CopyDataToReceivedMon: ; 71d19 (1c:5d19)
ld hl, wPartyMonNicks ; wPartyMonNicks ld hl, wPartyMonNicks
ld bc, $b ld bc, $b
call Func_71d4f call InGameTrade_GetReceivedMonPointer
ld hl, wcd29 ld hl, wInGameTradeMonNick
ld bc, $b ld bc, $b
call CopyData call CopyData
ld hl, wPartyMonOT ; wd273 ld hl, wPartyMonOT
ld bc, $b ld bc, $b
call Func_71d4f call InGameTrade_GetReceivedMonPointer
ld hl, String_71d59 ; $5d59 ld hl, InGameTrade_TrainerString
ld bc, $b ld bc, $b
call CopyData call CopyData
ld hl, wPartyMon1OTID ; wPartyMon1OTID ld hl, wPartyMon1OTID
ld bc, $2c ld bc, wPartyMon2 - wPartyMon1
call Func_71d4f call InGameTrade_GetReceivedMonPointer
ld hl, wcd59 ld hl, wTradedEnemyMonOTID
ld bc, $2 ld bc, $2
jp CopyData jp CopyData
Func_71d4f: ; 71d4f (1c:5d4f) ; the received mon's index is (partyCount - 1),
ld a, [wPartyCount] ; wPartyCount ; so this adds bc to hl (partyCount - 1) times and moves the result to de
InGameTrade_GetReceivedMonPointer: ; 71d4f (1c:5d4f)
ld a, [wPartyCount]
dec a dec a
call AddNTimes call AddNTimes
ld e, l ld e, l
ld d, h ld d, h
ret ret
String_71d59: ; 71d59 (1c:5d59) InGameTrade_TrainerString: ; 71d59 (1c:5d59)
; "TRAINER@@@@@@@@@@" ; "TRAINER@@@@@@@@@@"
db $5d, "@@@@@@@@@@" db $5d, "@@@@@@@@@@"

View file

@ -7,7 +7,7 @@ PlayIntro: ; 41682 (10:5682)
call PlayIntroScene call PlayIntroScene
call GBFadeOutToWhite call GBFadeOutToWhite
xor a xor a
ld [$ffae], a ld [hSCX], a
ld [H_AUTOBGTRANSFERENABLED], a ld [H_AUTOBGTRANSFERENABLED], a
call ClearSprites call ClearSprites
call DelayFrame call DelayFrame
@ -21,7 +21,7 @@ PlayIntroScene: ; 4169d (10:569d)
ld [rOBP0], a ld [rOBP0], a
ld [rOBP1], a ld [rOBP1], a
xor a xor a
ld [$ffae], a ld [hSCX], a
ld b, $3 ld b, $3
call Func_4183f call Func_4183f
ld a, 0 ld a, 0
@ -229,7 +229,7 @@ Func_4180e: ; 4180e (10:580e)
jr z, .asm_4181d jr z, .asm_4181d
cp $1 cp $1
jr z, .asm_4182d jr z, .asm_4182d
ld a, [$ffae] ld a, [hSCX]
dec a dec a
dec a dec a
jr .asm_41831 jr .asm_41831
@ -243,11 +243,11 @@ Func_4180e: ; 4180e (10:580e)
call Func_417ae call Func_417ae
pop de pop de
.asm_4182d .asm_4182d
ld a, [$ffae] ld a, [hSCX]
inc a inc a
inc a inc a
.asm_41831 .asm_41831
ld [$ffae], a ld [hSCX], a
push de push de
ld c, $2 ld c, $2
call CheckForUserInterruption call CheckForUserInterruption
@ -260,9 +260,9 @@ Func_4180e: ; 4180e (10:580e)
Func_4183f: ; 4183f (10:583f) Func_4183f: ; 4183f (10:583f)
hlCoord 13, 7 hlCoord 13, 7
Func_41842: ; 41842 (10:5842) CopyTileIDsFromList_ZeroBaseTileID: ; 41842 (10:5842)
ld c, $0 ld c, $0
predef_jump Func_79dda predef_jump CopyTileIDsFromList
Func_41849: ; 41849 (10:5849) Func_41849: ; 41849 (10:5849)
predef Func_79869 predef Func_79869

View file

@ -2098,7 +2098,7 @@ ItemUseTMHM: ; e479 (3:6479)
hlCoord 14, 7 hlCoord 14, 7
ld bc,$080f ld bc,$080f
ld a,$14 ld a,$14
ld [wd125],a ld [wTextBoxID],a
call DisplayTextBoxID ; yes/no menu call DisplayTextBoxID ; yes/no menu
ld a,[wCurrentMenuItem] ld a,[wCurrentMenuItem]
and a and a
@ -2489,7 +2489,7 @@ TossItem_: ; e6f1 (3:66f1)
hlCoord 14, 7 hlCoord 14, 7
ld bc,$080f ld bc,$080f
ld a,$14 ld a,$14
ld [wd125],a ld [wTextBoxID],a
call DisplayTextBoxID ; yes/no menu call DisplayTextBoxID ; yes/no menu
ld a,[wd12e] ld a,[wd12e]
cp a,2 cp a,2

View file

@ -79,7 +79,7 @@ AbandonLearning: ; 6eda (1:6eda)
hlCoord 14, 7 hlCoord 14, 7
ld bc, $80f ld bc, $80f
ld a, $14 ld a, $14
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem] ; wCurrentMenuItem
and a and a
@ -102,7 +102,7 @@ TryingToLearn: ; 6f07 (1:6f07)
hlCoord 14, 7 hlCoord 14, 7
ld bc, $80f ld bc, $80f
ld a, $14 ld a, $14
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
pop hl pop hl
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem] ; wCurrentMenuItem

View file

@ -508,48 +508,48 @@ MonWasReleasedText: ; 0x21820
TX_FAR _MonWasReleasedText TX_FAR _MonWasReleasedText
db "@" db "@"
PrintJustAMomentText1:: ; 5824 (8:5825) CableClubLeftGameboy:: ; 5824 (8:5825)
ld a, [$ffaa] ld a, [hSerialConnectionStatus]
cp $1 cp USING_EXTERNAL_CLOCK
ret z ret z
ld a, [wSpriteStateData1 + 9] ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
cp $c cp SPRITE_FACING_RIGHT
ret nz ret nz
ld a, [W_CURMAP] ld a, [W_CURMAP]
cp BATTLE_CENTER cp BATTLE_CENTER
ld a, $2 ld a, LINK_STATE_START_TRADE
jr z, .asm_2183a jr z, .asm_2183a
inc a inc a ; LINK_STATE_START_BATTLE
.asm_2183a .asm_2183a
ld [W_ISLINKBATTLE], a ld [wLinkState], a
call EnableAutoTextBoxDrawing call EnableAutoTextBoxDrawing
ld a, $22 ld a, $22 ; JustAMomentText
jp PrintPredefTextID jp PrintPredefTextID
PrintJustAMomentText2:: ; 5845 (8:5845) CableClubRightGameboy:: ; 5845 (8:5845)
ld a, [$ffaa] ld a, [hSerialConnectionStatus]
cp $2 cp USING_INTERNAL_CLOCK
ret z ret z
ld a, [wSpriteStateData1 + 9] ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
cp $8 cp SPRITE_FACING_LEFT
ret nz ret nz
ld a, [W_CURMAP] ld a, [W_CURMAP]
cp BATTLE_CENTER cp BATTLE_CENTER
ld a, $2 ld a, LINK_STATE_START_TRADE
jr z, .asm_2185a jr z, .asm_2185a
inc a inc a ; LINK_STATE_START_BATTLE
.asm_2185a .asm_2185a
ld [W_ISLINKBATTLE], a ld [wLinkState], a
call EnableAutoTextBoxDrawing call EnableAutoTextBoxDrawing
ld a, $22 ld a, $22 ; JustAMomentText
jp PrintPredefTextID jp PrintPredefTextID
JustAMomentText:: ; 21865 (8:5865) JustAMomentText:: ; 21865 (8:5865)
TX_FAR _JustAMomentText TX_FAR _JustAMomentText
db "@" db "@"
ld a, [wSpriteStateData1 + 9] ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
cp $4 cp SPRITE_FACING_UP
ret nz ret nz
call EnableAutoTextBoxDrawing call EnableAutoTextBoxDrawing
ld a, $23 ld a, $23

View file

@ -14,7 +14,7 @@ DisplayDiploma: ; 566e2 (15:66e2)
call FarCopyData2 call FarCopyData2
ld hl, wTileMap ld hl, wTileMap
ld bc, $1012 ld bc, $1012
predef Func_5ab0 predef Diploma_TextBoxBorder
ld hl, DiplomaTextPointersAndCoords ; $6784 ld hl, DiplomaTextPointersAndCoords ; $6784
ld c, $5 ld c, $5
.asm_56715 .asm_56715

View file

@ -14,8 +14,8 @@ MainMenu: ; 5af2 (1:5af2)
.next0 .next0
ld c,20 ld c,20
call DelayFrames call DelayFrames
xor a xor a ; LINK_STATE_NONE
ld [W_ISLINKBATTLE],a ld [wLinkState],a
ld hl,wcc2b ld hl,wcc2b
ld [hli],a ld [hli],a
ld [hli],a ld [hli],a
@ -133,7 +133,7 @@ LinkMenu: ; 5c0a (1:5c0a)
ld [wd358], a ld [wd358], a
ld hl, wd72e ld hl, wd72e
set 6, [hl] set 6, [hl]
ld hl, TextTerminator_6b20 ; $6b20 ld hl, TextTerminator_6b20
call PrintText call PrintText
call SaveScreenTilesToBuffer1 call SaveScreenTilesToBuffer1
ld hl, WhereWouldYouLikeText ld hl, WhereWouldYouLikeText
@ -149,7 +149,7 @@ LinkMenu: ; 5c0a (1:5c0a)
xor a xor a
ld [wcd37], a ld [wcd37], a
ld [wd72d], a ld [wd72d], a
ld hl, wTopMenuItemY ; wTopMenuItemY ld hl, wTopMenuItemY
ld a, $7 ld a, $7
ld [hli], a ld [hli], a
ld a, $6 ld a, $6
@ -163,97 +163,101 @@ LinkMenu: ; 5c0a (1:5c0a)
ld [hli], a ld [hli], a
xor a xor a
ld [hl], a ld [hl], a
.asm_5c52 .waitForInputLoop
call HandleMenuInput call HandleMenuInput
and $3 and A_BUTTON | B_BUTTON
add a add a
add a add a
ld b, a ld b, a
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem]
add b add b
add $d0 add $d0
ld [wcc42], a ld [wLinkMenuSelectionSendBuffer], a
ld [wcc43], a ld [wLinkMenuSelectionSendBuffer + 1], a
.asm_5c66 .exchangeMenuSelectionLoop
call Func_2247 call Serial_ExchangeLinkMenuSelection
ld a, [wcc3d] ld a, [wLinkMenuSelectionReceiveBuffer]
ld b, a ld b, a
and $f0 and $f0
cp $d0 cp $d0
jr z, .asm_5c7d jr z, .asm_5c7d
ld a, [wcc3e] ld a, [wLinkMenuSelectionReceiveBuffer + 1]
ld b, a ld b, a
and $f0 and $f0
cp $d0 cp $d0
jr nz, .asm_5c66 jr nz, .exchangeMenuSelectionLoop
.asm_5c7d .asm_5c7d
ld a, b ld a, b
and $c and $c ; did the enemy press A or B?
jr nz, .asm_5c8b jr nz, .enemyPressedAOrB
ld a, [wcc42] ; the enemy didn't press A or B
and $c ld a, [wLinkMenuSelectionSendBuffer]
jr z, .asm_5c52 and $c ; did the player press A or B?
jr .asm_5ca1 jr z, .waitForInputLoop ; if neither the player nor the enemy pressed A or B, try again
.asm_5c8b jr .doneChoosingMenuSelection ; if the player pressed A or B but the enemy didn't, use the player's selection
ld a, [wcc42] .enemyPressedAOrB
and $c ld a, [wLinkMenuSelectionSendBuffer]
jr z, .asm_5c98 and $c ; did the player press A or B?
ld a, [$ffaa] jr z, .useEnemyMenuSelection ; if the enemy pressed A or B but the player didn't, use the enemy's selection
cp $2 ; the enemy and the player both pressed A or B
jr z, .asm_5ca1 ; The gameboy that is clocking the connection wins.
.asm_5c98 ld a, [hSerialConnectionStatus]
cp USING_INTERNAL_CLOCK
jr z, .doneChoosingMenuSelection
.useEnemyMenuSelection
ld a, b ld a, b
ld [wcc42], a ld [wLinkMenuSelectionSendBuffer], a
and $3 and $3
ld [wCurrentMenuItem], a ; wCurrentMenuItem ld [wCurrentMenuItem], a ; wCurrentMenuItem
.asm_5ca1 .doneChoosingMenuSelection
ld a, [$ffaa] ld a, [hSerialConnectionStatus]
cp $2 cp USING_INTERNAL_CLOCK
jr nz, .asm_5cb1 jr nz, .skipStartingTransfer
call DelayFrame call DelayFrame
call DelayFrame call DelayFrame
ld a, $81 ld a, START_TRANSFER_INTERNAL_CLOCK
ld [$ff02], a ld [rSC], a
.asm_5cb1 .skipStartingTransfer
ld b, $7f ld b, $7f
ld c, $7f ld c, $7f
ld d, $ec ld d, $ec
ld a, [wcc42] ld a, [wLinkMenuSelectionSendBuffer]
and $8 and (B_BUTTON << 2) ; was B button pressed?
jr nz, .asm_5ccc jr nz, .updateCursorPosition
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ; A button was pressed
ld a, [wCurrentMenuItem]
cp $2 cp $2
jr z, .asm_5ccc jr z, .updateCursorPosition
ld c, d ld c, d
ld d, b ld d, b
dec a dec a
jr z, .asm_5ccc jr z, .updateCursorPosition
ld b, c ld b, c
ld c, d ld c, d
.asm_5ccc .updateCursorPosition
ld a, b ld a, b
Coorda 6, 7 Coorda 6, 7
ld a, c ld a, c
Coorda 6, 9 Coorda 6, 9
ld a, d ld a, d
Coorda 6, 11 Coorda 6, 11
ld c, $28 ld c, 40
call DelayFrames call DelayFrames
call LoadScreenTilesFromBuffer1 call LoadScreenTilesFromBuffer1
ld a, [wcc42] ld a, [wLinkMenuSelectionSendBuffer]
and $8 and (B_BUTTON << 2) ; was B button pressed?
jr nz, .asm_5d2d jr nz, .choseCancel ; cancel if B pressed
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem]
cp $2 cp $2
jr z, .asm_5d2d jr z, .choseCancel
xor a xor a
ld [wWalkBikeSurfState], a ld [wWalkBikeSurfState], a ; start walking
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem]
and a and a
ld a, TRADE_CENTER ld a, TRADE_CENTER
jr nz, .asm_5cfc jr nz, .next
ld a, BATTLE_CENTER ld a, BATTLE_CENTER
.asm_5cfc .next
ld [wd72d], a ld [wd72d], a
ld hl, PleaseWaitText ld hl, PleaseWaitText
call PrintText call PrintText
@ -261,23 +265,23 @@ LinkMenu: ; 5c0a (1:5c0a)
call DelayFrames call DelayFrames
ld hl, wd732 ld hl, wd732
res 1, [hl] res 1, [hl]
ld a, [W_ANIMATIONID] ; W_ANIMATIONID ld a, [W_ANIMATIONID]
ld [wDestinationMap], a ld [wDestinationMap], a
call SpecialWarpIn call SpecialWarpIn
ld c, $14 ld c, $14
call DelayFrames call DelayFrames
xor a xor a
ld [wMenuJoypadPollCount], a ; wMenuJoypadPollCount ld [wMenuJoypadPollCount], a
ld [wcc42], a ld [wSerialExchangeNybbleSendData], a
inc a inc a ; LINK_STATE_IN_CABLE_CLUB
ld [W_ISLINKBATTLE], a ; W_ISLINKBATTLE ld [wLinkState], a
ld [wcc47], a ld [wcc47], a
jr SpecialEnterMap jr SpecialEnterMap
.asm_5d2d .choseCancel
xor a xor a
ld [wMenuJoypadPollCount], a ; wMenuJoypadPollCount ld [wMenuJoypadPollCount], a
call Delay3 call Delay3
call Func_72d7 call CloseLinkConnection
ld hl, LinkCanceledText ld hl, LinkCanceledText
call PrintText call PrintText
ld hl, wd72e ld hl, wd72e

View file

@ -16,7 +16,7 @@ AskName: ; 64eb (1:64eb)
hlCoord 14, 7 hlCoord 14, 7
ld bc, $80f ld bc, $80f
ld a, $14 ld a, $14
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
pop hl pop hl
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem] ; wCurrentMenuItem

View file

@ -31,7 +31,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
.chosePokemon .chosePokemon
call SaveScreenTilesToBuffer1 ; save screen call SaveScreenTilesToBuffer1 ; save screen
ld a,$04 ld a,$04
ld [wd125],a ld [wTextBoxID],a
call DisplayTextBoxID ; display pokemon menu options call DisplayTextBoxID ; display pokemon menu options
ld hl,wWhichTrade ld hl,wWhichTrade
ld bc,$020c ; max menu item ID, top menu item Y ld bc,$020c ; max menu item ID, top menu item Y
@ -300,13 +300,13 @@ ItemMenuLoop: ; 132fc (4:72fc)
call GoPAL_SET_CF1C call GoPAL_SET_CF1C
StartMenu_Item: ; 13302 (4:7302) StartMenu_Item: ; 13302 (4:7302)
ld a,[W_ISLINKBATTLE] ld a,[wLinkState]
dec a dec a ; is the player in the Colosseum or Trade Centre?
jr nz,.notInLinkBattle jr nz,.notInCableClubRoom
ld hl,CannotUseItemsHereText ld hl,CannotUseItemsHereText
call PrintText call PrintText
jr .exitMenu jr .exitMenu
.notInLinkBattle .notInCableClubRoom
ld bc,wNumBagItems ld bc,wNumBagItems
ld hl,wcf8b ld hl,wcf8b
ld a,c ld a,c
@ -342,7 +342,7 @@ StartMenu_Item: ; 13302 (4:7302)
jp z,.useOrTossItem jp z,.useOrTossItem
.notBicycle1 .notBicycle1
ld a,$06 ; use/toss menu ld a,$06 ; use/toss menu
ld [wd125],a ld [wTextBoxID],a
call DisplayTextBoxID call DisplayTextBoxID
ld hl,wTopMenuItemY ld hl,wTopMenuItemY
ld a,11 ld a,11

View file

@ -2,7 +2,7 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0)
ld hl, VendingMachineText1 ld hl, VendingMachineText1
call PrintText call PrintText
ld a, $13 ld a, $13
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
xor a xor a
ld [wCurrentMenuItem], a ; wCurrentMenuItem ld [wCurrentMenuItem], a ; wCurrentMenuItem
@ -70,7 +70,7 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0)
ld c, $3 ld c, $3
predef SubBCDPredef predef SubBCDPredef
ld a, $13 ld a, $13
ld [wd125], a ld [wTextBoxID], a
jp DisplayTextBoxID jp DisplayTextBoxID
.BagFull .BagFull
ld hl, VendingMachineText6 ld hl, VendingMachineText6

View file

@ -382,7 +382,7 @@ GetPartyMonSpriteID: ; 718e9 (1c:58e9)
ld c, a ld c, a
dec a dec a
srl a srl a
ld hl, MonPartyData ; $590d ld hl, MonPartyData
ld e, a ld e, a
ld d, $0 ld d, $0
add hl, de add hl, de

View file

@ -1,51 +1,51 @@
CableClubNPC: ; 71c5 (1:71c5) CableClubNPC: ; 71c5 (1:71c5)
ld hl, CableClubNPCText1 ld hl, CableClubNPCWelcomeText
call PrintText call PrintText
ld a, [wd74b] ld a, [wd74b]
bit 5, a bit 5, a ; received pokedex?
jp nz, Func_71e1 jp nz, .receivedPokedex
; if the player hasn't received the pokedex
ld c, $3c ld c, $3c
call DelayFrames call DelayFrames
ld hl, CableClubNPCText6 ld hl, CableClubNPCMakingPreparationsText
call PrintText call PrintText
jp Func_7298 jp Func_7298
.receivedPokedex
Func_71e1: ; 71e1 (1:71e1)
ld a, $1 ld a, $1
ld [wMenuJoypadPollCount], a ld [wMenuJoypadPollCount], a
ld a, $5a ld a, 90
ld [wcc47], a ld [wLinkTimeoutCounter], a
.asm_71eb .establishConnectionLoop
ld a, [$ffaa] ld a, [hSerialConnectionStatus]
cp $2 cp USING_INTERNAL_CLOCK
jr z, .asm_721a ; 0x71ef $29 jr z, .establishedConnection
cp $1 cp USING_EXTERNAL_CLOCK
jr z, .asm_721a ; 0x71f3 $25 jr z, .establishedConnection
ld a, $ff ld a, CONNECTION_NOT_ESTABLISHED
ld [$ffaa], a ld [hSerialConnectionStatus], a
ld a, $2 ld a, ESTABLISH_CONNECTION_WITH_EXTERNAL_CLOCK
ld [rSB], a ld [rSB], a
xor a xor a
ld [$ffad], a ld [hSerialReceiveData], a
ld a, $80 ld a, START_TRANSFER_EXTERNAL_CLOCK
ld [$ff02], a ld [rSC], a
ld a, [wcc47] ld a, [wLinkTimeoutCounter]
dec a dec a
ld [wcc47], a ld [wLinkTimeoutCounter], a
jr z, .asm_7287 ; 0x720b $7a jr z, .failedToEstablishConnection
ld a, $1 ld a, ESTABLISH_CONNECTION_WITH_INTERNAL_CLOCK
ld [rSB], a ld [rSB], a
ld a, $81 ld a, START_TRANSFER_INTERNAL_CLOCK
ld [$ff02], a ld [rSC], a
call DelayFrame call DelayFrame
jr .asm_71eb ; 0x7218 $d1 jr .establishConnectionLoop
.asm_721a .establishedConnection
call Func_22ed call Serial_SendZeroByte
call DelayFrame call DelayFrame
call Func_22ed call Serial_SendZeroByte
ld c, $32 ld c, 50
call DelayFrames call DelayFrames
ld hl, CableClubNPCText2 ld hl, CableClubNPCPleaseApplyHereHaveToSaveText
call PrintText call PrintText
xor a xor a
ld [wMenuJoypadPollCount], a ld [wMenuJoypadPollCount], a
@ -54,22 +54,22 @@ Func_71e1: ; 71e1 (1:71e1)
ld [wMenuJoypadPollCount], a ld [wMenuJoypadPollCount], a
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
and a and a
jr nz, .asm_728f ; 0x723e $4f jr nz, .choseNo
callab SaveSAVtoSRAM callab SaveSAVtoSRAM
call WaitForSoundToFinish call WaitForSoundToFinish
ld a, (SFX_02_5d - SFX_Headers_02) / 3 ld a, (SFX_02_5d - SFX_Headers_02) / 3
call PlaySoundWaitForCurrent call PlaySoundWaitForCurrent
ld hl, CableClubNPCText3 ld hl, CableClubNPCPleaseWaitText
call PrintText call PrintText
ld hl, wcc47 ld hl, wUnknownSerialCounter
ld a, $3 ld a, $3
ld [hli], a ld [hli], a
xor a xor a
ld [hl], a ld [hl], a
ld [$ffa9], a ld [hSerialReceivedNewData], a
ld [wcc42], a ld [wSerialExchangeNybbleSendData], a
call Func_227f call Serial_SyncAndExchangeNybble
ld hl, wcc47 ld hl, wUnknownSerialCounter
ld a, [hli] ld a, [hli]
inc a inc a
jr nz, Func_72a8 ; 0x726b $3b jr nz, Func_72a8 ; 0x726b $3b
@ -79,26 +79,26 @@ Func_71e1: ; 71e1 (1:71e1)
ld b, $a ld b, $a
.asm_7273 .asm_7273
call DelayFrame call DelayFrame
call Func_22ed call Serial_SendZeroByte
dec b dec b
jr nz, .asm_7273 ; 0x727a $f7 jr nz, .asm_7273 ; 0x727a $f7
call Func_72d7 call CloseLinkConnection
ld hl, CableClubNPCText4 ld hl, CableClubNPCLinkClosedBecauseOfInactivityText
call PrintText call PrintText
jr Func_7298 ; 0x7285 $11 jr Func_7298 ; 0x7285 $11
.asm_7287 .failedToEstablishConnection
ld hl, CableClubNPCText7 ld hl, CableClubNPCAreaReservedFor2FriendsLinkedByCableText
call PrintText call PrintText
jr Func_7298 ; 0x728d $9 jr Func_7298 ; 0x728d $9
.asm_728f .choseNo
call Func_72d7 call CloseLinkConnection
ld hl, CableClubNPCText5 ld hl, CableClubNPCPleaseComeAgainText
call PrintText call PrintText
; fall through ; fall through
Func_7298: ; 7298 (1:7298) Func_7298: ; 7298 (1:7298)
xor a xor a
ld hl, wcc47 ld hl, wUnknownSerialCounter
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld hl, wd72e ld hl, wd72e
@ -115,42 +115,42 @@ Func_72a8: ; 72a8 (1:72a8)
ld b, BANK(LinkMenu) ld b, BANK(LinkMenu)
jp Bankswitch jp Bankswitch
CableClubNPCText7: ; 72b3 (1:72b3) CableClubNPCAreaReservedFor2FriendsLinkedByCableText: ; 72b3 (1:72b3)
TX_FAR _CableClubNPCText7 TX_FAR _CableClubNPCAreaReservedFor2FriendsLinkedByCableText
db "@" db "@"
CableClubNPCText1: ; 72b8 (1:72b8) CableClubNPCWelcomeText: ; 72b8 (1:72b8)
TX_FAR _CableClubNPCText1 TX_FAR _CableClubNPCWelcomeText
db "@" db "@"
CableClubNPCText2: ; 72bd (1:72bd) CableClubNPCPleaseApplyHereHaveToSaveText: ; 72bd (1:72bd)
TX_FAR _CableClubNPCText2 TX_FAR _CableClubNPCPleaseApplyHereHaveToSaveText
db "@" db "@"
CableClubNPCText3: ; 72c2 (1:72c2) CableClubNPCPleaseWaitText: ; 72c2 (1:72c2)
TX_FAR _CableClubNPCText3 TX_FAR _CableClubNPCPleaseWaitText
db $a, "@" db $a, "@"
CableClubNPCText4: ; 72c8 (1:72c8) CableClubNPCLinkClosedBecauseOfInactivityText: ; 72c8 (1:72c8)
TX_FAR _CableClubNPCText4 TX_FAR _CableClubNPCLinkClosedBecauseOfInactivityText
db "@" db "@"
CableClubNPCText5: ; 72cd (1:72cd) CableClubNPCPleaseComeAgainText: ; 72cd (1:72cd)
TX_FAR _CableClubNPCText5 TX_FAR _CableClubNPCPleaseComeAgainText
db "@" db "@"
CableClubNPCText6: ; 72d2 (1:72d2) CableClubNPCMakingPreparationsText: ; 72d2 (1:72d2)
TX_FAR _CableClubNPCText6 TX_FAR _CableClubNPCMakingPreparationsText
db "@" db "@"
Func_72d7: ; 72d7 (1:72d7) CloseLinkConnection: ; 72d7 (1:72d7)
call Delay3 call Delay3
ld a, $ff ld a, CONNECTION_NOT_ESTABLISHED
ld [$ffaa], a ld [hSerialConnectionStatus], a
ld a, $2 ld a, ESTABLISH_CONNECTION_WITH_EXTERNAL_CLOCK
ld [rSB], a ld [rSB], a
xor a xor a
ld [$ffad], a ld [hSerialReceiveData], a
ld a, $80 ld a, START_TRANSFER_EXTERNAL_CLOCK
ld [$ff02], a ld [rSC], a
ret ret

View file

@ -6,7 +6,7 @@ ShakeElevator: ; 7bf15 (1e:7f15)
call Delay3 call Delay3
ld a, $ff ld a, $ff
call PlaySound call PlaySound
ld a, [$ffaf] ld a, [hSCY]
ld d, a ld d, a
ld e, $1 ld e, $1
; number of times to play collision sfx ; number of times to play collision sfx
@ -16,7 +16,7 @@ ShakeElevator: ; 7bf15 (1e:7f15)
xor $fe xor $fe
ld e, a ld e, a
add d add d
ld [$ffaf], a ld [hSCY], a
push bc push bc
ld c, BANK(SFX_02_5b) ld c, BANK(SFX_02_5b)
ld a, (SFX_02_5b - SFX_Headers_02) / 3 ld a, (SFX_02_5b - SFX_Headers_02) / 3
@ -27,7 +27,7 @@ ShakeElevator: ; 7bf15 (1e:7f15)
dec b dec b
jr nz, .asm_7bf30 jr nz, .asm_7bf30
ld a, d ld a, d
ld [$ffaf], a ld [hSCY], a
ld a, $ff ld a, $ff
call PlaySound call PlaySound
ld c, BANK(SFX_02_5f) ld c, BANK(SFX_02_5f)

View file

@ -12,10 +12,10 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
inc a inc a
ld [wcf93],a ld [wcf93],a
ld a,$13 ld a,$13
ld [wd125],a ld [wTextBoxID],a
call DisplayTextBoxID ; draw money text box call DisplayTextBoxID ; draw money text box
ld a,$15 ld a,$15
ld [wd125],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
ld a,[hli] ld a,[hli]
@ -46,7 +46,7 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
.sellMenuLoop .sellMenuLoop
call LoadScreenTilesFromBuffer1 ; restore saved screen call LoadScreenTilesFromBuffer1 ; restore saved screen
ld a,$13 ld a,$13
ld [wd125],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
@ -80,7 +80,7 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
hlCoord 14, 7 hlCoord 14, 7
ld bc,$080f ld bc,$080f
ld a,$14 ld a,$14
ld [wd125],a ld [wTextBoxID],a
call DisplayTextBoxID ; yes/no menu call DisplayTextBoxID ; yes/no menu
ld a,[wd12e] ld a,[wd12e]
cp a,$02 cp a,$02
@ -120,7 +120,7 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
.buyMenuLoop .buyMenuLoop
call LoadScreenTilesFromBuffer1 ; restore saved screen call LoadScreenTilesFromBuffer1 ; restore saved screen
ld a,$13 ld a,$13
ld [wd125],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
@ -151,7 +151,7 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
hlCoord 14, 7 hlCoord 14, 7
ld bc,$080f ld bc,$080f
ld a,$14 ld a,$14
ld [wd125],a ld [wTextBoxID],a
call DisplayTextBoxID ; yes/no menu call DisplayTextBoxID ; yes/no menu
ld a,[wd12e] ld a,[wd12e]
cp a,$02 cp a,$02
@ -181,7 +181,7 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
.returnToMainPokemartMenu .returnToMainPokemartMenu
call LoadScreenTilesFromBuffer1 call LoadScreenTilesFromBuffer1
ld a,$13 ld a,$13
ld [wd125],a ld [wTextBoxID],a
call DisplayTextBoxID ; draw money text box call DisplayTextBoxID ; draw money text box
ld hl,PokemartAnythingElseText ld hl,PokemartAnythingElseText
call PrintText call PrintText

View file

@ -91,17 +91,17 @@ PredefPointers:: ; 4fe79 (13:7e79)
add_predef Func_48125 add_predef Func_48125
add_predef UpdateHPBar add_predef UpdateHPBar
add_predef HPBarLength add_predef HPBarLength
add_predef Func_5ab0 add_predef Diploma_TextBoxBorder
add_predef Func_3ed02 add_predef Func_3ed02
add_predef ShowPokedexMenu add_predef ShowPokedexMenu
add_predef EvolutionAfterBattle add_predef EvolutionAfterBattle
add_predef SaveSAVtoSRAM0 add_predef SaveSAVtoSRAM0
add_predef InitOpponent add_predef InitOpponent
add_predef Func_5a5f add_predef CableClub_Run
add_predef DrawBadges add_predef DrawBadges
add_predef Func_410f3 add_predef Func_410f3
add_predef BattleTransition add_predef BattleTransition
add_predef Func_79dda add_predef CopyTileIDsFromList
add_predef PlayIntro add_predef PlayIntro
add_predef Func_79869 add_predef Func_79869
add_predef FlashScreen add_predef FlashScreen
@ -129,14 +129,14 @@ PredefPointers:: ; 4fe79 (13:7e79)
add_predef LoadTownMap_Nest add_predef LoadTownMap_Nest
add_predef Func_27d6b add_predef Func_27d6b
add_predef EmotionBubble; 4C player exclamation add_predef EmotionBubble; 4C player exclamation
add_predef Func_5aaf; return immediately add_predef EmptyFunc3; return immediately
add_predef AskName add_predef AskName
add_predef PewterGuys add_predef PewterGuys
add_predef SaveSAVtoSRAM2 add_predef SaveSAVtoSRAM2
add_predef LoadSAVCheckSum2 add_predef LoadSAVCheckSum2
add_predef LoadSAV add_predef LoadSAV
add_predef SaveSAVtoSRAM1 add_predef SaveSAVtoSRAM1
add_predef Predef54 ; 54 initiate trade add_predef DoInGameTradeDialogue ; 54 initiate trade
add_predef HallOfFamePC add_predef HallOfFamePC
add_predef DisplayDexRating add_predef DisplayDexRating
dbw $1E, _LeaveMapAnim ; wrong bank dbw $1E, _LeaveMapAnim ; wrong bank

View file

@ -175,7 +175,7 @@ SaveSAVConfirm: ; 73768 (1c:7768)
hlCoord 0, 7 hlCoord 0, 7
ld bc,$0801 ;arrow's coordinates |b = Y|c = X| ld bc,$0801 ;arrow's coordinates |b = Y|c = X|
ld a,$14 ;one line shifting ($28 = 2 lines) ld a,$14 ;one line shifting ($28 = 2 lines)
ld [wd125],a ld [wTextBoxID],a
call DisplayTextBoxID ;handle Yes/No KeyPress call DisplayTextBoxID ;handle Yes/No KeyPress
ld a,[wCurrentMenuItem] ld a,[wCurrentMenuItem]
ret ret

View file

@ -135,10 +135,10 @@ MainSlotMachineLoop: ; 37395 (d:7395)
call PrintText call PrintText
ld hl, wTileMap + $fe ld hl, wTileMap + $fe
ld bc, $0d0f ld bc, $0d0f
xor a xor a ; YES_NO_MENU
ld [wd12c], a ld [wTwoOptionMenuID], a
ld a, $14 ld a, $14
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
and a and a

View file

@ -27,9 +27,9 @@ LoadTitlescreenGraphics: ; 42dd (1:42dd)
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
xor a xor a
ld [hTilesetType], a ld [hTilesetType], a
ld [$ffae], a ld [hSCX], a
ld a, $40 ld a, $40
ld [$ffaf], a ld [hSCY], a
ld a, $90 ld a, $90
ld [hWY], a ld [hWY], a
call ClearScreen call ClearScreen

View file

@ -1,29 +1,29 @@
Func_410e2: ; 410e2 (10:50e2) Func_410e2: ; 410e2 (10:50e2)
ld a, [wWhichTrade] ; wWhichTrade ld a, [wTradedPlayerMonSpecies]
ld [wcd5e], a ld [wcd5e], a
ld a, [wTrainerEngageDistance] ld a, [wTradedEnemyMonSpecies]
ld [wcd5f], a ld [wcd5f], a
ld de, PointerIDs_41138 ; $5138 ld de, PointerIDs_41138
jr Func_41102 jr Func_41102
Func_410f3: ; 410f3 (10:50f3) Func_410f3: ; 410f3 (10:50f3)
ld a, [wTrainerEngageDistance] ld a, [wTradedEnemyMonSpecies]
ld [wcd5e], a ld [wcd5e], a
ld a, [wTrainerSpriteOffset] ld a, [wTrainerSpriteOffset]
ld [wcd5f], a ld [wcd5f], a
ld de, PointerIDs_41149 ld de, PointerIDs_41149
Func_41102: ; 41102 (10:5102) Func_41102: ; 41102 (10:5102)
ld a, [W_OPTIONS] ; W_OPTIONS ld a, [W_OPTIONS]
push af push af
ld a, [$ffaf] ld a, [hSCY]
push af push af
ld a, [$ffae] ld a, [hSCX]
push af push af
xor a xor a
ld [W_OPTIONS], a ; W_OPTIONS ld [W_OPTIONS], a
ld [$ffaf], a ld [hSCY], a
ld [$ffae], a ld [hSCX], a
push de push de
.asm_41115 .asm_41115
pop de pop de
@ -32,7 +32,7 @@ Func_41102: ; 41102 (10:5102)
jr z, .asm_4112d jr z, .asm_4112d
inc de inc de
push de push de
ld hl, PointerTable_4115f ; $515f ld hl, PointerTable_4115f
add a add a
ld c, a ld c, a
ld b, $0 ld b, $0
@ -40,16 +40,16 @@ Func_41102: ; 41102 (10:5102)
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
ld de, .asm_41115 ; $5115 ld de, .asm_41115
push de push de
jp [hl] jp [hl]
.asm_4112d .asm_4112d
pop af pop af
ld [$ffae], a ld [hSCX], a
pop af pop af
ld [$ffaf], a ld [hSCY], a
pop af pop af
ld [W_OPTIONS], a ; W_OPTIONS ld [W_OPTIONS], a
ret ret
; these bytes refer to the $00th through $10th pointer of PointerTable_4115f ; these bytes refer to the $00th through $10th pointer of PointerTable_4115f
@ -61,13 +61,13 @@ PointerIDs_41149: ; 41149 (10:5149)
PointerTable_4115f: ; 4115f (10:515f) PointerTable_4115f: ; 4115f (10:515f)
dw LoadTradingGFXAndMonNames dw LoadTradingGFXAndMonNames
dw Func_41245 dw Trade_ShowPlayerMon
dw Func_41298 dw Trade_DrawOpenEndOfLinkCable
dw Func_412d2 dw Trade_AnimateBallEnteringLinkCable
dw Func_41336 dw Trade_ShowEnemyMon
dw Func_41376 dw Func_41376
dw Func_413c6 dw Func_413c6
dw Func_41181 dw Trade_Delay100
dw Func_415c8 dw Func_415c8
dw PrintTradeWentToText dw PrintTradeWentToText
dw PrintTradeForSendsText dw PrintTradeForSendsText
@ -76,46 +76,46 @@ PointerTable_4115f: ; 4115f (10:515f)
dw PrintTradeWillTradeText dw PrintTradeWillTradeText
dw Func_4123b dw Func_4123b
dw Func_415df dw Func_415df
dw Func_41217 dw Trade_SwapNames
Func_41181: ; 41181 (10:5181) Trade_Delay100: ; 41181 (10:5181)
ld c, $64 ld c, 100
jp DelayFrames jp DelayFrames
Func_41186: ; 41186 (10:5186) Trade_CopyTileMapToVRAM: ; 41186 (10:5186)
ld a, $1 ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
call Delay3 call Delay3
xor a xor a
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
ret ret
Delay50: ; 41191 (10:5191) Trade_Delay80: ; 41191 (10:5191)
ld c, $50 ld c, 80
jp DelayFrames jp DelayFrames
Func_41196: ; 41196 (10:5196) Trade_ClearTileMap: ; 41196 (10:5196)
ld hl, wTileMap ld hl, wTileMap
ld bc, $168 ld bc, 20 * 18
ld a, $7f ld a, " "
jp FillMemory jp FillMemory
LoadTradingGFXAndMonNames: ; 411a1 (10:51a1) LoadTradingGFXAndMonNames: ; 411a1 (10:51a1)
call Func_41196 call Trade_ClearTileMap
call DisableLCD call DisableLCD
ld hl, TradingAnimationGraphics ; $69be ld hl, TradingAnimationGraphics
ld de, vChars2 + $310 ld de, vChars2 + $310
ld bc, $310 ld bc, $310
ld a, BANK(TradingAnimationGraphics) ld a, BANK(TradingAnimationGraphics)
call FarCopyData2 call FarCopyData2
ld hl, TradingAnimationGraphics2 ; $6cce ld hl, TradingAnimationGraphics2
ld de, vSprites + $7c0 ld de, vSprites + $7c0
ld bc, $40 ld bc, $40
ld a, BANK(TradingAnimationGraphics2) ld a, BANK(TradingAnimationGraphics2)
call FarCopyData2 call FarCopyData2
ld hl, vBGMap0 ld hl, vBGMap0
ld bc, $800 ld bc, $800
ld a, $7f ld a, " "
call FillMemory call FillMemory
call ClearSprites call ClearSprites
ld a, $ff ld a, $ff
@ -128,40 +128,40 @@ LoadTradingGFXAndMonNames: ; 411a1 (10:51a1)
jr z, .asm_411e5 jr z, .asm_411e5
ld a, $f0 ld a, $f0
.asm_411e5 .asm_411e5
ld [rOBP0], a ; $ff48 ld [rOBP0], a
call EnableLCD call EnableLCD
xor a xor a
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
ld a, [wWhichTrade] ; wWhichTrade ld a, [wTradedPlayerMonSpecies]
ld [wd11e], a ld [wd11e], a
call GetMonName call GetMonName
ld hl, wcd6d ld hl, wcd6d
ld de, wcf4b ld de, wcf4b
ld bc, $b ld bc, $b
call CopyData call CopyData
ld a, [wTrainerEngageDistance] ld a, [wTradedEnemyMonSpecies]
ld [wd11e], a ld [wd11e], a
jp GetMonName jp GetMonName
Func_4120b: ; 4120b (10:520b) Func_4120b: ; 4120b (10:520b)
ld a, $d0 ld a, %11010000
ld [rOBP1], a ; $ff49 ld [rOBP1], a
ld b, BANK(Func_7176c) ld b, BANK(Func_7176c)
ld hl, Func_7176c ld hl, Func_7176c
jp Bankswitch jp Bankswitch
Func_41217: ; 41217 (10:5217) Trade_SwapNames: ; 41217 (10:5217)
ld hl, wPlayerName ld hl, wPlayerName
ld de, wHPBarMaxHP ld de, wBuffer
ld bc, $000b ld bc, 11
call CopyData call CopyData
ld hl, W_GRASSRATE ld hl, wLinkEnemyTrainerName
ld de, wPlayerName ld de, wPlayerName
ld bc, $000b ld bc, 11
call CopyData call CopyData
ld hl, wHPBarMaxHP ld hl, wBuffer
ld de, W_GRASSRATE ld de, wLinkEnemyTrainerName
ld bc, $000b ld bc, 11
jp CopyData jp CopyData
Func_4123b: ; 4123b (10:523b) Func_4123b: ; 4123b (10:523b)
@ -171,90 +171,90 @@ Func_4123b: ; 4123b (10:523b)
res 6, [hl] res 6, [hl]
ret ret
Func_41245: ; 41245 (10:5245) Trade_ShowPlayerMon: ; 41245 (10:5245)
ld a, $ab ld a, %10101011
ld [rLCDC], a ; $ff40 ld [rLCDC], a
ld a, $50 ld a, $50
ld [hWY], a ld [hWY], a
ld a, $86 ld a, $86
ld [rWX], a ; $ff4b ld [rWX], a
ld [$ffae], a ld [hSCX], a
xor a xor a
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
hlCoord 4, 0 hlCoord 4, 0
ld b, $6 ld b, 6
ld c, $a ld c, 10
call TextBoxBorder call TextBoxBorder
call Func_42769 call Trade_PrintPlayerMonInfoText
ld b, $98 ld b, $98
call CopyScreenTileBufferToVRAM call CopyScreenTileBufferToVRAM
call ClearScreen call ClearScreen
ld a, [wWhichTrade] ; wWhichTrade ld a, [wTradedPlayerMonSpecies]
call Func_415a4 call Trade_LoadMonSprite
ld a, $7e ld a, $7e
.asm_41273 .slideScreenLoop
push af push af
call DelayFrame call DelayFrame
pop af pop af
ld [rWX], a ; $ff4b ld [rWX], a
ld [$ffae], a ld [hSCX], a
dec a dec a
dec a dec a
and a and a
jr nz, .asm_41273 jr nz, .slideScreenLoop
call Delay50 call Trade_Delay80
ld a, ANIM_AD ld a, TRADE_BALL_POOF_ANIM
call Func_41676 call Trade_ShowAnimation
ld a, ANIM_AA ld a, TRADE_BALL_DROP_ANIM
call Func_41676 call Trade_ShowAnimation
ld a, [wWhichTrade] ; wWhichTrade ld a, [wTradedPlayerMonSpecies]
call PlayCry call PlayCry
xor a xor a
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
ret ret
Func_41298: ; 41298 (10:5298) Trade_DrawOpenEndOfLinkCable: ; 41298 (10:5298)
call Func_41196 call Trade_ClearTileMap
ld b, $98 ld b, $98
call CopyScreenTileBufferToVRAM call CopyScreenTileBufferToVRAM
ld b, $8 ld b, $8
call GoPAL_SET call GoPAL_SET
ld hl, vBGMap1 + $8c ld hl, vBGMap1 + $8c
call Func_414ae call Trade_RedrawRows4And5
ld a, $a0 ld a, $a0
ld [$ffae], a ld [hSCX], a
call DelayFrame call DelayFrame
ld a, $8b ld a, %10001011
ld [rLCDC], a ; $ff40 ld [rLCDC], a
hlCoord 6, 2 hlCoord 6, 2
ld b, $7 ld b, $7 ; open end of link cable tile ID list index
call Func_41842 call CopyTileIDsFromList_ZeroBaseTileID
call Func_41186 call Trade_CopyTileMapToVRAM
ld a, (SFX_02_3d - SFX_Headers_02) / 3 ld a, (SFX_02_3d - SFX_Headers_02) / 3
call PlaySound call PlaySound
ld c, $14 ld c, 20
.asm_412c8 .loop
ld a, [$ffae] ld a, [hSCX]
add $4 add 4
ld [$ffae], a ld [hSCX], a
dec c dec c
jr nz, .asm_412c8 jr nz, .loop
ret ret
Func_412d2: ; 412d2 (10:52d2) Trade_AnimateBallEnteringLinkCable: ; 412d2 (10:52d2)
ld a, ANIM_AB ld a, TRADE_BALL_SHAKE_ANIM
call Func_41676 call Trade_ShowAnimation
ld c, 10 ld c, 10
call DelayFrames call DelayFrames
ld a, $e4 ld a, %11100100
ld [rOBP0], a ; $ff48 ld [rOBP0], a
xor a xor a
ld [wd09f], a ld [wd09f], a
ld bc, $2060 ld bc, $2060
.asm_412e7 .moveBallInsideLinkCableLoop
push bc push bc
xor a xor a
ld de, UnknownOAM_4132e ; $532e ld de, Trade_BallInsideLinkCableOAM
call WriteOAMBlock call WriteOAMBlock
ld a, [wd09f] ld a, [wd09f]
xor $1 xor $1
@ -263,58 +263,58 @@ Func_412d2: ; 412d2 (10:52d2)
ld hl, wOAMBuffer + $02 ld hl, wOAMBuffer + $02
ld de, $4 ld de, $4
ld c, e ld c, e
.asm_41300 .cycleSpriteFramesLoop
ld [hl], a ld [hl], a
add hl, de add hl, de
dec c dec c
jr nz, .asm_41300 jr nz, .cycleSpriteFramesLoop
call Delay3 call Delay3
pop bc pop bc
ld a, c ld a, c
add $4 add $4
ld c, a ld c, a
cp $a0 cp $a0
jr nc, .asm_41318 jr nc, .ballSpriteReachedEdgeOfScreen
ld a, (SFX_02_3c - SFX_Headers_02) / 3 ld a, (SFX_02_3c - SFX_Headers_02) / 3
call PlaySound call PlaySound
jr .asm_412e7 jr .moveBallInsideLinkCableLoop
.asm_41318 .ballSpriteReachedEdgeOfScreen
call ClearSprites call ClearSprites
ld a, $1 ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
call ClearScreen call ClearScreen
ld b, $98 ld b, $98
call CopyScreenTileBufferToVRAM call CopyScreenTileBufferToVRAM
call Delay3 call Delay3
xor a xor a
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
ret ret
UnknownOAM_4132e: ; 4132e (10:532e) Trade_BallInsideLinkCableOAM: ; 4132e (10:532e)
db $7E,$00,$7E,$20 db $7E,$00,$7E,$20
db $7E,$40,$7E,$60 db $7E,$40,$7E,$60
Func_41336: ; 41336 (10:5336) Trade_ShowEnemyMon: ; 41336 (10:5336)
ld a, ANIM_AC ld a, TRADE_BALL_TILT_ANIM
call Func_41676 call Trade_ShowAnimation
call Func_415c8 call Func_415c8
hlCoord 4, 10 hlCoord 4, 10
ld b, $6 ld b, 6
ld c, $a ld c, 10
call TextBoxBorder call TextBoxBorder
call Func_427a7 call Trade_PrintEnemyMonInfoText
call Func_41186 call Trade_CopyTileMapToVRAM
ld a, $1 ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
ld a, [wTrainerEngageDistance] ld a, [wTradedEnemyMonSpecies]
call Func_415a4 call Trade_LoadMonSprite
ld a, ANIM_AD ld a, TRADE_BALL_POOF_ANIM
call Func_41676 call Trade_ShowAnimation
ld a, $1 ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
ld a, [wTrainerEngageDistance] ld a, [wTradedEnemyMonSpecies]
call PlayCry call PlayCry
call Func_41181 call Trade_Delay100
hlCoord 4, 10 hlCoord 4, 10
ld bc, $80c ld bc, $80c
call ClearScreenArea call ClearScreenArea
@ -325,23 +325,23 @@ Func_41376: ; 41376 (10:5376)
ld a, $1 ld a, $1
ld [wd08a], a ld [wd08a], a
ld a, $e4 ld a, $e4
ld [rOBP0], a ; $ff48 ld [rOBP0], a
ld a, $54 ld a, $54
ld [W_BASECOORDX], a ; wd081 ld [W_BASECOORDX], a
ld a, $1c ld a, $1c
ld [W_BASECOORDY], a ; wd082 ld [W_BASECOORDY], a
ld a, [wcd5e] ld a, [wcd5e]
ld [wcd5d], a ld [wcd5d], a
call Func_41505 call Func_41505
call Func_4142d call Func_4142d
call Func_41186 call Trade_CopyTileMapToVRAM
call Func_4149f call Func_4149f
ld hl, vBGMap1 + $8c ld hl, vBGMap1 + $8c
call Func_414ae call Trade_RedrawRows4And5
ld b, $6 ld b, $6
call Func_414c5 call Func_414c5
ld a, $1 ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
call Func_4149f call Func_4149f
ld b, $4 ld b, $4
call Func_414c5 call Func_414c5
@ -349,7 +349,7 @@ Func_41376: ; 41376 (10:5376)
ld b, $6 ld b, $6
call Func_414c5 call Func_414c5
xor a xor a
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
call Func_41525 call Func_41525
jp ClearSprites jp ClearSprites
@ -358,22 +358,22 @@ Func_413c6: ; 413c6 (10:53c6)
xor a xor a
ld [wd08a], a ld [wd08a], a
ld a, $64 ld a, $64
ld [W_BASECOORDX], a ; wd081 ld [W_BASECOORDX], a
ld a, $44 ld a, $44
ld [W_BASECOORDY], a ; wd082 ld [W_BASECOORDY], a
ld a, [wcd5f] ld a, [wcd5f]
ld [wcd5d], a ld [wcd5d], a
call Func_41505 call Func_41505
call Func_4145c call Func_4145c
call Func_41186 call Trade_CopyTileMapToVRAM
call Func_4149f call Func_4149f
ld hl, vBGMap1 + $94 ld hl, vBGMap1 + $94
call Func_414ae call Trade_RedrawRows4And5
call Func_41525 call Func_41525
ld b, $6 ld b, $6
call Func_414c5 call Func_414c5
ld a, $1 ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
call Func_4149f call Func_4149f
ld b, $4 ld b, $4
call Func_414c5 call Func_414c5
@ -381,27 +381,27 @@ Func_413c6: ; 413c6 (10:53c6)
ld b, $6 ld b, $6
call Func_414c5 call Func_414c5
xor a xor a
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
jp ClearSprites jp ClearSprites
Func_41411: ; 41411 (10:5411) Func_41411: ; 41411 (10:5411)
ld a, $1 ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
call ClearScreen call ClearScreen
xor a xor a
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
call Func_4120b call Func_4120b
call DelayFrame call DelayFrame
ld a, $ab ld a, %10101011
ld [rLCDC], a ; $ff40 ld [rLCDC], a
xor a xor a
ld [$ffae], a ld [hSCX], a
ld a, $90 ld a, $90
ld [hWY], a ld [hWY], a
ret ret
Func_4142d: ; 4142d (10:542d) Func_4142d: ; 4142d (10:542d)
call Func_41196 call Trade_ClearTileMap
hlCoord 11, 4 hlCoord 11, 4
ld a, $5d ld a, $5d
ld [hli], a ld [hli], a
@ -413,18 +413,18 @@ Func_4142d: ; 4142d (10:542d)
jr nz, .asm_4143a jr nz, .asm_4143a
hlCoord 5, 3 hlCoord 5, 3
ld b, $6 ld b, $6
call Func_41842 call CopyTileIDsFromList_ZeroBaseTileID
hlCoord 4, 12 hlCoord 4, 12
ld b, $2 ld b, 2
ld c, $7 ld c, 7
call TextBoxBorder call TextBoxBorder
hlCoord 5, 14 hlCoord 5, 14
ld de, wPlayerName ; wd158 ld de, wPlayerName
call PlaceString call PlaceString
jp DelayFrame jp DelayFrame
Func_4145c: ; 4145c (10:545c) Func_4145c: ; 4145c (10:545c)
call Func_41196 call Trade_ClearTileMap
hlCoord 0, 4 hlCoord 0, 4
ld a, $5e ld a, $5e
ld c, $e ld c, $e
@ -451,18 +451,18 @@ Func_4145c: ; 4145c (10:545c)
ld [hl], a ld [hl], a
hlCoord 7, 8 hlCoord 7, 8
ld b, $6 ld b, $6
call Func_41842 call CopyTileIDsFromList_ZeroBaseTileID
hlCoord 6, 0 hlCoord 6, 0
ld b, $2 ld b, $2
ld c, $7 ld c, $7
call TextBoxBorder call TextBoxBorder
hlCoord 7, 2 hlCoord 7, 2
ld de, W_GRASSRATE ; W_GRASSRATE ld de, wLinkEnemyTrainerName
call PlaceString call PlaceString
jp DelayFrame jp DelayFrame
Func_4149f: ; 4149f (10:549f) Func_4149f: ; 4149f (10:549f)
call Func_41196 call Trade_ClearTileMap
hlCoord 0, 4 hlCoord 0, 4
ld a, $5e ld a, $5e
ld c, $14 ld c, $14
@ -472,7 +472,7 @@ Func_4149f: ; 4149f (10:549f)
jr nz, .asm_414a9 jr nz, .asm_414a9
ret ret
Func_414ae: ; 414ae (10:54ae) Trade_RedrawRows4And5: ; 414ae (10:54ae)
push hl push hl
hlCoord 0, 4 hlCoord 0, 4
call CopyToScreenEdgeTiles call CopyToScreenEdgeTiles
@ -480,10 +480,10 @@ Func_414ae: ; 414ae (10:54ae)
ld a, h ld a, h
ld [H_SCREENEDGEREDRAWADDR + 1], a ld [H_SCREENEDGEREDRAWADDR + 1], a
ld a, l ld a, l
ld [H_SCREENEDGEREDRAWADDR], a ; $ffd1 ld [H_SCREENEDGEREDRAWADDR], a
ld a, $2 ld a, REDRAWROW
ld [H_SCREENEDGEREDRAW], a ; $ffd0 ld [H_SCREENEDGEREDRAW], a
ld c, $a ld c, 10
jp DelayFrames jp DelayFrames
Func_414c5: ; 414c5 (10:54c5) Func_414c5: ; 414c5 (10:54c5)
@ -494,14 +494,14 @@ Func_414c5: ; 414c5 (10:54c5)
ld a, e ld a, e
dec a dec a
jr z, .asm_414d5 jr z, .asm_414d5
ld a, [$ffae] ld a, [hSCX]
sub $2 sub $2
jr .asm_414d9 jr .asm_414d9
.asm_414d5 .asm_414d5
ld a, [$ffae] ld a, [hSCX]
add $2 add $2
.asm_414d9 .asm_414d9
ld [$ffae], a ld [hSCX], a
call DelayFrame call DelayFrame
dec d dec d
jr nz, .asm_414cb jr nz, .asm_414cb
@ -514,9 +514,9 @@ Func_414e8: ; 414e8 (10:54e8)
push de push de
push bc push bc
push hl push hl
ld a, [rBGP] ; $ff47 ld a, [rBGP]
xor $3c xor $3c
ld [rBGP], a ; $ff47 ld [rBGP], a
ld hl, wOAMBuffer + $02 ld hl, wOAMBuffer + $02
ld de, $4 ld de, $4
ld c, $14 ld c, $14
@ -540,10 +540,10 @@ Func_41510: ; 41510 (10:5510)
ld hl, wOAMBuffer ld hl, wOAMBuffer
ld c, $14 ld c, $14
.asm_41515 .asm_41515
ld a, [W_BASECOORDY] ; wd082 ld a, [W_BASECOORDY]
add [hl] add [hl]
ld [hli], a ld [hli], a
ld a, [W_BASECOORDX] ; wd081 ld a, [W_BASECOORDX]
add [hl] add [hl]
ld [hli], a ld [hli], a
inc hl inc hl
@ -566,9 +566,9 @@ Func_41525: ; 41525 (10:5525)
ld bc, $fc00 ld bc, $fc00
.asm_4153f .asm_4153f
ld a, b ld a, b
ld [W_BASECOORDX], a ; wd081 ld [W_BASECOORDX], a
ld a, c ld a, c
ld [W_BASECOORDY], a ; wd082 ld [W_BASECOORDY], a
ld d, $4 ld d, $4
.asm_41549 .asm_41549
call Func_41510 call Func_41510
@ -580,7 +580,7 @@ Func_41525: ; 41525 (10:5525)
ret ret
Func_41558: ; 41558 (10:5558) Func_41558: ; 41558 (10:5558)
ld hl, OAMPointers_41574 ; $5574 ld hl, OAMPointers_41574
ld c, $4 ld c, $4
xor a xor a
.asm_4155e .asm_4155e
@ -630,58 +630,59 @@ UnknownOAM_4159c: ; 4159c (10:559c)
db $3B,$70,$3A,$70 db $3B,$70,$3A,$70
db $39,$70,$38,$70 db $39,$70,$38,$70
Func_415a4: ; 415a4 (10:55a4) ; a = species
Trade_LoadMonSprite: ; 415a4 (10:55a4)
ld [wcf91], a ld [wcf91], a
ld [wd0b5], a ld [wd0b5], a
ld [wcf1d], a ld [wcf1d], a
ld b, $b ld b, $b
ld c, $0 ld c, $0
call GoPAL_SET call GoPAL_SET
ld a, [H_AUTOBGTRANSFERENABLED] ; $ffba ld a, [H_AUTOBGTRANSFERENABLED]
xor $1 xor $1
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
call GetMonHeader call GetMonHeader
hlCoord 7, 2 hlCoord 7, 2
call LoadFlippedFrontSpriteByMonIndex call LoadFlippedFrontSpriteByMonIndex
ld c, $a ld c, 10
jp DelayFrames jp DelayFrames
Func_415c8: ; 415c8 (10:55c8) Func_415c8: ; 415c8 (10:55c8)
ld a, $1 ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [H_AUTOBGTRANSFERENABLED], a
call ClearScreen call ClearScreen
ld a, $e3 ld a, %11100011
ld [rLCDC], a ; $ff40 ld [rLCDC], a
ld a, $7 ld a, $7
ld [rWX], a ; $ff4b ld [rWX], a
xor a xor a
ld [hWY], a ld [hWY], a
ld a, $90 ld a, $90
ld [$ffae], a ld [hSCX], a
ret ret
Func_415df: ; 415df (10:55df) Func_415df: ; 415df (10:55df)
ld c, $32 ld c, 50
call DelayFrames call DelayFrames
.asm_415e4 .loop
call DelayFrame call DelayFrame
ld a, [rWX] ; $ff4b ld a, [rWX]
inc a inc a
inc a inc a
ld [rWX], a ; $ff4b ld [rWX], a
cp $a1 cp $a1
jr nz, .asm_415e4 jr nz, .loop
call Func_41196 call Trade_ClearTileMap
ld c, $a ld c, 10
call DelayFrames call DelayFrames
ld a, $7 ld a, $7
ld [rWX], a ; $ff4b ld [rWX], a
ret ret
PrintTradeWentToText: ; 415fe (10:55fe) PrintTradeWentToText: ; 415fe (10:55fe)
ld hl, TradeWentToText ld hl, TradeWentToText
call PrintText call PrintText
ld c, $c8 ld c, 200
call DelayFrames call DelayFrames
jp Func_415df jp Func_415df
@ -692,10 +693,10 @@ TradeWentToText: ; 4160c (10:560c)
PrintTradeForSendsText: ; 41611 (10:5611) PrintTradeForSendsText: ; 41611 (10:5611)
ld hl, TradeForText ld hl, TradeForText
call PrintText call PrintText
call Delay50 call Trade_Delay80
ld hl, TradeSendsText ld hl, TradeSendsText
call PrintText call PrintText
jp Delay50 jp Trade_Delay80
TradeForText: ; 41623 (10:5623) TradeForText: ; 41623 (10:5623)
TX_FAR _TradeForText TX_FAR _TradeForText
@ -708,10 +709,10 @@ TradeSendsText: ; 41628 (10:5628)
PrintTradeFarewellText: ; 4162d (10:562d) PrintTradeFarewellText: ; 4162d (10:562d)
ld hl, TradeWavesFarewellText ld hl, TradeWavesFarewellText
call PrintText call PrintText
call Delay50 call Trade_Delay80
ld hl, TradeTransferredText ld hl, TradeTransferredText
call PrintText call PrintText
call Delay50 call Trade_Delay80
jp Func_415df jp Func_415df
TradeWavesFarewellText: ; 41642 (10:5642) TradeWavesFarewellText: ; 41642 (10:5642)
@ -725,7 +726,7 @@ TradeTransferredText: ; 41647 (10:5647)
PrintTradeTakeCareText: ; 4164c (10:564c) PrintTradeTakeCareText: ; 4164c (10:564c)
ld hl, TradeTakeCareText ld hl, TradeTakeCareText
call PrintText call PrintText
jp Delay50 jp Trade_Delay80
TradeTakeCareText: ; 41655 (10:5655) TradeTakeCareText: ; 41655 (10:5655)
TX_FAR _TradeTakeCareText TX_FAR _TradeTakeCareText
@ -734,10 +735,10 @@ TradeTakeCareText: ; 41655 (10:5655)
PrintTradeWillTradeText: ; 4165a (10:565a) PrintTradeWillTradeText: ; 4165a (10:565a)
ld hl, TradeWillTradeText ld hl, TradeWillTradeText
call PrintText call PrintText
call Delay50 call Trade_Delay80
ld hl, TradeforText ld hl, TradeforText
call PrintText call PrintText
jp Delay50 jp Trade_Delay80
TradeWillTradeText: ; 4166c (10:566c) TradeWillTradeText: ; 4166c (10:566c)
TX_FAR _TradeWillTradeText TX_FAR _TradeWillTradeText
@ -747,8 +748,8 @@ TradeforText: ; 41671 (10:5671)
TX_FAR _TradeforText TX_FAR _TradeforText
db "@" db "@"
Func_41676: ; 41676 (10:5676) Trade_ShowAnimation: ; 41676 (10:5676)
ld [W_ANIMATIONID], a ; W_ANIMATIONID ld [W_ANIMATIONID], a
xor a xor a
ld [wcc5b], a ld [wcc5b], a
predef_jump MoveAnimation predef_jump MoveAnimation

View file

@ -1,8 +1,8 @@
Func_42769: ; 42769 (10:6769) Trade_PrintPlayerMonInfoText: ; 42769 (10:6769)
hlCoord 5, 0 hlCoord 5, 0
ld de,OTString67E5 ld de,Trade_MonInfoText
call PlaceString call PlaceString
ld a,[wWhichTrade] ld a,[wTradedPlayerMonSpecies]
ld [wd11e],a ld [wd11e],a
predef IndexToPokedex predef IndexToPokedex
hlCoord 9, 0 hlCoord 9, 0
@ -13,18 +13,18 @@ Func_42769: ; 42769 (10:6769)
ld de,wcf4b ld de,wcf4b
call PlaceString call PlaceString
hlCoord 8, 4 hlCoord 8, 4
ld de,wTrainerScreenX ld de,wTradedPlayerMonOT
call PlaceString call PlaceString
hlCoord 8, 6 hlCoord 8, 6
ld de,wcd4c ld de,wTradedPlayerMonOTID
ld bc,$8205 ld bc,$8205
jp PrintNumber jp PrintNumber
Func_427a7: ; 427a7 (10:67a7) Trade_PrintEnemyMonInfoText: ; 427a7 (10:67a7)
hlCoord 5, 10 hlCoord 5, 10
ld de,OTString67E5 ld de,Trade_MonInfoText
call PlaceString call PlaceString
ld a,[wTrainerEngageDistance] ld a,[wTradedEnemyMonSpecies]
ld [wd11e],a ld [wd11e],a
predef IndexToPokedex predef IndexToPokedex
hlCoord 9, 10 hlCoord 9, 10
@ -35,14 +35,14 @@ Func_427a7: ; 427a7 (10:67a7)
ld de,wcd6d ld de,wcd6d
call PlaceString call PlaceString
hlCoord 8, 14 hlCoord 8, 14
ld de,wcd4e ld de,wTradedEnemyMonOT
call PlaceString call PlaceString
hlCoord 8, 16 hlCoord 8, 16
ld de,wcd59 ld de,wTradedEnemyMonOTID
ld bc,$8205 ld bc,$8205
jp PrintNumber jp PrintNumber
OTString67E5: ; 427e5 (10:67e5) Trade_MonInfoText: ; 427e5 (10:67e5)
db "──",$74,$F2,$4E db "──",$74,$F2,$4E
db $4E db $4E
db "OT/",$4E db "OT/",$4E

2
extras

@ -1 +1 @@
Subproject commit a87f66964cc602ff5575efebf27c388ef03fa94d Subproject commit 698b0fc7e63d3dadf07247015e230bce145cc500

View file

@ -1326,7 +1326,7 @@ AddAmountSoldToMoney:: ; 2b9e (0:2b9e)
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,$13
ld [wd125],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
call PlaySoundWaitForCurrent ; play sound call PlaySoundWaitForCurrent ; play sound
@ -1399,7 +1399,7 @@ DisplayListMenuID:: ; 2be6 (0:2be6)
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,$0d ; list menu text box ID
ld [wd125],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
; the code up to .skipMovingSprites appears to be useless ; the code up to .skipMovingSprites appears to be useless
@ -2136,7 +2136,7 @@ IsKeyItem:: ; 30d9 (0:30d9)
; function to draw various text boxes ; function to draw various text boxes
; INPUT: ; INPUT:
; [wd125] = text box ID ; [wTextBoxID] = text box ID
DisplayTextBoxID:: ; 30e8 (0:30e8) DisplayTextBoxID:: ; 30e8 (0:30e8)
ld a,[H_LOADEDROMBANK] ld a,[H_LOADEDROMBANK]
push af push af
@ -2898,7 +2898,7 @@ GetSpriteMovementByte2Pointer:: ; 3558 (0:3558)
GetTrainerInformation:: ; 3566 (0:3566) GetTrainerInformation:: ; 3566 (0:3566)
call GetTrainerName call GetTrainerName
ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE ld a, [wLinkState]
and a and a
jr nz, .linkBattle jr nz, .linkBattle
ld a, Bank(TrainerPicAndMoneyPointers) ld a, Bank(TrainerPicAndMoneyPointers)
@ -2997,34 +2997,34 @@ YesNoChoice:: ; 35ec (0:35ec)
Func_35f4:: ; 35f4 (0:35f4) Func_35f4:: ; 35f4 (0:35f4)
ld a, $14 ld a, $14
ld [wd125], a ld [wTextBoxID], a
call InitYesNoTextBoxParameters call InitYesNoTextBoxParameters
jp DisplayTextBoxID jp DisplayTextBoxID
InitYesNoTextBoxParameters:: ; 35ff (0:35ff) InitYesNoTextBoxParameters:: ; 35ff (0:35ff)
xor a xor a ; YES_NO_MENU
ld [wd12c], a ld [wTwoOptionMenuID], a
hlCoord 14, 7 hlCoord 14, 7
ld bc, $80f ld bc, $80f
ret ret
YesNoChoicePokeCenter:: ; 360a (0:360a) YesNoChoicePokeCenter:: ; 360a (0:360a)
call SaveScreenTilesToBuffer1 call SaveScreenTilesToBuffer1
ld a, $6 ld a, HEAL_CANCEL_MENU
ld [wd12c], a ld [wTwoOptionMenuID], a
hlCoord 11, 6 hlCoord 11, 6
ld bc, $80c ld bc, $80c
jr DisplayYesNoChoice jr DisplayYesNoChoice
Func_361a:: ; 361a (0:361a) Func_361a:: ; 361a (0:361a)
call SaveScreenTilesToBuffer1 call SaveScreenTilesToBuffer1
ld a, $3 ld a, WIDE_YES_NO_MENU
ld [wd12c], a ld [wTwoOptionMenuID], a
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, $14
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
jp LoadScreenTilesFromBuffer1 jp LoadScreenTilesFromBuffer1
@ -3467,7 +3467,7 @@ WaitForTextScrollButtonPress:: ; 3865 (0:3865)
call HandleDownArrowBlinkTiming call HandleDownArrowBlinkTiming
pop hl pop hl
call JoypadLowSensitivity call JoypadLowSensitivity
predef Func_5a5f predef CableClub_Run
ld a, [hJoy5] ld a, [hJoy5]
and A_BUTTON | B_BUTTON and A_BUTTON | B_BUTTON
jr z, .loop jr z, .loop
@ -3479,8 +3479,8 @@ WaitForTextScrollButtonPress:: ; 3865 (0:3865)
; (unless in link battle) waits for A or B being pressed and outputs the scrolling sound effect ; (unless in link battle) waits for A or B being pressed and outputs the scrolling sound effect
ManualTextScroll:: ; 3898 (0:3898) ManualTextScroll:: ; 3898 (0:3898)
ld a, [W_ISLINKBATTLE] ld a, [wLinkState]
cp $4 cp LINK_STATE_BATTLING
jr z, .inLinkBattle jr z, .inLinkBattle
call WaitForTextScrollButtonPress call WaitForTextScrollButtonPress
ld a, (SFX_02_40 - SFX_Headers_02) / 3 ld a, (SFX_02_40 - SFX_Headers_02) / 3
@ -4194,7 +4194,7 @@ 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,1
ld [wd125],a ld [wTextBoxID],a
call DisplayTextBoxID call DisplayTextBoxID
call UpdateSprites call UpdateSprites
call Delay3 call Delay3

View file

@ -26,7 +26,7 @@ rLCDC_DEFAULT EQU %11100011
ld [$ff43], a ld [$ff43], a
ld [$ff42], a ld [$ff42], a
ld [rSB], a ld [rSB], a
ld [$ff02], a ld [rSC], a
ld [$ff4b], a ld [$ff4b], a
ld [$ff4a], a ld [$ff4a], a
ld [$ff06], a ld [$ff06], a
@ -67,8 +67,8 @@ rLCDC_DEFAULT EQU %11100011
xor a xor a
ld [hTilesetType], a ld [hTilesetType], a
ld [$ff41], a ld [$ff41], a
ld [$ffae], a ld [hSCX], a
ld [$ffaf], a ld [hSCY], a
ld [$ff0f], a ld [$ff0f], a
ld a, 1 << VBLANK + 1 << TIMER + 1 << SERIAL ld a, 1 << VBLANK + 1 << TIMER + 1 << SERIAL
ld [rIE], a ld [rIE], a
@ -79,8 +79,8 @@ rLCDC_DEFAULT EQU %11100011
ld a, 7 ld a, 7
ld [rWX], a ld [rWX], a
ld a, $ff ld a, CONNECTION_NOT_ESTABLISHED
ld [$ffaa], a ld [hSerialConnectionStatus], a
ld h, vBGMap0 / $100 ld h, vBGMap0 / $100
call ClearBgMap call ClearBgMap

View file

@ -1609,12 +1609,12 @@ AdvancePlayerSprite:: ; 0d27 (0:0d27)
ld c,a ld c,a
sla b sla b
sla c sla c
ld a,[$ffaf] ld a,[hSCY]
add b add b
ld [$ffaf],a ; update background scroll Y ld [hSCY],a ; update background scroll Y
ld a,[$ffae] ld a,[hSCX]
add c add c
ld [$ffae],a ; update background scroll X ld [hSCX],a ; update background scroll X
; shift all the sprites in the direction opposite of the player's motion ; shift all the sprites in the direction opposite of the player's motion
; so that the player appears to move relative to them ; so that the player appears to move relative to them
ld hl,wSpriteStateData1 + $14 ld hl,wSpriteStateData1 + $14
@ -2310,8 +2310,8 @@ LoadMapData:: ; 1241 (0:1241)
ld [wMapViewVRAMPointer + 1],a ld [wMapViewVRAMPointer + 1],a
xor a xor a
ld [wMapViewVRAMPointer],a ld [wMapViewVRAMPointer],a
ld [$ffaf],a ld [hSCY],a
ld [$ffae],a ld [hSCX],a
ld [wWalkCounter],a ld [wWalkCounter],a
ld [wd119],a ld [wd119],a
ld [wWalkBikeSurfStateCopy],a ld [wWalkBikeSurfStateCopy],a

View file

@ -3,151 +3,156 @@ Serial:: ; 2125 (0:2125)
push bc push bc
push de push de
push hl push hl
ld a, [$ffaa] ld a, [hSerialConnectionStatus]
inc a inc a
jr z, .asm_2142 jr z, .connectionNotYetEstablished
ld a, [$ff01] ld a, [rSB]
ld [$ffad], a ld [hSerialReceiveData], a
ld a, [$ffac] ld a, [hSerialSendData]
ld [$ff01], a ld [rSB], a
ld a, [$ffaa] ld a, [hSerialConnectionStatus]
cp $2 cp USING_INTERNAL_CLOCK
jr z, .asm_2162 jr z, .done
ld a, $80 ; using external clock
ld [$ff02], a ld a, START_TRANSFER_EXTERNAL_CLOCK
jr .asm_2162 ld [rSC], a
.asm_2142 jr .done
ld a, [$ff01] .connectionNotYetEstablished
ld [$ffad], a ld a, [rSB]
ld [$ffaa], a ld [hSerialReceiveData], a
cp $2 ld [hSerialConnectionStatus], a
jr z, .asm_215f cp USING_INTERNAL_CLOCK
jr z, .usingInternalClock
; using external clock
xor a xor a
ld [$ff01], a ld [rSB], a
ld a, $3 ld a, $3
ld [rDIV], a ; $ff04 ld [rDIV], a
.asm_2153 .waitLoop
ld a, [rDIV] ; $ff04 ld a, [rDIV]
bit 7, a bit 7, a
jr nz, .asm_2153 jr nz, .waitLoop
ld a, $80 ld a, START_TRANSFER_EXTERNAL_CLOCK
ld [$ff02], a ld [rSC], a
jr .asm_2162 jr .done
.asm_215f .usingInternalClock
xor a xor a
ld [$ff01], a ld [rSB], a
.asm_2162 .done
ld a, $1 ld a, $1
ld [$ffa9], a ld [hSerialReceivedNewData], a
ld a, $fe ld a, SERIAL_NO_DATA_BYTE
ld [$ffac], a ld [hSerialSendData], a
pop hl pop hl
pop de pop de
pop bc pop bc
pop af pop af
reti reti
Func_216f:: ; 216f (0:216f) ; hl = send data
ld a, $1 ; de = receive data
ld [$ffab], a ; bc = length of data
.asm_2173 Serial_ExchangeBytes:: ; 216f (0:216f)
ld a, 1
ld [hSerialIgnoringInitialData], a
.loop
ld a, [hl] ld a, [hl]
ld [$ffac], a ld [hSerialSendData], a
call Func_219a call Serial_ExchangeByte
push bc push bc
ld b, a ld b, a
inc hl inc hl
ld a, $30 ld a, 48
.asm_217e .waitLoop
dec a dec a
jr nz, .asm_217e jr nz, .waitLoop
ld a, [$ffab] ld a, [hSerialIgnoringInitialData]
and a and a
ld a, b ld a, b
pop bc pop bc
jr z, .asm_2192 jr z, .storeReceivedByte
dec hl dec hl
cp $fd cp SERIAL_PREAMBLE_BYTE
jr nz, .asm_2173 jr nz, .loop
xor a xor a
ld [$ffab], a ld [hSerialIgnoringInitialData], a
jr .asm_2173 jr .loop
.asm_2192 .storeReceivedByte
ld [de], a ld [de], a
inc de inc de
dec bc dec bc
ld a, b ld a, b
or c or c
jr nz, .asm_2173 jr nz, .loop
ret ret
Func_219a:: ; 219a (0:219a) Serial_ExchangeByte:: ; 219a (0:219a)
xor a xor a
ld [$ffa9], a ld [hSerialReceivedNewData], a
ld a, [$ffaa] ld a, [hSerialConnectionStatus]
cp $2 cp USING_INTERNAL_CLOCK
jr nz, .asm_21a7 jr nz, .asm_21a7
ld a, $81 ld a, START_TRANSFER_INTERNAL_CLOCK
ld [$ff02], a ld [rSC], a
.asm_21a7 .asm_21a7
ld a, [$ffa9] ld a, [hSerialReceivedNewData]
and a and a
jr nz, .asm_21f1 jr nz, .asm_21f1
ld a, [$ffaa] ld a, [hSerialConnectionStatus]
cp $1 cp USING_EXTERNAL_CLOCK
jr nz, .asm_21cc jr nz, .asm_21cc
call Func_2237 call IsUnknownCounterZero
jr z, .asm_21cc jr z, .asm_21cc
call Func_2231 call WaitLoop_15Iterations
push hl push hl
ld hl, wcc48 ld hl, wUnknownSerialCounter + 1
inc [hl] inc [hl]
jr nz, .asm_21c3 jr nz, .asm_21c3
dec hl dec hl
inc [hl] inc [hl]
.asm_21c3 .asm_21c3
pop hl pop hl
call Func_2237 call IsUnknownCounterZero
jr nz, .asm_21a7 jr nz, .asm_21a7
jp Func_223f jp SetUnknownCounterToFFFF
.asm_21cc .asm_21cc
ld a, [rIE] ; $ffff ld a, [rIE]
and $f and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK)
cp $8 cp (1 << SERIAL)
jr nz, .asm_21a7 jr nz, .asm_21a7
ld a, [W_NUMHITS] ; wd074 ld a, [wUnknownSerialCounter2]
dec a dec a
ld [W_NUMHITS], a ; wd074 ld [wUnknownSerialCounter2], a
jr nz, .asm_21a7 jr nz, .asm_21a7
ld a, [wd075] ld a, [wUnknownSerialCounter2 + 1]
dec a dec a
ld [wd075], a ld [wUnknownSerialCounter2 + 1], a
jr nz, .asm_21a7 jr nz, .asm_21a7
ld a, [$ffaa] ld a, [hSerialConnectionStatus]
cp $1 cp USING_EXTERNAL_CLOCK
jr z, .asm_21f1 jr z, .asm_21f1
ld a, $ff ld a, 255
.asm_21ee .waitLoop
dec a dec a
jr nz, .asm_21ee jr nz, .waitLoop
.asm_21f1 .asm_21f1
xor a xor a
ld [$ffa9], a ld [hSerialReceivedNewData], a
ld a, [rIE] ; $ffff ld a, [rIE]
and $f and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK)
sub $8 sub (1 << SERIAL)
jr nz, .asm_2204 jr nz, .asm_2204
ld [W_NUMHITS], a ; wd074 ld [wUnknownSerialCounter2], a
ld a, $50 ld a, $50
ld [wd075], a ld [wUnknownSerialCounter2 + 1], a
.asm_2204 .asm_2204
ld a, [$ffad] ld a, [hSerialReceiveData]
cp $fe cp SERIAL_NO_DATA_BYTE
ret nz ret nz
call Func_2237 call IsUnknownCounterZero
jr z, .asm_221f jr z, .asm_221f
push hl push hl
ld hl, wcc48 ld hl, wUnknownSerialCounter + 1
ld a, [hl] ld a, [hl]
dec a dec a
ld [hld], a ld [hld], a
@ -156,149 +161,153 @@ Func_219a:: ; 219a (0:219a)
dec [hl] dec [hl]
.asm_2219 .asm_2219
pop hl pop hl
call Func_2237 call IsUnknownCounterZero
jr z, Func_223f jr z, SetUnknownCounterToFFFF
.asm_221f .asm_221f
ld a, [rIE] ; $ffff ld a, [rIE]
and $f and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK)
cp $8 cp (1 << SERIAL)
ld a, $fe ld a, SERIAL_NO_DATA_BYTE
ret z ret z
ld a, [hl] ld a, [hl]
ld [$ffac], a ld [hSerialSendData], a
call DelayFrame call DelayFrame
jp Func_219a jp Serial_ExchangeByte
Func_2231:: ; 2231 (0:2231) WaitLoop_15Iterations:: ; 2231 (0:2231)
ld a, $f ld a, 15
.asm_2233 .waitLoop
dec a dec a
jr nz, .asm_2233 jr nz, .waitLoop
ret ret
Func_2237:: ; 2237 (0:2237) IsUnknownCounterZero:: ; 2237 (0:2237)
push hl push hl
ld hl, wcc47 ld hl, wUnknownSerialCounter
ld a, [hli] ld a, [hli]
or [hl] or [hl]
pop hl pop hl
ret ret
Func_223f:: ; 223f (0:223f) ; a is always 0 when this is called
SetUnknownCounterToFFFF:: ; 223f (0:223f)
dec a dec a
ld [wcc47], a ld [wUnknownSerialCounter], a
ld [wcc48], a ld [wUnknownSerialCounter + 1], a
ret ret
Func_2247:: ; 2247 (0:2247) ; This is used to exchange the button press and selected menu item on the link menu.
ld hl, wcc42 ; The data is sent thrice and read twice to increase reliability.
ld de, wcc3d Serial_ExchangeLinkMenuSelection:: ; 2247 (0:2247)
ld c, $2 ld hl, wLinkMenuSelectionSendBuffer
ld a, $1 ld de, wLinkMenuSelectionReceiveBuffer
ld [$ffab], a ld c, 2 ; number of bytes to save
.asm_2253 ld a, 1
ld [hSerialIgnoringInitialData], a
.loop
call DelayFrame call DelayFrame
ld a, [hl] ld a, [hl]
ld [$ffac], a ld [hSerialSendData], a
call Func_219a call Serial_ExchangeByte
ld b, a ld b, a
inc hl inc hl
ld a, [$ffab] ld a, [hSerialIgnoringInitialData]
and a and a
ld a, $0 ld a, 0
ld [$ffab], a ld [hSerialIgnoringInitialData], a
jr nz, .asm_2253 jr nz, .loop
ld a, b ld a, b
ld [de], a ld [de], a
inc de inc de
dec c dec c
jr nz, .asm_2253 jr nz, .loop
ret ret
Func_226e:: ; 226e (0:226e) Serial_PrintWaitingTextAndSyncAndExchangeByte:: ; 226e (0:226e)
call SaveScreenTilesToBuffer1 call SaveScreenTilesToBuffer1
callab PrintWaitingText callab PrintWaitingText
call Func_227f call Serial_SyncAndExchangeNybble
jp LoadScreenTilesFromBuffer1 jp LoadScreenTilesFromBuffer1
Func_227f:: ; 227f (0:227f) Serial_SyncAndExchangeNybble:: ; 227f (0:227f)
ld a, $ff ld a, $ff
ld [wcc3e], a ld [wSerialExchangeNybbleReceiveData], a
.asm_2284 .loop1
call Func_22c3 call Serial_ExchangeNybble
call DelayFrame call DelayFrame
call Func_2237 call IsUnknownCounterZero
jr z, .asm_22a0 jr z, .next1
push hl push hl
ld hl, wcc48 ld hl, wUnknownSerialCounter + 1
dec [hl] dec [hl]
jr nz, .asm_229f jr nz, .next2
dec hl dec hl
dec [hl] dec [hl]
jr nz, .asm_229f jr nz, .next2
pop hl pop hl
xor a xor a
jp Func_223f jp SetUnknownCounterToFFFF
.asm_229f .next2
pop hl pop hl
.asm_22a0 .next1
ld a, [wcc3e] ld a, [wSerialExchangeNybbleReceiveData]
inc a inc a
jr z, .asm_2284 jr z, .loop1
ld b, $a ld b, 10
.asm_22a8 .loop2
call DelayFrame call DelayFrame
call Func_22c3 call Serial_ExchangeNybble
dec b dec b
jr nz, .asm_22a8 jr nz, .loop2
ld b, $a ld b, 10
.asm_22b3 .loop3
call DelayFrame call DelayFrame
call Func_22ed call Serial_SendZeroByte
dec b dec b
jr nz, .asm_22b3 jr nz, .loop3
ld a, [wcc3e] ld a, [wSerialExchangeNybbleReceiveData]
ld [wcc3d], a ld [wSerialSyncAndExchangeNybbleReceiveData], a
ret ret
Func_22c3:: ; 22c3 (0:22c3) ; exchange one byte with value of $f or less
call asm_22d7 Serial_ExchangeNybble:: ; 22c3 (0:22c3)
ld a, [wcc42] call .doExchange
ld a, [wSerialExchangeNybbleSendData]
add $60 add $60
ld [$ffac], a ld [hSerialSendData], a
ld a, [$ffaa] ld a, [hSerialConnectionStatus]
cp $2 cp USING_INTERNAL_CLOCK
jr nz, asm_22d7 jr nz, .doExchange
ld a, $81 ld a, START_TRANSFER_INTERNAL_CLOCK
ld [$ff02], a ld [rSC], a
asm_22d7:: ; 22d7 (0:22d7) .doExchange
ld a, [$ffad] ld a, [hSerialReceiveData]
ld [wcc3d], a ld [wSerialExchangeNybbleTempReceiveData], a
and $f0 and $f0
cp $60 cp $60
ret nz ret nz
xor a xor a
ld [$ffad], a ld [hSerialReceiveData], a
ld a, [wcc3d] ld a, [wSerialExchangeNybbleTempReceiveData]
and $f and $f
ld [wcc3e], a ld [wSerialExchangeNybbleReceiveData], a
ret ret
Func_22ed:: ; 22ed (0:22ed) Serial_SendZeroByte:: ; 22ed (0:22ed)
xor a xor a
ld [$ffac], a ld [hSerialSendData], a
ld a, [$ffaa] ld a, [hSerialConnectionStatus]
cp $2 cp USING_INTERNAL_CLOCK
ret nz ret nz
ld a, $81 ld a, START_TRANSFER_INTERNAL_CLOCK
ld [$ff02], a ld [rSC], a
ret ret
Func_22fa:: ; 22fa (0:22fa) Serial_TryEstablishingExternallyClockedConnection:: ; 22fa (0:22fa)
ld a, $2 ld a, ESTABLISH_CONNECTION_WITH_EXTERNAL_CLOCK
ld [$ff01], a ld [rSB], a
xor a xor a
ld [$ffad], a ld [hSerialReceiveData], a
ld a, $80 ld a, START_TRANSFER_EXTERNAL_CLOCK
ld [$ff02], a ld [rSC], a
ret ret

View file

@ -265,8 +265,8 @@ Char5F:: ; 1a91 (0:1a91)
ret ret
Char58:: ; 1a95 (0:1a95) Char58:: ; 1a95 (0:1a95)
ld a,[W_ISLINKBATTLE] ld a,[wLinkState]
cp 4 cp LINK_STATE_BATTLING
jp z,Next1AA2 jp z,Next1AA2
ld a,$EE ld a,$EE
Coorda 18, 16 Coorda 18, 16
@ -506,8 +506,8 @@ TextCommand05:: ; 1bc5 (0:1bc5)
; 06 ; 06
; (no arguments) ; (no arguments)
TextCommand06:: ; 1bcc (0:1bcc) TextCommand06:: ; 1bcc (0:1bcc)
ld a,[W_ISLINKBATTLE] ld a,[wLinkState]
cp a,$04 cp a,LINK_STATE_BATTLING
jp z,TextCommand0D jp z,TextCommand0D
ld a,$ee ; down arrow ld a,$ee ; down arrow
Coorda 18, 16 ; place down arrow in lower right corner of dialogue text box Coorda 18, 16 ; place down arrow in lower right corner of dialogue text box

View file

@ -10,6 +10,8 @@ hSoftReset EQU $FF8A
; presses the reset sequence (A+B+SEL+START). ; presses the reset sequence (A+B+SEL+START).
; Soft reset when 0 is reached. ; Soft reset when 0 is reached.
hBaseTileID 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
@ -38,6 +40,19 @@ H_NUMTOPRINT EQU $FF96 ; 3 bytes
H_POWEROFTEN EQU $FF99 ; 3 bytes H_POWEROFTEN EQU $FF99 ; 3 bytes
H_SAVEDNUMTOPRINT EQU $FF9C ; 3 bytes H_SAVEDNUMTOPRINT EQU $FF9C ; 3 bytes
hSerialReceivedNewData EQU $FFA9
; $01 = using external clock
; $02 = using internal clock
; $ff = establishing connection
hSerialConnectionStatus EQU $FFAA
hSerialIgnoringInitialData EQU $FFAB
hSerialSendData EQU $FFAC
hSerialReceiveData EQU $FFAD
; these values are copied to SCX, SCY, and WY during V-blank ; these values are copied to SCX, SCY, and WY during V-blank
hSCX EQU $FFAE hSCX EQU $FFAE
hSCY EQU $FFAF hSCY EQU $FFAF

157
main.asm
View file

@ -167,7 +167,7 @@ PrintWaitingText:
call TextBoxBorder call TextBoxBorder
jr .asm_4c1a jr .asm_4c1a
.asm_4c17 .asm_4c17
call Func_5ab3 call CableClub_TextBoxBorder
.asm_4c1a .asm_4c1a
hlCoord 4, 11 hlCoord 4, 11
ld de, WaitingText ld de, WaitingText
@ -633,8 +633,8 @@ LoadSpecialWarpData: ; 62ff (1:62ff)
cp BATTLE_CENTER cp BATTLE_CENTER
jr nz, .notBattleCenter jr nz, .notBattleCenter
ld hl, BattleCenterSpec1 ld hl, BattleCenterSpec1
ld a, [$ffaa] ld a, [hSerialConnectionStatus]
cp $2 cp USING_INTERNAL_CLOCK ; which gameboy is clocking determines who is on the left and who is on the right
jr z, .copyWarpData jr z, .copyWarpData
ld hl, BattleCenterSpec2 ld hl, BattleCenterSpec2
jr .copyWarpData jr .copyWarpData
@ -642,8 +642,8 @@ LoadSpecialWarpData: ; 62ff (1:62ff)
cp TRADE_CENTER cp TRADE_CENTER
jr nz, .notTradeCenter jr nz, .notTradeCenter
ld hl, TradeCenterSpec1 ld hl, TradeCenterSpec1
ld a, [$ffaa] ld a, [hSerialConnectionStatus]
cp $2 cp USING_INTERNAL_CLOCK
jr z, .copyWarpData jr z, .copyWarpData
ld hl, TradeCenterSpec2 ld hl, TradeCenterSpec2
jr .copyWarpData jr .copyWarpData
@ -798,7 +798,7 @@ SubtractAmountPaidFromMoney_: ; 6b21 (1:6b21)
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,$13
ld [wd125],a ld [wTextBoxID],a
call DisplayTextBoxID ; redraw money text box call DisplayTextBoxID ; redraw money text box
and a and a
ret ret
@ -1164,12 +1164,10 @@ PrintStartMenuItem: ; 71bb (1:71bb)
INCLUDE "engine/overworld/cable_club_npc.asm" INCLUDE "engine/overworld/cable_club_npc.asm"
; function to draw various text boxes ; function to draw various text boxes
; INPUT:
; [wd125] = text box ID
DisplayTextBoxID_: ; 72ea (1:72ea) DisplayTextBoxID_: ; 72ea (1:72ea)
ld a,[wd125] ; a = text box ID ld a,[wTextBoxID]
cp a,$14 cp a,$14
jp z,DisplayYesNoTextBox jp z,DisplayTwoOptionMenu
ld c,a ld c,a
ld hl,TextBoxFunctionTable ld hl,TextBoxFunctionTable
ld de,3 ld de,3
@ -1437,7 +1435,7 @@ Func_74ba: ; 74ba (1:74ba)
ld hl, wd730 ld hl, wd730
set 6, [hl] set 6, [hl]
ld a, $f ld a, $f
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
hlCoord 13, 1 hlCoord 13, 1
ld b, $1 ld b, $1
@ -1456,12 +1454,12 @@ CurrencyString: ; 74e2 (1:74e2)
Func_74ea: ; 74ea (1:74ea) Func_74ea: ; 74ea (1:74ea)
ld a, [wd730] ld a, [wd730]
set 6, a 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, $e
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
ld a, $3 ld a, $3
ld [wMenuWatchedKeys], a ; wMenuWatchedKeys ld [wMenuWatchedKeys], a ; wMenuWatchedKeys
@ -1476,7 +1474,7 @@ Func_74ea: ; 74ea (1:74ea)
ld [wLastMenuItem], a ; wLastMenuItem ld [wLastMenuItem], a ; wLastMenuItem
ld [wcc37], a ld [wcc37], a
ld a, [wd730] ld a, [wd730]
res 6, a res 6, a ; turn on the printing delay
ld [wd730], a ld [wd730], a
call HandleMenuInput call HandleMenuInput
call PlaceUnfilledArrowMenuCursor call PlaceUnfilledArrowMenuCursor
@ -1505,46 +1503,50 @@ Func_74ea: ; 74ea (1:74ea)
scf scf
ret ret
DisplayYesNoTextBox: ; 7559 (1:7559) ; displays a menu with two options to choose from
; b = Y of upper left corner of text region
; c = X of upper left corner of text region
; hl = address where the text box border should be drawn
DisplayTwoOptionMenu: ; 7559 (1:7559)
push hl push hl
ld a, [wd730] ld a, [wd730]
set 6, a set 6, a ; no printing delay
ld [wd730], a ld [wd730], a
xor a xor a
ld [wd12d], a ld [wd12d], a
ld [wd12e], a ld [wd12e], a
ld a, $3 ld a, A_BUTTON | B_BUTTON
ld [wMenuWatchedKeys], a ; wMenuWatchedKeys ld [wMenuWatchedKeys], a
ld a, $1 ld a, $1
ld [wMaxMenuItem], a ; wMaxMenuItem ld [wMaxMenuItem], a
ld a, b ld a, b
ld [wTopMenuItemY], a ; wTopMenuItemY ld [wTopMenuItemY], a
ld a, c ld a, c
ld [wTopMenuItemX], a ; wTopMenuItemX ld [wTopMenuItemX], a
xor a xor a
ld [wLastMenuItem], a ; wLastMenuItem ld [wLastMenuItem], a
ld [wcc37], a ld [wcc37], a
push hl push hl
ld hl, wd12c ld hl, wTwoOptionMenuID
bit 7, [hl] bit 7, [hl] ; select second menu item by default?
res 7, [hl] res 7, [hl]
jr z, .asm_758d jr z, .storeCurrentMenuItem
inc a inc a
.asm_758d .storeCurrentMenuItem
ld [wCurrentMenuItem], a ; wCurrentMenuItem ld [wCurrentMenuItem], a
pop hl pop hl
push hl push hl
push hl push hl
call Func_763e call TwoOptionMenu_SaveScreenTiles
ld a, [wd12c] ld a, [wTwoOptionMenuID]
ld hl, MenuStrings ; $7671 ld hl, TwoOptionMenuStrings
ld e, a ld e, a
ld d, $0 ld d, $0
ld a, $5 ld a, $5
.loop .menuStringLoop
add hl, de add hl, de
dec a dec a
jr nz, .loop jr nz, .menuStringLoop
ld a, [hli] ld a, [hli]
ld c, a ld c, a
ld a, [hli] ld a, [hli]
@ -1553,22 +1555,22 @@ DisplayYesNoTextBox: ; 7559 (1:7559)
ld d, h ld d, h
pop hl pop hl
push de push de
ld a, [wd12c] ld a, [wTwoOptionMenuID]
cp $5 cp TRADE_CANCEL_MENU
jr nz, .asm_75b9 jr nz, .notTradeCancelMenu
call Func_5ab3 call CableClub_TextBoxBorder
jr .asm_75bc jr .afterTextBoxBorder
.asm_75b9 .notTradeCancelMenu
call TextBoxBorder call TextBoxBorder
.asm_75bc .afterTextBoxBorder
call UpdateSprites call UpdateSprites
pop hl pop hl
ld a, [hli] ld a, [hli]
and a and a ; put blank line before first menu item?
ld bc, $16 ld bc, 20 + 2
jr z, .asm_75ca jr z, .noBlankLine
ld bc, $2a ld bc, 2 * 20 + 2
.asm_75ca .noBlankLine
ld a, [hli] ld a, [hli]
ld e, a ld e, a
ld a, [hli] ld a, [hli]
@ -1577,61 +1579,69 @@ DisplayYesNoTextBox: ; 7559 (1:7559)
add hl, bc add hl, bc
call PlaceString call PlaceString
ld hl, wd730 ld hl, wd730
res 6, [hl] res 6, [hl] ; turn on the printing delay
ld a, [wd12c] ld a, [wTwoOptionMenuID]
cp $7 cp NO_YES_MENU
jr nz, .asm_7603 jr nz, .notNoYesMenu
; No/Yes menu
; this menu type ignores the B button
; it only seems to be used when confirming the deletion of a save file
xor a xor a
ld [wd12c], a ld [wTwoOptionMenuID], a
ld a, [wFlags_0xcd60] ld a, [wFlags_0xcd60]
push af push af
push hl push hl
ld hl, wFlags_0xcd60 ld hl, wFlags_0xcd60
bit 5, [hl] bit 5, [hl]
set 5, [hl] set 5, [hl] ; don't play sound when A or B is pressed in menu
pop hl pop hl
.asm_75f0 .noYesMenuInputLoop
call HandleMenuInput call HandleMenuInput
bit 1, a bit 1, a ; A button pressed?
jr nz, .asm_75f0 jr nz, .noYesMenuInputLoop ; try again if A was not pressed
pop af pop af
pop hl pop hl
ld [wFlags_0xcd60], a ld [wFlags_0xcd60], a
ld a, (SFX_02_40 - SFX_Headers_02) / 3 ld a, (SFX_02_40 - SFX_Headers_02) / 3
call PlaySound call PlaySound
jr .asm_760f jr .pressedAButton
.asm_7603 .notNoYesMenu
xor a xor a
ld [wd12c], a ld [wTwoOptionMenuID], a
call HandleMenuInput call HandleMenuInput
pop hl pop hl
bit 1, a bit 1, a ; A button pressed?
jr nz, .asm_7627 jr nz, .choseSecondMenuItem ; automatically choose the second option if B is pressed
.asm_760f .pressedAButton
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem]
ld [wd12d], a ld [wd12d], a
and a and a
jr nz, .asm_7627 jr nz, .choseSecondMenuItem
; chose first menu item
ld a, $1 ld a, $1
ld [wd12e], a ld [wd12e], a
ld c, $f ld c, 15
call DelayFrames call DelayFrames
call Func_7656 call TwoOptionMenu_RestoreScreenTiles
and a and a
ret ret
.asm_7627 .choseSecondMenuItem
ld a, $1 ld a, $1
ld [wCurrentMenuItem], a ; wCurrentMenuItem ld [wCurrentMenuItem], a
ld [wd12d], a ld [wd12d], a
ld a, $2 ld a, $2
ld [wd12e], a ld [wd12e], a
ld c, $f ld c, 15
call DelayFrames call DelayFrames
call Func_7656 call TwoOptionMenu_RestoreScreenTiles
scf scf
ret ret
Func_763e: ; 763e (1:763e) ; Some of the wider/taller two option menus will not have the screen areas
; they cover be fully saved/restored by the two functions below.
; The bottom and right edges of the menu may remain after the function returns.
TwoOptionMenu_SaveScreenTiles: ; 763e (1:763e)
ld de, wHPBarMaxHP ld de, wHPBarMaxHP
ld bc, $506 ld bc, $506
.asm_7644 .asm_7644
@ -1641,7 +1651,7 @@ Func_763e: ; 763e (1:763e)
dec c dec c
jr nz, .asm_7644 jr nz, .asm_7644
push bc push bc
ld bc, $e ld bc, 14
add hl, bc add hl, bc
pop bc pop bc
ld c, $6 ld c, $6
@ -1649,7 +1659,7 @@ Func_763e: ; 763e (1:763e)
jr nz, .asm_7644 jr nz, .asm_7644
ret ret
Func_7656: ; 7656 (1:7656) TwoOptionMenu_RestoreScreenTiles: ; 7656 (1:7656)
ld de, wHPBarMaxHP ld de, wHPBarMaxHP
ld bc, $506 ld bc, $506
.asm_765c .asm_765c
@ -1668,7 +1678,12 @@ Func_7656: ; 7656 (1:7656)
call UpdateSprites call UpdateSprites
ret ret
MenuStrings: ; 7671 (1:7671) ; Format:
; 00: byte width
; 01: byte height
; 02: byte put blank line before first menu item
; 03: word text pointer
TwoOptionMenuStrings: ; 7671 (1:7671)
db 4,3,0 db 4,3,0
dw .YesNoMenu dw .YesNoMenu
db 6,3,0 db 6,3,0

View file

@ -20,7 +20,7 @@ CeladonGameCornerScript_48bcf: ; 48bcf (12:4bcf)
srl a srl a
srl a srl a
srl a srl a
ld [wcd05], a ld [wUnknownSlotVar], a
ret ret
CeladonGameCornerScript_48bec: ; 48bec (12:4bec) CeladonGameCornerScript_48bec: ; 48bec (12:4bec)

View file

@ -1,5 +1,5 @@
CeladonPokecenterScript: ; 488b8 (12:48b8) CeladonPokecenterScript: ; 488b8 (12:48b8)
call Func_22fa call Serial_TryEstablishingExternallyClockedConnection
jp EnableAutoTextBoxDrawing jp EnableAutoTextBoxDrawing
CeladonPokecenterTextPointers: ; 488be (12:48be) CeladonPokecenterTextPointers: ; 488be (12:48be)

View file

@ -13,5 +13,5 @@ CeruleanHouse1Text2: ; 1d702 (7:5702)
db $08 ; asm db $08 ; asm
ld a, $6 ld a, $6
ld [wWhichTrade], a ld [wWhichTrade], a
predef Predef54 predef DoInGameTradeDialogue
jp TextScriptEnd jp TextScriptEnd

View file

@ -1,5 +1,5 @@
CeruleanPokecenterScript: ; 5c645 (17:4645) CeruleanPokecenterScript: ; 5c645 (17:4645)
call Func_22fa call Serial_TryEstablishingExternallyClockedConnection
jp EnableAutoTextBoxDrawing jp EnableAutoTextBoxDrawing
CeruleanPokecenterTextPointers: ; 5c64b (17:464b) CeruleanPokecenterTextPointers: ; 5c64b (17:464b)

View file

@ -1,5 +1,5 @@
CinnabarPokecenterScript: ; 75e2c (1d:5e2c) CinnabarPokecenterScript: ; 75e2c (1d:5e2c)
call Func_22fa call Serial_TryEstablishingExternallyClockedConnection
jp EnableAutoTextBoxDrawing jp EnableAutoTextBoxDrawing
CinnabarPokecenterTextPointers: ; 75e32 (1d:5e32) CinnabarPokecenterTextPointers: ; 75e32 (1d:5e32)

View file

@ -129,7 +129,7 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
ld hl, DayCareMText_56428 ld hl, DayCareMText_56428
call PrintText call PrintText
ld a, $13 ld a, $13
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
call YesNoChoice call YesNoChoice
ld hl, DayCareMText_56437 ld hl, DayCareMText_56437
@ -159,7 +159,7 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
ld a, (SFX_02_5a - SFX_Headers_02) / 3 ld a, (SFX_02_5a - SFX_Headers_02) / 3
call PlaySoundWaitForCurrent call PlaySoundWaitForCurrent
ld a, $13 ld a, $13
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
ld hl, DayCareMText_5644f ld hl, DayCareMText_5644f
call PrintText call PrintText

View file

@ -1,5 +1,5 @@
FuchsiaPokecenterScript: ; 75063 (1d:5063) FuchsiaPokecenterScript: ; 75063 (1d:5063)
call Func_22fa call Serial_TryEstablishingExternallyClockedConnection
jp EnableAutoTextBoxDrawing jp EnableAutoTextBoxDrawing
FuchsiaPokecenterTextPointers: ; 75069 (1d:5069) FuchsiaPokecenterTextPointers: ; 75069 (1d:5069)

View file

@ -1,5 +1,5 @@
IndigoPlateauLobbyScript: ; 19c5b (6:5c5b) IndigoPlateauLobbyScript: ; 19c5b (6:5c5b)
call Func_22fa call Serial_TryEstablishingExternallyClockedConnection
call EnableAutoTextBoxDrawing call EnableAutoTextBoxDrawing
ld hl, wd126 ld hl, wd126
bit 6, [hl] bit 6, [hl]

View file

@ -21,5 +21,5 @@ Lab2Text3: ; 75c37 (1d:5c37)
ld a, $8 ld a, $8
ld [wWhichTrade], a ld [wWhichTrade], a
asm_78552: ; 75c3d (1d:5c3d) asm_78552: ; 75c3d (1d:5c3d)
predef Predef54 predef DoInGameTradeDialogue
jp TextScriptEnd jp TextScriptEnd

View file

@ -108,7 +108,7 @@ Lab4Text2: ; 75dda (1d:5dda)
db $08 ; asm db $08 ; asm
ld a, $3 ld a, $3
ld [wWhichTrade], a ld [wWhichTrade], a
predef Predef54 predef DoInGameTradeDialogue
jp TextScriptEnd jp TextScriptEnd
LoadFossilItemAndMonNameBank1D: ; 75de8 (1d:5de8) LoadFossilItemAndMonNameBank1D: ; 75de8 (1d:5de8)

View file

@ -1,5 +1,5 @@
LavenderPokecenterScript: ; 5c8da (17:48da) LavenderPokecenterScript: ; 5c8da (17:48da)
call Func_22fa call Serial_TryEstablishingExternallyClockedConnection
jp EnableAutoTextBoxDrawing jp EnableAutoTextBoxDrawing
LavenderPokecenterTextPointers: ; 5c8e0 (17:48e0) LavenderPokecenterTextPointers: ; 5c8e0 (17:48e0)

View file

@ -1,5 +1,5 @@
MtMoonPokecenterScript: ; 492cf (12:52cf) MtMoonPokecenterScript: ; 492cf (12:52cf)
call Func_22fa call Serial_TryEstablishingExternallyClockedConnection
jp EnableAutoTextBoxDrawing jp EnableAutoTextBoxDrawing
MtMoonPokecenterTextPointers: ; 492d5 (12:52d5) MtMoonPokecenterTextPointers: ; 492d5 (12:52d5)
@ -29,7 +29,7 @@ MtMoonPokecenterText4: ; 492ec (12:52ec)
ld hl, MtMoonPokecenterText_4935c ld hl, MtMoonPokecenterText_4935c
call PrintText call PrintText
ld a, $13 ld a, $13
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
call YesNoChoice call YesNoChoice
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
@ -57,7 +57,7 @@ MtMoonPokecenterText4: ; 492ec (12:52ec)
ld c, $3 ld c, $3
predef SubBCDPredef predef SubBCDPredef
ld a, $13 ld a, $13
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
ld hl, wd7c6 ld hl, wd7c6
set 7, [hl] set 7, [hl]

View file

@ -70,7 +70,7 @@ Museum1FText1: ; 5c135 (17:4135)
jp asm_d1145 jp asm_d1145
.asm_3ded4 .asm_3ded4
ld a, $13 ld a, $13
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
xor a xor a
ld [hJoyHeld], a ld [hJoyHeld], a
@ -105,7 +105,7 @@ Museum1FText1: ; 5c135 (17:4135)
ld c, $3 ld c, $3
predef SubBCDPredef predef SubBCDPredef
ld a, $13 ld a, $13
ld [wd125], a ld [wTextBoxID], a
call DisplayTextBoxID call DisplayTextBoxID
ld a, (SFX_02_5a - SFX_Headers_02) / 3 ld a, (SFX_02_5a - SFX_Headers_02) / 3
call PlaySoundWaitForCurrent call PlaySoundWaitForCurrent

View file

@ -1,5 +1,5 @@
PewterPokecenterScript: ; 5c587 (17:4587) PewterPokecenterScript: ; 5c587 (17:4587)
call Func_22fa call Serial_TryEstablishingExternallyClockedConnection
jp EnableAutoTextBoxDrawing jp EnableAutoTextBoxDrawing
PewterPokecenterTextPointers: ; 5c58d (17:458d) PewterPokecenterTextPointers: ; 5c58d (17:458d)

View file

@ -1,5 +1,5 @@
RockTunnelPokecenterScript: ; 493ba (12:53ba) RockTunnelPokecenterScript: ; 493ba (12:53ba)
call Func_22fa call Serial_TryEstablishingExternallyClockedConnection
jp EnableAutoTextBoxDrawing jp EnableAutoTextBoxDrawing
RockTunnelPokecenterTextPointers: ; 493c0 (12:53c0) RockTunnelPokecenterTextPointers: ; 493c0 (12:53c0)

View file

@ -11,7 +11,7 @@ Route11GateUpstairsText1: ; 4945f (12:545f)
db $08 ; asm db $08 ; asm
xor a xor a
ld [wWhichTrade], a ld [wWhichTrade], a
predef Predef54 predef DoInGameTradeDialogue
asm_49469: ; 49469 (12:5469) asm_49469: ; 49469 (12:5469)
jp TextScriptEnd jp TextScriptEnd

View file

@ -10,7 +10,7 @@ Route18GateUpstairsText1: ; 4997e (12:597e)
db $08 ; asm db $08 ; asm
ld a, $5 ld a, $5
ld [wWhichTrade], a ld [wWhichTrade], a
predef Predef54 predef DoInGameTradeDialogue
jp TextScriptEnd jp TextScriptEnd
Route18GateUpstairsText2: ; 4998c (12:598c) Route18GateUpstairsText2: ; 4998c (12:598c)

View file

@ -13,5 +13,5 @@ Route2HouseText2: ; 1def9 (7:5ef9)
db $08 ; asm db $08 ; asm
ld a, $1 ld a, $1
ld [wWhichTrade], a ld [wWhichTrade], a
predef Predef54 predef DoInGameTradeDialogue
jp TextScriptEnd jp TextScriptEnd

View file

@ -2,7 +2,7 @@
ld hl,.ForJust500Text ld hl,.ForJust500Text
call PrintText call PrintText
ld a,$13 ld a,$13
ld [wd125],a ld [wTextBoxID],a
call DisplayTextBoxID call DisplayTextBoxID
call YesNoChoice call YesNoChoice
ld a,[wCurrentMenuItem] ld a,[wCurrentMenuItem]
@ -49,7 +49,7 @@
call $3736 call $3736
call $373e call $373e
ld a,$13 ld a,$13
ld [wd125],a ld [wTextBoxID],a
call DisplayTextBoxID call DisplayTextBoxID
ld hl,.MakePaymentText ld hl,.MakePaymentText
call PrintText call PrintText

View file

@ -148,7 +148,7 @@ SafariZoneEntranceTextPointers: ; 752b9 (1d:52b9)
TX_FAR SafariZoneEntranceText_9e6e4 ; 0x9e6e4 TX_FAR SafariZoneEntranceText_9e6e4 ; 0x9e6e4
db $8 db $8
ld a, $13 ld a, $13
ld [wd125],a ld [wTextBoxID],a
call DisplayTextBoxID call DisplayTextBoxID
call YesNoChoice call YesNoChoice
ld a,[wCurrentMenuItem] ld a,[wCurrentMenuItem]
@ -178,7 +178,7 @@ SafariZoneEntranceTextPointers: ; 752b9 (1d:52b9)
ld c,3 ld c,3
predef SubBCDPredef predef SubBCDPredef
ld a,$13 ld a,$13
ld [wd125],a ld [wTextBoxID],a
call DisplayTextBoxID call DisplayTextBoxID
ld hl,.MakePaymentText ld hl,.MakePaymentText
call PrintText call PrintText

View file

@ -1,5 +1,5 @@
SaffronPokecenterScript: ; 5d535 (17:5535) SaffronPokecenterScript: ; 5d535 (17:5535)
call Func_22fa call Serial_TryEstablishingExternallyClockedConnection
jp EnableAutoTextBoxDrawing jp EnableAutoTextBoxDrawing
SaffronPokecenterTextPointers: ; 5d53b (17:553b) SaffronPokecenterTextPointers: ; 5d53b (17:553b)

View file

@ -13,6 +13,6 @@ UndergroundPathEntranceRoute5Text1: ; 5d6b2 (17:56b2)
db $08 ; asm db $08 ; asm
ld a, $9 ld a, $9
ld [wWhichTrade], a ld [wWhichTrade], a
predef Predef54 predef DoInGameTradeDialogue
ld hl, UndergroundPathEntranceRoute5_5d6af ld hl, UndergroundPathEntranceRoute5_5d6af
ret ret

View file

@ -8,5 +8,5 @@ VermilionHouse3Text1: ; 19c17 (6:5c17)
db $08 ; asm db $08 ; asm
ld a, $4 ld a, $4
ld [wWhichTrade], a ld [wWhichTrade], a
predef Predef54 predef DoInGameTradeDialogue
jp TextScriptEnd jp TextScriptEnd

View file

@ -1,5 +1,5 @@
VermilionPokecenterScript: ; 5c98f (17:498f) VermilionPokecenterScript: ; 5c98f (17:498f)
call Func_22fa call Serial_TryEstablishingExternallyClockedConnection
jp EnableAutoTextBoxDrawing jp EnableAutoTextBoxDrawing
VermilionPokecenterTextPointers: ; 5c995 (17:4995) VermilionPokecenterTextPointers: ; 5c995 (17:4995)

View file

@ -1,5 +1,5 @@
ViridianPokeCenterScript: ; 4425d (11:425d) ViridianPokeCenterScript: ; 4425d (11:425d)
call Func_22fa call Serial_TryEstablishingExternallyClockedConnection
jp EnableAutoTextBoxDrawing jp EnableAutoTextBoxDrawing
ViridianPokecenterTextPointers: ; 44263 (11:4263) ViridianPokecenterTextPointers: ; 44263 (11:4263)

View file

@ -1231,7 +1231,7 @@ _NoMovesLeftText:: ; 89892 (22:5892)
_MultiHitText:: ; 898aa (22:58aa) _MultiHitText:: ; 898aa (22:58aa)
text "Hit the enemy" text "Hit the enemy"
line "@" line "@"
TX_NUM W_NUMHITS,1,1 TX_NUM wPlayerNumHits,1,1
text " times!" text " times!"
prompt prompt
@ -1450,7 +1450,7 @@ _MirrorMoveFailedText:: ; 89b96 (22:5b96)
_HitXTimesText:: ; 89baf (22:5baf) _HitXTimesText:: ; 89baf (22:5baf)
text "Hit @" text "Hit @"
TX_NUM wcd05, 1, 1 TX_NUM wEnemyNumHits, 1, 1
text " times!" text " times!"
prompt prompt
@ -1973,7 +1973,7 @@ _HisNameIsText:: ; 8a64a (22:664a)
prompt prompt
_WillBeTradedText:: ; 8a677 (22:6677) _WillBeTradedText:: ; 8a677 (22:6677)
TX_RAM wTrainerFacingDirection TX_RAM wNameOfPlayerMonToBeTraded
text " and" text " and"
line "@" line "@"
TX_RAM wcd6d TX_RAM wcd6d
@ -2787,19 +2787,19 @@ _PokemonCenterFarewellText:: ; a2910 (28:6910)
line "you again!" line "you again!"
done done
_CableClubNPCText7:: ; a292b (28:692b) _CableClubNPCAreaReservedFor2FriendsLinkedByCableText:: ; a292b (28:692b)
text "This area is" text "This area is"
line "reserved for 2" line "reserved for 2"
cont "friends who are" cont "friends who are"
cont "linked by cable." cont "linked by cable."
done done
_CableClubNPCText1:: ; a2969 (28:6969) _CableClubNPCWelcomeText:: ; a2969 (28:6969)
text "Welcome to the" text "Welcome to the"
line "Cable Club!" line "Cable Club!"
done done
_CableClubNPCText2:: ; a2985 (28:6985) _CableClubNPCPleaseApplyHereHaveToSaveText:: ; a2985 (28:6985)
text "Please apply here." text "Please apply here."
para "Before opening" para "Before opening"
@ -2807,10 +2807,10 @@ _CableClubNPCText2:: ; a2985 (28:6985)
cont "to save the game." cont "to save the game."
done done
_CableClubNPCText3:: ; a29cc (28:69cc) _CableClubNPCPleaseWaitText:: ; a29cc (28:69cc)
text "Please wait.@@" text "Please wait.@@"
_CableClubNPCText4:: ; a29db (28:69db) _CableClubNPCLinkClosedBecauseOfInactivityText:: ; a29db (28:69db)
text "The link has been" text "The link has been"
line "closed because of" line "closed because of"
cont "inactivity." cont "inactivity."
@ -2823,11 +2823,11 @@ _CableClubNPCText4:: ; a29db (28:69db)
SECTION "Text 10", ROMX, BANK[TEXT_10] SECTION "Text 10", ROMX, BANK[TEXT_10]
_CableClubNPCText5:: ; a4000 (29:4000) _CableClubNPCPleaseComeAgainText:: ; a4000 (29:4000)
text "Please come again!" text "Please come again!"
done done
_CableClubNPCText6:: ; a4014 (29:4014) _CableClubNPCMakingPreparationsText:: ; a4014 (29:4014)
text "We're making" text "We're making"
line "preparations." line "preparations."
cont "Please wait." cont "Please wait."
@ -3229,21 +3229,21 @@ _ConnectCableText:: ; a809a (2a:409a)
_TradedForText:: ; a80bc (2a:40bc) _TradedForText:: ; a80bc (2a:40bc)
text $52, " traded" text $52, " traded"
line "@" line "@"
TX_RAM wcd13 TX_RAM wInGameTradeGiveMonName
text " for" text " for"
cont "@" cont "@"
TX_RAM wPlayerMonAccuracyMod TX_RAM wInGameTradeReceiveMonName
text "!@@" text "!@@"
_WannaTrade1Text:: ; a80d8 (2a:40d8) _WannaTrade1Text:: ; a80d8 (2a:40d8)
text "I'm looking for" text "I'm looking for"
line "@" line "@"
TX_RAM wcd13 TX_RAM wInGameTradeGiveMonName
text "! Wanna" text "! Wanna"
para "trade one for" para "trade one for"
line "@" line "@"
TX_RAM wPlayerMonAccuracyMod TX_RAM wInGameTradeReceiveMonName
text "? " text "? "
done done
@ -3255,7 +3255,7 @@ _NoTrade1Text:: ; a810b (2a:410b)
_WrongMon1Text:: ; a811d (2a:411d) _WrongMon1Text:: ; a811d (2a:411d)
text "What? That's not" text "What? That's not"
line "@" line "@"
TX_RAM wcd13 TX_RAM wInGameTradeGiveMonName
text "!" text "!"
para "If you get one," para "If you get one,"
@ -3269,7 +3269,7 @@ _Thanks1Text:: ; a8155 (2a:4155)
_AfterTrade1Text:: ; a8162 (2a:4162) _AfterTrade1Text:: ; a8162 (2a:4162)
text "Isn't my old" text "Isn't my old"
line "@" line "@"
TX_RAM wPlayerMonAccuracyMod TX_RAM wInGameTradeReceiveMonName
text " great?" text " great?"
done done
@ -3278,10 +3278,10 @@ _WannaTrade2Text:: ; a817c (2a:417c)
line "you want to trade" line "you want to trade"
para "your @" para "your @"
TX_RAM wcd13 TX_RAM wInGameTradeGiveMonName
db $0 db $0
line "for @" line "for @"
TX_RAM wPlayerMonAccuracyMod TX_RAM wInGameTradeReceiveMonName
text "?" text "?"
done done
@ -3293,7 +3293,7 @@ _NoTrade2Text:: ; a81b5 (2a:41b5)
_WrongMon2Text:: ; a81d3 (2a:41d3) _WrongMon2Text:: ; a81d3 (2a:41d3)
text "Hmmm? This isn't" text "Hmmm? This isn't"
line "@" line "@"
TX_RAM wcd13 TX_RAM wInGameTradeGiveMonName
text "." text "."
para "Think of me when" para "Think of me when"
@ -3313,7 +3313,7 @@ IF DEF(_YELLOW)
cont "magnificent!" cont "magnificent!"
ELSE ELSE
text "The @" text "The @"
TX_RAM wcd13 TX_RAM wInGameTradeGiveMonName
text " you" text " you"
line "traded to me" line "traded to me"
@ -3324,12 +3324,12 @@ ENDC
_WannaTrade3Text:: ; a8240 (2a:4240) _WannaTrade3Text:: ; a8240 (2a:4240)
text "Hi! Do you have" text "Hi! Do you have"
line "@" line "@"
TX_RAM wcd13 TX_RAM wInGameTradeGiveMonName
text "?" text "?"
para "Want to trade it" para "Want to trade it"
line "for @" line "for @"
TX_RAM wPlayerMonAccuracyMod TX_RAM wInGameTradeReceiveMonName
text "?" text "?"
done done
@ -3340,7 +3340,7 @@ _NoTrade3Text:: ; a8274 (2a:4274)
_WrongMon3Text:: ; a8284 (2a:4284) _WrongMon3Text:: ; a8284 (2a:4284)
text "...This is no" text "...This is no"
line "@" line "@"
TX_RAM wcd13 TX_RAM wInGameTradeGiveMonName
text "." text "."
para "If you get one," para "If you get one,"
@ -3358,11 +3358,11 @@ ENDC
_AfterTrade3Text:: ; a82c9 (2a:42c9) _AfterTrade3Text:: ; a82c9 (2a:42c9)
text "How is my old" text "How is my old"
line "@" line "@"
TX_RAM wPlayerMonAccuracyMod TX_RAM wInGameTradeReceiveMonName
text "?" text "?"
para "My @" para "My @"
TX_RAM wcd13 TX_RAM wInGameTradeGiveMonName
text " is" text " is"
line "doing great!" line "doing great!"
done done

190
wram.asm
View file

@ -183,12 +183,21 @@ wTileMap:: ; c3a0
; buffer for tiles that are visible on screen (20 columns by 18 rows) ; buffer for tiles that are visible on screen (20 columns by 18 rows)
ds 20 * 18 ds 20 * 18
wSerialPartyMonsPatchList:: ; c508
; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
wTileMapBackup:: ; c508 wTileMapBackup:: ; c508
; buffer for temporarily saving and restoring current screen's tiles ; buffer for temporarily saving and restoring current screen's tiles
; (e.g. if menus are drawn on top) ; (e.g. if menus are drawn on top)
ds 20 * 18 ; ds 20 * 18
ds 120 ds 200
wSerialEnemyMonsPatchList:: ; c5d0
; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
ds 200
ds 80
wTempPic:: wTempPic::
wOverworldMap:: ; c6e8 wOverworldMap:: ; c6e8
@ -257,7 +266,12 @@ wListScrollOffset:: ; cc36
ds 1 ds 1
wcc37:: ds 1 wcc37:: ds 1
wcc38:: ds 2
wTradeCenterPointerTableIndex:: ; cc38
ds 1
ds 1
wcc3a:: ds 1 wcc3a:: ds 1
wcc3b:: ds 1 wcc3b:: ds 1
@ -265,12 +279,46 @@ wDoNotWaitForButtonPressAfterDisplayingText:: ; cc3c
; if non-zero, skip waiting for a button press after displaying text in DisplayTextID ; if non-zero, skip waiting for a button press after displaying text in DisplayTextID
ds 1 ds 1
wSerialSyncAndExchangeNybbleReceiveData:: ; cc3d
; the final received nybble is stored here by Serial_SyncAndExchangeNybble
wSerialExchangeNybbleTempReceiveData:: ; cc3d
; temporary nybble used by Serial_ExchangeNybble
wLinkMenuSelectionReceiveBuffer:: ; cc3d
; two byte buffer
; the received menu selection is stored twice
wcc3d:: ds 1 wcc3d:: ds 1
wcc3e:: ds 4
wcc42:: ds 1 wSerialExchangeNybbleReceiveData:: ; cc3e
wcc43:: ds 4 ; the final received nybble is stored here by Serial_ExchangeNybble
ds 1
ds 3
wSerialExchangeNybbleSendData:: ; cc42
; this nybble is sent when using Serial_SyncAndExchangeNybble or Serial_ExchangeNybble
wLinkMenuSelectionSendBuffer:: ; cc42
; two byte buffer
; the menu selection byte is stored twice before sending
ds 5
wLinkTimeoutCounter:: ; cc47
; 1 byte
wUnknownSerialCounter:: ; cc47
; 2 bytes
wcc47:: ds 1 wcc47:: ds 1
wcc48:: ds 1 wcc48:: ds 1
wWhichTradeMonSelectionMenu:: ; cc49
; $00 = player mons
; $01 = enemy mons
wcc49:: ds 1 wcc49:: ds 1
wMenuWrappingEnabled:: ; cc4a wMenuWrappingEnabled:: ; cc4a
@ -348,7 +396,7 @@ wPlayerSelectedMove:: ; ccdc
wEnemySelectedMove:: ; ccdd wEnemySelectedMove:: ; ccdd
ds 1 ds 1
wLinkBattleRNCount:: ; ccde wLinkBattleRandomNumberListIndex:: ; ccde
ds 1 ds 1
wAICount:: ; ccdf wAICount:: ; ccdf
@ -391,24 +439,32 @@ wPartyFoughtCurrentEnemyFlags::
wccf6:: ds 1 wccf6:: ds 1
wccf7:: ds 14 wccf7:: ds 14
wcd05:: ds 1
wcd06:: ds 9 wUnknownSlotVar:: ; cd05
wEnemyNumHits:: ; cd05
; number of hits by enemy in attacks like Double Slap, etc.
wEnemyBideAccumulatedDamage:: ; cd05
; the amount of damage accumulated by the enemy while biding (2 bytes)
ds 10
wInGameTradeGiveMonSpecies:: ; cd0f
wPlayerMonUnmodifiedLevel:: ; cd0f wPlayerMonUnmodifiedLevel:: ; cd0f
ds 0
wcd0f:: ; overload, used in in-game trade code
ds 1 ds 1
wInGameTradeTextPointerTablePointer:: ; cd10
wPlayerMonUnmodifiedMaxHP:: ; cd10 wPlayerMonUnmodifiedMaxHP:: ; cd10
ds 0 ds 2
wcd10:: ; overload, used in in-game trade code
ds 1 wInGameTradeTextPointerTableIndex:: ; cd12
wcd11:: ; overload, used in in-game trade code
ds 1
wPlayerMonUnmodifiedAttack:: ; cd12 wPlayerMonUnmodifiedAttack:: ; cd12
ds 0
wcd12:: ; overload, used in in-game trade code
ds 1 ds 1
wcd13:: ; overload, used in in-game trade code (to store name string) wInGameTradeGiveMonName:: ; cd13
ds 1 ds 1
wPlayerMonUnmodifiedDefense:: ; cd14 wPlayerMonUnmodifiedDefense:: ; cd14
ds 2 ds 2
@ -430,6 +486,9 @@ wPlayerMonSpeedMod:: ; cd1c
ds 1 ds 1
wPlayerMonSpecialMod:: ; cd1d wPlayerMonSpecialMod:: ; cd1d
ds 1 ds 1
wInGameTradeReceiveMonName:: ; cd1e
wPlayerMonAccuracyMod:: ; cd1e wPlayerMonAccuracyMod:: ; cd1e
ds 1 ds 1
wPlayerMonEvasionMod:: ; cd1f wPlayerMonEvasionMod:: ; cd1f
@ -445,8 +504,10 @@ wEnemyMonUnmodifiedAttack:: ; cd26
ds 2 ds 2
wEnemyMonUnmodifiedDefense:: ; cd28 wEnemyMonUnmodifiedDefense:: ; cd28
ds 1 ds 1
wcd29:: ; overload, used in in-game trade code
wInGameTradeMonNick:: ; cd29
ds 1 ds 1
wEnemyMonUnmodifiedSpeed:: ; cd2a wEnemyMonUnmodifiedSpeed:: ; cd2a
ds 2 ds 2
wEnemyMonUnmodifiedSpecial:: ; cd2c wEnemyMonUnmodifiedSpecial:: ; cd2c
@ -475,7 +536,10 @@ wEnemyMonAccuracyMod:: ; cd32
wEnemyMonEvasionMod:: ; cd33 wEnemyMonEvasionMod:: ; cd33
ds 1 ds 1
wcd34:: ds 3 wInGameTradeReceiveMonSpecies::
ds 1
ds 2
wNPCMovementDirections2Index:: ; cd37 wNPCMovementDirections2Index:: ; cd37
@ -501,6 +565,10 @@ wOverrideSimulatedJoypadStatesMask:: ; cd3b
ds 1 ds 1
wTradedPlayerMonSpecies:: ; cd3d
wTradingWhichPlayerMon:: ; cd3d
wChangeBoxSavedMapTextPointer:: ; cd3d wChangeBoxSavedMapTextPointer:: ; cd3d
wFlyAnimUsingCoordList:: ; cd3d wFlyAnimUsingCoordList:: ; cd3d
@ -520,6 +588,10 @@ wWhichTrade:: ; cd3d
wTrainerSpriteOffset:: ; cd3d wTrainerSpriteOffset:: ; cd3d
ds 1 ds 1
wTradedEnemyMonSpecies:: ; cd3e
wTradingWhichEnemyMon:: ; cd3e
wFlyAnimCounter:: ; cd3e wFlyAnimCounter:: ; cd3e
wPlayerSpinInPlaceAnimFrameDelayDelta:: ; cd3e wPlayerSpinInPlaceAnimFrameDelayDelta:: ; cd3e
@ -531,6 +603,8 @@ wHiddenObjectFunctionRomBank:: ; cd3e
wTrainerEngageDistance:: ; cd3e wTrainerEngageDistance:: ; cd3e
ds 1 ds 1
wNameOfPlayerMonToBeTraded:: ; cd3f
wFlyAnimBirdSpriteImageIndex:: ; cd3f wFlyAnimBirdSpriteImageIndex:: ; cd3f
wPlayerSpinInPlaceAnimFrameDelayEndValue:: ; cd3f wPlayerSpinInPlaceAnimFrameDelayEndValue:: ; cd3f
@ -550,7 +624,9 @@ wHiddenObjectY:: ; cd40
wTrainerScreenY:: ; cd40 wTrainerScreenY:: ; cd40
ds 1 ds 1
wHiddenObjectX:: ; cd40 wTradedPlayerMonOT:: ; cd41
wHiddenObjectX:: ; cd41
wTrainerScreenX:: ; cd41 wTrainerScreenX:: ; cd41
ds 1 ds 1
@ -565,13 +641,21 @@ wcd48:: ds 1
wcd49:: ds 1 wcd49:: ds 1
wcd4a:: ds 1 wcd4a:: ds 1
wcd4b:: ds 1 wcd4b:: ds 1
wTradedPlayerMonOTID:: ; cd4c
wcd4c:: ds 1 wcd4c:: ds 1
wcd4d:: ds 1 wcd4d:: ds 1
wTradedEnemyMonOT:: ; cd4e
wcd4e:: ds 1 wcd4e:: ds 1
wcd4f:: ds 1 wcd4f:: ds 1
wcd50:: ds 9 wcd50:: ds 9
wcd59:: ds 1
wcd5a:: ds 1 wTradedEnemyMonOTID:: ; cd59
ds 2
wcd5b:: ds 1 wcd5b:: ds 1
wcd5c:: ds 1 wcd5c:: ds 1
wcd5d:: ds 1 wcd5d:: ds 1
@ -581,6 +665,7 @@ wcd5f:: ds 1
wFlags_0xcd60:: ; cd60 wFlags_0xcd60:: ; cd60
; bit 0: is player engaged by trainer (to avoid being engaged by multiple trainers simultaneously) ; bit 0: is player engaged by trainer (to avoid being engaged by multiple trainers simultaneously)
; bit 1: boulder dust animation (from using Strength) pending ; bit 1: boulder dust animation (from using Strength) pending
; bit 5: don't play sound when A or B is pressed in menu
; bit 6: tried pushing against boulder once (you need to push twice before it will move) ; bit 6: tried pushing against boulder once (you need to push twice before it will move)
ds 1 ds 1
@ -599,6 +684,9 @@ wcd72:: ds 5
wcd77:: ds 1 wcd77:: ds 1
wcd78:: ds 9 wcd78:: ds 9
wSerialOtherGameboyRandomNumberListBlock:: ; cd81
; buffer for transferring the random number list generated by the other gameboy
wTileMapBackup2:: ; cd81 wTileMapBackup2:: ; cd81
; second buffer for temporarily saving and restoring current screen's tiles (e.g. if menus are drawn on top) ; second buffer for temporarily saving and restoring current screen's tiles (e.g. if menus are drawn on top)
ds 20 * 18 ds 20 * 18
@ -960,11 +1048,16 @@ W_ENEMYDISABLEDMOVE:: ; d072
ds 1 ds 1
W_NUMHITS:: ; d074 wPlayerNumHits:: ; d074
; number of hits in attacks like Doubleslap, etc. ; number of hits by player in attacks like Double Slap, etc.
ds 1
wd075:: ds 3 wPlayerBideAccumulatedDamage:: ; d074
; the amount of damage accumulated by the player while biding (2 bytes)
wUnknownSerialCounter2:: ; d075
; 2 bytes
ds 4
wEscapedFromBattle:: wEscapedFromBattle::
; non-zero when an item or move that allows escape from battle was used ; non-zero when an item or move that allows escape from battle was used
@ -1205,7 +1298,10 @@ wNumRunAttempts::
wd121:: ds 1 wd121:: ds 1
wd122:: ds 2 wd122:: ds 2
wd124:: ds 1 wd124:: ds 1
wd125:: ds 1
wTextBoxID:: ; d125
ds 1
wd126:: ds 1 wd126:: ds 1
W_CURENEMYLVL:: ; d127 W_CURENEMYLVL:: ; d127
@ -1215,10 +1311,10 @@ wd128:: ds 1
wd129:: ds 1 wd129:: ds 1
wd12a:: ds 1 wd12a:: ds 1
W_ISLINKBATTLE:: ; d12b wLinkState:: ; d12b
ds 1 ds 1
wd12c:: ds 1 wTwoOptionMenuID:: ds 1
wd12d:: ds 1 wd12d:: ds 1
wd12e:: ds 1 wd12e:: ds 1
wd12f:: ds 1 wd12f:: ds 1
@ -1250,10 +1346,20 @@ W_PRIZE3:: ; d13f
ds 1 ds 1
wSerialRandomNumberListBlock:: ; d141
; the first 7 bytes are the preamble
wd141:: ds 2 wd141:: ds 2
wd143:: ds 2 wd143:: ds 2
wd145:: ds 3 wd145:: ds 3
wd148:: ds 10
wLinkBattleRandomNumberList:: ; d148
; shared list of 9 random numbers, indexed by wLinkBattleRandomNumberListIndex
ds 10
wSerialPlayerDataBlock:: ; d152
; the first 6 bytes are the preamble
wd152:: ds 1 wd152:: ds 1
wd153:: ds 3 wd153:: ds 3
wd156:: ds 1 wd156:: ds 1
@ -1886,7 +1992,11 @@ wd736:: ; d736
; bit 6: jumping down a ledge ; bit 6: jumping down a ledge
ds 1 ds 1
wd737:: ds 4 wCompletedInGameTradeFlags:: ; d737
ds 2
ds 2
wd73b:: ds 1 wd73b:: ds 1
wd73c:: ds 3 wd73c:: ds 3
@ -1902,7 +2012,16 @@ wd743:: ds 1
wd744:: ds 3 wd744:: ds 3
wd747:: ds 3 wd747:: ds 3
wd74a:: ds 1 wd74a:: ds 1
wd74b:: ds 1
wd74b:: ; d74b
; bit 0: Prof. Oak has lead the player to the north end of his lab
; bit 1: Prof. Oak has asked the player to choose a pokemon
; bit 2: the player and the rival have received their pokemon
; bit 3: the player has battled the rival in Oak's lab
; bit 4: Prof. Oak has given the player 5 pokeballs
; bit 5: received pokedex
ds 1
wd74c:: ds 2 wd74c:: ds 2
wd74e:: ds 3 wd74e:: ds 3
wd751:: ds 1 wd751:: ds 1
@ -2028,6 +2147,9 @@ wd880:: ds 1
wd881:: ds 1 wd881:: ds 1
wd882:: ds 5 wd882:: ds 5
wLinkEnemyTrainerName:: ; d887
; linked game's trainer name
W_GRASSRATE:: ; d887 W_GRASSRATE:: ; d887
ds 1 ds 1