From 5c7d04ac84743d16bff16f0297744eb31d5e9e65 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sat, 23 Jun 2018 21:12:37 -0400 Subject: =?UTF-8?q?Use=20direct=20tile=20IDs,=20not=20charmap=20entries,?= =?UTF-8?q?=20since=20they=20don't=20correspond=20correctly=20(e.g.=20"?= =?UTF-8?q?=E2=94=8C"=20is=20not=20the=20top-right=20corner)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- engine/link/link_2.asm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engine') diff --git a/engine/link/link_2.asm b/engine/link/link_2.asm index e2fe47dc5..3922df404 100644 --- a/engine/link/link_2.asm +++ b/engine/link/link_2.asm @@ -67,22 +67,22 @@ LinkTextbox2: ; 4d35b add hl, de .loop push hl - ld a, "┌" + ld a, $79 ld [hli], a ld a, " " call .PlaceRow - ld [hl], "─" + ld [hl], $7a pop hl ld de, SCREEN_WIDTH add hl, de dec b jr nz, .loop - ld a, "┐" + ld a, $7b ld [hli], a - ld a, "│" + ld a, $7c call .PlaceRow - ld [hl], "└" + ld [hl], $7d ret ; 4d3ab -- cgit v1.2.3 From f6ef0952847e8ee6d2e17da062c899af445087a0 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sat, 23 Jun 2018 22:35:46 -0400 Subject: Add STANDARDMART_* jumptable index constants --- engine/items/mart.asm | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) (limited to 'engine') diff --git a/engine/items/mart.asm b/engine/items/mart.asm index 911251f65..a38cf3fdd 100644 --- a/engine/items/mart.asm +++ b/engine/items/mart.asm @@ -28,7 +28,7 @@ OpenMartDialog:: ; 15a45 MartDialog: ; 15a61 ld a, 0 ld [wEngineBuffer1], a - xor a + xor a ; STANDARDMART_HOWMAYIHELPYOU ld [wEngineBuffer5], a call StandardMart ret @@ -138,17 +138,27 @@ GetMart: ; 15b31 ret ; 15b47 +; StandardMart.MartFunctions indexes + const_def + const STANDARDMART_HOWMAYIHELPYOU ; 0 + const STANDARDMART_TOPMENU ; 1 + const STANDARDMART_BUY ; 2 + const STANDARDMART_SELL ; 3 + const STANDARDMART_QUIT ; 4 + const STANDARDMART_ANYTHINGELSE ; 5 + StandardMart: ; 15b47 .loop ld a, [wEngineBuffer5] ld hl, .MartFunctions rst JumpTable ld [wEngineBuffer5], a - cp $ff + cp -1 jr nz, .loop ret .MartFunctions: +; entries correspond to STANDARDMART_* constants dw .HowMayIHelpYou dw .TopMenu dw .Buy @@ -161,7 +171,7 @@ StandardMart: ; 15b47 call LoadStandardMenuHeader ld hl, Text_Mart_HowMayIHelpYou call PrintText - ld a, $1 ; top menu + ld a, STANDARDMART_TOPMENU ret ; 15b6e @@ -176,13 +186,13 @@ StandardMart: ; 15b47 cp $2 jr z, .sell .quit - ld a, $4 ; Come again! + ld a, STANDARDMART_QUIT ret .buy - ld a, $2 ; buy + ld a, STANDARDMART_BUY ret .sell - ld a, $3 ; sell + ld a, STANDARDMART_SELL ret ; 15b8d @@ -191,14 +201,14 @@ StandardMart: ; 15b47 call FarReadMart call BuyMenu and a - ld a, $5 ; Anything else? + ld a, STANDARDMART_ANYTHINGELSE ret ; 15b9a .Sell: ; 15b9a call ExitMenu call SellMenu - ld a, $5 ; Anything else? + ld a, STANDARDMART_ANYTHINGELSE ret ; 15ba3 @@ -206,7 +216,7 @@ StandardMart: ; 15b47 call ExitMenu ld hl, Text_Mart_ComeAgain call MartTextBox - ld a, $ff ; exit + ld a, -1 ret ; 15baf @@ -214,7 +224,7 @@ StandardMart: ; 15b47 call LoadStandardMenuHeader ld hl, Text_Mart_AnythingElse call PrintText - ld a, $1 ; top menu + ld a, STANDARDMART_TOPMENU ret ; 15bbb @@ -470,7 +480,7 @@ BuyMenuLoop: ; 15cef jr c, .cancel ld de, wMoney ld bc, hMoneyTemp - ld a, $3 ; useless load + ld a, 3 ; useless load call CompareMoney jr c, .insufficient_funds ld hl, wNumItems @@ -478,7 +488,7 @@ BuyMenuLoop: ; 15cef jr nc, .insufficient_bag_space ld a, [wMartItemID] ld e, a - ld d, $0 + ld d, 0 ld b, SET_FLAG ld hl, wBargainShopFlags call FlagAction @@ -537,7 +547,7 @@ BargainShopAskPurchaseQuantity: ld [wItemQuantityChangeBuffer], a ld a, [wMartItemID] ld e, a - ld d, $0 + ld d, 0 ld b, CHECK_FLAG ld hl, wBargainShopFlags call FlagAction @@ -546,7 +556,7 @@ BargainShopAskPurchaseQuantity: jr nz, .SoldOut ld a, [wMartItemID] ld e, a - ld d, $0 + ld d, 0 ld hl, wMartPointer ld a, [hli] ld h, [hl] -- cgit v1.2.3 From a4bf94e1d770cadb9a52b94142fd7eb517e4b1df Mon Sep 17 00:00:00 2001 From: Rangi Date: Sat, 23 Jun 2018 23:15:13 -0400 Subject: wCurMartEnd - wCurMart = 16 --- engine/items/mart.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine') diff --git a/engine/items/mart.asm b/engine/items/mart.asm index a38cf3fdd..159a63a29 100644 --- a/engine/items/mart.asm +++ b/engine/items/mart.asm @@ -110,7 +110,7 @@ LoadMartPointer: ; 15b10 ld [wMartPointer + 1], a ld hl, wCurMart xor a - ld bc, 16 + ld bc, wCurMartEnd - wCurMart call ByteFill xor a ld [wEngineBuffer5], a -- cgit v1.2.3 From 5a58f90ec6221906991fdf7a61aaa3f84513b714 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 24 Jun 2018 11:46:55 -0400 Subject: FISHGROUP_DATA_LENGTH --- engine/events/fish.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine') diff --git a/engine/events/fish.asm b/engine/events/fish.asm index 09de8f2b7..63c48b4ee 100644 --- a/engine/events/fish.asm +++ b/engine/events/fish.asm @@ -11,7 +11,7 @@ Fish: ; 92402 call GetFishGroupIndex ld hl, FishGroups -rept 7 +rept FISHGROUP_DATA_LENGTH add hl, de endr call .Fish -- cgit v1.2.3 From d84aabf3c1dfd71b46ead2114c2e61b8e2327ee3 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 24 Jun 2018 12:30:33 -0400 Subject: WATER_WILDDATA_LENGTH --- engine/overworld/wildmons.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine') diff --git a/engine/overworld/wildmons.asm b/engine/overworld/wildmons.asm index 20375ba6c..53e2d3b38 100644 --- a/engine/overworld/wildmons.asm +++ b/engine/overworld/wildmons.asm @@ -96,7 +96,7 @@ FindNest: ; 2a01f .next_water pop hl - ld bc, 3 * 3 + ld bc, WATER_WILDDATA_LENGTH add hl, bc jr .FindWater ; 2a088 -- cgit v1.2.3 From ee48c7a3ed6f558810acfc2919adfde061669123 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 24 Jun 2018 12:32:56 -0400 Subject: NUM_WATERMON --- engine/overworld/wildmons.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine') diff --git a/engine/overworld/wildmons.asm b/engine/overworld/wildmons.asm index 53e2d3b38..97930f51c 100644 --- a/engine/overworld/wildmons.asm +++ b/engine/overworld/wildmons.asm @@ -88,7 +88,7 @@ FindNest: ; 2a01f ld a, [hli] ld c, a inc hl - ld a, 3 + ld a, NUM_WATERMON call .SearchMapForMon jr nc, .next_water ld [de], a -- cgit v1.2.3 From 1a888f22004aec967d2b6049ede7e04b1815f956 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 24 Jun 2018 13:00:55 -0400 Subject: NUM_GRASSMON * 2 --- engine/overworld/wildmons.asm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engine') diff --git a/engine/overworld/wildmons.asm b/engine/overworld/wildmons.asm index 97930f51c..757ecb017 100644 --- a/engine/overworld/wildmons.asm +++ b/engine/overworld/wildmons.asm @@ -276,7 +276,7 @@ ChooseWildEncounter: ; 2a14f inc hl inc hl ld a, [wTimeOfDay] - ld bc, $e + ld bc, NUM_GRASSMON * 2 call AddNTimes ld de, GrassMonProbTable @@ -675,7 +675,7 @@ UpdateRoamMons: ; 2a30d jr nc, .update_loop ; invalid index, try again inc hl ld c, a - ld b, $0 + ld b, 0 add hl, bc add hl, bc ld a, [wRoamMons_LastMapGroup] @@ -819,7 +819,7 @@ RandomUnseenWildMon: ; 2a4ab jr z, .randloop1 dec a ld c, a - ld b, $0 + ld b, 0 add hl, bc add hl, bc ; We now have the pointer to one of the last (rarest) three wild Pokemon found in that area. @@ -894,7 +894,7 @@ RandomPhoneWildMon: ; 2a51f call Random and %11 ld c, a - ld b, $0 + ld b, 0 add hl, bc add hl, bc inc hl -- cgit v1.2.3 From 9afaed9b8fb93b6413d901f533f51a5298fb43dc Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 24 Jun 2018 21:39:23 -0400 Subject: Remove more address comments --- engine/battle/move_effects/present.asm | 14 +++++++------- engine/gfx/crystal_layouts.asm | 2 +- engine/gfx/player_gfx.asm | 2 +- engine/menus/naming_screen.asm | 2 +- engine/overworld/map_object_action.asm | 2 +- engine/overworld/map_objects.asm | 3 ++- engine/pokemon/bills_pc.asm | 7 +++---- engine/printer/printer_serial.asm | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) (limited to 'engine') diff --git a/engine/battle/move_effects/present.asm b/engine/battle/move_effects/present.asm index 2bbea8028..f0949558f 100644 --- a/engine/battle/move_effects/present.asm +++ b/engine/battle/move_effects/present.asm @@ -32,12 +32,12 @@ BattleCommand_Present: .next ld a, [hli] cp -1 - jr z, .heal_effect ; 378a4 $11 + jr z, .heal_effect cp b - jr nc, .got_power ; 378a7 $4 + jr nc, .got_power inc c inc hl - jr .next ; 378ab $f4 + jr .next .got_power ld a, c @@ -56,12 +56,12 @@ BattleCommand_Present: ld hl, AICheckPlayerMaxHP ld a, [hBattleTurn] and a - jr z, .got_hp_fn_pointer ; 378c9 $3 + jr z, .got_hp_fn_pointer ld hl, AICheckEnemyMaxHP .got_hp_fn_pointer ld a, BANK(AICheckPlayerMaxHP) rst FarCall - jr c, .already_fully_healed ; 378d1 $20 + jr c, .already_fully_healed ld hl, GetQuarterMaxHP call CallBattleCore @@ -73,12 +73,12 @@ BattleCommand_Present: call StdBattleTextBox call BattleCommand_SwitchTurn call UpdateOpponentInParty - jr .do_animation ; 378f1 $11 + jr .do_animation .already_fully_healed call BattleCommand_SwitchTurn call _CheckBattleScene - jr nc, .do_animation ; 378f9 $9 + jr nc, .do_animation call AnimateFailedMove ld hl, RefusedGiftText call StdBattleTextBox diff --git a/engine/gfx/crystal_layouts.asm b/engine/gfx/crystal_layouts.asm index bc7aa3292..b9686701c 100644 --- a/engine/gfx/crystal_layouts.asm +++ b/engine/gfx/crystal_layouts.asm @@ -1,4 +1,4 @@ -GetMysteryGift_MobileAdapterLayout: ; 4930f (mobile) +GetMysteryGift_MobileAdapterLayout: ld a, b cp SCGB_RAM jr nz, .not_ram diff --git a/engine/gfx/player_gfx.asm b/engine/gfx/player_gfx.asm index 04208905a..9954143a8 100644 --- a/engine/gfx/player_gfx.asm +++ b/engine/gfx/player_gfx.asm @@ -72,7 +72,7 @@ ShowPlayerNamingChoices: INCLUDE "data/player_names.asm" -GetPlayerNameArray: ; 88318 This Function is never called +Unreferenced_GetPlayerNameArray: ld hl, wPlayerName ld de, MalePlayerNameArray ld a, [wPlayerGender] diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm index 9d633bb3f..f269e32ad 100644 --- a/engine/menus/naming_screen.asm +++ b/engine/menus/naming_screen.asm @@ -925,7 +925,7 @@ INCBIN "gfx/naming_screen/middle_line.1bpp" NamingScreenGFX_UnderLine: INCBIN "gfx/naming_screen/underline.1bpp" -_ComposeMailMessage: ; 11e75 (mail?) +_ComposeMailMessage: ld hl, wNamingScreenDestinationPointer ld [hl], e inc hl diff --git a/engine/overworld/map_object_action.asm b/engine/overworld/map_object_action.asm index 613e3b099..2c4834a3d 100644 --- a/engine/overworld/map_object_action.asm +++ b/engine/overworld/map_object_action.asm @@ -190,7 +190,7 @@ SetFacingShadow: ld [hl], FACING_SHADOW ret -SetFacingEmote: ; 4582 emote +SetFacingEmote: ld hl, OBJECT_FACING_STEP add hl, bc ld [hl], FACING_EMOTE diff --git a/engine/overworld/map_objects.asm b/engine/overworld/map_objects.asm index 0846f01b1..d0cfd8741 100644 --- a/engine/overworld/map_objects.asm +++ b/engine/overworld/map_objects.asm @@ -2159,7 +2159,8 @@ Function55e0:: jr nz, .loop ret -Function5602: ; 5602, called at battle start +Function5602: +; called at battle start call Function5645 ; clear sprites ld a, PLAYER call Function5629 ; respawn player diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm index d2de035ae..c5904e9b0 100644 --- a/engine/pokemon/bills_pc.asm +++ b/engine/pokemon/bills_pc.asm @@ -226,20 +226,19 @@ BillsPCDepositFuncCancel: ld [wJumptableIndex], a ret -BillsPCDepositMenuHeader: ; 0xe253d (38:653d) +BillsPCDepositMenuHeader: db MENU_BACKUP_TILES ; flags menu_coords 9, 4, SCREEN_WIDTH - 1, 13 dw .MenuData db 1 ; default option -.MenuData: ; 0xe2545 (38:6545) +.MenuData: db STATICMENU_CURSOR ; flags db 4 ; items db "DEPOSIT@" db "STATS@" db "RELEASE@" db "CANCEL@" -; 0xe2564 (38:6564) Unreferenced_BillsPCClearThreeBoxes: hlcoord 0, 0 @@ -405,7 +404,7 @@ BillsPC_Withdraw: ld l, a jp hl -.dw ; e2699 (38:6699) #mark +.dw dw .withdraw ; Withdraw dw .stats ; Stats dw .release ; Release diff --git a/engine/printer/printer_serial.asm b/engine/printer/printer_serial.asm index b7422cac4..e8f106ac4 100644 --- a/engine/printer/printer_serial.asm +++ b/engine/printer/printer_serial.asm @@ -27,7 +27,7 @@ PrinterJumptableIteration: ld l, a jp hl -.Jumptable: ; 84031 (21:4031) +.Jumptable: dw Print_InitPrinterHandshake ; 00 dw Printer_CheckConnectionStatus ; 01 dw Printer_WaitSerial ; 02 -- cgit v1.2.3