diff --git a/asm/frontier_map.s b/asm/frontier_map.s index 2b0cc01702..ce5d7c2841 100644 --- a/asm/frontier_map.s +++ b/asm/frontier_map.s @@ -177,11 +177,11 @@ _022386D4: lsr r1, r1, #0x10 bl sub_02055198 mov r0, #1 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #0 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, _02238854 ; =FrontierMap_VBlank add r1, r4, #0 bl Main_SetVBlankIntrCB @@ -315,9 +315,9 @@ FrontierMap_Free: ; 0x0223885C mov r0, #0 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint bl sub_0203A914 mov r1, #5 mov r2, #2 diff --git a/asm/include/overlay_01_021F3F50.inc b/asm/include/overlay_01_021F3F50.inc index 016379e1f9..4dae5ae634 100644 --- a/asm/include/overlay_01_021F3F50.inc +++ b/asm/include/overlay_01_021F3F50.inc @@ -1,8 +1,8 @@ #include #pragma once .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B50 -.public sub_02002B8C +.public TextFlags_SetAutoScrollParam +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_String_GetWidth .public GetFontAttribute .public NewMsgDataFromNarc diff --git a/asm/include/overlay_03.inc b/asm/include/overlay_03.inc index e375d57dba..9d2d03dd73 100644 --- a/asm/include/overlay_03.inc +++ b/asm/include/overlay_03.inc @@ -8,8 +8,8 @@ .public ListMenuGetScrollAndRow .public ListMenuGetTemplateField .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B50 -.public sub_02002B8C +.public TextFlags_SetAutoScrollParam +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_String_GetWidth .public PlaySE .public GfGfxLoader_LoadCharData diff --git a/asm/include/overlay_101.inc b/asm/include/overlay_101.inc index dc33c118fa..4c81f62993 100644 --- a/asm/include/overlay_101.inc +++ b/asm/include/overlay_101.inc @@ -1,12 +1,12 @@ #include #pragma once -.public sub_020027F0 +.public TextPrinter_SetDownArrowBaseTile .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B8C -.public sub_02002BA8 -.public sub_02002C04 -.public sub_02002C20 -.public sub_02002C40 +.public TextFlags_SetCanTouchSpeedUpPrint +.public TextFlags_SetAlternateDownArrow +.public TextFlags_GetIsTouchSpeedingUpPrint +.public TextFlags_SetFastForwardTouchButtonHitbox +.public TextFlags_UnsetFastForwardTouchButtonHitbox .public FontID_Alloc .public FontID_Release .public FontID_String_GetWidth diff --git a/asm/include/overlay_103.inc b/asm/include/overlay_103.inc index c59ec98e04..5ae49d9de6 100644 --- a/asm/include/overlay_103.inc +++ b/asm/include/overlay_103.inc @@ -1,6 +1,6 @@ #include #pragma once -.public sub_02002B8C +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public FontID_String_GetWidth diff --git a/asm/include/overlay_111.inc b/asm/include/overlay_111.inc index 39f273bd98..e7da01283e 100644 --- a/asm/include/overlay_111.inc +++ b/asm/include/overlay_111.inc @@ -1,7 +1,7 @@ #include #pragma once .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B8C +.public TextFlags_SetCanTouchSpeedUpPrint .public LoadFontPal0 .public PlaySE .public OverlayManager_CreateAndGetData diff --git a/asm/include/overlay_112.inc b/asm/include/overlay_112.inc index a5bc901e56..fe80143914 100644 --- a/asm/include/overlay_112.inc +++ b/asm/include/overlay_112.inc @@ -3,7 +3,7 @@ .public RegisterMainOverlay .public CopyU16StringArrayN .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B8C +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public FontID_String_GetWidth diff --git a/asm/include/overlay_12_022378C0.inc b/asm/include/overlay_12_022378C0.inc index 7407cbc1f2..4cb4e614b2 100644 --- a/asm/include/overlay_12_022378C0.inc +++ b/asm/include/overlay_12_022378C0.inc @@ -1,9 +1,9 @@ #include #pragma once -.public sub_020027F0 +.public TextPrinter_SetDownArrowBaseTile .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B50 -.public sub_02002B8C +.public TextFlags_SetAutoScrollParam +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public PaletteData_Init diff --git a/asm/include/overlay_12_02266024.inc b/asm/include/overlay_12_02266024.inc index 8e9b32f09d..ee91c0766b 100644 --- a/asm/include/overlay_12_02266024.inc +++ b/asm/include/overlay_12_02266024.inc @@ -1,9 +1,9 @@ #include #pragma once -.public sub_02002BC4 -.public sub_02002BD4 -.public sub_02002BE4 -.public sub_02002BF4 +.public TextFlags_GetHasSpedUpInput +.public TextFlags_ResetHasSpedUpInput +.public TextFlags_GetHasContinuedInput +.public TextFlags_ResetHasContinuedInput .public FontID_String_GetWidth .public PaletteData_LoadPalette .public PaletteData_LoadNarc diff --git a/asm/include/overlay_15.inc b/asm/include/overlay_15.inc index 906aa8d366..f9514904c1 100644 --- a/asm/include/overlay_15.inc +++ b/asm/include/overlay_15.inc @@ -1,8 +1,8 @@ #include #pragma once .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B50 -.public sub_02002B8C +.public TextFlags_SetAutoScrollParam +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_String_GetWidth .public LoadFontPal1 .public sub_02004B10 diff --git a/asm/include/overlay_27.inc b/asm/include/overlay_27.inc index 0c7b5cf3d2..e077d90dfe 100644 --- a/asm/include/overlay_27.inc +++ b/asm/include/overlay_27.inc @@ -1,6 +1,6 @@ #include #pragma once -.public sub_02002B8C +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public FontID_String_GetWidth diff --git a/asm/include/overlay_31.inc b/asm/include/overlay_31.inc index 2187cebd8d..2c0021400d 100644 --- a/asm/include/overlay_31.inc +++ b/asm/include/overlay_31.inc @@ -1,7 +1,7 @@ #include #pragma once -.public sub_02002B8C -.public sub_02002C20 +.public TextFlags_SetCanTouchSpeedUpPrint +.public TextFlags_SetFastForwardTouchButtonHitbox .public FontID_String_GetWidth .public LoadFontPal0 .public LoadFontPal1 diff --git a/asm/include/overlay_39_thumb.inc b/asm/include/overlay_39_thumb.inc index 701791036f..9db8fb3266 100644 --- a/asm/include/overlay_39_thumb.inc +++ b/asm/include/overlay_39_thumb.inc @@ -1,8 +1,8 @@ #include #pragma once .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B50 -.public sub_02002B8C +.public TextFlags_SetAutoScrollParam +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_String_GetWidth .public LoadFontPal1 .public BlendPalette diff --git a/asm/include/overlay_40.inc b/asm/include/overlay_40.inc index a3e44127d7..d0a29c50e2 100644 --- a/asm/include/overlay_40.inc +++ b/asm/include/overlay_40.inc @@ -1,6 +1,6 @@ #include #pragma once -.public sub_02002B8C +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_String_GetWidth .public FontID_String_AllCharsValid .public FontID_String_GetWidthMultiline diff --git a/asm/include/overlay_41.inc b/asm/include/overlay_41.inc index 69509a1d48..46a42e84be 100644 --- a/asm/include/overlay_41.inc +++ b/asm/include/overlay_41.inc @@ -1,6 +1,6 @@ #include #pragma once -.public sub_02002B8C +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public FontID_String_GetWidth diff --git a/asm/include/overlay_43.inc b/asm/include/overlay_43.inc index 33c63fa6ea..4fd2409020 100644 --- a/asm/include/overlay_43.inc +++ b/asm/include/overlay_43.inc @@ -1,9 +1,9 @@ #include #pragma once .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B50 -.public sub_02002B8C -.public sub_02002C04 +.public TextFlags_SetAutoScrollParam +.public TextFlags_SetCanTouchSpeedUpPrint +.public TextFlags_GetIsTouchSpeedingUpPrint .public FontID_Alloc .public FontID_Release .public FontID_String_GetWidth diff --git a/asm/include/overlay_44.inc b/asm/include/overlay_44.inc index c196b5aba6..802999e010 100644 --- a/asm/include/overlay_44.inc +++ b/asm/include/overlay_44.inc @@ -8,8 +8,8 @@ .public Handle2dMenuInput_DeleteOnFinish .public Clear2dMenuWindowAndDelete .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B50 -.public sub_02002B8C +.public TextFlags_SetAutoScrollParam +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public FontID_String_GetWidth diff --git a/asm/include/overlay_49.inc b/asm/include/overlay_49.inc index 86d49c3fa8..43b221390a 100644 --- a/asm/include/overlay_49.inc +++ b/asm/include/overlay_49.inc @@ -5,8 +5,8 @@ .public DestroyListMenu .public ListMenuGetScrollAndRow .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B50 -.public sub_02002B8C +.public TextFlags_SetAutoScrollParam +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_String_GetWidth .public LoadFontPal0 .public LoadFontPal1 diff --git a/asm/include/overlay_59.inc b/asm/include/overlay_59.inc index 8b5b9e913c..b850877738 100644 --- a/asm/include/overlay_59.inc +++ b/asm/include/overlay_59.inc @@ -1,7 +1,7 @@ #include #pragma once .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B8C +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public FontID_String_GetWidth diff --git a/asm/include/overlay_68.inc b/asm/include/overlay_68.inc index 4a3bca3bd3..ac4cc1382d 100644 --- a/asm/include/overlay_68.inc +++ b/asm/include/overlay_68.inc @@ -1,7 +1,7 @@ #include #pragma once .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B8C +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public FontID_String_GetWidth diff --git a/asm/include/overlay_69.inc b/asm/include/overlay_69.inc index e56d786ea7..3973edb4d4 100644 --- a/asm/include/overlay_69.inc +++ b/asm/include/overlay_69.inc @@ -6,8 +6,8 @@ .public Std_CreateYesNoMenu .public Handle2dMenuInput_DeleteOnFinish .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B50 -.public sub_02002B8C +.public TextFlags_SetAutoScrollParam +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public LoadFontPal0 diff --git a/asm/include/overlay_70.inc b/asm/include/overlay_70.inc index 50b9623567..df8178d964 100644 --- a/asm/include/overlay_70.inc +++ b/asm/include/overlay_70.inc @@ -2,7 +2,7 @@ #pragma once .public Handle2dMenuInput_DeleteOnFinish .public CopyU16StringArrayN -.public sub_02002B8C +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public FontID_String_GetWidth diff --git a/asm/include/overlay_72.inc b/asm/include/overlay_72.inc index ec2b29c0a4..4e4bd25f62 100644 --- a/asm/include/overlay_72.inc +++ b/asm/include/overlay_72.inc @@ -1,6 +1,6 @@ #include #pragma once -.public sub_02002B8C +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public FontID_String_GetWidth diff --git a/asm/include/overlay_74_thumb.inc b/asm/include/overlay_74_thumb.inc index 4d32af108f..881c860949 100644 --- a/asm/include/overlay_74_thumb.inc +++ b/asm/include/overlay_74_thumb.inc @@ -5,7 +5,7 @@ .public ListMenuInit .public ListMenu_ProcessInput .public DestroyListMenu -.public sub_02002B8C +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public FontID_String_GetWidth diff --git a/asm/include/overlay_75.inc b/asm/include/overlay_75.inc index d3ec5042e3..77f8cab946 100644 --- a/asm/include/overlay_75.inc +++ b/asm/include/overlay_75.inc @@ -5,8 +5,8 @@ .public ListMenu_ProcessInput .public DestroyListMenu .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B50 -.public sub_02002B8C +.public TextFlags_SetAutoScrollParam +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_String_GetWidth .public LoadFontPal1 .public BlendPalette diff --git a/asm/include/overlay_80_0222BDF4.inc b/asm/include/overlay_80_0222BDF4.inc index 39a882d84a..8e1c7dd341 100644 --- a/asm/include/overlay_80_0222BDF4.inc +++ b/asm/include/overlay_80_0222BDF4.inc @@ -15,8 +15,8 @@ .public Handle2dMenuInput_DeleteOnFinish .public Clear2dMenuWindowAndDelete .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B50 -.public sub_02002B8C +.public TextFlags_SetAutoScrollParam +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_String_GetWidth .public PaletteData_LoadNarc .public PaletteData_FillPaletteInBuffer diff --git a/asm/include/overlay_80_02238648.inc b/asm/include/overlay_80_02238648.inc index a307e4bf36..7d102a0880 100644 --- a/asm/include/overlay_80_02238648.inc +++ b/asm/include/overlay_80_02238648.inc @@ -1,8 +1,8 @@ #include #pragma once .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B50 -.public sub_02002B8C +.public TextFlags_SetAutoScrollParam +.public TextFlags_SetCanTouchSpeedUpPrint .public PaletteData_Init .public PaletteData_Free .public PaletteData_AllocBuffers diff --git a/asm/include/overlay_81.inc b/asm/include/overlay_81.inc index 248aea991e..54f34ec4f8 100644 --- a/asm/include/overlay_81.inc +++ b/asm/include/overlay_81.inc @@ -1,7 +1,7 @@ #include #pragma once .public Delete2dMenu -.public sub_02002B8C +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public FontID_String_GetWidth diff --git a/asm/include/overlay_82.inc b/asm/include/overlay_82.inc index 5cd33a0a5a..0970602fd9 100644 --- a/asm/include/overlay_82.inc +++ b/asm/include/overlay_82.inc @@ -1,6 +1,6 @@ #include #pragma once -.public sub_02002B8C +.public TextFlags_SetCanTouchSpeedUpPrint .public LoadFontPal0 .public LoadFontPal1 .public PaletteData_Init diff --git a/asm/include/overlay_89.inc b/asm/include/overlay_89.inc index 3215767938..b11c614bb2 100644 --- a/asm/include/overlay_89.inc +++ b/asm/include/overlay_89.inc @@ -1,8 +1,8 @@ #include #pragma once .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B50 -.public sub_02002B8C +.public TextFlags_SetAutoScrollParam +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public FontID_String_GetWidth diff --git a/asm/include/overlay_90.inc b/asm/include/overlay_90.inc index 400e0c8673..6772801ef4 100644 --- a/asm/include/overlay_90.inc +++ b/asm/include/overlay_90.inc @@ -1,7 +1,7 @@ #include #pragma once -.public sub_02002C60 -.public sub_02002C90 +.public TextFlags_BeginAutoScroll +.public TextFlags_EndAutoScroll .public FontID_Alloc .public FontID_Release .public FontID_String_GetWidth diff --git a/asm/include/overlay_93_thumb_1.inc b/asm/include/overlay_93_thumb_1.inc index bd00adfc4e..623ebd0282 100644 --- a/asm/include/overlay_93_thumb_1.inc +++ b/asm/include/overlay_93_thumb_1.inc @@ -1,8 +1,8 @@ #include #pragma once .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B50 -.public sub_02002B8C +.public TextFlags_SetAutoScrollParam +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_String_GetWidth .public PaletteData_Init .public PaletteData_Free diff --git a/asm/include/overlay_95.inc b/asm/include/overlay_95.inc index 39a020e20d..63c6bb6d5f 100644 --- a/asm/include/overlay_95.inc +++ b/asm/include/overlay_95.inc @@ -1,6 +1,6 @@ #include #pragma once -.public sub_02002B8C +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public PaletteData_Init diff --git a/asm/include/overlay_96.inc b/asm/include/overlay_96.inc index b3e606a87c..14f1b1bac3 100644 --- a/asm/include/overlay_96.inc +++ b/asm/include/overlay_96.inc @@ -2,8 +2,8 @@ #pragma once .public CopyU16StringArrayN .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B50 -.public sub_02002B8C +.public TextFlags_SetAutoScrollParam +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public LoadFontPal0 diff --git a/asm/include/overlay_trainer_card_main.inc b/asm/include/overlay_trainer_card_main.inc index ac9ecfae43..b70d10888b 100644 --- a/asm/include/overlay_trainer_card_main.inc +++ b/asm/include/overlay_trainer_card_main.inc @@ -1,7 +1,7 @@ #include #pragma once .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B8C +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public FontID_String_GetWidth diff --git a/asm/include/overlay_trainer_card_signature.inc b/asm/include/overlay_trainer_card_signature.inc index 0adc2fbe47..c4affcb129 100644 --- a/asm/include/overlay_trainer_card_signature.inc +++ b/asm/include/overlay_trainer_card_signature.inc @@ -1,7 +1,7 @@ #include #pragma once .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B8C +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public FontID_String_GetWidth diff --git a/asm/include/render_text.inc b/asm/include/render_text.inc deleted file mode 100644 index c88ce9b555..0000000000 --- a/asm/include/render_text.inc +++ /dev/null @@ -1,42 +0,0 @@ -#include -#pragma once -.public RenderText -.public sub_020027F0 -.public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B50 -.public sub_02002B8C -.public sub_02002BA8 -.public sub_02002BC4 -.public sub_02002BD4 -.public sub_02002BE4 -.public sub_02002BF4 -.public sub_02002C04 -.public sub_02002C20 -.public sub_02002C40 -.public sub_02002C60 -.public sub_02002C90 -.public FontID_TryLoadGlyph -.public FontID_FlatArray_GetWidthFirstLine -.public GetFontAttribute -.public PlaySE -.public sub_0200EB68 -.public BgCommitTilemapBufferToVram -.public FillBgTilemapRect -.public CopyWindowToVram -.public FillWindowPixelBuffer -.public CopyGlyphToWindow -.public ScrollWindow -.public GetWindowBgId -.public GetWindowWidth -.public GetWindowHeight -.public GetWindowX -.public GetWindowY -.public MsgArray_SkipControlCode -.public MsgArray_GetControlCode -.public MsgArray_ControlCodeGetField -.public GenerateFontHalfRowLookupTable -.public RenderScreenFocusIndicatorTile -.public TouchscreenHitbox_TouchHeldIsIn -.public TouchscreenHitbox_TouchNewIsIn -.public GF_AssertFail -.public gSystem diff --git a/asm/include/render_window.inc b/asm/include/render_window.inc index 7f7333f099..8b7511a0fd 100644 --- a/asm/include/render_window.inc +++ b/asm/include/render_window.inc @@ -1,6 +1,6 @@ #include #pragma once -.public sub_020027F0 +.public TextPrinter_SetDownArrowBaseTile .public CreateSysTaskAndEnvironment .public DestroySysTaskAndEnvironment .public AllocAndReadWholeNarcMemberByIdPair diff --git a/asm/include/text_0205B4EC.inc b/asm/include/text_0205B4EC.inc index 1b8f3b608d..e396a532db 100644 --- a/asm/include/text_0205B4EC.inc +++ b/asm/include/text_0205B4EC.inc @@ -1,8 +1,8 @@ #include #pragma once .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B50 -.public sub_02002B8C +.public TextFlags_SetAutoScrollParam +.public TextFlags_SetCanTouchSpeedUpPrint .public LoadFontPal0 .public LoadFontPal1 .public LoadUserFrameGfx2 diff --git a/asm/include/unk_020755E8.inc b/asm/include/unk_020755E8.inc index 9266eab566..9a211b9ab6 100644 --- a/asm/include/unk_020755E8.inc +++ b/asm/include/unk_020755E8.inc @@ -1,7 +1,7 @@ #include #pragma once .public TextFlags_SetCanABSpeedUpPrint -.public sub_02002B8C +.public TextFlags_SetCanTouchSpeedUpPrint .public FontID_Alloc .public FontID_Release .public PaletteData_Init diff --git a/asm/include/unk_020921A4.inc b/asm/include/unk_020921A4.inc index bdae07385d..0ad9b31db9 100644 --- a/asm/include/unk_020921A4.inc +++ b/asm/include/unk_020921A4.inc @@ -1,7 +1,7 @@ #include #pragma once .public RegisterMainOverlay -.public sub_02002B8C +.public TextFlags_SetCanTouchSpeedUpPrint .public LoadFontPal0 .public OverlayManager_CreateAndGetData .public OverlayManager_GetData diff --git a/asm/overlay_01_021F3F50.s b/asm/overlay_01_021F3F50.s index 10f60233d3..d4d469d630 100644 --- a/asm/overlay_01_021F3F50.s +++ b/asm/overlay_01_021F3F50.s @@ -558,9 +558,9 @@ ov01_021F4360: ; 0x021F4360 mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint add r0, r4, #0 ldr r1, [r4] add r0, #0x1c diff --git a/asm/overlay_03.s b/asm/overlay_03.s index a87926fc21..f52d021907 100644 --- a/asm/overlay_03.s +++ b/asm/overlay_03.s @@ -1149,9 +1149,9 @@ _0225476A: mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, _022547D0 ; =ov03_022598A0 mov r3, #0 ldr r2, [r0] diff --git a/asm/overlay_101.s b/asm/overlay_101.s index 2eecf6d88d..a36d637a9c 100644 --- a/asm/overlay_101.s +++ b/asm/overlay_101.s @@ -16950,7 +16950,7 @@ _021EFB18: add r0, #0x58 bl CopyWindowToVram mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint add r0, r4, #0 bl ov101_021F0B84 mov r0, #1 @@ -17593,9 +17593,9 @@ _021F001A: bl ov101_021F1FF4 _021F0026: mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, _021F0038 ; =ov101_021F8400 - bl sub_02002C20 + bl TextFlags_SetFastForwardTouchButtonHitbox add r0, r4, #0 pop {r3, r4, r5, pc} nop @@ -17620,8 +17620,8 @@ ov101_021F003C: ; 0x021F003C add r0, #0x58 bl CopyWindowToVram mov r0, #0 - bl sub_02002B8C - bl sub_02002C40 + bl TextFlags_SetCanTouchSpeedUpPrint + bl TextFlags_UnsetFastForwardTouchButtonHitbox add r0, r4, #0 mov r1, #0 bl ov101_021F0464 @@ -18273,7 +18273,7 @@ _021F0586: cmp r6, #4 blt _021F0586 ldr r0, _021F05C8 ; =0x000003E1 - bl sub_020027F0 + bl TextPrinter_SetDownArrowBaseTile add sp, #0x14 pop {r4, r5, r6, r7, pc} .balign 4, 0 @@ -18344,7 +18344,7 @@ _021F0628: add r6, #0x44 strb r0, [r6] mov r0, #1 - bl sub_02002BA8 + bl TextFlags_SetAlternateDownArrow mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint pop {r4, r5, r6, pc} @@ -18373,7 +18373,7 @@ _021F0660: ldr r0, [r6, #0x14] bl DestroyMsgData mov r0, #0 - bl sub_02002BA8 + bl TextFlags_SetAlternateDownArrow mov r0, #0 bl TextFlags_SetCanABSpeedUpPrint pop {r4, r5, r6, pc} @@ -22037,7 +22037,7 @@ ov101_021F2220: ; 0x021F2220 mov r0, #0 pop {r4, pc} _021F223A: - bl sub_02002C04 + bl TextFlags_GetIsTouchSpeedingUpPrint add r4, #0xaa strb r0, [r4] mov r0, #1 diff --git a/asm/overlay_103.s b/asm/overlay_103.s index c7bab4b3f4..5d526090e8 100644 --- a/asm/overlay_103.s +++ b/asm/overlay_103.s @@ -617,7 +617,7 @@ ov103_021ECE18: ; 0x021ECE18 lsl r1, r1, #4 str r0, [r4, r1] mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint pop {r4, pc} .balign 4, 0 thumb_func_end ov103_021ECE18 @@ -627,7 +627,7 @@ ov103_021ECE54: ; 0x021ECE54 push {r4, lr} add r4, r0, #0 mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r0, #0x23 lsl r0, r0, #4 ldr r0, [r4, r0] diff --git a/asm/overlay_111.s b/asm/overlay_111.s index 0f76e013e4..fea0b9427f 100644 --- a/asm/overlay_111.s +++ b/asm/overlay_111.s @@ -768,7 +768,7 @@ _021E5E46: mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, _021E5F00 ; =ov111_021E5DF0 add r1, r4, #0 bl Main_SetVBlankIntrCB diff --git a/asm/overlay_112.s b/asm/overlay_112.s index 3b60ff3b25..38257b2871 100644 --- a/asm/overlay_112.s +++ b/asm/overlay_112.s @@ -3999,7 +3999,7 @@ ov112_021E7768: ; 0x021E7768 add r0, r4, #0 bl ov112_021EA4F4 mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint add r0, r4, #0 bl ov112_021E9C98 ldr r0, _021E77D8 ; =ov112_021E79A8 @@ -4173,7 +4173,7 @@ ov112_021E7910: ; 0x021E7910 mov r0, #0 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint add r0, r4, #0 bl ov112_021E77E4 add r0, r5, #0 diff --git a/asm/overlay_12_022378C0.s b/asm/overlay_12_022378C0.s index 7d96318a74..6bbe43ae71 100644 --- a/asm/overlay_12_022378C0.s +++ b/asm/overlay_12_022378C0.s @@ -1109,9 +1109,9 @@ _022386C0: mov r0, #0 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, [r4, #8] mov r1, #3 bl WindowArray_Delete @@ -4950,19 +4950,19 @@ ov12_0223A620: ; 0x0223A620 beq _0223A648 _0223A634: mov r0, #1 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint pop {r3, pc} _0223A648: mov r0, #3 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint pop {r3, pc} .balign 4, 0 _0223A65C: .word 0x00000404 diff --git a/asm/overlay_12_02266024.s b/asm/overlay_12_02266024.s index d189073d36..33c6d251ca 100644 --- a/asm/overlay_12_02266024.s +++ b/asm/overlay_12_02266024.s @@ -253,8 +253,8 @@ _022662C0: _022662CA: add r0, r4, #0 bl FreeToHeap - bl sub_02002BD4 - bl sub_02002BF4 + bl TextFlags_ResetHasSpedUpInput + bl TextFlags_ResetHasContinuedInput ldr r0, _02266314 ; =ov12_02269954 ldr r2, _02266318 ; =0x0000D6D8 add r1, r6, #0 @@ -7045,12 +7045,12 @@ _02269950: .word 0x00000694 ov12_02269954: ; 0x02269954 push {r3, r4, r5, r6, r7, lr} add r5, r1, #0 - bl sub_02002BC4 + bl TextFlags_GetHasSpedUpInput add r6, r0, #0 - bl sub_02002BE4 + bl TextFlags_GetHasContinuedInput add r7, r0, #0 - bl sub_02002BD4 - bl sub_02002BF4 + bl TextFlags_ResetHasSpedUpInput + bl TextFlags_ResetHasContinuedInput ldr r0, [r5] bl BattleSystem_GetPaletteData add r4, r0, #0 diff --git a/asm/overlay_15.s b/asm/overlay_15.s index 67d5de31e7..fe9085762a 100644 --- a/asm/overlay_15.s +++ b/asm/overlay_15.s @@ -96,7 +96,7 @@ Bag_Init: ; 0x021F9380 add r0, r4, #0 bl ov15_021FE020 mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint add r0, r4, #0 bl ov15_021FE4C8 add r0, r4, #0 @@ -11518,7 +11518,7 @@ _021FEF6C: mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #9 lsl r0, r0, #6 ldr r0, [r5, r0] diff --git a/asm/overlay_27.s b/asm/overlay_27.s index d692535330..af81139a9b 100644 --- a/asm/overlay_27.s +++ b/asm/overlay_27.s @@ -4514,7 +4514,7 @@ ov27_0225C250: ; 0x0225C250 mov r1, #1 bl GfGfx_EngineBTogglePlanes mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint add r0, r6, #0 add sp, #8 pop {r3, r4, r5, r6, r7, pc} @@ -4561,7 +4561,7 @@ _0225C3C4: ldr r0, [r7, r0] bl SpriteList_Delete mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint add r0, r7, #0 bl ov27_0225C930 mov r0, #4 diff --git a/asm/overlay_31.s b/asm/overlay_31.s index aa2735833f..70e0250a2d 100644 --- a/asm/overlay_31.s +++ b/asm/overlay_31.s @@ -90,9 +90,9 @@ ov31_0225D520: ; 0x0225D520 mov r1, #1 bl GfGfx_EngineBTogglePlanes mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, _0225D608 ; =_0225EE40 - bl sub_02002C20 + bl TextFlags_SetFastForwardTouchButtonHitbox add r0, r5, #0 add sp, #8 pop {r3, r4, r5, r6, r7, pc} @@ -239,7 +239,7 @@ ov31_0225D710: ; 0x0225D710 bl SysTask_GetData add r4, r0, #0 mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint add r0, r4, #0 bl ov31_0225DBA0 add r0, r4, #0 diff --git a/asm/overlay_39_thumb.s b/asm/overlay_39_thumb.s index 868d34a6d1..dc46c50115 100644 --- a/asm/overlay_39_thumb.s +++ b/asm/overlay_39_thumb.s @@ -2501,9 +2501,9 @@ ov39_02228140: ; 0x02228140 mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, _02228304 ; =ov39_02228418 add r1, r5, #0 bl Main_SetVBlankIntrCB @@ -2659,9 +2659,9 @@ _02228394: mov r0, #0 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint bl sub_0203A914 add r0, r5, #0 bl OverlayManager_FreeData diff --git a/asm/overlay_40.s b/asm/overlay_40.s index 995e4c3e17..e206600f8d 100644 --- a/asm/overlay_40.s +++ b/asm/overlay_40.s @@ -88,7 +88,7 @@ ov40_0222B6E0: ; 0x0222B6E0 add r0, r4, #0 bl ov40_0222C360 mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, _0222B928 ; =ov40_0222BD04 add r1, r4, #0 bl Main_SetVBlankIntrCB @@ -347,7 +347,7 @@ _0222B9FE: ldr r0, [r5, #0x2c] bl TouchHitboxController_Destroy mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r7, _0222BA88 ; =0x0000087C mov r6, #0 add r4, r5, #0 diff --git a/asm/overlay_41.s b/asm/overlay_41.s index 3e90d666bb..56ab2c0098 100644 --- a/asm/overlay_41.s +++ b/asm/overlay_41.s @@ -2240,7 +2240,7 @@ _02246F76: cmp r0, #1 bne _02246F9E mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, _02247138 ; =0x00000568 mov r1, #0x1b add r0, r4, r0 @@ -2293,7 +2293,7 @@ _02246FD8: mov r3, #0x30 bl ov41_0224AC08 add r0, r6, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, [r5] add r0, r0, #1 str r0, [r5] diff --git a/asm/overlay_43.s b/asm/overlay_43.s index a5ee42712a..6302fa043a 100644 --- a/asm/overlay_43.s +++ b/asm/overlay_43.s @@ -494,7 +494,7 @@ _0222A2DE: mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint pop {r4, r5, r6, pc} .balign 4, 0 thumb_func_end ov43_0222A290 @@ -507,7 +507,7 @@ ov43_0222A2F0: ; 0x0222A2F0 add r4, r1, #0 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, [r4, #4] ldr r1, [r5] bl sub_02018410 @@ -764,9 +764,9 @@ ov43_0222A48C: ; 0x0222A48C mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint pop {r4, r5, r6, pc} nop _0222A4FC: .word gSystem + 0x60 @@ -1402,7 +1402,7 @@ ov43_0222A9F4: ; 0x0222A9F4 cmp r0, #1 bne _0222AA22 mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint add r0, r5, #0 add r0, #0x84 ldr r0, [r0] @@ -1422,7 +1422,7 @@ _0222AA22: ldr r2, [r5, #0x78] bl StringExpandPlaceholders mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r0, #4 str r0, [sp] mov r0, #2 @@ -1457,7 +1457,7 @@ ov43_0222AA70: ; 0x0222AA70 cmp r0, #1 bne _0222AA98 mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint add r0, r4, #0 add r0, #0x84 ldr r0, [r0] @@ -2794,7 +2794,7 @@ ov43_0222B4BC: ; 0x0222B4BC add r2, r6, #0 bl StringExpandPlaceholders mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r3, #0 str r3, [sp] ldr r0, [r5, #0x38] @@ -2836,8 +2836,8 @@ ov43_0222B534: ; 0x0222B534 cmp r0, #0 bne _0222B556 mov r0, #0 - bl sub_02002B8C - bl sub_02002C04 + bl TextFlags_SetCanTouchSpeedUpPrint + bl TextFlags_GetIsTouchSpeedingUpPrint str r0, [r4] mov r0, #1 pop {r4, pc} @@ -4923,7 +4923,7 @@ ov43_0222C550: ; 0x0222C550 add r2, r6, #0 bl StringExpandPlaceholders mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r3, #0 add r0, r5, #0 add r2, r5, #0 @@ -4972,8 +4972,8 @@ ov43_0222C5D8: ; 0x0222C5D8 cmp r0, #0 bne _0222C5FC mov r0, #0 - bl sub_02002B8C - bl sub_02002C04 + bl TextFlags_SetCanTouchSpeedUpPrint + bl TextFlags_GetIsTouchSpeedingUpPrint str r0, [r4] mov r0, #1 pop {r4, pc} diff --git a/asm/overlay_44.s b/asm/overlay_44.s index 41dc841048..71d88b9fcd 100644 --- a/asm/overlay_44.s +++ b/asm/overlay_44.s @@ -1171,7 +1171,7 @@ ov44_0222A758: ; 0x0222A758 _0222A780: bl UnloadDwcOverlay mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint b _0222A792 _0222A78C: bl ov00_021E6EBC @@ -10966,9 +10966,9 @@ _0222F5F8: mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r3, #0 str r3, [sp] str r4, [sp, #4] diff --git a/asm/overlay_49.s b/asm/overlay_49.s index f2e5aaaeba..3393176328 100644 --- a/asm/overlay_49.s +++ b/asm/overlay_49.s @@ -2628,9 +2628,9 @@ _02259B02: mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, [r5] bl Save_PlayerData_GetProfileAddr mov r1, #0xfd diff --git a/asm/overlay_59.s b/asm/overlay_59.s index 5513be9d2d..3875a52a7f 100644 --- a/asm/overlay_59.s +++ b/asm/overlay_59.s @@ -1159,7 +1159,7 @@ _022385C4: mov r0, #1 str r0, [r4, #0x40] mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r0, #0xff add r4, #0x47 strb r0, [r4] @@ -1182,7 +1182,7 @@ _022385F4: ldr r0, _02238618 ; =0x000005DC bl PlaySE mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r0, #0xff add r4, #0x47 strb r0, [r4] @@ -2063,7 +2063,7 @@ ov59_02238CFC: ; 0x02238CFC cmp r4, #0 beq _02238D4E mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r3, #0 str r3, [sp] str r4, [sp, #4] @@ -7443,7 +7443,7 @@ ov59_0223B68C: ; 0x0223B68C mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r3, [r6] mov r0, #0 mov r1, #0x1b @@ -7504,7 +7504,7 @@ ov59_0223B6FC: ; 0x0223B6FC ldr r0, [r4, #0x5c] bl DestroyMsgData mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r0, #0 bl TextFlags_SetCanABSpeedUpPrint mov r0, #4 diff --git a/asm/overlay_68.s b/asm/overlay_68.s index bd26750517..5b3f3fc57b 100644 --- a/asm/overlay_68.s +++ b/asm/overlay_68.s @@ -197,7 +197,7 @@ ov68_021E5A58: ; 0x021E5A58 and r0, r1 str r0, [r2] mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, [r4] ldr r0, [r0, #0xc] bl sub_020183F0 @@ -277,7 +277,7 @@ ov68_021E5B14: ; 0x021E5B14 ldr r1, [r4, r1] bl sub_02018410 mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint bl GF_DestroyVramTransferManager mov r0, #0 add r1, r0, #0 diff --git a/asm/overlay_69.s b/asm/overlay_69.s index 4ad08e83c9..daba097cc7 100644 --- a/asm/overlay_69.s +++ b/asm/overlay_69.s @@ -106,9 +106,9 @@ _021E5960: mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint add r0, r5, #0 bl ov69_021E6138 mov r0, #1 diff --git a/asm/overlay_70.s b/asm/overlay_70.s index 2497357c97..ba6c4e3528 100644 --- a/asm/overlay_70.s +++ b/asm/overlay_70.s @@ -1682,7 +1682,7 @@ _02238446: _0223856E: bl sub_02034D8C mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r0, #0 str r0, [r5] add sp, #0x10 @@ -1888,7 +1888,7 @@ ov70_022386F4: ; 0x022386F4 bl ov70_0223887C bl sub_02034DE0 mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, [r4, #4] bl FreeToHeap ldr r0, [r4] diff --git a/asm/overlay_72.s b/asm/overlay_72.s index 1df3040218..0596b46302 100644 --- a/asm/overlay_72.s +++ b/asm/overlay_72.s @@ -849,7 +849,7 @@ _02237E36: mov r2, #1 bl sub_02004EC4 mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r2, _02237F98 ; =0x04000304 ldrh r1, [r2] lsr r0, r2, #0xb @@ -1005,7 +1005,7 @@ NintendoWfc_Exit: ; 0x02238070 pop {r3, r4, r5, pc} _02238086: mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r0, #4 bl FontID_Release ldr r0, [r4, #0x24] diff --git a/asm/overlay_74_thumb.s b/asm/overlay_74_thumb.s index 1ddff1bbac..5b8ff583c7 100644 --- a/asm/overlay_74_thumb.s +++ b/asm/overlay_74_thumb.s @@ -24356,7 +24356,7 @@ ov74_022330D0: ; 0x022330D0 beq _0223310C bl ov74_02232B18 mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, _0223312C ; =ov74_0223C9B8 lsl r1, r4, #2 ldr r0, [r0, r1] @@ -24384,7 +24384,7 @@ _0223310C: cmp r0, #0 bne _02233126 mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r0, #1 pop {r3, r4, r5, pc} _02233126: @@ -24405,7 +24405,7 @@ ov74_02233134: ; 0x02233134 beq _02233170 bl ov74_02232B18 mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, _02233194 ; =ov74_0223C9B8 lsl r1, r4, #2 ldr r0, [r0, r1] @@ -24435,7 +24435,7 @@ _02233170: add r0, r5, #0 bl ov74_02232F5C mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r0, #1 pop {r3, r4, r5, pc} _02233190: @@ -24458,7 +24458,7 @@ ov74_0223319C: ; 0x0223319C beq _022331DE bl ov74_02232B18 mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r1, #0x46 ldr r0, [r5, #8] lsl r1, r1, #4 @@ -24488,7 +24488,7 @@ _022331DE: cmp r0, #0 bne _0223321C mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r0, #1 pop {r3, r4, r5, pc} _022331FC: @@ -24502,7 +24502,7 @@ _022331FC: beq _0223321C _0223320C: mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, _02233220 ; =SEQ_SE_DP_SELECT bl PlaySE mov r0, #1 diff --git a/asm/overlay_75.s b/asm/overlay_75.s index f26ac60cf0..95b3075f30 100644 --- a/asm/overlay_75.s +++ b/asm/overlay_75.s @@ -975,9 +975,9 @@ _0224707C: mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, _02247114 ; =ov75_02247234 add r1, r5, #0 bl Main_SetVBlankIntrCB @@ -1106,9 +1106,9 @@ _022471A4: mov r0, #0 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint bl sub_0203A914 add r0, r5, #0 bl OverlayManager_FreeData diff --git a/asm/overlay_80_0222BDF4.s b/asm/overlay_80_0222BDF4.s index d67b561795..b7e9684cc1 100644 --- a/asm/overlay_80_0222BDF4.s +++ b/asm/overlay_80_0222BDF4.s @@ -533,7 +533,7 @@ ov80_0222C17C: ; 0x0222C17C cmp r0, #0 bne _0222C196 mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r0, #1 pop {r3, pc} _0222C196: @@ -4999,18 +4999,18 @@ ov80_0222E344: ; 0x0222E344 add r4, r2, #0 bl TextFlags_SetCanABSpeedUpPrint ldr r0, [sp, #0x20] - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam cmp r4, #0 beq _0222E362 cmp r4, #0xff bne _0222E36A _0222E362: mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint b _0222E370 _0222E36A: mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint _0222E370: mov r3, #0 str r3, [sp] @@ -7274,7 +7274,7 @@ ov80_0222F4D0: ; 0x0222F4D0 cmp r0, #0 bne _0222F4EA mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r0, #1 pop {r3, pc} _0222F4EA: diff --git a/asm/overlay_81.s b/asm/overlay_81.s index bf1ecfd757..cb7fac671c 100644 --- a/asm/overlay_81.s +++ b/asm/overlay_81.s @@ -130,7 +130,7 @@ _0223DE5C: add r0, r4, #0 bl ov81_02240D64 mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldrb r0, [r4, #9] bl ov80_02237254 cmp r0, #1 @@ -660,7 +660,7 @@ _0223E2A8: strh r2, [r0, #2] _0223E2CE: mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, _0223E30C ; =0x0000046C ldr r0, [r4, r0] bl ov81_02241BC8 diff --git a/asm/overlay_82.s b/asm/overlay_82.s index bb2eb276c4..97c08761b8 100644 --- a/asm/overlay_82.s +++ b/asm/overlay_82.s @@ -86,7 +86,7 @@ _0223DE0E: mov r0, #0 str r0, [r6] mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r0, #1 pop {r4, r5, r6, pc} .balign 4, 0 diff --git a/asm/overlay_89.s b/asm/overlay_89.s index 42295f9005..fb6e1f5d6e 100644 --- a/asm/overlay_89.s +++ b/asm/overlay_89.s @@ -276,9 +276,9 @@ _02258A4A: mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, _02258AF8 ; =ov89_02258FF4 ldr r2, _02258AFC ; =0x0000EA60 add r1, r5, #0 @@ -871,9 +871,9 @@ ov89_02258F00: ; 0x02258F00 mov r0, #0 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint bl sub_0203A914 add r0, r5, #0 bl OverlayManager_FreeData diff --git a/asm/overlay_90.s b/asm/overlay_90.s index 5f1ff71d85..cad3caced4 100644 --- a/asm/overlay_90.s +++ b/asm/overlay_90.s @@ -1635,7 +1635,7 @@ ov90_0225938C: ; 0x0225938C bl Options_GetFrame add r4, r0, #0 mov r0, #1 - bl sub_02002C60 + bl TextFlags_BeginAutoScroll lsl r0, r4, #0x18 lsr r0, r0, #0x18 str r0, [sp] @@ -1724,7 +1724,7 @@ _0225943E: add r6, #0x10 cmp r4, #2 blt _0225943E - bl sub_02002C90 + bl TextFlags_EndAutoScroll pop {r3, r4, r5, r6, r7, pc} .balign 4, 0 thumb_func_end ov90_02259434 diff --git a/asm/overlay_93_thumb_1.s b/asm/overlay_93_thumb_1.s index 429ccc1a86..8ef1c22681 100644 --- a/asm/overlay_93_thumb_1.s +++ b/asm/overlay_93_thumb_1.s @@ -563,11 +563,11 @@ ov93_0225C768: ; 0x0225C768 mov r1, #1 bl GfGfx_EngineBTogglePlanes mov r0, #1 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #0 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, [r5, #0x28] bl sub_0200E2B0 mov r1, #0x75 @@ -1075,9 +1075,9 @@ _0225CD72: mov r0, #0 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint bl sub_0203A914 mov r0, #1 pop {r3, r4, r5, r6, r7, pc} diff --git a/asm/overlay_95.s b/asm/overlay_95.s index a87995ae39..029ec9e054 100644 --- a/asm/overlay_95.s +++ b/asm/overlay_95.s @@ -2681,7 +2681,7 @@ ov95_021E6D70: ; 0x021E6D70 add r0, r4, #4 bl ov95_021E619C mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, [r4, #4] ldr r1, [r4, #0x54] ldr r2, [r4, #0x50] @@ -2805,7 +2805,7 @@ ov95_021E6F0C: ; 0x021E6F0C ldr r0, [r4, #8] bl PaletteData_Free mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, [r4, #4] mov r1, #1 bl FreeBgTilemapBuffer diff --git a/asm/overlay_96.s b/asm/overlay_96.s index bd2aea3bdf..5ff63859ba 100644 --- a/asm/overlay_96.s +++ b/asm/overlay_96.s @@ -116,17 +116,17 @@ _021E5986: mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint b _021E5A10 _021E59FE: mov r0, #0 bl TextFlags_SetCanABSpeedUpPrint mov r0, #1 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint _021E5A10: add r0, r4, #0 mov r1, #0 @@ -352,9 +352,9 @@ _021E5BBC: mov r0, #0 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, _021E5C24 ; =0x00000614 ldr r0, [r4, r0] bl ov96_021E9320 diff --git a/asm/overlay_trainer_card_main.s b/asm/overlay_trainer_card_main.s index 81dd74ffd4..3f58c4b0d4 100644 --- a/asm/overlay_trainer_card_main.s +++ b/asm/overlay_trainer_card_main.s @@ -195,7 +195,7 @@ _021E5C2C: mov r0, #4 bl sub_02021148 mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r1, #0 @@ -505,7 +505,7 @@ TrainerCardMainApp_Exit: ; 0x021E5EC8 bl ov51_021E6644 bl sub_02021238 mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r0, #0 bl TextFlags_SetCanABSpeedUpPrint add r0, r4, #0 diff --git a/asm/overlay_trainer_card_signature.s b/asm/overlay_trainer_card_signature.s index 5a243dae70..5d8ed9ed02 100644 --- a/asm/overlay_trainer_card_signature.s +++ b/asm/overlay_trainer_card_signature.s @@ -71,7 +71,7 @@ _021E80D6: bl NewMsgDataFromNarc str r0, [r4, #0x14] mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r0, #4 @@ -271,7 +271,7 @@ _021E82FC: bl ov52_021E85A0 bl sub_02021238 mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r0, #0 bl TextFlags_SetCanABSpeedUpPrint ldr r0, [r6, #0x14] diff --git a/asm/render_text.s b/asm/render_text.s deleted file mode 100644 index 6b0f224a03..0000000000 --- a/asm/render_text.s +++ /dev/null @@ -1,1503 +0,0 @@ - .include "asm/macros.inc" - .include "render_text.inc" - .include "global.inc" - - .rodata - -_020F56BC: - .byte 0x00, 0x01, 0x02, 0x01 - - .bss - -_02111884: - .space 4 - -_02111888: - .space 2 - - .text - - thumb_func_start sub_020021A0 -sub_020021A0: ; 0x020021A0 - push {r3, lr} - ldr r1, _02002210 ; =gSystem - ldr r2, [r1, #0x44] - mov r1, #3 - tst r1, r2 - beq _020021C2 - ldrb r0, [r0] - lsl r0, r0, #0x1b - lsr r0, r0, #0x1f - beq _020021C2 - ldr r1, _02002214 ; =_02111884 - mov r0, #1 - ldrb r2, [r1, #3] - bic r2, r0 - strb r2, [r1, #3] - mov r0, #1 - pop {r3, pc} -_020021C2: - ldr r1, _02002214 ; =_02111884 - ldrb r0, [r1, #2] - lsl r0, r0, #0x1b - lsr r0, r0, #0x1f - beq _0200220A - ldr r0, _02002218 ; =gSystem + 0x40 - ldrh r0, [r0, #0x26] - cmp r0, #0 - bne _020021D8 - mov r0, #0 - pop {r3, pc} -_020021D8: - ldrb r2, [r1, #3] - lsl r0, r2, #0x1e - lsr r0, r0, #0x1f - beq _020021FE - ldr r0, _0200221C ; =_02111888 - bl TouchscreenHitbox_TouchHeldIsIn - cmp r0, #0 - beq _020021FA - ldr r1, _02002214 ; =_02111884 - mov r0, #1 - ldrb r2, [r1, #3] - bic r2, r0 - mov r0, #1 - orr r2, r0 - strb r2, [r1, #3] - pop {r3, pc} -_020021FA: - mov r0, #0 - pop {r3, pc} -_020021FE: - mov r0, #1 - bic r2, r0 - mov r0, #1 - orr r2, r0 - strb r2, [r1, #3] - pop {r3, pc} -_0200220A: - mov r0, #0 - pop {r3, pc} - nop -_02002210: .word gSystem -_02002214: .word _02111884 -_02002218: .word gSystem + 0x40 -_0200221C: .word _02111888 - thumb_func_end sub_020021A0 - - thumb_func_start sub_02002220 -sub_02002220: ; 0x02002220 - push {r3, lr} - ldr r0, _02002288 ; =gSystem - ldr r1, [r0, #0x48] - mov r0, #3 - tst r0, r1 - beq _0200223A - ldr r1, _0200228C ; =_02111884 - mov r0, #1 - ldrb r2, [r1, #3] - bic r2, r0 - strb r2, [r1, #3] - mov r0, #1 - pop {r3, pc} -_0200223A: - ldr r1, _0200228C ; =_02111884 - ldrb r0, [r1, #2] - lsl r0, r0, #0x1b - lsr r0, r0, #0x1f - beq _02002282 - ldr r0, _02002290 ; =gSystem + 0x40 - ldrh r0, [r0, #0x24] - cmp r0, #0 - bne _02002250 - mov r0, #0 - pop {r3, pc} -_02002250: - ldrb r2, [r1, #3] - lsl r0, r2, #0x1e - lsr r0, r0, #0x1f - beq _02002276 - ldr r0, _02002294 ; =_02111888 - bl TouchscreenHitbox_TouchNewIsIn - cmp r0, #0 - beq _02002272 - ldr r1, _0200228C ; =_02111884 - mov r0, #1 - ldrb r2, [r1, #3] - bic r2, r0 - mov r0, #1 - orr r2, r0 - strb r2, [r1, #3] - pop {r3, pc} -_02002272: - mov r0, #0 - pop {r3, pc} -_02002276: - mov r0, #1 - bic r2, r0 - mov r0, #1 - orr r2, r0 - strb r2, [r1, #3] - pop {r3, pc} -_02002282: - mov r0, #0 - pop {r3, pc} - nop -_02002288: .word gSystem -_0200228C: .word _02111884 -_02002290: .word gSystem + 0x40 -_02002294: .word _02111888 - thumb_func_end sub_02002220 - - thumb_func_start RenderText -RenderText: ; 0x02002298 - push {r3, r4, r5, r6, lr} - sub sp, #0xc - add r4, r0, #0 - add r1, r4, #0 - add r1, #0x28 - ldrb r1, [r1] - add r6, r4, #0 - add r6, #0x20 - cmp r1, #8 - bls _020022AE - b _020027EA -_020022AE: - add r1, r1, r1 - add r1, pc - ldrh r1, [r1, #6] - lsl r1, r1, #0x10 - asr r1, r1, #0x10 - add pc, r1 -_020022BA: ; jump table - .short _020022CC - _020022BA - 2 ; case 0 - .short _0200269A - _020022BA - 2 ; case 1 - .short _020026B4 - _020022BA - 2 ; case 2 - .short _020026DE - _020022BA - 2 ; case 3 - .short _0200270E - _020022BA - 2 ; case 4 - .short _02002764 - _020022BA - 2 ; case 5 - .short _02002770 - _020022BA - 2 ; case 6 - .short _02002790 - _020022BA - 2 ; case 7 - .short _020027BA - _020022BA - 2 ; case 8 -_020022CC: - add r0, r6, #0 - bl sub_020021A0 - cmp r0, #0 - beq _020022F4 - add r0, r4, #0 - mov r1, #0 - add r0, #0x2a - strb r1, [r0] - add r0, r4, #0 - add r0, #0x29 - ldrb r0, [r0] - lsl r0, r0, #0x19 - lsr r0, r0, #0x19 - beq _020022F4 - ldr r1, _020025B8 ; =_02111884 - mov r0, #0x40 - ldrb r2, [r1, #2] - orr r0, r2 - strb r0, [r1, #2] -_020022F4: - add r0, r4, #0 - add r0, #0x2a - ldrb r0, [r0] - cmp r0, #0 - beq _0200233E - add r0, r4, #0 - add r0, #0x29 - ldrb r0, [r0] - lsl r0, r0, #0x19 - lsr r0, r0, #0x19 - beq _0200233E - add r0, r4, #0 - add r0, #0x2a - ldrb r0, [r0] - sub r1, r0, #1 - add r0, r4, #0 - add r0, #0x2a - strb r1, [r0] - ldr r0, _020025B8 ; =_02111884 - ldrb r0, [r0, #2] - lsl r0, r0, #0x1f - lsr r0, r0, #0x1f - beq _02002338 - bl sub_02002220 - cmp r0, #0 - beq _02002338 - ldrb r1, [r6] - mov r0, #0x10 - add r4, #0x2a - orr r0, r1 - strb r0, [r6] - mov r0, #0 - strb r0, [r4] -_02002338: - add sp, #0xc - mov r0, #3 - pop {r3, r4, r5, r6, pc} -_0200233E: - add r0, r4, #0 - add r0, #0x29 - ldrb r0, [r0] - lsl r0, r0, #0x19 - lsr r1, r0, #0x19 - add r0, r4, #0 - add r0, #0x2a - strb r1, [r0] - ldr r0, [r4] - ldrh r5, [r0] - add r0, r0, #2 - str r0, [r4] - mov r0, #0xf1 - lsl r0, r0, #8 - cmp r5, r0 - bne _02002362 - bl GF_AssertFail -_02002362: - ldr r0, _020025BC ; =0x0000F0FD - cmp r5, r0 - bgt _0200238C - bge _020023C0 - ldr r1, _020025C0 ; =0x000025BD - cmp r5, r1 - bgt _02002382 - sub r0, r1, #1 - cmp r5, r0 - blt _02002380 - bne _0200237A - b _02002630 -_0200237A: - cmp r5, r1 - bne _02002380 - b _02002644 -_02002380: - b _02002658 -_02002382: - mov r0, #0xe - lsl r0, r0, #0xc - cmp r5, r0 - beq _020023A4 - b _02002658 -_0200238C: - ldr r0, _020025C4 ; =0x0000FFFE - cmp r5, r0 - bgt _02002396 - beq _020023CC - b _02002658 -_02002396: - add r0, r0, #1 - cmp r5, r0 - beq _0200239E - b _02002658 -_0200239E: - add sp, #0xc - mov r0, #1 - pop {r3, r4, r5, r6, pc} -_020023A4: - ldrb r0, [r4, #0xa] - mov r1, #1 - strh r0, [r4, #0xc] - ldrb r0, [r4, #9] - bl GetFontAttribute - ldrh r1, [r4, #0x12] - ldrh r2, [r4, #0xe] - add sp, #0xc - add r0, r1, r0 - add r0, r2, r0 - strh r0, [r4, #0xe] - mov r0, #2 - pop {r3, r4, r5, r6, pc} -_020023C0: - ldr r0, [r4] - add sp, #0xc - add r0, r0, #2 - str r0, [r4] - mov r0, #2 - pop {r3, r4, r5, r6, pc} -_020023CC: - ldr r0, [r4] - sub r0, r0, #2 - str r0, [r4] - bl MsgArray_GetControlCode - lsl r0, r0, #0x10 - ldr r1, _020025C8 ; =0x0000FE06 - lsr r0, r0, #0x10 - cmp r0, r1 - bgt _0200240C - blt _020023E4 - b _020025D0 -_020023E4: - mov r1, #2 - lsl r1, r1, #8 - sub r1, r0, r1 - cmp r1, #8 - bhi _02002416 - add r1, r1, r1 - add r1, pc - ldrh r1, [r1, #6] - lsl r1, r1, #0x10 - asr r1, r1, #0x10 - add pc, r1 -_020023FA: ; jump table - .short _02002470 - _020023FA - 2 ; case 0 - .short _020024F0 - _020023FA - 2 ; case 1 - .short _02002512 - _020023FA - 2 ; case 2 - .short _0200252A - _020023FA - 2 ; case 3 - .short _02002536 - _020023FA - 2 ; case 4 - .short _02002542 - _020023FA - 2 ; case 5 - .short _0200256E - _020023FA - 2 ; case 6 - .short _0200249C - _020023FA - 2 ; case 7 - .short _020024C6 - _020023FA - 2 ; case 8 -_0200240C: - mov r1, #0xff - lsl r1, r1, #8 - cmp r0, r1 - bgt _02002418 - beq _02002422 -_02002416: - b _02002622 -_02002418: - add r1, r1, #1 - cmp r0, r1 - bne _02002420 - b _02002590 -_02002420: - b _02002622 -_02002422: - ldr r0, [r4] - mov r1, #0 - bl MsgArray_ControlCodeGetField - lsl r0, r0, #0x10 - lsr r0, r0, #0x10 - cmp r0, #0xff - bne _02002452 - ldrb r0, [r4, #0x15] - ldrb r2, [r4, #0x1b] - sub r1, r0, #1 - lsr r0, r1, #0x1f - add r0, r1, r0 - asr r0, r0, #1 - add r0, #0x64 - strb r0, [r4, #0x1b] - cmp r2, #0x64 - blo _02002492 - cmp r2, #0x6b - bhs _02002492 - sub r2, #0x64 - lsl r0, r2, #0x10 - lsr r0, r0, #0x10 - b _0200245A -_02002452: - cmp r0, #0x64 - blo _0200245A - strb r0, [r4, #0x1b] - b _02002622 -_0200245A: - lsl r1, r0, #1 - add r0, r1, #1 - strb r0, [r4, #0x15] - add r0, r1, #2 - strb r0, [r4, #0x17] - ldrb r0, [r4, #0x15] - ldrb r1, [r4, #0x16] - ldrb r2, [r4, #0x17] - bl GenerateFontHalfRowLookupTable - b _02002622 -_02002470: - ldr r0, [r4] - mov r1, #0 - bl MsgArray_ControlCodeGetField - lsl r0, r0, #0x10 - lsr r3, r0, #0x10 - ldrh r1, [r4, #0xc] - ldrh r2, [r4, #0xe] - add r0, r4, #0 - bl RenderScreenFocusIndicatorTile - add r0, r4, #0 - add r0, #0x29 - ldrb r0, [r0] - lsl r0, r0, #0x18 - lsr r0, r0, #0x1f - bne _02002494 -_02002492: - b _02002622 -_02002494: - ldr r0, [r4, #4] - bl CopyWindowToVram - b _02002622 -_0200249C: - add r0, r4, #0 - mov r1, #7 - add r0, #0x28 - strb r1, [r0] - add r0, r4, #0 - bl sub_020027FC - ldr r0, [r4] - bl MsgArray_SkipControlCode - str r0, [r4] - mov r1, #0xe - ldrh r2, [r0] - lsl r1, r1, #0xc - cmp r2, r1 - bne _020024C0 - add r0, r0, #2 - str r0, [r4] -_020024C0: - add sp, #0xc - mov r0, #3 - pop {r3, r4, r5, r6, pc} -_020024C6: - add r0, r4, #0 - mov r1, #8 - add r0, #0x28 - strb r1, [r0] - add r0, r4, #0 - bl sub_020027FC - ldr r0, [r4] - bl MsgArray_SkipControlCode - str r0, [r4] - mov r1, #0xe - ldrh r2, [r0] - lsl r1, r1, #0xc - cmp r2, r1 - bne _020024EA - add r0, r0, #2 - str r0, [r4] -_020024EA: - add sp, #0xc - mov r0, #3 - pop {r3, r4, r5, r6, pc} -_020024F0: - ldr r0, [r4] - mov r1, #0 - bl MsgArray_ControlCodeGetField - add r1, r4, #0 - add r1, #0x2a - strb r0, [r1] - ldr r0, [r4] - bl MsgArray_SkipControlCode - str r0, [r4] - mov r0, #6 - add r4, #0x28 - strb r0, [r4] - add sp, #0xc - mov r0, #3 - pop {r3, r4, r5, r6, pc} -_02002512: - ldr r0, [r4] - mov r1, #0 - bl MsgArray_ControlCodeGetField - strh r0, [r4, #0x2e] - ldr r0, [r4] - bl MsgArray_SkipControlCode - str r0, [r4] - add sp, #0xc - mov r0, #3 - pop {r3, r4, r5, r6, pc} -_0200252A: - ldr r0, [r4] - mov r1, #0 - bl MsgArray_ControlCodeGetField - strh r0, [r4, #0xc] - b _02002622 -_02002536: - ldr r0, [r4] - mov r1, #0 - bl MsgArray_ControlCodeGetField - strh r0, [r4, #0xe] - b _02002622 -_02002542: ; 0x0205 - ldr r0, [r4, #4] - bl GetWindowWidth - lsl r5, r0, #3 - ldrb r0, [r4, #9] - ldrh r2, [r4, #0x10] - ldr r1, [r4] - bl FontID_FlatArray_GetWidthFirstLine - cmp r0, r5 - bge _02002568 - sub r1, r5, r0 - lsr r0, r1, #0x1f - add r0, r1, r0 - ldrb r2, [r4, #0xa] - asr r0, r0, #1 - add r0, r2, r0 - strh r0, [r4, #0xc] - b _02002622 -_02002568: - ldrb r0, [r4, #0xa] - strh r0, [r4, #0xc] - b _02002622 -_0200256E: - ldr r0, [r4, #4] - bl GetWindowWidth - lsl r5, r0, #3 - ldrb r0, [r4, #9] - ldrh r2, [r4, #0x10] - ldr r1, [r4] - bl FontID_FlatArray_GetWidthFirstLine - cmp r0, r5 - bge _0200258A - sub r0, r5, r0 - strh r0, [r4, #0xc] - b _02002622 -_0200258A: - ldrb r0, [r4, #0xa] - strh r0, [r4, #0xc] - b _02002622 -_02002590: - ldr r0, [r4] - mov r1, #0 - bl MsgArray_ControlCodeGetField - lsl r0, r0, #0x10 - lsr r0, r0, #0x10 - cmp r0, #0x64 - beq _020025A6 - cmp r0, #0xc8 - beq _020025AE - b _02002622 -_020025A6: - mov r0, #0 - strh r0, [r4, #0x18] - strb r0, [r4, #0x1a] - b _02002622 -_020025AE: - ldr r0, _020025CC ; =0x0000FFFC - strh r0, [r4, #0x18] - mov r0, #0 - strb r0, [r4, #0x1a] - b _02002622 - .balign 4, 0 -_020025B8: .word _02111884 -_020025BC: .word 0x0000F0FD -_020025C0: .word 0x000025BD -_020025C4: .word 0x0000FFFE -_020025C8: .word 0x0000FE06 -_020025CC: .word 0x0000FFFC -_020025D0: - ldr r0, [r4] - mov r1, #0 - bl MsgArray_ControlCodeGetField - lsl r0, r0, #0x10 - lsr r1, r0, #0x10 - mov r0, #0xfe - lsl r0, r0, #8 - cmp r1, r0 - beq _02002606 - add r0, r0, #1 - cmp r1, r0 - bne _02002622 - add r0, r4, #0 - mov r1, #2 - add r0, #0x28 - strb r1, [r0] - add r0, r4, #0 - bl sub_020027FC - ldr r0, [r4] - bl MsgArray_SkipControlCode - str r0, [r4] - add sp, #0xc - mov r0, #3 - pop {r3, r4, r5, r6, pc} -_02002606: - add r0, r4, #0 - mov r1, #3 - add r0, #0x28 - strb r1, [r0] - add r0, r4, #0 - bl sub_020027FC - ldr r0, [r4] - bl MsgArray_SkipControlCode - str r0, [r4] - add sp, #0xc - mov r0, #3 - pop {r3, r4, r5, r6, pc} -_02002622: - ldr r0, [r4] - bl MsgArray_SkipControlCode - str r0, [r4] - add sp, #0xc - mov r0, #2 - pop {r3, r4, r5, r6, pc} -_02002630: - add r0, r4, #0 - mov r1, #2 - add r0, #0x28 - strb r1, [r0] - add r0, r4, #0 - bl sub_020027FC - add sp, #0xc - mov r0, #3 - pop {r3, r4, r5, r6, pc} -_02002644: - add r0, r4, #0 - mov r1, #3 - add r0, #0x28 - strb r1, [r0] - add r0, r4, #0 - bl sub_020027FC - add sp, #0xc - mov r0, #3 - pop {r3, r4, r5, r6, pc} -_02002658: - ldrb r0, [r6] - add r1, r5, #0 - lsl r0, r0, #0x1c - lsr r0, r0, #0x1c - bl FontID_TryLoadGlyph - add r5, r0, #0 - ldrh r0, [r4, #0xc] - add r2, r5, #0 - add r3, r5, #0 - str r0, [sp] - ldrh r0, [r4, #0xe] - add r2, #0x80 - add r3, #0x81 - str r0, [sp, #4] - ldrh r0, [r4, #0x18] - add r1, r5, #0 - str r0, [sp, #8] - ldrb r2, [r2] - ldrb r3, [r3] - ldr r0, [r4, #4] - bl CopyGlyphToWindow - add r5, #0x80 - ldrb r1, [r5] - ldrh r0, [r4, #0x10] - ldrh r2, [r4, #0xc] - add sp, #0xc - add r0, r1, r0 - add r0, r2, r0 - strh r0, [r4, #0xc] - mov r0, #0 - pop {r3, r4, r5, r6, pc} -_0200269A: - bl TextPrinterWait - cmp r0, #0 - beq _020026AE - add r0, r4, #0 - bl TextPrinterClearDownArrow - mov r0, #0 - add r4, #0x28 - strb r0, [r4] -_020026AE: - add sp, #0xc - mov r0, #3 - pop {r3, r4, r5, r6, pc} -_020026B4: - bl TextPrinterWaitWithDownArrow - cmp r0, #0 - beq _020026D8 - add r0, r4, #0 - bl TextPrinterClearDownArrow - ldrb r1, [r4, #0x16] - ldr r0, [r4, #4] - bl FillWindowPixelBuffer - ldrb r0, [r4, #0xa] - strh r0, [r4, #0xc] - ldrb r0, [r4, #0xb] - strh r0, [r4, #0xe] - mov r0, #0 - add r4, #0x28 - strb r0, [r4] -_020026D8: - add sp, #0xc - mov r0, #3 - pop {r3, r4, r5, r6, pc} -_020026DE: - bl TextPrinterWaitWithDownArrow - cmp r0, #0 - beq _02002708 - add r0, r4, #0 - bl TextPrinterClearDownArrow - ldrb r0, [r4, #9] - mov r1, #1 - bl GetFontAttribute - ldrh r1, [r4, #0x12] - add r1, r1, r0 - add r0, r4, #0 - add r0, #0x2b - strb r1, [r0] - ldrb r0, [r4, #0xa] - strh r0, [r4, #0xc] - mov r0, #4 - add r4, #0x28 - strb r0, [r4] -_02002708: - add sp, #0xc - mov r0, #3 - pop {r3, r4, r5, r6, pc} -_0200270E: - add r0, #0x2b - ldrb r2, [r0] - cmp r2, #0 - beq _02002758 - cmp r2, #4 - ldrb r5, [r4, #0x16] - bge _02002730 - lsl r3, r5, #4 - orr r3, r5 - lsl r3, r3, #0x18 - ldr r0, [r4, #4] - mov r1, #0 - lsr r3, r3, #0x18 - bl ScrollWindow - mov r1, #0 - b _0200274A -_02002730: - lsl r3, r5, #4 - orr r3, r5 - lsl r3, r3, #0x18 - ldr r0, [r4, #4] - mov r1, #0 - mov r2, #4 - lsr r3, r3, #0x18 - bl ScrollWindow - add r0, r4, #0 - add r0, #0x2b - ldrb r0, [r0] - sub r1, r0, #4 -_0200274A: - add r0, r4, #0 - add r0, #0x2b - strb r1, [r0] - ldr r0, [r4, #4] - bl CopyWindowToVram - b _0200275E -_02002758: - mov r0, #0 - add r4, #0x28 - strb r0, [r4] -_0200275E: - add sp, #0xc - mov r0, #3 - pop {r3, r4, r5, r6, pc} -_02002764: - mov r0, #0 - add r4, #0x28 - strb r0, [r4] - add sp, #0xc - mov r0, #3 - pop {r3, r4, r5, r6, pc} -_02002770: - add r0, #0x2a - ldrb r0, [r0] - cmp r0, #0 - beq _02002784 - add r0, r4, #0 - add r0, #0x2a - ldrb r0, [r0] - add r4, #0x2a - sub r0, r0, #1 - b _02002788 -_02002784: - mov r0, #0 - add r4, #0x28 -_02002788: - add sp, #0xc - strb r0, [r4] - mov r0, #3 - pop {r3, r4, r5, r6, pc} -_02002790: - bl TextPrinterWaitWithDownArrow - cmp r0, #0 - beq _020027B4 - add r0, r4, #0 - bl TextPrinterClearDownArrow - ldrb r1, [r4, #0x16] - ldr r0, [r4, #4] - bl FillWindowPixelBuffer - ldrb r0, [r4, #0xa] - strh r0, [r4, #0xc] - ldrb r0, [r4, #0xb] - strh r0, [r4, #0xe] - mov r0, #0 - add r4, #0x28 - strb r0, [r4] -_020027B4: - add sp, #0xc - mov r0, #3 - pop {r3, r4, r5, r6, pc} -_020027BA: - bl TextPrinterWaitWithDownArrow - cmp r0, #0 - beq _020027E4 - add r0, r4, #0 - bl TextPrinterClearDownArrow - ldrb r0, [r4, #9] - mov r1, #1 - bl GetFontAttribute - ldrh r1, [r4, #0x12] - add r1, r1, r0 - add r0, r4, #0 - add r0, #0x2b - strb r1, [r0] - ldrb r0, [r4, #0xa] - strh r0, [r4, #0xc] - mov r0, #4 - add r4, #0x28 - strb r0, [r4] -_020027E4: - add sp, #0xc - mov r0, #3 - pop {r3, r4, r5, r6, pc} -_020027EA: - mov r0, #1 - add sp, #0xc - pop {r3, r4, r5, r6, pc} - thumb_func_end RenderText - - thumb_func_start sub_020027F0 -sub_020027F0: ; 0x020027F0 - ldr r1, _020027F8 ; =_02111884 - strh r0, [r1] - bx lr - nop -_020027F8: .word _02111884 - thumb_func_end sub_020027F0 - - thumb_func_start sub_020027FC -sub_020027FC: ; 0x020027FC - ldr r2, _02002830 ; =_02111884 - add r1, r0, #0 - ldrb r2, [r2, #2] - add r1, #0x20 - lsl r2, r2, #0x1d - lsr r2, r2, #0x1f - beq _02002814 - ldrb r3, [r1, #2] - mov r2, #0xff - bic r3, r2 - strb r3, [r1, #2] - b _02002824 -_02002814: - ldrb r3, [r1, #1] - mov r2, #0x60 - bic r3, r2 - strb r3, [r1, #1] - ldrb r3, [r1, #1] - mov r2, #0x1f - bic r3, r2 - strb r3, [r1, #1] -_02002824: - ldr r1, _02002830 ; =_02111884 - ldr r3, _02002834 ; =sub_0200EB68 - ldr r0, [r0, #4] - ldrh r1, [r1] - bx r3 - nop -_02002830: .word _02111884 -_02002834: .word sub_0200EB68 - thumb_func_end sub_020027FC - - thumb_func_start TextPrinterDrawDownArrow -TextPrinterDrawDownArrow: ; 0x02002838 - push {r3, r4, r5, r6, r7, lr} - sub sp, #0x30 - add r5, r0, #0 - ldr r0, _020029D0 ; =_02111884 - add r4, r5, #0 - ldrb r0, [r0, #2] - add r4, #0x20 - lsl r1, r0, #0x1d - lsr r1, r1, #0x1f - bne _02002852 - lsl r0, r0, #0x1e - lsr r0, r0, #0x1f - beq _02002854 -_02002852: - b _020029CC -_02002854: - ldrb r0, [r4, #1] - lsl r1, r0, #0x1b - lsr r2, r1, #0x1b - beq _02002872 - mov r1, #0x1f - add r2, #0xff - bic r0, r1 - lsl r1, r2, #0x18 - lsr r2, r1, #0x18 - mov r1, #0x1f - and r1, r2 - orr r0, r1 - add sp, #0x30 - strb r0, [r4, #1] - pop {r3, r4, r5, r6, r7, pc} -_02002872: - ldr r0, [r5, #4] - bl GetWindowBgId - str r0, [sp, #0x20] - ldr r0, [r5, #4] - bl GetWindowX - str r0, [sp, #0x24] - ldr r0, [r5, #4] - bl GetWindowY - add r7, r0, #0 - ldr r0, [r5, #4] - bl GetWindowWidth - str r0, [sp, #0x28] - ldr r0, [r5, #4] - bl GetWindowHeight - sub r0, r0, #2 - lsl r0, r0, #0x18 - lsr r1, r0, #0x18 - ldr r0, _020029D0 ; =_02111884 - add r7, r7, r1 - ldrh r6, [r0] - ldr r1, [sp, #0x24] - ldr r0, [sp, #0x28] - add r2, r6, #0 - add r0, r1, r0 - str r0, [sp, #0x1c] - add r0, r0, #1 - str r0, [sp, #0x18] - lsl r0, r7, #0x18 - lsr r0, r0, #0x18 - str r0, [sp] - mov r0, #1 - str r0, [sp, #4] - str r0, [sp, #8] - mov r0, #0x10 - str r0, [sp, #0xc] - str r2, [sp, #0x2c] - add r2, #0x12 - str r2, [sp, #0x2c] - ldrb r2, [r4, #1] - ldr r0, [r5, #4] - ldr r1, [sp, #0x20] - lsl r2, r2, #0x19 - lsr r3, r2, #0x1e - ldr r2, _020029D4 ; =_020F56BC - ldr r0, [r0] - ldrb r2, [r2, r3] - lsl r3, r2, #2 - ldr r2, [sp, #0x2c] - add r2, r2, r3 - ldr r3, [sp, #0x18] - lsl r2, r2, #0x10 - lsl r3, r3, #0x18 - lsr r2, r2, #0x10 - lsr r3, r3, #0x18 - bl FillBgTilemapRect - ldr r0, [sp, #0x1c] - add r2, r6, #0 - add r0, r0, #2 - str r0, [sp, #0x10] - lsl r0, r7, #0x18 - lsr r0, r0, #0x18 - str r0, [sp] - mov r0, #1 - str r0, [sp, #4] - str r0, [sp, #8] - mov r0, #0x10 - str r0, [sp, #0xc] - add r2, #0x13 - mov ip, r2 - ldrb r2, [r4, #1] - ldr r0, [r5, #4] - ldr r1, [sp, #0x20] - lsl r2, r2, #0x19 - lsr r3, r2, #0x1e - ldr r2, _020029D4 ; =_020F56BC - ldr r0, [r0] - ldrb r2, [r2, r3] - mov r3, ip - lsl r2, r2, #2 - add r2, r3, r2 - ldr r3, [sp, #0x10] - lsl r2, r2, #0x10 - lsl r3, r3, #0x18 - lsr r2, r2, #0x10 - lsr r3, r3, #0x18 - bl FillBgTilemapRect - add r0, r7, #1 - str r0, [sp, #0x14] - lsl r0, r0, #0x18 - lsr r0, r0, #0x18 - str r0, [sp] - mov r0, #1 - str r0, [sp, #4] - str r0, [sp, #8] - mov r0, #0x10 - str r0, [sp, #0xc] - ldrb r2, [r4, #1] - add r7, r6, #0 - ldr r0, [r5, #4] - lsl r2, r2, #0x19 - lsr r3, r2, #0x1e - ldr r2, _020029D4 ; =_020F56BC - add r7, #0x14 - ldrb r2, [r2, r3] - ldr r3, [sp, #0x18] - ldr r0, [r0] - lsl r2, r2, #2 - add r2, r7, r2 - lsl r2, r2, #0x10 - lsl r3, r3, #0x18 - ldr r1, [sp, #0x20] - lsr r2, r2, #0x10 - lsr r3, r3, #0x18 - bl FillBgTilemapRect - ldr r0, [sp, #0x14] - add r6, #0x15 - lsl r0, r0, #0x18 - lsr r0, r0, #0x18 - str r0, [sp] - mov r0, #1 - str r0, [sp, #4] - str r0, [sp, #8] - mov r0, #0x10 - str r0, [sp, #0xc] - ldrb r2, [r4, #1] - ldr r0, [r5, #4] - ldr r1, [sp, #0x20] - lsl r2, r2, #0x19 - lsr r3, r2, #0x1e - ldr r2, _020029D4 ; =_020F56BC - ldr r0, [r0] - ldrb r2, [r2, r3] - ldr r3, [sp, #0x10] - lsl r2, r2, #2 - add r2, r6, r2 - lsl r2, r2, #0x10 - lsl r3, r3, #0x18 - lsr r2, r2, #0x10 - lsr r3, r3, #0x18 - bl FillBgTilemapRect - ldr r0, [r5, #4] - ldr r1, [sp, #0x20] - ldr r0, [r0] - bl BgCommitTilemapBufferToVram - ldrb r1, [r4, #1] - mov r0, #0x1f - bic r1, r0 - mov r0, #8 - orr r0, r1 - strb r0, [r4, #1] - ldrb r2, [r4, #1] - mov r1, #0x60 - add r0, r2, #0 - bic r0, r1 - lsl r1, r2, #0x19 - lsr r1, r1, #0x1e - add r1, r1, #1 - lsl r1, r1, #0x18 - lsr r1, r1, #0x18 - lsl r1, r1, #0x1e - lsr r1, r1, #0x19 - orr r0, r1 - strb r0, [r4, #1] -_020029CC: - add sp, #0x30 - pop {r3, r4, r5, r6, r7, pc} - .balign 4, 0 -_020029D0: .word _02111884 -_020029D4: .word _020F56BC - thumb_func_end TextPrinterDrawDownArrow - - thumb_func_start TextPrinterClearDownArrow -TextPrinterClearDownArrow: ; 0x020029D8 - push {r4, r5, r6, r7, lr} - sub sp, #0x1c - add r5, r0, #0 - ldr r0, _02002A80 ; =_02111884 - ldrb r0, [r0, #2] - lsl r0, r0, #0x1e - lsr r0, r0, #0x1f - bne _02002A7C - ldr r0, [r5, #4] - bl GetWindowBgId - str r0, [sp, #0x10] - ldr r0, [r5, #4] - bl GetWindowX - str r0, [sp, #0x14] - ldr r0, [r5, #4] - bl GetWindowY - add r6, r0, #0 - ldr r0, [r5, #4] - bl GetWindowWidth - str r0, [sp, #0x18] - ldr r0, [r5, #4] - bl GetWindowHeight - sub r0, r0, #2 - lsl r0, r0, #0x18 - lsr r1, r0, #0x18 - ldr r0, _02002A80 ; =_02111884 - add r7, r6, r1 - ldrh r4, [r0] - ldr r1, [sp, #0x14] - ldr r0, [sp, #0x18] - add r2, r4, #0 - add r6, r1, r0 - lsl r0, r7, #0x18 - lsr r0, r0, #0x18 - str r0, [sp] - mov r0, #1 - str r0, [sp, #4] - mov r0, #2 - str r0, [sp, #8] - mov r0, #0x10 - str r0, [sp, #0xc] - ldr r0, [r5, #4] - add r2, #0xa - add r3, r6, #1 - lsl r2, r2, #0x10 - lsl r3, r3, #0x18 - ldr r0, [r0] - ldr r1, [sp, #0x10] - lsr r2, r2, #0x10 - lsr r3, r3, #0x18 - bl FillBgTilemapRect - lsl r0, r7, #0x18 - lsr r0, r0, #0x18 - str r0, [sp] - mov r0, #1 - str r0, [sp, #4] - mov r0, #2 - str r0, [sp, #8] - mov r0, #0x10 - str r0, [sp, #0xc] - ldr r0, [r5, #4] - add r4, #0xb - add r3, r6, #2 - lsl r2, r4, #0x10 - lsl r3, r3, #0x18 - ldr r0, [r0] - ldr r1, [sp, #0x10] - lsr r2, r2, #0x10 - lsr r3, r3, #0x18 - bl FillBgTilemapRect - ldr r0, [r5, #4] - ldr r1, [sp, #0x10] - ldr r0, [r0] - bl BgCommitTilemapBufferToVram -_02002A7C: - add sp, #0x1c - pop {r4, r5, r6, r7, pc} - .balign 4, 0 -_02002A80: .word _02111884 - thumb_func_end TextPrinterClearDownArrow - - thumb_func_start TextPrinterContinue -TextPrinterContinue: ; 0x02002A84 - push {r3, lr} - bl sub_02002220 - cmp r0, #0 - beq _02002AA2 - ldr r0, _02002AA8 ; =0x000005DC - bl PlaySE - ldr r1, _02002AAC ; =_02111884 - mov r0, #0x80 - ldrb r2, [r1, #2] - orr r0, r2 - strb r0, [r1, #2] - mov r0, #1 - pop {r3, pc} -_02002AA2: - mov r0, #0 - pop {r3, pc} - nop -_02002AA8: .word 0x000005DC -_02002AAC: .word _02111884 - thumb_func_end TextPrinterContinue - - thumb_func_start TextPrinterWaitAutoMode -TextPrinterWaitAutoMode: ; 0x02002AB0 - push {r4, lr} - add r2, r0, #0 - add r2, #0x20 - ldrb r1, [r2, #2] - add r4, r1, #0 - cmp r4, #0x64 - bne _02002AC2 - mov r0, #1 - pop {r4, pc} -_02002AC2: - mov r3, #0xff - bic r1, r3 - add r3, r4, #1 - lsl r3, r3, #0x18 - lsr r3, r3, #0x18 - lsl r3, r3, #0x18 - lsr r3, r3, #0x18 - orr r1, r3 - strb r1, [r2, #2] - ldr r1, _02002AE8 ; =_02111884 - ldrb r1, [r1, #2] - lsl r1, r1, #0x1a - lsr r1, r1, #0x1f - beq _02002AE4 - bl TextPrinterContinue - pop {r4, pc} -_02002AE4: - mov r0, #0 - pop {r4, pc} - .balign 4, 0 -_02002AE8: .word _02111884 - thumb_func_end TextPrinterWaitAutoMode - - thumb_func_start TextPrinterWaitWithDownArrow -TextPrinterWaitWithDownArrow: ; 0x02002AEC - push {r4, lr} - ldr r1, _02002B0C ; =_02111884 - add r4, r0, #0 - ldrb r1, [r1, #2] - lsl r1, r1, #0x1d - lsr r1, r1, #0x1f - beq _02002B00 - bl TextPrinterWaitAutoMode - pop {r4, pc} -_02002B00: - bl TextPrinterDrawDownArrow - add r0, r4, #0 - bl TextPrinterContinue - pop {r4, pc} - .balign 4, 0 -_02002B0C: .word _02111884 - thumb_func_end TextPrinterWaitWithDownArrow - - thumb_func_start TextPrinterWait -TextPrinterWait: ; 0x02002B10 - push {r3, lr} - ldr r1, _02002B30 ; =_02111884 - ldrb r1, [r1, #2] - lsl r1, r1, #0x1d - lsr r1, r1, #0x1f - beq _02002B26 - bl TextPrinterWaitAutoMode - lsl r0, r0, #0x18 - lsr r0, r0, #0x18 - pop {r3, pc} -_02002B26: - bl TextPrinterContinue - lsl r0, r0, #0x18 - lsr r0, r0, #0x18 - pop {r3, pc} - .balign 4, 0 -_02002B30: .word _02111884 - thumb_func_end TextPrinterWait - - thumb_func_start TextFlags_SetCanABSpeedUpPrint -TextFlags_SetCanABSpeedUpPrint: ; 0x02002B34 - ldr r2, _02002B4C ; =_02111884 - mov r1, #1 - ldrb r3, [r2, #2] - lsl r0, r0, #0x18 - bic r3, r1 - lsr r1, r0, #0x18 - mov r0, #1 - and r0, r1 - orr r0, r3 - strb r0, [r2, #2] - bx lr - nop -_02002B4C: .word _02111884 - thumb_func_end TextFlags_SetCanABSpeedUpPrint - - thumb_func_start sub_02002B50 -sub_02002B50: ; 0x02002B50 - push {r3, r4} - ldr r1, _02002B88 ; =_02111884 - mov r3, #4 - ldrb r2, [r1, #2] - mov r4, #1 - bic r2, r3 - add r3, r0, #0 - and r3, r4 - lsl r3, r3, #0x18 - lsr r3, r3, #0x18 - lsl r3, r3, #0x1f - lsr r3, r3, #0x1d - orr r2, r3 - asr r0, r0, #1 - and r0, r4 - strb r2, [r1, #2] - lsl r0, r0, #0x18 - lsr r0, r0, #0x18 - lsl r0, r0, #0x1f - ldrb r2, [r1, #2] - mov r3, #0x20 - lsr r0, r0, #0x1a - bic r2, r3 - orr r0, r2 - strb r0, [r1, #2] - pop {r3, r4} - bx lr - nop -_02002B88: .word _02111884 - thumb_func_end sub_02002B50 - - thumb_func_start sub_02002B8C -sub_02002B8C: ; 0x02002B8C - ldr r2, _02002BA4 ; =_02111884 - lsl r0, r0, #0x18 - ldrb r3, [r2, #2] - lsr r0, r0, #0x18 - mov r1, #0x10 - lsl r0, r0, #0x1f - bic r3, r1 - lsr r0, r0, #0x1b - orr r0, r3 - strb r0, [r2, #2] - bx lr - nop -_02002BA4: .word _02111884 - thumb_func_end sub_02002B8C - - thumb_func_start sub_02002BA8 -sub_02002BA8: ; 0x02002BA8 - ldr r2, _02002BC0 ; =_02111884 - lsl r0, r0, #0x18 - ldrb r3, [r2, #2] - lsr r0, r0, #0x18 - mov r1, #2 - lsl r0, r0, #0x1f - bic r3, r1 - lsr r0, r0, #0x1e - orr r0, r3 - strb r0, [r2, #2] - bx lr - nop -_02002BC0: .word _02111884 - thumb_func_end sub_02002BA8 - - thumb_func_start sub_02002BC4 -sub_02002BC4: ; 0x02002BC4 - ldr r0, _02002BD0 ; =_02111884 - ldrb r0, [r0, #2] - lsl r0, r0, #0x19 - lsr r0, r0, #0x1f - bx lr - nop -_02002BD0: .word _02111884 - thumb_func_end sub_02002BC4 - - thumb_func_start sub_02002BD4 -sub_02002BD4: ; 0x02002BD4 - ldr r1, _02002BE0 ; =_02111884 - mov r0, #0x40 - ldrb r2, [r1, #2] - bic r2, r0 - strb r2, [r1, #2] - bx lr - .balign 4, 0 -_02002BE0: .word _02111884 - thumb_func_end sub_02002BD4 - - thumb_func_start sub_02002BE4 -sub_02002BE4: ; 0x02002BE4 - ldr r0, _02002BF0 ; =_02111884 - ldrb r0, [r0, #2] - lsl r0, r0, #0x18 - lsr r0, r0, #0x1f - bx lr - nop -_02002BF0: .word _02111884 - thumb_func_end sub_02002BE4 - - thumb_func_start sub_02002BF4 -sub_02002BF4: ; 0x02002BF4 - ldr r1, _02002C00 ; =_02111884 - mov r0, #0x80 - ldrb r2, [r1, #2] - bic r2, r0 - strb r2, [r1, #2] - bx lr - .balign 4, 0 -_02002C00: .word _02111884 - thumb_func_end sub_02002BF4 - - thumb_func_start sub_02002C04 -sub_02002C04: ; 0x02002C04 - ldr r0, _02002C1C ; =_02111884 - ldrb r1, [r0, #2] - lsl r1, r1, #0x1b - lsr r1, r1, #0x1f - beq _02002C16 - ldrb r0, [r0, #3] - lsl r0, r0, #0x1f - lsr r0, r0, #0x1f - bx lr -_02002C16: - mov r0, #0 - bx lr - nop -_02002C1C: .word _02111884 - thumb_func_end sub_02002C04 - - thumb_func_start sub_02002C20 -sub_02002C20: ; 0x02002C20 - ldr r2, _02002C3C ; =_02111884 - mov r1, #2 - ldrb r3, [r2, #3] - orr r1, r3 - strb r1, [r2, #3] - ldrb r1, [r0] - strb r1, [r2, #4] - ldrb r1, [r0, #1] - strb r1, [r2, #5] - ldrb r1, [r0, #2] - strb r1, [r2, #6] - ldrb r0, [r0, #3] - strb r0, [r2, #7] - bx lr - .balign 4, 0 -_02002C3C: .word _02111884 - thumb_func_end sub_02002C20 - - thumb_func_start sub_02002C40 -sub_02002C40: ; 0x02002C40 - ldr r1, _02002C5C ; =_02111884 - mov r0, #2 - ldrb r2, [r1, #3] - bic r2, r0 - strb r2, [r1, #3] - mov r2, #0 - strb r2, [r1, #4] - mov r0, #0xc0 - strb r0, [r1, #5] - strb r2, [r1, #6] - mov r0, #0xff - strb r0, [r1, #7] - bx lr - nop -_02002C5C: .word _02111884 - thumb_func_end sub_02002C40 - - thumb_func_start sub_02002C60 -sub_02002C60: ; 0x02002C60 - push {r3, lr} - cmp r0, #0 - bne _02002C7A - mov r0, #1 - bl TextFlags_SetCanABSpeedUpPrint - mov r0, #3 - bl sub_02002B50 - mov r0, #1 - bl sub_02002B8C - pop {r3, pc} -_02002C7A: - mov r0, #1 - bl sub_02002B50 - mov r0, #0 - bl TextFlags_SetCanABSpeedUpPrint - mov r0, #0 - bl sub_02002B8C - pop {r3, pc} - .balign 4, 0 - thumb_func_end sub_02002C60 - - thumb_func_start sub_02002C90 -sub_02002C90: ; 0x02002C90 - push {r3, lr} - mov r0, #0 - bl TextFlags_SetCanABSpeedUpPrint - mov r0, #0 - bl sub_02002B50 - mov r0, #0 - bl sub_02002B8C - pop {r3, pc} - .balign 4, 0 - thumb_func_end sub_02002C90 diff --git a/asm/render_window.s b/asm/render_window.s index 06ed3aa4cc..e1e9dd8abd 100644 --- a/asm/render_window.s +++ b/asm/render_window.s @@ -799,7 +799,7 @@ DrawFrameAndWindow2: ; 0x0200E998 bl CopyWindowToVram _0200E9B2: add r0, r6, #0 - bl sub_020027F0 + bl TextPrinter_SetDownArrowBaseTile pop {r4, r5, r6, pc} .balign 4, 0 thumb_func_end DrawFrameAndWindow2 @@ -1668,7 +1668,7 @@ _0200F094: bl CopyWindowToVram _0200F0A0: add r0, r6, #0 - bl sub_020027F0 + bl TextPrinter_SetDownArrowBaseTile add sp, #0x28 pop {r3, r4, r5, r6, r7, pc} .balign 4, 0 diff --git a/asm/text_0205B4EC.s b/asm/text_0205B4EC.s index 134b6312ca..6406cb9099 100644 --- a/asm/text_0205B4EC.s +++ b/asm/text_0205B4EC.s @@ -120,9 +120,9 @@ sub_0205B5B4: ; 0x0205B5B4 add r6, r2, #0 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint add r0, r6, #0 bl Options_GetTextFrameDelay mov r3, #0 @@ -149,9 +149,9 @@ sub_0205B5EC: ; 0x0205B5EC add r4, r3, #0 bl TextFlags_SetCanABSpeedUpPrint ldr r0, [sp, #0x24] - bl sub_02002B50 + bl TextFlags_SetAutoScrollParam mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r3, #0 str r3, [sp] str r4, [sp, #4] diff --git a/asm/unk_020755E8.s b/asm/unk_020755E8.s index 96e264c294..e86bc62b01 100644 --- a/asm/unk_020755E8.s +++ b/asm/unk_020755E8.s @@ -907,7 +907,7 @@ sub_02075A7C: ; 0x02075A7C mov r0, #1 bl TextFlags_SetCanABSpeedUpPrint mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint bl sub_0203A880 add r0, r4, #0 add sp, #0x24 @@ -1024,7 +1024,7 @@ sub_02075D4C: ; 0x02075D4C mov r0, #0 bl TextFlags_SetCanABSpeedUpPrint mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint ldr r0, _02075E10 ; =gSystem + 0x60 mov r1, #1 strb r1, [r0, #9] diff --git a/asm/unk_020921A4.s b/asm/unk_020921A4.s index c1000afa8c..0ae381087b 100644 --- a/asm/unk_020921A4.s +++ b/asm/unk_020921A4.s @@ -35,7 +35,7 @@ sub_020921A4: ; 0x020921A4 ldr r0, [r0, #8] str r0, [r4, #0x34] mov r0, #1 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint mov r0, #1 pop {r3, r4, r5, pc} thumb_func_end sub_020921A4 @@ -123,7 +123,7 @@ sub_02092288: ; 0x02092288 bl OverlayManager_GetData ldr r4, [r0] mov r0, #0 - bl sub_02002B8C + bl TextFlags_SetCanTouchSpeedUpPrint add r0, r5, #0 bl OverlayManager_FreeData add r0, r4, #0 diff --git a/include/font_types_def.h b/include/font_types_def.h index 30a721ea20..aeb25d6c10 100644 --- a/include/font_types_def.h +++ b/include/font_types_def.h @@ -7,11 +7,11 @@ typedef u8 FontID; struct FontData; -struct GlyphInfo { +typedef struct GlyphInfo { u8 data[0x80]; u8 width; u8 height; -}; +} GlyphInfo; struct FontInfo { u8 maxLetterWidth; @@ -39,7 +39,7 @@ typedef struct TextPrinterTemplate { u16 letterSpacing, lineSpacing; u8 unk14; u8 fgColor, bgColor, shadowColor; - u16 unk18; + u16 glyphTable; u8 unk1A; u8 unk1B; } TextPrinterTemplate; diff --git a/include/render_text.h b/include/render_text.h index aa7fdea6bb..1211fb386b 100644 --- a/include/render_text.h +++ b/include/render_text.h @@ -2,8 +2,22 @@ #define POKEHEARTGOLD_RENDER_TEXT_H #include "text.h" +#include "touchscreen.h" -struct TextPrinterSubStruct { +typedef struct TextFlags { + u8 canABSpeedUpPrint : 1; + u8 useAlternateDownArrow : 1; + u8 autoScroll : 1; + u8 forceMidTextSpeed : 1; + u8 canTouchSpeedUpPrint : 1; + u8 autoScrollCanSpeedUp : 1; + u8 hasSpedUpInput : 1; + u8 hasContinuedInput : 1; + u8 touchIsSpeedingUpPrint : 1; + u8 touchHitboxActive : 1; +} TextFlags; + +typedef struct TextPrinterSubStruct { u8 fontId : 4; // 0x14 u8 hasPrintBeenSpedUp : 1; u8 unk : 3; @@ -11,13 +25,22 @@ struct TextPrinterSubStruct { u8 downArrowYPosIdx : 2; u8 hasFontIdBeenSet : 1; u8 autoScrollDelay : 8; -}; +} TextPrinterSubStruct; RenderResult RenderText(TextPrinter *printer); void TextFlags_SetCanABSpeedUpPrint(BOOL enable); -void sub_020027F0(int a0); -void sub_02002B50(u32 a0); -void sub_02002B8C(BOOL enable); -void sub_02002C60(BOOL a0); +void TextPrinter_SetDownArrowBaseTile(int tile); +void TextFlags_SetAutoScrollParam(int a0); +void TextFlags_SetCanTouchSpeedUpPrint(BOOL enable); +void TextFlags_SetAlternateDownArrow(BOOL enable); +u8 TextFlags_GetHasSpedUpInput(); +void TextFlags_ResetHasSpedUpInput(void); +u8 TextFlags_GetHasContinuedInput(void); +void TextFlags_ResetHasContinuedInput(void); +BOOL TextFlags_GetIsTouchSpeedingUpPrint(void); +void TextFlags_SetFastForwardTouchButtonHitbox(const TouchscreenHitbox *hitbox); +void TextFlags_UnsetFastForwardTouchButtonHitbox(void); +void TextFlags_BeginAutoScroll(BOOL noSpeedUp); +void TextFlags_EndAutoScroll(void); #endif // POKEHEARTGOLD_RENDER_TEXT_H diff --git a/include/render_window.h b/include/render_window.h index 28be5dd631..241c19a091 100644 --- a/include/render_window.h +++ b/include/render_window.h @@ -19,5 +19,6 @@ struct PokepicManager *DrawPokemonPicFromSpecies(BgConfig *bgConfig, GFBgLayer l struct PokepicManager *DrawPokemonPicFromMon(BgConfig *bgConfig, GFBgLayer layer, int x, int y, u8 paletteNum, u16 baseTile, Pokemon *mon, HeapID heapId); void sub_0200E398(BgConfig *bgConfig, u32 a1, u32 a2, u32 a3, HeapID heapId); u32 sub_0200E3D8(void); +void sub_0200EB68(Window *window, int a1); #endif // POKEHEARTGOLD_RENDER_WINDOW_H diff --git a/include/string_control_code.h b/include/string_control_code.h index d41387bda7..afd3fcc850 100644 --- a/include/string_control_code.h +++ b/include/string_control_code.h @@ -4,8 +4,8 @@ #include "global.h" const u16 *MsgArray_SkipControlCode(const u16 *arr); -u16 MsgArray_GetControlCode(const u16 *arr); +int MsgArray_GetControlCode(const u16 *arr); BOOL MsgArray_ControlCodeIsStrVar(const u16 *arr); -u16 MsgArray_ControlCodeGetField(const u16 *arr, u32 fieldno); +int MsgArray_ControlCodeGetField(const u16 *arr, u32 fieldno); #endif // HEARTGOLD_STRING_CONTROL_CODE_H diff --git a/main.lsf b/main.lsf index d69511fd00..e298ed65fe 100644 --- a/main.lsf +++ b/main.lsf @@ -14,7 +14,7 @@ Static main Object src/list_menu.o Object src/list_menu_2d.o Object src/string_util.o - Object asm/render_text.o + Object src/render_text.o Object src/font.o Object src/palette.o Object src/sound.o diff --git a/src/battle/battle_022378C0.c b/src/battle/battle_022378C0.c index 79e4906ffc..85230151c2 100644 --- a/src/battle/battle_022378C0.c +++ b/src/battle/battle_022378C0.c @@ -228,7 +228,7 @@ void ov12_02237BB8(BattleSystem *bsys) { NARC_Delete(unkNarcA); NARC_Delete(unkNarcB); - sub_020027F0(1); + TextPrinter_SetDownArrowBaseTile(1); ov12_0223A620(bsys); G2dRenderer_SetSubSurfaceCoords(SpriteRenderer_GetG2dRendererPtr(bsys->unk90), 0, FX32_CONST(272)); diff --git a/src/choose_starter_app.c b/src/choose_starter_app.c index a6325a5562..305ab18d94 100644 --- a/src/choose_starter_app.c +++ b/src/choose_starter_app.c @@ -299,8 +299,8 @@ BOOL ChooseStarter_Init(OVY_MANAGER *ovy, int *state_p) { initBallModelPositions(work); createMonSprites(work); TextFlags_SetCanABSpeedUpPrint(FALSE); - sub_02002B50(TRUE); - sub_02002B8C(FALSE); + TextFlags_SetAutoScrollParam(TRUE); + TextFlags_SetCanTouchSpeedUpPrint(FALSE); return TRUE; } @@ -540,8 +540,8 @@ BOOL ChooseStarter_Exit(OVY_MANAGER *ovy, int *state) { struct ChooseStarterArgs *args = OverlayManager_GetArgs(ovy); TextFlags_SetCanABSpeedUpPrint(FALSE); - sub_02002B50(FALSE); - sub_02002B8C(FALSE); + TextFlags_SetAutoScrollParam(FALSE); + TextFlags_SetCanTouchSpeedUpPrint(FALSE); args->cursorPos = work->curSelection; Main_SetVBlankIntrCB(NULL, NULL); DeleteCameraTranslationWrapper(work->cameraTranslation); diff --git a/src/oaks_speech.c b/src/oaks_speech.c index d319bdc068..00e827bb24 100644 --- a/src/oaks_speech.c +++ b/src/oaks_speech.c @@ -558,7 +558,7 @@ BOOL OakSpeech_Init(OVY_MANAGER *ovyMan, int *pState) { data->namingScreenArgs_Rival = NamingScreen_CreateArgs(HEAP_ID_OAKS_SPEECH, NAME_SCREEN_RIVAL, 0, PLAYER_NAME_LENGTH, data->options, NULL); data->lastChosenGender = 0; data->frameDelayCounter = 0; - sub_02002B8C(FALSE); + TextFlags_SetCanTouchSpeedUpPrint(FALSE); FontID_Alloc(4, data->heapId); return TRUE; } @@ -648,7 +648,7 @@ BOOL OakSpeech_Exit(OVY_MANAGER *ovyMan, int *pState) { OverlayManager_FreeData(ovyMan); DestroyHeap(heapId); RegisterMainOverlay(FS_OVERLAY_ID(OVY_36), &ov36_App_InitGameState_AfterOakSpeech); - sub_02002B8C(FALSE); + TextFlags_SetCanTouchSpeedUpPrint(FALSE); return TRUE; } @@ -943,7 +943,7 @@ static BOOL OakSpeech_PrintDialogMsg(OakSpeechData *data, int msgNum, int waitBu DrawFrameAndWindow2(&data->dialogWindow, FALSE, 0x3E2, 4); TextFlags_SetCanABSpeedUpPrint(TRUE); - sub_02002B50(FALSE); + TextFlags_SetAutoScrollParam(FALSE); String *temp = String_New(0x400, data->heapId); data->string = String_New(0x400, data->heapId); diff --git a/src/options_app.c b/src/options_app.c index 211c329bff..1d3adfacbf 100644 --- a/src/options_app.c +++ b/src/options_app.c @@ -348,7 +348,7 @@ BOOL OptionsMenu_Init(OVY_MANAGER *manager, int *state) { data->frameNumText = String_New(40, data->heapId); TextFlags_SetCanABSpeedUpPrint(FALSE); - sub_02002B8C(FALSE); + TextFlags_SetCanTouchSpeedUpPrint(FALSE); sub_0200FBF4(PM_LCD_TOP, 0); sub_0200FBF4(PM_LCD_BOTTOM, 0); @@ -382,7 +382,7 @@ BOOL OptionsMenu_Exit(OVY_MANAGER *manager, int *state) { String_Delete(data->frameNumText); TextFlags_SetCanABSpeedUpPrint(TRUE); - sub_02002B8C(TRUE); + TextFlags_SetCanTouchSpeedUpPrint(TRUE); OverlayManager_FreeData(manager); DestroyHeap(data->heapId); diff --git a/src/party_context_menu.c b/src/party_context_menu.c index c66228b060..266c25dea6 100644 --- a/src/party_context_menu.c +++ b/src/party_context_menu.c @@ -773,7 +773,7 @@ void PartyMenu_PrintMessageOnWindow34(PartyMenu *partyMenu, int msgId, BOOL draw void PartyMenu_PrintBufferedMessageOnWindow34(PartyMenu *partyMenu) { TextFlags_SetCanABSpeedUpPrint(TRUE); - sub_02002B50(0); + TextFlags_SetAutoScrollParam(0); partyMenu->textPrinterId = AddTextPrinterParameterized(&partyMenu->windows[PARTY_MENU_WINDOW_ID_34], 1, partyMenu->formattedStrBuf, 0, 0, Options_GetTextFrameDelay(partyMenu->args->options), TextPrinterCB_PartyMenuWin34Msg); } diff --git a/src/party_menu.c b/src/party_menu.c index 2001dd617d..7e4e9771ba 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -279,7 +279,7 @@ static BOOL PartyMenuApp_Init(OVY_MANAGER *manager, int *pState) { thunk_Sprite_SetPalIndex(partyMenu->sprites[PARTY_MENU_SPRITE_ID_CURSOR], 1); } sub_0207A89C(partyMenu); - sub_02002B8C(TRUE); + TextFlags_SetCanTouchSpeedUpPrint(TRUE); Main_SetVBlankIntrCB(sub_020796B8, partyMenu); sub_0203A994(2); FontID_Alloc(4, HEAP_ID_PARTY_MENU); @@ -611,7 +611,7 @@ static int PartyMenu_Subtask_UseTMHM(PartyMenu *partyMenu) { static BOOL PartyMenuApp_Exit(OVY_MANAGER *manager, int *pState) { u32 i; PartyMenu *partyMenu = (PartyMenu *)OverlayManager_GetData(manager); - sub_02002B8C(FALSE); + TextFlags_SetCanTouchSpeedUpPrint(FALSE); Main_SetVBlankIntrCB(NULL, NULL); PartyMenu_RemoveSpriteRenderer(partyMenu); PartyMenu_RemoveAllWindows(partyMenu); diff --git a/src/render_text.c b/src/render_text.c new file mode 100644 index 0000000000..aec9ed58f2 --- /dev/null +++ b/src/render_text.c @@ -0,0 +1,599 @@ +#include "render_text.h" + +#include "global.h" + +#include "constants/sndseq.h" + +#include "font.h" +#include "render_window.h" +#include "string_control_code.h" +#include "system.h" +#include "text.h" +#include "touchscreen.h" +#include "unk_02005D10.h" + +static u16 sDownArrowBaseTile; +static TextFlags sTextFlags; +static TouchscreenHitbox sTouchScreenHitbox; + +static const u8 sDownArrowTileOffsets[] = { 0, 1, 2, 1 }; + +static BOOL TextPrinter_ContinueInputHeld(TextPrinterSubStruct *subStruct); +static BOOL TextPrinter_ContinueInputNew(void); +static void TextPrinter_InitDownArrowCounters(TextPrinter *printer); +static void TextPrinter_DrawDownArrow(TextPrinter *printer); +static void TextPrinter_ClearDownArrow(TextPrinter *printer); +static BOOL TextPrinter_Continue(TextPrinter *printer); +static BOOL TextPrinter_WaitAutoMode(TextPrinter *printer); +static BOOL TextPrinter_WaitWithDownArrow(TextPrinter *printer); +static u8 TextPrinter_Wait(TextPrinter *printer); + +static BOOL TextPrinter_ContinueInputHeld(TextPrinterSubStruct *subStruct) { + if ((gSystem.heldKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) && subStruct->hasPrintBeenSpedUp) { + sTextFlags.touchIsSpeedingUpPrint = FALSE; + return TRUE; + } + + if (sTextFlags.canTouchSpeedUpPrint) { + if (!gSystem.touchHeld) { + return FALSE; + } + + if (sTextFlags.touchHitboxActive) { + if (TouchscreenHitbox_TouchHeldIsIn(&sTouchScreenHitbox)) { + sTextFlags.touchIsSpeedingUpPrint = TRUE; + return TRUE; + } + return FALSE; + } else { + sTextFlags.touchIsSpeedingUpPrint = TRUE; + return TRUE; + } + } + return FALSE; +} + +static BOOL TextPrinter_ContinueInputNew(void) { + if (gSystem.newKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { + sTextFlags.touchIsSpeedingUpPrint = FALSE; + return TRUE; + } + + if (sTextFlags.canTouchSpeedUpPrint) { + if (!gSystem.touchNew) { + return FALSE; + } + + if (sTextFlags.touchHitboxActive) { + if (TouchscreenHitbox_TouchNewIsIn(&sTouchScreenHitbox)) { + sTextFlags.touchIsSpeedingUpPrint = TRUE; + return TRUE; + } + return FALSE; + } else { + sTextFlags.touchIsSpeedingUpPrint = TRUE; + return TRUE; + } + } + return FALSE; +} + +RenderResult RenderText(TextPrinter *printer) { + TextPrinterSubStruct *subStruct = (TextPrinterSubStruct *)(&printer->subStructFields); + u16 currentChar; + + switch (printer->state) { + case 0: + if (TextPrinter_ContinueInputHeld(subStruct)) { + printer->delayCounter = 0; + if (printer->textSpeedBottom != 0) { + sTextFlags.hasSpedUpInput = 1; + } + } + + if (printer->delayCounter && printer->textSpeedBottom) { + printer->delayCounter--; + + if (sTextFlags.canABSpeedUpPrint != 0) { + if (TextPrinter_ContinueInputNew()) { + subStruct->hasPrintBeenSpedUp = 1; + printer->delayCounter = 0; + } + } + + return RENDER_UPDATE; + } + + printer->delayCounter = printer->textSpeedBottom; + currentChar = *printer->template.currentChar.raw; + printer->template.currentChar.raw++; + + GF_ASSERT(currentChar != 0xF100); + + switch (currentChar) { + case EOS: + return RENDER_FINISH; + case CHAR_LF: + printer->template.currentX = printer->template.x; + s32 fontAttribute = GetFontAttribute(printer->template.fontId, 1); + + printer->template.currentY += printer->template.lineSpacing + fontAttribute; + + return RENDER_REPEAT; + + case 0xF0FD: + printer->template.currentChar.raw++; + return RENDER_REPEAT; + case EXT_CTRL_CODE_BEGIN: + printer->template.currentChar.raw--; + switch ((u16)MsgArray_GetControlCode(printer->template.currentChar.raw)) { + case 0xFF00: + u16 field = MsgArray_ControlCodeGetField( + printer->template.currentChar.raw, 0); + if (field == 0xff) { + u8 r2 = printer->template.unk1B; + printer->template.unk1B = ((printer->template.fgColor - 1) / 2 + 100); + + if (r2 < 100 || r2 >= 107) { + break; + } + + field = (r2 - 100); + } else { + if (field >= 100) { + printer->template.unk1B = field; + break; + } + } + + printer->template.fgColor = (field * 2 + 1); + printer->template.shadowColor = (field * 2 + 2); + + GenerateFontHalfRowLookupTable(printer->template.fgColor, + printer->template.bgColor, + printer->template.shadowColor); + + break; + + case 0x200: + field = MsgArray_ControlCodeGetField( + printer->template.currentChar.raw, 0); + + RenderScreenFocusIndicatorTile(printer, + printer->template.currentX, + printer->template.currentY, + field); + if (printer->textSpeedTop != 0) { + CopyWindowToVram(printer->template.window); + } + + break; + case 0x207: + printer->state = 7; + TextPrinter_InitDownArrowCounters(printer); + printer->template.currentChar.raw = MsgArray_SkipControlCode(printer->template.currentChar.raw); + if (*printer->template.currentChar.raw == 0xE000) { + ++printer->template.currentChar.raw; + } + return RENDER_UPDATE; + case 0x208: + printer->state = 8; + TextPrinter_InitDownArrowCounters(printer); + printer->template.currentChar.raw = MsgArray_SkipControlCode(printer->template.currentChar.raw); + if (*printer->template.currentChar.raw == 0xE000) { + ++printer->template.currentChar.raw; + } + return RENDER_UPDATE; + case 0x201: + printer->delayCounter = MsgArray_ControlCodeGetField( + printer->template.currentChar.raw, 0); + printer->template.currentChar.raw = MsgArray_SkipControlCode(printer->template.currentChar.raw); + printer->state = 6; + + return RENDER_UPDATE; + case 0x202: + printer->unk2E = MsgArray_ControlCodeGetField( + printer->template.currentChar.raw, 0); + printer->template.currentChar.raw = MsgArray_SkipControlCode(printer->template.currentChar.raw); + + return RENDER_UPDATE; + case 0x203: + printer->template.currentX = MsgArray_ControlCodeGetField( + printer->template.currentChar.raw, 0); + break; + case 0x204: + printer->template.currentY = MsgArray_ControlCodeGetField( + printer->template.currentChar.raw, 0); + break; + case 0x205: { + int x = GetWindowWidth(printer->template.window) * 8; + int width = FontID_FlatArray_GetWidthFirstLine(printer->template.fontId, printer->template.currentChar.raw, printer->template.letterSpacing); + if (width < x) { + printer->template.currentX = printer->template.x + (x - width) / 2; + } else { + printer->template.currentX = printer->template.x; + } + } break; + case 0x206: { + int x = GetWindowWidth(printer->template.window) * 8; + int width = FontID_FlatArray_GetWidthFirstLine(printer->template.fontId, printer->template.currentChar.raw, printer->template.letterSpacing); + if (width < x) { + printer->template.currentX = x - width; + } else { + printer->template.currentX = printer->template.x; + } + } break; + + case 0xFF01: + field = MsgArray_ControlCodeGetField( + printer->template.currentChar.raw, 0); + + switch (field) { + case 100: + printer->template.glyphTable = 0; + printer->template.unk1A = 0; + break; + case 200: + printer->template.glyphTable = 0xFFFC; + printer->template.unk1A = 0; + break; + } + + break; + + case 0xFE06: + field = MsgArray_ControlCodeGetField( + printer->template.currentChar.raw, 0); + if (field != 0xFE00) { + if (field != 0xFE01) { + break; + } + + printer->state = 2; + TextPrinter_InitDownArrowCounters(printer); + printer->template.currentChar.raw = MsgArray_SkipControlCode( + printer->template.currentChar.raw); + + return RENDER_UPDATE; + } + + printer->state = 3; + TextPrinter_InitDownArrowCounters(printer); + printer->template.currentChar.raw = MsgArray_SkipControlCode(printer->template.currentChar.raw); + + return RENDER_UPDATE; + } + + printer->template.currentChar.raw = MsgArray_SkipControlCode(printer->template.currentChar.raw); + return RENDER_REPEAT; + + case 0x25BC: + printer->state = 2; + TextPrinter_InitDownArrowCounters(printer); + return RENDER_UPDATE; + + case 0x25BD: + printer->state = 3; + TextPrinter_InitDownArrowCounters(printer); + return RENDER_UPDATE; + } + + GlyphInfo *glyphInfo = FontID_TryLoadGlyph(subStruct->fontId, currentChar); + CopyGlyphToWindow(printer->template.window, + glyphInfo->data, + glyphInfo->width, + glyphInfo->height, + printer->template.currentX, + printer->template.currentY, + printer->template.glyphTable); + + printer->template.currentX += glyphInfo->width + printer->template.letterSpacing; + + return RENDER_PRINT; + case 1: + if (TextPrinter_Wait(printer) != 0) { + TextPrinter_ClearDownArrow(printer); + + printer->state = 0; + } + + return RENDER_UPDATE; + case 2: + if (TextPrinter_WaitWithDownArrow(printer) != 0) { + TextPrinter_ClearDownArrow(printer); + FillWindowPixelBuffer( + printer->template.window, printer->template.bgColor); + printer->template.currentX = printer->template.x; + printer->template.currentY = printer->template.y; + printer->state = 0; + } + + return RENDER_UPDATE; + case 3: + if (TextPrinter_WaitWithDownArrow(printer) != 0) { + TextPrinter_ClearDownArrow(printer); + printer->scrollDistance = (GetFontAttribute(printer->template.fontId, 1) + printer->template.lineSpacing); + printer->template.currentX = printer->template.x; + printer->state = 4; + } + + return RENDER_UPDATE; + case 4: + if (printer->scrollDistance != 0) { + if ((int)printer->scrollDistance < 4) { + ScrollWindow(printer->template.window, + 0, + printer->scrollDistance, + (printer->template.bgColor | (printer->template.bgColor << 4))); + printer->scrollDistance = 0; + } else { + ScrollWindow(printer->template.window, + 0, + 4, + (printer->template.bgColor | (printer->template.bgColor << 4))); + + printer->scrollDistance -= 4; + } + + CopyWindowToVram(printer->template.window); + } else { + printer->state = 0; + } + + return RENDER_UPDATE; + case 5: + printer->state = 0; + return RENDER_UPDATE; + case 6: + if (printer->delayCounter != 0) { + printer->delayCounter--; + } else { + printer->state = 0; + } + + return RENDER_UPDATE; + + case 7: + if (TextPrinter_WaitWithDownArrow(printer)) { + TextPrinter_ClearDownArrow(printer); + FillWindowPixelBuffer(printer->template.window, printer->template.bgColor); + printer->template.currentX = printer->template.x; + printer->template.currentY = printer->template.y; + printer->state = 0; + } + return RENDER_UPDATE; + case 8: + if (TextPrinter_WaitWithDownArrow(printer)) { + TextPrinter_ClearDownArrow(printer); + printer->scrollDistance = printer->template.lineSpacing + GetFontAttribute(printer->template.fontId, 1); + printer->template.currentX = printer->template.x; + printer->state = 4; + } + return RENDER_UPDATE; + } + + return RENDER_FINISH; +} + +void TextPrinter_SetDownArrowBaseTile(int tile) { + sDownArrowBaseTile = tile; +} + +static void TextPrinter_InitDownArrowCounters(TextPrinter *printer) { + TextPrinterSubStruct *subStruct = (TextPrinterSubStruct *)(&printer->subStructFields); + + if (sTextFlags.autoScroll) { + subStruct->autoScrollDelay = 0; + } else { + subStruct->downArrowYPosIdx = 0; + subStruct->downArrowDelay = 0; + } + sub_0200EB68(printer->template.window, sDownArrowBaseTile); +} + +// Possible UB? Where does downArrowYPosIdx get reset to 0 when it reaches NELEMS(sDownArrowTileOffsets) == 4? +static void TextPrinter_DrawDownArrow(TextPrinter *printer) { + TextPrinterSubStruct *subStruct = (TextPrinterSubStruct *)(&printer->subStructFields); + + if (sTextFlags.autoScroll || sTextFlags.useAlternateDownArrow) { + return; + } + + if (subStruct->downArrowDelay != 0) { + subStruct->downArrowDelay--; + return; + } + + u8 bg_id = GetWindowBgId(printer->template.window); + u8 x = GetWindowX(printer->template.window); + u8 y = GetWindowY(printer->template.window); + u8 width = GetWindowWidth(printer->template.window); + u8 height = GetWindowHeight(printer->template.window) - 2; + u16 baseTile = sDownArrowBaseTile; + + FillBgTilemapRect(printer->template.window->bgConfig, + bg_id, + (baseTile + 18 + sDownArrowTileOffsets[subStruct->downArrowYPosIdx] * 4), + (x + width + 1), + (y + height), + 1, + 1, + 0x10); + + FillBgTilemapRect(printer->template.window->bgConfig, + bg_id, + (baseTile + 19 + sDownArrowTileOffsets[subStruct->downArrowYPosIdx] * 4), + (x + width + 2), + (y + height), + 1, + 1, + 0x10); + FillBgTilemapRect(printer->template.window->bgConfig, + bg_id, + (baseTile + 20 + sDownArrowTileOffsets[subStruct->downArrowYPosIdx] * 4), + (x + width + 1), + (y + height + 1), + 1, + 1, + 0x10); + FillBgTilemapRect(printer->template.window->bgConfig, + bg_id, + (baseTile + 21 + sDownArrowTileOffsets[subStruct->downArrowYPosIdx] * 4), + (x + width + 2), + (y + height + 1), + 1, + 1, + 0x10); + + BgCommitTilemapBufferToVram(printer->template.window->bgConfig, bg_id); + subStruct->downArrowDelay = 8; + subStruct->downArrowYPosIdx++; +} + +static void TextPrinter_ClearDownArrow(TextPrinter *printer) { + if (sTextFlags.useAlternateDownArrow) { + return; + } + + u8 bg_id = GetWindowBgId(printer->template.window); + u8 x = GetWindowX(printer->template.window); + u8 y = GetWindowY(printer->template.window); + u8 width = GetWindowWidth(printer->template.window); + u8 height = GetWindowHeight(printer->template.window) - 2; + u16 baseTile = sDownArrowBaseTile; + + FillBgTilemapRect(printer->template.window->bgConfig, + bg_id, + (baseTile + 10), + (x + width + 1), + (y + height), + 1, + 2, + 0x10); + FillBgTilemapRect(printer->template.window->bgConfig, + bg_id, + (baseTile + 11), + (x + width + 2), + (y + height), + 1, + 2, + 0x10); + BgCommitTilemapBufferToVram(printer->template.window->bgConfig, bg_id); +} + +static BOOL TextPrinter_Continue(TextPrinter *printer) { +#pragma unused(printer) + if (TextPrinter_ContinueInputNew()) { + PlaySE(SEQ_SE_DP_SELECT); + + sTextFlags.hasContinuedInput = 1; + + return TRUE; + } + + return FALSE; +} + +static BOOL TextPrinter_WaitAutoMode(TextPrinter *printer) { + TextPrinterSubStruct *subStruct = (TextPrinterSubStruct *)(&printer->subStructFields); + + if (subStruct->autoScrollDelay == 100) { + return TRUE; + } + + subStruct->autoScrollDelay++; + if (sTextFlags.autoScrollCanSpeedUp) { + return TextPrinter_Continue(printer); + } + + return FALSE; +} + +static BOOL TextPrinter_WaitWithDownArrow(TextPrinter *printer) { + if (sTextFlags.autoScroll) { + return TextPrinter_WaitAutoMode(printer); + } + TextPrinter_DrawDownArrow(printer); + + return TextPrinter_Continue(printer); +} + +static u8 TextPrinter_Wait(TextPrinter *printer) { + if (sTextFlags.autoScroll) { + return TextPrinter_WaitAutoMode(printer); + } + + return TextPrinter_Continue(printer); +} + +void TextFlags_SetCanABSpeedUpPrint(BOOL param0) { + sTextFlags.canABSpeedUpPrint = param0; +} + +void TextFlags_SetAutoScrollParam(int param0) { + sTextFlags.autoScroll = param0 & 1; + sTextFlags.autoScrollCanSpeedUp = (param0 >> 1) & 1; +} + +void TextFlags_SetCanTouchSpeedUpPrint(BOOL enable) { + sTextFlags.canTouchSpeedUpPrint = enable; +} + +void TextFlags_SetAlternateDownArrow(BOOL enable) { + sTextFlags.useAlternateDownArrow = enable; +} + +u8 TextFlags_GetHasSpedUpInput(void) { + return sTextFlags.hasSpedUpInput; +} + +void TextFlags_ResetHasSpedUpInput(void) { + sTextFlags.hasSpedUpInput = 0; +} + +u8 TextFlags_GetHasContinuedInput(void) { + return sTextFlags.hasContinuedInput; +} + +void TextFlags_ResetHasContinuedInput(void) { + sTextFlags.hasContinuedInput = 0; +} + +BOOL TextFlags_GetIsTouchSpeedingUpPrint(void) { + if (sTextFlags.canTouchSpeedUpPrint) { + return sTextFlags.touchIsSpeedingUpPrint; + } else { + return FALSE; + } +} + +void TextFlags_SetFastForwardTouchButtonHitbox(const TouchscreenHitbox *hitbox) { + sTextFlags.touchHitboxActive = TRUE; + sTouchScreenHitbox = *hitbox; +} + +void TextFlags_UnsetFastForwardTouchButtonHitbox(void) { + sTextFlags.touchHitboxActive = FALSE; + sTouchScreenHitbox.rect.top = 0; + sTouchScreenHitbox.rect.bottom = 192; + sTouchScreenHitbox.rect.left = 0; + sTouchScreenHitbox.rect.right = 255; +} + +void TextFlags_BeginAutoScroll(BOOL noSpeedUp) { + if (noSpeedUp == FALSE) { + TextFlags_SetCanABSpeedUpPrint(TRUE); + TextFlags_SetAutoScrollParam(3); + TextFlags_SetCanTouchSpeedUpPrint(TRUE); + } else { + TextFlags_SetAutoScrollParam(1); + TextFlags_SetCanABSpeedUpPrint(FALSE); + TextFlags_SetCanTouchSpeedUpPrint(FALSE); + } +} + +void TextFlags_EndAutoScroll(void) { + TextFlags_SetCanABSpeedUpPrint(FALSE); + TextFlags_SetAutoScrollParam(0); + TextFlags_SetCanTouchSpeedUpPrint(FALSE); +} diff --git a/src/scrcmd_c.c b/src/scrcmd_c.c index bce772f324..de75212e6a 100644 --- a/src/scrcmd_c.c +++ b/src/scrcmd_c.c @@ -849,8 +849,8 @@ BOOL ScrCmd_TrainerTips(ScriptContext *ctx) { StringExpandPlaceholders(*msg_fmt, *unk, *tmp_str); TextFlags_SetCanABSpeedUpPrint(TRUE); - sub_02002B50(FALSE); - sub_02002B8C(FALSE); + TextFlags_SetAutoScrollParam(FALSE); + TextFlags_SetCanTouchSpeedUpPrint(FALSE); Window *window = ov01_021F3D80(fieldSystem->unk68); u8 text_speed = Options_GetTextFrameDelay(Save_PlayerData_GetOptionsAddr(fieldSystem->saveData)); diff --git a/src/string_control_code.c b/src/string_control_code.c index 9892368e02..523bd11530 100644 --- a/src/string_control_code.c +++ b/src/string_control_code.c @@ -14,7 +14,7 @@ const u16 *MsgArray_SkipControlCode(const u16 *arr) { return arr; } -u16 MsgArray_GetControlCode(const u16 *arr) { +int MsgArray_GetControlCode(const u16 *arr) { GF_ASSERT(*arr == EXT_CTRL_CODE_BEGIN); return arr[1]; } @@ -24,7 +24,7 @@ BOOL MsgArray_ControlCodeIsStrVar(const u16 *arr) { return strcode == 0x100 || strcode == 0x300 || strcode == 0x400 || strcode == 0x3400; } -u16 MsgArray_ControlCodeGetField(const u16 *arr, u32 fieldno) { +int MsgArray_ControlCodeGetField(const u16 *arr, u32 fieldno) { GF_ASSERT(*arr == EXT_CTRL_CODE_BEGIN); GF_ASSERT(fieldno < arr[2]); arr += 3; diff --git a/src/text.c b/src/text.c index 4a68e0d192..7a2565fd22 100644 --- a/src/text.c +++ b/src/text.c @@ -93,7 +93,7 @@ u8 AddTextPrinterParameterized(Window *window, FontID fontId, String *string, u3 template.fgColor = sFonts[fontId].fgColor; template.bgColor = sFonts[fontId].bgColor; template.shadowColor = sFonts[fontId].shadowColor; - template.unk18 = 0; + template.glyphTable = 0; template.unk1A = 0; template.unk1B = 0xFF; @@ -116,7 +116,7 @@ u8 AddTextPrinterParameterizedWithColor(Window *window, FontID fontId, String *s template.fgColor = (color >> 16) & 0xFF; template.shadowColor = (color >> 8) & 0xFF; template.bgColor = (color >> 0) & 0xFF; - template.unk18 = 0; + template.glyphTable = 0; template.unk1A = 0; template.unk1B = 0xFF; @@ -139,7 +139,7 @@ u8 AddTextPrinterParameterizedWithColorAndSpacing(Window *window, int fontId, St template.fgColor = (color >> 16) & 0xFF; template.shadowColor = (color >> 8) & 0xFF; template.bgColor = (color >> 0) & 0xFF; - template.unk18 = 0; + template.glyphTable = 0; template.unk1A = 0; template.unk1B = 0xFF; diff --git a/src/touch_save_app.c b/src/touch_save_app.c index f5d38dd870..34f23e3c14 100644 --- a/src/touch_save_app.c +++ b/src/touch_save_app.c @@ -207,7 +207,7 @@ SysTask *ov30_0225D520(BgConfig *bgConfig, void *a1, FieldSystem *fieldSystem, v GfGfx_EngineBTogglePlanes(GX_PLANEMASK_BG2, GF_PLANE_TOGGLE_ON); GfGfx_EngineBTogglePlanes(GX_PLANEMASK_OBJ, GF_PLANE_TOGGLE_ON); - sub_02002B8C(TRUE); + TextFlags_SetCanTouchSpeedUpPrint(TRUE); return task; } @@ -224,7 +224,7 @@ void ov30_0225D64C(BgConfig *bgConfig, SysTask *task) { ov01_021F434C(data->unk40); ov01_021F43D0(data->unk40); - sub_02002B8C(FALSE); + TextFlags_SetCanTouchSpeedUpPrint(FALSE); if (ov123_0225F520(ov30_0225DC08)) { AllocFromHeapAtEnd(HEAP_ID_3, 1000); diff --git a/src/unk_0206B910.c b/src/unk_0206B910.c index 0d78bc2032..0a231f0580 100644 --- a/src/unk_0206B910.c +++ b/src/unk_0206B910.c @@ -222,7 +222,7 @@ BOOL ScrCmd_236(ScriptContext *ctx) { BOOL ScrCmd_237(ScriptContext *ctx) { void **unused = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); - sub_02002C60(TRUE); + TextFlags_BeginAutoScroll(TRUE); return FALSE; } diff --git a/src/voltorb_flip/voltorb_flip.c b/src/voltorb_flip/voltorb_flip.c index b606d5688d..e8e5fd5471 100644 --- a/src/voltorb_flip/voltorb_flip.c +++ b/src/voltorb_flip/voltorb_flip.c @@ -1998,7 +1998,7 @@ static void ov122_021E8094(OVY_MANAGER *man) { sub_0200FBDC(0); sub_0200FBDC(1); TextFlags_SetCanABSpeedUpPrint(TRUE); - sub_02002B8C(TRUE); + TextFlags_SetCanTouchSpeedUpPrint(TRUE); Main_SetVBlankIntrCB((GFIntrCB)ov122_021E8004, work); GameStats_AddScore(Save_GameStats_Get(args->saveData), SCORE_EVENT_6);