From dc8e2ebc1306b2bf268cd4a259005e1c9ec5d25c Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Wed, 7 Oct 2015 18:24:21 -0700 Subject: [PATCH] change name of glyph width functions --- asm/data2.s | 20 ++++++++++---------- asm/emerald.s | 36 ++++++++++++++++++------------------ asm/macros.s | 2 +- asm/text_renderer.s | 39 ++++++++++++++++++++------------------- 4 files changed, 49 insertions(+), 48 deletions(-) diff --git a/asm/data2.s b/asm/data2.s index c1dcbc89d..c28f270f3 100644 --- a/asm/data2.s +++ b/asm/data2.s @@ -70,16 +70,16 @@ gDownArrowYCoords: @ 82E9D0C gWindowVerticalScrollSpeeds: @ 82E9D10 .byte 1, 2, 4, 0 -gFontWidthFuncs: @ 82E9D14 - font_width_func 0, get_font_width_0+1 - font_width_func 1, get_font_width_1+1 - font_width_func 2, get_font_width_2+1 - font_width_func 3, get_font_width_2+1 - font_width_func 4, get_font_width_2+1 - font_width_func 5, get_font_width_2+1 - font_width_func 6, get_font_width_6+1 - font_width_func 7, get_font_width_7+1 - font_width_func 8, get_font_width_8+1 +gGlyphWidthFuncs: @ 82E9D14 + glyph_width_func 0, GetGlyphWidthFont0+1 + glyph_width_func 1, GetGlyphWidthFont1+1 + glyph_width_func 2, GetGlyphWidthFont2+1 + glyph_width_func 3, GetGlyphWidthFont2+1 + glyph_width_func 4, GetGlyphWidthFont2+1 + glyph_width_func 5, GetGlyphWidthFont2+1 + glyph_width_func 6, GetGlyphWidthFont6+1 + glyph_width_func 7, GetGlyphWidthFont7+1 + glyph_width_func 8, GetGlyphWidthFont8+1 gKeypadIcons: @ 82E9D5C keypad_icon 0x0, 8, 12 diff --git a/asm/emerald.s b/asm/emerald.s index 3ba90a5ae..c072daf54 100644 --- a/asm/emerald.s +++ b/asm/emerald.s @@ -702215,13 +702215,13 @@ sub_816BFE0: @ 816BFE0 bne _0816C030 movs r0, 0x1 movs r1, 0 - bl sub_8006460 + bl GetMenuCursorDimensionByFont adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0x1 movs r1, 0x1 - bl sub_8006460 + bl GetMenuCursorDimensionByFont lsls r0, 24 lsrs r0, 24 str r4, [sp] @@ -787999,7 +787999,7 @@ sub_81983EC: @ 81983EC movs r1, 0x1 str r2, [sp, 0xC] str r3, [sp, 0x10] - bl sub_8006460 + bl GetMenuCursorDimensionByFont lsls r0, 24 lsrs r0, 24 str r0, [sp] @@ -788039,13 +788039,13 @@ RedrawMenuCursor: @ 8198448 ldr r5, =0x0203cd90 ldrb r0, [r5, 0x6] movs r1, 0 - bl sub_8006460 + bl GetMenuCursorDimensionByFont adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldrb r0, [r5, 0x6] movs r1, 0x1 - bl sub_8006460 + bl GetMenuCursorDimensionByFont lsls r0, 24 lsrs r0, 24 ldrb r1, [r5, 0x5] @@ -789592,7 +789592,7 @@ sub_8198FD4: @ 8198FD4 movs r1, 0x1 str r2, [sp, 0x18] str r3, [sp, 0x1C] - bl sub_8006460 + bl GetMenuCursorDimensionByFont lsls r0, 24 lsrs r0, 24 adds r1, r4, 0 @@ -789640,7 +789640,7 @@ sub_8199060: @ 8199060 ldr r5, =0x0203cd90 ldrb r0, [r5, 0x6] movs r1, 0 - bl sub_8006460 + bl GetMenuCursorDimensionByFont mov r9, r0 mov r1, r9 lsls r1, 24 @@ -789648,7 +789648,7 @@ sub_8199060: @ 8199060 mov r9, r1 ldrb r0, [r5, 0x6] movs r1, 0x1 - bl sub_8006460 + bl GetMenuCursorDimensionByFont adds r6, r0, 0 lsls r6, 24 lsrs r6, 24 @@ -825934,13 +825934,13 @@ sub_81AB75C: @ 81AB75C bne _081AB798 movs r0, 0x1 movs r1, 0 - bl sub_8006460 + bl GetMenuCursorDimensionByFont adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0x1 movs r1, 0x1 - bl sub_8006460 + bl GetMenuCursorDimensionByFont lsls r0, 24 lsrs r0, 24 str r4, [sp] @@ -832269,7 +832269,7 @@ sub_81AEC78: @ 81AEC78 lsls r0, 26 lsrs r0, 26 movs r1, 0 - bl sub_8006460 + bl GetMenuCursorDimensionByFont adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 @@ -832277,7 +832277,7 @@ sub_81AEC78: @ 81AEC78 lsls r0, 26 lsrs r0, 26 movs r1, 0x1 - bl sub_8006460 + bl GetMenuCursorDimensionByFont lsls r0, 24 lsrs r0, 24 ldrb r6, [r7, 0x10] @@ -841084,7 +841084,7 @@ _081B3226: _081B3250: movs r0, 0x1 movs r1, 0 - bl sub_8006460 + bl GetMenuCursorDimensionByFont lsls r0, 24 lsrs r0, 24 mov r9, r0 @@ -855015,11 +855015,11 @@ sub_81BA668: @ 81BA668 .pool thumb_func_end sub_81BA668 - thumb_func_start get_font_width_6 -get_font_width_6: @ 81BA6CC + thumb_func_start GetGlyphWidthFont6 +GetGlyphWidthFont6: @ 81BA6CC movs r0, 0x10 bx lr - thumb_func_end get_font_width_6 + thumb_func_end GetGlyphWidthFont6 thumb_func_start sub_81BA6D0 sub_81BA6D0: @ 81BA6D0 @@ -876243,13 +876243,13 @@ sub_81C5AB8: @ 81C5AB8 bne _081C5AF4 movs r0, 0x1 movs r1, 0 - bl sub_8006460 + bl GetMenuCursorDimensionByFont adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0x1 movs r1, 0x1 - bl sub_8006460 + bl GetMenuCursorDimensionByFont lsls r0, 24 lsrs r0, 24 str r4, [sp] diff --git a/asm/macros.s b/asm/macros.s index 7629f747e..f9729f3f7 100644 --- a/asm/macros.s +++ b/asm/macros.s @@ -38,7 +38,7 @@ .2byte \vram_tile_offset .endm - .macro font_width_func font_id, func + .macro glyph_width_func font_id, func .4byte \font_id .4byte \func .endm diff --git a/asm/text_renderer.s b/asm/text_renderer.s index b05b339d7..3e62b0d1e 100644 --- a/asm/text_renderer.s +++ b/asm/text_renderer.s @@ -3331,7 +3331,7 @@ GetFontWidthFunc: @ 8005EA8 lsls r0, 24 lsrs r4, r0, 24 movs r3, 0 - ldr r0, =gFontWidthFuncs + ldr r0, =gGlyphWidthFuncs adds r2, r0, 0x4 adds r1, r0, 0 _08005EB6: @@ -4070,8 +4070,9 @@ _08006456: .pool thumb_func_end fbox_get_field - thumb_func_start sub_8006460 -sub_8006460: @ 8006460 + thumb_func_start GetMenuCursorDimensionByFont +@ u8 GetMenuCursorDimensionByFont(u8 fontId, u8 whichDimension) +GetMenuCursorDimensionByFont: @ 8006460 lsls r0, 24 lsls r1, 24 lsrs r1, 24 @@ -4083,7 +4084,7 @@ sub_8006460: @ 8006460 bx lr .align 2, 0 .pool - thumb_func_end sub_8006460 + thumb_func_end GetMenuCursorDimensionByFont thumb_func_start Text_DecompressGlyphFont0 Text_DecompressGlyphFont0: @ 8006478 @@ -4176,8 +4177,8 @@ _08006534: .pool thumb_func_end Text_DecompressGlyphFont0 - thumb_func_start get_font_width_0 -get_font_width_0: @ 8006540 + thumb_func_start GetGlyphWidthFont0 +GetGlyphWidthFont0: @ 8006540 push {lr} lsls r0, 16 lsrs r2, r0, 16 @@ -4194,7 +4195,7 @@ _08006558: _0800655A: pop {r1} bx r1 - thumb_func_end get_font_width_0 + thumb_func_end GetGlyphWidthFont0 thumb_func_start Text_DecompressGlyphFont7 Text_DecompressGlyphFont7: @ 8006560 @@ -4287,8 +4288,8 @@ _0800661C: .pool thumb_func_end Text_DecompressGlyphFont7 - thumb_func_start get_font_width_7 -get_font_width_7: @ 8006628 + thumb_func_start GetGlyphWidthFont7 +GetGlyphWidthFont7: @ 8006628 push {lr} lsls r0, 16 lsrs r2, r0, 16 @@ -4305,7 +4306,7 @@ _08006640: _08006642: pop {r1} bx r1 - thumb_func_end get_font_width_7 + thumb_func_end GetGlyphWidthFont7 thumb_func_start Text_DecompressGlyphFont8 @ void Text_DecompressGlyphFont8(u16 glyphIndex, bool japanese) @@ -4399,8 +4400,8 @@ _08006704: .pool thumb_func_end Text_DecompressGlyphFont8 - thumb_func_start get_font_width_8 -get_font_width_8: @ 8006710 + thumb_func_start GetGlyphWidthFont8 +GetGlyphWidthFont8: @ 8006710 push {lr} lsls r0, 16 lsrs r2, r0, 16 @@ -4417,7 +4418,7 @@ _08006728: _0800672A: pop {r1} bx r1 - thumb_func_end get_font_width_8 + thumb_func_end GetGlyphWidthFont8 thumb_func_start Text_DecompressGlyphFont2 Text_DecompressGlyphFont2: @ 8006730 @@ -4524,8 +4525,8 @@ _08006810: .pool thumb_func_end Text_DecompressGlyphFont2 - thumb_func_start get_font_width_2 -get_font_width_2: @ 800681C + thumb_func_start GetGlyphWidthFont2 +GetGlyphWidthFont2: @ 800681C push {lr} lsls r0, 16 lsrs r2, r0, 16 @@ -4544,7 +4545,7 @@ _08006832: bx r1 .align 2, 0 .pool - thumb_func_end get_font_width_2 + thumb_func_end GetGlyphWidthFont2 thumb_func_start Text_DecompressGlyphFont1 @ void Text_DecompressGlyphFont1(int a1, int japanese) @@ -4638,8 +4639,8 @@ _080068FC: .pool thumb_func_end Text_DecompressGlyphFont1 - thumb_func_start get_font_width_1 -get_font_width_1: @ 8006908 + thumb_func_start GetGlyphWidthFont1 +GetGlyphWidthFont1: @ 8006908 push {lr} lsls r0, 16 lsrs r2, r0, 16 @@ -4656,7 +4657,7 @@ _08006920: _08006922: pop {r1} bx r1 - thumb_func_end get_font_width_1 + thumb_func_end GetGlyphWidthFont1 thumb_func_start Text_DecompressGlyphFont9 Text_DecompressGlyphFont9: @ 8006928