2018-01-11 09:00:01 -08:00
|
|
|
TRADEANIM_RIGHT_ARROW EQU $ed
|
|
|
|
TRADEANIM_LEFT_ARROW EQU $ee
|
|
|
|
|
|
|
|
; TradeAnim_TubeAnimJumptable.Jumptable indexes
|
|
|
|
const_def
|
|
|
|
const TRADEANIMSTATE_0 ; 0
|
|
|
|
const TRADEANIMSTATE_1 ; 1
|
|
|
|
const TRADEANIMSTATE_2 ; 2
|
|
|
|
const TRADEANIMSTATE_3 ; 3
|
|
|
|
TRADEANIMJUMPTABLE_LENGTH EQU const_value
|
|
|
|
|
2018-01-16 11:30:10 -08:00
|
|
|
TradeAnimation: ; 28f24
|
2015-11-22 21:21:21 -08:00
|
|
|
xor a
|
|
|
|
ld [wcf66], a
|
|
|
|
ld hl, wPlayerTrademonSenderName
|
|
|
|
ld de, wOTTrademonSenderName
|
2016-01-09 13:28:22 -08:00
|
|
|
call LinkTradeAnim_LoadTradePlayerNames
|
2015-11-22 21:21:21 -08:00
|
|
|
ld hl, wPlayerTrademonSpecies
|
|
|
|
ld de, wOTTrademonSpecies
|
2016-01-09 13:28:22 -08:00
|
|
|
call LinkTradeAnim_LoadTradeMonSpecies
|
2016-05-13 20:23:26 -07:00
|
|
|
ld de, .script
|
|
|
|
jr RunTradeAnimScript
|
2015-11-22 21:21:21 -08:00
|
|
|
|
2016-05-13 20:23:26 -07:00
|
|
|
.script
|
2015-11-22 23:08:08 -08:00
|
|
|
tradeanim_setup_givemon_scroll
|
|
|
|
tradeanim_show_givemon_data
|
|
|
|
tradeanim_do_givemon_scroll
|
|
|
|
tradeanim_wait_80
|
|
|
|
tradeanim_wait_96
|
|
|
|
tradeanim_poof
|
|
|
|
tradeanim_rocking_ball
|
|
|
|
tradeanim_enter_link_tube
|
|
|
|
tradeanim_wait_anim
|
|
|
|
tradeanim_bulge_through_tube
|
|
|
|
tradeanim_wait_anim
|
2016-05-13 20:23:26 -07:00
|
|
|
tradeanim_textbox_scroll
|
2015-11-22 23:08:08 -08:00
|
|
|
tradeanim_give_trademon_sfx
|
|
|
|
tradeanim_tube_to_ot
|
|
|
|
tradeanim_sent_to_ot_text
|
|
|
|
tradeanim_scroll_out_right
|
|
|
|
|
|
|
|
tradeanim_ot_sends_text_1
|
|
|
|
tradeanim_ot_bids_farewell
|
|
|
|
tradeanim_wait_40
|
|
|
|
tradeanim_scroll_out_right
|
|
|
|
tradeanim_get_trademon_sfx
|
|
|
|
tradeanim_tube_to_player
|
|
|
|
tradeanim_enter_link_tube
|
|
|
|
tradeanim_drop_ball
|
|
|
|
tradeanim_exit_link_tube
|
|
|
|
tradeanim_wait_anim
|
|
|
|
tradeanim_show_getmon_data
|
|
|
|
tradeanim_poof
|
|
|
|
tradeanim_wait_anim
|
2016-05-13 20:23:26 -07:00
|
|
|
tradeanim_frontpic_scroll
|
2015-11-22 23:08:08 -08:00
|
|
|
tradeanim_animate_frontpic
|
|
|
|
tradeanim_wait_80_if_ot_egg
|
2016-05-13 20:23:26 -07:00
|
|
|
tradeanim_textbox_scroll
|
2015-11-22 23:08:08 -08:00
|
|
|
tradeanim_take_care_of_text
|
|
|
|
tradeanim_scroll_out_right
|
2015-11-22 21:21:21 -08:00
|
|
|
tradeanim_end
|
|
|
|
|
2018-01-16 11:30:10 -08:00
|
|
|
TradeAnimationPlayer2: ; 28f63
|
2015-11-22 21:21:21 -08:00
|
|
|
xor a
|
|
|
|
ld [wcf66], a
|
|
|
|
ld hl, wOTTrademonSenderName
|
|
|
|
ld de, wPlayerTrademonSenderName
|
2016-01-09 13:28:22 -08:00
|
|
|
call LinkTradeAnim_LoadTradePlayerNames
|
2015-11-22 21:21:21 -08:00
|
|
|
ld hl, wOTTrademonSpecies
|
|
|
|
ld de, wPlayerTrademonSpecies
|
2016-01-09 13:28:22 -08:00
|
|
|
call LinkTradeAnim_LoadTradeMonSpecies
|
2016-05-13 20:23:26 -07:00
|
|
|
ld de, .script
|
|
|
|
jr RunTradeAnimScript
|
2015-11-22 21:21:21 -08:00
|
|
|
|
2016-05-13 20:23:26 -07:00
|
|
|
.script
|
2015-11-22 23:08:08 -08:00
|
|
|
tradeanim_ot_sends_text_2
|
|
|
|
tradeanim_ot_bids_farewell
|
|
|
|
tradeanim_wait_40
|
|
|
|
tradeanim_scroll_out_right
|
|
|
|
tradeanim_get_trademon_sfx
|
|
|
|
tradeanim_tube_to_ot
|
|
|
|
tradeanim_enter_link_tube
|
|
|
|
tradeanim_drop_ball
|
|
|
|
tradeanim_exit_link_tube
|
|
|
|
tradeanim_wait_anim
|
|
|
|
tradeanim_show_getmon_data
|
|
|
|
tradeanim_poof
|
|
|
|
tradeanim_wait_anim
|
2016-05-13 20:23:26 -07:00
|
|
|
tradeanim_frontpic_scroll
|
2015-11-22 23:08:08 -08:00
|
|
|
tradeanim_animate_frontpic
|
|
|
|
tradeanim_wait_180_if_ot_egg
|
2016-05-13 20:23:26 -07:00
|
|
|
tradeanim_textbox_scroll
|
2015-11-22 23:08:08 -08:00
|
|
|
tradeanim_take_care_of_text
|
|
|
|
tradeanim_scroll_out_right
|
|
|
|
|
|
|
|
tradeanim_setup_givemon_scroll
|
|
|
|
tradeanim_show_givemon_data
|
|
|
|
tradeanim_do_givemon_scroll
|
|
|
|
tradeanim_wait_40
|
|
|
|
tradeanim_poof
|
|
|
|
tradeanim_rocking_ball
|
|
|
|
tradeanim_enter_link_tube
|
|
|
|
tradeanim_wait_anim
|
|
|
|
tradeanim_bulge_through_tube
|
|
|
|
tradeanim_wait_anim
|
2016-05-13 20:23:26 -07:00
|
|
|
tradeanim_textbox_scroll
|
2015-11-22 23:08:08 -08:00
|
|
|
tradeanim_give_trademon_sfx
|
|
|
|
tradeanim_tube_to_player
|
|
|
|
tradeanim_sent_to_ot_text
|
|
|
|
tradeanim_scroll_out_right
|
2015-11-22 21:21:21 -08:00
|
|
|
tradeanim_end
|
|
|
|
|
2016-05-13 20:23:26 -07:00
|
|
|
RunTradeAnimScript: ; 28fa1
|
2017-12-09 11:22:58 -08:00
|
|
|
ld hl, wTradeAnimAddress
|
2015-11-22 21:21:21 -08:00
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
ld [hl], d
|
|
|
|
ld a, [hMapAnims]
|
|
|
|
push af
|
|
|
|
xor a
|
|
|
|
ld [hMapAnims], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wVramState
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hl]
|
|
|
|
push af
|
|
|
|
res 0, [hl]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOptions
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hl]
|
|
|
|
push af
|
|
|
|
set 4, [hl]
|
2016-01-09 13:28:22 -08:00
|
|
|
call .TradeAnimLayout
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [wcf66]
|
|
|
|
and a
|
|
|
|
jr nz, .anim_loop
|
|
|
|
ld de, MUSIC_EVOLUTION
|
|
|
|
call PlayMusic2
|
|
|
|
.anim_loop
|
|
|
|
call DoTradeAnimation
|
|
|
|
jr nc, .anim_loop
|
|
|
|
pop af
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wOptions], a
|
2015-11-22 21:21:21 -08:00
|
|
|
pop af
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wVramState], a
|
2015-11-22 21:21:21 -08:00
|
|
|
pop af
|
|
|
|
ld [hMapAnims], a
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 28fdb
|
|
|
|
|
2016-01-09 13:28:22 -08:00
|
|
|
.TradeAnimLayout: ; 28fdb
|
2015-11-22 21:21:21 -08:00
|
|
|
xor a
|
|
|
|
ld [wJumptableIndex], a
|
|
|
|
call ClearBGPalettes
|
|
|
|
call ClearSprites
|
|
|
|
call ClearTileMap
|
|
|
|
call DisableLCD
|
|
|
|
call LoadFontsBattleExtra
|
2017-12-24 09:47:30 -08:00
|
|
|
callfar ClearSpriteAnims
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hCGB]
|
|
|
|
and a
|
2016-01-09 13:28:22 -08:00
|
|
|
jr z, .NotCGB
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, $1
|
|
|
|
ld [rVBK], a
|
2017-12-28 04:32:33 -08:00
|
|
|
ld hl, vTiles0
|
|
|
|
ld bc, sScratch - vTiles0
|
2015-11-22 21:21:21 -08:00
|
|
|
xor a
|
|
|
|
call ByteFill
|
|
|
|
ld a, $0
|
|
|
|
ld [rVBK], a
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.NotCGB:
|
2015-11-22 21:21:21 -08:00
|
|
|
hlbgcoord 0, 0
|
2017-12-28 04:32:33 -08:00
|
|
|
ld bc, sScratch - vBGMap0
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, " "
|
|
|
|
call ByteFill
|
|
|
|
ld hl, TradeGameBoyLZ
|
2017-12-28 04:32:33 -08:00
|
|
|
ld de, vTiles2 tile $31
|
2015-11-22 21:21:21 -08:00
|
|
|
call Decompress
|
|
|
|
ld hl, TradeArrowGFX
|
2018-01-11 09:00:01 -08:00
|
|
|
ld de, vTiles0 tile TRADEANIM_RIGHT_ARROW
|
|
|
|
ld bc, 1 tiles
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, BANK(TradeArrowGFX)
|
|
|
|
call FarCopyBytes
|
2018-01-11 09:00:01 -08:00
|
|
|
ld hl, TradeArrowGFX + 1 tiles
|
|
|
|
ld de, vTiles0 tile TRADEANIM_LEFT_ARROW
|
|
|
|
ld bc, 1 tiles
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, BANK(TradeArrowGFX)
|
|
|
|
call FarCopyBytes
|
|
|
|
xor a
|
|
|
|
ld [hSCX], a
|
|
|
|
ld [hSCY], a
|
|
|
|
ld a, $7
|
|
|
|
ld [hWX], a
|
|
|
|
ld a, $90
|
|
|
|
ld [hWY], a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall GetTrademonFrontpic
|
2015-11-22 21:21:21 -08:00
|
|
|
call EnableLCD
|
2016-01-09 13:28:22 -08:00
|
|
|
call LoadTradeBallAndCableGFX
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [wPlayerTrademonSpecies]
|
|
|
|
ld hl, wPlayerTrademonDVs
|
2017-12-28 04:32:33 -08:00
|
|
|
ld de, vTiles0
|
2015-12-17 10:49:26 -08:00
|
|
|
call TradeAnim_GetFrontpic
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [wOTTrademonSpecies]
|
|
|
|
ld hl, wOTTrademonDVs
|
2017-12-28 04:32:33 -08:00
|
|
|
ld de, vTiles0 tile $31
|
2015-12-17 10:49:26 -08:00
|
|
|
call TradeAnim_GetFrontpic
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [wPlayerTrademonSpecies]
|
|
|
|
ld de, wPlayerTrademonSpeciesName
|
2015-12-17 10:49:26 -08:00
|
|
|
call TradeAnim_GetNickname
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [wOTTrademonSpecies]
|
|
|
|
ld de, wOTTrademonSpeciesName
|
2015-12-17 10:49:26 -08:00
|
|
|
call TradeAnim_GetNickname
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_NormalPals
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29082
|
|
|
|
|
|
|
|
DoTradeAnimation: ; 29082
|
|
|
|
ld a, [wJumptableIndex]
|
|
|
|
bit 7, a
|
|
|
|
jr nz, .finished
|
|
|
|
call .DoTradeAnimCommand
|
2017-12-24 09:47:30 -08:00
|
|
|
callfar PlaySpriteAnimations
|
2015-11-22 21:21:21 -08:00
|
|
|
ld hl, wcf65
|
|
|
|
inc [hl]
|
|
|
|
call DelayFrame
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.finished
|
|
|
|
call LoadStandardFont
|
|
|
|
scf
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 290a0
|
|
|
|
|
|
|
|
.DoTradeAnimCommand: ; 290a0
|
|
|
|
ld a, [wJumptableIndex]
|
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
|
|
|
ld hl, .JumpTable
|
|
|
|
add hl, de
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, de
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2017-06-09 14:01:10 -07:00
|
|
|
jp hl
|
2015-11-22 21:21:21 -08:00
|
|
|
; 290af
|
|
|
|
|
|
|
|
.JumpTable: ; 290af
|
2017-12-26 15:45:04 -08:00
|
|
|
; entries correspond to macros/scripts/trade_anims.asm enumeration
|
2016-05-13 20:23:26 -07:00
|
|
|
dw TradeAnim_AdvanceScriptPointer ; 00
|
|
|
|
dw TradeAnim_ShowGivemonData ; 01
|
|
|
|
dw TradeAnim_ShowGetmonData ; 02
|
|
|
|
dw TradeAnim_EnterLinkTube1 ; 03
|
|
|
|
dw TradeAnim_EnterLinkTube2 ; 04
|
|
|
|
dw TradeAnim_ExitLinkTube ; 05
|
|
|
|
dw TradeAnim_TubeToOT1 ; 06
|
|
|
|
dw TradeAnim_TubeToOT2 ; 07
|
|
|
|
dw TradeAnim_TubeToOT3 ; 08
|
|
|
|
dw TradeAnim_TubeToOT4 ; 09
|
|
|
|
dw TradeAnim_TubeToOT5 ; 0a
|
|
|
|
dw TradeAnim_TubeToOT6 ; 0b
|
|
|
|
dw TradeAnim_TubeToOT7 ; 0c
|
|
|
|
dw TradeAnim_TubeToOT8 ; 0d
|
|
|
|
dw TradeAnim_TubeToPlayer1 ; 0e
|
|
|
|
dw TradeAnim_TubeToPlayer2 ; 0f
|
|
|
|
dw TradeAnim_TubeToPlayer3 ; 10
|
|
|
|
dw TradeAnim_TubeToPlayer4 ; 11
|
|
|
|
dw TradeAnim_TubeToPlayer5 ; 12
|
|
|
|
dw TradeAnim_TubeToPlayer6 ; 13
|
|
|
|
dw TradeAnim_TubeToPlayer7 ; 14
|
|
|
|
dw TradeAnim_TubeToPlayer8 ; 15
|
|
|
|
dw TradeAnim_SentToOTText ; 16
|
|
|
|
dw TradeAnim_OTBidsFarewell ; 17
|
|
|
|
dw TradeAnim_TakeCareOfText ; 18
|
|
|
|
dw TradeAnim_OTSendsText1 ; 19
|
|
|
|
dw TradeAnim_OTSendsText2 ; 1a
|
|
|
|
dw TradeAnim_SetupGivemonScroll ; 1b
|
|
|
|
dw TradeAnim_DoGivemonScroll ; 1c
|
|
|
|
dw TradeAnim_FrontpicScrollStart ; 1d
|
|
|
|
dw TradeAnim_TextboxScrollStart ; 1e
|
|
|
|
dw TradeAnim_ScrollOutRight ; 1f
|
|
|
|
dw TradeAnim_ScrollOutRight2 ; 20
|
|
|
|
dw TraideAnim_Wait80 ; 21
|
|
|
|
dw TraideAnim_Wait40 ; 22
|
|
|
|
dw TradeAnim_RockingBall ; 23
|
|
|
|
dw TradeAnim_DropBall ; 24
|
|
|
|
dw TradeAnim_WaitAnim ; 25
|
|
|
|
dw TradeAnim_WaitAnim2 ; 26
|
|
|
|
dw TradeAnim_Poof ; 27
|
2015-11-22 23:08:08 -08:00
|
|
|
dw TradeAnim_BulgeThroughTube ; 28
|
2016-05-13 20:23:26 -07:00
|
|
|
dw TradeAnim_GiveTrademonSFX ; 29
|
|
|
|
dw TradeAnim_GetTrademonSFX ; 2a
|
|
|
|
dw TradeAnim_End ; 2b
|
|
|
|
dw TradeAnim_AnimateFrontpic ; 2c
|
|
|
|
dw TraideAnim_Wait96 ; 2d
|
|
|
|
dw TraideAnim_Wait80IfOTEgg ; 2e
|
|
|
|
dw TraideAnim_Wait180IfOTEgg ; 2f
|
2015-11-22 21:21:21 -08:00
|
|
|
; 2910f
|
|
|
|
|
2016-05-13 20:23:26 -07:00
|
|
|
TradeAnim_IncrementJumptableIndex: ; 2910f
|
2015-11-22 21:21:21 -08:00
|
|
|
ld hl, wJumptableIndex
|
|
|
|
inc [hl]
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29114
|
|
|
|
|
2016-05-13 20:23:26 -07:00
|
|
|
TradeAnim_AdvanceScriptPointer: ; 29114
|
2017-12-09 11:22:58 -08:00
|
|
|
ld hl, wTradeAnimAddress
|
2015-11-22 21:21:21 -08:00
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
|
|
|
ld a, [de]
|
|
|
|
ld [wJumptableIndex], a
|
|
|
|
inc de
|
|
|
|
ld [hl], d
|
|
|
|
dec hl
|
|
|
|
ld [hl], e
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29123
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_End: ; 29123
|
2015-11-22 21:21:21 -08:00
|
|
|
ld hl, wJumptableIndex
|
|
|
|
set 7, [hl]
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29129
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_TubeToOT1: ; 29129
|
2018-01-11 09:00:01 -08:00
|
|
|
ld a, TRADEANIM_RIGHT_ARROW
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_PlaceTrademonStatsOnTubeAnim
|
2016-01-09 13:28:22 -08:00
|
|
|
ld a, [wLinkTradeSendmonSpecies]
|
2015-11-22 21:21:21 -08:00
|
|
|
ld [wd265], a
|
|
|
|
xor a
|
|
|
|
depixel 5, 11, 4, 0
|
|
|
|
ld b, $0
|
2016-05-13 19:46:32 -07:00
|
|
|
jr TradeAnim_InitTubeAnim
|
2015-11-22 21:21:21 -08:00
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_TubeToPlayer1: ; 2913c
|
2018-01-11 09:00:01 -08:00
|
|
|
ld a, TRADEANIM_LEFT_ARROW
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_PlaceTrademonStatsOnTubeAnim
|
2016-01-09 13:28:22 -08:00
|
|
|
ld a, [wLinkTradeGetmonSpecies]
|
2015-11-22 21:21:21 -08:00
|
|
|
ld [wd265], a
|
2018-01-11 09:00:01 -08:00
|
|
|
ld a, TRADEANIMSTATE_2
|
2015-11-22 21:21:21 -08:00
|
|
|
depixel 9, 18, 4, 4
|
|
|
|
ld b, $4
|
2016-05-13 19:46:32 -07:00
|
|
|
TradeAnim_InitTubeAnim: ; 2914e
|
2015-11-22 21:21:21 -08:00
|
|
|
push bc
|
|
|
|
push de
|
|
|
|
push bc
|
|
|
|
push de
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
push af
|
|
|
|
call DisableLCD
|
2017-12-24 09:47:30 -08:00
|
|
|
callfar ClearSpriteAnims
|
2015-11-22 21:21:21 -08:00
|
|
|
hlbgcoord 20, 3
|
2016-05-13 19:46:32 -07:00
|
|
|
ld bc, 12
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, $60
|
|
|
|
call ByteFill
|
|
|
|
pop af
|
2016-05-13 19:46:32 -07:00
|
|
|
|
|
|
|
call TradeAnim_TubeAnimJumptable
|
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
xor a
|
|
|
|
ld [hSCX], a
|
|
|
|
ld a, $7
|
|
|
|
ld [hWX], a
|
|
|
|
ld a, $70
|
|
|
|
ld [hWY], a
|
|
|
|
call EnableLCD
|
2016-01-09 13:28:22 -08:00
|
|
|
call LoadTradeBubbleGFX
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
pop de
|
2016-05-13 19:46:32 -07:00
|
|
|
ld a, SPRITE_ANIM_INDEX_TRADEMON_ICON
|
2015-11-22 21:21:21 -08:00
|
|
|
call _InitSpriteAnimStruct
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2016-05-13 22:11:01 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
ld [hl], b
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
pop de
|
2016-05-13 19:46:32 -07:00
|
|
|
ld a, SPRITE_ANIM_INDEX_TRADEMON_BUBBLE
|
2015-11-22 21:21:21 -08:00
|
|
|
call _InitSpriteAnimStruct
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2016-05-13 22:11:01 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
ld [hl], b
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
call WaitBGMap
|
2016-05-13 19:46:32 -07:00
|
|
|
ld b, SCGB_TRADE_TUBE
|
2015-11-22 21:21:21 -08:00
|
|
|
call GetSGBLayout
|
2015-12-17 10:49:26 -08:00
|
|
|
ld a, %11100100 ; 3,2,1,0
|
2015-11-22 21:21:21 -08:00
|
|
|
call DmgToCgbBGPals
|
2016-05-13 19:46:32 -07:00
|
|
|
ld a, %11010000
|
2015-12-09 08:38:40 -08:00
|
|
|
call DmgToCgbObjPal0
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2018-01-11 12:36:11 -08:00
|
|
|
ld a, 92
|
|
|
|
ld [wFrameCounter], a
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 291af
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_TubeToOT2: ; 291af
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_FlashBGPals
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hSCX]
|
|
|
|
add $2
|
|
|
|
ld [hSCX], a
|
|
|
|
cp $50
|
|
|
|
ret nz
|
2018-01-11 09:00:01 -08:00
|
|
|
ld a, TRADEANIMSTATE_1
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_TubeAnimJumptable
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 291c4
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_TubeToOT3: ; 291c4
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_FlashBGPals
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hSCX]
|
|
|
|
add $2
|
|
|
|
ld [hSCX], a
|
|
|
|
cp $a0
|
|
|
|
ret nz
|
2018-01-11 09:00:01 -08:00
|
|
|
ld a, TRADEANIMSTATE_2
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_TubeAnimJumptable
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 291d9
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_TubeToOT4: ; 291d9
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_FlashBGPals
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hSCX]
|
|
|
|
add $2
|
|
|
|
ld [hSCX], a
|
|
|
|
and a
|
|
|
|
ret nz
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 291e8
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_TubeToPlayer3: ; 291e8
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_FlashBGPals
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hSCX]
|
|
|
|
sub $2
|
|
|
|
ld [hSCX], a
|
|
|
|
cp $b0
|
|
|
|
ret nz
|
2018-01-11 09:00:01 -08:00
|
|
|
ld a, TRADEANIMSTATE_1
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_TubeAnimJumptable
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 291fd
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_TubeToPlayer4: ; 291fd
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_FlashBGPals
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hSCX]
|
|
|
|
sub $2
|
|
|
|
ld [hSCX], a
|
|
|
|
cp $60
|
|
|
|
ret nz
|
2018-01-11 09:00:01 -08:00
|
|
|
xor a ; TRADEANIMSTATE_0
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_TubeAnimJumptable
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29211
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_TubeToPlayer5: ; 29211
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_FlashBGPals
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hSCX]
|
|
|
|
sub $2
|
|
|
|
ld [hSCX], a
|
|
|
|
and a
|
|
|
|
ret nz
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29220
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_TubeToOT6:
|
|
|
|
TradeAnim_TubeToPlayer6: ; 29220
|
2018-01-11 12:36:11 -08:00
|
|
|
ld a, 128
|
|
|
|
ld [wFrameCounter], a
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29229
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_TubeToOT8:
|
|
|
|
TradeAnim_TubeToPlayer8: ; 29229
|
2015-11-22 21:21:21 -08:00
|
|
|
call ClearBGPalettes
|
|
|
|
call ClearTileMap
|
|
|
|
call ClearSprites
|
|
|
|
call DisableLCD
|
2017-12-24 09:47:30 -08:00
|
|
|
callfar ClearSpriteAnims
|
2015-11-22 21:21:21 -08:00
|
|
|
hlbgcoord 0, 0
|
2017-12-28 04:32:33 -08:00
|
|
|
ld bc, sScratch - vBGMap0
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, " "
|
|
|
|
call ByteFill
|
|
|
|
xor a
|
|
|
|
ld [hSCX], a
|
|
|
|
ld a, $90
|
|
|
|
ld [hWY], a
|
|
|
|
call EnableLCD
|
2016-01-09 13:28:22 -08:00
|
|
|
call LoadTradeBallAndCableGFX
|
2015-11-22 21:21:21 -08:00
|
|
|
call WaitBGMap
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_NormalPals
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 2925d
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_TubeToOT5:
|
|
|
|
TradeAnim_TubeToOT7:
|
|
|
|
TradeAnim_TubeToPlayer2:
|
|
|
|
TradeAnim_TubeToPlayer7: ; 2925d
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_FlashBGPals
|
2018-01-11 12:36:11 -08:00
|
|
|
ld hl, wFrameCounter
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .done
|
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
.done
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 2926d
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_GiveTrademonSFX: ; 2926d
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ld de, SFX_GIVE_TRADEMON
|
|
|
|
call PlaySFX
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29277
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_GetTrademonSFX: ; 29277
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ld de, SFX_GET_TRADEMON
|
|
|
|
call PlaySFX
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29281
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
TradeAnim_TubeAnimJumptable: ; 29281
|
2018-01-16 14:27:50 -08:00
|
|
|
maskbits TRADEANIMJUMPTABLE_LENGTH
|
2015-11-22 21:21:21 -08:00
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
2016-05-13 19:46:32 -07:00
|
|
|
ld hl, .Jumptable
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, de
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, de
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2017-06-09 14:01:10 -07:00
|
|
|
jp hl
|
2015-11-22 21:21:21 -08:00
|
|
|
; 2928f
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.Jumptable: ; 2928f
|
2018-01-11 09:00:01 -08:00
|
|
|
; entries correspond to TRADEANIMSTATE_* constants
|
2016-05-13 19:46:32 -07:00
|
|
|
dw .Zero
|
|
|
|
dw .One
|
|
|
|
dw .Two
|
|
|
|
dw .Three
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29297
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.Zero: ; 29297
|
|
|
|
.Three: ; 29297
|
|
|
|
call TradeAnim_BlankTileMap
|
2015-11-22 21:21:21 -08:00
|
|
|
hlcoord 9, 3
|
|
|
|
ld [hl], $5b
|
|
|
|
inc hl
|
2015-11-22 23:08:08 -08:00
|
|
|
ld bc, 10
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, $60
|
|
|
|
call ByteFill
|
|
|
|
hlcoord 3, 2
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_CopyTradeGameBoyTilemap
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 292af
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.One: ; 292af
|
|
|
|
call TradeAnim_BlankTileMap
|
2015-11-22 21:21:21 -08:00
|
|
|
hlcoord 0, 3
|
|
|
|
ld bc, SCREEN_WIDTH
|
|
|
|
ld a, $60
|
|
|
|
call ByteFill
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 292be
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.Two: ; 292be
|
|
|
|
call TradeAnim_BlankTileMap
|
2015-11-22 21:21:21 -08:00
|
|
|
hlcoord 0, 3
|
|
|
|
ld bc, $11
|
|
|
|
ld a, $60
|
|
|
|
call ByteFill
|
|
|
|
hlcoord 17, 3
|
|
|
|
ld a, $5d
|
|
|
|
ld [hl], a
|
2015-12-17 10:49:26 -08:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, $61
|
|
|
|
ld de, SCREEN_WIDTH
|
|
|
|
ld c, $3
|
2015-11-22 23:08:08 -08:00
|
|
|
.loop
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, de
|
|
|
|
ld [hl], a
|
|
|
|
dec c
|
2015-11-22 23:08:08 -08:00
|
|
|
jr nz, .loop
|
2015-12-17 10:49:26 -08:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, de
|
|
|
|
ld a, $5f
|
|
|
|
ld [hld], a
|
|
|
|
ld a, $5b
|
|
|
|
ld [hl], a
|
|
|
|
hlcoord 10, 6
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_CopyTradeGameBoyTilemap
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 292ec
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
TradeAnim_CopyTradeGameBoyTilemap: ; 292ec
|
2015-11-22 21:21:21 -08:00
|
|
|
ld de, TradeGameBoyTilemap
|
|
|
|
lb bc, 8, 6
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_CopyBoxFromDEtoHL
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 292f6
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
TradeAnim_PlaceTrademonStatsOnTubeAnim: ; 292f6
|
2015-11-22 21:21:21 -08:00
|
|
|
push af
|
|
|
|
call ClearBGPalettes
|
|
|
|
call WaitTop
|
2017-12-28 04:32:33 -08:00
|
|
|
ld a, HIGH(vBGMap1)
|
2015-11-22 21:21:21 -08:00
|
|
|
ld [hBGMapAddress + 1], a
|
|
|
|
call ClearTileMap
|
|
|
|
hlcoord 0, 0
|
|
|
|
ld bc, SCREEN_WIDTH
|
|
|
|
ld a, "─"
|
|
|
|
call ByteFill
|
|
|
|
hlcoord 0, 1
|
2015-11-22 23:08:08 -08:00
|
|
|
ld de, wLinkPlayer1Name
|
2015-11-22 21:21:21 -08:00
|
|
|
call PlaceString
|
2015-11-22 23:08:08 -08:00
|
|
|
ld hl, wLinkPlayer2Name
|
2015-11-22 21:21:21 -08:00
|
|
|
ld de, 0
|
2015-11-22 23:08:08 -08:00
|
|
|
.find_name_end_loop
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hli]
|
|
|
|
cp "@"
|
2015-11-22 23:08:08 -08:00
|
|
|
jr z, .done
|
2015-11-22 21:21:21 -08:00
|
|
|
dec de
|
2015-11-22 23:08:08 -08:00
|
|
|
jr .find_name_end_loop
|
2015-11-22 21:21:21 -08:00
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
.done
|
2015-11-22 21:21:21 -08:00
|
|
|
hlcoord 0, 4
|
|
|
|
add hl, de
|
2015-11-22 23:08:08 -08:00
|
|
|
ld de, wLinkPlayer2Name
|
2015-11-22 21:21:21 -08:00
|
|
|
call PlaceString
|
|
|
|
hlcoord 7, 2
|
|
|
|
ld bc, 6
|
|
|
|
pop af
|
|
|
|
call ByteFill
|
|
|
|
call WaitBGMap
|
|
|
|
call WaitTop
|
2017-12-28 04:32:33 -08:00
|
|
|
ld a, HIGH(vBGMap0)
|
2015-11-22 21:21:21 -08:00
|
|
|
ld [hBGMapAddress + 1], a
|
|
|
|
call ClearTileMap
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29348
|
|
|
|
|
2016-05-13 20:23:26 -07:00
|
|
|
TradeAnim_EnterLinkTube1: ; 29348
|
2015-11-22 21:21:21 -08:00
|
|
|
call ClearTileMap
|
|
|
|
call WaitTop
|
|
|
|
ld a, $a0
|
|
|
|
ld [hSCX], a
|
|
|
|
call DelayFrame
|
|
|
|
hlcoord 8, 2
|
2016-05-13 20:23:26 -07:00
|
|
|
ld de, TradeLinkTubeTilemap
|
2015-11-22 21:21:21 -08:00
|
|
|
lb bc, 3, 12
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_CopyBoxFromDEtoHL
|
2015-11-22 21:21:21 -08:00
|
|
|
call WaitBGMap
|
2016-05-13 19:46:32 -07:00
|
|
|
ld b, SCGB_TRADE_TUBE
|
2015-11-22 21:21:21 -08:00
|
|
|
call GetSGBLayout
|
2015-12-17 10:49:26 -08:00
|
|
|
ld a, %11100100 ; 3,2,1,0
|
2015-11-22 21:21:21 -08:00
|
|
|
call DmgToCgbBGPals
|
2015-12-17 10:49:26 -08:00
|
|
|
lb de, %11100100, %11100100 ; 3,2,1,0, 3,2,1,0
|
2015-11-22 21:21:21 -08:00
|
|
|
call DmgToCgbObjPals
|
|
|
|
ld de, SFX_POTION
|
|
|
|
call PlaySFX
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 2937e
|
|
|
|
|
2016-05-13 20:23:26 -07:00
|
|
|
TradeAnim_EnterLinkTube2: ; 2937e
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hSCX]
|
|
|
|
and a
|
|
|
|
jr z, .done
|
|
|
|
add $4
|
|
|
|
ld [hSCX], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.done
|
|
|
|
ld c, 80
|
|
|
|
call DelayFrames
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29391
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_ExitLinkTube: ; 29391
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hSCX]
|
|
|
|
cp $a0
|
2016-05-13 20:23:26 -07:00
|
|
|
jr z, .done
|
2015-11-22 21:21:21 -08:00
|
|
|
sub $4
|
|
|
|
ld [hSCX], a
|
|
|
|
ret
|
|
|
|
|
2016-05-13 20:23:26 -07:00
|
|
|
.done
|
2015-11-22 21:21:21 -08:00
|
|
|
call ClearTileMap
|
|
|
|
xor a
|
|
|
|
ld [hSCX], a
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 293a6
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_SetupGivemonScroll: ; 293a6
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, $8f
|
|
|
|
ld [hWX], a
|
|
|
|
ld a, $88
|
|
|
|
ld [hSCX], a
|
|
|
|
ld a, $50
|
|
|
|
ld [hWY], a
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 293b6
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_DoGivemonScroll: ; 293b6
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hWX]
|
|
|
|
cp $7
|
|
|
|
jr z, .done
|
|
|
|
sub $4
|
|
|
|
ld [hWX], a
|
|
|
|
ld a, [hSCX]
|
|
|
|
sub $4
|
|
|
|
ld [hSCX], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.done
|
|
|
|
ld a, $7
|
|
|
|
ld [hWX], a
|
|
|
|
xor a
|
|
|
|
ld [hSCX], a
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 293d2
|
|
|
|
|
2016-05-13 20:23:26 -07:00
|
|
|
TradeAnim_FrontpicScrollStart: ; 293d2
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, $7
|
|
|
|
ld [hWX], a
|
|
|
|
ld a, $50
|
|
|
|
ld [hWY], a
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 293de
|
|
|
|
|
2016-05-13 20:23:26 -07:00
|
|
|
TradeAnim_TextboxScrollStart: ; 293de
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, $7
|
|
|
|
ld [hWX], a
|
|
|
|
ld a, $90
|
|
|
|
ld [hWY], a
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 293ea
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_ScrollOutRight: ; 293ea
|
2015-11-22 21:21:21 -08:00
|
|
|
call WaitTop
|
2017-12-28 04:32:33 -08:00
|
|
|
ld a, HIGH(vBGMap1)
|
2015-11-22 21:21:21 -08:00
|
|
|
ld [hBGMapAddress + 1], a
|
|
|
|
call WaitBGMap
|
|
|
|
ld a, $7
|
|
|
|
ld [hWX], a
|
|
|
|
xor a
|
|
|
|
ld [hWY], a
|
|
|
|
call DelayFrame
|
|
|
|
call WaitTop
|
2017-12-28 04:32:33 -08:00
|
|
|
ld a, HIGH(vBGMap0)
|
2015-11-22 21:21:21 -08:00
|
|
|
ld [hBGMapAddress + 1], a
|
|
|
|
call ClearTileMap
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 2940c
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_ScrollOutRight2: ; 2940c
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hWX]
|
|
|
|
cp $a1
|
2015-11-22 23:08:08 -08:00
|
|
|
jr nc, .done
|
2015-11-22 21:21:21 -08:00
|
|
|
add $4
|
|
|
|
ld [hWX], a
|
|
|
|
ret
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
.done
|
2017-12-28 04:32:33 -08:00
|
|
|
ld a, HIGH(vBGMap1)
|
2015-11-22 21:21:21 -08:00
|
|
|
ld [hBGMapAddress + 1], a
|
|
|
|
call WaitBGMap
|
|
|
|
ld a, $7
|
|
|
|
ld [hWX], a
|
|
|
|
ld a, $90
|
|
|
|
ld [hWY], a
|
2017-12-28 04:32:33 -08:00
|
|
|
ld a, HIGH(vBGMap0)
|
2015-11-22 21:21:21 -08:00
|
|
|
ld [hBGMapAddress + 1], a
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 2942e
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_ShowGivemonData: ; 2942e
|
2016-05-13 19:46:32 -07:00
|
|
|
call ShowPlayerTrademonStats
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [wPlayerTrademonSpecies]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurPartySpecies], a
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [wPlayerTrademonDVs]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wTempMonDVs], a
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [wPlayerTrademonDVs + 1]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wTempMonDVs + 1], a
|
2016-05-13 19:46:32 -07:00
|
|
|
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
|
2015-11-22 21:21:21 -08:00
|
|
|
call GetSGBLayout
|
2015-12-17 10:49:26 -08:00
|
|
|
ld a, %11100100 ; 3,2,1,0
|
2015-11-22 21:21:21 -08:00
|
|
|
call DmgToCgbBGPals
|
2015-12-17 10:49:26 -08:00
|
|
|
call TradeAnim_ShowGivemonFrontpic
|
2015-11-22 21:21:21 -08:00
|
|
|
|
|
|
|
ld a, [wPlayerTrademonSpecies]
|
|
|
|
call GetCryIndex
|
|
|
|
jr c, .skip_cry
|
|
|
|
ld e, c
|
|
|
|
ld d, b
|
2018-01-16 20:47:45 -08:00
|
|
|
call PlayCry
|
2015-11-22 21:21:21 -08:00
|
|
|
.skip_cry
|
|
|
|
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29461
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_ShowGetmonData: ; 29461
|
2016-05-13 19:46:32 -07:00
|
|
|
call ShowOTTrademonStats
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [wOTTrademonSpecies]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurPartySpecies], a
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [wOTTrademonDVs]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wTempMonDVs], a
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [wOTTrademonDVs + 1]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wTempMonDVs + 1], a
|
2016-05-13 19:46:32 -07:00
|
|
|
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
|
2015-11-22 21:21:21 -08:00
|
|
|
call GetSGBLayout
|
2015-12-17 10:49:26 -08:00
|
|
|
ld a, %11100100 ; 3,2,1,0
|
2015-11-22 21:21:21 -08:00
|
|
|
call DmgToCgbBGPals
|
2015-12-17 10:49:26 -08:00
|
|
|
call TradeAnim_ShowGetmonFrontpic
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29487
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_AnimateFrontpic: ; 29487
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall AnimateTrademonFrontpic
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29491
|
|
|
|
|
2015-12-17 10:49:26 -08:00
|
|
|
TradeAnim_GetFrontpic: ; 29491
|
2015-11-22 21:21:21 -08:00
|
|
|
push de
|
|
|
|
push af
|
2018-01-16 11:30:10 -08:00
|
|
|
predef GetUnownLetter
|
2015-11-22 21:21:21 -08:00
|
|
|
pop af
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurPartySpecies], a
|
|
|
|
ld [wCurSpecies], a
|
2015-11-22 21:21:21 -08:00
|
|
|
call GetBaseData
|
|
|
|
pop de
|
2018-01-16 11:30:10 -08:00
|
|
|
predef GetMonFrontpic
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 294a9
|
|
|
|
|
2015-12-17 10:49:26 -08:00
|
|
|
TradeAnim_GetNickname: ; 294a9
|
2015-11-22 21:21:21 -08:00
|
|
|
push de
|
|
|
|
ld [wd265], a
|
|
|
|
call GetPokemonName
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wStringBuffer1
|
2015-11-22 21:21:21 -08:00
|
|
|
pop de
|
|
|
|
ld bc, NAME_LENGTH
|
|
|
|
call CopyBytes
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 294bb
|
|
|
|
|
2015-12-17 10:49:26 -08:00
|
|
|
TradeAnim_ShowGivemonFrontpic: ; 294bb
|
2017-12-28 04:32:33 -08:00
|
|
|
ld de, vTiles0
|
2015-12-17 10:49:26 -08:00
|
|
|
jr TradeAnim_ShowFrontpic
|
2015-11-22 21:21:21 -08:00
|
|
|
|
2015-12-17 10:49:26 -08:00
|
|
|
TradeAnim_ShowGetmonFrontpic: ; 294c0
|
2017-12-28 04:32:33 -08:00
|
|
|
ld de, vTiles0 tile $31
|
2015-12-17 10:49:26 -08:00
|
|
|
TradeAnim_ShowFrontpic: ; 294c3
|
2015-11-22 21:21:21 -08:00
|
|
|
call DelayFrame
|
2017-12-28 04:32:33 -08:00
|
|
|
ld hl, vTiles2
|
2015-11-22 21:21:21 -08:00
|
|
|
lb bc, 10, $31
|
|
|
|
call Request2bpp
|
|
|
|
call WaitTop
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_BlankTileMap
|
2015-11-22 21:21:21 -08:00
|
|
|
hlcoord 7, 2
|
|
|
|
xor a
|
2016-01-12 09:46:18 -08:00
|
|
|
ld [hGraphicStartTile], a
|
2015-11-22 21:21:21 -08:00
|
|
|
lb bc, 7, 7
|
2018-01-16 11:30:10 -08:00
|
|
|
predef PlaceGraphic
|
2015-11-22 21:21:21 -08:00
|
|
|
call WaitBGMap
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 294e7
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TraideAnim_Wait80: ; 294e7
|
2015-11-22 21:21:21 -08:00
|
|
|
ld c, 80
|
|
|
|
call DelayFrames
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 294f0
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TraideAnim_Wait40: ; 294f0
|
2015-11-22 21:21:21 -08:00
|
|
|
ld c, 40
|
|
|
|
call DelayFrames
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 294f9
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TraideAnim_Wait96: ; 294f9
|
2015-11-22 21:21:21 -08:00
|
|
|
ld c, 96
|
|
|
|
call DelayFrames
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29502
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TraideAnim_Wait80IfOTEgg: ; 29502
|
|
|
|
call IsOTTrademonEgg
|
2015-11-22 21:21:21 -08:00
|
|
|
ret nz
|
|
|
|
ld c, 80
|
|
|
|
call DelayFrames
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 2950c
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TraideAnim_Wait180IfOTEgg: ; 2950c
|
|
|
|
call IsOTTrademonEgg
|
2015-11-22 21:21:21 -08:00
|
|
|
ret nz
|
|
|
|
ld c, 180
|
|
|
|
call DelayFrames
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29516
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
IsOTTrademonEgg: ; 29516
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [wOTTrademonSpecies]
|
2015-11-22 23:08:08 -08:00
|
|
|
cp EGG
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 2951f
|
2016-05-13 19:46:32 -07:00
|
|
|
ShowPlayerTrademonStats: ; 2951f
|
2015-11-22 21:21:21 -08:00
|
|
|
ld de, wPlayerTrademonSpecies
|
|
|
|
ld a, [de]
|
2015-11-22 23:08:08 -08:00
|
|
|
cp EGG
|
2016-05-13 19:46:32 -07:00
|
|
|
jr z, TrademonStats_Egg
|
|
|
|
call TrademonStats_MonTemplate
|
2015-11-22 21:21:21 -08:00
|
|
|
ld de, wPlayerTrademonSpecies
|
2016-05-13 19:46:32 -07:00
|
|
|
call TrademonStats_PrintSpeciesNumber
|
2015-11-22 21:21:21 -08:00
|
|
|
ld de, wPlayerTrademonSpeciesName
|
2016-05-13 19:46:32 -07:00
|
|
|
call TrademonStats_PrintSpeciesName
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [wPlayerTrademonCaughtData]
|
|
|
|
ld de, wPlayerTrademonOTName
|
2016-05-13 19:46:32 -07:00
|
|
|
call TrademonStats_PrintOTName
|
|
|
|
ld de, wPlayerTrademonID
|
|
|
|
call TrademonStats_PrintTrademonID
|
|
|
|
call TrademonStats_WaitBGMap
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29549
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
ShowOTTrademonStats: ; 29549
|
2015-11-22 21:21:21 -08:00
|
|
|
ld de, wOTTrademonSpecies
|
|
|
|
ld a, [de]
|
2015-11-22 23:08:08 -08:00
|
|
|
cp EGG
|
2016-05-13 19:46:32 -07:00
|
|
|
jr z, TrademonStats_Egg
|
|
|
|
call TrademonStats_MonTemplate
|
2015-11-22 21:21:21 -08:00
|
|
|
ld de, wOTTrademonSpecies
|
2016-05-13 19:46:32 -07:00
|
|
|
call TrademonStats_PrintSpeciesNumber
|
2015-11-22 21:21:21 -08:00
|
|
|
ld de, wOTTrademonSpeciesName
|
2016-05-13 19:46:32 -07:00
|
|
|
call TrademonStats_PrintSpeciesName
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [wOTTrademonCaughtData]
|
|
|
|
ld de, wOTTrademonOTName
|
2016-05-13 19:46:32 -07:00
|
|
|
call TrademonStats_PrintOTName
|
2015-11-22 21:21:21 -08:00
|
|
|
ld de, wOTTrademonID
|
2016-05-13 19:46:32 -07:00
|
|
|
call TrademonStats_PrintTrademonID
|
|
|
|
call TrademonStats_WaitBGMap
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29573
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
TrademonStats_MonTemplate: ; 29573
|
2015-11-22 21:21:21 -08:00
|
|
|
call WaitTop
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_BlankTileMap
|
2017-12-28 04:32:33 -08:00
|
|
|
ld a, HIGH(vBGMap1)
|
2015-11-22 21:21:21 -08:00
|
|
|
ld [hBGMapAddress + 1], a
|
|
|
|
hlcoord 3, 0
|
|
|
|
ld b, $6
|
|
|
|
ld c, $d
|
|
|
|
call TextBox
|
|
|
|
hlcoord 4, 0
|
2016-05-13 19:46:32 -07:00
|
|
|
ld de, .OTMonData
|
2015-11-22 21:21:21 -08:00
|
|
|
call PlaceString
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29591
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.OTMonData: ; 29591
|
2015-11-22 21:21:21 -08:00
|
|
|
db "─── №."
|
|
|
|
next ""
|
|
|
|
next "OT/"
|
2015-11-22 23:08:08 -08:00
|
|
|
next "<ID>№.@"
|
2015-11-22 21:21:21 -08:00
|
|
|
; 295a1
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
TrademonStats_Egg: ; 295a1
|
2015-11-22 21:21:21 -08:00
|
|
|
call WaitTop
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_BlankTileMap
|
2017-12-28 04:32:33 -08:00
|
|
|
ld a, HIGH(vBGMap1)
|
2015-11-22 21:21:21 -08:00
|
|
|
ld [hBGMapAddress + 1], a
|
|
|
|
hlcoord 3, 0
|
2016-05-13 19:46:32 -07:00
|
|
|
ld b, 6
|
|
|
|
ld c, 13
|
2015-11-22 21:21:21 -08:00
|
|
|
call TextBox
|
|
|
|
hlcoord 4, 2
|
2016-05-13 19:46:32 -07:00
|
|
|
ld de, .EggData
|
2015-11-22 21:21:21 -08:00
|
|
|
call PlaceString
|
2016-05-13 19:46:32 -07:00
|
|
|
call TrademonStats_WaitBGMap
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 295c2
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.EggData: ; 295c2
|
2015-11-22 21:21:21 -08:00
|
|
|
db "EGG"
|
|
|
|
next "OT/?????"
|
|
|
|
next "<ID>№.?????@"
|
|
|
|
; 295d8
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
TrademonStats_WaitBGMap: ; 295d8
|
2015-11-22 21:21:21 -08:00
|
|
|
call WaitBGMap
|
|
|
|
call WaitTop
|
2017-12-28 04:32:33 -08:00
|
|
|
ld a, HIGH(vBGMap0)
|
2015-11-22 21:21:21 -08:00
|
|
|
ld [hBGMapAddress + 1], a
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 295e3
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
TrademonStats_PrintSpeciesNumber: ; 295e3
|
2015-11-22 21:21:21 -08:00
|
|
|
hlcoord 10, 0
|
|
|
|
lb bc, PRINTNUM_LEADINGZEROS | 1, 3
|
|
|
|
call PrintNum
|
|
|
|
ld [hl], " "
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 295ef
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
TrademonStats_PrintSpeciesName: ; 295ef
|
2015-11-22 21:21:21 -08:00
|
|
|
hlcoord 4, 2
|
|
|
|
call PlaceString
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 295f6
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
TrademonStats_PrintOTName: ; 295f6
|
2015-11-22 21:21:21 -08:00
|
|
|
cp 3
|
2016-05-13 19:46:32 -07:00
|
|
|
jr c, .caught_gender_okay
|
2015-11-22 21:21:21 -08:00
|
|
|
xor a
|
2016-05-13 19:46:32 -07:00
|
|
|
.caught_gender_okay
|
2015-11-22 21:21:21 -08:00
|
|
|
push af
|
|
|
|
hlcoord 7, 4
|
|
|
|
call PlaceString
|
|
|
|
inc bc
|
|
|
|
pop af
|
2016-05-13 19:46:32 -07:00
|
|
|
ld hl, .Gender
|
2015-11-22 21:21:21 -08:00
|
|
|
ld d, 0
|
|
|
|
ld e, a
|
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
|
|
|
ld [bc], a
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 2960e
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.Gender: ; 2960e
|
2015-11-22 21:21:21 -08:00
|
|
|
db " ", "♂", "♀"
|
|
|
|
; 29611
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
TrademonStats_PrintTrademonID: ; 29611
|
2015-11-22 21:21:21 -08:00
|
|
|
hlcoord 7, 6
|
|
|
|
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
|
|
|
|
call PrintNum
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 2961b
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_RockingBall: ; 2961b
|
2015-11-22 21:21:21 -08:00
|
|
|
depixel 10, 11, 4, 0
|
2017-12-08 21:50:59 -08:00
|
|
|
ld a, SPRITE_ANIM_INDEX_TRADE_POKE_BALL
|
2015-11-22 21:21:21 -08:00
|
|
|
call _InitSpriteAnimStruct
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2018-01-11 12:36:11 -08:00
|
|
|
ld a, 32
|
|
|
|
ld [wFrameCounter], a
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 2962c
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_DropBall: ; 2962c
|
2015-11-22 21:21:21 -08:00
|
|
|
depixel 10, 11, 4, 0
|
2017-12-08 21:50:59 -08:00
|
|
|
ld a, SPRITE_ANIM_INDEX_TRADE_POKE_BALL
|
2015-11-22 21:21:21 -08:00
|
|
|
call _InitSpriteAnimStruct
|
2016-05-13 22:11:01 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $1
|
2016-05-13 19:46:32 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_YOFFSET
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $dc
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2018-01-11 12:36:11 -08:00
|
|
|
ld a, 56
|
|
|
|
ld [wFrameCounter], a
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29649
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_Poof: ; 29649
|
2015-11-22 21:21:21 -08:00
|
|
|
depixel 10, 11, 4, 0
|
2017-12-08 21:50:59 -08:00
|
|
|
ld a, SPRITE_ANIM_INDEX_TRADE_POOF
|
2015-11-22 21:21:21 -08:00
|
|
|
call _InitSpriteAnimStruct
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2018-01-11 12:36:11 -08:00
|
|
|
ld a, 16
|
|
|
|
ld [wFrameCounter], a
|
2015-11-22 21:21:21 -08:00
|
|
|
ld de, SFX_BALL_POOF
|
|
|
|
call PlaySFX
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29660
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_BulgeThroughTube: ; 29660
|
2015-12-17 10:49:26 -08:00
|
|
|
ld a, %11100100 ; 3,2,1,0
|
2015-12-09 08:38:40 -08:00
|
|
|
call DmgToCgbObjPal0
|
2015-11-22 21:21:21 -08:00
|
|
|
depixel 5, 11
|
2017-12-08 21:50:59 -08:00
|
|
|
ld a, SPRITE_ANIM_INDEX_TRADE_TUBE_BULGE
|
2015-11-22 21:21:21 -08:00
|
|
|
call _InitSpriteAnimStruct
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2018-01-11 12:36:11 -08:00
|
|
|
ld a, 64
|
|
|
|
ld [wFrameCounter], a
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29676
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
TradeAnim_AnimateTrademonInTube: ; 29676 (a:5676)
|
2016-05-13 22:11:01 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, bc
|
|
|
|
ld e, [hl]
|
|
|
|
ld d, 0
|
2016-05-13 19:46:32 -07:00
|
|
|
ld hl, .Jumptable
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, de
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, de
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2017-06-09 14:01:10 -07:00
|
|
|
jp hl
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29686
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.Jumptable: ; 29686 (a:5686)
|
|
|
|
dw .InitTimer
|
|
|
|
dw .WaitTimer1
|
|
|
|
dw .MoveRight
|
|
|
|
dw .MoveDown
|
|
|
|
dw .MoveUp
|
|
|
|
dw .MoveLeft
|
|
|
|
dw .WaitTimer2
|
2015-11-22 21:21:21 -08:00
|
|
|
; 2969a
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.JumptableNext: ; 29694 (a:5694)
|
2016-05-13 22:11:01 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, bc
|
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.InitTimer: ; 2969a (a:569a)
|
|
|
|
call .JumptableNext
|
|
|
|
ld hl, SPRITEANIMSTRUCT_0C
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $80
|
|
|
|
ret
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.WaitTimer1: ; 296a4 (a:56a4)
|
|
|
|
ld hl, SPRITEANIMSTRUCT_0C
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
dec [hl]
|
|
|
|
and a
|
|
|
|
ret nz
|
2016-05-13 19:46:32 -07:00
|
|
|
call .JumptableNext
|
2015-11-22 21:21:21 -08:00
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.MoveRight: ; 296af (a:56af)
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $94
|
2016-05-13 19:46:32 -07:00
|
|
|
jr nc, .done_move_right
|
2015-11-22 21:21:21 -08:00
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.done_move_right
|
|
|
|
call .JumptableNext
|
|
|
|
|
|
|
|
.MoveDown: ; 296bd (a:56bd)
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YCOORD
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $4c
|
2016-05-13 19:46:32 -07:00
|
|
|
jr nc, .done_move_down
|
2015-11-22 21:21:21 -08:00
|
|
|
inc [hl]
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
|
|
|
.done_move_down
|
|
|
|
ld hl, SPRITEANIMSTRUCT_INDEX
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.MoveUp: ; 296cf (a:56cf)
|
|
|
|
ld hl, SPRITEANIMSTRUCT_YCOORD
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $2c
|
2016-05-13 19:46:32 -07:00
|
|
|
jr z, .done_move_up
|
2015-11-22 21:21:21 -08:00
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.done_move_up
|
|
|
|
call .JumptableNext
|
|
|
|
|
|
|
|
.MoveLeft: ; 296dd (a:56dd)
|
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $58
|
2016-05-13 19:46:32 -07:00
|
|
|
jr z, .done_move_left
|
2015-11-22 21:21:21 -08:00
|
|
|
dec [hl]
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
|
|
|
.done_move_left
|
|
|
|
call .JumptableNext
|
|
|
|
ld hl, SPRITEANIMSTRUCT_0C
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $80
|
|
|
|
ret
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.WaitTimer2: ; 296f2 (a:56f2)
|
|
|
|
ld hl, SPRITEANIMSTRUCT_0C
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
dec [hl]
|
|
|
|
and a
|
|
|
|
ret nz
|
2016-05-13 19:46:32 -07:00
|
|
|
ld hl, SPRITEANIMSTRUCT_INDEX
|
2015-11-22 21:21:21 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29701 (a:5701)
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_SentToOTText: ; 29701
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [wLinkMode]
|
|
|
|
cp LINK_TIMECAPSULE
|
|
|
|
jr z, .time_capsule
|
2016-05-13 19:46:32 -07:00
|
|
|
ld hl, .Text_MonName
|
2015-11-22 21:21:21 -08:00
|
|
|
call PrintText
|
|
|
|
ld c, 189
|
|
|
|
call DelayFrames
|
2016-05-13 19:46:32 -07:00
|
|
|
ld hl, .Text_WasSentTo
|
2015-11-22 21:21:21 -08:00
|
|
|
call PrintText
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_Wait80Frames
|
2015-11-22 21:21:21 -08:00
|
|
|
ld c, 128
|
|
|
|
call DelayFrames
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.time_capsule
|
2016-05-13 19:46:32 -07:00
|
|
|
ld hl, .Text_WasSentTo
|
2015-11-22 21:21:21 -08:00
|
|
|
call PrintText
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_Wait80Frames
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29732
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.Text_WasSentTo: ; 0x29732
|
2015-11-22 21:21:21 -08:00
|
|
|
; was sent to @ .
|
|
|
|
text_jump UnknownText_0x1bc6e9
|
|
|
|
db "@"
|
|
|
|
; 0x29737
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.Text_MonName: ; 0x29737
|
2015-11-22 21:21:21 -08:00
|
|
|
;
|
|
|
|
text_jump UnknownText_0x1bc701
|
|
|
|
db "@"
|
|
|
|
; 0x2973c
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_OTBidsFarewell: ; 2973c
|
2016-05-13 19:46:32 -07:00
|
|
|
ld hl, .Text_BidsFarewellToMon
|
2015-11-22 21:21:21 -08:00
|
|
|
call PrintText
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_Wait80Frames
|
|
|
|
ld hl, .Text_MonName
|
2015-11-22 21:21:21 -08:00
|
|
|
call PrintText
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_Wait80Frames
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29752
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.Text_BidsFarewellToMon: ; 0x29752
|
2015-11-22 21:21:21 -08:00
|
|
|
; bids farewell to
|
|
|
|
text_jump UnknownText_0x1bc703
|
|
|
|
db "@"
|
|
|
|
; 0x29757
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.Text_MonName: ; 0x29757
|
2015-11-22 21:21:21 -08:00
|
|
|
; .
|
|
|
|
text_jump UnknownText_0x1bc719
|
|
|
|
db "@"
|
|
|
|
; 0x2975c
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_TakeCareOfText: ; 2975c
|
2015-11-22 21:21:21 -08:00
|
|
|
call WaitTop
|
|
|
|
hlcoord 0, 10
|
|
|
|
ld bc, 8 * SCREEN_WIDTH
|
|
|
|
ld a, " "
|
|
|
|
call ByteFill
|
|
|
|
call WaitBGMap
|
2016-05-13 19:46:32 -07:00
|
|
|
ld hl, .Text_TakeGoodCareOfMon
|
2015-11-22 21:21:21 -08:00
|
|
|
call PrintText
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_Wait80Frames
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 2977a
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.Text_TakeGoodCareOfMon: ; 0x2977a
|
2015-11-22 21:21:21 -08:00
|
|
|
; Take good care of @ .
|
|
|
|
text_jump UnknownText_0x1bc71f
|
|
|
|
db "@"
|
|
|
|
; 0x2977f
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_OTSendsText1: ; 2977f
|
2016-05-13 19:46:32 -07:00
|
|
|
ld hl, .Text_ForYourMon
|
2015-11-22 21:21:21 -08:00
|
|
|
call PrintText
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_Wait80Frames
|
|
|
|
ld hl, .Text_OTSends
|
2015-11-22 21:21:21 -08:00
|
|
|
call PrintText
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_Wait80Frames
|
2015-11-22 21:21:21 -08:00
|
|
|
ld c, 14
|
|
|
|
call DelayFrames
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 2979a
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.Text_ForYourMon: ; 0x2979a
|
2015-11-22 21:21:21 -08:00
|
|
|
; For @ 's @ ,
|
|
|
|
text_jump UnknownText_0x1bc739
|
|
|
|
db "@"
|
|
|
|
; 0x2979f
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.Text_OTSends: ; 0x2979f
|
2015-11-22 21:21:21 -08:00
|
|
|
; sends @ .
|
|
|
|
text_jump UnknownText_0x1bc74c
|
|
|
|
db "@"
|
|
|
|
; 0x297a4
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_OTSendsText2: ; 297a4
|
2016-05-13 19:46:32 -07:00
|
|
|
ld hl, .Text_WillTrade
|
2015-11-22 21:21:21 -08:00
|
|
|
call PrintText
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_Wait80Frames
|
|
|
|
ld hl, .Text_ForYourMon
|
2015-11-22 21:21:21 -08:00
|
|
|
call PrintText
|
2016-05-13 19:46:32 -07:00
|
|
|
call TradeAnim_Wait80Frames
|
2015-11-22 21:21:21 -08:00
|
|
|
ld c, 14
|
|
|
|
call DelayFrames
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 297bf
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.Text_WillTrade: ; 0x297bf
|
2015-11-22 21:21:21 -08:00
|
|
|
; will trade @ @
|
|
|
|
text_jump UnknownText_0x1bc75e
|
|
|
|
db "@"
|
|
|
|
; 0x297c4
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.Text_ForYourMon: ; 0x297c4
|
2015-11-22 21:21:21 -08:00
|
|
|
; for @ 's @ .
|
|
|
|
text_jump UnknownText_0x1bc774
|
|
|
|
db "@"
|
|
|
|
; 0x297c9
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
TradeAnim_Wait80Frames: ; 297c9
|
2015-11-22 21:21:21 -08:00
|
|
|
ld c, 80
|
|
|
|
call DelayFrames
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 297cf
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
TradeAnim_BlankTileMap: ; 297cf
|
2015-11-22 21:21:21 -08:00
|
|
|
hlcoord 0, 0
|
|
|
|
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
|
|
|
ld a, " "
|
|
|
|
call ByteFill
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 297db
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
TradeAnim_CopyBoxFromDEtoHL: ; 297db
|
|
|
|
.row
|
2015-11-22 21:21:21 -08:00
|
|
|
push bc
|
|
|
|
push hl
|
2016-05-13 19:46:32 -07:00
|
|
|
.col
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
ld [hli], a
|
|
|
|
dec c
|
2016-05-13 19:46:32 -07:00
|
|
|
jr nz, .col
|
2015-11-22 21:21:21 -08:00
|
|
|
pop hl
|
|
|
|
ld bc, SCREEN_WIDTH
|
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
dec b
|
2016-05-13 19:46:32 -07:00
|
|
|
jr nz, .row
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 297ed
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
TradeAnim_NormalPals: ; 297ed
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hSGB]
|
|
|
|
and a
|
2015-12-17 10:49:26 -08:00
|
|
|
ld a, %11100100 ; 3,2,1,0
|
2016-01-09 13:28:22 -08:00
|
|
|
jr z, .not_sgb
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, $f0
|
|
|
|
|
2016-01-09 13:28:22 -08:00
|
|
|
.not_sgb
|
2015-12-09 08:38:40 -08:00
|
|
|
call DmgToCgbObjPal0
|
2015-12-17 10:49:26 -08:00
|
|
|
ld a, %11100100 ; 3,2,1,0
|
2015-11-22 21:21:21 -08:00
|
|
|
call DmgToCgbBGPals
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 297ff
|
|
|
|
|
2016-01-09 13:28:22 -08:00
|
|
|
LinkTradeAnim_LoadTradePlayerNames: ; 297ff
|
2015-11-22 21:21:21 -08:00
|
|
|
push de
|
2015-11-22 23:08:08 -08:00
|
|
|
ld de, wLinkPlayer1Name
|
2015-11-22 21:21:21 -08:00
|
|
|
ld bc, NAME_LENGTH
|
|
|
|
call CopyBytes
|
|
|
|
pop hl
|
2015-11-22 23:08:08 -08:00
|
|
|
ld de, wLinkPlayer2Name
|
2015-11-22 21:21:21 -08:00
|
|
|
ld bc, NAME_LENGTH
|
|
|
|
call CopyBytes
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29814
|
|
|
|
|
2016-01-09 13:28:22 -08:00
|
|
|
LinkTradeAnim_LoadTradeMonSpecies: ; 29814
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hl]
|
2016-01-09 13:28:22 -08:00
|
|
|
ld [wLinkTradeSendmonSpecies], a
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [de]
|
2016-01-09 13:28:22 -08:00
|
|
|
ld [wLinkTradeGetmonSpecies], a
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 2981d
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
TradeAnim_FlashBGPals: ; 2981d
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [wcf65]
|
|
|
|
and $7
|
|
|
|
ret nz
|
|
|
|
ld a, [rBGP]
|
2016-05-13 19:46:32 -07:00
|
|
|
xor %00111100
|
2015-11-22 21:21:21 -08:00
|
|
|
call DmgToCgbBGPals
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 2982b
|
|
|
|
|
2016-01-09 13:28:22 -08:00
|
|
|
LoadTradeBallAndCableGFX: ; 2982b
|
2015-11-22 21:21:21 -08:00
|
|
|
call DelayFrame
|
|
|
|
ld de, TradeBallGFX
|
2017-12-28 04:32:33 -08:00
|
|
|
ld hl, vTiles0 tile $62
|
2018-01-14 16:43:35 -08:00
|
|
|
lb bc, BANK(TradeBallGFX), 6
|
2015-11-22 21:21:21 -08:00
|
|
|
call Request2bpp
|
|
|
|
ld de, TradePoofGFX
|
2017-12-28 04:32:33 -08:00
|
|
|
ld hl, vTiles0 tile $68
|
2018-01-14 16:43:35 -08:00
|
|
|
lb bc, BANK(TradePoofGFX), 12
|
2015-11-22 21:21:21 -08:00
|
|
|
call Request2bpp
|
|
|
|
ld de, TradeCableGFX
|
2017-12-28 04:32:33 -08:00
|
|
|
ld hl, vTiles0 tile $74
|
2018-01-14 16:43:35 -08:00
|
|
|
lb bc, BANK(TradeCableGFX), 4
|
2015-11-22 21:21:21 -08:00
|
|
|
call Request2bpp
|
|
|
|
xor a
|
2016-01-09 13:28:22 -08:00
|
|
|
ld hl, wSpriteAnimDict
|
2015-11-22 21:21:21 -08:00
|
|
|
ld [hli], a
|
|
|
|
ld [hl], $62
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 2985a
|
|
|
|
|
2016-01-09 13:28:22 -08:00
|
|
|
LoadTradeBubbleGFX: ; 2985a
|
2015-11-22 21:21:21 -08:00
|
|
|
call DelayFrame
|
|
|
|
ld e, $3
|
2017-12-24 09:47:30 -08:00
|
|
|
callfar LoadMenuMonIcon
|
2015-11-22 21:21:21 -08:00
|
|
|
ld de, TradeBubbleGFX
|
2017-12-28 04:32:33 -08:00
|
|
|
ld hl, vTiles0 tile $72
|
2018-01-14 16:43:35 -08:00
|
|
|
lb bc, BANK(TradeBubbleGFX), 4
|
2015-11-22 21:21:21 -08:00
|
|
|
call Request2bpp
|
|
|
|
xor a
|
2016-01-09 13:28:22 -08:00
|
|
|
ld hl, wSpriteAnimDict
|
2015-11-22 21:21:21 -08:00
|
|
|
ld [hli], a
|
|
|
|
ld [hl], $62
|
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29879
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_WaitAnim: ; 29879
|
2018-01-11 12:36:11 -08:00
|
|
|
ld hl, wFrameCounter
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .done
|
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
.done
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29886
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
TradeAnim_WaitAnim2: ; 29886
|
2018-01-11 12:36:11 -08:00
|
|
|
ld hl, wFrameCounter
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-11-22 23:08:08 -08:00
|
|
|
jr z, .done
|
2015-11-22 21:21:21 -08:00
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
2015-11-22 23:08:08 -08:00
|
|
|
.done
|
2016-05-13 20:23:26 -07:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 29893
|
|
|
|
|
|
|
|
|
2018-01-02 10:38:56 -08:00
|
|
|
Unreferenced_DebugTrade: ; 29893
|
|
|
|
; This function is not referenced.
|
2015-11-22 21:21:21 -08:00
|
|
|
; It was meant for use in Japanese versions, so the
|
|
|
|
; constant used for copy length was changed by accident.
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
ld hl, .DebugTradeData
|
2015-11-22 21:21:21 -08:00
|
|
|
|
|
|
|
ld a, [hli]
|
|
|
|
ld [wPlayerTrademonSpecies], a
|
|
|
|
ld de, wPlayerTrademonSenderName
|
2018-01-18 17:40:32 -08:00
|
|
|
ld c, NAME_LENGTH + 2 ; JP: NAME_LENGTH_JAPANESE + 2
|
2015-11-22 23:08:08 -08:00
|
|
|
.loop1
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
dec c
|
2015-11-22 23:08:08 -08:00
|
|
|
jr nz, .loop1
|
2015-11-22 21:21:21 -08:00
|
|
|
|
|
|
|
ld a, [hli]
|
|
|
|
ld [wOTTrademonSpecies], a
|
|
|
|
ld de, wOTTrademonSenderName
|
2018-01-18 17:40:32 -08:00
|
|
|
ld c, NAME_LENGTH + 2 ; JP: NAME_LENGTH_JAPANESE + 2
|
2015-11-22 23:08:08 -08:00
|
|
|
.loop2
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
dec c
|
2015-11-22 23:08:08 -08:00
|
|
|
jr nz, .loop2
|
2015-11-22 21:21:21 -08:00
|
|
|
ret
|
2016-05-13 19:46:32 -07:00
|
|
|
|
2015-11-22 21:21:21 -08:00
|
|
|
; 298b5
|
|
|
|
|
2018-01-18 17:40:32 -08:00
|
|
|
debugtrade: MACRO
|
|
|
|
; species, ot name, ot id (?)
|
|
|
|
db \1, \2
|
|
|
|
dw \3
|
|
|
|
ENDM
|
|
|
|
|
2016-05-13 19:46:32 -07:00
|
|
|
.DebugTradeData: ; 298b5
|
2018-01-18 17:40:32 -08:00
|
|
|
debugtrade VENUSAUR, "ゲーフり@@", $0123 ; GAME FREAK
|
|
|
|
debugtrade CHARIZARD, "クりーチャ@", $0456 ; Creatures Inc.
|
2015-11-22 21:21:21 -08:00
|
|
|
; 298c7
|
|
|
|
|
|
|
|
|
|
|
|
TradeGameBoyTilemap: ; 298c7
|
|
|
|
; 6x8
|
|
|
|
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
|
|
|
|
; 297f7
|
|
|
|
|
2016-05-13 20:23:26 -07:00
|
|
|
TradeLinkTubeTilemap: ; 297f7
|
2015-11-22 21:21:21 -08:00
|
|
|
; 12x3
|
|
|
|
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
|
|
|
|
; 2991b
|
|
|
|
|
|
|
|
TradeArrowGFX: INCBIN "gfx/trade/arrow.2bpp"
|
|
|
|
TradeCableGFX: INCBIN "gfx/trade/cable.2bpp"
|
|
|
|
TradeBubbleGFX: INCBIN "gfx/trade/bubble.2bpp"
|
|
|
|
TradeGameBoyLZ: INCBIN "gfx/trade/game_boy.2bpp.lz"
|
|
|
|
TradeBallGFX: INCBIN "gfx/trade/ball.2bpp"
|
|
|
|
TradePoofGFX: INCBIN "gfx/trade/poof.2bpp"
|