summaryrefslogtreecommitdiff
path: root/engine/menu/start_menu.asm
diff options
context:
space:
mode:
authorxCrystal <rgr.crystal@gmail.com>2017-12-30 01:54:27 +0100
committerxCrystal <rgr.crystal@gmail.com>2017-12-30 01:54:27 +0100
commit237aeb8fbdb204948d611830565d4a00c6b0ab70 (patch)
tree94dea41b4af4a3374a1a1e2f56665cff2ea5baa9 /engine/menu/start_menu.asm
parent94b9a86c8b9b6ea29653e98921205056790d6617 (diff)
Add space between arguments in assembly instructions and remove redundant a in instructions like add a, x
Diffstat (limited to 'engine/menu/start_menu.asm')
-rwxr-xr-xengine/menu/start_menu.asm88
1 files changed, 44 insertions, 44 deletions
diff --git a/engine/menu/start_menu.asm b/engine/menu/start_menu.asm
index 029d8c01..eb4b4f2d 100755
--- a/engine/menu/start_menu.asm
+++ b/engine/menu/start_menu.asm
@@ -1,9 +1,9 @@
DisplayStartMenu::
- ld a,BANK(StartMenu_Pokedex)
- ld [H_LOADEDROMBANK],a
- ld [MBC1RomBank],a
- ld a,[wWalkBikeSurfState] ; walking/biking/surfing
- ld [wWalkBikeSurfStateCopy],a
+ ld a, BANK(StartMenu_Pokedex)
+ ld [H_LOADEDROMBANK], a
+ ld [MBC1RomBank], a
+ ld a, [wWalkBikeSurfState] ; walking/biking/surfing
+ ld [wWalkBikeSurfStateCopy], a
ld a, SFX_START_MENU
call PlaySound
@@ -13,73 +13,73 @@ RedisplayStartMenu::
call UpdateSprites
.loop
call HandleMenuInput
- ld b,a
+ ld b, a
.checkIfUpPressed
- bit 6,a ; was Up pressed?
- jr z,.checkIfDownPressed
- ld a,[wCurrentMenuItem] ; menu selection
+ bit 6, a ; was Up pressed?
+ jr z, .checkIfDownPressed
+ ld a, [wCurrentMenuItem] ; menu selection
and a
- jr nz,.loop
- ld a,[wLastMenuItem]
+ jr nz, .loop
+ ld a, [wLastMenuItem]
and a
- jr nz,.loop
+ jr nz, .loop
; if the player pressed tried to go past the top item, wrap around to the bottom
CheckEvent EVENT_GOT_POKEDEX
- ld a,6 ; there are 7 menu items with the pokedex, so the max index is 6
- jr nz,.wrapMenuItemId
+ ld a, 6 ; there are 7 menu items with the pokedex, so the max index is 6
+ jr nz, .wrapMenuItemId
dec a ; there are only 6 menu items without the pokedex
.wrapMenuItemId
- ld [wCurrentMenuItem],a
+ ld [wCurrentMenuItem], a
call EraseMenuCursor
jr .loop
.checkIfDownPressed
- bit 7,a
- jr z,.buttonPressed
+ bit 7, a
+ jr z, .buttonPressed
; if the player pressed tried to go past the bottom item, wrap around to the top
CheckEvent EVENT_GOT_POKEDEX
- ld a,[wCurrentMenuItem]
- ld c,7 ; there are 7 menu items with the pokedex
- jr nz,.checkIfPastBottom
+ ld a, [wCurrentMenuItem]
+ ld c, 7 ; there are 7 menu items with the pokedex
+ jr nz, .checkIfPastBottom
dec c ; there are only 6 menu items without the pokedex
.checkIfPastBottom
cp c
- jr nz,.loop
+ jr nz, .loop
; the player went past the bottom, so wrap to the top
xor a
- ld [wCurrentMenuItem],a
+ ld [wCurrentMenuItem], a
call EraseMenuCursor
jr .loop
.buttonPressed ; A, B, or Start button pressed
call PlaceUnfilledArrowMenuCursor
- ld a,[wCurrentMenuItem]
- ld [wBattleAndStartSavedMenuItem],a ; save current menu selection
- ld a,b
- and a,%00001010 ; was the Start button or B button pressed?
- jp nz,CloseStartMenu
+ ld a, [wCurrentMenuItem]
+ ld [wBattleAndStartSavedMenuItem], a ; save current menu selection
+ ld a, b
+ and %00001010 ; was the Start button or B button pressed?
+ jp nz, CloseStartMenu
call SaveScreenTilesToBuffer2 ; copy background from wTileMap to wTileMapBackup2
CheckEvent EVENT_GOT_POKEDEX
- ld a,[wCurrentMenuItem]
- jr nz,.displayMenuItem
+ ld a, [wCurrentMenuItem]
+ jr nz, .displayMenuItem
inc a ; adjust position to account for missing pokedex menu item
.displayMenuItem
- cp a,0
- jp z,StartMenu_Pokedex
- cp a,1
- jp z,StartMenu_Pokemon
- cp a,2
- jp z,StartMenu_Item
- cp a,3
- jp z,StartMenu_TrainerInfo
- cp a,4
- jp z,StartMenu_SaveReset
- cp a,5
- jp z,StartMenu_Option
+ cp 0
+ jp z, StartMenu_Pokedex
+ cp 1
+ jp z, StartMenu_Pokemon
+ cp 2
+ jp z, StartMenu_Item
+ cp 3
+ jp z, StartMenu_TrainerInfo
+ cp 4
+ jp z, StartMenu_SaveReset
+ cp 5
+ jp z, StartMenu_Option
; EXIT falls through to here
CloseStartMenu::
call Joypad
- ld a,[hJoyPressed]
- bit 0,a ; was A button newly pressed?
- jr nz,CloseStartMenu
+ ld a, [hJoyPressed]
+ bit 0, a ; was A button newly pressed?
+ jr nz, CloseStartMenu
call LoadTextBoxTilePatterns
jp CloseTextDisplay