mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
32ed487a47
# Conflicts: # audio/engine.asm # constants/gfx_constants.asm # constants/map_data_constants.asm # constants/pokemon_data_constants.asm # constants/sprite_constants.asm # constants/wram_constants.asm # data/maps/data.asm # engine/battle/ai/scoring.asm # engine/battle/core.asm # engine/battle/effect_commands.asm # engine/battle/misc.asm # engine/battle_anims/getpokeballwobble.asm # engine/breeding.asm # engine/buy_sell_toss.asm # engine/decorations.asm # engine/events/battle_tower/battle_tower.asm # engine/events/battle_tower/rules.asm # engine/events/buena.asm # engine/events/bug_contest/contest_2.asm # engine/events/daycare.asm # engine/events/dratini.asm # engine/events/halloffame.asm # engine/events/happiness_egg.asm # engine/events/kurt.asm # engine/events/lucky_number.asm # engine/events/magnet_train.asm # engine/events/overworld.asm # engine/events/pokerus/pokerus.asm # engine/events/print_unown.asm # engine/events/print_unown_2.asm # engine/events/unown_walls.asm # engine/item_effects.asm # engine/link.asm # engine/mon_menu.asm # engine/player_object.asm # engine/routines/playslowcry.asm # engine/scripting.asm # engine/search.asm # engine/search2.asm # engine/specials.asm # engine/start_menu.asm # engine/timeset.asm # home/battle_vars.asm # home/map.asm # maps/GoldenrodUndergroundSwitchRoomEntrances.asm # maps/IlexForest.asm # maps/KrissHouse2F.asm # maps/Route39Barn.asm # mobile/mobile_12_2.asm # mobile/mobile_40.asm # mobile/mobile_5f.asm # wram.asm
233 lines
3.3 KiB
NASM
Executable File
233 lines
3.3 KiB
NASM
Executable File
Elevator:: ; 1342d
|
|
call .LoadPointer
|
|
call .FindCurrentFloor
|
|
jr c, .quit
|
|
ld [wElevatorOriginFloor], a
|
|
call Elevator_AskWhichFloor
|
|
jr c, .quit
|
|
ld hl, wElevatorOriginFloor
|
|
cp [hl]
|
|
jr z, .quit
|
|
call Elevator_GoToFloor
|
|
and a
|
|
ret
|
|
|
|
.quit
|
|
scf
|
|
ret
|
|
; 1344a
|
|
|
|
.LoadPointer: ; 1344a
|
|
ld a, b
|
|
ld [wElevatorPointerBank], a
|
|
ld a, e
|
|
ld [wElevatorPointer], a
|
|
ld a, d
|
|
ld [wElevatorPointer + 1], a
|
|
call .LoadFloors
|
|
ret
|
|
; 1345a
|
|
|
|
.LoadFloors: ; 1345a
|
|
ld de, wCurElevator
|
|
ld bc, 4
|
|
ld hl, wElevatorPointer
|
|
ld a, [hli]
|
|
ld h, [hl]
|
|
ld l, a
|
|
ld a, [wElevatorPointerBank]
|
|
call GetFarByte
|
|
inc hl
|
|
ld [de], a
|
|
inc de
|
|
.loop
|
|
ld a, [wElevatorPointerBank]
|
|
call GetFarByte
|
|
ld [de], a
|
|
inc de
|
|
add hl, bc
|
|
cp -1
|
|
jr nz, .loop
|
|
ret
|
|
; 1347d
|
|
|
|
.FindCurrentFloor: ; 1347d
|
|
ld hl, wElevatorPointer
|
|
ld a, [hli]
|
|
ld h, [hl]
|
|
ld l, a
|
|
ld a, [wElevatorPointerBank]
|
|
call GetFarByte
|
|
ld c, a
|
|
inc hl
|
|
ld a, [wBackupMapGroup]
|
|
ld d, a
|
|
ld a, [wBackupMapNumber]
|
|
ld e, a
|
|
ld b, 0
|
|
.loop2
|
|
ld a, [wElevatorPointerBank]
|
|
call GetFarByte
|
|
cp -1
|
|
jr z, .fail
|
|
inc hl
|
|
inc hl
|
|
ld a, [wElevatorPointerBank]
|
|
call GetFarByte
|
|
inc hl
|
|
cp d
|
|
jr nz, .next1
|
|
ld a, [wElevatorPointerBank]
|
|
call GetFarByte
|
|
inc hl
|
|
cp e
|
|
jr nz, .next2
|
|
jr .done
|
|
|
|
.next1
|
|
inc hl
|
|
.next2
|
|
inc b
|
|
jr .loop2
|
|
|
|
.done
|
|
xor a
|
|
ld a, b
|
|
ret
|
|
|
|
.fail
|
|
scf
|
|
ret
|
|
; 134c0
|
|
|
|
Elevator_GoToFloor: ; 134c0
|
|
push af
|
|
ld hl, wElevatorPointer
|
|
ld a, [hli]
|
|
ld h, [hl]
|
|
ld l, a
|
|
inc hl
|
|
pop af
|
|
ld bc, 4
|
|
call AddNTimes
|
|
inc hl
|
|
ld de, wBackupWarpNumber
|
|
ld a, [wElevatorPointerBank]
|
|
ld bc, 3
|
|
call FarCopyBytes
|
|
ret
|
|
; 134dd
|
|
|
|
Elevator_AskWhichFloor: ; 134dd
|
|
call LoadStandardMenuHeader
|
|
ld hl, Elevator_WhichFloorText
|
|
call PrintText
|
|
call Elevator_GetCurrentFloorText
|
|
ld hl, Elevator_MenuHeader
|
|
call CopyMenuHeader
|
|
call InitScrollingMenu
|
|
call UpdateSprites
|
|
xor a
|
|
ld [wMenuScrollPosition], a
|
|
call ScrollingMenu
|
|
call CloseWindow
|
|
ld a, [wMenuJoypad]
|
|
cp B_BUTTON
|
|
jr z, .cancel
|
|
xor a
|
|
ld a, [wScrollingMenuCursorPosition]
|
|
ret
|
|
|
|
.cancel
|
|
scf
|
|
ret
|
|
; 1350d
|
|
|
|
Elevator_WhichFloorText: ; 0x1350d
|
|
; Which floor?
|
|
text_jump UnknownText_0x1bd2bc
|
|
db "@"
|
|
; 0x13512
|
|
|
|
|
|
Elevator_GetCurrentFloorText: ; 13512
|
|
ld hl, wOptions
|
|
ld a, [hl]
|
|
push af
|
|
set NO_TEXT_SCROLL, [hl]
|
|
hlcoord 0, 0
|
|
ld b, 4
|
|
ld c, 8
|
|
call TextBox
|
|
hlcoord 1, 2
|
|
ld de, Elevator_CurrentFloorText
|
|
call PlaceString
|
|
hlcoord 4, 4
|
|
call Elevator_GetCurrentFloorString
|
|
pop af
|
|
ld [wOptions], a
|
|
ret
|
|
; 13537
|
|
|
|
Elevator_CurrentFloorText: ; 13537
|
|
db "Now on:@"
|
|
; 1353f
|
|
|
|
|
|
Elevator_GetCurrentFloorString: ; 1353f
|
|
push hl
|
|
ld a, [wElevatorOriginFloor]
|
|
ld e, a
|
|
ld d, 0
|
|
ld hl, wCurElevatorFloors
|
|
add hl, de
|
|
ld a, [hl]
|
|
pop de
|
|
call GetFloorString
|
|
ret
|
|
; 13550
|
|
|
|
Elevator_MenuHeader: ; 0x13550
|
|
db MENU_BACKUP_TILES ; flags
|
|
menu_coords 12, 1, 18, 9
|
|
dw Elevator_MenuData
|
|
db 1 ; default option
|
|
; 0x13558
|
|
|
|
Elevator_MenuData: ; 0x13558
|
|
db SCROLLINGMENU_DISPLAY_ARROWS ; flags
|
|
db 4, 0 ; rows, columns
|
|
db 1 ; horizontal spacing
|
|
dbw 0, wCurElevator
|
|
dba GetElevatorFloorStrings
|
|
dba NULL
|
|
dba NULL
|
|
; 13568
|
|
|
|
GetElevatorFloorStrings: ; 13568
|
|
ld a, [wMenuSelection]
|
|
GetFloorString: ; 1356b
|
|
push de
|
|
call FloorToString
|
|
ld d, h
|
|
ld e, l
|
|
pop hl
|
|
jp PlaceString
|
|
; 13575
|
|
|
|
FloorToString: ; 13575
|
|
push de
|
|
ld e, a
|
|
ld d, 0
|
|
ld hl, ElevatorFloorNames
|
|
add hl, de
|
|
add hl, de
|
|
ld a, [hli]
|
|
ld h, [hl]
|
|
ld l, a
|
|
pop de
|
|
ret
|
|
; 13583
|
|
|
|
INCLUDE "data/events/elevator_floors.asm"
|