diff options
Diffstat (limited to 'engine')
-rw-r--r-- | engine/events/buena.asm | 2 | ||||
-rw-r--r-- | engine/events/elevator.asm | 2 | ||||
-rw-r--r-- | engine/events/kurt.asm | 4 | ||||
-rw-r--r-- | engine/events/pokecenter_pc.asm | 7 | ||||
-rw-r--r-- | engine/items/mart.asm | 2 | ||||
-rw-r--r-- | engine/items/pack.asm | 12 | ||||
-rw-r--r-- | engine/items/switch_items.asm | 28 | ||||
-rw-r--r-- | engine/math/print_num.asm | 2 | ||||
-rw-r--r-- | engine/menus/scrolling_menu.asm | 6 | ||||
-rw-r--r-- | engine/overworld/decorations.asm | 2 | ||||
-rw-r--r-- | engine/overworld/player_step.asm | 28 | ||||
-rw-r--r-- | engine/pokedex/pokedex_2.asm | 9 | ||||
-rw-r--r-- | engine/pokegear/pokegear.asm | 8 | ||||
-rw-r--r-- | engine/pokemon/bills_pc.asm | 20 | ||||
-rw-r--r-- | engine/pokemon/mail.asm | 4 |
15 files changed, 71 insertions, 65 deletions
diff --git a/engine/events/buena.asm b/engine/events/buena.asm index 97a28549b..3e78dfa91 100644 --- a/engine/events/buena.asm +++ b/engine/events/buena.asm @@ -263,7 +263,7 @@ Buena_PrizeMenu: .MenuData: db SCROLLINGMENU_DISPLAY_ARROWS ; flags db 4, 13 ; rows, columns - db 1 ; spacing + db SCROLLINGMENU_ITEMS_NORMAL ; item format dba .indices dba .prizeitem dba .prizepoints diff --git a/engine/events/elevator.asm b/engine/events/elevator.asm index 37de3f1b6..8394cf442 100644 --- a/engine/events/elevator.asm +++ b/engine/events/elevator.asm @@ -184,7 +184,7 @@ Elevator_MenuHeader: Elevator_MenuData: db SCROLLINGMENU_DISPLAY_ARROWS ; flags db 4, 0 ; rows, columns - db 1 ; horizontal spacing + db SCROLLINGMENU_ITEMS_NORMAL ; item format dbw 0, wCurElevator dba GetElevatorFloorStrings dba NULL diff --git a/engine/events/kurt.asm b/engine/events/kurt.asm index 234e5f424..3dd700dbb 100644 --- a/engine/events/kurt.asm +++ b/engine/events/kurt.asm @@ -87,8 +87,8 @@ Kurt_SelectApricorn: .MenuData: db SCROLLINGMENU_DISPLAY_ARROWS ; flags - db 4, 7 - db 1 + db 4, 7 ; rows, columns + db SCROLLINGMENU_ITEMS_NORMAL ; item format dbw 0, wBuffer1 dba .Name dba .Quantity diff --git a/engine/events/pokecenter_pc.asm b/engine/events/pokecenter_pc.asm index b899f9323..fa06d971e 100644 --- a/engine/events/pokecenter_pc.asm +++ b/engine/events/pokecenter_pc.asm @@ -236,8 +236,7 @@ Function15715: PlayersPCMenuData: db MENU_BACKUP_TILES ; flags - db 0, 0 ; top left corner coords (y, x) - db 12, 15 ; bottom right corner coords (y, x) + menu_coords 0, 0, 15, 12 dw .PlayersPCMenuData db 1 ; default selected option @@ -626,8 +625,8 @@ PCItemsJoypad: .MenuData: db SCROLLINGMENU_ENABLE_SELECT | SCROLLINGMENU_ENABLE_FUNCTION3 | SCROLLINGMENU_DISPLAY_ARROWS ; flags - db 4, 8 ; rows/cols? - db 2 ; horizontal spacing? + db 4, 8 ; rows, columns + db SCROLLINGMENU_ITEMS_QUANTITY ; item format dbw 0, wNumPCItems dba PlaceMenuItemName dba PlaceMenuItemQuantity diff --git a/engine/items/mart.asm b/engine/items/mart.asm index 6341e9e6e..0209aac23 100644 --- a/engine/items/mart.asm +++ b/engine/items/mart.asm @@ -600,7 +600,7 @@ MenuHeader_Buy: .MenuData db SCROLLINGMENU_DISPLAY_ARROWS | SCROLLINGMENU_ENABLE_FUNCTION3 ; flags db 4, 8 ; rows, columns - db 1 ; horizontal spacing + db SCROLLINGMENU_ITEMS_NORMAL ; item format dbw 0, wCurMart dba PlaceMenuItemName dba .PrintBCDPrices diff --git a/engine/items/pack.asm b/engine/items/pack.asm index 268a013bc..d5d331720 100644 --- a/engine/items/pack.asm +++ b/engine/items/pack.asm @@ -1465,7 +1465,7 @@ ItemsPocketMenuHeader: .MenuData: db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags db 5, 8 ; rows, columns - db 2 ; horizontal spacing + db SCROLLINGMENU_ITEMS_QUANTITY ; item format dbw 0, wNumItems dba PlaceMenuItemName dba PlaceMenuItemQuantity @@ -1480,7 +1480,7 @@ PC_Mart_ItemsPocketMenuHeader: .MenuData: db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags db 5, 8 ; rows, columns - db 2 ; horizontal spacing + db SCROLLINGMENU_ITEMS_QUANTITY ; item format dbw 0, wNumItems dba PlaceMenuItemName dba PlaceMenuItemQuantity @@ -1495,7 +1495,7 @@ KeyItemsPocketMenuHeader: .MenuData: db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags db 5, 8 ; rows, columns - db 1 ; horizontal spacing + db SCROLLINGMENU_ITEMS_NORMAL ; item format dbw 0, wNumKeyItems dba PlaceMenuItemName dba PlaceMenuItemQuantity @@ -1510,7 +1510,7 @@ PC_Mart_KeyItemsPocketMenuHeader: .MenuData: db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags db 5, 8 ; rows, columns - db 1 ; horizontal spacing + db SCROLLINGMENU_ITEMS_NORMAL ; item format dbw 0, wNumKeyItems dba PlaceMenuItemName dba PlaceMenuItemQuantity @@ -1525,7 +1525,7 @@ BallsPocketMenuHeader: .MenuData: db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags db 5, 8 ; rows, columns - db 2 ; horizontal spacing + db SCROLLINGMENU_ITEMS_QUANTITY ; item format dbw 0, wNumBalls dba PlaceMenuItemName dba PlaceMenuItemQuantity @@ -1540,7 +1540,7 @@ PC_Mart_BallsPocketMenuHeader: .MenuData: db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags db 5, 8 ; rows, columns - db 2 ; horizontal spacing + db SCROLLINGMENU_ITEMS_QUANTITY ; item format dbw 0, wNumBalls dba PlaceMenuItemName dba PlaceMenuItemQuantity diff --git a/engine/items/switch_items.asm b/engine/items/switch_items.asm index 81b5ac6a5..10fe535b3 100644 --- a/engine/items/switch_items.asm +++ b/engine/items/switch_items.asm @@ -48,7 +48,7 @@ SwitchItemsInBag: call ItemSwitch_GetNthItem dec hl push hl - call ItemSwitch_ConvertSpacingToDW + call ItemSwitch_ConvertItemFormatToDW add hl, bc ld d, h ld e, l @@ -74,7 +74,7 @@ SwitchItemsInBag: call ItemSwitch_GetNthItem ld d, h ld e, l - call ItemSwitch_ConvertSpacingToDW + call ItemSwitch_ConvertItemFormatToDW add hl, bc pop bc call CopyBytes @@ -162,7 +162,7 @@ Function249d1: .asm_24a25 dec [hl] - call ItemSwitch_ConvertSpacingToDW + call ItemSwitch_ConvertItemFormatToDW push bc ld a, [wSwitchItem] call ItemSwitch_GetNthItem @@ -183,7 +183,7 @@ Function249d1: Function24a40: call ItemSwitch_GetNthItem ld de, wd002 - call ItemSwitch_ConvertSpacingToDW + call ItemSwitch_ConvertItemFormatToDW call CopyBytes ret @@ -192,13 +192,13 @@ Function24a4d: ld d, h ld e, l ld hl, wd002 - call ItemSwitch_ConvertSpacingToDW + call ItemSwitch_ConvertItemFormatToDW call CopyBytes ret ItemSwitch_GetNthItem: push af - call ItemSwitch_ConvertSpacingToDW + call ItemSwitch_ConvertItemFormatToDW ld hl, wMenuData_ItemsPointerAddr ld a, [hli] ld h, [hl] @@ -210,7 +210,7 @@ ItemSwitch_GetNthItem: Function24a6c: push hl - call ItemSwitch_ConvertSpacingToDW + call ItemSwitch_ConvertItemFormatToDW ld a, d sub e jr nc, .dont_negate @@ -224,13 +224,13 @@ Function24a6c: pop hl ret -ItemSwitch_ConvertSpacingToDW: +ItemSwitch_ConvertItemFormatToDW: ; This function is absolutely idiotic. push hl - ld a, [wMenuData_ScrollingMenuSpacing] + ld a, [wMenuData_ScrollingMenuItemFormat] ld c, a ld b, 0 - ld hl, .spacing_dws + ld hl, .format_dws add hl, bc add hl, bc ld c, [hl] @@ -239,12 +239,14 @@ ItemSwitch_ConvertSpacingToDW: pop hl ret -.spacing_dws - dw 0, 1, 2 +.format_dws + dw 0 + dw 1 + dw 2 Function24a97: push af - call ItemSwitch_ConvertSpacingToDW + call ItemSwitch_ConvertItemFormatToDW ld a, c cp 2 jr nz, .not_2 diff --git a/engine/math/print_num.asm b/engine/math/print_num.asm index fce3c9027..62ef97fb3 100644 --- a/engine/math/print_num.asm +++ b/engine/math/print_num.asm @@ -2,6 +2,8 @@ _PrintNum:: ; Print c digits of the b-byte value from de to hl. ; Allows 2 to 7 digits. For 1-digit numbers, add ; the value to char "0" instead of calling PrintNum. +; The high nybble of the c register specifies how many of the total amount of +; digits will be in front of the decimal point. ; Some extra flags can be given in bits 5-7 of b. ; Bit 5: money if set (unless left-aligned without leading zeros) ; Bit 6: right-aligned if set diff --git a/engine/menus/scrolling_menu.asm b/engine/menus/scrolling_menu.asm index e47d656bc..b26442dc7 100644 --- a/engine/menus/scrolling_menu.asm +++ b/engine/menus/scrolling_menu.asm @@ -497,10 +497,10 @@ ScrollingMenu_GetListItemCoordAndFunctionArgs: ld h, [hl] ld l, a inc hl ; items - ld a, [wMenuData_ScrollingMenuSpacing] - cp 1 + ld a, [wMenuData_ScrollingMenuItemFormat] + cp SCROLLINGMENU_ITEMS_NORMAL jr z, .got_spacing - cp 2 + cp SCROLLINGMENU_ITEMS_QUANTITY jr z, .pointless_jump .pointless_jump add hl, de diff --git a/engine/overworld/decorations.asm b/engine/overworld/decorations.asm index c601b65c3..3b40641f3 100644 --- a/engine/overworld/decorations.asm +++ b/engine/overworld/decorations.asm @@ -409,7 +409,7 @@ PopulateDecoCategoryMenu: .ScrollingMenuData: db SCROLLINGMENU_DISPLAY_ARROWS ; flags db 8, 0 ; rows, columns - db 1 ; horizontal spacing + db SCROLLINGMENU_ITEMS_NORMAL ; item format dbw 0, wd002 ; text pointer dba DecorationMenuFunction dbw 0, 0 diff --git a/engine/overworld/player_step.asm b/engine/overworld/player_step.asm index eb1e88cf4..b035face1 100644 --- a/engine/overworld/player_step.asm +++ b/engine/overworld/player_step.asm @@ -126,25 +126,25 @@ UpdateOverworldMap: .step_down call .ScrollOverworldMapDown call LoadMapPart - call ScrollMapUp + call ScrollMapDown ret .step_up call .ScrollOverworldMapUp call LoadMapPart - call ScrollMapDown + call ScrollMapUp ret .step_left call .ScrollOverworldMapLeft call LoadMapPart - call ScrollMapRight + call ScrollMapLeft ret .step_right call .ScrollOverworldMapRight call LoadMapPart - call ScrollMapLeft + call ScrollMapRight ret .ScrollOverworldMapDown: @@ -164,14 +164,14 @@ UpdateOverworldMap: cp 2 ; was 1 jr nz, .done_down ld [hl], 0 - call .Add6ToOverworldMapAnchor + call .ScrollMapDataDown .done_down ret -.Add6ToOverworldMapAnchor: +.ScrollMapDataDown: ld hl, wOverworldMapAnchor ld a, [wMapWidth] - add 6 + add 3 * 2 ; surrounding tiles add [hl] ld [hli], a ret nc @@ -195,14 +195,14 @@ UpdateOverworldMap: cp -1 ; was 0 jr nz, .done_up ld [hl], $1 - call .Sub6FromOverworldMapAnchor + call .ScrollMapDataUp .done_up ret -.Sub6FromOverworldMapAnchor: +.ScrollMapDataUp: ld hl, wOverworldMapAnchor ld a, [wMapWidth] - add 6 + add 3 * 2 ; surrounding tiles ld b, a ld a, [hl] sub b @@ -227,11 +227,11 @@ UpdateOverworldMap: cp -1 jr nz, .done_left ld [hl], 1 - call .DecrementwOverworldMapAnchor + call .ScrollMapDataLeft .done_left ret -.DecrementwOverworldMapAnchor: +.ScrollMapDataLeft: ld hl, wOverworldMapAnchor ld a, [hl] sub 1 @@ -256,11 +256,11 @@ UpdateOverworldMap: cp 2 jr nz, .done_right ld [hl], 0 - call .IncrementwOverworldMapAnchor + call .ScrollMapDataRight .done_right ret -.IncrementwOverworldMapAnchor: +.ScrollMapDataRight: ld hl, wOverworldMapAnchor ld a, [hl] add 1 diff --git a/engine/pokedex/pokedex_2.asm b/engine/pokedex/pokedex_2.asm index 62e7e853b..ac47bd484 100644 --- a/engine/pokedex/pokedex_2.asm +++ b/engine/pokedex/pokedex_2.asm @@ -124,14 +124,16 @@ DisplayDexEntry: jr z, .skip_height push hl push de +; Print the height, with two of the four digits in front of the decimal point ld hl, sp+$0 ld d, h ld e, l hlcoord 12, 7 - lb bc, 2, PRINTNUM_MONEY | 4 + lb bc, 2, (2 << 4) | 4 call PrintNum +; Replace the decimal point with a ft symbol hlcoord 14, 7 - ld [hl], $5e ; ft symbol + ld [hl], $5e pop af pop hl @@ -148,11 +150,12 @@ DisplayDexEntry: or d jr z, .skip_weight push de +; Print the weight, with four of the five digits in front of the decimal point ld hl, sp+$0 ld d, h ld e, l hlcoord 11, 9 - lb bc, 2, PRINTNUM_RIGHTALIGN | 5 + lb bc, 2, (4 << 4) | 5 call PrintNum pop de diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm index 13b561d4b..d0e7e8ca0 100644 --- a/engine/pokegear/pokegear.asm +++ b/engine/pokegear/pokegear.asm @@ -335,7 +335,7 @@ InitPokegearTilemap: .ok farcall PokegearMap ld a, $07 - ld bc, $12 + ld bc, SCREEN_WIDTH - 2 hlcoord 1, 2 call ByteFill hlcoord 0, 2 @@ -2165,7 +2165,7 @@ TownMapBubble: hlcoord 1, 1 ; Middle row - ld bc, 18 + ld bc, SCREEN_WIDTH - 2 ld a, " " call ByteFill @@ -2481,10 +2481,10 @@ Pokedex_GetArea: ld a, " " call ByteFill hlcoord 0, 1 - ld a, $6 + ld a, $06 ld [hli], a ld bc, SCREEN_WIDTH - 2 - ld a, $7 + ld a, $07 call ByteFill ld [hl], $17 call GetPokemonName diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm index b63e481f6..162c94887 100644 --- a/engine/pokemon/bills_pc.asm +++ b/engine/pokemon/bills_pc.asm @@ -241,16 +241,16 @@ BillsPCDepositMenuHeader: Unreferenced_BillsPCClearThreeBoxes: hlcoord 0, 0 - ld b, 4 - ld c, 8 + ld b, 4 + ld c, 8 call ClearBox hlcoord 0, 4 ld b, 10 - ld c, 9 + ld c, 9 call ClearBox hlcoord 0, 14 - ld b, 2 - ld c, 8 + ld b, 2 + ld c, 8 call ClearBox ret @@ -1854,7 +1854,7 @@ TryWithdrawPokemon: ld h, b ld de, wStringBuffer1 call PlaceString - ld a, $e7 + ld a, "!" ld [bc], a ld c, 50 call DelayFrames @@ -1913,7 +1913,7 @@ ReleasePKMN_ByePKMN: call PlaceString ld l, c ld h, b - ld [hl], $e7 + ld [hl], "!" ld c, 50 call DelayFrames ret @@ -2269,9 +2269,9 @@ _ChangeBox_MenuHeader: db 1 ; default option .MenuData - db MENU_UNUSED_1 | MENU_UNUSED_3 ; flags - db 4, 0 - db 1 + db SCROLLINGMENU_CALL_FUNCTION3_NO_SWITCH | SCROLLINGMENU_ENABLE_FUNCTION3 ; flags + db 4, 0 ; rows, columns + db SCROLLINGMENU_ITEMS_NORMAL ; item format dba .boxes dba .boxnames dba NULL diff --git a/engine/pokemon/mail.asm b/engine/pokemon/mail.asm index 04c9a98e2..f89a51944 100644 --- a/engine/pokemon/mail.asm +++ b/engine/pokemon/mail.asm @@ -543,8 +543,8 @@ MailboxPC: .TopMenuData: db SCROLLINGMENU_DISPLAY_ARROWS ; flags - db 4, 0 ; rows/columns? - db 1 ; horizontal spacing? + db 4, 0 ; rows, columns + db SCROLLINGMENU_ITEMS_NORMAL ; item format dbw 0, wMailboxCount ; text pointer dba MailboxPC_PrintMailAuthor dba NULL |