From 987ed1fafb2ed4920276089f8c93f1be3f31acac Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 19 Dec 2015 14:48:30 -0500 Subject: [PATCH] More work on slots; WRAM cleanup, Move Deleter --- battle/core.asm | 32 +++--- battle/effect_commands.asm | 2 +- engine/battle_start.asm | 4 +- engine/crystal_intro.asm | 20 ++-- engine/debug.asm | 2 +- engine/evolution_animation.asm | 10 +- engine/intro_menu.asm | 4 +- engine/learn.asm | 16 +-- engine/link.asm | 80 ++++++------- engine/main_menu.asm | 126 ++++++++++----------- engine/mon_menu.asm | 4 +- engine/party_menu.asm | 8 +- engine/slot_machine.asm | 199 ++++++++++++++++----------------- engine/startmenu.asm | 12 +- engine/stats_screen.asm | 12 +- engine/tmhm2.asm | 20 ++-- engine/warp_connection.asm | 4 +- event/halloffame.asm | 6 +- event/move_deleter.asm | 70 ++++++------ event/photo.asm | 22 ++-- gfx/pics/animation.asm | 12 +- home.asm | 10 +- home/map.asm | 4 +- home/menu.asm | 4 +- home/window.asm | 6 +- main.asm | 106 +++++++++--------- misc/gfx_41.asm | 42 +++---- misc/mobile_12.asm | 11 +- misc/mobile_12_2.asm | 8 +- misc/mobile_22.asm | 14 +-- misc/mobile_40.asm | 34 +++--- misc/mobile_41.asm | 2 +- misc/mobile_45.asm | 2 +- misc/mobile_5b.asm | 18 +-- misc/mobile_5c.asm | 2 +- misc/printer_77.asm | 2 +- wram.asm | 39 +++---- 37 files changed, 477 insertions(+), 492 deletions(-) diff --git a/battle/core.asm b/battle/core.asm index bfe53f863..e5ee3c1be 100644 --- a/battle/core.asm +++ b/battle/core.asm @@ -5308,7 +5308,7 @@ BattleMenu_Pack: ; 3e1c7 call UpdateBattleHUDs call WaitBGMap call LoadTileMapToTempTileMap - call ResetTextRelatedRAM + call ClearWindowData call FinishBattleAnim and a ret @@ -5319,7 +5319,7 @@ BattleMenu_Pack: ; 3e1c7 ld a, [wBattleResult] and $c0 ld [wBattleResult], a - call ResetTextRelatedRAM + call ClearWindowData call SetPalettes scf ret @@ -5661,9 +5661,9 @@ MoveSelectionScreen: ; 3e4bc ld a, 17 - NUM_MOVES - 4 .got_default_coord - ld [wcfa1], a + ld [w2DMenuCursorInitY], a ld a, b - ld [wcfa2], a + ld [w2DMenuCursorInitX], a ld a, [wMoveSelectionMenuType] cp $1 jr z, .skip_inc @@ -5676,9 +5676,9 @@ MoveSelectionScreen: ; 3e4bc ld [wMenuCursorX], a ld a, [wNumMoves] inc a - ld [wcfa3], a + ld [w2DMenuNumRows], a ld a, $1 - ld [wcfa4], a + ld [w2DMenuNumCols], a ld c, $2c ld a, [wMoveSelectionMenuType] dec a @@ -5694,13 +5694,13 @@ MoveSelectionScreen: ; 3e4bc .okay ld a, b - ld [wcfa8], a + ld [w2DMenuFlags4], a ld a, c - ld [wcfa5], a + ld [w2DMenuFlags1], a xor a - ld [wcfa6], a + ld [w2DMenuFlags2], a ld a, $10 - ld [wcfa7], a + ld [w2DMenuFlags3], a .menu_loop ld a, [wMoveSelectionMenuType] and a @@ -8557,9 +8557,9 @@ InitEnemy: ; 3f55e BackUpVBGMap2: ; 3f568 ld a, [rSVBK] push af - ld a, $6 ; BANK(wBackupTilemap) + ld a, $6 ; BANK(wDecompressScratch) ld [rSVBK], a - ld hl, wBackupTilemap + ld hl, wDecompressScratch ld bc, $40 tiles ; VBGMap3 - VBGMap2 ld a, $2 call ByteFill @@ -8567,7 +8567,7 @@ BackUpVBGMap2: ; 3f568 push af ld a, $1 ld [rVBK], a - ld de, wBackupTilemap + ld de, wDecompressScratch hlbgcoord 0, 0 ; VBGMap2 lb bc, BANK(BackUpVBGMap2), $40 call Request2bpp @@ -9453,12 +9453,12 @@ InitBattleDisplay: ; 3fb6c ld a, $6 ld [rSVBK], a - ld hl, wBackupTilemap - ld bc, wBackupAttrMap - wBackupTilemap + ld hl, wDecompressScratch + ld bc, wBackupAttrMap - wDecompressScratch ld a, " " call ByteFill - ld de, wBackupTilemap + ld de, wDecompressScratch hlbgcoord 0, 0 lb bc, BANK(.BlankBGMap), $40 call Request2bpp diff --git a/battle/effect_commands.asm b/battle/effect_commands.asm index 3e66c446a..e732389cc 100644 --- a/battle/effect_commands.asm +++ b/battle/effect_commands.asm @@ -912,7 +912,7 @@ BattleCommand_CheckObedience: ; 343db ld a, 1 ld [AlreadyDisobeyed], a - ld a, [wcfa3] + ld a, [w2DMenuNumRows] ld b, a ; Save the move we originally picked for afterward. diff --git a/engine/battle_start.asm b/engine/battle_start.asm index 69b08fb41..162529999 100644 --- a/engine/battle_start.asm +++ b/engine/battle_start.asm @@ -120,7 +120,7 @@ Function8c2cf: ; 8c2cf ld a, $6 ld [rSVBK], a push hl - ld hl, wBackupTilemap + ld hl, wDecompressScratch ld bc, $28 * $10 .loop @@ -132,7 +132,7 @@ Function8c2cf: ; 8c2cf jr nz, .loop pop hl - ld de, wBackupTilemap + ld de, wDecompressScratch ld b, BANK(Function8c2cf) ; BANK(@) ld c, $28 call Request2bpp diff --git a/engine/crystal_intro.asm b/engine/crystal_intro.asm index dadc07e32..3f238550d 100755 --- a/engine/crystal_intro.asm +++ b/engine/crystal_intro.asm @@ -61,17 +61,17 @@ Copyright_GFPresents: ; e4579 ld [rSVBK], a ld hl, IntroLogoGFX - ld de, wBackupTilemap + ld de, wDecompressScratch ld a, BANK(IntroLogoGFX) call FarDecompress ld hl, VTiles0 - ld de, wBackupTilemap + ld de, wDecompressScratch lb bc, 1, 8 tiles call Request2bpp ld hl, VTiles1 - ld de, wBackupTilemap + $80 tiles + ld de, wDecompressScratch + $80 tiles lb bc, 1, 8 tiles call Request2bpp @@ -1919,7 +1919,7 @@ Intro_LoadTilemap: ; e541b (39:541b) ld a, $6 ld [rSVBK], a - ld hl, wBackupTilemap + ld hl, wDecompressScratch decoord 0, 0 ld b, SCREEN_HEIGHT .row @@ -2039,11 +2039,11 @@ Intro_DecompressRequest2bpp_128Tiles: ; e54c2 (39:54c2) ld [rSVBK], a push de - ld de, wBackupTilemap + ld de, wDecompressScratch call Decompress pop hl - ld de, wBackupTilemap + ld de, wDecompressScratch lb bc, $01, $80 call Request2bpp @@ -2058,11 +2058,11 @@ Intro_DecompressRequest2bpp_255Tiles: ; e54de (39:54de) ld [rSVBK], a push de - ld de, wBackupTilemap + ld de, wDecompressScratch call Decompress pop hl - ld de, wBackupTilemap + ld de, wDecompressScratch lb bc, $01, $ff call Request2bpp @@ -2077,11 +2077,11 @@ Intro_DecompressRequest2bpp_64Tiles: ; e54fa (39:54fa) ld [rSVBK], a push de - ld de, wBackupTilemap + ld de, wDecompressScratch call Decompress pop hl - ld de, wBackupTilemap + ld de, wDecompressScratch lb bc, $01, $40 call Request2bpp diff --git a/engine/debug.asm b/engine/debug.asm index 877c2008d..60eb58c00 100755 --- a/engine/debug.asm +++ b/engine/debug.asm @@ -395,7 +395,7 @@ Function81adb: ; 81adb hlcoord 4, 1 call PlaceString xor a - ld [wc2c6], a + ld [wBoxAlignment], a hlcoord 12, 3 call _PrepMonFrontpic ld de, VTiles2 tile $31 diff --git a/engine/evolution_animation.asm b/engine/evolution_animation.asm index 54387311e..1561c70fa 100755 --- a/engine/evolution_animation.asm +++ b/engine/evolution_animation.asm @@ -111,10 +111,10 @@ EvolutionAnimation: ; 4e5e1 call .check_statused jr c, .no_anim - ld a, [wc2c6] + ld a, [wBoxAlignment] push af ld a, $1 - ld [wc2c6], a + ld [wBoxAlignment], a ld a, [CurPartySpecies] push af @@ -128,7 +128,7 @@ EvolutionAnimation: ; 4e5e1 pop af ld [CurPartySpecies], a pop af - ld [wc2c6], a + ld [wBoxAlignment], a ret .no_anim @@ -167,11 +167,11 @@ EvolutionAnimation: ; 4e5e1 .LoadFrontpic: ; 4e711 call GetBaseData ld a, $1 - ld [wc2c6], a + ld [wBoxAlignment], a ld de, VTiles2 predef FrontpicPredef xor a - ld [wc2c6], a + ld [wBoxAlignment], a ret ; 4e726 diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index 6c26f3a0c..ef843a801 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -50,7 +50,7 @@ NewGame_ClearTileMapEtc: ; 5b44 call ClearTileMap call LoadFontsExtra call LoadStandardFont - call ResetTextRelatedRAM + call ClearWindowData ret ; 5b54 @@ -1410,7 +1410,7 @@ CopyrightString: ; 63fd GameInit:: ; 642e callba TryLoadSaveData - call ResetTextRelatedRAM + call ClearWindowData call ClearBGPalettes call ClearTileMap ld a, VBGMap0 / $100 diff --git a/engine/learn.asm b/engine/learn.asm index 86acf0325..8520a29f7 100755 --- a/engine/learn.asm +++ b/engine/learn.asm @@ -147,24 +147,24 @@ ForgetMove: ; 65d3 predef ListMoves ; wMenuData3 ld a, $4 - ld [wcfa1], a + ld [w2DMenuCursorInitY], a ld a, $6 - ld [wcfa2], a + ld [w2DMenuCursorInitX], a ld a, [wNumMoves] inc a - ld [wcfa3], a + ld [w2DMenuNumRows], a ld a, $1 - ld [wcfa4], a + ld [w2DMenuNumCols], a ld [wMenuCursorY], a ld [wMenuCursorX], a ld a, $3 - ld [wcfa8], a + ld [w2DMenuFlags4], a ld a, $20 - ld [wcfa5], a + ld [w2DMenuFlags1], a xor a - ld [wcfa6], a + ld [w2DMenuFlags2], a ld a, $20 - ld [wcfa7], a + ld [w2DMenuFlags3], a call StaticMenuJoypad push af call Call_LoadTempTileMapToTileMap diff --git a/engine/link.asm b/engine/link.asm index 69554611b..b6bbee66b 100755 --- a/engine/link.asm +++ b/engine/link.asm @@ -1229,23 +1229,23 @@ Function28803: ; 28803 ld a, $1 ld [MonType], a ld a, $c1 - ld [wcfa8], a + ld [w2DMenuFlags4], a ld a, [OTPartyCount] - ld [wcfa3], a + ld [w2DMenuNumRows], a ld a, $1 - ld [wcfa4], a + ld [w2DMenuNumCols], a ld a, $9 - ld [wcfa1], a + ld [w2DMenuCursorInitY], a ld a, $6 - ld [wcfa2], a + ld [w2DMenuCursorInitX], a ld a, $1 ld [wMenuCursorX], a ld a, $10 - ld [wcfa7], a + ld [w2DMenuFlags3], a ld a, $20 - ld [wcfa5], a + ld [w2DMenuFlags1], a xor a - ld [wcfa6], a + ld [w2DMenuFlags2], a Function28835: ; 28835 callba Function16d70c @@ -1294,23 +1294,23 @@ Function2888b: ; 2888b xor a ld [MonType], a ld a, $c1 - ld [wcfa8], a + ld [w2DMenuFlags4], a ld a, [PartyCount] - ld [wcfa3], a + ld [w2DMenuNumRows], a ld a, $1 - ld [wcfa4], a + ld [w2DMenuNumCols], a ld a, $1 - ld [wcfa1], a + ld [w2DMenuCursorInitY], a ld a, $6 - ld [wcfa2], a + ld [w2DMenuCursorInitX], a ld a, $1 ld [wMenuCursorX], a ld a, $10 - ld [wcfa7], a + ld [w2DMenuFlags3], a ld a, $20 - ld [wcfa5], a + ld [w2DMenuFlags1], a xor a - ld [wcfa6], a + ld [w2DMenuFlags2], a call WaitBGMap2 Function288c5: ; 288c5 @@ -1388,23 +1388,23 @@ Function28926: ; 28926 ld a, $7f ldcoord_a 11, 16 ld a, $13 - ld [wcfa8], a + ld [w2DMenuFlags4], a ld a, $1 - ld [wcfa3], a + ld [w2DMenuNumRows], a ld a, $1 - ld [wcfa4], a + ld [w2DMenuNumCols], a ld a, $10 - ld [wcfa1], a + ld [w2DMenuCursorInitY], a ld a, $1 - ld [wcfa2], a + ld [w2DMenuCursorInitX], a ld a, $1 ld [wMenuCursorY], a ld [wMenuCursorX], a ld a, $20 - ld [wcfa7], a + ld [w2DMenuFlags3], a xor a - ld [wcfa5], a - ld [wcfa6], a + ld [w2DMenuFlags1], a + ld [w2DMenuFlags2], a call ScrollingMenuJoypad bit 4, a jr nz, .asm_2898d @@ -1420,23 +1420,23 @@ Function28926: ; 28926 ld a, $7f ldcoord_a 1, 16 ld a, $23 - ld [wcfa8], a + ld [w2DMenuFlags4], a ld a, $1 - ld [wcfa3], a + ld [w2DMenuNumRows], a ld a, $1 - ld [wcfa4], a + ld [w2DMenuNumCols], a ld a, $10 - ld [wcfa1], a + ld [w2DMenuCursorInitY], a ld a, $b - ld [wcfa2], a + ld [w2DMenuCursorInitX], a ld a, $1 ld [wMenuCursorY], a ld [wMenuCursorX], a ld a, $20 - ld [wcfa7], a + ld [w2DMenuFlags3], a xor a - ld [wcfa5], a - ld [wcfa6], a + ld [w2DMenuFlags1], a + ld [w2DMenuFlags2], a call ScrollingMenuJoypad bit 5, a jp nz, .asm_28946 @@ -1700,20 +1700,20 @@ Function28b87: ; 28b87 hlcoord 12, 8 call PlaceString ld a, $8 - ld [wcfa1], a + ld [w2DMenuCursorInitY], a ld a, $b - ld [wcfa2], a + ld [w2DMenuCursorInitX], a ld a, $1 - ld [wcfa4], a + ld [w2DMenuNumCols], a ld a, $2 - ld [wcfa3], a + ld [w2DMenuNumRows], a xor a - ld [wcfa5], a - ld [wcfa6], a + ld [w2DMenuFlags1], a + ld [w2DMenuFlags2], a ld a, $20 - ld [wcfa7], a + ld [w2DMenuFlags3], a ld a, $3 - ld [wcfa8], a + ld [w2DMenuFlags4], a ld a, $1 ld [wMenuCursorY], a ld [wMenuCursorX], a diff --git a/engine/main_menu.asm b/engine/main_menu.asm index 2a4fb37c7..6326b0b98 100755 --- a/engine/main_menu.asm +++ b/engine/main_menu.asm @@ -75,14 +75,14 @@ NewGameMenu: ; 0x49d6c db 2 db NEW_GAME db OPTION - db $ff + db -1 ContinueMenu: ; 0x49d70 db 3 db CONTINUE db NEW_GAME db OPTION - db $ff + db -1 MobileMysteryMenu: ; 0x49d75 db 5 @@ -91,7 +91,7 @@ MobileMysteryMenu: ; 0x49d75 db OPTION db MYSTERY_GIFT db MOBILE - db $ff + db -1 MobileMenu: ; 0x49d7c db 4 @@ -99,7 +99,7 @@ MobileMenu: ; 0x49d7c db NEW_GAME db OPTION db MOBILE - db $ff + db -1 MobileStudiumMenu: ; 0x49d82 db 5 @@ -108,7 +108,7 @@ MobileStudiumMenu: ; 0x49d82 db OPTION db MOBILE db MOBILE_STUDIUM - db $ff + db -1 MysteryMobileStudiumMenu: ; 0x49d89 db 6 @@ -118,7 +118,7 @@ MysteryMobileStudiumMenu: ; 0x49d89 db MYSTERY_GIFT db MOBILE db MOBILE_STUDIUM - db $ff + db -1 MysteryMenu: ; 0x49d91 db 4 @@ -126,7 +126,7 @@ MysteryMenu: ; 0x49d91 db NEW_GAME db OPTION db MYSTERY_GIFT - db $ff + db -1 MysteryStudiumMenu: ; 0x49d97 db 5 @@ -135,7 +135,7 @@ MysteryStudiumMenu: ; 0x49d97 db OPTION db MYSTERY_GIFT db MOBILE_STUDIUM - db $ff + db -1 StudiumMenu: ; 0x49d9e db 4 @@ -143,7 +143,7 @@ StudiumMenu: ; 0x49d9e db NEW_GAME db OPTION db MOBILE_STUDIUM - db $ff + db -1 Function49da4: ; 49da4 @@ -198,9 +198,9 @@ Function49de4: ; 49de4 call SetUpMenu .asm_49de7 call Function49e09 - ld a, [wcfa5] + ld a, [w2DMenuFlags1] set 5, a - ld [wcfa5], a + ld [w2DMenuFlags1], a call Function1f1a ld a, [wMenuJoypad] cp $2 @@ -333,7 +333,7 @@ Function49ed0: ; 49ed0 call ClearTileMap call LoadFontsExtra call LoadStandardFont - call ResetTextRelatedRAM + call ClearWindowData ret ; 49ee0 @@ -370,19 +370,19 @@ Function49f0a: ; 49f0a call Function4a492 call ClearBGPalettes Function49f16: ; 49f16 - call Function4a071 + call MobileMenu_InitMenuBuffers ld c, 12 call DelayFrames hlcoord 4, 0 - ld b, $a - ld c, $a + ld b, 10 + ld c, 10 call Function48cdc hlcoord 6, 2 ld de, MobileString1 call PlaceString hlcoord 0, 12 - ld b, $4 - ld c, $12 + ld b, 4 + ld c, SCREEN_HEIGHT call TextBox xor a ld de, String_0x49fe9 @@ -394,36 +394,35 @@ Function49f16: ; 49f16 ld hl, wMenuCursorY ld b, [hl] push bc - jr .asm_49f5d + jr .check_buttons -.asm_49f55 +.joy_loop call ScrollingMenuJoypad ld hl, wMenuCursorY ld b, [hl] push bc -.asm_49f5d - bit 0, a - jr nz, .asm_49f67 - bit 1, a - jr nz, .asm_49f84 - jr .asm_49f97 +.check_buttons + bit A_BUTTON_F, a + jr nz, .a_button + bit B_BUTTON_F, a + jr nz, .b_button + jr .next -.asm_49f67 +.a_button ld hl, wMenuCursorY ld a, [hl] - cp $1 + cp 1 jp z, Function4a098 - cp $2 + cp 2 jp z, Function4a0b9 - cp $3 + cp 3 jp z, Function4a0c2 - cp $4 + cp 4 jp z, Function4a100 - ld a, $1 + ld a, 1 call MenuClickSound - -.asm_49f84 +.b_button pop bc call ClearBGPalettes call ClearTileMap @@ -433,7 +432,7 @@ Function49f16: ; 49f16 call Function4a6c5 ret -.asm_49f97 +.next ld hl, wMenuCursorY ld a, [hl] dec a @@ -442,15 +441,15 @@ Function49f16: ; 49f16 ld d, h ld e, l hlcoord 1, 13 - ld b, $4 - ld c, $12 + ld b, 4 + ld c, SCREEN_HEIGHT call ClearBox hlcoord 1, 14 call PlaceString - jp .asm_49fb7 + jp .useless_jump -.asm_49fb7 - call Function4a071 +.useless_jump + call MobileMenu_InitMenuBuffers pop bc ld hl, wMenuCursorY ld [hl], b @@ -458,7 +457,7 @@ Function49f16: ; 49f16 ld c, $1 hlcoord 5, 1 call ClearBox - jp .asm_49f55 + jp .joy_loop ; 49fcc @@ -499,36 +498,37 @@ String_0x4a062: ; 4a062 next "@" ; 4a071 -Function4a071: ; 4a071 (12:6071) - ld hl, wcfa1 - ld a, $2 +MobileMenu_InitMenuBuffers: ; 4a071 (12:6071) + ld hl, w2DMenuCursorInitY + ld a, 2 ld [hli], a - ld a, $5 + ld a, 5 ; w2DMenuCursorInitX ld [hli], a - ld a, $5 + ld a, 5 ; w2DMenuNumRows ld [hli], a - ld a, $1 + ld a, 1 ; w2DMenuNumCols ld [hli], a - ld [hl], $0 + ld [hl], $0 ; w2DMenuFlags1 set 5, [hl] inc hl - xor a + xor a ; w2DMenuFlags2 ld [hli], a - ld a, $20 + ld a, $20 ; w2DMenuFlags3 ld [hli], a + ; this is a stupid way to load $c3 ld a, $1 add $40 add $80 add $2 - ld [hli], a - ld a, $1 + ld [hli], a ; w2DMenuFlags4 + ld a, 1 rept 2 - ld [hli], a + ld [hli], a ; wMenuCursorY, wMenuCursorX endr ret Function4a098: ; 4a098 (12:6098) - ld a, $2 + ld a, 2 call MenuClickSound call PlaceHollowCursor call WaitBGMap @@ -541,19 +541,19 @@ Function4a098: ; 4a098 (12:6098) jp Function49f16 Function4a0b9: ; 4a0b9 (12:60b9) - ld a, $2 + ld a, 2 call MenuClickSound pop bc jp Function4a4c4 Function4a0c2: ; 4a0c2 (12:60c2) - ld a, $2 + ld a, 2 call MenuClickSound ld a, BANK(sPlayerData) call GetSRAMBank ld hl, sPlayerData + PlayerName - wPlayerData ld de, PlayerName - ld bc, $6 + ld bc, 6 ; japanese name length call CopyBytes call CloseSRAM callba _LoadData @@ -565,15 +565,15 @@ Function4a0c2: ; 4a0c2 (12:60c2) call ClearBGPalettes pop af and a - jr nz, .asm_4a0f9 + jr nz, .skip_save callba _SaveData -.asm_4a0f9 +.skip_save ld c, 5 call DelayFrames jr asm_4a111 Function4a100: ; 4a100 (12:6100) - ld a, $2 + ld a, 2 call MenuClickSound call ClearBGPalettes call Function4a13b @@ -586,7 +586,7 @@ asm_4a111: ; 4a111 (12:6111) jp Function49f0a Function4a118: ; 4a118 (12:6118) - ld hl, wcfa1 + ld hl, w2DMenuCursorInitY ld a, $1 ld [hli], a ld a, $d @@ -860,7 +860,7 @@ MenuData2_0x4a36a: ; 0x4a36a ; 0x4a373 Function4a373: ; 4a373 (12:6373) - ld hl, wcfa1 + ld hl, w2DMenuCursorInitY ld a, $4 ld [hli], a ld a, $2 @@ -991,7 +991,7 @@ Function4a449: ; 4a449 Function4a485: ; 4a485 (12:6485) ld de, GFX_49c0c ld hl, VTiles2 tile $00 - lb bc, BANK(GFX_49c0c), $d + lb bc, BANK(GFX_49c0c), 13 call Get2bpp ret @@ -1173,7 +1173,7 @@ Strings_4a5f6: ; 4a5f6 ; 4a680 Function4a680: ; 4a680 (12:6680) - ld hl, wcfa1 + ld hl, w2DMenuCursorInitY ld a, $2 ld [hli], a ld a, $3 diff --git a/engine/mon_menu.asm b/engine/mon_menu.asm index b58b2e2bc..f560b1b15 100755 --- a/engine/mon_menu.asm +++ b/engine/mon_menu.asm @@ -86,7 +86,7 @@ MonMenuLoop: ; 24d59 ld a, [Buffer1] ; items ld [wMenuData2Items], a call InitVerticalMenuCursor - ld hl, wcfa5 + ld hl, w2DMenuFlags1 set 6, [hl] call StaticMenuJoypad ld de, SFX_READ_TEXT_2 @@ -308,7 +308,7 @@ BattleMonMenu: ; 24e99 bit 7, a jr z, .set_carry call InitVerticalMenuCursor - ld hl, wcfa5 + ld hl, w2DMenuFlags1 set 6, [hl] call StaticMenuJoypad ld de, SFX_READ_TEXT_2 diff --git a/engine/party_menu.asm b/engine/party_menu.asm index 91b5f2b3f..59eb4afbe 100644 --- a/engine/party_menu.asm +++ b/engine/party_menu.asm @@ -682,7 +682,7 @@ InitPartyMenuWithCancel: ; 50405 call InitMenu3 ld a, [PartyCount] inc a - ld [wcfa3], a ; list length + ld [w2DMenuNumRows], a ; list length dec a ld b, a ld a, [wPartyMenuCursor] @@ -698,7 +698,7 @@ InitPartyMenuWithCancel: ; 50405 .done ld [wMenuCursorY], a ld a, A_BUTTON | B_BUTTON - ld [wcfa8], a + ld [w2DMenuFlags4], a ret ; 5042d @@ -707,7 +707,7 @@ InitPartyMenuNoCancel: ; 0x5042d ld de, PartyMenuAttributes call InitMenu3 ld a, [PartyCount] - ld [wcfa3], a ; list length + ld [w2DMenuNumRows], a ; list length ld b, a ld a, [wPartyMenuCursor] and a @@ -720,7 +720,7 @@ InitPartyMenuNoCancel: ; 0x5042d .done ld [wMenuCursorY], a ld a, A_BUTTON | B_BUTTON - ld [wcfa8], a + ld [w2DMenuFlags4], a ret ; 5044f (14:444f) diff --git a/engine/slot_machine.asm b/engine/slot_machine.asm index 91d8b3035..aad1e4def 100755 --- a/engine/slot_machine.asm +++ b/engine/slot_machine.asm @@ -36,7 +36,7 @@ _SlotMachine: call DelayFrame call DisableLCD hlbgcoord 0, 0 - lb bc, 4, 0 + ld bc, VBGMap1 - VBGMap0 ld a, " " call ByteFill ld b, SCGB_05 @@ -97,13 +97,13 @@ _SlotMachine: ret Slots_GetPals: ; 9279b (24:679b) - ld a, $e4 + ld a, %11100100 call DmgToCgbBGPals - lb de, $e4, $e4 + lb de, %11100100, %11100100 ld a, [hCGB] and a jr nz, .cgb - lb de, $c0, $e4 + lb de, %11000000, %11100100 .cgb call DmgToCgbObjPals ret @@ -139,7 +139,7 @@ SlotsLoop: ; 927af (24:67af) ld a, [wFirstTwoReelsMatchingSevens] and a jr nz, .matching_sevens - ld a, $e4 + ld a, %11100100 call DmgToCgbBGPals ret @@ -148,7 +148,7 @@ SlotsLoop: ; 927af (24:67af) and $7 ret nz ld a, [rBGP] - xor %1100 + xor %00001100 call DmgToCgbBGPals ret @@ -280,9 +280,9 @@ Slots_BetAndStart: ; 9288e (24:688e) ld [wReel2ReelAction], a ld [wReel3ReelAction], a ld a, $4 - ld [wReel1 + 9], a - ld [wReel2 + 9], a - ld [wReel3 + 9], a + ld [wReel1Slot09], a + ld [wReel2Slot09], a + ld [wReel3Slot09], a call WaitSFX ld a, SFX_SLOT_MACHINE_START call Slots_PlaySFX @@ -401,7 +401,7 @@ Slots_GiveEarnedCoins: ; 92987 (24:6987) xor a ld [wFirstTwoReelsMatching], a ld [wFirstTwoReelsMatchingSevens], a - ld a, $e4 + ld a, %11100100 call DmgToCgbBGPals call SlotGetPayout xor a @@ -524,22 +524,22 @@ Slots_StopReel1: ; 92a2b (24:6a2b) Slots_StopReel2: ; 92a2e (24:6a2e) ld a, [wSlotBet] cp $2 - jr c, .eight + jr c, .dont_jump ld a, [wSlotBias] and a jr z, .skip cp SLOTS_NOMATCH - jr nz, .eight + jr nz, .dont_jump .skip call .CheckReel1ForASeven - jr nz, .eight + jr nz, .dont_jump call Random cp $50 ; 32% - jr nc, .eight + jr nc, .dont_jump ld a, $a ret -.eight +.dont_jump ld a, $8 ret @@ -557,38 +557,38 @@ Slots_StopReel2: ; 92a2e (24:6a2e) Slots_StopReel3: ; 92a60 (24:6a60) ld a, [wFirstTwoReelsMatching] and a - jr z, .not_matching_sevens + jr z, .stop ld a, [wFirstTwoReelsMatchingSevens] and a - jr z, .not_matching_sevens + jr z, .stop ld a, [wSlotBias] and a jr nz, .biased call Random cp 180 - jr nc, .not_matching_sevens + jr nc, .stop cp 120 - jr nc, .sixteen + jr nc, .slow_advance cp 60 - jr nc, .eighteen + jr nc, .golem ld a, $15 ret .biased call Random cp 160 - jr nc, .not_matching_sevens + jr nc, .stop cp 80 - jr nc, .sixteen -.eighteen + jr nc, .slow_advance +.golem ld a, $12 ret -.sixteen +.slow_advance ld a, $10 ret -.not_matching_sevens +.stop ld a, $9 ret @@ -817,37 +817,38 @@ endr .jumptable: ; 92be4 jumptable_start - jumptable ReelAction_DoNothing ; 00 - jumptable Slots_StopReelIgnoreJoypad ; 01 + jumptable ReelAction_DoNothing ; 00 + jumptable Slots_StopReelIgnoreJoypad ; 01 - jumptable ReelAction_QuadrupleRate ; 02 - jumptable ReelAction_DoubleRate ; 03 - jumptable ReelAction_NormalRate ; 04 - jumptable ReelAction_HalfRate ; 05 - jumptable ReelAction_QuarterRate ; 06 + jumptable ReelAction_QuadrupleRate ; 02 + jumptable ReelAction_DoubleRate ; 03 + jumptable ReelAction_NormalRate ; 04 + jumptable ReelAction_HalfRate ; 05 + jumptable ReelAction_QuarterRate ; 06 - jumptable ReelAction_StopReel1 ; 07 - jumptable ReelAction_StopReel2 ; 08 - jumptable ReelAction_StopReel3 ; 09 + jumptable ReelAction_StopReel1 ; 07 + jumptable ReelAction_StopReel2 ; 08 + jumptable ReelAction_StopReel3 ; 09 - jumptable Function92cd2 ; 0a - jumptable Function92cf8 ; 0b - jumptable Function92d13 ; 0c - jumptable Function92df7 ; 0d - jumptable Function92e10 ; 0e - jumptable Function92e31 ; 0f + jumptable ReelAction_SetUpReel2SkipTo7 ; 0a + jumptable ReelAction_WaitReel2SkipTo7 ; 0b + jumptable ReelAction_FastSpinReel2UntilLinedUp7s ; 0c - jumptable Function92e47 ; 10 - jumptable Function92e64 ; 11 + jumptable ReelAction_BoringReelDrops ; 0d + jumptable ReelAction_CheckDropReel ; 0e + jumptable ReelAction_WaitDropReel ; 0f - jumptable Function92d20 ; 12 - jumptable Function92d4f ; 13 - jumptable Function92d6e ; 14 + jumptable ReelAction_StartSlowAdvanceReel3 ; 10 + jumptable ReelAction_WaitSlowAdvanceReel3 ; 11 - jumptable Slots_InitChansey ; 15 - jumptable Function92da4 ; 16 - jumptable Function92db3 ; 17 - jumptable Function92dca ; 18 + jumptable ReelAction_InitGolem ; 12 + jumptable ReelAction_WaitGolem ; 13 + jumptable ReelAction_EndGolem ; 14 + + jumptable Slots_InitChansey ; 15 + jumptable ReelAction_WaitChansey ; 16 + jumptable ReelAction_WaitEgg ; 17 + jumptable ReelAction_DropReel ; 18 ; 92c16 ReelAction_DoNothing: ; 92c16 @@ -963,20 +964,20 @@ ReelAction_StopReel2: ; 92c86 ld a, [wSlotBuildingMatch] ld hl, wSlotBias cp [hl] - jr z, .biased_match + jr z, .NoBias .nope ld a, [wSlotBias] - cp $ff - jr z, .biased_match + cp SLOTS_NOMATCH + jr z, .NoBias ld hl, wReel1Slot09 - wReel1 add hl, bc ld a, [hl] and a - jr z, .biased_match + jr z, .NoBias dec [hl] ret -.biased_match +.NoBias call Slots_StopReel ret @@ -987,7 +988,7 @@ ReelAction_StopReel3: ; 92ca9 jr nc, .NoMatch ld hl, wSlotBias cp [hl] - jr z, .bias + jr z, .NoBias ld hl, wReel1Slot09 - wReel1 add hl, bc ld a, [hl] @@ -999,22 +1000,22 @@ ReelAction_StopReel3: ; 92ca9 .NoMatch ld a, [wSlotBias] cp SLOTS_NOMATCH - jr z, .bias + jr z, .NoBias ld hl, wReel1Slot09 - wReel1 add hl, bc ld a, [hl] and a - jr z, .bias + jr z, .NoBias dec [hl] ret -.bias +.NoBias call Slots_StopReel ret ; 92cd2 -Function92cd2: ; 92cd2 +ReelAction_SetUpReel2SkipTo7: ; 92cd2 call Slots_CheckMatchedFirstTwoReels jr nc, .no_match ld a, [wFirstTwoReelsMatchingSevens] @@ -1039,7 +1040,7 @@ Function92cd2: ; 92cd2 ; 92cf8 -Function92cf8: ; 92cf8 +ReelAction_WaitReel2SkipTo7: ; 92cf8 ld hl, wReel1Slot0a - wReel1 add hl, bc ld a, [hl] @@ -1061,7 +1062,7 @@ Function92cf8: ; 92cf8 ; 92d13 -Function92d13: ; 92d13 +ReelAction_FastSpinReel2UntilLinedUp7s: ; 92d13 call Slots_CheckMatchedFirstTwoReels ret nc ld a, [wFirstTwoReelsMatchingSevens] @@ -1072,7 +1073,7 @@ Function92d13: ; 92d13 ; 92d20 -Function92d20: ; 92d20 +ReelAction_InitGolem: ; 92d20 call Slots_CheckMatchedAllThreeReels ret c ld a, SFX_STOP_SLOT @@ -1097,21 +1098,20 @@ Function92d20: ; 92d20 pop bc xor a ld [wcf64], a - -Function92d4f: ; 92d4f +ReelAction_WaitGolem: ; 92d4f ld a, [wcf64] - cp $2 - jr z, .asm_92d5b - cp $1 - jr z, .asm_92d62 + cp 2 + jr z, .two + cp 1 + jr z, .one ret -.asm_92d5b +.two call Slots_CheckMatchedAllThreeReels call Slots_StopReel ret -.asm_92d62 +.one ld hl, wReel1ReelAction - wReel1 add hl, bc inc [hl] @@ -1122,7 +1122,7 @@ Function92d4f: ; 92d4f ; 92d6e -Function92d6e: ; 92d6e +ReelAction_EndGolem: ; 92d6e xor a ld [wcf64], a ld hl, wReel1ReelAction - wReel1 @@ -1158,7 +1158,7 @@ Slots_InitChansey: ; 92d7e ; 92da4 -Function92da4: ; 92da4 +ReelAction_WaitChansey: ; 92da4 ld a, [wcf64] and a ret z @@ -1167,8 +1167,7 @@ Function92da4: ; 92da4 inc [hl] ld a, $2 ld [wcf64], a - -Function92db3: ; 92db3 +ReelAction_WaitEgg: ; 92db3 ld a, [wcf64] cp $4 ret c @@ -1181,27 +1180,26 @@ Function92db3: ; 92db3 ld hl, wReel1Slot0a - wReel1 add hl, bc ld [hl], $11 - -Function92dca: ; 92dca +ReelAction_DropReel: ; 92dca ld hl, wReel1Slot0a - wReel1 add hl, bc ld a, [hl] and a - jr z, .asm_92dd4 + jr z, .check_match dec [hl] ret -.asm_92dd4 +.check_match call Slots_CheckMatchedAllThreeReels - jr nc, .asm_92de5 + jr nc, .EggAgain and a - jr nz, .asm_92de5 + jr nz, .EggAgain ld a, $5 ld [wcf64], a call Slots_StopReel ret -.asm_92de5 +.EggAgain ld hl, wReel1SpinRate - wReel1 add hl, bc ld [hl], $0 @@ -1216,7 +1214,7 @@ endr ; 92df7 -Function92df7: ; 92df7 +ReelAction_BoringReelDrops: ; 92df7 call Slots_CheckMatchedAllThreeReels ret c ld a, SFX_STOP_SLOT @@ -1229,7 +1227,7 @@ Function92df7: ; 92df7 ld hl, wReel1Slot0a - wReel1 add hl, bc ld [hl], a -Function92e10: ; 92e10 +ReelAction_CheckDropReel: ; 92e10 ld hl, wReel1Slot0a - wReel1 add hl, bc ld a, [hl] @@ -1250,16 +1248,16 @@ Function92e10: ; 92e10 ld hl, wReel1SpinRate - wReel1 add hl, bc ld [hl], $0 -Function92e31: ; 92e31 +ReelAction_WaitDropReel: ; 92e31 ld hl, wReel1Slot0b - wReel1 add hl, bc ld a, [hl] and a - jr z, .asm_92e3b + jr z, .DropReel dec [hl] ret -.asm_92e3b +.DropReel ld hl, wReel1ReelAction - wReel1 add hl, bc dec [hl] @@ -1270,7 +1268,7 @@ Function92e31: ; 92e31 ; 92e47 -Function92e47: ; 92e47 +ReelAction_StartSlowAdvanceReel3: ; 92e47 call Slots_CheckMatchedAllThreeReels ret c ld a, SFX_STOP_SLOT @@ -1285,34 +1283,33 @@ Function92e47: ; 92e47 ld hl, wReel1Slot0a - wReel1 add hl, bc ld [hl], $10 - -Function92e64: ; 92e64 +ReelAction_WaitSlowAdvanceReel3: ; 92e64 ld hl, wReel1Slot0a - wReel1 add hl, bc ld a, [hl] and a - jr z, .asm_92e73 + jr z, .check1 dec [hl] -.asm_92e6d +.play_sfx ld a, SFX_GOT_SAFARI_BALLS call Slots_PlaySFX ret -.asm_92e73 +.check1 ld a, [wSlotBias] and a - jr nz, .asm_92e88 + jr nz, .check2 call Slots_CheckMatchedAllThreeReels - jr nc, .asm_92e6d + jr nc, .play_sfx and a - jr nz, .asm_92e6d + jr nz, .play_sfx call Slots_StopReel call WaitSFX ret -.asm_92e88 +.check2 call Slots_CheckMatchedAllThreeReels - jr c, .asm_92e6d + jr c, .play_sfx call Slots_StopReel call WaitSFX ret @@ -1575,7 +1572,7 @@ Function92fc0: ; 92fc0 ld a, [hl] push af push hl - call Function92fcf + call .Check7Bias pop hl pop af ld [hl], a @@ -1584,7 +1581,7 @@ Function92fc0: ; 92fc0 ; 92fcf -Function92fcf: ; 92fcf +.Check7Bias: ; 92fcf ld a, [wSlotBias] and a jr nz, .not_biased_to_seven @@ -1605,7 +1602,7 @@ Function92fcf: ; 92fcf .not_biased_to_seven call Random and $7 - cp $4 + cp $4 ; ((50 percent) & 7) + 1 jr c, .not_biased_to_seven ld e, a .loop2 diff --git a/engine/startmenu.asm b/engine/startmenu.asm index dea007338..c97b10ffc 100755 --- a/engine/startmenu.asm +++ b/engine/startmenu.asm @@ -1,6 +1,6 @@ StartMenu:: ; 125cd - call ResetTextRelatedRAM + call ClearWindowData ld de, SFX_MENU call PlaySFX @@ -1478,7 +1478,7 @@ ChooseMoveToDelete: ; 12f5b ld de, Unknown_12fb2 call InitMenu3 call SetUpMoveList - ld hl, wcfa5 + ld hl, w2DMenuFlags1 set 6, [hl] jr .asm_12f93 @@ -1506,7 +1506,7 @@ ChooseMoveToDelete: ; 12f5b push af xor a ld [wSwitchMon], a - ld hl, wcfa5 + ld hl, w2DMenuFlags1 res 6, [hl] call ClearSprites call ClearTileMap @@ -1546,7 +1546,7 @@ MoveScreenLoop: ; 12fd5 call InitMenu3 .loop call SetUpMoveList - ld hl, wcfa5 + ld hl, w2DMenuFlags1 set 6, [hl] jr .skip_joy @@ -1740,7 +1740,7 @@ MoveScreenLoop: ; 12fd5 .exit: ; 13154 xor a ld [wMoveSwapBuffer], a - ld hl, wcfa5 + ld hl, w2DMenuFlags1 res 6, [hl] call ClearSprites jp ClearTileMap @@ -1822,7 +1822,7 @@ SetUpMoveList: ; 131ef call SetPalettes ld a, [wNumMoves] inc a - ld [wcfa3], a + ld [w2DMenuNumRows], a hlcoord 0, 11 ld b, 5 ld c, 18 diff --git a/engine/stats_screen.asm b/engine/stats_screen.asm index 4e3a6d9b3..a23148c2e 100755 --- a/engine/stats_screen.asm +++ b/engine/stats_screen.asm @@ -21,7 +21,7 @@ StatsScreenInit_gotaddress: ; 4dc94 push af xor a ld [hMapAnims], a ; disable overworld tile animations - ld a, [wc2c6] ; whether sprite is to be mirrorred + ld a, [wBoxAlignment] ; whether sprite is to be mirrorred push af ld a, [wJumptableIndex] ld b, a @@ -46,7 +46,7 @@ StatsScreenInit_gotaddress: ; 4dc94 ld a, c ld [wcf64], a pop af - ld [wc2c6], a + ld [wBoxAlignment], a pop af ld [hMapAnims], a ret @@ -823,7 +823,7 @@ Function4e253: ; 4e253 (13:6253) ret .asm_4e266 xor a - ld [wc2c6], a + ld [wBoxAlignment], a hlcoord 0, 0 call _PrepMonFrontpic ret @@ -833,12 +833,12 @@ Function4e271: ; 4e271 (13:6271) cp UNOWN jr z, .asm_4e281 ld a, $1 - ld [wc2c6], a + ld [wBoxAlignment], a call Function4e289 ret .asm_4e281 xor a - ld [wc2c6], a + ld [wBoxAlignment], a call Function4e289 ret @@ -1048,7 +1048,7 @@ Function4e497: ; 4e497 (13:6497) .asm_4e4ab push de ld a, $1 - ld [wc2c6], a + ld [wBoxAlignment], a call Function4e307 ld de, VTiles2 tile $00 predef FrontpicPredef diff --git a/engine/tmhm2.asm b/engine/tmhm2.asm index d23287b65..9476ce4cd 100755 --- a/engine/tmhm2.asm +++ b/engine/tmhm2.asm @@ -80,7 +80,7 @@ ChooseMonToLearnTMHM_NoRefresh: ; 2c80a callba LoadPartyMenuGFX callba InitPartyMenuWithCancel callba InitPartyMenuGFX - ld a, $3 + ld a, $3 ; TeachWhichPKMNString ld [PartyMenuActionText], a .loopback callba WritePartyMenuTilemap @@ -197,11 +197,11 @@ TMHM_PocketLoop: ; 2c8d3 (b:48d3) ld [hBGMapMode], a call TMHM_DisplayPocketItems ld a, $2 - ld [wcfa1], a + ld [w2DMenuCursorInitY], a ld a, $7 - ld [wcfa2], a + ld [w2DMenuCursorInitX], a ld a, $1 - ld [wcfa4], a + ld [w2DMenuNumCols], a ld a, $5 sub d inc a @@ -209,15 +209,15 @@ TMHM_PocketLoop: ; 2c8d3 (b:48d3) jr nz, .okay dec a .okay - ld [wcfa3], a + ld [w2DMenuNumRows], a ld a, $c - ld [wcfa5], a + ld [w2DMenuFlags1], a xor a - ld [wcfa6], a + ld [w2DMenuFlags2], a ld a, $20 - ld [wcfa7], a + ld [w2DMenuFlags3], a ld a, $f3 - ld [wcfa8], a + ld [w2DMenuFlags4], a ld a, [wTMHMPocketCursor] inc a ld [wMenuCursorY], a @@ -234,7 +234,7 @@ TMHM_JoypadLoop: ; 2c915 (b:4915) ld [wTMHMPocketCursor], a xor a ld [hBGMapMode], a - ld a, [wcfa6] + ld a, [w2DMenuFlags2] bit 7, a jp nz, TMHM_ScrollPocket ld a, b diff --git a/engine/warp_connection.asm b/engine/warp_connection.asm index 62f81d6e5..1443de6d7 100755 --- a/engine/warp_connection.asm +++ b/engine/warp_connection.asm @@ -256,13 +256,13 @@ Function104770: ; 104770 (41:4770) ld a, $1 ld [rVBK], a xor a - lb bc, 4, 0 + ld bc, VBGMap1 - VBGMap0 hlbgcoord 0, 0 call ByteFill pop af ld [rVBK], a ld a, $60 - lb bc, 4, 0 + ld bc, VBGMap1 - VBGMap0 hlbgcoord 0, 0 call ByteFill ret diff --git a/event/halloffame.asm b/event/halloffame.asm index f9ba7cf16..95554a870 100755 --- a/event/halloffame.asm +++ b/event/halloffame.asm @@ -267,7 +267,7 @@ endr call SetPalettes call HOF_SlideBackpic xor a - ld [wc2c6], a + ld [wBoxAlignment], a hlcoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld a, " " @@ -486,7 +486,7 @@ DisplayHOFMon: ; 86748 ld hl, TempMonDVs predef GetUnownLetter xor a - ld [wc2c6], a + ld [wBoxAlignment], a hlcoord 6, 5 call _PrepMonFrontpic ld a, [CurPartySpecies] @@ -566,7 +566,7 @@ Function86810: ; 86810 call SetPalettes call HOF_SlideBackpic xor a - ld [wc2c6], a + ld [wBoxAlignment], a hlcoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld a, " " diff --git a/event/move_deleter.asm b/event/move_deleter.asm index ba52b2b3a..aa8a1e915 100644 --- a/event/move_deleter.asm +++ b/event/move_deleter.asm @@ -1,113 +1,113 @@ MoveDeletion: - ld hl, UnknownText_0x2c5ef + ld hl, .IntroText call PrintText call YesNoBox - jr c, .asm_2c5c3 - ld hl, UnknownText_0x2c5f4 + jr c, .declined + ld hl, .AskWhichMonText call PrintText callba SelectMonFromParty - jr c, .asm_2c5c3 + jr c, .declined ld a, [CurPartySpecies] cp EGG - jr z, .asm_2c5bc + jr z, .egg ld a, [CurPartyMon] ld hl, PartyMon1Moves + 1 ld bc, PARTYMON_STRUCT_LENGTH call AddNTimes ld a, [hl] and a - jr z, .asm_2c5ca - ld hl, UnknownText_0x2c5ea + jr z, .onlyonemove + ld hl, .AskWhichMoveText call PrintText call LoadStandardMenuDataHeader callba ChooseMoveToDelete push af call ReturnToMapWithSpeechTextbox pop af - jr c, .asm_2c5c3 + jr c, .declined ld a, [wMenuCursorY] push af ld a, [CurSpecies] ld [wd265], a call GetMoveName - ld hl, UnknownText_0x2c5d6 + ld hl, .ConfirmDeleteText call PrintText call YesNoBox pop bc - jr c, .asm_2c5c3 - call Function2c5f9 + jr c, .declined + call .DeleteMove call WaitSFX ld de, SFX_MOVE_DELETED call PlaySFX call WaitSFX - ld hl, UnknownText_0x2c5db + ld hl, .MoveDeletedText call PrintText ret -.asm_2c5bc - ld hl, UnknownText_0x2c5e0 +.egg + ld hl, .EggText call PrintText ret -.asm_2c5c3 - ld hl, UnknownText_0x2c5e5 +.declined + ld hl, .DeclinedDeletionText call PrintText ret -.asm_2c5ca - ld hl, UnknownText_0x2c5d1 +.onlyonemove + ld hl, .OnlyOneMoveText call PrintText ret -UnknownText_0x2c5d1: ; 0x2c5d1 +.OnlyOneMoveText: ; 0x2c5d1 ; That #MON knows only one move. text_jump UnknownText_0x1c5eba db "@" ; 0x2c5d6 -UnknownText_0x2c5d6: ; 0x2c5d6 +.ConfirmDeleteText: ; 0x2c5d6 ; Oh, make it forget @ ? text_jump UnknownText_0x1c5eda db "@" ; 0x2c5db -UnknownText_0x2c5db: ; 0x2c5db +.MoveDeletedText: ; 0x2c5db ; Done! Your #MON forgot the move. text_jump UnknownText_0x1c5ef5 db "@" ; 0x2c5e0 -UnknownText_0x2c5e0: ; 0x2c5e0 +.EggText: ; 0x2c5e0 ; An EGG doesn't know any moves! text_jump UnknownText_0x1c5f17 db "@" ; 0x2c5e5 -UnknownText_0x2c5e5: ; 0x2c5e5 +.DeclinedDeletionText: ; 0x2c5e5 ; No? Come visit me again. text_jump UnknownText_0x1c5f36 db "@" ; 0x2c5ea -UnknownText_0x2c5ea: ; 0x2c5ea +.AskWhichMoveText: ; 0x2c5ea ; Which move should it forget, then? text_jump UnknownText_0x1c5f50 db "@" ; 0x2c5ef -UnknownText_0x2c5ef: ; 0x2c5ef +.IntroText: ; 0x2c5ef ; Um… Oh, yes, I'm the MOVE DELETER. I can make #MON forget moves. Shall I make a #MON forget? text_jump UnknownText_0x1c5f74 db "@" ; 0x2c5f4 -UnknownText_0x2c5f4: ; 0x2c5f4 +.AskWhichMonText: ; 0x2c5f4 ; Which #MON? text_jump UnknownText_0x1c5fd1 db "@" ; 0x2c5f9 -Function2c5f9: ; 2c5f9 +.DeleteMove: ; 2c5f9 ld a, b push bc dec a @@ -121,18 +121,18 @@ Function2c5f9: ; 2c5f9 pop bc push bc inc b -.asm_2c60f +.loop ld a, b cp NUM_MOVES + 1 - jr z, .asm_2c61b + jr z, .okay inc hl ld a, [hld] ld [hl], a inc hl inc b - jr .asm_2c60f + jr .loop -.asm_2c61b +.okay xor a ld [hl], a pop bc @@ -149,18 +149,18 @@ Function2c5f9: ; 2c5f9 call AddNTimes pop bc inc b -.asm_2c633 +.loop2 ld a, b cp NUM_MOVES + 1 - jr z, .asm_2c63f + jr z, .done inc hl ld a, [hld] ld [hl], a inc hl inc b - jr .asm_2c633 + jr .loop2 -.asm_2c63f +.done xor a ld [hl], a ret diff --git a/event/photo.asm b/event/photo.asm index c023e8d2b..54fc3b861 100755 --- a/event/photo.asm +++ b/event/photo.asm @@ -50,7 +50,7 @@ UnownPrinter: ; 16be4 xor a ld [wJumptableIndex], a - call Function16cc8 + call .UpdateUnownFrontpic call WaitBGMap ld a, UNOWN @@ -74,7 +74,7 @@ UnownPrinter: ; 16be4 and A_BUTTON jr nz, .pressed_a - call Function16ca0 + call .LeftRight call DelayFrame jr .joy_loop @@ -96,7 +96,7 @@ UnownPrinter: ; 16be4 ret ; 16ca0 -Function16ca0: ; 16ca0 +.LeftRight: ; 16ca0 ld a, [hJoyLast] and D_RIGHT jr nz, .press_right @@ -110,8 +110,7 @@ Function16ca0: ; 16ca0 ld a, [hl] and a jr nz, .wrap_around_left - ld [hl], $1b - + ld [hl], 26 + 1 .wrap_around_left dec [hl] jr .return @@ -119,19 +118,18 @@ Function16ca0: ; 16ca0 .press_right ld hl, wJumptableIndex ld a, [hl] - cp $1a + cp 26 jr c, .wrap_around_right - ld [hl], $ff - + ld [hl], -1 .wrap_around_right inc [hl] .return - call Function16cc8 + call .UpdateUnownFrontpic ret ; 16cc8 -Function16cc8: ; 16cc8 +.UpdateUnownFrontpic: ; 16cc8 ld a, [wJumptableIndex] cp 26 jr z, Function16d20 @@ -140,7 +138,7 @@ Function16cc8: ; 16cc8 ld a, UNOWN ld [CurPartySpecies], a xor a - ld [wc2c6], a + ld [wBoxAlignment], a ld de, VTiles2 predef GetFrontpic call Function16cff @@ -162,7 +160,7 @@ Function16cff: ; 16cff ld a, BANK(sScratch) call GetSRAMBank - ld de, wBackupTilemap + ld de, wDecompressScratch ld hl, sScratch ld a, [hROMBank] ld b, a diff --git a/gfx/pics/animation.asm b/gfx/pics/animation.asm index 182577cbc..ae207a790 100644 --- a/gfx/pics/animation.asm +++ b/gfx/pics/animation.asm @@ -663,7 +663,7 @@ Functiond03cd: ; d03cd ld a, [w2_d186] ld bc, SCREEN_WIDTH call AddNTimes - ld a, [wc2c6] + ld a, [wBoxAlignment] and a jr nz, .go ld a, [w2_d185] @@ -786,7 +786,7 @@ Functiond046c: ; d046c ld bc, 45 .okay - ld a, [wc2c6] + ld a, [wBoxAlignment] and a jr nz, .add_bc add hl, de @@ -824,7 +824,7 @@ Functiond0499: ; d0499 Functiond04bd: ; d04bd call Functiond04f6 - ld a, [wc2c6] + ld a, [wBoxAlignment] and a jr nz, .minus_one_and_six ld de, 1 @@ -1117,7 +1117,7 @@ PokeAnim_GetSpeciesOrUnown: ; d065c Functiond0669: ; d0669 ld a, $1 - ld [wc2c6], a + ld [wBoxAlignment], a Functiond066e: ; d066e call AnimateMon_CheckIfPokemon @@ -1134,12 +1134,12 @@ Functiond066e: ; d066e ld e, c call AnimateFrontpic xor a - ld [wc2c6], a + ld [wBoxAlignment], a ret .asm_d068c xor a - ld [wc2c6], a + ld [wBoxAlignment], a inc a ld [CurPartySpecies], a ret diff --git a/home.asm b/home.asm index 90f0988ce..733068dd2 100644 --- a/home.asm +++ b/home.asm @@ -1714,7 +1714,7 @@ DrawBattleHPBar:: ; 3750 PrepMonFrontpic:: ; 3786 ld a, $1 - ld [wc2c6], a + ld [wBoxAlignment], a _PrepMonFrontpic:: ; 378b ld a, [CurPartySpecies] @@ -1730,12 +1730,12 @@ _PrepMonFrontpic:: ; 378b lb bc, 7, 7 predef FillBox xor a - ld [wc2c6], a + ld [wBoxAlignment], a ret .not_pokemon xor a - ld [wc2c6], a + ld [wBoxAlignment], a inc a ld [CurPartySpecies], a ret @@ -2192,7 +2192,7 @@ Function3f7c:: ; 3f7c ; 3f88 Function3f88:: ; 3f88 - ld hl, wBackupTilemap + ld hl, wDecompressScratch ld b, $0 .asm_3f8d push bc @@ -2213,7 +2213,7 @@ Function3f88:: ; 3f88 ; 3f9f Function3f9f:: ; 3f9f - ld hl, wBackupTilemap + ld hl, wDecompressScratch .asm_3fa2 push bc ld c, $8 diff --git a/home/map.asm b/home/map.asm index 1185a04d1..dc2dc96f2 100644 --- a/home/map.asm +++ b/home/map.asm @@ -1405,10 +1405,10 @@ LoadTileset:: ; 2821 ld [rSVBK], a ld a, e - ld de, wBackupTilemap + ld de, wDecompressScratch call FarDecompress - ld hl, wBackupTilemap + ld hl, wDecompressScratch ld de, VTiles2 ld bc, $60 tiles call CopyBytes diff --git a/home/menu.asm b/home/menu.asm index 5213fab32..0427bbd1b 100644 --- a/home/menu.asm +++ b/home/menu.asm @@ -489,14 +489,14 @@ endr ret ; 1fbf -ResetTextRelatedRAM:: ; 1fbf +ClearWindowData:: ; 1fbf ld hl, wWindowStackPointer call .bytefill ld hl, wMenuDataHeader call .bytefill ld hl, wMenuData2Flags call .bytefill - ld hl, wcfa1 + ld hl, w2DMenuCursorInitY call .bytefill ld a, [rSVBK] diff --git a/home/window.asm b/home/window.asm index cd6abbd6e..55e58f6a5 100644 --- a/home/window.asm +++ b/home/window.asm @@ -1,6 +1,6 @@ ResetWindow:: ; 2dba - call ResetTextRelatedRAM + call ClearWindowData ld a, [hROMBank] push af ld a, BANK(Function6454) ; and BANK(Function64bf) @@ -32,7 +32,7 @@ CloseText:: ; 2dcf ; 2de2 .CloseText ; 2de2 - call ResetTextRelatedRAM + call ClearWindowData xor a ld [hBGMapMode], a call OverworldTextModeSwitch @@ -49,7 +49,7 @@ CloseText:: ; 2dcf ; 2e08 OpenText:: ; 2e08 - call ResetTextRelatedRAM + call ClearWindowData ld a, [hROMBank] push af ld a, BANK(Function6454) ; and BANK(Function64bf) diff --git a/main.asm b/main.asm index 27db50a67..b3e567aa4 100644 --- a/main.asm +++ b/main.asm @@ -146,12 +146,12 @@ Function64db: ; 64db ld [rSVBK], a ld a, $60 - ld hl, wBackupTilemap - lb bc, 4, 0 + ld hl, wDecompressScratch + ld bc, wBackupAttrMap - wDecompressScratch call ByteFill - ld a, wBackupTilemap / $100 + ld a, wDecompressScratch / $100 ld [rHDMA1], a - ld a, wBackupTilemap % $100 + ld a, wDecompressScratch % $100 ld [rHDMA2], a ld a, (VBGMap0 % $8000) / $100 ld [rHDMA3], a @@ -9173,7 +9173,7 @@ endr callab ResetEnemyStatLevels - call ResetTextRelatedRAM + call ClearWindowData ld hl, hBGMapAddress xor a @@ -9183,13 +9183,13 @@ endr ; 2ef6e FillBox: ; 2ef6e -; Fill wc2c6-aligned box width b height c +; Fill wBoxAlignment-aligned box width b height c ; with iterating tile starting from hFillBox at hl. ; Predef $13 ld de, SCREEN_WIDTH - ld a, [wc2c6] + ld a, [wBoxAlignment] and a jr nz, .right @@ -11616,12 +11616,12 @@ Function4e906: ; 4e906 push af ld a, $6 ld [rSVBK], a - ld hl, wBackupTilemap - ld bc, wBackupAttrMap - wBackupTilemap + ld hl, wDecompressScratch + ld bc, wBackupAttrMap - wDecompressScratch ld a, " " call ByteFill hlbgcoord 0, 0 - ld de, wBackupTilemap + ld de, wDecompressScratch ld b, $0 ld c, $40 call Request2bpp @@ -13028,15 +13028,15 @@ _GetFrontpic: ; 510a5 ld a, $6 ld [rSVBK], a ld a, b - ld de, wBackupTilemap + $800 + ld de, wDecompressScratch + $800 call FarDecompress pop bc - ld hl, wBackupTilemap - ld de, wBackupTilemap + $800 + ld hl, wDecompressScratch + ld de, wDecompressScratch + $800 call Function512ab pop hl push hl - ld de, wBackupTilemap + ld de, wDecompressScratch ld c, 7 * 7 ld a, [hROMBank] ld b, a @@ -13079,7 +13079,7 @@ Function51103: ; 51103 ld a, $1 ld [rVBK], a push hl - ld de, wBackupTilemap + ld de, wDecompressScratch ld c, 7 * 7 ld a, [hROMBank] ld b, a @@ -13110,7 +13110,7 @@ Function51103: ; 51103 call Function5114f pop bc pop hl - ld de, wBackupTilemap + ld de, wDecompressScratch ld a, [hROMBank] ld b, a call Get2bpp @@ -13120,7 +13120,7 @@ Function51103: ; 51103 ; 5114f Function5114f: ; 5114f - ld hl, wBackupTilemap + ld hl, wDecompressScratch swap c ld a, c and $f @@ -13129,12 +13129,12 @@ Function5114f: ; 5114f and $f0 ld c, a push bc - call Function512f2 + call LoadFrontpic pop bc .asm_51161 push bc ld c, $0 - call Function512f2 + call LoadFrontpic pop bc dec b jr nz, .asm_51161 @@ -13179,14 +13179,14 @@ GetBackpic: ; 5116c inc hl ld a, d call GetFarHalfword - ld de, wBackupTilemap + ld de, wDecompressScratch pop af call FarDecompress - ld hl, wBackupTilemap + ld hl, wDecompressScratch ld c, 6 * 6 - call Function5127c + call FixBackpicAlignment pop hl - ld de, wBackupTilemap + ld de, wDecompressScratch ld a, [hROMBank] ld b, a call Get2bpp @@ -13283,10 +13283,10 @@ GetTrainerPic: ; 5120d ld a, BANK(TrainerPicPointers) call GetFarHalfword pop af - ld de, wBackupTilemap + ld de, wDecompressScratch call FarDecompress pop hl - ld de, wBackupTilemap + ld de, wDecompressScratch ld c, 7 * 7 ld a, [hROMBank] ld b, a @@ -13310,10 +13310,10 @@ DecompressPredef: ; 5125d push de push bc ld a, b - ld de, wBackupTilemap + ld de, wDecompressScratch call FarDecompress pop bc - ld de, wBackupTilemap + ld de, wDecompressScratch pop hl ld a, [hROMBank] ld b, a @@ -13324,12 +13324,12 @@ DecompressPredef: ; 5125d ret ; 5127c -Function5127c: ; 5127c +FixBackpicAlignment: ; 5127c push de push bc - ld a, [wc2c6] + ld a, [wBoxAlignment] and a - jr z, .asm_512a8 + jr z, .keep_dims ld a, c cp 7 * 7 ld de, 7 * 7 tiles @@ -13355,7 +13355,7 @@ Function5127c: ; 5127c or d jr nz, .got_dims -.asm_512a8 +.keep_dims pop bc pop de ret @@ -13368,39 +13368,39 @@ Function512ab: ; 512ab cp 5 jr z, .five -.seven +.seven_loop ld c, $70 - call Function512f2 + call LoadFrontpic dec b - jr nz, .seven + jr nz, .seven_loop ret .six ld c, $70 xor a call .Fill -.asm_512c3 +.six_loop ld c, $10 xor a call .Fill ld c, $60 - call Function512f2 + call LoadFrontpic dec b - jr nz, .asm_512c3 + jr nz, .six_loop ret .five ld c, $70 xor a call .Fill -.asm_512d8 +.five_loop ld c, $20 xor a call .Fill ld c, $50 - call Function512f2 + call LoadFrontpic dec b - jr nz, .asm_512d8 + jr nz, .five_loop ld c, $70 xor a call .Fill @@ -13413,21 +13413,21 @@ Function512ab: ; 512ab ret ; 512f2 -Function512f2: ; 512f2 - ld a, [wc2c6] +LoadFrontpic: ; 512f2 + ld a, [wBoxAlignment] and a - jr nz, .asm_512ff -.asm_512f8 + jr nz, .x_flip +.left_loop ld a, [de] inc de ld [hli], a dec c - jr nz, .asm_512f8 + jr nz, .left_loop ret -.asm_512ff +.x_flip push bc -.asm_51300 +.right_loop ld a, [de] inc de ld b, a @@ -13438,7 +13438,7 @@ Function512f2: ; 512f2 endr ld [hli], a dec c - jr nz, .asm_51300 + jr nz, .right_loop pop bc ret ; 51322 @@ -13453,14 +13453,14 @@ Function51322: ; 51322 ld [wd265], a ld hl, sBoxMonNicknames ld bc, PKMN_NAME_LENGTH - ld de, wd002 + ld de, wBufferMonNick call Function513e0 ld a, [sBoxCount] dec a ld [wd265], a ld hl, sBoxMonOT ld bc, NAME_LENGTH - ld de, wd00d + ld de, wBufferMonOT call Function513e0 ld a, [sBoxCount] dec a @@ -13491,14 +13491,14 @@ Function5138b: ; 5138b ld [wd265], a ld hl, PartyMonNicknames ld bc, PKMN_NAME_LENGTH - ld de, wd002 + ld de, wBufferMonNick call Function513e0 ld a, [PartyCount] dec a ld [wd265], a ld hl, PartyMonOT ld bc, NAME_LENGTH - ld de, wd00d + ld de, wBufferMonOT call Function513e0 ld a, [PartyCount] dec a @@ -15208,7 +15208,7 @@ endr .Decompress: ; e0057 ld hl, wd012 - ld e, $80 + ld e, %10000000 ld d, 8 .loop_decompress push hl diff --git a/misc/gfx_41.asm b/misc/gfx_41.asm index 6f55c237e..a07e3c429 100755 --- a/misc/gfx_41.asm +++ b/misc/gfx_41.asm @@ -8,11 +8,11 @@ Function104006: ; 104006 ld hl, wBackupAttrMap call CutAndPasteAttrMap decoord 0, 0 - ld hl, wBackupTilemap + ld hl, wDecompressScratch call CutAndPasteTilemap ld a, $0 ld [rVBK], a - ld hl, wBackupTilemap + ld hl, wDecompressScratch call Function10419d ld a, $1 ld [rVBK], a @@ -28,11 +28,11 @@ Function10402d:: ; 10402d Function104033: ; 104033 decoord 0, 0 - ld hl, wBackupTilemap + ld hl, wDecompressScratch call CutAndPasteTilemap ld a, $0 ld [rVBK], a - ld hl, wBackupTilemap + ld hl, wDecompressScratch call Function10419d ret ; 104047 @@ -63,7 +63,7 @@ Function104067: ; 104067 ld hl, wBackupAttrMap call CutAndPasteAttrMap decoord 0, 0 - ld hl, wBackupTilemap + ld hl, wDecompressScratch call CutAndPasteTilemap call DelayFrame di @@ -75,7 +75,7 @@ Function104067: ; 104067 call Function1041ad ld a, $0 ld [rVBK], a - ld hl, wBackupTilemap + ld hl, wDecompressScratch call Function1041ad pop af ld [rVBK], a @@ -93,7 +93,7 @@ Function1040a2: ; 1040a2 ld hl, wBackupAttrMap call CutAndPasteAttrMap decoord 0, 0 - ld hl, wBackupTilemap + ld hl, wDecompressScratch call CutAndPasteTilemap call DelayFrame di @@ -105,7 +105,7 @@ Function1040a2: ; 1040a2 call Function1041c1 ld a, $0 ld [rVBK], a - ld hl, wBackupTilemap + ld hl, wDecompressScratch call Function1041c1 pop af ld [rVBK], a @@ -164,7 +164,7 @@ Function104116: ; 104116 ld hl, wBackupAttrMap call CutAndPasteAttrMap decoord 0, 0 - ld hl, wBackupTilemap + ld hl, wDecompressScratch call CutAndPasteTilemap call DelayFrame @@ -177,7 +177,7 @@ Function104116: ; 104116 call Function1041b7 ld a, $0 ld [rVBK], a - ld hl, wBackupTilemap + ld hl, wDecompressScratch call Function1041b7 pop af ld [rVBK], a @@ -196,7 +196,7 @@ Function10414e: ; 10414e call CutAndPasteAttrMap ld c, $ff decoord 0, 0 - ld hl, wBackupTilemap + ld hl, wDecompressScratch call CutAndPasteMap ld a, $1 ld [rVBK], a @@ -204,7 +204,7 @@ Function10414e: ; 10414e call Function1041ad ld a, $0 ld [rVBK], a - ld hl, wBackupTilemap + ld hl, wDecompressScratch call Function1041ad ret ; 104177 @@ -450,7 +450,7 @@ _Get2bpp:: ; 104284 push bc push hl - ; Copy c tiles of the 2bpp from b:de to wBackupTilemap + ; Copy c tiles of the 2bpp from b:de to wDecompressScratch ld a, b ; bank ld l, c ; number of tiles ld h, $0 @@ -461,7 +461,7 @@ endr ld c, l ld h, d ; address ld l, e - ld de, wBackupTilemap + ld de, wDecompressScratch call FarCopyBytes pop hl @@ -473,7 +473,7 @@ endr ld d, h ld e, l - ld hl, wBackupTilemap + ld hl, wDecompressScratch call Function104209 ; restore the previous bank @@ -528,7 +528,7 @@ endr ld b, h ld h, d ld l, e - ld de, wBackupTilemap + ld de, wDecompressScratch call FarCopyBytesDouble_DoubleBankSwitch pop hl @@ -540,7 +540,7 @@ endr ld d, h ld e, l - ld hl, wBackupTilemap + ld hl, wDecompressScratch call Function104209 pop af @@ -554,22 +554,22 @@ Function104303: ; 104303 ; 104309 Function104309: - ld hl, wBackupTilemap + ld hl, wDecompressScratch decoord 0, 0 call Function10433a - ld hl, wBackupTilemap + $80 + ld hl, wDecompressScratch + $80 decoord 0, 0, AttrMap call Function10433a ld a, $1 ld [rVBK], a ld c, $8 - ld hl, wBackupTilemap + $80 + ld hl, wDecompressScratch + $80 debgcoord 0, 0, VBGMap1 call Function104209 ld a, $0 ld [rVBK], a ld c, $8 - ld hl, wBackupTilemap + ld hl, wDecompressScratch debgcoord 0, 0, VBGMap1 call Function104209 ret diff --git a/misc/mobile_12.asm b/misc/mobile_12.asm index 748b095de..7dca10581 100755 --- a/misc/mobile_12.asm +++ b/misc/mobile_12.asm @@ -687,7 +687,7 @@ Function48689: ; 48689 (12:4689) ret Function486bf: ; 486bf (12:46bf) - ld hl, wcfa1 + ld hl, w2DMenuCursorInitY ld a, [wd002] bit 6, a jr nz, .asm_486ce @@ -772,7 +772,7 @@ Function48725: ; 48725 (12:4725) ret Function4873c: ; 4873c (12:473c) - ld hl, wcfa1 + ld hl, w2DMenuCursorInitY ld a, $4 ld [hli], a ld a, $c @@ -1217,9 +1217,9 @@ Function48a3a: ; 48a3a (12:4a3a) call LoadMenuDataHeader call Function4873c ld a, $a - ld [wcfa1], a + ld [w2DMenuCursorInitY], a ld a, $b - ld [wcfa2], a + ld [w2DMenuCursorInitX], a ld a, $1 ld [wMenuCursorY], a hlcoord 10, 8 @@ -1605,7 +1605,8 @@ Function48c63: ; 48c63 ; 48c8e Function48c8e: ; 48c8e - ld hl, wd02a +; unreferenced + ld hl, $d02a ld d, h ld e, l callba Function48c63 diff --git a/misc/mobile_12_2.asm b/misc/mobile_12_2.asm index d7c987c36..6865c480a 100755 --- a/misc/mobile_12_2.asm +++ b/misc/mobile_12_2.asm @@ -488,11 +488,11 @@ Function4ab06: ; 4ab06 Function4ab1a: ; 4ab1a .asm_4ab1a ld a, $fb - ld [wcfa8], a + ld [w2DMenuFlags4], a ld a, $26 - ld [wcfa7], a + ld [w2DMenuFlags3], a ld a, $2 - ld [wcfa4], a + ld [w2DMenuNumCols], a call Function4adf7 call StaticMenuJoypad call Function4abc3 @@ -748,7 +748,7 @@ Function4acaa: ; 4acaa ld a, $1 ld [wMenuCursorBuffer], a call InitVerticalMenuCursor - ld hl, wcfa5 + ld hl, w2DMenuFlags1 set 6, [hl] call StaticMenuJoypad ld de, SFX_READ_TEXT_2 diff --git a/misc/mobile_22.asm b/misc/mobile_22.asm index 8734a4ca3..38acfa3af 100644 --- a/misc/mobile_22.asm +++ b/misc/mobile_22.asm @@ -2200,7 +2200,7 @@ Function89d5e: ; 89d5e (22:5d5e) call Function8923c call PlaceVerticalMenuItems call InitVerticalMenuCursor - ld hl, wcfa5 + ld hl, w2DMenuFlags1 set 7, [hl] ret @@ -2242,7 +2242,7 @@ Function89dab: ; 89dab (22:5dab) callba MobileMenuJoypad call Function8923c ld a, c - ld hl, wcfa8 + ld hl, w2DMenuFlags4 and [hl] ret z bit 0, a @@ -2253,7 +2253,7 @@ Function89dab: ; 89dab (22:5dab) ret .asm_89dc7 call PlayClickSFX - ld a, [wcfa3] + ld a, [w2DMenuNumRows] ld c, a ld a, [wMenuCursorY] cp c @@ -2384,8 +2384,8 @@ Function89e9a: ; 89e9a (22:5e9a) ld a, $5 ld [rSVBK], a ld hl, Palette_89eb1 - ld de, wd028 - ld bc, $8 + ld de, UnknBGPals + 5 palettes + ld bc, 1 palettes call CopyBytes pop af ld [rSVBK], a @@ -3056,7 +3056,7 @@ Function8a31c: ; 8a31c (22:631c) ld [MenuSelection], a call PlaceVerticalMenuItems call InitVerticalMenuCursor - ld hl, wcfa5 + ld hl, w2DMenuFlags1 set 7, [hl] .asm_8a34e call Function8a3a2 @@ -3088,7 +3088,7 @@ Function8a31c: ; 8a31c (22:631c) Function8a383: ; 8a383 (22:6383) callba MobileMenuJoypad ld a, c - ld hl, wcfa8 + ld hl, w2DMenuFlags4 and [hl] ret z bit 0, a diff --git a/misc/mobile_40.asm b/misc/mobile_40.asm index 548c4b1d4..0041d549d 100644 --- a/misc/mobile_40.asm +++ b/misc/mobile_40.asm @@ -820,7 +820,7 @@ Function100513: ; 100513 call Function3f7c call PlaceVerticalMenuItems call InitVerticalMenuCursor - ld hl, wcfa5 + ld hl, w2DMenuFlags1 set 7, [hl] ret ; 100522 @@ -860,7 +860,7 @@ Function100545: ; 100545 Function10054d: ; 10054d callba MobileMenuJoypad ld a, c - ld hl, wcfa8 + ld hl, w2DMenuFlags4 and [hl] ret z call MenuClickSound @@ -1829,16 +1829,16 @@ Function100b45: ; 100b45 call Function100e2d pop bc jr c, .asm_100b6b - ld a, [wcfa8] + ld a, [w2DMenuFlags4] and c jr z, .asm_100b48 callba Mobile_GetMenuSelection ret .asm_100b6b - ld a, [wcfa4] + ld a, [w2DMenuNumCols] ld c, a - ld a, [wcfa3] + ld a, [w2DMenuNumRows] call SimpleMultiply ld [wMenuCursorBuffer], a and a @@ -1854,7 +1854,7 @@ Function100b7a: ; 100b7a call UpdateSprites call ApplyTilemap callba Init2DMenuCursorPosition - ld hl, wcfa5 + ld hl, w2DMenuFlags1 set 7, [hl] ret ; 100b9f @@ -1890,7 +1890,7 @@ Function100bc2: ; 100bc2 call Function100e2d pop bc jr c, .asm_100c25 - ld a, [wcfa8] + ld a, [w2DMenuFlags4] and c bit 6, a jp nz, .asm_100bff @@ -1996,7 +1996,7 @@ Function100c98: ; 100c98 call InitMenu3 ld a, [wNumMoves] inc a - ld [wcfa3], a + ld [w2DMenuNumRows], a ld a, [CurMoveNum] inc a ld [wMenuCursorY], a @@ -2009,7 +2009,7 @@ Unknown_100cad: ; 100cad Function100cb5: ; 100cb5 call Function100dd8 ret c - ld hl, wcfa5 + ld hl, w2DMenuFlags1 set 7, [hl] res 6, [hl] .asm_100cc0 @@ -2021,7 +2021,7 @@ Function100cb5: ; 100cb5 call Function100dfd pop bc jr c, .asm_100d17 - ld a, [wcfa8] + ld a, [w2DMenuFlags4] and c jr z, .asm_100cc0 call PlaceHollowCursor @@ -2063,7 +2063,7 @@ MobileBattleMonMenu: ; 100d22 call Function100dd8 ret c call Function100d67 - ld hl, wcfa5 + ld hl, w2DMenuFlags1 set 7, [hl] res 6, [hl] .asm_100d30 @@ -2075,7 +2075,7 @@ MobileBattleMonMenu: ; 100d22 call Function100dfd pop bc jr c, .asm_100d54 - ld a, [wcfa8] + ld a, [w2DMenuFlags4] and c jr nz, .asm_100d56 jr .asm_100d30 @@ -2111,7 +2111,7 @@ Function100d67: ; 100d67 call WaitBGMap call CopyMenuData2 call InitVerticalMenuCursor - ld hl, wcfa5 + ld hl, w2DMenuFlags1 set 6, [hl] ret ; 100d88 @@ -5722,7 +5722,7 @@ Function1025ff: ; 1025ff callba Function1009f3 ret c callba MobileMenuJoypad - ld a, [wcfa8] + ld a, [w2DMenuFlags4] and c ret z bit 0, c @@ -5784,7 +5784,7 @@ Function10266b: ; 10266b callba Function1009f3 ret c callba MobileMenuJoypad - ld a, [wcfa8] + ld a, [w2DMenuFlags4] and c ret z bit 0, c @@ -6494,7 +6494,7 @@ Function102b4e: ; 102b4e pop af ld [wMenuCursorY], a ld a, [OTPartyCount] - ld [wcfa3], a + ld [w2DMenuNumRows], a ret ; 102b68 @@ -6519,7 +6519,7 @@ Function102b7b: ; 102b7b pop af ld [wMenuCursorY], a ld a, [PartyCount] - ld [wcfa3], a + ld [w2DMenuNumRows], a ret ; 102b94 diff --git a/misc/mobile_41.asm b/misc/mobile_41.asm index cc78c84e7..0f84cbf3c 100755 --- a/misc/mobile_41.asm +++ b/misc/mobile_41.asm @@ -1054,7 +1054,7 @@ Function1064d8: ; 1064d8 jr asm_1064ed asm_1064ed - ld de, wBackupTilemap + ld de, wDecompressScratch ld b, $0 ld a, [rSVBK] push af diff --git a/misc/mobile_45.asm b/misc/mobile_45.asm index c5c18b6fc..9afa520fb 100644 --- a/misc/mobile_45.asm +++ b/misc/mobile_45.asm @@ -5662,7 +5662,7 @@ Function1161d5: ; 1161d5 ld [rSVBK], a ld hl, Unknown_117356 - ld de, wBackupTilemap + ld de, wDecompressScratch ld bc, $0300 call CopyBytes diff --git a/misc/mobile_5b.asm b/misc/mobile_5b.asm index d11e655cf..cc5f3e8ba 100755 --- a/misc/mobile_5b.asm +++ b/misc/mobile_5b.asm @@ -1084,7 +1084,7 @@ Function16d713: ; 16d713 ; 16d725 Function16d725: ; 16d725 - ld hl, wcfa6 + ld hl, w2DMenuFlags2 res 7, [hl] ld a, [hBGMapMode] push af @@ -1102,12 +1102,12 @@ Function16d734: ; 16d734 jr nc, .asm_16d758 callba _2DMenuInterpretJoypad jr c, .asm_16d758 - ld a, [wcfa5] + ld a, [w2DMenuFlags1] bit 7, a jr nz, .asm_16d758 call Function16d713 ld b, a - ld a, [wcfa8] + ld a, [w2DMenuFlags4] and b jr z, .asm_16d734 @@ -1133,7 +1133,7 @@ Function16d76a: ; 16d76a call RTC call Function16d7e7 ret c - ld a, [wcfa5] + ld a, [w2DMenuFlags1] bit 7, a jr z, .asm_16d76a and a @@ -1159,12 +1159,12 @@ Function16d77a: ; 16d77a pop hl .asm_16d792 - ld a, [wcfa1] + ld a, [w2DMenuCursorInitY] ld b, a - ld a, [wcfa2] + ld a, [w2DMenuCursorInitX] ld c, a call Coord2Tile - ld a, [wcfa7] + ld a, [w2DMenuFlags3] swap a and $f ld c, a @@ -1181,7 +1181,7 @@ Function16d77a: ; 16d77a .asm_16d7b1 ld c, $14 call AddNTimes - ld a, [wcfa7] + ld a, [w2DMenuFlags3] and $f ld c, a ld a, [wMenuCursorX] @@ -1219,7 +1219,7 @@ Function16d77a: ; 16d77a ; 16d7e7 Function16d7e7: ; 16d7e7 - ld a, [wcfa5] + ld a, [w2DMenuFlags1] bit 6, a jr z, .asm_16d7f4 callba PlaySpriteAnimationsAndDelayFrame diff --git a/misc/mobile_5c.asm b/misc/mobile_5c.asm index a8a98c49d..321ea9382 100755 --- a/misc/mobile_5c.asm +++ b/misc/mobile_5c.asm @@ -270,7 +270,7 @@ Function170cc6: ; 170cc6 ld a, $6 ld [rSVBK], a ld hl, LZ_170d16 - ld de, wBackupTilemap + ld de, wDecompressScratch call Decompress ld a, $1 ld [rVBK], a diff --git a/misc/printer_77.asm b/misc/printer_77.asm index 72a7ec645..b176e9be9 100755 --- a/misc/printer_77.asm +++ b/misc/printer_77.asm @@ -214,7 +214,7 @@ Function1dc381: ; 1dc381 call Function1dc52c ld hl, TempMonDVs predef GetUnownLetter - ld hl, wc2c6 + ld hl, wBoxAlignment xor a ld [hl], a ld a, [CurPartySpecies] diff --git a/wram.asm b/wram.asm index 19836f0c9..2a4dc2e8a 100644 --- a/wram.asm +++ b/wram.asm @@ -320,7 +320,7 @@ wLZBank:: db ; c2c4 ds 1 -wc2c6:: ds 1 +wBoxAlignment:: ds 1 InputType:: ; c2c7 ds 1 AutoInputAddress:: ; c2c8 @@ -1548,24 +1548,18 @@ wcf9b:: ds 3 wMenuData2_ScrollingMenuFunction3:: wcf9e:: ds 3 wMenuData2End:: + wMenuData3:: -w2DMenuCursorInitY:: -wcfa1:: ds 1 -w2DMenuCursorInitX:: -wcfa2:: ds 1 -w2DMenuNumRows:: -wcfa3:: ds 1 -w2DMenuNumCols:: -wcfa4:: ds 1 -w2DMenuFlags1:: -wcfa5:: ds 1 -w2DMenuFlags2:: -wcfa6:: ds 1 -w2DMenuFlags3:: -wcfa7:: ds 1 -w2DMenuFlags4:: -wcfa8:: ds 1 +w2DMenuCursorInitY:: ds 1 +w2DMenuCursorInitX:: ds 1 +w2DMenuNumRows:: ds 1 +w2DMenuNumCols:: ds 1 +w2DMenuFlags1:: ds 1 +w2DMenuFlags2:: ds 1 +w2DMenuFlags3:: ds 1 +w2DMenuFlags4:: ds 1 wMenuData3End:: + wMenuCursorY:: ds 1 wMenuCursorX:: ds 1 wCursorOffCharacter:: ds 1 @@ -1783,10 +1777,7 @@ wd01a:: ds 3 wMartItem10BCD:: ds 2 wd01f:: ds 1 wMartItemBCDEnd:: -wd020:: ds 3 -wd023:: ds 5 -wd028:: ds 2 -wd02a:: ds 3 + ds 13 wd02d:: ds 1 wd02e:: ds 1 wd02f:: ds 1 @@ -3270,10 +3261,8 @@ w5_dc3e:: ds $c SECTION "WRAM 6", WRAMX, BANK [6] -wBackupTilemap:: ds $20 * SCREEN_HEIGHT - ds $1c0 -wBackupAttrMap:: ds $20 * SCREEN_HEIGHT - ds -$40 +wDecompressScratch:: ds $400 +wBackupAttrMap:: ds $200 w6_d600:: ds $200 w6_d800::