Merge pull request #638 from mid-kid/master

beep boop
This commit is contained in:
Rangi 2019-06-17 07:29:30 -04:00 committed by GitHub
commit f1bab45624
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 168 additions and 90 deletions

View File

@ -181,6 +181,7 @@ gfx/title/logo.2bpp: rgbgfx += -x 4
gfx/trade/ball.2bpp: tools/gfx += --remove-whitespace gfx/trade/ball.2bpp: tools/gfx += --remove-whitespace
gfx/trade/game_boy_n64.2bpp: tools/gfx += --trim-whitespace gfx/trade/game_boy_n64.2bpp: tools/gfx += --trim-whitespace
gfx/slots/slots_1.2bpp: tools/gfx += --trim-whitespace
gfx/slots/slots_2.2bpp: tools/gfx += --interleave --png=$< gfx/slots/slots_2.2bpp: tools/gfx += --interleave --png=$<
gfx/slots/slots_3.2bpp: tools/gfx += --interleave --png=$< --remove-duplicates --keep-whitespace --remove-xflip gfx/slots/slots_3.2bpp: tools/gfx += --interleave --png=$< --remove-duplicates --keep-whitespace --remove-xflip

View File

@ -32,6 +32,11 @@
shift_const SCROLLINGMENU_ENABLE_START shift_const SCROLLINGMENU_ENABLE_START
shift_const SCROLLINGMENU_ENABLE_SELECT shift_const SCROLLINGMENU_ENABLE_SELECT
; ScrollingMenu items structure format
const_def 1
const SCROLLINGMENU_ITEMS_NORMAL
const SCROLLINGMENU_ITEMS_QUANTITY
; MonMenuOptions indexes (see data/mon_menu.asm) ; MonMenuOptions indexes (see data/mon_menu.asm)
; used by PokemonActionSubmenu (see engine/pokemon/mon_menu.asm) ; used by PokemonActionSubmenu (see engine/pokemon/mon_menu.asm)
const_def 1 const_def 1

View File

@ -414,9 +414,8 @@ BecameConfusedText:
text "<TARGET>" text "<TARGET>"
line "became confused!" line "became confused!"
prompt prompt
; ItemHealedConfusion
BattleText_ItemHealedConfusion: ; ItemHealedConfusion BattleText_ItemHealedConfusion:
text "A @" text "A @"
text_ram wStringBuffer1 text_ram wStringBuffer1
text " rid" text " rid"

View File

@ -815,7 +815,7 @@ UnknownText_0x1c0df3::
UnknownText_0x1c0e24:: UnknownText_0x1c0e24::
text "It's @" text "It's @"
text_ram wBreedMon1 text_ram wBreedMon1Nick
text_start text_start
line "that was left with" line "that was left with"
cont "the DAY-CARE MAN." cont "the DAY-CARE MAN."

View File

@ -55,6 +55,7 @@ Some fixes are mentioned as breaking compatibility with link battles. This can b
- [No bump noise if standing on tile `$3E`](#no-bump-noise-if-standing-on-tile-3e) - [No bump noise if standing on tile `$3E`](#no-bump-noise-if-standing-on-tile-3e)
- [Playing Entei's Pokédex cry can distort Raikou's and Suicune's](#playing-enteis-pokédex-cry-can-distort-raikous-and-suicunes) - [Playing Entei's Pokédex cry can distort Raikou's and Suicune's](#playing-enteis-pokédex-cry-can-distort-raikous-and-suicunes)
- [In-battle “`…`” ellipsis is too high](#in-battle--ellipsis-is-too-high) - [In-battle “`…`” ellipsis is too high](#in-battle--ellipsis-is-too-high)
- [Move selection menu doesn't handle joypad properly](#move-selection-menu-doesnt-handle-joypad-properly)
- [Two tiles in the `port` tileset are drawn incorrectly](#two-tiles-in-the-port-tileset-are-drawn-incorrectly) - [Two tiles in the `port` tileset are drawn incorrectly](#two-tiles-in-the-port-tileset-are-drawn-incorrectly)
- [`LoadMetatiles` wraps around past 128 blocks](#loadmetatiles-wraps-around-past-128-blocks) - [`LoadMetatiles` wraps around past 128 blocks](#loadmetatiles-wraps-around-past-128-blocks)
- [Surfing directly across a map connection does not load the new map](#surfing-directly-across-a-map-connection-does-not-load-the-new-map) - [Surfing directly across a map connection does not load the new map](#surfing-directly-across-a-map-connection-does-not-load-the-new-map)
@ -915,7 +916,7 @@ This can bring Pokémon straight from level 1 to 100 by gaining just a few exper
+ +
+.UnsetClairScene: +.UnsetClairScene:
+ setmapscene DRAGONS_DEN_B1F, SCENE_DRAGONSDENB1F_NOTHING + setmapscene DRAGONS_DEN_B1F, SCENE_DRAGONSDENB1F_NOTHING
+ end + return
``` ```
@ -1334,6 +1335,62 @@ This is a mistake with the “`…`” tile in [gfx/battle/hp_exp_bar_border.png
![image](https://raw.githubusercontent.com/pret/pokecrystal/master/docs/images/hp_exp_bar_border.png) ![image](https://raw.githubusercontent.com/pret/pokecrystal/master/docs/images/hp_exp_bar_border.png)
## Move selection menu doesn't handle joypad properly
([Video](https://www.youtube.com/watch?v=vjFUo6Jr4po&t=438))
`hInMenu` isn't defined in the menu that handles selecting moves in a battle. Because of this, your cursor is usually rendered unable to keep scrolling when one of the directional keys is being held. It's up for debate whether this behavior was intentional or not, but this value should be defined when in the move selection menu. A value of 1 will allow it to keep scrolling, though it's usually 0 by default.
There exists one way in which this behaviour would be temporarily changed in-game, and that's when the credits sequence is triggered, `hInMenu` will be set but never unset. This can be fixed with the following:
**Fix:** Edit `Credits` in [engine/movie/credits.asm](https://github.com/pret/pokecrystal/blob/master/engine/movie/credits.asm):
```diff
ldh a, [hVBlank]
push af
ld a, $5
ldh [hVBlank], a
+ ldh a, [hInMenu]
+ push af
ld a, $1
ldh [hInMenu], a
...
ldh [hLCDCPointer], a
ldh [hBGMapAddress], a
+ pop af
+ ldh [hInMenu], a
pop af
ldh [hVBlank], a
pop af
ldh [rSVBK], a
```
If you want to make sure `hInMenu` always has a defined value in the move selection menu, the following code will set it to 1:
**Fix:** Edit `BattleTurn` in [engine/battle/core.asm](https://github.com/pret/pokecrystal/blob/master/engine/battle/core.asm):
```diff
BattleTurn:
+ ldh a, [hInMenu]
+ push af
+ ld a, 1
+ ldh [hInMenu], a
+
.loop
...
jp .loop
.quit
+ pop af
+ ldh [hInMenu], a
ret
```
## Two tiles in the `port` tileset are drawn incorrectly ## Two tiles in the `port` tileset are drawn incorrectly
This is a mistake with the left-hand warp carpet corner tiles in [gfx/tilesets/port.png](https://github.com/pret/pokecrystal/blob/master/gfx/tilesets/port.png): This is a mistake with the left-hand warp carpet corner tiles in [gfx/tilesets/port.png](https://github.com/pret/pokecrystal/blob/master/gfx/tilesets/port.png):

View File

@ -26,7 +26,7 @@ Structure:
.MenuData: .MenuData:
db 0 ; flags db 0 ; flags
db 5, 0 ; rows, columns db 5, 0 ; rows, columns
db 1 ; horizontal spacing db SCROLLINGMENU_ITEMS_NORMAL ; item format
dba Items dba Items
dba Function1 dba Function1
dba Function2 dba Function2
@ -66,9 +66,9 @@ Function3: Called to display anything else, whenever the cursor is moved.
There is no register of importance that should be preserved in any of these functions. There is no register of importance that should be preserved in any of these functions.
The `; horizontal spacing` item in each `MenuData` is a misnomer. It changes how the `Items` struct looks. The `; item format` entry in each `MenuData` changes how the `Items` struct looks.
If it's 1: If it's `SCROLLINGMENU_ITEMS_NORMAL` (1):
``` ```
db entries not including cancel db entries not including cancel
@ -78,7 +78,7 @@ db -1 ; cancel
... ...
``` ```
If it's 2: If it's `SCROLLINGMENU_ITEMS_QUANTITY` (2):
``` ```
db entries not including cancel db entries not including cancel

View File

@ -263,7 +263,7 @@ Buena_PrizeMenu:
.MenuData: .MenuData:
db SCROLLINGMENU_DISPLAY_ARROWS ; flags db SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 4, 13 ; rows, columns db 4, 13 ; rows, columns
db 1 ; spacing db SCROLLINGMENU_ITEMS_NORMAL ; item format
dba .indices dba .indices
dba .prizeitem dba .prizeitem
dba .prizepoints dba .prizepoints

View File

@ -184,7 +184,7 @@ Elevator_MenuHeader:
Elevator_MenuData: Elevator_MenuData:
db SCROLLINGMENU_DISPLAY_ARROWS ; flags db SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 4, 0 ; rows, columns db 4, 0 ; rows, columns
db 1 ; horizontal spacing db SCROLLINGMENU_ITEMS_NORMAL ; item format
dbw 0, wCurElevator dbw 0, wCurElevator
dba GetElevatorFloorStrings dba GetElevatorFloorStrings
dba NULL dba NULL

View File

@ -87,8 +87,8 @@ Kurt_SelectApricorn:
.MenuData: .MenuData:
db SCROLLINGMENU_DISPLAY_ARROWS ; flags db SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 4, 7 db 4, 7 ; rows, columns
db 1 db SCROLLINGMENU_ITEMS_NORMAL ; item format
dbw 0, wBuffer1 dbw 0, wBuffer1
dba .Name dba .Name
dba .Quantity dba .Quantity

View File

@ -236,8 +236,7 @@ Function15715:
PlayersPCMenuData: PlayersPCMenuData:
db MENU_BACKUP_TILES ; flags db MENU_BACKUP_TILES ; flags
db 0, 0 ; top left corner coords (y, x) menu_coords 0, 0, 15, 12
db 12, 15 ; bottom right corner coords (y, x)
dw .PlayersPCMenuData dw .PlayersPCMenuData
db 1 ; default selected option db 1 ; default selected option
@ -626,8 +625,8 @@ PCItemsJoypad:
.MenuData: .MenuData:
db SCROLLINGMENU_ENABLE_SELECT | SCROLLINGMENU_ENABLE_FUNCTION3 | SCROLLINGMENU_DISPLAY_ARROWS ; flags db SCROLLINGMENU_ENABLE_SELECT | SCROLLINGMENU_ENABLE_FUNCTION3 | SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 4, 8 ; rows/cols? db 4, 8 ; rows, columns
db 2 ; horizontal spacing? db SCROLLINGMENU_ITEMS_QUANTITY ; item format
dbw 0, wNumPCItems dbw 0, wNumPCItems
dba PlaceMenuItemName dba PlaceMenuItemName
dba PlaceMenuItemQuantity dba PlaceMenuItemQuantity

View File

@ -600,7 +600,7 @@ MenuHeader_Buy:
.MenuData .MenuData
db SCROLLINGMENU_DISPLAY_ARROWS | SCROLLINGMENU_ENABLE_FUNCTION3 ; flags db SCROLLINGMENU_DISPLAY_ARROWS | SCROLLINGMENU_ENABLE_FUNCTION3 ; flags
db 4, 8 ; rows, columns db 4, 8 ; rows, columns
db 1 ; horizontal spacing db SCROLLINGMENU_ITEMS_NORMAL ; item format
dbw 0, wCurMart dbw 0, wCurMart
dba PlaceMenuItemName dba PlaceMenuItemName
dba .PrintBCDPrices dba .PrintBCDPrices

View File

@ -1465,7 +1465,7 @@ ItemsPocketMenuHeader:
.MenuData: .MenuData:
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags
db 5, 8 ; rows, columns db 5, 8 ; rows, columns
db 2 ; horizontal spacing db SCROLLINGMENU_ITEMS_QUANTITY ; item format
dbw 0, wNumItems dbw 0, wNumItems
dba PlaceMenuItemName dba PlaceMenuItemName
dba PlaceMenuItemQuantity dba PlaceMenuItemQuantity
@ -1480,7 +1480,7 @@ PC_Mart_ItemsPocketMenuHeader:
.MenuData: .MenuData:
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags
db 5, 8 ; rows, columns db 5, 8 ; rows, columns
db 2 ; horizontal spacing db SCROLLINGMENU_ITEMS_QUANTITY ; item format
dbw 0, wNumItems dbw 0, wNumItems
dba PlaceMenuItemName dba PlaceMenuItemName
dba PlaceMenuItemQuantity dba PlaceMenuItemQuantity
@ -1495,7 +1495,7 @@ KeyItemsPocketMenuHeader:
.MenuData: .MenuData:
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags
db 5, 8 ; rows, columns db 5, 8 ; rows, columns
db 1 ; horizontal spacing db SCROLLINGMENU_ITEMS_NORMAL ; item format
dbw 0, wNumKeyItems dbw 0, wNumKeyItems
dba PlaceMenuItemName dba PlaceMenuItemName
dba PlaceMenuItemQuantity dba PlaceMenuItemQuantity
@ -1510,7 +1510,7 @@ PC_Mart_KeyItemsPocketMenuHeader:
.MenuData: .MenuData:
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags
db 5, 8 ; rows, columns db 5, 8 ; rows, columns
db 1 ; horizontal spacing db SCROLLINGMENU_ITEMS_NORMAL ; item format
dbw 0, wNumKeyItems dbw 0, wNumKeyItems
dba PlaceMenuItemName dba PlaceMenuItemName
dba PlaceMenuItemQuantity dba PlaceMenuItemQuantity
@ -1525,7 +1525,7 @@ BallsPocketMenuHeader:
.MenuData: .MenuData:
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags
db 5, 8 ; rows, columns db 5, 8 ; rows, columns
db 2 ; horizontal spacing db SCROLLINGMENU_ITEMS_QUANTITY ; item format
dbw 0, wNumBalls dbw 0, wNumBalls
dba PlaceMenuItemName dba PlaceMenuItemName
dba PlaceMenuItemQuantity dba PlaceMenuItemQuantity
@ -1540,7 +1540,7 @@ PC_Mart_BallsPocketMenuHeader:
.MenuData: .MenuData:
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags
db 5, 8 ; rows, columns db 5, 8 ; rows, columns
db 2 ; horizontal spacing db SCROLLINGMENU_ITEMS_QUANTITY ; item format
dbw 0, wNumBalls dbw 0, wNumBalls
dba PlaceMenuItemName dba PlaceMenuItemName
dba PlaceMenuItemQuantity dba PlaceMenuItemQuantity

View File

@ -48,7 +48,7 @@ SwitchItemsInBag:
call ItemSwitch_GetNthItem call ItemSwitch_GetNthItem
dec hl dec hl
push hl push hl
call ItemSwitch_ConvertSpacingToDW call ItemSwitch_ConvertItemFormatToDW
add hl, bc add hl, bc
ld d, h ld d, h
ld e, l ld e, l
@ -74,7 +74,7 @@ SwitchItemsInBag:
call ItemSwitch_GetNthItem call ItemSwitch_GetNthItem
ld d, h ld d, h
ld e, l ld e, l
call ItemSwitch_ConvertSpacingToDW call ItemSwitch_ConvertItemFormatToDW
add hl, bc add hl, bc
pop bc pop bc
call CopyBytes call CopyBytes
@ -162,7 +162,7 @@ Function249d1:
.asm_24a25 .asm_24a25
dec [hl] dec [hl]
call ItemSwitch_ConvertSpacingToDW call ItemSwitch_ConvertItemFormatToDW
push bc push bc
ld a, [wSwitchItem] ld a, [wSwitchItem]
call ItemSwitch_GetNthItem call ItemSwitch_GetNthItem
@ -183,7 +183,7 @@ Function249d1:
Function24a40: Function24a40:
call ItemSwitch_GetNthItem call ItemSwitch_GetNthItem
ld de, wd002 ld de, wd002
call ItemSwitch_ConvertSpacingToDW call ItemSwitch_ConvertItemFormatToDW
call CopyBytes call CopyBytes
ret ret
@ -192,13 +192,13 @@ Function24a4d:
ld d, h ld d, h
ld e, l ld e, l
ld hl, wd002 ld hl, wd002
call ItemSwitch_ConvertSpacingToDW call ItemSwitch_ConvertItemFormatToDW
call CopyBytes call CopyBytes
ret ret
ItemSwitch_GetNthItem: ItemSwitch_GetNthItem:
push af push af
call ItemSwitch_ConvertSpacingToDW call ItemSwitch_ConvertItemFormatToDW
ld hl, wMenuData_ItemsPointerAddr ld hl, wMenuData_ItemsPointerAddr
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
@ -210,7 +210,7 @@ ItemSwitch_GetNthItem:
Function24a6c: Function24a6c:
push hl push hl
call ItemSwitch_ConvertSpacingToDW call ItemSwitch_ConvertItemFormatToDW
ld a, d ld a, d
sub e sub e
jr nc, .dont_negate jr nc, .dont_negate
@ -224,13 +224,13 @@ Function24a6c:
pop hl pop hl
ret ret
ItemSwitch_ConvertSpacingToDW: ItemSwitch_ConvertItemFormatToDW:
; This function is absolutely idiotic. ; This function is absolutely idiotic.
push hl push hl
ld a, [wMenuData_ScrollingMenuSpacing] ld a, [wMenuData_ScrollingMenuItemFormat]
ld c, a ld c, a
ld b, 0 ld b, 0
ld hl, .spacing_dws ld hl, .format_dws
add hl, bc add hl, bc
add hl, bc add hl, bc
ld c, [hl] ld c, [hl]
@ -239,12 +239,14 @@ ItemSwitch_ConvertSpacingToDW:
pop hl pop hl
ret ret
.spacing_dws .format_dws
dw 0, 1, 2 dw 0
dw 1
dw 2
Function24a97: Function24a97:
push af push af
call ItemSwitch_ConvertSpacingToDW call ItemSwitch_ConvertItemFormatToDW
ld a, c ld a, c
cp 2 cp 2
jr nz, .not_2 jr nz, .not_2

View File

@ -2,6 +2,8 @@ _PrintNum::
; Print c digits of the b-byte value from de to hl. ; Print c digits of the b-byte value from de to hl.
; Allows 2 to 7 digits. For 1-digit numbers, add ; Allows 2 to 7 digits. For 1-digit numbers, add
; the value to char "0" instead of calling PrintNum. ; 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. ; Some extra flags can be given in bits 5-7 of b.
; Bit 5: money if set (unless left-aligned without leading zeros) ; Bit 5: money if set (unless left-aligned without leading zeros)
; Bit 6: right-aligned if set ; Bit 6: right-aligned if set

View File

@ -497,10 +497,10 @@ ScrollingMenu_GetListItemCoordAndFunctionArgs:
ld h, [hl] ld h, [hl]
ld l, a ld l, a
inc hl ; items inc hl ; items
ld a, [wMenuData_ScrollingMenuSpacing] ld a, [wMenuData_ScrollingMenuItemFormat]
cp 1 cp SCROLLINGMENU_ITEMS_NORMAL
jr z, .got_spacing jr z, .got_spacing
cp 2 cp SCROLLINGMENU_ITEMS_QUANTITY
jr z, .pointless_jump jr z, .pointless_jump
.pointless_jump .pointless_jump
add hl, de add hl, de

View File

@ -409,7 +409,7 @@ PopulateDecoCategoryMenu:
.ScrollingMenuData: .ScrollingMenuData:
db SCROLLINGMENU_DISPLAY_ARROWS ; flags db SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 8, 0 ; rows, columns db 8, 0 ; rows, columns
db 1 ; horizontal spacing db SCROLLINGMENU_ITEMS_NORMAL ; item format
dbw 0, wd002 ; text pointer dbw 0, wd002 ; text pointer
dba DecorationMenuFunction dba DecorationMenuFunction
dbw 0, 0 dbw 0, 0

View File

@ -126,25 +126,25 @@ UpdateOverworldMap:
.step_down .step_down
call .ScrollOverworldMapDown call .ScrollOverworldMapDown
call LoadMapPart call LoadMapPart
call ScrollMapUp call ScrollMapDown
ret ret
.step_up .step_up
call .ScrollOverworldMapUp call .ScrollOverworldMapUp
call LoadMapPart call LoadMapPart
call ScrollMapDown call ScrollMapUp
ret ret
.step_left .step_left
call .ScrollOverworldMapLeft call .ScrollOverworldMapLeft
call LoadMapPart call LoadMapPart
call ScrollMapRight call ScrollMapLeft
ret ret
.step_right .step_right
call .ScrollOverworldMapRight call .ScrollOverworldMapRight
call LoadMapPart call LoadMapPart
call ScrollMapLeft call ScrollMapRight
ret ret
.ScrollOverworldMapDown: .ScrollOverworldMapDown:
@ -164,14 +164,14 @@ UpdateOverworldMap:
cp 2 ; was 1 cp 2 ; was 1
jr nz, .done_down jr nz, .done_down
ld [hl], 0 ld [hl], 0
call .Add6ToOverworldMapAnchor call .ScrollMapDataDown
.done_down .done_down
ret ret
.Add6ToOverworldMapAnchor: .ScrollMapDataDown:
ld hl, wOverworldMapAnchor ld hl, wOverworldMapAnchor
ld a, [wMapWidth] ld a, [wMapWidth]
add 6 add 3 * 2 ; surrounding tiles
add [hl] add [hl]
ld [hli], a ld [hli], a
ret nc ret nc
@ -195,14 +195,14 @@ UpdateOverworldMap:
cp -1 ; was 0 cp -1 ; was 0
jr nz, .done_up jr nz, .done_up
ld [hl], $1 ld [hl], $1
call .Sub6FromOverworldMapAnchor call .ScrollMapDataUp
.done_up .done_up
ret ret
.Sub6FromOverworldMapAnchor: .ScrollMapDataUp:
ld hl, wOverworldMapAnchor ld hl, wOverworldMapAnchor
ld a, [wMapWidth] ld a, [wMapWidth]
add 6 add 3 * 2 ; surrounding tiles
ld b, a ld b, a
ld a, [hl] ld a, [hl]
sub b sub b
@ -227,11 +227,11 @@ UpdateOverworldMap:
cp -1 cp -1
jr nz, .done_left jr nz, .done_left
ld [hl], 1 ld [hl], 1
call .DecrementwOverworldMapAnchor call .ScrollMapDataLeft
.done_left .done_left
ret ret
.DecrementwOverworldMapAnchor: .ScrollMapDataLeft:
ld hl, wOverworldMapAnchor ld hl, wOverworldMapAnchor
ld a, [hl] ld a, [hl]
sub 1 sub 1
@ -256,11 +256,11 @@ UpdateOverworldMap:
cp 2 cp 2
jr nz, .done_right jr nz, .done_right
ld [hl], 0 ld [hl], 0
call .IncrementwOverworldMapAnchor call .ScrollMapDataRight
.done_right .done_right
ret ret
.IncrementwOverworldMapAnchor: .ScrollMapDataRight:
ld hl, wOverworldMapAnchor ld hl, wOverworldMapAnchor
ld a, [hl] ld a, [hl]
add 1 add 1

View File

@ -124,14 +124,16 @@ DisplayDexEntry:
jr z, .skip_height jr z, .skip_height
push hl push hl
push de push de
; Print the height, with two of the four digits in front of the decimal point
ld hl, sp+$0 ld hl, sp+$0
ld d, h ld d, h
ld e, l ld e, l
hlcoord 12, 7 hlcoord 12, 7
lb bc, 2, PRINTNUM_MONEY | 4 lb bc, 2, (2 << 4) | 4
call PrintNum call PrintNum
; Replace the decimal point with a ft symbol
hlcoord 14, 7 hlcoord 14, 7
ld [hl], $5e ; ft symbol ld [hl], $5e
pop af pop af
pop hl pop hl
@ -148,11 +150,12 @@ DisplayDexEntry:
or d or d
jr z, .skip_weight jr z, .skip_weight
push de push de
; Print the weight, with four of the five digits in front of the decimal point
ld hl, sp+$0 ld hl, sp+$0
ld d, h ld d, h
ld e, l ld e, l
hlcoord 11, 9 hlcoord 11, 9
lb bc, 2, PRINTNUM_RIGHTALIGN | 5 lb bc, 2, (4 << 4) | 5
call PrintNum call PrintNum
pop de pop de

View File

@ -335,7 +335,7 @@ InitPokegearTilemap:
.ok .ok
farcall PokegearMap farcall PokegearMap
ld a, $07 ld a, $07
ld bc, $12 ld bc, SCREEN_WIDTH - 2
hlcoord 1, 2 hlcoord 1, 2
call ByteFill call ByteFill
hlcoord 0, 2 hlcoord 0, 2
@ -2165,7 +2165,7 @@ TownMapBubble:
hlcoord 1, 1 hlcoord 1, 1
; Middle row ; Middle row
ld bc, 18 ld bc, SCREEN_WIDTH - 2
ld a, " " ld a, " "
call ByteFill call ByteFill
@ -2481,10 +2481,10 @@ Pokedex_GetArea:
ld a, " " ld a, " "
call ByteFill call ByteFill
hlcoord 0, 1 hlcoord 0, 1
ld a, $6 ld a, $06
ld [hli], a ld [hli], a
ld bc, SCREEN_WIDTH - 2 ld bc, SCREEN_WIDTH - 2
ld a, $7 ld a, $07
call ByteFill call ByteFill
ld [hl], $17 ld [hl], $17
call GetPokemonName call GetPokemonName

View File

@ -241,16 +241,16 @@ BillsPCDepositMenuHeader:
Unreferenced_BillsPCClearThreeBoxes: Unreferenced_BillsPCClearThreeBoxes:
hlcoord 0, 0 hlcoord 0, 0
ld b, 4 ld b, 4
ld c, 8 ld c, 8
call ClearBox call ClearBox
hlcoord 0, 4 hlcoord 0, 4
ld b, 10 ld b, 10
ld c, 9 ld c, 9
call ClearBox call ClearBox
hlcoord 0, 14 hlcoord 0, 14
ld b, 2 ld b, 2
ld c, 8 ld c, 8
call ClearBox call ClearBox
ret ret
@ -1854,7 +1854,7 @@ TryWithdrawPokemon:
ld h, b ld h, b
ld de, wStringBuffer1 ld de, wStringBuffer1
call PlaceString call PlaceString
ld a, $e7 ld a, "!"
ld [bc], a ld [bc], a
ld c, 50 ld c, 50
call DelayFrames call DelayFrames
@ -1913,7 +1913,7 @@ ReleasePKMN_ByePKMN:
call PlaceString call PlaceString
ld l, c ld l, c
ld h, b ld h, b
ld [hl], $e7 ld [hl], "!"
ld c, 50 ld c, 50
call DelayFrames call DelayFrames
ret ret
@ -2269,9 +2269,9 @@ _ChangeBox_MenuHeader:
db 1 ; default option db 1 ; default option
.MenuData .MenuData
db MENU_UNUSED_1 | MENU_UNUSED_3 ; flags db SCROLLINGMENU_CALL_FUNCTION3_NO_SWITCH | SCROLLINGMENU_ENABLE_FUNCTION3 ; flags
db 4, 0 db 4, 0 ; rows, columns
db 1 db SCROLLINGMENU_ITEMS_NORMAL ; item format
dba .boxes dba .boxes
dba .boxnames dba .boxnames
dba NULL dba NULL

View File

@ -543,8 +543,8 @@ MailboxPC:
.TopMenuData: .TopMenuData:
db SCROLLINGMENU_DISPLAY_ARROWS ; flags db SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 4, 0 ; rows/columns? db 4, 0 ; rows, columns
db 1 ; horizontal spacing? db SCROLLINGMENU_ITEMS_NORMAL ; item format
dbw 0, wMailboxCount ; text pointer dbw 0, wMailboxCount ; text pointer
dba MailboxPC_PrintMailAuthor dba MailboxPC_PrintMailAuthor
dba NULL dba NULL

Binary file not shown.

Before

Width:  |  Height:  |  Size: 446 B

After

Width:  |  Height:  |  Size: 433 B

View File

@ -1151,7 +1151,7 @@ UnmaskObject::
ld [hl], 0 ; unmasked ld [hl], 0 ; unmasked
ret ret
ScrollMapDown:: ScrollMapUp::
hlcoord 0, 0 hlcoord 0, 0
ld de, wBGMapBuffer ld de, wBGMapBuffer
call BackupBGMapRow call BackupBGMapRow
@ -1166,7 +1166,7 @@ ScrollMapDown::
ldh [hBGMapUpdate], a ldh [hBGMapUpdate], a
ret ret
ScrollMapUp:: ScrollMapDown::
hlcoord 0, SCREEN_HEIGHT - 2 hlcoord 0, SCREEN_HEIGHT - 2
ld de, wBGMapBuffer ld de, wBGMapBuffer
call BackupBGMapRow call BackupBGMapRow
@ -1189,7 +1189,7 @@ ScrollMapUp::
ldh [hBGMapUpdate], a ldh [hBGMapUpdate], a
ret ret
ScrollMapRight:: ScrollMapLeft::
hlcoord 0, 0 hlcoord 0, 0
ld de, wBGMapBuffer ld de, wBGMapBuffer
call BackupBGMapColumn call BackupBGMapColumn
@ -1204,7 +1204,7 @@ ScrollMapRight::
ldh [hBGMapUpdate], a ldh [hBGMapUpdate], a
ret ret
ScrollMapLeft:: ScrollMapRight::
hlcoord SCREEN_WIDTH - 2, 0 hlcoord SCREEN_WIDTH - 2, 0
ld de, wBGMapBuffer ld de, wBGMapBuffer
call BackupBGMapColumn call BackupBGMapColumn

View File

@ -6,7 +6,7 @@ InitString::
InitName:: InitName::
; Intended for names, so this function is limited to ten characters. ; Intended for names, so this function is limited to ten characters.
push hl push hl
ld c, 10 ld c, NAME_LENGTH - 1
_InitString:: _InitString::
; if the string pointed to by hl is empty (defined as "zero or more spaces ; if the string pointed to by hl is empty (defined as "zero or more spaces
; followed by a null"), then initialize it to the string pointed to by de. ; followed by a null"), then initialize it to the string pointed to by de.

View File

@ -584,13 +584,21 @@ MenuHeader_0x48513:
MenuData_0x4851b: MenuData_0x4851b:
db SCROLLINGMENU_DISPLAY_ARROWS | SCROLLINGMENU_ENABLE_RIGHT | SCROLLINGMENU_ENABLE_LEFT | SCROLLINGMENU_CALL_FUNCTION1_CANCEL ; flags db SCROLLINGMENU_DISPLAY_ARROWS | SCROLLINGMENU_ENABLE_RIGHT | SCROLLINGMENU_ENABLE_LEFT | SCROLLINGMENU_CALL_FUNCTION1_CANCEL ; flags
db 6 ; items db 6, 0 ; rows, columns
db SCROLLINGMENU_ITEMS_NORMAL ; item format
dba .Items
dba Function483e8
dba NULL
dba NULL
Unknown_4851d: .Items:
db $00, $01, $12, $2b, $45, $12, $e8, $43, $00, $00, $00, $00, $00, $00, $2e, $00, $01, $02, $03, $04 db 46
db $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $0f, $10, $11, $12, $13, $14, $15, $16, $17, $18 x = 0
db $19, $1a, $1b, $1c, $1d, $1e, $1f, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $2a, $2b, $2c rept 46
db $2d, $ff db x
x = x + 1
endr
db -1
Prefectures: Prefectures:
Aichi: db "あいちけん@" ; Aichi Aichi: db "あいちけん@" ; Aichi

View File

@ -883,8 +883,8 @@ MenuHeader_0x8b867:
MenuData_0x8b870: MenuData_0x8b870:
db SCROLLINGMENU_ENABLE_FUNCTION3 | SCROLLINGMENU_DISPLAY_ARROWS | SCROLLINGMENU_ENABLE_RIGHT | SCROLLINGMENU_ENABLE_LEFT ; flags db SCROLLINGMENU_ENABLE_FUNCTION3 | SCROLLINGMENU_DISPLAY_ARROWS | SCROLLINGMENU_ENABLE_RIGHT | SCROLLINGMENU_ENABLE_LEFT ; flags
db 5 ; items db 5, 3 ; rows, columns
db 3, 1 db SCROLLINGMENU_ITEMS_NORMAL ; item format
dbw 0, wd002 dbw 0, wd002
dba Function8b880 dba Function8b880
dba Function8b88c dba Function8b88c

View File

@ -3796,9 +3796,9 @@ BattleTowerRoomMenu_WaitForMessage:
call BattleTowerRoomMenu_IncrementJumptable call BattleTowerRoomMenu_IncrementJumptable
BattleTowerRoomMenu_DelayRestartMenu: BattleTowerRoomMenu_DelayRestartMenu:
; Loops while (--[wcd50] != 0), ; Loops while (--[wcd50] != 0),
; to create some sort of "delay" after the message is written on the screen, ; to create some sort of "delay" after the message is written on the screen,
; before starting the menu again. ; before starting the menu again.
ld hl, wcd50 ld hl, wcd50
dec [hl] dec [hl]
ret nz ret nz

View File

@ -17,6 +17,7 @@ valid_toc_headings = {'## TOC', '##TOC'}
TocItem = namedtuple('TocItem', ['name', 'anchor', 'level']) TocItem = namedtuple('TocItem', ['name', 'anchor', 'level'])
punctuation_regexp = re.compile(r'[^\w\- ]+') punctuation_regexp = re.compile(r'[^\w\- ]+')
specialchar_regexp = re.compile(r'[⅔]+')
def name_to_anchor(name): def name_to_anchor(name):
# GitHub's algorithm for generating anchors from headings # GitHub's algorithm for generating anchors from headings
@ -24,6 +25,7 @@ def name_to_anchor(name):
anchor = name.strip().lower() # lowercase anchor = name.strip().lower() # lowercase
anchor = re.sub(punctuation_regexp, '', anchor) # remove punctuation anchor = re.sub(punctuation_regexp, '', anchor) # remove punctuation
anchor = anchor.replace(' ', '-') # replace spaces with dash anchor = anchor.replace(' ', '-') # replace spaces with dash
anchor = re.sub(specialchar_regexp, '', anchor) # remove misc special chars
return anchor return anchor
def get_toc_index(lines): def get_toc_index(lines):

View File

@ -1481,7 +1481,7 @@ NEXTU ; cf92
; Scrolling Menu ; Scrolling Menu
wMenuData_ScrollingMenuHeight:: db ; cf92 wMenuData_ScrollingMenuHeight:: db ; cf92
wMenuData_ScrollingMenuWidth:: db ; cf93 wMenuData_ScrollingMenuWidth:: db ; cf93
wMenuData_ScrollingMenuSpacing:: db ; cf94 wMenuData_ScrollingMenuItemFormat:: db ; cf94
wMenuData_ItemsPointerBank:: db ; cf95 wMenuData_ItemsPointerBank:: db ; cf95
wMenuData_ItemsPointerAddr:: dw ; cf97 wMenuData_ItemsPointerAddr:: dw ; cf97
wMenuData_ScrollingMenuFunction1:: ds 3 ; cf98 wMenuData_ScrollingMenuFunction1:: ds 3 ; cf98