shithub: pokecrystal

Download patch

ref: 7cac5b787bda37b5ed1fc5ea39e6a96c046cca9d
parent: 8826d97ee42b85dbb45647ed81eaaaad56632754
author: Rangi <[email protected]>
date: Sat Aug 6 08:24:40 EDT 2022

Assert that there are NUM_FRAMES textbox frames

--- a/engine/menus/options_menu.asm
+++ b/engine/menus/options_menu.asm
@@ -1,14 +1,14 @@
 ; GetOptionPointer.Pointers indexes
 	const_def
-	const OPT_TEXT_SPEED   ; 0
-	const OPT_BATTLE_SCENE ; 1
-	const OPT_BATTLE_STYLE ; 2
-	const OPT_SOUND        ; 3
-	const OPT_PRINT        ; 4
-	const OPT_MENU_ACCOUNT ; 5
-	const OPT_FRAME        ; 6
-	const OPT_CANCEL       ; 7
-DEF NUM_OPTIONS EQU const_value    ; 8
+	const OPT_TEXT_SPEED    ; 0
+	const OPT_BATTLE_SCENE  ; 1
+	const OPT_BATTLE_STYLE  ; 2
+	const OPT_SOUND         ; 3
+	const OPT_PRINT         ; 4
+	const OPT_MENU_ACCOUNT  ; 5
+	const OPT_FRAME         ; 6
+	const OPT_CANCEL        ; 7
+DEF NUM_OPTIONS EQU const_value ; 8
 
 _Option:
 	ld hl, hInMenu
--- a/gfx/font.asm
+++ b/gfx/font.asm
@@ -8,6 +8,7 @@
 INCBIN "gfx/font/font_battle_extra.2bpp"
 
 Frames:
+	table_width TEXTBOX_FRAME_TILES * LEN_1BPP_TILE, Frames
 INCBIN "gfx/frames/1.1bpp"
 INCBIN "gfx/frames/2.1bpp"
 INCBIN "gfx/frames/3.1bpp"
@@ -16,7 +17,8 @@
 INCBIN "gfx/frames/6.1bpp"
 INCBIN "gfx/frames/7.1bpp"
 INCBIN "gfx/frames/8.1bpp"
-INCBIN "gfx/frames/9.1bpp"
+	assert_table_length NUM_FRAMES
+INCBIN "gfx/frames/9.1bpp" ; unused
 
 StatsScreenPageTilesGFX:
 INCBIN "gfx/stats/stats_tiles.2bpp"