Move all code out of home.asm into home/

This results in 64 home/*.asm files, comparable to pokecrystal's 57.
This commit is contained in:
Rangi 2020-07-07 18:50:58 -04:00
parent 51ac538c25
commit bbf2f51a02
35 changed files with 1754 additions and 1758 deletions

View file

@ -2421,3 +2421,54 @@ ForceBikeOrSurf::
ld hl, LoadPlayerSpriteGraphics
call Bankswitch
jp PlayDefaultMusic ; update map/player state?
CheckForUserInterruption::
; Return carry if Up+Select+B, Start or A are pressed in c frames.
; Used only in the intro and title screen.
call DelayFrame
push bc
call JoypadLowSensitivity
pop bc
ldh a, [hJoyHeld]
cp D_UP + SELECT + B_BUTTON
jr z, .input
ldh a, [hJoy5]
and START | A_BUTTON
jr nz, .input
dec c
jr nz, CheckForUserInterruption
and a
ret
.input
scf
ret
; function to load position data for destination warp when switching maps
; INPUT:
; a = ID of destination warp within destination map
LoadDestinationWarpPosition::
ld b, a
ldh a, [hLoadedROMBank]
push af
ld a, [wPredefParentBank]
ldh [hLoadedROMBank], a
ld [MBC1RomBank], a
ld a, b
add a
add a
ld c, a
ld b, 0
add hl, bc
ld bc, 4
ld de, wCurrentTileBlockMapViewPointer
call CopyData
pop af
ldh [hLoadedROMBank], a
ld [MBC1RomBank], a
ret