2015-12-13 19:15:16 +00:00
|
|
|
|
TMHMPocket: ; 2c76f (b:476f)
|
|
|
|
|
ld a, $1
|
|
|
|
|
ld [hInMenu], a
|
|
|
|
|
call TMHM_PocketLoop
|
|
|
|
|
ld a, $0
|
|
|
|
|
ld [hInMenu], a
|
|
|
|
|
ret nc
|
2015-12-18 03:31:16 +00:00
|
|
|
|
call PlaceHollowCursor
|
2015-12-13 19:15:16 +00:00
|
|
|
|
call WaitBGMap
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wCurItem]
|
2015-12-13 19:15:16 +00:00
|
|
|
|
dec a
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld [wCurItemQuantity], a
|
|
|
|
|
ld hl, wTMsHMs
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld c, a
|
|
|
|
|
ld b, 0
|
|
|
|
|
add hl, bc
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
ld [wItemQuantityBuffer], a
|
|
|
|
|
call .ConvertItemToTMHMNumber
|
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.ConvertItemToTMHMNumber: ; 2c798 (b:4798)
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wCurItem]
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld c, a
|
2017-12-24 17:47:30 +00:00
|
|
|
|
callfar GetNumberedTMHM
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld a, c
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld [wCurItem], a
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
ConvertCurItemIntoCurTMHM: ; 2c7a7 (b:47a7)
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wCurItem]
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld c, a
|
2017-12-24 17:47:30 +00:00
|
|
|
|
callfar GetTMHMNumber
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld a, c
|
|
|
|
|
ld [wCurTMHM], a
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
GetTMHMItemMove: ; 2c7b6 (b:47b6)
|
|
|
|
|
call ConvertCurItemIntoCurTMHM
|
2018-01-16 19:30:10 +00:00
|
|
|
|
predef GetTMHMMove
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
AskTeachTMHM: ; 2c7bf (b:47bf)
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld hl, wOptions
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld a, [hl]
|
|
|
|
|
push af
|
|
|
|
|
res NO_TEXT_SCROLL, [hl]
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wCurItem]
|
2015-12-13 19:15:16 +00:00
|
|
|
|
cp TM01
|
|
|
|
|
jr c, .NotTMHM
|
|
|
|
|
call GetTMHMItemMove
|
|
|
|
|
ld a, [wCurTMHM]
|
|
|
|
|
ld [wPutativeTMHMMove], a
|
|
|
|
|
call GetMoveName
|
|
|
|
|
call CopyName1
|
|
|
|
|
ld hl, Text_BootedTM ; Booted up a TM
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wCurItem]
|
2015-12-13 19:15:16 +00:00
|
|
|
|
cp HM01
|
|
|
|
|
jr c, .TM
|
|
|
|
|
ld hl, Text_BootedHM ; Booted up an HM
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.TM:
|
2015-12-13 19:15:16 +00:00
|
|
|
|
call PrintText
|
|
|
|
|
ld hl, Text_ItContained
|
|
|
|
|
call PrintText
|
|
|
|
|
call YesNoBox
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.NotTMHM:
|
2015-12-13 19:15:16 +00:00
|
|
|
|
pop bc
|
|
|
|
|
ld a, b
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld [wOptions], a
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
ChooseMonToLearnTMHM: ; 2c7fb
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld hl, wStringBuffer2
|
2015-12-19 01:07:09 +00:00
|
|
|
|
ld de, wTMHMMoveNameBackup
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld bc, 12
|
|
|
|
|
call CopyBytes
|
|
|
|
|
call ClearBGPalettes
|
|
|
|
|
ChooseMonToLearnTMHM_NoRefresh: ; 2c80a
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall LoadPartyMenuGFX
|
|
|
|
|
farcall InitPartyMenuWithCancel
|
|
|
|
|
farcall InitPartyMenuGFX
|
2017-11-30 19:27:25 +00:00
|
|
|
|
ld a, PARTYMENUACTION_TEACH_TMHM
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld [wPartyMenuActionText], a
|
2015-12-13 19:15:16 +00:00
|
|
|
|
.loopback
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall WritePartyMenuTilemap
|
|
|
|
|
farcall PrintPartyMenuText
|
2015-12-13 19:15:16 +00:00
|
|
|
|
call WaitBGMap
|
|
|
|
|
call SetPalettes
|
|
|
|
|
call DelayFrame
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall PartyMenuSelect
|
2015-12-13 19:15:16 +00:00
|
|
|
|
push af
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wCurPartySpecies]
|
2015-12-13 19:15:16 +00:00
|
|
|
|
cp EGG
|
|
|
|
|
pop bc ; now contains the former contents of af
|
|
|
|
|
jr z, .egg
|
|
|
|
|
push bc
|
2015-12-19 01:07:09 +00:00
|
|
|
|
ld hl, wTMHMMoveNameBackup
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld de, wStringBuffer2
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld bc, 12
|
|
|
|
|
call CopyBytes
|
|
|
|
|
pop af ; now contains the original contents of af
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.egg
|
|
|
|
|
push hl
|
|
|
|
|
push de
|
|
|
|
|
push bc
|
|
|
|
|
push af
|
|
|
|
|
ld de, SFX_WRONG
|
|
|
|
|
call PlaySFX
|
|
|
|
|
call WaitSFX
|
|
|
|
|
pop af
|
|
|
|
|
pop bc
|
|
|
|
|
pop de
|
|
|
|
|
pop hl
|
|
|
|
|
jr .loopback
|
|
|
|
|
; 2c867
|
|
|
|
|
|
|
|
|
|
TeachTMHM: ; 2c867
|
2018-01-16 19:30:10 +00:00
|
|
|
|
predef CanLearnTMHMMove
|
2015-12-13 19:15:16 +00:00
|
|
|
|
|
|
|
|
|
push bc
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wCurPartyMon]
|
|
|
|
|
ld hl, wPartyMonNicknames
|
2015-12-13 19:15:16 +00:00
|
|
|
|
call GetNick
|
|
|
|
|
pop bc
|
|
|
|
|
|
|
|
|
|
ld a, c
|
|
|
|
|
and a
|
|
|
|
|
jr nz, .compatible
|
|
|
|
|
push de
|
|
|
|
|
ld de, SFX_WRONG
|
|
|
|
|
call PlaySFX
|
|
|
|
|
pop de
|
|
|
|
|
ld hl, Text_TMHMNotCompatible
|
|
|
|
|
call PrintText
|
|
|
|
|
jr .nope
|
|
|
|
|
|
|
|
|
|
.compatible
|
2017-12-24 17:47:30 +00:00
|
|
|
|
callfar KnowsMove
|
2015-12-13 19:15:16 +00:00
|
|
|
|
jr c, .nope
|
|
|
|
|
|
2018-01-16 19:30:10 +00:00
|
|
|
|
predef LearnMove
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld a, b
|
|
|
|
|
and a
|
|
|
|
|
jr z, .nope
|
|
|
|
|
|
2018-01-02 19:00:14 +00:00
|
|
|
|
farcall StubbedTrainerRankings_TMsHMsTaught
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wCurItem]
|
2015-12-13 19:15:16 +00:00
|
|
|
|
call IsHM
|
|
|
|
|
ret c
|
|
|
|
|
|
|
|
|
|
ld c, HAPPINESS_LEARNMOVE
|
2017-12-24 17:47:30 +00:00
|
|
|
|
callfar ChangeHappiness
|
2015-12-13 19:15:16 +00:00
|
|
|
|
call ConsumeTM
|
|
|
|
|
jr .learned_move
|
|
|
|
|
|
|
|
|
|
.nope
|
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.unused
|
|
|
|
|
ld a, 2
|
|
|
|
|
ld [wItemEffectSucceeded], a
|
|
|
|
|
.learned_move
|
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
; 2c8bf (b:48bf)
|
|
|
|
|
|
|
|
|
|
Text_BootedTM: ; 0x2c8bf
|
|
|
|
|
; Booted up a TM.
|
|
|
|
|
text_jump UnknownText_0x1c0373
|
|
|
|
|
db "@"
|
|
|
|
|
; 0x2c8c4
|
|
|
|
|
|
|
|
|
|
Text_BootedHM: ; 0x2c8c4
|
|
|
|
|
; Booted up an HM.
|
|
|
|
|
text_jump UnknownText_0x1c0384
|
|
|
|
|
db "@"
|
|
|
|
|
; 0x2c8c9
|
|
|
|
|
|
|
|
|
|
Text_ItContained: ; 0x2c8c9
|
|
|
|
|
; It contained @ . Teach @ to a #MON?
|
|
|
|
|
text_jump UnknownText_0x1c0396
|
|
|
|
|
db "@"
|
|
|
|
|
; 0x2c8ce
|
|
|
|
|
|
|
|
|
|
Text_TMHMNotCompatible: ; 0x2c8ce
|
|
|
|
|
; is not compatible with @ . It can't learn @ .
|
|
|
|
|
text_jump UnknownText_0x1c03c2
|
|
|
|
|
db "@"
|
|
|
|
|
; 0x2c8d3
|
|
|
|
|
|
|
|
|
|
TMHM_PocketLoop: ; 2c8d3 (b:48d3)
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
call TMHM_DisplayPocketItems
|
2016-01-18 05:39:01 +00:00
|
|
|
|
ld a, 2
|
2015-12-19 19:48:30 +00:00
|
|
|
|
ld [w2DMenuCursorInitY], a
|
2016-01-18 05:39:01 +00:00
|
|
|
|
ld a, 7
|
2015-12-19 19:48:30 +00:00
|
|
|
|
ld [w2DMenuCursorInitX], a
|
2016-01-18 05:39:01 +00:00
|
|
|
|
ld a, 1
|
2015-12-19 19:48:30 +00:00
|
|
|
|
ld [w2DMenuNumCols], a
|
2016-01-18 05:39:01 +00:00
|
|
|
|
ld a, 5
|
2015-12-13 19:15:16 +00:00
|
|
|
|
sub d
|
|
|
|
|
inc a
|
2016-01-18 05:39:01 +00:00
|
|
|
|
cp 6
|
2015-12-13 19:15:16 +00:00
|
|
|
|
jr nz, .okay
|
|
|
|
|
dec a
|
|
|
|
|
.okay
|
2015-12-19 19:48:30 +00:00
|
|
|
|
ld [w2DMenuNumRows], a
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld a, $c
|
2015-12-19 19:48:30 +00:00
|
|
|
|
ld [w2DMenuFlags1], a
|
2015-12-13 19:15:16 +00:00
|
|
|
|
xor a
|
2015-12-19 19:48:30 +00:00
|
|
|
|
ld [w2DMenuFlags2], a
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld a, $20
|
2015-12-21 19:10:16 +00:00
|
|
|
|
ld [w2DMenuCursorOffsets], a
|
2015-12-20 17:54:08 +00:00
|
|
|
|
ld a, A_BUTTON | B_BUTTON | D_UP | D_DOWN | D_LEFT | D_RIGHT
|
|
|
|
|
ld [wMenuJoypadFilter], a
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld a, [wTMHMPocketCursor]
|
|
|
|
|
inc a
|
2015-12-15 23:59:49 +00:00
|
|
|
|
ld [wMenuCursorY], a
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld a, $1
|
2015-12-15 23:59:49 +00:00
|
|
|
|
ld [wMenuCursorX], a
|
2015-12-13 19:15:16 +00:00
|
|
|
|
jr TMHM_ShowTMMoveDescription
|
|
|
|
|
|
|
|
|
|
TMHM_JoypadLoop: ; 2c915 (b:4915)
|
|
|
|
|
call TMHM_DisplayPocketItems
|
2015-12-15 23:59:49 +00:00
|
|
|
|
call StaticMenuJoypad
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld b, a
|
2015-12-15 23:59:49 +00:00
|
|
|
|
ld a, [wMenuCursorY]
|
2015-12-13 19:15:16 +00:00
|
|
|
|
dec a
|
|
|
|
|
ld [wTMHMPocketCursor], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
2015-12-19 19:48:30 +00:00
|
|
|
|
ld a, [w2DMenuFlags2]
|
2015-12-13 19:15:16 +00:00
|
|
|
|
bit 7, a
|
|
|
|
|
jp nz, TMHM_ScrollPocket
|
|
|
|
|
ld a, b
|
|
|
|
|
ld [wMenuJoypad], a
|
|
|
|
|
bit A_BUTTON_F, a
|
|
|
|
|
jp nz, TMHM_ChooseTMorHM
|
|
|
|
|
bit B_BUTTON_F, a
|
|
|
|
|
jp nz, TMHM_ExitPack
|
|
|
|
|
bit D_RIGHT_F, a
|
|
|
|
|
jp nz, TMHM_ExitPocket
|
|
|
|
|
bit D_LEFT_F, a
|
|
|
|
|
jp nz, TMHM_ExitPocket
|
|
|
|
|
TMHM_ShowTMMoveDescription: ; 2c946 (b:4946)
|
|
|
|
|
call TMHM_CheckHoveringOverCancel
|
|
|
|
|
jp nc, TMHM_ExitPocket
|
|
|
|
|
hlcoord 0, 12
|
|
|
|
|
ld b, 4
|
|
|
|
|
ld c, SCREEN_WIDTH - 2
|
|
|
|
|
call TextBox
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wCurItem]
|
2015-12-13 19:15:16 +00:00
|
|
|
|
cp NUM_TMS + NUM_HMS + 1
|
|
|
|
|
jr nc, TMHM_JoypadLoop
|
|
|
|
|
ld [wd265], a
|
2018-01-16 19:30:10 +00:00
|
|
|
|
predef GetTMHMMove
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld a, [wd265]
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld [wCurSpecies], a
|
2015-12-13 19:15:16 +00:00
|
|
|
|
hlcoord 1, 14
|
2018-01-16 19:30:10 +00:00
|
|
|
|
call PrintMoveDesc
|
2015-12-13 19:15:16 +00:00
|
|
|
|
jp TMHM_JoypadLoop
|
|
|
|
|
|
|
|
|
|
TMHM_ChooseTMorHM: ; 2c974 (b:4974)
|
|
|
|
|
call TMHM_PlaySFX_ReadText2
|
|
|
|
|
call CountTMsHMs ; This stores the count to wd265.
|
2015-12-15 23:59:49 +00:00
|
|
|
|
ld a, [wMenuCursorY]
|
2015-12-13 19:15:16 +00:00
|
|
|
|
dec a
|
|
|
|
|
ld b, a
|
|
|
|
|
ld a, [wTMHMPocketScrollPosition]
|
|
|
|
|
add b
|
|
|
|
|
ld b, a
|
|
|
|
|
ld a, [wd265]
|
|
|
|
|
cp b
|
|
|
|
|
jr z, _TMHM_ExitPack ; our cursor was hovering over CANCEL
|
|
|
|
|
TMHM_CheckHoveringOverCancel: ; 2c98a (b:498a)
|
|
|
|
|
call TMHM_GetCurrentPocketPosition
|
2015-12-15 23:59:49 +00:00
|
|
|
|
ld a, [wMenuCursorY]
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld b, a
|
|
|
|
|
.loop
|
|
|
|
|
inc c
|
|
|
|
|
ld a, c
|
|
|
|
|
cp NUM_TMS + NUM_HMS + 1
|
|
|
|
|
jr nc, .okay
|
|
|
|
|
ld a, [hli]
|
|
|
|
|
and a
|
|
|
|
|
jr z, .loop
|
|
|
|
|
dec b
|
|
|
|
|
jr nz, .loop
|
|
|
|
|
ld a, c
|
|
|
|
|
.okay
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld [wCurItem], a
|
2015-12-13 19:15:16 +00:00
|
|
|
|
cp -1
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
TMHM_ExitPack: ; 2c9a5 (b:49a5)
|
|
|
|
|
call TMHM_PlaySFX_ReadText2
|
|
|
|
|
_TMHM_ExitPack: ; 2c9a8 (b:49a8)
|
|
|
|
|
ld a, $2
|
|
|
|
|
ld [wMenuJoypad], a
|
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
TMHM_ExitPocket: ; 2c9af (b:49af)
|
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
TMHM_ScrollPocket: ; 2c9b1 (b:49b1)
|
|
|
|
|
ld a, b
|
|
|
|
|
bit 7, a
|
|
|
|
|
jr nz, .skip
|
|
|
|
|
ld hl, wTMHMPocketScrollPosition
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and a
|
|
|
|
|
jp z, TMHM_JoypadLoop
|
|
|
|
|
dec [hl]
|
|
|
|
|
call TMHM_DisplayPocketItems
|
|
|
|
|
jp TMHM_ShowTMMoveDescription
|
|
|
|
|
|
|
|
|
|
.skip
|
|
|
|
|
call TMHM_GetCurrentPocketPosition
|
|
|
|
|
ld b, 5
|
|
|
|
|
.loop
|
|
|
|
|
inc c
|
|
|
|
|
ld a, c
|
|
|
|
|
cp NUM_TMS + NUM_HMS + 1
|
|
|
|
|
jp nc, TMHM_JoypadLoop
|
|
|
|
|
ld a, [hli]
|
|
|
|
|
and a
|
|
|
|
|
jr z, .loop
|
|
|
|
|
dec b
|
|
|
|
|
jr nz, .loop
|
|
|
|
|
ld hl, wTMHMPocketScrollPosition
|
|
|
|
|
inc [hl]
|
|
|
|
|
call TMHM_DisplayPocketItems
|
|
|
|
|
jp TMHM_ShowTMMoveDescription
|
|
|
|
|
|
|
|
|
|
TMHM_DisplayPocketItems: ; 2c9e2 (b:49e2)
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wBattleType]
|
2015-12-13 19:15:16 +00:00
|
|
|
|
cp BATTLETYPE_TUTORIAL
|
|
|
|
|
jp z, Tutorial_TMHMPocket
|
|
|
|
|
|
|
|
|
|
hlcoord 5, 2
|
|
|
|
|
lb bc, 10, 15
|
|
|
|
|
ld a, " "
|
|
|
|
|
call ClearBox
|
|
|
|
|
call TMHM_GetCurrentPocketPosition
|
|
|
|
|
ld d, $5
|
|
|
|
|
.loop2
|
|
|
|
|
inc c
|
|
|
|
|
ld a, c
|
|
|
|
|
cp NUM_TMS + NUM_HMS + 1
|
|
|
|
|
jr nc, .NotTMHM
|
|
|
|
|
ld a, [hli]
|
|
|
|
|
and a
|
|
|
|
|
jr z, .loop2
|
|
|
|
|
ld b, a
|
|
|
|
|
ld a, c
|
|
|
|
|
ld [wd265], a
|
|
|
|
|
push hl
|
|
|
|
|
push de
|
|
|
|
|
push bc
|
|
|
|
|
call TMHMPocket_GetCurrentLineCoord
|
|
|
|
|
push hl
|
|
|
|
|
ld a, [wd265]
|
|
|
|
|
cp NUM_TMS + 1
|
|
|
|
|
jr nc, .HM
|
|
|
|
|
ld de, wd265
|
|
|
|
|
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
|
|
|
|
|
call PrintNum
|
|
|
|
|
jr .okay
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.HM:
|
2015-12-13 19:15:16 +00:00
|
|
|
|
push af
|
|
|
|
|
sub NUM_TMS
|
|
|
|
|
ld [wd265], a
|
|
|
|
|
ld [hl], "H"
|
|
|
|
|
inc hl
|
|
|
|
|
ld de, wd265
|
|
|
|
|
lb bc, PRINTNUM_RIGHTALIGN | 1, 2
|
|
|
|
|
call PrintNum
|
|
|
|
|
pop af
|
|
|
|
|
ld [wd265], a
|
|
|
|
|
.okay
|
2018-01-16 19:30:10 +00:00
|
|
|
|
predef GetTMHMMove
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld a, [wd265]
|
|
|
|
|
ld [wPutativeTMHMMove], a
|
|
|
|
|
call GetMoveName
|
|
|
|
|
pop hl
|
|
|
|
|
ld bc, 3
|
|
|
|
|
add hl, bc
|
|
|
|
|
push hl
|
|
|
|
|
call PlaceString
|
|
|
|
|
pop hl
|
|
|
|
|
pop bc
|
|
|
|
|
ld a, c
|
|
|
|
|
push bc
|
|
|
|
|
cp NUM_TMS + 1
|
|
|
|
|
jr nc, .hm2
|
|
|
|
|
ld bc, SCREEN_WIDTH + 9
|
|
|
|
|
add hl, bc
|
|
|
|
|
ld [hl], "×"
|
|
|
|
|
inc hl
|
|
|
|
|
ld a, "0" ; why are we doing this?
|
|
|
|
|
pop bc
|
|
|
|
|
push bc
|
|
|
|
|
ld a, b
|
|
|
|
|
ld [wd265], a
|
|
|
|
|
ld de, wd265
|
|
|
|
|
lb bc, 1, 2
|
|
|
|
|
call PrintNum
|
|
|
|
|
.hm2
|
|
|
|
|
pop bc
|
|
|
|
|
pop de
|
|
|
|
|
pop hl
|
|
|
|
|
dec d
|
|
|
|
|
jr nz, .loop2
|
|
|
|
|
jr .done
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.NotTMHM:
|
2015-12-13 19:15:16 +00:00
|
|
|
|
call TMHMPocket_GetCurrentLineCoord
|
|
|
|
|
inc hl
|
2016-05-10 16:31:49 +00:00
|
|
|
|
inc hl
|
|
|
|
|
inc hl
|
2015-12-13 19:15:16 +00:00
|
|
|
|
push de
|
|
|
|
|
ld de, TMHM_String_Cancel
|
|
|
|
|
call PlaceString
|
|
|
|
|
pop de
|
|
|
|
|
.done
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
TMHMPocket_GetCurrentLineCoord: ; 2ca86 (b:4a86)
|
|
|
|
|
hlcoord 5, 0
|
|
|
|
|
ld bc, 2 * SCREEN_WIDTH
|
|
|
|
|
ld a, 6
|
|
|
|
|
sub d
|
|
|
|
|
ld e, a
|
|
|
|
|
; AddNTimes
|
|
|
|
|
.loop
|
|
|
|
|
add hl, bc
|
|
|
|
|
dec e
|
|
|
|
|
jr nz, .loop
|
|
|
|
|
ret
|
|
|
|
|
; 2ca95 (b:4a95)
|
|
|
|
|
|
2018-01-02 15:04:21 +00:00
|
|
|
|
Unreferenced_Function2ca95: ; 2ca95
|
2015-12-13 19:15:16 +00:00
|
|
|
|
pop hl
|
|
|
|
|
ld bc, 3
|
|
|
|
|
add hl, bc
|
2018-01-16 19:30:10 +00:00
|
|
|
|
predef GetTMHMMove
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld a, [wd265]
|
|
|
|
|
ld [wPutativeTMHMMove], a
|
|
|
|
|
call GetMoveName
|
|
|
|
|
push hl
|
|
|
|
|
call PlaceString
|
|
|
|
|
pop hl
|
|
|
|
|
ret
|
|
|
|
|
; 2caae
|
|
|
|
|
|
|
|
|
|
TMHM_String_Cancel: ; 2caae
|
|
|
|
|
db "CANCEL@"
|
|
|
|
|
; 2cab5
|
|
|
|
|
|
|
|
|
|
TMHM_GetCurrentPocketPosition: ; 2cab5 (b:4ab5)
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld hl, wTMsHMs
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld a, [wTMHMPocketScrollPosition]
|
|
|
|
|
ld b, a
|
|
|
|
|
inc b
|
|
|
|
|
ld c, 0
|
|
|
|
|
.loop
|
|
|
|
|
inc c
|
|
|
|
|
ld a, [hli]
|
|
|
|
|
and a
|
|
|
|
|
jr z, .loop
|
|
|
|
|
dec b
|
|
|
|
|
jr nz, .loop
|
|
|
|
|
dec hl
|
|
|
|
|
dec c
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Tutorial_TMHMPocket: ; 2caca (b:4aca)
|
|
|
|
|
hlcoord 9, 3
|
|
|
|
|
push de
|
|
|
|
|
ld de, TMHM_String_Cancel
|
|
|
|
|
call PlaceString
|
|
|
|
|
pop de
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
TMHM_PlaySFX_ReadText2: ; 2cad6 (b:4ad6)
|
|
|
|
|
push de
|
|
|
|
|
ld de, SFX_READ_TEXT_2
|
|
|
|
|
call PlaySFX
|
|
|
|
|
pop de
|
|
|
|
|
ret
|
|
|
|
|
; 2cadf (b:4adf)
|
|
|
|
|
|
2018-01-02 15:04:21 +00:00
|
|
|
|
Unreferenced_Function2cadf: ; 2cadf
|
2015-12-13 19:15:16 +00:00
|
|
|
|
call ConvertCurItemIntoCurTMHM
|
|
|
|
|
call .CheckHaveRoomForTMHM
|
|
|
|
|
ld hl, .NoRoomText
|
|
|
|
|
jr nc, .print
|
|
|
|
|
ld hl, .ReceivedText
|
|
|
|
|
.print
|
|
|
|
|
jp PrintText
|
|
|
|
|
; 2caf0
|
|
|
|
|
|
|
|
|
|
.NoRoomText: ; 0x2caf0
|
|
|
|
|
; You have no room for any more @ S.
|
|
|
|
|
text_jump UnknownText_0x1c03fa
|
|
|
|
|
db "@"
|
|
|
|
|
; 0x2caf5
|
|
|
|
|
|
|
|
|
|
.ReceivedText: ; 0x2caf5
|
|
|
|
|
; You received @ !
|
|
|
|
|
text_jump UnknownText_0x1c0421
|
|
|
|
|
db "@"
|
|
|
|
|
; 0x2cafa
|
|
|
|
|
|
|
|
|
|
.CheckHaveRoomForTMHM: ; 2cafa
|
|
|
|
|
ld a, [wd265]
|
|
|
|
|
dec a
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld hl, wTMsHMs
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld b, 0
|
|
|
|
|
ld c, a
|
|
|
|
|
add hl, bc
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
inc a
|
|
|
|
|
cp NUM_TMS * 2
|
|
|
|
|
ret nc
|
|
|
|
|
ld [hl], a
|
|
|
|
|
ret
|
|
|
|
|
; 2cb0c
|
|
|
|
|
|
|
|
|
|
ConsumeTM: ; 2cb0c (b:4b0c)
|
|
|
|
|
call ConvertCurItemIntoCurTMHM
|
|
|
|
|
ld a, [wd265]
|
|
|
|
|
dec a
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld hl, wTMsHMs
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld b, 0
|
|
|
|
|
ld c, a
|
|
|
|
|
add hl, bc
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and a
|
|
|
|
|
ret z
|
|
|
|
|
dec a
|
|
|
|
|
ld [hl], a
|
|
|
|
|
ret nz
|
|
|
|
|
ld a, [wTMHMPocketScrollPosition]
|
|
|
|
|
and a
|
|
|
|
|
ret z
|
|
|
|
|
dec a
|
|
|
|
|
ld [wTMHMPocketScrollPosition], a
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
CountTMsHMs: ; 2cb2a (b:4b2a)
|
|
|
|
|
ld b, 0
|
|
|
|
|
ld c, NUM_TMS + NUM_HMS
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld hl, wTMsHMs
|
2015-12-13 19:15:16 +00:00
|
|
|
|
.loop
|
|
|
|
|
ld a, [hli]
|
|
|
|
|
and a
|
|
|
|
|
jr z, .skip
|
|
|
|
|
inc b
|
|
|
|
|
.skip
|
|
|
|
|
dec c
|
|
|
|
|
jr nz, .loop
|
|
|
|
|
ld a, b
|
|
|
|
|
ld [wd265], a
|
|
|
|
|
ret
|
|
|
|
|
|
2018-01-16 19:30:10 +00:00
|
|
|
|
PrintMoveDesc: ; 2cb3e
|
2015-12-13 19:15:16 +00:00
|
|
|
|
push hl
|
|
|
|
|
ld hl, MoveDescriptions
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wCurSpecies]
|
2015-12-13 19:15:16 +00:00
|
|
|
|
dec a
|
|
|
|
|
ld c, a
|
|
|
|
|
ld b, 0
|
|
|
|
|
add hl, bc
|
2016-05-04 15:46:23 +00:00
|
|
|
|
add hl, bc
|
2015-12-13 19:15:16 +00:00
|
|
|
|
ld a, [hli]
|
|
|
|
|
ld e, a
|
|
|
|
|
ld d, [hl]
|
|
|
|
|
pop hl
|
|
|
|
|
jp PlaceString
|
|
|
|
|
; 2cb52
|