summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormid-kid <esteve.varela@gmail.com>2019-06-09 00:05:32 +0200
committermid-kid <esteve.varela@gmail.com>2019-06-09 00:17:35 +0200
commit54b87ecea87916bd140c0c6197eb203df9992221 (patch)
tree8b2b9282fc19e8e27baef6bc98112204c1a7f13f
parentc7fdf5f9ec4eb6597278fc234dbd2349b893f528 (diff)
Document in-battle move selection menu scrolling glitch
What a mouthful...
-rw-r--r--docs/bugs_and_glitches.md53
-rwxr-xr-xtools/toc.py2
2 files changed, 55 insertions, 0 deletions
diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md
index c9437b3e1..dd0ed6290 100644
--- a/docs/bugs_and_glitches.md
+++ b/docs/bugs_and_glitches.md
@@ -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)
- [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)
+- [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)
- [`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)
@@ -1334,6 +1335,58 @@ 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)
+## Move selection menu doesn't handle joypad properly
+
+This is an oversight, where `hInMenu` isn't set properly in the menu that handles selecting moves in a battle. Because of this, your cursor is rendered unable to keep scrolling when one of the directional keys is being held.
+
+**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
+```
+
+There existed one way in which this bug would be temporarily "fixed" in-game, and that's when the credits sequence is triggered, `hInMenu` will be set but never unset. This has no bad effect upon the rest of the game, but you might want to fix it regardless.
+
+**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
+```
+
+
## 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):
diff --git a/tools/toc.py b/tools/toc.py
index 8ff50be94..13b75ae1c 100755
--- a/tools/toc.py
+++ b/tools/toc.py
@@ -17,6 +17,7 @@ valid_toc_headings = {'## TOC', '##TOC'}
TocItem = namedtuple('TocItem', ['name', 'anchor', 'level'])
punctuation_regexp = re.compile(r'[^\w\- ]+')
+specialchar_regexp = re.compile(r'[⅔]+')
def name_to_anchor(name):
# GitHub's algorithm for generating anchors from headings
@@ -24,6 +25,7 @@ def name_to_anchor(name):
anchor = name.strip().lower() # lowercase
anchor = re.sub(punctuation_regexp, '', anchor) # remove punctuation
anchor = anchor.replace(' ', '-') # replace spaces with dash
+ anchor = re.sub(specialchar_regexp, '', anchor) # remove misc special chars
return anchor
def get_toc_index(lines):