diff options
author | entrpntr <12521136+entrpntr@users.noreply.github.com> | 2020-05-27 18:42:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-27 18:42:13 -0400 |
commit | 2321448d133ac3651f08787b1cf2c2fcbdac82c9 (patch) | |
tree | 47f648c0fd273463376c981055cdc9cc5b6a93dc /engine/events/catch_tutorial.asm | |
parent | 418ac97a9c2142aae82051e6bdb149c9103b7282 (diff) | |
parent | 9dac1d992d343f542acae9974eff3099fbd9b39f (diff) |
Merge pull request #36 from entrpntr/misc-dump
Disassemble banks $70 and $3f, add tileset data
Diffstat (limited to 'engine/events/catch_tutorial.asm')
-rw-r--r-- | engine/events/catch_tutorial.asm | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/engine/events/catch_tutorial.asm b/engine/events/catch_tutorial.asm new file mode 100644 index 00000000..5c12a02f --- /dev/null +++ b/engine/events/catch_tutorial.asm @@ -0,0 +1,81 @@ +CatchTutorial:: + ld a, [wBattleType] + dec a + ld c, a + ld hl, .dw + ld b, 0 + add hl, bc + add hl, bc + ld a, [hli] + ld h, [hl] + ld l, a + jp hl + +.dw + dw .DudeTutorial + dw .DudeTutorial + dw .DudeTutorial + +.DudeTutorial: +; Back up your name to your Mom's name. + ld hl, wPlayerName + ld de, wMomsName + ld bc, NAME_LENGTH + call CopyBytes +; Copy Dude's name to your name + ld hl, .Dude + ld de, wPlayerName + ld bc, NAME_LENGTH + call CopyBytes + + call .LoadDudeData + + xor a + ldh [hJoyDown], a + ldh [hJoyPressed], a + ld a, [wOptions] + push af + and $ff ^ TEXT_DELAY_MASK + add TEXT_DELAY_MED + ld [wOptions], a + ld hl, .AutoInput + ld a, BANK(.AutoInput) + call StartAutoInput + callfar StartBattle + call StopAutoInput + pop af + + ld [wOptions], a + ld hl, wMomsName + ld de, wPlayerName + ld bc, NAME_LENGTH + call CopyBytes + ret + +.LoadDudeData: + ld hl, wDudeNumItems + ld [hl], 1 + inc hl + ld [hl], POTION + inc hl + ld [hl], 1 + inc hl + ld [hl], -1 + ld hl, wDudeNumKeyItems + ld [hl], 0 + inc hl + ld [hl], -1 + ld hl, wDudeNumBalls + ld a, 1 + ld [hli], a + ld a, POKE_BALL + ld [hli], a + ld [hli], a + ld [hl], -1 + ret + +.Dude: + db "DUDE@" + +.AutoInput: + db NO_INPUT, $ff ; end |