diff --git a/CMakeLists.txt b/CMakeLists.txt index 41bae4dd04..2eec007d95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ foreach(SRC IN LISTS C_SOURCES_GAME C_SOURCES_LIBS) endforeach() add_executable(PokeHeartGold ${SOURCES}) -target_include_directories(PokeHeartGold PUBLIC include files ${CMAKE_SOURCE_DIR}/lib/include ${CMAKE_SOURCE_DIR}/lib/include/cw ${CMAKE_SOURCE_DIR}/lib/include/nitro ${CMAKE_SOURCE_DIR}/lib/include/nnsys ${CMAKE_SOURCE_DIR}/lib/include/nitro/os include/library) +target_include_directories(PokeHeartGold PUBLIC src include files ${CMAKE_SOURCE_DIR}/lib/include ${CMAKE_SOURCE_DIR}/lib/include/cw ${CMAKE_SOURCE_DIR}/lib/include/nitro ${CMAKE_SOURCE_DIR}/lib/include/nnsys ${CMAKE_SOURCE_DIR}/lib/include/nitro/os include/library) target_compile_definitions(PokeHeartGold PUBLIC __CLION_IDE__ SDK_ARM9 SDK_CW SDK_CODE_ARM SDK_TS _NITRO __arm PLATFORM_INTRINSIC_FUNCTION_BIT_CLZ32=__builtin_clz wchar_t=__WCHAR_TYPE__ PM_KEEP_ASSERTS) target_compile_options(PokeHeartGold PRIVATE -Wimplicit -Wno-endif-labels -fms-extensions -nostdinc -Wno-builtin-declaration-mismatch -Wno-implicit-int -Wno-multichar -Wno-address-of-packed-member -mcpu=arm946e-s) target_compile_features(PokeHeartGold PRIVATE c_std_99 cxx_std_98) diff --git a/asm/include/overlay_01_021E7FDC.inc b/asm/include/overlay_01_021E7FDC.inc index 4c666f4124..8b9bba3748 100644 --- a/asm/include/overlay_01_021E7FDC.inc +++ b/asm/include/overlay_01_021E7FDC.inc @@ -27,7 +27,7 @@ .public sub_0200B00C .public sub_0200B050 .public sub_0200B0CC -.public sub_0200B12C +.public GF_PlttResObj_GetVramSlotNum .public AllocFromHeap .public FreeToHeap .public SpriteList_Delete diff --git a/asm/include/overlay_02.inc b/asm/include/overlay_02.inc index 2a864d9ada..b5898722cb 100644 --- a/asm/include/overlay_02.inc +++ b/asm/include/overlay_02.inc @@ -41,7 +41,7 @@ .public sub_0200AF00 .public sub_0200B00C .public sub_0200B0A8 -.public sub_0200B0F8 +.public GF_PlttResObj_GetPlttProxy .public NewMsgDataFromNarc .public DestroyMsgData .public NewString_ReadMsgData diff --git a/asm/include/overlay_05.inc b/asm/include/overlay_05.inc index 0611908d4f..461002ca38 100644 --- a/asm/include/overlay_05.inc +++ b/asm/include/overlay_05.inc @@ -48,7 +48,7 @@ .public SpriteRenderer_LoadCellResObjFromOpenNarc .public SpriteRenderer_LoadAnimResObjFromOpenNarc .public SpriteRenderer_LoadResourcesAndCreateSprite -.public sub_0200D934 +.public GfGfxHandler_GetPlttProxy .public SpriteRenderer_UnloadResourcesAndRemoveGfxHandler .public UnkImageStruct_Delete .public UnkImageStruct_SetSpriteAnimSeqNo diff --git a/asm/include/overlay_07.inc b/asm/include/overlay_07.inc index 12597821fd..6e58bab0f8 100644 --- a/asm/include/overlay_07.inc +++ b/asm/include/overlay_07.inc @@ -234,8 +234,8 @@ .public ov07_02234B5C .public ov07_022377DC .public ov07_022377F4 -.public ov12_0223A8E4 -.public ov12_0223A8EC +.public BattleSystem_GetSpriteRenderer +.public BattleSystem_GetGfxHandler .public BattleSystem_GetPaletteData .public ov12_0223BB88 .public ov12_0223C1C4 diff --git a/asm/include/overlay_08.inc b/asm/include/overlay_08.inc index 7397912539..c34206e558 100644 --- a/asm/include/overlay_08.inc +++ b/asm/include/overlay_08.inc @@ -169,7 +169,7 @@ .public BattleSystem_GetBattleContext .public BattleSystem_GetParty .public BattleSystem_GetPartyMon -.public ov12_0223A8E4 +.public BattleSystem_GetSpriteRenderer .public BattleSystem_GetPaletteData .public BattleSystem_GetTrainer .public BattleSystem_GetBag diff --git a/asm/include/overlay_100.inc b/asm/include/overlay_100.inc index 57c0c21f0b..7c22628be1 100644 --- a/asm/include/overlay_100.inc +++ b/asm/include/overlay_100.inc @@ -41,7 +41,7 @@ .public sub_0200B00C .public sub_0200B084 .public sub_0200B0CC -.public sub_0200B12C +.public GF_PlttResObj_GetVramSlotNum .public sub_0200B2E0 .public sub_0200B2E8 .public SpriteRenderer_Create diff --git a/asm/include/overlay_101.inc b/asm/include/overlay_101.inc index 4c81f62993..e234e4ddc8 100644 --- a/asm/include/overlay_101.inc +++ b/asm/include/overlay_101.inc @@ -58,7 +58,7 @@ .public SpriteRenderer_GetG2dRendererPtr .public thunk_Sprite_Delete .public SpriteRenderer_CreateSprite -.public sub_0200D934 +.public GfGfxHandler_GetPlttProxy .public thunk_Sprite_SetPriority .public thunk_Sprite_SetDrawPriority .public Sprite_SetPositionXY diff --git a/asm/include/overlay_108.inc b/asm/include/overlay_108.inc index c1741c1d84..186d56b0e7 100644 --- a/asm/include/overlay_108.inc +++ b/asm/include/overlay_108.inc @@ -58,7 +58,7 @@ .public SpriteRenderer_Delete .public sub_0200D2A4 .public SpriteRenderer_CreateSprite -.public sub_0200D934 +.public GfGfxHandler_GetPlttProxy .public UnkImageStruct_Delete .public thunk_Set2dSpriteVisibleFlag .public thunk_Sprite_SetPriority diff --git a/asm/include/overlay_112.inc b/asm/include/overlay_112.inc index fe80143914..4c48a8a722 100644 --- a/asm/include/overlay_112.inc +++ b/asm/include/overlay_112.inc @@ -51,7 +51,7 @@ .public sub_0200AF00 .public sub_0200AF94 .public sub_0200B0A8 -.public sub_0200B0F8 +.public GF_PlttResObj_GetPlttProxy .public OamManager_Create .public OamManager_Free .public NewMsgDataFromNarc diff --git a/asm/include/overlay_12_02264824.inc b/asm/include/overlay_12_02264824.inc index b65c092ca4..666db7c5fd 100644 --- a/asm/include/overlay_12_02264824.inc +++ b/asm/include/overlay_12_02264824.inc @@ -13,7 +13,7 @@ .public SpriteRenderer_LoadCellResObjFromOpenNarc .public SpriteRenderer_LoadAnimResObjFromOpenNarc .public SpriteRenderer_LoadResourcesAndCreateSprite -.public sub_0200D944 +.public GfGfxHandler_GetPlttNumById .public SpriteGfxHandler_UnloadCharObjById .public SpriteGfxHandler_UnloadCellObjById .public SpriteGfxHandler_UnloadAnimObjById @@ -40,7 +40,7 @@ .public String_New .public String_Delete .public Mon_GetBoxMon -.public sub_02088080 +.public HpBar_GetColorIdx .public MIi_CpuCopy16 .public MI_CpuFill8 .public abs @@ -50,10 +50,10 @@ .public BattleSystem_GetBgConfig .public BattleSystem_GetBattleType .public BattleSystem_GetPartyMon -.public ov12_0223A8E4 -.public ov12_0223A8EC -.public BattleSystem_GetHpFont -.public BattleSystem_GetLevelFont +.public BattleSystem_GetSpriteRenderer +.public BattleSystem_GetGfxHandler +.public BattleSystem_GetHpNumPrinter +.public BattleSystem_GetLevelNumPrinter .public BattleSystem_GetMessageData .public BattleSystem_GetPaletteData .public BattleSystem_GetMessageFormat @@ -70,7 +70,7 @@ .public ov12_02264EE0 .public BattleHpBar_SetEnabled .public ov12_02264FB0 -.public ov12_02265B64 -.public ov12_02265C54 +.public BattleHpBar_Util_GetBarTypeFromBattlerSide +.public BattleHpBar_BeginExpBarFullFlashEffect .public ov12_02265D70 .public ov12_02265D74 diff --git a/asm/include/overlay_12_02265E28.inc b/asm/include/overlay_12_02265E28.inc index f096ffae24..9606daf6cd 100644 --- a/asm/include/overlay_12_02265E28.inc +++ b/asm/include/overlay_12_02265E28.inc @@ -17,8 +17,8 @@ .public UnkImageStruct_SetSpriteVisibleFlag .public GF_AssertFail .public MIi_CpuClearFast -.public ov12_0223A8E4 -.public ov12_0223A8EC +.public BattleSystem_GetSpriteRenderer +.public BattleSystem_GetGfxHandler .public BattleSystem_GetPaletteData .public ov12_0223B52C .public ov12_02265FC4 diff --git a/asm/include/overlay_12_02266024.inc b/asm/include/overlay_12_02266024.inc index ee91c0766b..4d317c213a 100644 --- a/asm/include/overlay_12_02266024.inc +++ b/asm/include/overlay_12_02266024.inc @@ -34,7 +34,7 @@ .public SpriteRenderer_LoadAnimResObjFromNarcId .public SpriteRenderer_LoadAnimResObjFromOpenNarc .public SpriteRenderer_LoadResourcesAndCreateSprite -.public sub_0200D934 +.public GfGfxHandler_GetPlttProxy .public SpriteGfxHandler_UnloadCharObjById .public SpriteGfxHandler_UnloadPlttObjById .public SpriteGfxHandler_UnloadCellObjById @@ -133,8 +133,8 @@ .public BattleSystem_GetBattleType .public BattleSystem_GetOpponentData .public BattleSystem_GetPartyMon -.public ov12_0223A8E4 -.public ov12_0223A8EC +.public BattleSystem_GetSpriteRenderer +.public BattleSystem_GetGfxHandler .public BattleSystem_GetMessageData .public BattleSystem_GetPaletteData .public BattleSystem_GetMessageFormat diff --git a/asm/include/overlay_12_battle_command.inc b/asm/include/overlay_12_battle_command.inc index 8b482f9d04..3480961ef7 100644 --- a/asm/include/overlay_12_battle_command.inc +++ b/asm/include/overlay_12_battle_command.inc @@ -26,7 +26,7 @@ .public SpriteRenderer_LoadCellResObjFromNarcId .public SpriteRenderer_LoadAnimResObjFromNarcId .public SpriteRenderer_LoadResourcesAndCreateSprite -.public sub_0200D934 +.public GfGfxHandler_GetPlttProxy .public SpriteGfxHandler_UnloadCharObjById .public SpriteGfxHandler_UnloadPlttObjById .public SpriteGfxHandler_UnloadCellObjById @@ -123,8 +123,8 @@ .public BattleSystem_GetPartySize .public BattleSystem_GetPartyMon .public ov12_0223A8D4 -.public ov12_0223A8E4 -.public ov12_0223A8EC +.public BattleSystem_GetSpriteRenderer +.public BattleSystem_GetGfxHandler .public ov12_0223A8F4 .public BattleSystem_GetMessageData .public BattleSystem_GetPaletteData diff --git a/asm/include/overlay_12_battle_controller_opponent.inc b/asm/include/overlay_12_battle_controller_opponent.inc index ccd6106d4a..f49358f612 100644 --- a/asm/include/overlay_12_battle_controller_opponent.inc +++ b/asm/include/overlay_12_battle_controller_opponent.inc @@ -157,8 +157,8 @@ .public BattleSystem_GetPartyMon .public ov12_0223A8D4 .public ov12_0223A8DC -.public ov12_0223A8E4 -.public ov12_0223A8EC +.public BattleSystem_GetSpriteRenderer +.public BattleSystem_GetGfxHandler .public ov12_0223A8F4 .public ov12_0223A900 .public ov12_0223A908 @@ -272,8 +272,8 @@ .public ov12_02264EB4 .public BattleHpBar_SetEnabled .public ov12_02264FB0 -.public ov12_02265B64 -.public ov12_02265C54 +.public BattleHpBar_Util_GetBarTypeFromBattlerSide +.public BattleHpBar_BeginExpBarFullFlashEffect .public ov12_02265D70 .public ov12_02265D74 .public ov12_02266508 diff --git a/asm/include/overlay_14.inc b/asm/include/overlay_14.inc index 05a09aa8d8..9680178eb3 100644 --- a/asm/include/overlay_14.inc +++ b/asm/include/overlay_14.inc @@ -65,7 +65,7 @@ .public SpriteRenderer_LoadAnimResObjFromNarcId .public SpriteRenderer_LoadResourcesAndCreateSprite .public SpriteRenderer_LoadResourcesAndCreateSprite_CustomBottomScreenOffset -.public sub_0200D934 +.public GfGfxHandler_GetPlttProxy .public SpriteRenderer_UnloadResourcesAndRemoveGfxHandler .public UnkImageStruct_Delete .public UnkImageStruct_TickSpriteAnimation1Frame diff --git a/asm/include/overlay_18.inc b/asm/include/overlay_18.inc index e0434cbf72..c683960e21 100644 --- a/asm/include/overlay_18.inc +++ b/asm/include/overlay_18.inc @@ -57,7 +57,7 @@ .public sub_0200AEB0 .public sub_0200B00C .public sub_0200B0A8 -.public sub_0200B12C +.public GF_PlttResObj_GetVramSlotNum .public NewMsgDataFromNarc .public DestroyMsgData .public ReadMsgDataIntoString @@ -91,7 +91,7 @@ .public SpriteRenderer_LoadAnimResObjFromOpenNarc .public SpriteRenderer_LoadResourcesAndCreateSprite .public SpriteRenderer_LoadResourcesAndCreateSprite_CustomBottomScreenOffset -.public sub_0200D944 +.public GfGfxHandler_GetPlttNumById .public SpriteGfxHandler_UnloadCharObjById .public SpriteGfxHandler_UnloadPlttObjById .public SpriteGfxHandler_UnloadCellObjById diff --git a/asm/include/overlay_40.inc b/asm/include/overlay_40.inc index d0a29c50e2..4f06028dda 100644 --- a/asm/include/overlay_40.inc +++ b/asm/include/overlay_40.inc @@ -67,7 +67,7 @@ .public SpriteRenderer_LoadAnimResObjFromNarcId .public SpriteRenderer_LoadAnimResObjFromOpenNarc .public SpriteRenderer_LoadResourcesAndCreateSprite -.public sub_0200D934 +.public GfGfxHandler_GetPlttProxy .public SpriteGfxHandler_UnloadCharObjById .public SpriteGfxHandler_UnloadPlttObjById .public SpriteGfxHandler_UnloadCellObjById diff --git a/asm/include/overlay_41.inc b/asm/include/overlay_41.inc index 46a42e84be..c283dde166 100644 --- a/asm/include/overlay_41.inc +++ b/asm/include/overlay_41.inc @@ -55,7 +55,7 @@ .public sub_0200AEB0 .public sub_0200B00C .public sub_0200B0A8 -.public sub_0200B0F8 +.public GF_PlttResObj_GetPlttProxy .public OamManager_Create .public OamManager_ApplyAndResetBuffers .public OamManager_Free diff --git a/asm/include/overlay_42.inc b/asm/include/overlay_42.inc index b357936634..ad61f7311e 100644 --- a/asm/include/overlay_42.inc +++ b/asm/include/overlay_42.inc @@ -20,7 +20,7 @@ .public sub_0200AEB0 .public sub_0200B00C .public sub_0200B0A8 -.public sub_0200B12C +.public GF_PlttResObj_GetVramSlotNum .public AllocFromHeap .public FreeToHeap .public InitBgFromTemplate diff --git a/asm/include/overlay_44.inc b/asm/include/overlay_44.inc index 802999e010..81709f103b 100644 --- a/asm/include/overlay_44.inc +++ b/asm/include/overlay_44.inc @@ -57,7 +57,7 @@ .public sub_0200AEB0 .public sub_0200B00C .public sub_0200B0A8 -.public sub_0200B0F8 +.public GF_PlttResObj_GetPlttProxy .public OamManager_Create .public OamManager_ApplyAndResetBuffers .public OamManager_Free diff --git a/asm/include/overlay_57.inc b/asm/include/overlay_57.inc index 5788423369..e8d03d0d1e 100644 --- a/asm/include/overlay_57.inc +++ b/asm/include/overlay_57.inc @@ -57,7 +57,7 @@ .public SpriteRenderer_LoadAnimResObjFromNarcId .public SpriteRenderer_LoadAnimResObjFromOpenNarc .public SpriteRenderer_LoadResourcesAndCreateSprite -.public sub_0200D934 +.public GfGfxHandler_GetPlttProxy .public SpriteGfxHandler_UnloadCharObjById .public SpriteRenderer_UnloadResourcesAndRemoveGfxHandler .public UnkImageStruct_Delete diff --git a/asm/include/overlay_80_0223A00C.inc b/asm/include/overlay_80_0223A00C.inc index 4862ec0769..8ad6b3c338 100644 --- a/asm/include/overlay_80_0223A00C.inc +++ b/asm/include/overlay_80_0223A00C.inc @@ -21,7 +21,7 @@ .public SpriteRenderer_LoadCellResObjFromOpenNarc .public SpriteRenderer_LoadAnimResObjFromOpenNarc .public SpriteRenderer_LoadResourcesAndCreateSprite -.public sub_0200D934 +.public GfGfxHandler_GetPlttProxy .public UnkImageStruct_Delete .public TickSpriteAnimation1Frame .public UnkImageStruct_SetSpriteVisibleFlag diff --git a/asm/include/overlay_89.inc b/asm/include/overlay_89.inc index b11c614bb2..60581763a7 100644 --- a/asm/include/overlay_89.inc +++ b/asm/include/overlay_89.inc @@ -57,7 +57,7 @@ .public SpriteRenderer_LoadCellResObjFromOpenNarc .public SpriteRenderer_LoadAnimResObjFromOpenNarc .public SpriteRenderer_LoadResourcesAndCreateSprite -.public sub_0200D934 +.public GfGfxHandler_GetPlttProxy .public SpriteRenderer_UnloadResourcesAndRemoveGfxHandler .public UnkImageStruct_Delete .public TickSpriteAnimation1Frame diff --git a/asm/include/overlay_90.inc b/asm/include/overlay_90.inc index 6772801ef4..3df6b02c8d 100644 --- a/asm/include/overlay_90.inc +++ b/asm/include/overlay_90.inc @@ -34,7 +34,7 @@ .public sub_0200AEB0 .public sub_0200B00C .public sub_0200B0A8 -.public sub_0200B12C +.public GF_PlttResObj_GetVramSlotNum .public OamManager_Create .public OamManager_ApplyAndResetBuffers .public OamManager_Free diff --git a/asm/include/overlay_91.inc b/asm/include/overlay_91.inc index 30abdf82aa..ed2b7bbe59 100644 --- a/asm/include/overlay_91.inc +++ b/asm/include/overlay_91.inc @@ -31,7 +31,7 @@ .public sub_0200AEB0 .public sub_0200B00C .public sub_0200B0A8 -.public sub_0200B0F8 +.public GF_PlttResObj_GetPlttProxy .public OamManager_Create .public OamManager_ApplyAndResetBuffers .public OamManager_Free diff --git a/asm/include/overlay_93_thumb_2.inc b/asm/include/overlay_93_thumb_2.inc index afa220f53e..c13f530092 100644 --- a/asm/include/overlay_93_thumb_2.inc +++ b/asm/include/overlay_93_thumb_2.inc @@ -15,8 +15,8 @@ .public GfGfxLoader_LoadScrnDataFromOpenNarc .public NewString_ReadMsgData .public SpriteRenderer_LoadResourcesAndCreateSprite -.public sub_0200D934 -.public sub_0200D944 +.public GfGfxHandler_GetPlttProxy +.public GfGfxHandler_GetPlttNumById .public UnkImageStruct_Delete .public TickSpriteAnimation1Frame .public UnkImageStruct_TickSpriteAnimationNFrames diff --git a/asm/include/overlay_96.inc b/asm/include/overlay_96.inc index 14f1b1bac3..f7c04e4da8 100644 --- a/asm/include/overlay_96.inc +++ b/asm/include/overlay_96.inc @@ -72,7 +72,7 @@ .public sub_0200AF00 .public sub_0200AF94 .public sub_0200B0A8 -.public sub_0200B0F8 +.public GF_PlttResObj_GetPlttProxy .public OamManager_Create .public OamManager_ApplyAndResetBuffers .public OamManager_Free diff --git a/asm/include/overlay_97.inc b/asm/include/overlay_97.inc index 8a8a7e4601..905348d4cf 100644 --- a/asm/include/overlay_97.inc +++ b/asm/include/overlay_97.inc @@ -24,7 +24,7 @@ .public sub_0200AF00 .public sub_0200AF94 .public sub_0200B0A8 -.public sub_0200B0F8 +.public GF_PlttResObj_GetPlttProxy .public OamManager_Create .public OamManager_Free .public NewMsgDataFromNarc diff --git a/asm/include/render_window.inc b/asm/include/render_window.inc index 8b7511a0fd..8af19708ae 100644 --- a/asm/include/render_window.inc +++ b/asm/include/render_window.inc @@ -11,7 +11,7 @@ .public PokepicManager_Delete .public Get2DGfxResObjById .public sub_0200AF00 -.public sub_0200B0F8 +.public GF_PlttResObj_GetPlttProxy .public UnkImageStruct_Delete .public SysTask_CreateOnVBlankQueue .public SysTask_CreateOnVWaitQueue diff --git a/asm/include/unk_020863F4.inc b/asm/include/unk_020863F4.inc index 978979e8dd..44937cd685 100644 --- a/asm/include/unk_020863F4.inc +++ b/asm/include/unk_020863F4.inc @@ -20,7 +20,7 @@ .public SpriteRenderer_LoadCellResObjFromOpenNarc .public SpriteRenderer_LoadAnimResObjFromOpenNarc .public SpriteRenderer_LoadResourcesAndCreateSprite -.public sub_0200D934 +.public GfGfxHandler_GetPlttProxy .public UnkImageStruct_Delete .public UnkImageStruct_TickSpriteAnimation1Frame .public UnkImageStruct_SetSpriteAnimSeqNo diff --git a/asm/include/unk_0208805C.inc b/asm/include/unk_0208805C.inc deleted file mode 100644 index 6d91f1221d..0000000000 --- a/asm/include/unk_0208805C.inc +++ /dev/null @@ -1,17 +0,0 @@ -#include -#pragma once -.public GfGfxLoader_LoadCharDataFromOpenNarc -.public GfGfxLoader_LoadScrnDataFromOpenNarc -.public GfGfxLoader_GXLoadPalFromOpenNarc -.public BeginNormalPaletteFade -.public sub_0208805C -.public CalculateHpBarPixelsLength -.public sub_02088080 -.public CalculateHpBarColor -.public sub_020880CC -.public sub_020881C0 -.public sub_0208820C -.public _u32_div_f -.public gOverlayTemplate_Battle -.public gNatureStatMods -.public gSystem diff --git a/asm/overlay_01_021E7FDC.s b/asm/overlay_01_021E7FDC.s index 40582fa0c4..51b959e893 100644 --- a/asm/overlay_01_021E7FDC.s +++ b/asm/overlay_01_021E7FDC.s @@ -525,7 +525,7 @@ _021E83CC: bl ov01_021E847C ldr r1, [sp, #0x2c] add r0, r4, #0 - bl sub_0200B12C + bl GF_PlttResObj_GetVramSlotNum add sp, #0x10 pop {r3, r4, r5, r6, r7, pc} _021E83E4: diff --git a/asm/overlay_02_02245B80.s b/asm/overlay_02_02245B80.s index dee67e6216..2230dfeb0f 100644 --- a/asm/overlay_02_02245B80.s +++ b/asm/overlay_02_02245B80.s @@ -10239,7 +10239,7 @@ ov02_0224A88C: ; 0x0224A88C mov r1, #3 bl Get2DGfxResObjById add r1, r6, #0 - bl sub_0200B0F8 + bl GF_PlttResObj_GetPlttProxy mov r1, #1 bl NNS_G2dGetImagePaletteLocation add r5, r0, #0 diff --git a/asm/overlay_05.s b/asm/overlay_05.s index 9082630480..d0fbe8c180 100644 --- a/asm/overlay_05.s +++ b/asm/overlay_05.s @@ -3418,7 +3418,7 @@ ov05_0221D530: ; 0x0221D530 lsl r0, r0, #2 ldr r0, [r4, r0] ldr r1, _0221D5D4 ; =0x0000B807 - bl sub_0200D934 + bl GfGfxHandler_GetPlttProxy mov r1, #0x3e lsl r2, r6, #4 lsl r1, r1, #4 diff --git a/asm/overlay_07.s b/asm/overlay_07.s index da1ffb9f1a..377673eb20 100644 --- a/asm/overlay_07.s +++ b/asm/overlay_07.s @@ -8506,10 +8506,10 @@ ov07_0221FB90: ; 0x0221FB90 str r0, [r4] str r5, [r4, #4] add r0, r7, #0 - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer str r0, [r4, #8] add r0, r7, #0 - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler str r0, [r4, #0xc] add r0, r7, #0 bl BattleSystem_GetPaletteData diff --git a/asm/overlay_08.s b/asm/overlay_08.s index 5796783914..b462917f08 100644 --- a/asm/overlay_08.s +++ b/asm/overlay_08.s @@ -8763,7 +8763,7 @@ ov08_0222061C: ; 0x0222061C stmia r2!, {r0, r1} ldr r0, [r5] ldr r0, [r0, #8] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer add r4, r0, #0 bl SpriteRenderer_CreateGfxHandler ldr r1, _02220664 ; =0x00001FB4 @@ -8796,7 +8796,7 @@ ov08_02220668: ; 0x02220668 add r7, r0, #0 ldr r0, [r6] ldr r0, [r0, #8] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer str r0, [sp, #0x18] bl sub_02074490 str r7, [sp] @@ -8899,7 +8899,7 @@ ov08_02220750: ; 0x02220750 add r5, r0, #0 ldr r0, [r5] ldr r0, [r0, #8] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer ldr r1, [r5] add r4, r0, #0 ldr r1, [r1, #0xc] @@ -8977,7 +8977,7 @@ ov08_02220800: ; 0x02220800 add r5, r0, #0 ldr r0, [r5] ldr r0, [r0, #8] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer add r6, r0, #0 mov r0, #2 str r0, [sp] @@ -9039,7 +9039,7 @@ ov08_02220878: ; 0x02220878 add r4, r0, #0 ldr r0, [r5] ldr r0, [r0, #8] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer add r6, r0, #0 bl sub_0207CAA0 str r4, [sp] @@ -9112,7 +9112,7 @@ ov08_02220928: ; 0x02220928 add r5, r0, #0 ldr r0, [r5] ldr r0, [r0, #8] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer add r4, r0, #0 mov r0, #0x47 str r0, [sp] @@ -9182,7 +9182,7 @@ ov08_022209B8: ; 0x022209B8 ldr r0, [r5] add r4, r1, #0 ldr r0, [r0, #8] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer mov r2, #0 add r1, sp, #0 strh r2, [r1] @@ -9256,7 +9256,7 @@ ov08_02220A50: ; 0x02220A50 add r7, r0, #0 ldr r0, [r7] ldr r0, [r0, #8] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer ldr r6, _02220A84 ; =0x00001FB8 str r0, [sp] mov r4, #0 @@ -9343,7 +9343,7 @@ ov08_02220AEC: ; 0x02220AEC ldr r0, [r0, #8] add r7, r1, #0 add r4, r2, #0 - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer str r0, [sp, #8] bl sub_020776B4 str r0, [sp, #0xc] @@ -9379,7 +9379,7 @@ ov08_02220B3C: ; 0x02220B3C add r4, r2, #0 ldr r0, [r0, #8] add r6, r1, #0 - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer add r7, r0, #0 bl sub_02077830 str r0, [sp, #8] @@ -10747,7 +10747,7 @@ ov08_0222162C: ; 0x0222162C add r5, r0, #0 ldr r0, [r5] ldr r0, [r0, #8] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer ldr r1, _02221688 ; =0x0000B018 mov r2, #0x7a str r1, [sp] @@ -15676,7 +15676,7 @@ ov08_02223D34: ; 0x02223D34 stmia r2!, {r0, r1} ldr r0, [r5] ldr r0, [r0] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer add r4, r0, #0 bl SpriteRenderer_CreateGfxHandler mov r1, #0xc3 @@ -15710,7 +15710,7 @@ ov08_02223D80: ; 0x02223D80 add r7, r0, #0 ldr r0, [r6] ldr r0, [r0] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer str r0, [sp, #0x18] mov r4, #0 _02223D9E: @@ -15794,7 +15794,7 @@ ov08_02223E3C: ; 0x02223E3C add r6, r1, #0 ldr r0, [r0] add r4, r2, #0 - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer add r7, r0, #0 add r0, r6, #0 mov r1, #1 @@ -15848,7 +15848,7 @@ ov08_02223EA4: ; 0x02223EA4 ldr r0, [r5] add r4, r1, #0 ldr r0, [r0] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer mov r2, #0 add r1, sp, #0 strh r2, [r1] @@ -15919,7 +15919,7 @@ ov08_02223F34: ; 0x02223F34 add r7, r0, #0 ldr r0, [r7] ldr r0, [r0] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer mov r6, #0x31 str r0, [sp] mov r4, #0 @@ -16113,7 +16113,7 @@ ov08_022240A8: ; 0x022240A8 add r5, r0, #0 ldr r0, [r5] ldr r0, [r0] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer ldr r1, _02224104 ; =0x0000B4BE add r4, r0, #0 str r1, [sp] @@ -16235,7 +16235,7 @@ ov08_0222419C: ; 0x0222419C add r5, r0, #0 ldr r0, [r5] ldr r0, [r0] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer ldr r1, _022241F0 ; =0x0000B4BD add r4, r0, #0 str r1, [sp] diff --git a/asm/overlay_100.s b/asm/overlay_100.s index 7fc7683a73..ee0d825ecb 100644 --- a/asm/overlay_100.s +++ b/asm/overlay_100.s @@ -2500,7 +2500,7 @@ _021E6BE0: bl Sprite_SetAnimCtrlSeq add r0, r7, #0 add r1, r6, #0 - bl sub_0200B12C + bl GF_PlttResObj_GetVramSlotNum ldr r1, _021E6C40 ; =ov100_021E770C add r2, r0, #0 ldrb r1, [r1, r5] diff --git a/asm/overlay_101.s b/asm/overlay_101.s index a36d637a9c..70d4ac8ea2 100644 --- a/asm/overlay_101.s +++ b/asm/overlay_101.s @@ -2558,7 +2558,7 @@ ov101_021E8AE4: ; 0x021E8AE4 mov r1, #0 add r0, #0x90 ldr r0, [r0] - bl sub_0200D934 + bl GfGfxHandler_GetPlttProxy str r0, [sp, #0x24] mov r0, #0 str r0, [sp, #0x10] @@ -12470,6 +12470,8 @@ _021ED7E4: bx lr thumb_func_end ov101_021ED7D8 + // File boundary? + thumb_func_start TownMap_Init TownMap_Init: ; 0x021ED7F8 push {r3, r4, r5, lr} @@ -14530,6 +14532,8 @@ _021EE8E0: .word ov101_021EB2FC _021EE8E4: .word 0x00030100 thumb_func_end ov101_021EE670 + // File boundary? + thumb_func_start ov101_021EE8E8 ov101_021EE8E8: ; 0x021EE8E8 push {r3, r4, r5, lr} @@ -16529,6 +16533,8 @@ _021EF840: .word ov101_021F83E4 _021EF844: .word 0x00000941 thumb_func_end ov101_021EF7D4 + // File boundary? + thumb_func_start ov101_021EF848 ov101_021EF848: ; 0x021EF848 push {r3, r4, r5, lr} @@ -21427,6 +21433,7 @@ _021F1D6E: _021F1D70: .word 0x00000404 thumb_func_end ov101_021F1D44 + // Gendered phone call? thumb_func_start ov101_021F1D74 ov101_021F1D74: ; 0x021F1D74 push {r4, r5, r6, lr} @@ -21954,6 +21961,9 @@ _021F219C: .word ov101_021F8400 thumb_func_start PhoneCallMessagePrint PhoneCallMessagePrint: ; 0x021F21A0 + // r0: PhoneCallData + // r1: MsgData + // r2: MsgIDs push {r4, lr} sub sp, #0x10 add r4, r0, #0 @@ -26614,6 +26624,8 @@ _021F4478: .word 0x0000096A _021F447C: .word 0x0000099F thumb_func_end ov101_021F42E4 + // File boundary? + thumb_func_start ov101_021F4480 ov101_021F4480: ; 0x021F4480 push {r3, r4, r5, lr} diff --git a/asm/overlay_108.s b/asm/overlay_108.s index b0d04a48f8..10f1ea71ee 100644 --- a/asm/overlay_108.s +++ b/asm/overlay_108.s @@ -3607,7 +3607,7 @@ ov108_021E756C: ; 0x021E756C lsl r0, r0, #4 ldr r0, [r5, r0] mov r1, #0 - bl sub_0200D934 + bl GfGfxHandler_GetPlttProxy str r0, [sp, #0x1c] mov r0, #3 str r0, [sp, #0x30] diff --git a/asm/overlay_112.s b/asm/overlay_112.s index 38257b2871..4712426348 100644 --- a/asm/overlay_112.s +++ b/asm/overlay_112.s @@ -22288,7 +22288,7 @@ ov112_021F0C50: ; 0x021F0C50 add r6, r0, #0 add r0, r4, #0 add r1, r6, #0 - bl sub_0200B0F8 + bl GF_PlttResObj_GetPlttProxy add r4, r0, #0 add r0, r6, #0 mov r1, #2 diff --git a/asm/overlay_12_02265E28.s b/asm/overlay_12_02265E28.s index 2fccdf08cc..e357ac7259 100644 --- a/asm/overlay_12_02265E28.s +++ b/asm/overlay_12_02265E28.s @@ -14,10 +14,10 @@ ov12_02265E28: ; 0x02265E28 bl NARC_New add r4, r0, #0 ldr r0, [r5, #4] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer str r0, [sp, #0x24] ldr r0, [r5, #4] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler str r0, [sp, #0x20] ldr r0, [r5, #4] bl ov12_0223B52C @@ -132,10 +132,10 @@ ov12_02265F34: ; 0x02265F34 push {r3, r4, r5, lr} add r4, r0, #0 ldr r0, [r4, #4] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer add r5, r0, #0 ldr r0, [r4, #4] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler add r1, r0, #0 add r0, r5, #0 ldrb r3, [r4, #8] @@ -171,7 +171,7 @@ ov12_02265F7C: ; 0x02265F7C push {r3, r4, r5, lr} add r5, r0, #0 ldr r0, [r5, #4] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler add r4, r0, #0 ldrb r0, [r5, #8] cmp r0, #0 diff --git a/asm/overlay_12_02266024.s b/asm/overlay_12_02266024.s index 33c6d251ca..4318e81bcf 100644 --- a/asm/overlay_12_02266024.s +++ b/asm/overlay_12_02266024.s @@ -335,10 +335,10 @@ ov12_02266390: ; 0x02266390 sub sp, #0x18 add r7, r0, #0 ldr r0, [r7] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer add r6, r0, #0 ldr r0, [r7] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler add r4, r0, #0 ldr r0, [r7] bl BattleSystem_GetBgConfig @@ -451,9 +451,9 @@ ov12_02266490: ; 0x02266490 push {r3, r4, r5, r6, r7, lr} add r7, r0, #0 ldr r0, [r7] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer ldr r0, [r7] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler ldr r6, _022664F0 ; =0x00004E39 add r5, r0, #0 mov r4, #0 @@ -523,10 +523,10 @@ _02266526: bl BattleSystem_GetBgConfig str r0, [sp, #0x28] ldr r0, [r7] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer str r0, [sp, #0x24] ldr r0, [r7] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler str r0, [sp, #0x20] ldr r0, _0226662C ; =0x0000068B ldrsb r2, [r7, r0] @@ -670,11 +670,11 @@ _02266660: _02266664: ldr r0, [sp, #0x14] ldr r0, [r0] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer str r0, [sp, #0x18] ldr r0, [sp, #0x14] ldr r0, [r0] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler add r7, r0, #0 mov r0, #1 str r0, [sp] @@ -865,9 +865,9 @@ _02266818: bl GF_AssertFail _0226681C: ldr r0, [r6] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer ldr r0, [r6] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler ldr r1, _022668B4 ; =0x00004E37 add r7, r0, #0 bl SpriteGfxHandler_UnloadCharObjById @@ -3970,10 +3970,10 @@ ov12_02268194: ; 0x02268194 sub sp, #0x18 add r5, r0, #0 ldr r0, [r5] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer add r4, r0, #0 ldr r0, [r5] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler add r6, r0, #0 ldr r0, [r5] bl BattleSystem_GetPaletteData @@ -4025,7 +4025,7 @@ _02268210: .word 0x00004E35 ov12_02268214: ; 0x02268214 push {r4, lr} ldr r0, [r0] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler ldr r1, _02268250 ; =0x00004E44 add r4, r0, #0 bl SpriteGfxHandler_UnloadCharObjById @@ -4162,10 +4162,10 @@ _0226831A: pop {r3, r4, r5, r6, r7, pc} _02268324: ldr r0, [r4] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer str r0, [sp, #0x18] ldr r0, [r4] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler str r0, [sp, #0x14] ldr r0, [sp, #0xc] bl Pokemon_GetIconNaix @@ -4305,10 +4305,10 @@ ov12_02268440: ; 0x02268440 bl GF_AssertFail _02268454: ldr r0, [r5] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer add r7, r0, #0 ldr r0, [r5] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler add r4, r0, #0 ldr r0, [sp, #0xc] bl Pokemon_GetIconNaix @@ -4452,7 +4452,7 @@ ov12_02268550: ; 0x02268550 bl GF_AssertFail _0226856A: ldr r0, [r7] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler str r0, [sp, #0x20] ldr r0, [r7] bl BattleSystem_GetBgConfig @@ -4534,7 +4534,7 @@ _02268602: str r0, [sp, #0x54] ldr r0, [sp, #0x20] ldr r1, [sp, #0x98] - bl sub_0200D934 + bl GfGfxHandler_GetPlttProxy str r0, [sp, #0x58] mov r0, #0 ldr r1, [sp, #0x34] @@ -5153,10 +5153,10 @@ ov12_02268AD0: ; 0x02268AD0 add r0, #0x1c str r0, [sp, #4] ldr r0, [r5] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer str r0, [sp, #0xc] ldr r0, [r5] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler ldr r1, _02268BA4 ; =0x0000068A str r0, [sp, #8] ldrb r1, [r5, r1] @@ -5260,9 +5260,9 @@ ov12_02268BB8: ; 0x02268BB8 push {r3, r4, r5, r6, r7, lr} add r5, r0, #0 ldr r0, [r5] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer ldr r0, [r5] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler mov r4, #0 ldr r7, _02268BE8 ; =0x00000608 add r6, r4, #0 @@ -5288,9 +5288,9 @@ ov12_02268BEC: ; 0x02268BEC push {r3, r4, r5, r6, r7, lr} add r5, r0, #0 ldr r0, [r5] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer ldr r0, [r5] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler mov r4, #0 add r6, r0, #0 add r7, r4, #0 @@ -9161,9 +9161,9 @@ ov12_0226A8F4: ; 0x0226A8F4 push {r4, lr} add r4, r0, #0 ldr r0, [r4] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer ldr r0, [r4] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler ldr r0, [r4] bl BattleSystem_GetPaletteData ldr r0, [r4] @@ -9606,10 +9606,10 @@ ov12_0226AC70: ; 0x0226AC70 bl GF_AssertFail _0226AC84: ldr r0, [r5] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer add r4, r0, #0 ldr r0, [r5] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler add r6, r0, #0 mov r0, #8 mov r1, #5 @@ -9711,7 +9711,7 @@ ov12_0226AD60: ; 0x0226AD60 cmp r0, #0 beq _0226ADB4 ldr r0, [r5] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler add r4, r0, #0 mov r0, #0x6f lsl r0, r0, #4 diff --git a/asm/overlay_12_battle_command.s b/asm/overlay_12_battle_command.s index 158c1d96ef..4799c4eb0a 100644 --- a/asm/overlay_12_battle_command.s +++ b/asm/overlay_12_battle_command.s @@ -323,7 +323,7 @@ _02246636: ldr r0, [r4, #0x2c] str r0, [sp, #0x140] ldr r0, [r4] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer str r0, [sp, #0x14c] ldr r0, [r4] bl BattleSystem_GetPaletteData @@ -3799,10 +3799,10 @@ ov12_02248228: ; 0x02248228 bl BattleSystem_GetBgConfig str r0, [sp, #0x1c] add r0, r7, #0 - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer add r6, r0, #0 add r0, r7, #0 - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler add r4, r0, #0 add r0, r7, #0 bl BattleSystem_GetPaletteData @@ -4025,7 +4025,7 @@ _022483C6: str r0, [sp, #0x34] ldr r1, _022484AC ; =0x00004E30 add r0, r4, #0 - bl sub_0200D934 + bl GfGfxHandler_GetPlttProxy mov r1, #0 str r0, [sp, #0x38] ldr r0, [sp, #0x60] @@ -4077,7 +4077,7 @@ _022484D0: .word 0x00010200 ov12_022484D4: ; 0x022484D4 push {r3, r4, r5, lr} add r5, r1, #0 - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler add r4, r0, #0 ldr r0, [r5, #0xc] bl UnkImageStruct_Delete diff --git a/asm/overlay_12_battle_controller_opponent.s b/asm/overlay_12_battle_controller_opponent.s index 1cfd578e4e..b87d777279 100644 --- a/asm/overlay_12_battle_controller_opponent.s +++ b/asm/overlay_12_battle_controller_opponent.s @@ -782,7 +782,7 @@ _02258DDC: str r0, [sp, #0xc] add r0, r5, #0 str r6, [sp, #0x10] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer str r0, [sp, #0x1c] add r0, r5, #0 bl BattleSystem_GetPaletteData @@ -1927,10 +1927,10 @@ ov12_02259658: ; 0x02259658 push {r3, r4, r5, r6, r7, lr} add r5, r0, #0 add r4, r1, #0 - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer add r6, r0, #0 add r0, r5, #0 - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler add r7, r0, #0 add r0, r5, #0 bl BattleSystem_GetPaletteData @@ -1955,7 +1955,7 @@ ov12_02259694: ; 0x02259694 push {r3, r4, r5, lr} add r5, r0, #0 add r4, r1, #0 - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler bl ov12_0226AE78 mov r1, #0x65 lsl r1, r1, #2 @@ -3678,7 +3678,7 @@ ov12_0225A414: ; 0x0225A414 add r1, r0, #0 ldr r0, _0225A4D4 ; =0x00000195 ldrb r0, [r6, r0] - bl ov12_02265B64 + bl BattleHpBar_Util_GetBarTypeFromBattlerSide add r1, r4, #0 add r1, #0x25 strb r0, [r1] @@ -4445,7 +4445,7 @@ _0225A9F2: add r1, r0, #0 ldr r0, _0225AA60 ; =0x00000195 ldrb r0, [r6, r0] - bl ov12_02265B64 + bl BattleHpBar_Util_GetBarTypeFromBattlerSide add r1, r4, #0 add r1, #0x25 strb r0, [r1] @@ -5147,7 +5147,7 @@ ov12_0225AF74: ; 0x0225AF74 add r1, r0, #0 ldr r0, _0225B024 ; =0x00000195 ldrb r0, [r6, r0] - bl ov12_02265B64 + bl BattleHpBar_Util_GetBarTypeFromBattlerSide add r1, r4, #0 add r1, #0x25 strb r0, [r1] @@ -7440,7 +7440,7 @@ _0225C1CC: ldrh r0, [r0] str r0, [sp, #0x68] ldr r0, [r4] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer str r0, [sp, #0x74] ldr r0, [r4] bl BattleSystem_GetPaletteData @@ -8544,7 +8544,7 @@ _0225CABE: ldrh r0, [r0] str r0, [sp, #0x60] ldr r0, [r4] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer str r0, [sp, #0x6c] ldr r0, [r4] bl BattleSystem_GetPaletteData @@ -8581,7 +8581,7 @@ _0225CB06: ldrh r0, [r0] str r0, [sp, #0x38] ldr r0, [r4] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer str r0, [sp, #0x44] ldr r0, [r4] bl BattleSystem_GetPaletteData @@ -9434,7 +9434,7 @@ _0225D1CA: ldrb r0, [r4, #9] str r0, [sp, #0x14] ldr r0, [r4] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer str r0, [sp, #0x24] ldr r0, [r4] bl BattleSystem_GetPaletteData @@ -9555,7 +9555,7 @@ _0225D2E4: b _0225D62E _0225D2E6: ldr r0, [r4] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler add r5, r0, #0 ldr r0, [r4, #4] ldr r0, [r0, #0x18] @@ -9755,7 +9755,7 @@ _0225D48E: b _0225D62E _0225D49C: ldr r0, [r4] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler add r5, r0, #0 ldr r0, [r4, #4] ldr r0, [r0, #0x18] @@ -9987,7 +9987,7 @@ _0225D664: b _0225D870 _0225D694: ldr r0, [r5] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler add r4, r0, #0 ldr r0, [r5, #4] ldr r0, [r0, #0x18] @@ -10150,7 +10150,7 @@ _0225D7F2: cmp r1, r0 bgt _0225D870 ldr r0, [r5] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler add r4, r0, #0 ldr r0, [r5, #4] ldr r0, [r0, #0x18] @@ -10275,7 +10275,7 @@ _0225D8DE: pop {r3, r4, r5, r6, pc} _0225D90E: ldr r0, [r5] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler add r4, r0, #0 ldr r0, [r5, #4] ldr r0, [r0, #0x18] @@ -13192,7 +13192,7 @@ _0225F070: bl BattleSystem_GetBattleType add r1, r0, #0 ldr r0, [sp, #0x18] - bl ov12_02265B64 + bl BattleHpBar_Util_GetBarTypeFromBattlerSide add r1, r5, #0 add r1, #0x25 strb r0, [r1] @@ -15802,7 +15802,7 @@ ov12_02260584: ; 0x02260584 _02260596: ldr r0, [r4, #4] add r1, #0xb - bl ov12_02265C54 + bl BattleHpBar_BeginExpBarFullFlashEffect ldr r0, _022605CC ; =0x0000070C bl PlaySE ldrb r0, [r4, #0xa] @@ -16581,10 +16581,10 @@ _02260BEC: ldr r7, [sp, #8] _02260BEE: ldr r0, [r5] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer add r4, r0, #0 ldr r0, [r5] - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler str r4, [sp] str r0, [sp, #4] add r0, r5, #0 @@ -18560,10 +18560,10 @@ ov12_02261B2C: ; 0x02261B2C add r4, r1, #0 add r6, r2, #0 add r7, r3, #0 - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer str r0, [sp, #0x1c] add r0, r5, #0 - bl ov12_0223A8EC + bl BattleSystem_GetGfxHandler str r0, [sp, #0x18] add r0, r5, #0 bl BattleSystem_GetPaletteData @@ -18627,7 +18627,7 @@ _02261BA8: bl BattleSystem_GetPaletteData str r0, [sp, #0x24] ldr r0, [sp] - bl ov12_0223A8E4 + bl BattleSystem_GetSpriteRenderer add r5, sp, #0x1c str r0, [sp, #0x1c] ldr r0, [sp, #0xc] diff --git a/asm/overlay_12_hp_bar.s b/asm/overlay_12_hp_bar.s deleted file mode 100644 index 407e5c9cac..0000000000 --- a/asm/overlay_12_hp_bar.s +++ /dev/null @@ -1,3212 +0,0 @@ - .include "asm/macros.inc" - .include "overlay_12_02264824.inc" - .include "global.inc" - - .text - - thumb_func_start ov12_02264824 -ov12_02264824: ; 0x02264824 - push {r4, r5, r6, r7, lr} - sub sp, #0x1c - add r5, r0, #0 - ldr r0, [sp, #0x30] - add r6, r1, #0 - lsl r0, r0, #0x18 - lsr r0, r0, #0x18 - add r4, r2, #0 - str r3, [sp, #0x18] - bl ov12_02265BB8 - add r7, r0, #0 - ldr r3, [r7, #0x14] - mov r0, #1 - str r0, [sp] - str r0, [sp, #4] - str r3, [sp, #8] - add r0, r5, #0 - add r1, r6, #0 - add r2, r4, #0 - bl SpriteRenderer_LoadCharResObjFromOpenNarc - str r4, [sp] - mov r0, #0x47 - str r0, [sp, #4] - mov r0, #0 - str r0, [sp, #8] - mov r0, #1 - str r0, [sp, #0xc] - str r0, [sp, #0x10] - ldr r0, _022648E0 ; =0x00004E26 - mov r1, #2 - str r0, [sp, #0x14] - ldr r0, [sp, #0x18] - add r2, r5, #0 - add r3, r6, #0 - bl sub_0200D68C - ldr r3, [r7, #0x1c] - mov r0, #1 - str r0, [sp] - str r3, [sp, #4] - add r0, r5, #0 - add r1, r6, #0 - add r2, r4, #0 - bl SpriteRenderer_LoadCellResObjFromOpenNarc - ldr r3, [r7, #0x20] - mov r0, #1 - str r0, [sp] - str r3, [sp, #4] - add r0, r5, #0 - add r1, r6, #0 - add r2, r4, #0 - bl SpriteRenderer_LoadAnimResObjFromOpenNarc - str r4, [sp] - mov r0, #0x47 - str r0, [sp, #4] - mov r0, #0 - str r0, [sp, #8] - mov r0, #1 - str r0, [sp, #0xc] - str r0, [sp, #0x10] - ldr r0, _022648E4 ; =0x00004E27 - mov r1, #2 - str r0, [sp, #0x14] - ldr r0, [sp, #0x18] - add r2, r5, #0 - add r3, r6, #0 - bl sub_0200D68C - ldr r0, [sp, #0x30] - sub r0, r0, #6 - cmp r0, #1 - bhi _022648DC - str r4, [sp] - mov r0, #0x51 - str r0, [sp, #4] - mov r0, #0 - str r0, [sp, #8] - mov r0, #1 - str r0, [sp, #0xc] - str r0, [sp, #0x10] - ldr r0, _022648E8 ; =0x00004E28 - mov r1, #2 - str r0, [sp, #0x14] - ldr r0, [sp, #0x18] - add r2, r5, #0 - add r3, r6, #0 - bl sub_0200D68C -_022648DC: - add sp, #0x1c - pop {r4, r5, r6, r7, pc} - .balign 4, 0 -_022648E0: .word 0x00004E26 -_022648E4: .word 0x00004E27 -_022648E8: .word 0x00004E28 - thumb_func_end ov12_02264824 - - thumb_func_start ov12_022648EC -ov12_022648EC: ; 0x022648EC - push {r4, r5, r6, r7, lr} - sub sp, #0x1c - add r6, r0, #0 - ldr r0, [sp, #0x30] - add r7, r1, #0 - lsl r0, r0, #0x18 - lsr r0, r0, #0x18 - add r5, r2, #0 - str r3, [sp, #0x18] - bl ov12_02265C1C - add r4, r0, #0 - beq _0226495E - ldr r3, [r4, #0x14] - mov r0, #1 - str r0, [sp] - str r0, [sp, #4] - str r3, [sp, #8] - add r0, r6, #0 - add r1, r7, #0 - add r2, r5, #0 - bl SpriteRenderer_LoadCharResObjFromOpenNarc - str r5, [sp] - mov r0, #0x47 - str r0, [sp, #4] - mov r0, #0 - str r0, [sp, #8] - mov r0, #1 - str r0, [sp, #0xc] - str r0, [sp, #0x10] - ldr r0, _02264964 ; =0x00004E26 - mov r1, #2 - str r0, [sp, #0x14] - ldr r0, [sp, #0x18] - add r2, r6, #0 - add r3, r7, #0 - bl sub_0200D68C - ldr r3, [r4, #0x1c] - mov r0, #1 - str r0, [sp] - str r3, [sp, #4] - add r0, r6, #0 - add r1, r7, #0 - add r2, r5, #0 - bl SpriteRenderer_LoadCellResObjFromOpenNarc - ldr r3, [r4, #0x20] - mov r0, #1 - str r0, [sp] - add r0, r6, #0 - add r1, r7, #0 - add r2, r5, #0 - str r3, [sp, #4] - bl SpriteRenderer_LoadAnimResObjFromOpenNarc -_0226495E: - add sp, #0x1c - pop {r4, r5, r6, r7, pc} - nop -_02264964: .word 0x00004E26 - thumb_func_end ov12_022648EC - - thumb_func_start ov12_02264968 -ov12_02264968: ; 0x02264968 - push {r3, r4, r5, lr} - add r5, r0, #0 - lsl r0, r2, #0x18 - add r4, r1, #0 - lsr r0, r0, #0x18 - bl ov12_02265BB8 - add r2, r0, #0 - add r0, r5, #0 - add r1, r4, #0 - bl SpriteRenderer_LoadResourcesAndCreateSprite - add r4, r0, #0 - ldr r0, [r4] - bl TickSpriteAnimation1Frame - add r0, r4, #0 - pop {r3, r4, r5, pc} - thumb_func_end ov12_02264968 - - thumb_func_start ov12_0226498C -ov12_0226498C: ; 0x0226498C - push {r4, r5, r6, lr} - add r5, r0, #0 - ldr r0, [r5, #4] - add r6, r1, #0 - add r4, r2, #0 - cmp r0, #0 - bne _0226499E - bl GF_AssertFail -_0226499E: - add r0, r5, #0 - add r0, #0x25 - ldrb r0, [r0] - cmp r0, #6 - bne _022649B0 - mov r1, #3 - lsl r1, r1, #0xa - and r4, r1 - b _022649C0 -_022649B0: - cmp r0, #7 - bne _022649BC - mov r1, #3 - lsl r1, r1, #0xc - and r4, r1 - b _022649C0 -_022649BC: - ldr r1, _02264B1C ; =0xFFFFC3FF - and r4, r1 -_022649C0: - cmp r0, #7 - bhi _02264A06 - add r0, r0, r0 - add r0, pc - ldrh r0, [r0, #6] - lsl r0, r0, #0x10 - asr r0, r0, #0x10 - add pc, r0 -_022649D0: ; jump table - .short _02264A02 - _022649D0 - 2 ; case 0 - .short _022649E0 - _022649D0 - 2 ; case 1 - .short _022649E6 - _022649D0 - 2 ; case 2 - .short _022649E0 - _022649D0 - 2 ; case 3 - .short _022649E6 - _022649D0 - 2 ; case 4 - .short _022649E0 - _022649D0 - 2 ; case 5 - .short _02264A06 - _022649D0 - 2 ; case 6 - .short _02264A06 - _022649D0 - 2 ; case 7 -_022649E0: - mov r0, #0x26 - bic r4, r0 - b _02264A06 -_022649E6: - ldr r0, _02264B20 ; =0xFFFFFDDF - and r4, r0 - add r0, r5, #0 - add r0, #0x4f - ldrb r0, [r0] - lsl r0, r0, #0x1c - lsr r0, r0, #0x1f - bne _022649FC - mov r0, #6 - bic r4, r0 - b _02264A06 -_022649FC: - mov r0, #1 - bic r4, r0 - b _02264A06 -_02264A02: - ldr r0, _02264B24 ; =0xFFFFFDFF - and r4, r0 -_02264A06: - ldr r0, [r5, #0xc] - bl BattleSystem_GetBattleType - mov r1, #1 - tst r0, r1 - beq _02264A16 - ldr r0, _02264B24 ; =0xFFFFFDFF - and r4, r0 -_02264A16: - mov r0, #1 - tst r0, r4 - beq _02264A2C - add r0, r5, #0 - mov r1, #0 - bl ov12_02264DCC - add r0, r5, #0 - mov r1, #0 - bl ov12_022657E4 -_02264A2C: - mov r0, #2 - tst r0, r4 - beq _02264A3A - add r0, r5, #0 - add r1, r6, #0 - bl ov12_02265474 -_02264A3A: - mov r0, #4 - tst r0, r4 - beq _02264A46 - add r0, r5, #0 - bl ov12_02265500 -_02264A46: - mov r0, #0x80 - tst r0, r4 - bne _02264A52 - mov r0, #0x40 - tst r0, r4 - beq _02264A58 -_02264A52: - add r0, r5, #0 - bl ov12_022652D0 -_02264A58: - mov r0, #8 - tst r0, r4 - beq _02264A64 - add r0, r5, #0 - bl ov12_02265354 -_02264A64: - mov r0, #0x10 - tst r0, r4 - beq _02264A70 - add r0, r5, #0 - bl ov12_0226516C -_02264A70: - mov r0, #0x20 - tst r0, r4 - beq _02264A86 - add r0, r5, #0 - mov r1, #0 - bl ov12_02264E34 - add r0, r5, #0 - mov r1, #1 - bl ov12_022657E4 -_02264A86: - mov r0, #2 - lsl r0, r0, #8 - tst r0, r4 - beq _02264A94 - add r0, r5, #0 - bl ov12_02265560 -_02264A94: - mov r0, #1 - lsl r0, r0, #8 - tst r0, r4 - beq _02264AF8 - add r0, r5, #0 - add r0, #0x4a - ldrb r0, [r0] - cmp r0, #5 - bhi _02264ABE - add r0, r0, r0 - add r0, pc - ldrh r0, [r0, #6] - lsl r0, r0, #0x10 - asr r0, r0, #0x10 - add pc, r0 -_02264AB2: ; jump table - .short _02264ABE - _02264AB2 - 2 ; case 0 - .short _02264AC8 - _02264AB2 - 2 ; case 1 - .short _02264AD2 - _02264AB2 - 2 ; case 2 - .short _02264ADC - _02264AB2 - 2 ; case 3 - .short _02264AE6 - _02264AB2 - 2 ; case 4 - .short _02264AF0 - _02264AB2 - 2 ; case 5 -_02264ABE: - add r0, r5, #0 - mov r1, #0x26 - bl ov12_022655B0 - b _02264AF8 -_02264AC8: - add r0, r5, #0 - mov r1, #0x2f - bl ov12_022655B0 - b _02264AF8 -_02264AD2: - add r0, r5, #0 - mov r1, #0x32 - bl ov12_022655B0 - b _02264AF8 -_02264ADC: - add r0, r5, #0 - mov r1, #0x35 - bl ov12_022655B0 - b _02264AF8 -_02264AE6: - add r0, r5, #0 - mov r1, #0x2c - bl ov12_022655B0 - b _02264AF8 -_02264AF0: - add r0, r5, #0 - mov r1, #0x29 - bl ov12_022655B0 -_02264AF8: - mov r0, #5 - lsl r0, r0, #0xa - tst r0, r4 - beq _02264B08 - add r0, r5, #0 - add r1, r4, #0 - bl ov12_022655F0 -_02264B08: - mov r0, #0xa - lsl r0, r0, #0xa - tst r0, r4 - beq _02264B18 - add r0, r5, #0 - add r1, r4, #0 - bl ov12_022656CC -_02264B18: - pop {r4, r5, r6, pc} - nop -_02264B1C: .word 0xFFFFC3FF -_02264B20: .word 0xFFFFFDDF -_02264B24: .word 0xFFFFFDFF - thumb_func_end ov12_0226498C - - thumb_func_start ov12_02264B28 -ov12_02264B28: ; 0x02264B28 - push {r4, lr} - add r4, r0, #0 - ldr r0, [r4, #0x50] - cmp r0, #0 - beq _02264B3A - bl SysTask_Destroy - mov r0, #0 - str r0, [r4, #0x50] -_02264B3A: - ldr r0, [r4, #4] - cmp r0, #0 - beq _02264B48 - bl UnkImageStruct_Delete - mov r0, #0 - str r0, [r4, #4] -_02264B48: - pop {r4, pc} - .balign 4, 0 - thumb_func_end ov12_02264B28 - - thumb_func_start ov12_02264B4C -ov12_02264B4C: ; 0x02264B4C - push {r4, lr} - add r4, r0, #0 - ldr r0, [r4, #8] - cmp r0, #0 - beq _02264B5E - bl UnkImageStruct_Delete - mov r0, #0 - str r0, [r4, #8] -_02264B5E: - pop {r4, pc} - thumb_func_end ov12_02264B4C - - thumb_func_start ov12_02264B60 -ov12_02264B60: ; 0x02264B60 - push {r3, r4, r5, lr} - add r5, r0, #0 - add r0, #0x25 - ldrb r0, [r0] - bl ov12_02265BB8 - add r4, r0, #0 - ldr r0, [r5, #0xc] - bl ov12_0223A8E4 - ldr r0, [r5, #0xc] - bl ov12_0223A8EC - ldr r1, [r4, #0x14] - add r5, r0, #0 - bl SpriteGfxHandler_UnloadCharObjById - ldr r1, [r4, #0x1c] - add r0, r5, #0 - bl SpriteGfxHandler_UnloadCellObjById - ldr r1, [r4, #0x20] - add r0, r5, #0 - bl SpriteGfxHandler_UnloadAnimObjById - pop {r3, r4, r5, pc} - thumb_func_end ov12_02264B60 - - thumb_func_start ov12_02264B94 -ov12_02264B94: ; 0x02264B94 - push {r3, r4, r5, lr} - add r5, r0, #0 - add r0, #0x25 - ldrb r0, [r0] - bl ov12_02265C1C - add r4, r0, #0 - beq _02264BC8 - ldr r0, [r5, #0xc] - bl ov12_0223A8E4 - ldr r0, [r5, #0xc] - bl ov12_0223A8EC - ldr r1, [r4, #0x14] - add r5, r0, #0 - bl SpriteGfxHandler_UnloadCharObjById - ldr r1, [r4, #0x1c] - add r0, r5, #0 - bl SpriteGfxHandler_UnloadCellObjById - ldr r1, [r4, #0x20] - add r0, r5, #0 - bl SpriteGfxHandler_UnloadAnimObjById -_02264BC8: - pop {r3, r4, r5, pc} - .balign 4, 0 - thumb_func_end ov12_02264B94 - - thumb_func_start BattleHpBar_LoadResources -BattleHpBar_LoadResources: ; 0x02264BCC - push {r4, r5, r6, r7, lr} - sub sp, #0xc - add r5, r0, #0 - mov r0, #8 - mov r1, #5 - bl NARC_New - add r6, r0, #0 - ldr r0, [r5, #0xc] - bl ov12_0223A8E4 - add r7, r0, #0 - ldr r0, [r5, #0xc] - bl ov12_0223A8EC - str r0, [sp, #4] - ldr r0, [r5, #0xc] - bl BattleSystem_GetPaletteData - str r0, [sp, #8] - add r0, r5, #0 - add r0, #0x25 - ldrb r0, [r0] - bl ov12_02265BB8 - add r4, r0, #0 - add r0, r5, #0 - add r0, #0x25 - ldrb r0, [r0] - ldr r1, [sp, #4] - ldr r3, [sp, #8] - str r0, [sp] - add r0, r7, #0 - add r2, r6, #0 - bl ov12_02264824 - add r2, r5, #0 - add r2, #0x25 - ldrb r2, [r2] - ldr r1, [sp, #4] - add r0, r7, #0 - bl ov12_02264968 - str r0, [r5, #4] - add r0, r5, #0 - add r0, #0x25 - ldrb r0, [r0] - ldr r1, [sp, #4] - ldr r3, [sp, #8] - str r0, [sp] - add r0, r7, #0 - add r2, r6, #0 - bl ov12_022648EC - ldr r0, [r5, #8] - cmp r0, #0 - beq _02264C5A - add r5, #0x25 - ldrb r3, [r5] - ldr r2, _02264C64 ; =ov12_0226D368 - mov r1, #0 - ldrsh r1, [r4, r1] - ldrsb r2, [r2, r3] - ldr r0, [r0] - sub r1, r1, r2 - mov r2, #2 - lsl r1, r1, #0x10 - ldrsh r2, [r4, r2] - asr r1, r1, #0x10 - bl Sprite_SetPositionXY -_02264C5A: - add r0, r6, #0 - bl NARC_Delete - add sp, #0xc - pop {r4, r5, r6, r7, pc} - .balign 4, 0 -_02264C64: .word ov12_0226D368 - thumb_func_end BattleHpBar_LoadResources - - thumb_func_start BattleHpBar_FreeResources -BattleHpBar_FreeResources: ; 0x02264C68 - push {r4, lr} - add r4, r0, #0 - bl ov12_02264B28 - add r0, r4, #0 - bl ov12_02264B60 - add r0, r4, #0 - bl ov12_02264B4C - add r0, r4, #0 - bl ov12_02264B94 - pop {r4, pc} - thumb_func_end BattleHpBar_FreeResources - - thumb_func_start ov12_02264C84 -ov12_02264C84: ; 0x02264C84 - push {r4, r5, r6, lr} - add r5, r0, #0 - add r0, #0x25 - ldrb r0, [r0] - cmp r0, #2 - beq _02264C96 - cmp r0, #4 - beq _02264C96 - b _02264DB0 -_02264C96: - add r0, r5, #0 - add r0, #0x4f - ldrb r2, [r0] - mov r1, #8 - add r0, r2, #0 - bic r0, r1 - lsl r1, r2, #0x1c - lsr r2, r1, #0x1f - mov r1, #1 - eor r1, r2 - lsl r1, r1, #0x18 - lsr r1, r1, #0x18 - lsl r1, r1, #0x1f - lsr r1, r1, #0x1c - orr r1, r0 - add r0, r5, #0 - add r0, #0x4f - strb r1, [r0] - ldr r0, [r5, #4] - ldr r0, [r0] - bl Sprite_GetImageProxy - add r4, r0, #0 - add r0, r5, #0 - add r0, #0x4f - ldrb r0, [r0] - lsl r0, r0, #0x1c - lsr r0, r0, #0x1f - cmp r0, #1 - bne _02264D42 - mov r0, #0x46 - bl ov12_02265B58 - add r2, r5, #0 - add r2, #0x25 - ldrb r2, [r2] - mov r6, #0x19 - lsl r6, r6, #0x16 - lsl r3, r2, #2 - ldr r2, _02264DB4 ; =ov12_0226D3A8 - ldr r1, [r4, #4] - ldrh r2, [r2, r3] - add r2, r6, r2 - add r2, #0x20 - add r1, r1, r2 - mov r2, #0x20 - bl MIi_CpuCopy16 - mov r0, #0x47 - bl ov12_02265B58 - add r2, r5, #0 - add r2, #0x25 - ldrb r2, [r2] - ldr r1, [r4, #4] - lsl r3, r2, #2 - ldr r2, _02264DB8 ; =ov12_0226D3D8 - ldrh r2, [r2, r3] - add r2, r6, r2 - add r2, #0x20 - add r1, r1, r2 - mov r2, #0x20 - bl MIi_CpuCopy16 - mov r0, #0x45 - bl ov12_02265B58 - add r1, r5, #0 - add r1, #0x25 - ldrb r1, [r1] - ldr r3, _02264DBC ; =ov12_0226D408 - lsl r2, r1, #2 - ldrh r3, [r3, r2] - ldr r1, [r4, #4] - add r3, r6, r3 - add r1, r1, r3 - ldr r3, _02264DC0 ; =ov12_0226D40A - ldrh r2, [r3, r2] - bl MIi_CpuCopy16 - ldr r1, [r5, #0x28] - add r0, r5, #0 - mov r2, #6 - bl ov12_0226498C - pop {r4, r5, r6, pc} -_02264D42: - mov r0, #0x42 - bl ov12_02265B58 - add r1, r5, #0 - add r1, #0x25 - ldrb r1, [r1] - mov r6, #0x19 - ldr r3, _02264DB4 ; =ov12_0226D3A8 - lsl r2, r1, #2 - ldrh r3, [r3, r2] - lsl r6, r6, #0x16 - ldr r1, [r4, #4] - add r3, r6, r3 - add r1, r1, r3 - ldr r3, _02264DC4 ; =ov12_0226D3AA - ldrh r2, [r3, r2] - bl MIi_CpuCopy16 - mov r0, #0x44 - bl ov12_02265B58 - add r1, r5, #0 - add r1, #0x25 - ldrb r1, [r1] - ldr r3, _02264DB8 ; =ov12_0226D3D8 - lsl r2, r1, #2 - ldrh r3, [r3, r2] - ldr r1, [r4, #4] - add r3, r6, r3 - add r1, r1, r3 - ldr r3, _02264DC8 ; =ov12_0226D3DA - ldrh r2, [r3, r2] - bl MIi_CpuCopy16 - mov r0, #0x26 - bl ov12_02265B58 - add r2, r5, #0 - add r2, #0x25 - ldrb r2, [r2] - ldr r1, [r4, #4] - lsl r3, r2, #2 - ldr r2, _02264DB8 ; =ov12_0226D3D8 - ldrh r2, [r2, r3] - add r2, r6, r2 - add r2, #0x20 - add r1, r1, r2 - mov r2, #0x20 - bl MIi_CpuCopy16 - ldr r1, [r5, #0x28] - add r0, r5, #0 - mov r2, #1 - bl ov12_0226498C -_02264DB0: - pop {r4, r5, r6, pc} - nop -_02264DB4: .word ov12_0226D3A8 -_02264DB8: .word ov12_0226D3D8 -_02264DBC: .word ov12_0226D408 -_02264DC0: .word ov12_0226D40A -_02264DC4: .word ov12_0226D3AA -_02264DC8: .word ov12_0226D3DA - thumb_func_end ov12_02264C84 - - thumb_func_start ov12_02264DCC -ov12_02264DCC: ; 0x02264DCC - mov r2, #2 - lsl r2, r2, #0x1e - str r2, [r0, #0x34] - ldr r3, [r0, #0x28] - add r2, r3, r1 - bpl _02264DDA - sub r1, r1, r2 -_02264DDA: - ldr r2, [r0, #0x2c] - add r3, r3, r1 - cmp r3, r2 - ble _02264DE6 - sub r2, r3, r2 - sub r1, r1, r2 -_02264DE6: - neg r1, r1 - str r1, [r0, #0x30] - ldr r1, [r0, #0x28] - cmp r1, #0 - bge _02264DF4 - mov r1, #0 - str r1, [r0, #0x28] -_02264DF4: - ldr r2, [r0, #0x2c] - ldr r1, [r0, #0x28] - cmp r1, r2 - ble _02264DFE - str r2, [r0, #0x28] -_02264DFE: - bx lr - thumb_func_end ov12_02264DCC - - thumb_func_start ov12_02264E00 -ov12_02264E00: ; 0x02264E00 - push {r3, r4, r5, lr} - mov r1, #0 - add r5, r0, #0 - bl ov12_022657E4 - add r4, r0, #0 - mov r0, #0 - mvn r0, r0 - cmp r4, r0 - bne _02264E26 - ldr r1, [r5, #0x28] - ldr r0, [r5, #0x30] - mov r2, #2 - sub r1, r1, r0 - add r0, r5, #0 - str r1, [r5, #0x28] - bl ov12_0226498C - b _02264E30 -_02264E26: - add r0, r5, #0 - add r1, r4, #0 - mov r2, #2 - bl ov12_0226498C -_02264E30: - add r0, r4, #0 - pop {r3, r4, r5, pc} - thumb_func_end ov12_02264E00 - - thumb_func_start ov12_02264E34 -ov12_02264E34: ; 0x02264E34 - mov r2, #2 - lsl r2, r2, #0x1e - str r2, [r0, #0x44] - ldr r3, [r0, #0x38] - add r2, r3, r1 - bpl _02264E42 - sub r1, r1, r2 -_02264E42: - ldr r2, [r0, #0x3c] - add r3, r3, r1 - cmp r3, r2 - ble _02264E4E - sub r2, r3, r2 - sub r1, r1, r2 -_02264E4E: - neg r1, r1 - str r1, [r0, #0x40] - ldr r1, [r0, #0x38] - cmp r1, #0 - bge _02264E5C - mov r1, #0 - str r1, [r0, #0x38] -_02264E5C: - ldr r2, [r0, #0x3c] - ldr r1, [r0, #0x38] - cmp r1, r2 - ble _02264E66 - str r2, [r0, #0x38] -_02264E66: - bx lr - thumb_func_end ov12_02264E34 - - thumb_func_start ov12_02264E68 -ov12_02264E68: ; 0x02264E68 - push {r4, lr} - mov r1, #1 - add r4, r0, #0 - bl ov12_022657E4 - mov r1, #0 - mvn r1, r1 - cmp r0, r1 - bne _02264E82 - ldr r2, [r4, #0x38] - ldr r1, [r4, #0x40] - sub r1, r2, r1 - str r1, [r4, #0x38] -_02264E82: - pop {r4, pc} - thumb_func_end ov12_02264E68 - - thumb_func_start ov12_02264E84 -ov12_02264E84: ; 0x02264E84 - push {r4, lr} - add r4, r0, #0 - ldr r0, [r4, #8] - cmp r0, #0 - beq _02264E9E - ldr r0, [r0] - mov r1, #1 - bl Sprite_SetAnimActiveFlag - add r0, r4, #0 - mov r1, #1 - bl ov12_02264F00 -_02264E9E: - ldr r0, [r4, #0xc] - bl BattleSystem_GetBattleType - mov r1, #0x22 - lsl r1, r1, #4 - tst r0, r1 - bne _02264EB2 - add r0, r4, #0 - bl ov12_02265D78 -_02264EB2: - pop {r4, pc} - thumb_func_end ov12_02264E84 - - thumb_func_start ov12_02264EB4 -ov12_02264EB4: ; 0x02264EB4 - push {r4, lr} - add r4, r0, #0 - ldr r0, [r4, #8] - cmp r0, #0 - beq _02264ED8 - ldr r0, [r0] - mov r1, #0 - bl Sprite_SetAnimActiveFlag - ldr r0, [r4, #8] - mov r1, #0 - ldr r0, [r0] - bl Sprite_SetAnimCtrlCurrentFrame - add r0, r4, #0 - mov r1, #0 - bl ov12_02264F00 -_02264ED8: - add r0, r4, #0 - bl ov12_02265DA0 - pop {r4, pc} - thumb_func_end ov12_02264EB4 - - thumb_func_start ov12_02264EE0 -ov12_02264EE0: ; 0x02264EE0 - push {r3, r4, r5, lr} - add r5, r0, #0 - ldr r0, [r5, #4] - add r4, r1, #0 - cmp r0, #0 - beq _02264EFC - bl UnkImageStruct_SetSpritePriority - ldr r0, [r5, #8] - cmp r0, #0 - beq _02264EFC - add r1, r4, #0 - bl UnkImageStruct_SetSpritePriority -_02264EFC: - pop {r3, r4, r5, pc} - .balign 4, 0 - thumb_func_end ov12_02264EE0 - - thumb_func_start ov12_02264F00 -ov12_02264F00: ; 0x02264F00 - push {r3, r4, r5, lr} - add r5, r0, #0 - ldr r0, [r5, #8] - add r4, r1, #0 - cmp r0, #0 - beq _02264F26 - ldr r0, [r5, #0xc] - bl BattleSystem_GetBattleType - mov r1, #0x22 - lsl r1, r1, #4 - tst r0, r1 - beq _02264F1E - cmp r4, #1 - beq _02264F26 -_02264F1E: - ldr r0, [r5, #8] - add r1, r4, #0 - bl UnkImageStruct_SetSpriteVisibleFlag -_02264F26: - pop {r3, r4, r5, pc} - thumb_func_end ov12_02264F00 - - thumb_func_start BattleHpBar_SetEnabled -BattleHpBar_SetEnabled: ; 0x02264F28 - push {r3, r4, r5, lr} - add r5, r0, #0 - ldr r0, [r5, #4] - add r4, r1, #0 - cmp r0, #0 - beq _02264F40 - bl UnkImageStruct_SetSpriteVisibleFlag - add r0, r5, #0 - add r1, r4, #0 - bl ov12_02264F00 -_02264F40: - pop {r3, r4, r5, pc} - .balign 4, 0 - thumb_func_end BattleHpBar_SetEnabled - - thumb_func_start ov12_02264F44 -ov12_02264F44: ; 0x02264F44 - push {r3, r4, r5, r6, r7, lr} - add r5, r0, #0 - ldr r0, [r5, #4] - add r6, r1, #0 - add r7, r2, #0 - cmp r0, #0 - bne _02264F56 - bl GF_AssertFail -_02264F56: - add r0, r5, #0 - add r0, #0x25 - ldrb r0, [r0] - bl ov12_02265BB8 - add r4, r0, #0 - mov r1, #0 - mov r2, #2 - ldrsh r1, [r4, r1] - ldrsh r2, [r4, r2] - ldr r0, [r5, #4] - add r1, r1, r6 - add r2, r2, r7 - lsl r1, r1, #0x10 - lsl r2, r2, #0x10 - ldr r0, [r0] - asr r1, r1, #0x10 - asr r2, r2, #0x10 - bl Sprite_SetPositionXY - ldr r0, [r5, #8] - cmp r0, #0 - beq _02264FA8 - add r5, #0x25 - ldrb r3, [r5] - mov r1, #0 - ldr r2, _02264FAC ; =ov12_0226D368 - ldrsh r1, [r4, r1] - ldrsb r2, [r2, r3] - ldr r0, [r0] - add r1, r1, r6 - sub r1, r1, r2 - mov r2, #2 - ldrsh r2, [r4, r2] - lsl r1, r1, #0x10 - asr r1, r1, #0x10 - add r2, r2, r7 - lsl r2, r2, #0x10 - asr r2, r2, #0x10 - bl Sprite_SetPositionXY -_02264FA8: - pop {r3, r4, r5, r6, r7, pc} - nop -_02264FAC: .word ov12_0226D368 - thumb_func_end ov12_02264F44 - - thumb_func_start ov12_02264FB0 -ov12_02264FB0: ; 0x02264FB0 - push {r3, r4, r5, lr} - add r4, r0, #0 - add r5, r1, #0 - cmp r4, #0 - bne _02264FBE - bl GF_AssertFail -_02264FBE: - ldr r0, [r4, #4] - cmp r0, #0 - bne _02264FC8 - bl GF_AssertFail -_02264FC8: - add r0, r4, #0 - add r0, #0x4f - ldrb r1, [r0] - mov r0, #2 - bic r1, r0 - add r0, r4, #0 - add r0, #0x4f - strb r1, [r0] - add r0, r4, #0 - add r0, #0x4f - ldrb r0, [r0] - mov r1, #1 - bic r0, r1 - lsl r1, r5, #0x18 - lsr r2, r1, #0x18 - mov r1, #1 - and r1, r2 - orr r1, r0 - add r0, r4, #0 - add r0, #0x4f - strb r1, [r0] - cmp r5, #0 - bne _02265036 - add r0, r4, #0 - add r0, #0x25 - ldrb r0, [r0] - cmp r0, #7 - bhi _02265028 - add r0, r0, r0 - add r0, pc - ldrh r0, [r0, #6] - lsl r0, r0, #0x10 - asr r0, r0, #0x10 - add pc, r0 -_0226500C: ; jump table - .short _0226501C - _0226500C - 2 ; case 0 - .short _02265028 - _0226500C - 2 ; case 1 - .short _0226501C - _0226500C - 2 ; case 2 - .short _02265028 - _0226500C - 2 ; case 3 - .short _0226501C - _0226500C - 2 ; case 4 - .short _02265028 - _0226500C - 2 ; case 5 - .short _0226501C - _0226500C - 2 ; case 6 - .short _0226501C - _0226500C - 2 ; case 7 -_0226501C: - add r0, r4, #0 - mov r1, #0xa0 - mov r2, #0 - bl ov12_02264F44 - b _02265040 -_02265028: - mov r1, #0x9f - add r0, r4, #0 - mvn r1, r1 - mov r2, #0 - bl ov12_02264F44 - b _02265040 -_02265036: - mov r1, #0 - add r0, r4, #0 - add r2, r1, #0 - bl ov12_02264F44 -_02265040: - ldr r0, _0226504C ; =ov12_02265054 - ldr r2, _02265050 ; =0x000003DE - add r1, r4, #0 - bl SysTask_CreateOnMainQueue - pop {r3, r4, r5, pc} - .balign 4, 0 -_0226504C: .word ov12_02265054 -_02265050: .word 0x000003DE - thumb_func_end ov12_02264FB0 - - thumb_func_start ov12_02265054 -ov12_02265054: ; 0x02265054 - push {r3, r4, r5, r6, r7, lr} - add r5, r1, #0 - add r7, r0, #0 - add r0, r5, #0 - add r0, #0x25 - ldrb r0, [r0] - mov r4, #0 - bl ov12_02265BB8 - add r6, r0, #0 - add r1, sp, #0 - ldr r0, [r5, #4] - add r1, #2 - add r2, sp, #0 - bl UnkImageStruct_GetSpritePositionXY - add r0, r5, #0 - add r0, #0x25 - ldrb r0, [r0] - cmp r0, #7 - bhi _022650DA - add r0, r0, r0 - add r0, pc - ldrh r0, [r0, #6] - lsl r0, r0, #0x10 - asr r0, r0, #0x10 - add pc, r0 -_0226508A: ; jump table - .short _0226509A - _0226508A - 2 ; case 0 - .short _022650DA - _0226508A - 2 ; case 1 - .short _0226509A - _0226508A - 2 ; case 2 - .short _022650DA - _0226508A - 2 ; case 3 - .short _0226509A - _0226508A - 2 ; case 4 - .short _022650DA - _0226508A - 2 ; case 5 - .short _0226509A - _0226508A - 2 ; case 6 - .short _0226509A - _0226508A - 2 ; case 7 -_0226509A: - add r0, r5, #0 - add r0, #0x4f - ldrb r0, [r0] - lsl r0, r0, #0x1f - lsr r0, r0, #0x1f - add r0, sp, #0 - bne _022650C0 - mov r1, #2 - ldrsh r2, [r0, r1] - sub r2, #0x18 - strh r2, [r0, #2] - add r2, r4, #0 - ldrsh r1, [r0, r1] - ldrsh r2, [r6, r2] - cmp r1, r2 - bge _02265118 - strh r2, [r0, #2] - add r4, r4, #1 - b _02265118 -_022650C0: - mov r1, #2 - ldrsh r2, [r0, r1] - add r2, #0x18 - strh r2, [r0, #2] - add r2, r4, #0 - ldrsh r2, [r6, r2] - ldrsh r1, [r0, r1] - add r2, #0xa0 - cmp r1, r2 - ble _02265118 - strh r2, [r0, #2] - add r4, r4, #1 - b _02265118 -_022650DA: - add r0, r5, #0 - add r0, #0x4f - ldrb r0, [r0] - lsl r0, r0, #0x1f - lsr r0, r0, #0x1f - add r0, sp, #0 - bne _02265100 - mov r1, #2 - ldrsh r2, [r0, r1] - add r2, #0x18 - strh r2, [r0, #2] - mov r2, #0 - ldrsh r1, [r0, r1] - ldrsh r2, [r6, r2] - cmp r1, r2 - ble _02265118 - strh r2, [r0, #2] - add r4, r4, #1 - b _02265118 -_02265100: - mov r1, #2 - ldrsh r2, [r0, r1] - sub r2, #0x18 - strh r2, [r0, #2] - mov r2, #0 - ldrsh r2, [r6, r2] - ldrsh r1, [r0, r1] - sub r2, #0x18 - cmp r1, r2 - bge _02265118 - strh r2, [r0, #2] - add r4, r4, #1 -_02265118: - add r2, sp, #0 - mov r1, #2 - mov r3, #0 - ldrsh r1, [r2, r1] - ldrsh r2, [r2, r3] - ldr r0, [r5, #4] - bl UnkImageStruct_SetSpritePositionXY - ldr r0, [r5, #8] - cmp r0, #0 - beq _0226514C - add r6, sp, #0 - mov r1, #2 - ldrsh r3, [r6, r1] - add r1, r5, #0 - add r1, #0x25 - ldrb r2, [r1] - ldr r1, _02265168 ; =ov12_0226D368 - ldrsb r1, [r1, r2] - mov r2, #0 - ldrsh r2, [r6, r2] - sub r1, r3, r1 - lsl r1, r1, #0x10 - asr r1, r1, #0x10 - bl UnkImageStruct_SetSpritePositionXY -_0226514C: - cmp r4, #0 - ble _02265164 - add r0, r5, #0 - add r0, #0x4f - ldrb r1, [r0] - mov r0, #2 - add r5, #0x4f - orr r0, r1 - strb r0, [r5] - add r0, r7, #0 - bl SysTask_Destroy -_02265164: - pop {r3, r4, r5, r6, r7, pc} - nop -_02265168: .word ov12_0226D368 - thumb_func_end ov12_02265054 - - thumb_func_start ov12_0226516C -ov12_0226516C: ; 0x0226516C - push {r4, r5, r6, r7, lr} - sub sp, #0x34 - add r5, r0, #0 - ldr r0, [r5, #0xc] - bl BattleSystem_GetBgConfig - add r6, r0, #0 - ldr r0, [r5, #0xc] - bl BattleSystem_GetMessageData - add r7, r0, #0 - ldr r0, [r5, #0xc] - bl BattleSystem_GetMessageFormat - add r4, r0, #0 - mov r0, #0x16 - mov r1, #5 - bl String_New - mov r1, #0xf1 - str r0, [sp, #0x18] - add r0, r7, #0 - lsl r1, r1, #2 - bl NewString_ReadMsgData - add r1, r5, #0 - add r2, r5, #0 - add r1, #0x24 - add r2, #0x26 - str r0, [sp, #0x1c] - ldrb r1, [r1] - ldrb r2, [r2] - ldr r0, [r5, #0xc] - bl BattleSystem_GetPartyMon - bl Mon_GetBoxMon - add r2, r0, #0 - add r0, r4, #0 - mov r1, #0 - bl BufferBoxMonNickname - ldr r1, [sp, #0x18] - ldr r2, [sp, #0x1c] - add r0, r4, #0 - bl StringExpandPlaceholders - mov r0, #0 - str r0, [sp] - mov r0, #0xf - str r0, [sp, #4] - add r0, r6, #0 - add r1, sp, #0x24 - mov r2, #8 - mov r3, #2 - bl AddTextWindowTopLeftCorner - mov r1, #0 - str r1, [sp] - mov r0, #0xff - str r0, [sp, #4] - ldr r0, _022652AC ; =0x000E020F - ldr r2, [sp, #0x18] - str r0, [sp, #8] - str r1, [sp, #0xc] - str r1, [sp, #0x10] - str r1, [sp, #0x14] - add r0, sp, #0x24 - add r3, r1, #0 - bl AddTextPrinterParameterizedWithColorAndSpacing - ldr r0, [r5, #4] - ldr r6, [sp, #0x30] - ldr r0, [r0] - bl Sprite_GetImageProxy - add r4, r0, #0 - mov r0, #1 - lsl r0, r0, #8 - add r0, r6, r0 - str r0, [sp, #0x20] - add r0, r5, #0 - add r0, #0x25 - ldrb r0, [r0] - ldr r1, _022652B0 ; =ov12_0226D680 - ldr r3, [r4, #4] - lsl r7, r0, #4 - ldrh r2, [r1, r7] - mov r1, #0x19 - lsl r1, r1, #0x16 - add r1, r1, r2 - ldr r2, _022652B4 ; =ov12_0226D682 - add r0, r6, #0 - ldrh r2, [r2, r7] - add r1, r3, r1 - bl MIi_CpuCopy16 - add r0, r5, #0 - add r0, #0x25 - ldrb r0, [r0] - ldr r1, _022652B8 ; =ov12_0226D684 - ldr r3, [r4, #4] - lsl r7, r0, #4 - ldrh r2, [r1, r7] - mov r1, #0x19 - lsl r1, r1, #0x16 - add r1, r1, r2 - ldr r2, _022652BC ; =ov12_0226D686 - ldr r0, [sp, #0x20] - ldrh r2, [r2, r7] - add r1, r3, r1 - bl MIi_CpuCopy16 - add r0, r5, #0 - add r0, #0x25 - ldrb r0, [r0] - ldr r3, _022652C0 ; =ov12_0226D688 - ldr r1, [r4, #4] - lsl r2, r0, #4 - ldr r0, _022652B4 ; =ov12_0226D682 - ldrh r0, [r0, r2] - add r0, r6, r0 - ldrh r6, [r3, r2] - mov r3, #0x19 - lsl r3, r3, #0x16 - add r3, r3, r6 - add r1, r1, r3 - ldr r3, _022652C4 ; =ov12_0226D68A - ldrh r2, [r3, r2] - bl MIi_CpuCopy16 - add r5, #0x25 - ldrb r0, [r5] - ldr r4, [r4, #4] - lsl r2, r0, #4 - ldr r0, _022652BC ; =ov12_0226D686 - ldrh r1, [r0, r2] - ldr r0, [sp, #0x20] - add r0, r0, r1 - ldr r1, _022652C8 ; =ov12_0226D68C - ldrh r3, [r1, r2] - mov r1, #0x19 - lsl r1, r1, #0x16 - add r1, r1, r3 - ldr r3, _022652CC ; =ov12_0226D68E - add r1, r4, r1 - ldrh r2, [r3, r2] - bl MIi_CpuCopy16 - add r0, sp, #0x24 - bl RemoveWindow - ldr r0, [sp, #0x18] - bl String_Delete - ldr r0, [sp, #0x1c] - bl String_Delete - add sp, #0x34 - pop {r4, r5, r6, r7, pc} - .balign 4, 0 -_022652AC: .word 0x000E020F -_022652B0: .word ov12_0226D680 -_022652B4: .word ov12_0226D682 -_022652B8: .word ov12_0226D684 -_022652BC: .word ov12_0226D686 -_022652C0: .word ov12_0226D688 -_022652C4: .word ov12_0226D68A -_022652C8: .word ov12_0226D68C -_022652CC: .word ov12_0226D68E - thumb_func_end ov12_0226516C - - thumb_func_start ov12_022652D0 -ov12_022652D0: ; 0x022652D0 - push {r3, r4, r5, r6, r7, lr} - add r5, r0, #0 - add r0, #0x49 - ldrb r0, [r0] - cmp r0, #0 - bne _022652E2 - mov r0, #0x4a - mov r4, #0x3e - b _022652F0 -_022652E2: - cmp r0, #1 - bne _022652EC - mov r0, #0x48 - mov r4, #0x3c - b _022652F0 -_022652EC: - mov r0, #0x4c - mov r4, #0x40 -_022652F0: - bl ov12_02265B58 - str r0, [sp] - add r0, r4, #0 - bl ov12_02265B58 - add r7, r0, #0 - ldr r0, [r5, #4] - ldr r0, [r0] - bl Sprite_GetImageProxy - add r4, r0, #0 - add r0, r5, #0 - add r0, #0x25 - ldrb r0, [r0] - mov r6, #0x19 - ldr r3, _02265344 ; =ov12_0226D4B0 - lsl r2, r0, #3 - ldrh r3, [r3, r2] - lsl r6, r6, #0x16 - ldr r1, [r4, #4] - add r3, r6, r3 - add r1, r1, r3 - ldr r3, _02265348 ; =ov12_0226D4B2 - add r0, r7, #0 - ldrh r2, [r3, r2] - bl MIi_CpuCopy16 - add r5, #0x25 - ldrb r0, [r5] - ldr r1, _0226534C ; =ov12_0226D4B4 - ldr r3, [r4, #4] - lsl r2, r0, #3 - ldrh r1, [r1, r2] - ldr r0, [sp] - add r1, r6, r1 - add r1, r3, r1 - ldr r3, _02265350 ; =ov12_0226D4B6 - ldrh r2, [r3, r2] - bl MIi_CpuCopy16 - pop {r3, r4, r5, r6, r7, pc} - .balign 4, 0 -_02265344: .word ov12_0226D4B0 -_02265348: .word ov12_0226D4B2 -_0226534C: .word ov12_0226D4B4 -_02265350: .word ov12_0226D4B6 - thumb_func_end ov12_022652D0 - - thumb_func_start ov12_02265354 -ov12_02265354: ; 0x02265354 - push {r4, r5, r6, r7, lr} - sub sp, #0xc - str r0, [sp, #4] - mov r0, #5 - mov r1, #0x60 - bl AllocFromHeap - add r4, r0, #0 - mov r0, #5 - mov r1, #0xc0 - bl AllocFromHeap - add r7, r0, #0 - add r0, r4, #0 - mov r1, #0xff - mov r2, #0x60 - bl MI_CpuFill8 - ldr r0, [sp, #4] - ldr r0, [r0, #0xc] - bl BattleSystem_GetLevelFont - ldr r1, [sp, #4] - str r4, [sp] - add r1, #0x48 - ldrb r1, [r1] - mov r2, #3 - mov r3, #0 - bl sub_0200CEB0 - ldr r0, [sp, #4] - ldr r0, [r0, #4] - ldr r0, [r0] - bl Sprite_GetImageProxy - str r0, [sp, #8] - ldr r0, [sp, #4] - ldr r1, _02265464 ; =ov12_0226D420 - add r0, #0x25 - ldrb r0, [r0] - lsl r2, r0, #3 - ldrh r3, [r1, r2] - mov r1, #0x19 - lsl r1, r1, #0x16 - ldr r0, [sp, #8] - add r1, r1, r3 - ldr r3, _02265468 ; =ov12_0226D422 - ldr r0, [r0, #4] - ldrh r2, [r3, r2] - add r0, r0, r1 - add r1, r7, #0 - bl MIi_CpuCopy16 - ldr r0, [sp, #4] - ldr r1, _0226546C ; =ov12_0226D424 - add r0, #0x25 - ldrb r0, [r0] - lsl r2, r0, #3 - ldrh r3, [r1, r2] - mov r1, #0x19 - ldr r0, [sp, #8] - lsl r1, r1, #0x16 - add r1, r1, r3 - ldr r3, _02265470 ; =ov12_0226D426 - ldr r0, [r0, #4] - ldrh r2, [r3, r2] - add r0, r0, r1 - add r1, r7, #0 - add r1, #0x60 - bl MIi_CpuCopy16 - mov r2, #0 - add r1, r2, #0 -_022653E6: - mov r0, #0 - add r3, r7, r1 -_022653EA: - ldrb r5, [r4, r2] - add r6, r4, r2 - add r0, r0, #1 - strb r5, [r3, #0x10] - ldrb r6, [r6, #0x10] - add r5, r3, #0 - add r5, #0x60 - strb r6, [r5] - add r2, r2, #1 - add r3, r3, #1 - cmp r0, #0x10 - blt _022653EA - add r1, #0x20 - add r2, #0x10 - cmp r1, #0x60 - blt _022653E6 - ldr r0, [sp, #4] - ldr r1, [sp, #8] - add r0, #0x25 - ldrb r0, [r0] - ldr r3, _02265464 ; =ov12_0226D420 - ldr r1, [r1, #4] - lsl r2, r0, #3 - ldrh r5, [r3, r2] - mov r3, #0x19 - lsl r3, r3, #0x16 - add r3, r3, r5 - add r1, r1, r3 - ldr r3, _02265468 ; =ov12_0226D422 - add r0, r7, #0 - ldrh r2, [r3, r2] - bl MIi_CpuCopy16 - ldr r0, [sp, #4] - ldr r3, _0226546C ; =ov12_0226D424 - add r0, #0x25 - str r0, [sp, #4] - ldrb r0, [r0] - ldr r1, [sp, #8] - lsl r2, r0, #3 - ldrh r5, [r3, r2] - mov r3, #0x19 - lsl r3, r3, #0x16 - add r0, r7, #0 - ldr r1, [r1, #4] - add r3, r3, r5 - add r1, r1, r3 - ldr r3, _02265470 ; =ov12_0226D426 - add r0, #0x60 - ldrh r2, [r3, r2] - bl MIi_CpuCopy16 - add r0, r4, #0 - bl FreeToHeap - add r0, r7, #0 - bl FreeToHeap - add sp, #0xc - pop {r4, r5, r6, r7, pc} - nop -_02265464: .word ov12_0226D420 -_02265468: .word ov12_0226D422 -_0226546C: .word ov12_0226D424 -_02265470: .word ov12_0226D426 - thumb_func_end ov12_02265354 - - thumb_func_start ov12_02265474 -ov12_02265474: ; 0x02265474 - push {r3, r4, r5, r6, r7, lr} - add r5, r0, #0 - add r6, r1, #0 - mov r0, #5 - mov r1, #0x60 - bl AllocFromHeap - mov r1, #0xff - mov r2, #0x60 - add r4, r0, #0 - bl MI_CpuFill8 - ldr r0, [r5, #0xc] - bl BattleSystem_GetHpFont - str r4, [sp] - add r1, r6, #0 - mov r2, #3 - mov r3, #1 - bl sub_0200CEB0 - ldr r0, [r5, #4] - ldr r0, [r0] - bl Sprite_GetImageProxy - add r6, r0, #0 - add r0, r5, #0 - add r0, #0x25 - ldrb r0, [r0] - mov r7, #0x19 - ldr r3, _022654F0 ; =ov12_0226D450 - lsl r2, r0, #3 - ldrh r3, [r3, r2] - lsl r7, r7, #0x16 - ldr r1, [r6, #4] - add r3, r7, r3 - add r1, r1, r3 - ldr r3, _022654F4 ; =ov12_0226D452 - add r0, r4, #0 - ldrh r2, [r3, r2] - bl MIi_CpuCopy16 - add r5, #0x25 - ldrb r0, [r5] - ldr r3, _022654F8 ; =ov12_0226D454 - ldr r1, [r6, #4] - lsl r2, r0, #3 - ldrh r3, [r3, r2] - ldr r0, _022654F4 ; =ov12_0226D452 - add r3, r7, r3 - add r1, r1, r3 - ldrh r0, [r0, r2] - ldr r3, _022654FC ; =ov12_0226D456 - ldrh r2, [r3, r2] - add r0, r4, r0 - bl MIi_CpuCopy16 - add r0, r4, #0 - bl FreeToHeap - pop {r3, r4, r5, r6, r7, pc} - nop -_022654F0: .word ov12_0226D450 -_022654F4: .word ov12_0226D452 -_022654F8: .word ov12_0226D454 -_022654FC: .word ov12_0226D456 - thumb_func_end ov12_02265474 - - thumb_func_start ov12_02265500 -ov12_02265500: ; 0x02265500 - push {r3, r4, r5, lr} - add r5, r0, #0 - mov r0, #5 - mov r1, #0x60 - bl AllocFromHeap - mov r1, #0xff - mov r2, #0x60 - add r4, r0, #0 - bl MI_CpuFill8 - ldr r0, [r5, #0xc] - bl BattleSystem_GetHpFont - str r4, [sp] - ldr r1, [r5, #0x2c] - mov r2, #3 - mov r3, #0 - bl sub_0200CEB0 - ldr r0, [r5, #4] - ldr r0, [r0] - bl Sprite_GetImageProxy - add r1, r0, #0 - add r5, #0x25 - ldrb r0, [r5] - ldr r3, _02265558 ; =ov12_0226D3F0 - ldr r1, [r1, #4] - lsl r2, r0, #2 - ldrh r5, [r3, r2] - mov r3, #0x19 - lsl r3, r3, #0x16 - add r3, r5, r3 - add r1, r1, r3 - ldr r3, _0226555C ; =ov12_0226D3F2 - add r0, r4, #0 - ldrh r2, [r3, r2] - bl MIi_CpuCopy16 - add r0, r4, #0 - bl FreeToHeap - pop {r3, r4, r5, pc} - .balign 4, 0 -_02265558: .word ov12_0226D3F0 -_0226555C: .word ov12_0226D3F2 - thumb_func_end ov12_02265500 - - thumb_func_start ov12_02265560 -ov12_02265560: ; 0x02265560 - push {r3, r4, r5, lr} - add r5, r0, #0 - add r0, #0x4b - ldrb r0, [r0] - cmp r0, #1 - bne _02265574 - mov r0, #0x3b - bl ov12_02265B58 - b _0226557A -_02265574: - mov r0, #0x26 - bl ov12_02265B58 -_0226557A: - add r4, r0, #0 - ldr r0, [r5, #4] - ldr r0, [r0] - bl Sprite_GetImageProxy - add r5, #0x25 - add r1, r0, #0 - ldrb r0, [r5] - lsl r2, r0, #2 - add r0, r4, #0 - ldr r4, [r1, #4] - ldr r1, _022655A8 ; =ov12_0226D3C0 - ldrh r3, [r1, r2] - mov r1, #0x19 - lsl r1, r1, #0x16 - add r1, r3, r1 - ldr r3, _022655AC ; =ov12_0226D3C2 - add r1, r4, r1 - ldrh r2, [r3, r2] - bl MIi_CpuCopy16 - pop {r3, r4, r5, pc} - nop -_022655A8: .word ov12_0226D3C0 -_022655AC: .word ov12_0226D3C2 - thumb_func_end ov12_02265560 - - thumb_func_start ov12_022655B0 -ov12_022655B0: ; 0x022655B0 - push {r3, r4, r5, lr} - add r5, r0, #0 - add r0, r1, #0 - bl ov12_02265B58 - add r4, r0, #0 - ldr r0, [r5, #4] - ldr r0, [r0] - bl Sprite_GetImageProxy - add r5, #0x25 - add r1, r0, #0 - ldrb r0, [r5] - lsl r2, r0, #2 - add r0, r4, #0 - ldr r4, [r1, #4] - ldr r1, _022655E8 ; =ov12_0226D390 - ldrh r3, [r1, r2] - mov r1, #0x19 - lsl r1, r1, #0x16 - add r1, r3, r1 - ldr r3, _022655EC ; =ov12_0226D392 - add r1, r4, r1 - ldrh r2, [r3, r2] - bl MIi_CpuCopy16 - pop {r3, r4, r5, pc} - nop -_022655E8: .word ov12_0226D390 -_022655EC: .word ov12_0226D392 - thumb_func_end ov12_022655B0 - - thumb_func_start ov12_022655F0 -ov12_022655F0: ; 0x022655F0 - push {r3, r4, r5, r6, r7, lr} - sub sp, #0x28 - add r4, r0, #0 - ldr r0, [r4, #0xc] - add r5, r1, #0 - bl BattleSystem_GetBgConfig - add r6, r0, #0 - ldr r0, [r4, #0xc] - bl BattleSystem_GetMessageData - mov r1, #1 - lsl r1, r1, #0xa - add r2, r5, #0 - tst r2, r1 - beq _02265618 - sub r1, #0x4a - bl NewString_ReadMsgData - b _0226561E -_02265618: - add r1, #0xc4 - bl NewString_ReadMsgData -_0226561E: - add r7, r0, #0 - mov r0, #0 - str r0, [sp] - mov r0, #0xf - str r0, [sp, #4] - add r0, r6, #0 - add r1, sp, #0x18 - mov r2, #0xd - mov r3, #2 - bl AddTextWindowTopLeftCorner - mov r1, #0 - str r1, [sp] - mov r0, #0xff - str r0, [sp, #4] - ldr r0, _022656C8 ; =0x000E020F - add r2, r7, #0 - str r0, [sp, #8] - str r1, [sp, #0xc] - str r1, [sp, #0x10] - str r1, [sp, #0x14] - add r0, sp, #0x18 - add r3, r1, #0 - bl AddTextPrinterParameterizedWithColorAndSpacing - ldr r0, [r4, #4] - ldr r5, [sp, #0x24] - ldr r0, [r0] - bl Sprite_GetImageProxy - add r4, r0, #0 - mov r2, #0x1a - mov r6, #0x19 - lsl r2, r2, #4 - lsl r6, r6, #0x16 - add r2, #0xa0 - ldr r1, [r4, #4] - add r2, r6, r2 - add r1, r1, r2 - add r0, r5, #0 - mov r2, #0xc0 - bl MIi_CpuCopy16 - mov r2, #0xd - mov r0, #0x1a - lsl r2, r2, #6 - lsl r0, r0, #4 - ldr r1, [r4, #4] - add r2, r6, r2 - add r1, r1, r2 - add r0, r5, r0 - mov r2, #0xc0 - bl MIi_CpuCopy16 - mov r2, #0xa - lsl r2, r2, #8 - add r0, r5, #0 - ldr r1, [r4, #4] - add r2, r6, r2 - add r1, r1, r2 - add r0, #0xc0 - mov r2, #0xe0 - bl MIi_CpuCopy16 - mov r0, #0x1a - mov r1, #0xb - lsl r0, r0, #4 - lsl r1, r1, #8 - add r0, r5, r0 - ldr r2, [r4, #4] - add r1, r6, r1 - add r1, r2, r1 - add r0, #0xc0 - mov r2, #0xe0 - bl MIi_CpuCopy16 - add r0, sp, #0x18 - bl RemoveWindow - add r0, r7, #0 - bl String_Delete - add sp, #0x28 - pop {r3, r4, r5, r6, r7, pc} - nop -_022656C8: .word 0x000E020F - thumb_func_end ov12_022655F0 - - thumb_func_start ov12_022656CC -ov12_022656CC: ; 0x022656CC - push {r4, r5, r6, r7, lr} - sub sp, #0x34 - add r4, r0, #0 - ldr r0, [r4, #0xc] - add r5, r1, #0 - bl BattleSystem_GetBgConfig - str r0, [sp, #0x1c] - ldr r0, [r4, #0xc] - bl BattleSystem_GetMessageData - str r0, [sp, #0x20] - ldr r0, [r4, #0xc] - bl BattleSystem_GetMessageFormat - add r7, r0, #0 - mov r0, #0x1e - mov r1, #5 - bl String_New - mov r1, #1 - add r6, r0, #0 - lsl r1, r1, #0xa - add r0, r5, #0 - tst r0, r1 - beq _0226570C - ldr r0, [sp, #0x20] - sub r1, #0x49 - bl NewString_ReadMsgData - str r0, [sp, #0x18] - b _02265716 -_0226570C: - ldr r0, [sp, #0x20] - add r1, #0xc5 - bl NewString_ReadMsgData - str r0, [sp, #0x18] -_02265716: - mov r0, #1 - str r0, [sp] - add r2, r4, #0 - str r0, [sp, #4] - add r2, #0x27 - ldrb r2, [r2] - add r0, r7, #0 - mov r1, #0 - mov r3, #2 - bl BufferIntegerAsString - ldr r2, [sp, #0x18] - add r0, r7, #0 - add r1, r6, #0 - bl StringExpandPlaceholders - mov r0, #0 - str r0, [sp] - mov r0, #0xf - str r0, [sp, #4] - ldr r0, [sp, #0x1c] - add r1, sp, #0x24 - mov r2, #0xd - mov r3, #2 - bl AddTextWindowTopLeftCorner - mov r1, #0 - str r1, [sp] - mov r0, #0xff - str r0, [sp, #4] - ldr r0, _022657E0 ; =0x000E020F - add r2, r6, #0 - str r0, [sp, #8] - str r1, [sp, #0xc] - str r1, [sp, #0x10] - str r1, [sp, #0x14] - add r0, sp, #0x24 - add r3, r1, #0 - bl AddTextPrinterParameterizedWithColorAndSpacing - ldr r0, [r4, #4] - ldr r5, [sp, #0x30] - ldr r0, [r0] - bl Sprite_GetImageProxy - add r4, r0, #0 - mov r7, #0x19 - mov r2, #0x11 - lsl r7, r7, #0x16 - lsl r2, r2, #6 - ldr r1, [r4, #4] - add r2, r7, r2 - add r1, r1, r2 - add r0, r5, #0 - mov r2, #0xc0 - bl MIi_CpuCopy16 - mov r2, #0x15 - mov r0, #0x1a - lsl r2, r2, #6 - lsl r0, r0, #4 - ldr r1, [r4, #4] - add r2, r7, r2 - add r1, r1, r2 - add r0, r5, r0 - mov r2, #0xc0 - bl MIi_CpuCopy16 - mov r2, #3 - lsl r2, r2, #0xa - add r0, r5, #0 - ldr r1, [r4, #4] - add r2, r7, r2 - add r1, r1, r2 - add r0, #0xc0 - mov r2, #0xe0 - bl MIi_CpuCopy16 - mov r0, #0x1a - mov r1, #0xd - lsl r0, r0, #4 - lsl r1, r1, #8 - add r0, r5, r0 - ldr r2, [r4, #4] - add r1, r7, r1 - add r1, r2, r1 - add r0, #0xc0 - mov r2, #0xe0 - bl MIi_CpuCopy16 - add r0, sp, #0x24 - bl RemoveWindow - add r0, r6, #0 - bl String_Delete - ldr r0, [sp, #0x18] - bl String_Delete - add sp, #0x34 - pop {r4, r5, r6, r7, pc} - .balign 4, 0 -_022657E0: .word 0x000E020F - thumb_func_end ov12_022656CC - - thumb_func_start ov12_022657E4 -ov12_022657E4: ; 0x022657E4 - push {r4, r5, r6, lr} - sub sp, #8 - add r5, r0, #0 - add r4, r1, #0 - bne _02265808 - mov r0, #6 - str r0, [sp] - mov r0, #1 - str r0, [sp, #4] - add r3, r5, #0 - ldr r0, [r5, #0x2c] - ldr r1, [r5, #0x28] - ldr r2, [r5, #0x30] - add r3, #0x34 - bl ov12_022659E0 - add r6, r0, #0 - b _02265840 -_02265808: - ldr r0, [r5, #0x38] - ldr r1, [r5, #0x40] - ldr r2, [r5, #0x3c] - mov r3, #0xc - bl ov12_02265B18 - add r1, r0, #0 - bne _0226581A - mov r1, #1 -_0226581A: - ldr r6, [r5, #0x40] - add r0, r6, #0 - bl _s32_div_f - bl abs - mov r1, #0xc - lsl r0, r0, #0x10 - add r3, r5, #0 - str r1, [sp] - lsr r0, r0, #0x10 - str r0, [sp, #4] - ldr r0, [r5, #0x3c] - ldr r1, [r5, #0x38] - add r2, r6, #0 - add r3, #0x44 - bl ov12_022659E0 - add r6, r0, #0 -_02265840: - cmp r4, #0 - bne _02265852 - add r0, r5, #0 - add r0, #0x4f - ldrb r0, [r0] - lsl r0, r0, #0x1c - lsr r0, r0, #0x1f - cmp r0, #1 - beq _0226585C -_02265852: - lsl r1, r4, #0x18 - add r0, r5, #0 - lsr r1, r1, #0x18 - bl ov12_02265878 -_0226585C: - mov r0, #0 - mvn r0, r0 - cmp r6, r0 - bne _02265872 - cmp r4, #0 - bne _0226586E - mov r0, #0 - str r0, [r5, #0x34] - b _02265872 -_0226586E: - mov r0, #0 - str r0, [r5, #0x44] -_02265872: - add r0, r6, #0 - add sp, #8 - pop {r4, r5, r6, pc} - thumb_func_end ov12_022657E4 - - thumb_func_start ov12_02265878 -ov12_02265878: ; 0x02265878 - push {r4, r5, r6, r7, lr} - sub sp, #0x1c - add r6, r0, #0 - ldr r0, [r6, #4] - add r4, r1, #0 - ldr r0, [r0] - bl Sprite_GetImageProxy - add r5, r0, #0 - cmp r4, #0 - beq _02265896 - cmp r4, #1 - beq _02265948 - add sp, #0x1c - pop {r4, r5, r6, r7, pc} -_02265896: - add r0, sp, #0x10 - str r0, [sp] - mov r0, #6 - str r0, [sp, #4] - add r3, r6, #0 - ldr r0, [r6, #0x2c] - ldr r1, [r6, #0x28] - ldr r2, [r6, #0x30] - add r3, #0x34 - bl ov12_02265A9C - mov r1, #0x30 - bl sub_02088080 - cmp r0, #1 - beq _022658C6 - cmp r0, #2 - beq _022658C2 - cmp r0, #3 - bne _022658C6 - mov r0, #2 - b _022658C8 -_022658C2: - mov r0, #0xb - b _022658C8 -_022658C6: - mov r0, #0x14 -_022658C8: - bl ov12_02265B58 - str r0, [sp, #0xc] - add r0, r6, #0 - add r0, #0x25 - ldrb r0, [r0] - mov r4, #0 - lsl r1, r0, #3 - ldr r0, _022659D8 ; =ov12_0226D482 - ldrh r0, [r0, r1] - lsr r7, r0, #5 -_022658DE: - cmp r4, r7 - add r0, sp, #0x10 - bge _0226590E - add r2, r6, #0 - add r2, #0x25 - ldrb r2, [r2] - ldrb r0, [r0, r4] - lsl r3, r2, #3 - ldr r2, _022659DC ; =ov12_0226D480 - lsl r1, r0, #5 - ldrh r3, [r2, r3] - ldr r0, [sp, #0xc] - mov r2, #0x19 - lsl r2, r2, #0x16 - add r0, r0, r1 - add r3, r2, r3 - lsl r2, r4, #5 - ldr r1, [r5, #4] - add r2, r3, r2 - add r1, r1, r2 - mov r2, #0x20 - bl MIi_CpuCopy16 - b _0226593A -_0226590E: - ldrb r0, [r0, r4] - ldr r2, [r5, #4] - lsl r1, r0, #5 - ldr r0, [sp, #0xc] - add r0, r0, r1 - add r1, r6, #0 - add r1, #0x25 - ldrb r1, [r1] - lsl r3, r1, #3 - ldr r1, _022659DC ; =ov12_0226D480 - add r1, r1, r3 - ldrh r3, [r1, #4] - mov r1, #0x19 - lsl r1, r1, #0x16 - add r1, r1, r3 - sub r3, r4, r7 - lsl r3, r3, #5 - add r1, r1, r3 - add r1, r2, r1 - mov r2, #0x20 - bl MIi_CpuCopy16 -_0226593A: - add r0, r4, #1 - lsl r0, r0, #0x18 - lsr r4, r0, #0x18 - cmp r4, #6 - blo _022658DE - add sp, #0x1c - pop {r4, r5, r6, r7, pc} -_02265948: - add r0, sp, #0x10 - str r0, [sp] - mov r0, #0xc - str r0, [sp, #4] - add r3, r6, #0 - ldr r0, [r6, #0x3c] - ldr r1, [r6, #0x38] - ldr r2, [r6, #0x40] - add r3, #0x44 - bl ov12_02265A9C - add r6, #0x48 - ldrb r0, [r6] - cmp r0, #0x64 - bne _02265978 - mov r0, #0 - add r2, r0, #0 - add r1, sp, #0x10 -_0226596C: - strb r2, [r1, r0] - add r0, r0, #1 - lsl r0, r0, #0x18 - lsr r0, r0, #0x18 - cmp r0, #0xc - blo _0226596C -_02265978: - mov r0, #0x1d - bl ov12_02265B58 - add r6, r0, #0 - mov r1, #0x19 - mov r0, #0x66 - lsl r1, r1, #0x16 - lsl r0, r0, #4 - add r0, r1, r0 - str r0, [sp, #8] - mov r0, #0xe - lsl r0, r0, #8 - mov r4, #0 - add r7, r1, r0 -_02265994: - cmp r4, #5 - add r0, sp, #0x10 - bhs _022659B2 - ldrb r0, [r0, r4] - ldr r1, [sp, #8] - lsl r2, r4, #5 - lsl r0, r0, #5 - add r1, r1, r2 - ldr r3, [r5, #4] - add r0, r6, r0 - add r1, r3, r1 - mov r2, #0x20 - bl MIi_CpuCopy16 - b _022659C8 -_022659B2: - ldrb r0, [r0, r4] - sub r2, r4, #5 - lsl r2, r2, #5 - lsl r0, r0, #5 - ldr r1, [r5, #4] - add r2, r7, r2 - add r1, r1, r2 - add r0, r6, r0 - mov r2, #0x20 - bl MIi_CpuCopy16 -_022659C8: - add r0, r4, #1 - lsl r0, r0, #0x18 - lsr r4, r0, #0x18 - cmp r4, #0xc - blo _02265994 - add sp, #0x1c - pop {r4, r5, r6, r7, pc} - nop -_022659D8: .word ov12_0226D482 -_022659DC: .word ov12_0226D480 - thumb_func_end ov12_02265878 - - thumb_func_start ov12_022659E0 -ov12_022659E0: ; 0x022659E0 - push {r4, r5, r6, lr} - add r6, r2, #0 - add r2, sp, #0 - add r5, r3, #0 - ldrb r2, [r2, #0x10] - mov r3, #2 - ldr r4, [r5] - lsl r2, r2, #0x1b - lsl r3, r3, #0x1e - lsr r2, r2, #0x18 - cmp r4, r3 - bne _02265A04 - cmp r0, r2 - bge _02265A02 - lsl r3, r1, #8 - str r3, [r5] - b _02265A04 -_02265A02: - str r1, [r5] -_02265A04: - sub r4, r1, r6 - bpl _02265A0C - mov r4, #0 - b _02265A12 -_02265A0C: - cmp r4, r0 - ble _02265A12 - add r4, r0, #0 -_02265A12: - cmp r0, r2 - bge _02265A2A - ldr r3, [r5] - asr r1, r3, #8 - cmp r4, r1 - bne _02265A36 - lsl r1, r3, #0x18 - lsr r1, r1, #0x18 - bne _02265A36 - mov r0, #0 - mvn r0, r0 - pop {r4, r5, r6, pc} -_02265A2A: - ldr r1, [r5] - cmp r4, r1 - bne _02265A36 - mov r0, #0 - mvn r0, r0 - pop {r4, r5, r6, pc} -_02265A36: - cmp r0, r2 - bge _02265A76 - lsl r0, r0, #8 - add r1, r2, #0 - bl _s32_div_f - cmp r6, #0 - ldr r1, [r5] - bge _02265A5A - add r0, r1, r0 - str r0, [r5] - asr r0, r0, #8 - cmp r0, r4 - blt _02265A9A - lsl r0, r4, #8 - str r0, [r5] - add r0, r4, #0 - pop {r4, r5, r6, pc} -_02265A5A: - sub r1, r1, r0 - str r1, [r5] - asr r0, r1, #8 - lsl r1, r1, #0x18 - lsr r1, r1, #0x18 - cmp r1, #0 - ble _02265A6A - add r0, r0, #1 -_02265A6A: - cmp r0, r4 - bgt _02265A9A - lsl r0, r4, #8 - str r0, [r5] - add r0, r4, #0 - pop {r4, r5, r6, pc} -_02265A76: - cmp r6, #0 - ldr r1, [r5] - add r0, sp, #0 - bge _02265A8C - ldrh r0, [r0, #0x14] - add r0, r1, r0 - str r0, [r5] - cmp r0, r4 - ble _02265A98 - str r4, [r5] - b _02265A98 -_02265A8C: - ldrh r0, [r0, #0x14] - sub r0, r1, r0 - str r0, [r5] - cmp r0, r4 - bge _02265A98 - str r4, [r5] -_02265A98: - ldr r0, [r5] -_02265A9A: - pop {r4, r5, r6, pc} - thumb_func_end ov12_022659E0 - - thumb_func_start ov12_02265A9C -ov12_02265A9C: ; 0x02265A9C - push {r3, r4, r5, r6, r7, lr} - add r6, r0, #0 - ldr r5, [sp, #0x18] - sub r7, r1, r2 - bpl _02265AAA - mov r7, #0 - b _02265AB0 -_02265AAA: - cmp r7, r6 - ble _02265AB0 - add r7, r6, #0 -_02265AB0: - add r0, sp, #8 - ldrb r4, [r0, #0x14] - mov r1, #0 - lsl r2, r4, #3 - cmp r4, #0 - ble _02265AC6 - add r0, r1, #0 -_02265ABE: - strb r0, [r5, r1] - add r1, r1, #1 - cmp r1, r4 - blt _02265ABE -_02265AC6: - cmp r6, r2 - ldr r1, [r3] - bhs _02265ADA - add r0, r1, #0 - mul r0, r2 - add r1, r6, #0 - bl _u32_div_f - lsr r0, r0, #8 - b _02265AE4 -_02265ADA: - add r0, r1, #0 - mul r0, r2 - add r1, r6, #0 - bl _u32_div_f -_02265AE4: - add r2, r0, #0 - cmp r0, #0 - bne _02265AF4 - cmp r7, #0 - ble _02265AF4 - mov r2, #1 - strb r2, [r5] - b _02265B10 -_02265AF4: - mov r3, #0 - cmp r4, #0 - ble _02265B10 - mov r1, #8 -_02265AFC: - cmp r0, #8 - blo _02265B06 - strb r1, [r5, r3] - sub r0, #8 - b _02265B0A -_02265B06: - strb r0, [r5, r3] - b _02265B10 -_02265B0A: - add r3, r3, #1 - cmp r3, r4 - blt _02265AFC -_02265B10: - lsl r0, r2, #0x18 - lsr r0, r0, #0x18 - pop {r3, r4, r5, r6, r7, pc} - .balign 4, 0 - thumb_func_end ov12_02265A9C - - thumb_func_start ov12_02265B18 -ov12_02265B18: ; 0x02265B18 - push {r3, r4, r5, r6, r7, lr} - add r7, r0, #0 - lsl r0, r3, #0x1b - add r5, r2, #0 - lsr r6, r0, #0x18 - sub r4, r7, r1 - bpl _02265B2A - mov r4, #0 - b _02265B30 -_02265B2A: - cmp r4, r5 - ble _02265B30 - add r4, r5, #0 -_02265B30: - add r0, r7, #0 - mul r0, r6 - add r1, r5, #0 - bl _s32_div_f - add r7, r0, #0 - add r0, r4, #0 - mul r0, r6 - add r1, r5, #0 - bl _s32_div_f - lsl r1, r7, #0x18 - lsl r0, r0, #0x18 - asr r1, r1, #0x18 - asr r0, r0, #0x18 - sub r0, r1, r0 - bl abs - pop {r3, r4, r5, r6, r7, pc} - .balign 4, 0 - thumb_func_end ov12_02265B18 - - thumb_func_start ov12_02265B58 -ov12_02265B58: ; 0x02265B58 - ldr r1, _02265B60 ; =ov12_0226D6E0 - lsl r0, r0, #5 - add r0, r1, r0 - bx lr - .balign 4, 0 -_02265B60: .word ov12_0226D6E0 - thumb_func_end ov12_02265B58 - - thumb_func_start ov12_02265B64 -ov12_02265B64: ; 0x02265B64 - push {r3, lr} - cmp r0, #5 - bhi _02265BB0 - add r0, r0, r0 - add r0, pc - ldrh r0, [r0, #6] - lsl r0, r0, #0x10 - asr r0, r0, #0x10 - add pc, r0 -_02265B76: ; jump table - .short _02265B82 - _02265B76 - 2 ; case 0 - .short _02265B9C - _02265B76 - 2 ; case 1 - .short _02265BA0 - _02265B76 - 2 ; case 2 - .short _02265BA4 - _02265B76 - 2 ; case 3 - .short _02265BA8 - _02265B76 - 2 ; case 4 - .short _02265BAC - _02265B76 - 2 ; case 5 -_02265B82: - mov r0, #2 - lsl r0, r0, #8 - tst r0, r1 - beq _02265B8E - mov r0, #7 - pop {r3, pc} -_02265B8E: - mov r0, #0x20 - tst r0, r1 - beq _02265B98 - mov r0, #6 - pop {r3, pc} -_02265B98: - mov r0, #0 - pop {r3, pc} -_02265B9C: - mov r0, #1 - pop {r3, pc} -_02265BA0: - mov r0, #2 - pop {r3, pc} -_02265BA4: - mov r0, #3 - pop {r3, pc} -_02265BA8: - mov r0, #4 - pop {r3, pc} -_02265BAC: - mov r0, #5 - pop {r3, pc} -_02265BB0: - bl GF_AssertFail - mov r0, #0 - pop {r3, pc} - thumb_func_end ov12_02265B64 - - thumb_func_start ov12_02265BB8 -ov12_02265BB8: ; 0x02265BB8 - push {r3, lr} - cmp r0, #7 - bhi _02265BF6 - add r0, r0, r0 - add r0, pc - ldrh r0, [r0, #6] - lsl r0, r0, #0x10 - asr r0, r0, #0x10 - add pc, r0 -_02265BCA: ; jump table - .short _02265BDA - _02265BCA - 2 ; case 0 - .short _02265BDE - _02265BCA - 2 ; case 1 - .short _02265BE2 - _02265BCA - 2 ; case 2 - .short _02265BE6 - _02265BCA - 2 ; case 3 - .short _02265BEA - _02265BCA - 2 ; case 4 - .short _02265BEE - _02265BCA - 2 ; case 5 - .short _02265BF2 - _02265BCA - 2 ; case 6 - .short _02265BF2 - _02265BCA - 2 ; case 7 -_02265BDA: - ldr r0, _02265C00 ; =ov12_0226D5E4 - pop {r3, pc} -_02265BDE: - ldr r0, _02265C04 ; =ov12_0226D618 - pop {r3, pc} -_02265BE2: - ldr r0, _02265C08 ; =ov12_0226D4E0 - pop {r3, pc} -_02265BE6: - ldr r0, _02265C0C ; =ov12_0226D514 - pop {r3, pc} -_02265BEA: - ldr r0, _02265C10 ; =ov12_0226D57C - pop {r3, pc} -_02265BEE: - ldr r0, _02265C14 ; =ov12_0226D64C - pop {r3, pc} -_02265BF2: - ldr r0, _02265C18 ; =ov12_0226D5B0 - pop {r3, pc} -_02265BF6: - bl GF_AssertFail - mov r0, #0 - pop {r3, pc} - nop -_02265C00: .word ov12_0226D5E4 -_02265C04: .word ov12_0226D618 -_02265C08: .word ov12_0226D4E0 -_02265C0C: .word ov12_0226D514 -_02265C10: .word ov12_0226D57C -_02265C14: .word ov12_0226D64C -_02265C18: .word ov12_0226D5B0 - thumb_func_end ov12_02265BB8 - - thumb_func_start ov12_02265C1C -ov12_02265C1C: ; 0x02265C1C - push {r3, lr} - cmp r0, #7 - bhi _02265C46 - add r0, r0, r0 - add r0, pc - ldrh r0, [r0, #6] - lsl r0, r0, #0x10 - asr r0, r0, #0x10 - add pc, r0 -_02265C2E: ; jump table - .short _02265C3E - _02265C2E - 2 ; case 0 - .short _02265C42 - _02265C2E - 2 ; case 1 - .short _02265C3E - _02265C2E - 2 ; case 2 - .short _02265C42 - _02265C2E - 2 ; case 3 - .short _02265C3E - _02265C2E - 2 ; case 4 - .short _02265C42 - _02265C2E - 2 ; case 5 - .short _02265C3E - _02265C2E - 2 ; case 6 - .short _02265C3E - _02265C2E - 2 ; case 7 -_02265C3E: - ldr r0, _02265C50 ; =ov12_0226D548 - pop {r3, pc} -_02265C42: - mov r0, #0 - pop {r3, pc} -_02265C46: - bl GF_AssertFail - mov r0, #0 - pop {r3, pc} - nop -_02265C50: .word ov12_0226D548 - thumb_func_end ov12_02265C1C - - thumb_func_start ov12_02265C54 -ov12_02265C54: ; 0x02265C54 - push {r4, r5, r6, lr} - add r5, r0, #0 - add r6, r1, #0 - mov r0, #0 - strb r0, [r6] - mov r0, #5 - mov r1, #0xc - bl AllocFromHeap - mov r1, #0 - mov r2, #0xc - add r4, r0, #0 - bl MI_CpuFill8 - mov r2, #0xfa - str r5, [r4] - ldr r0, _02265C84 ; =ov12_02265C88 - add r1, r4, #0 - lsl r2, r2, #2 - str r6, [r4, #4] - bl SysTask_CreateOnMainQueue - pop {r4, r5, r6, pc} - nop -_02265C84: .word ov12_02265C88 - thumb_func_end ov12_02265C54 - - thumb_func_start ov12_02265C88 -ov12_02265C88: ; 0x02265C88 - push {r3, r4, r5, r6, r7, lr} - sub sp, #8 - add r4, r1, #0 - add r7, r0, #0 - ldr r0, [r4] - ldr r0, [r0, #0xc] - bl ov12_0223A8EC - add r5, r0, #0 - ldr r0, [r4] - ldr r0, [r0, #0xc] - bl BattleSystem_GetPaletteData - add r6, r0, #0 - ldrb r0, [r4, #8] - cmp r0, #0 - beq _02265CB4 - cmp r0, #1 - beq _02265CD2 - cmp r0, #2 - beq _02265D04 - b _02265D38 -_02265CB4: - ldr r1, _02265D64 ; =0x00004E27 - add r0, r5, #0 - mov r2, #1 - bl sub_0200D944 - add r5, r0, #0 - ldr r0, [r4] - add r1, r5, #0 - ldr r0, [r0, #4] - bl UnkImageStruct_SetSpritePalIndex - strb r5, [r4, #9] - ldrb r0, [r4, #8] - add r0, r0, #1 - strb r0, [r4, #8] -_02265CD2: - mov r0, #0xa - ldrsb r1, [r4, r0] - add r1, r1, #2 - strb r1, [r4, #0xa] - ldrsb r1, [r4, r0] - cmp r1, #0xa - blt _02265CE8 - strb r0, [r4, #0xa] - ldrb r0, [r4, #8] - add r0, r0, #1 - strb r0, [r4, #8] -_02265CE8: - ldrb r0, [r4, #0xa] - mov r1, #2 - mov r3, #0x10 - str r0, [sp] - ldr r0, _02265D68 ; =0x000073A5 - str r0, [sp, #4] - ldrb r2, [r4, #9] - add r0, r6, #0 - lsl r2, r2, #0x14 - lsr r2, r2, #0x10 - bl PaletteData_BlendPalette - add sp, #8 - pop {r3, r4, r5, r6, r7, pc} -_02265D04: - mov r0, #0xa - ldrsb r1, [r4, r0] - sub r1, r1, #2 - strb r1, [r4, #0xa] - ldrsb r0, [r4, r0] - cmp r0, #0 - bgt _02265D1C - mov r0, #0 - strb r0, [r4, #0xa] - ldrb r0, [r4, #8] - add r0, r0, #1 - strb r0, [r4, #8] -_02265D1C: - ldrb r0, [r4, #0xa] - mov r1, #2 - mov r3, #0x10 - str r0, [sp] - ldr r0, _02265D68 ; =0x000073A5 - str r0, [sp, #4] - ldrb r2, [r4, #9] - add r0, r6, #0 - lsl r2, r2, #0x14 - lsr r2, r2, #0x10 - bl PaletteData_BlendPalette - add sp, #8 - pop {r3, r4, r5, r6, r7, pc} -_02265D38: - ldr r1, _02265D6C ; =0x00004E26 - add r0, r5, #0 - mov r2, #1 - bl sub_0200D944 - add r1, r0, #0 - ldr r0, [r4] - ldr r0, [r0, #4] - bl UnkImageStruct_SetSpritePalIndex - ldr r0, [r4, #4] - mov r1, #1 - strb r1, [r0] - add r0, r4, #0 - bl FreeToHeap - add r0, r7, #0 - bl SysTask_Destroy - add sp, #8 - pop {r3, r4, r5, r6, r7, pc} - nop -_02265D64: .word 0x00004E27 -_02265D68: .word 0x000073A5 -_02265D6C: .word 0x00004E26 - thumb_func_end ov12_02265C88 - - thumb_func_start ov12_02265D70 -ov12_02265D70: ; 0x02265D70 - bx lr - .balign 4, 0 - thumb_func_end ov12_02265D70 - - thumb_func_start ov12_02265D74 -ov12_02265D74: ; 0x02265D74 - bx lr - .balign 4, 0 - thumb_func_end ov12_02265D74 - - thumb_func_start ov12_02265D78 -ov12_02265D78: ; 0x02265D78 - push {r4, lr} - add r4, r0, #0 - ldr r0, [r4, #0x50] - cmp r0, #0 - bne _02265D96 - add r0, r4, #0 - mov r1, #0 - add r0, #0x54 - strh r1, [r0] - ldr r0, _02265D98 ; =ov12_02265DC4 - ldr r2, _02265D9C ; =0x000003F2 - add r1, r4, #0 - bl SysTask_CreateOnMainQueue - str r0, [r4, #0x50] -_02265D96: - pop {r4, pc} - .balign 4, 0 -_02265D98: .word ov12_02265DC4 -_02265D9C: .word 0x000003F2 - thumb_func_end ov12_02265D78 - - thumb_func_start ov12_02265DA0 -ov12_02265DA0: ; 0x02265DA0 - push {r4, lr} - add r4, r0, #0 - ldr r0, [r4, #0x50] - cmp r0, #0 - beq _02265DB2 - bl SysTask_Destroy - mov r0, #0 - str r0, [r4, #0x50] -_02265DB2: - add r0, r4, #0 - mov r1, #0 - add r0, #0x54 - strh r1, [r0] - add r0, r4, #0 - add r2, r1, #0 - bl ov12_02264F44 - pop {r4, pc} - thumb_func_end ov12_02265DA0 - - thumb_func_start ov12_02265DC4 -ov12_02265DC4: ; 0x02265DC4 - push {r3, r4, r5, lr} - add r4, r1, #0 - add r1, #0x54 - ldrh r2, [r1] - add r1, r4, #0 - add r1, #0x54 - add r2, #0x14 - strh r2, [r1] - add r1, r4, #0 - add r1, #0x54 - ldrh r2, [r1] - mov r1, #0x5a - add r0, r4, #0 - lsl r1, r1, #2 - add r0, #0x54 - cmp r2, r1 - blo _02265DEC - ldrh r2, [r0] - sub r1, r2, r1 - strh r1, [r0] -_02265DEC: - add r0, r4, #0 - add r0, #0x54 - ldrh r0, [r0] - bl GF_SinDegNoWrap - mov r2, #6 - asr r1, r0, #0x1f - lsl r2, r2, #0xa - mov r3, #0 - bl _ll_mul - mov r2, #2 - add r3, r0, #0 - add r5, r1, #0 - mov r1, #0 - lsl r2, r2, #0xa - add r0, r4, #0 - add r3, r3, r2 - adc r5, r1 - lsl r2, r5, #0x14 - lsr r3, r3, #0xc - orr r3, r2 - asr r2, r3, #0xb - lsr r2, r2, #0x14 - add r2, r3, r2 - asr r2, r2, #0xc - bl ov12_02264F44 - pop {r3, r4, r5, pc} - .balign 4, 0 - thumb_func_end ov12_02265DC4 - - .rodata - -ov12_0226D368: ; 0x0226D368 - .byte 0x48, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0x00 - .byte 0x40, 0x02, 0xC0, 0x00, 0x40, 0x03, 0xC0, 0x00, 0x00, 0x0A, 0xE0, 0x00, 0x00, 0x0B, 0xE0, 0x00 - .byte 0x40, 0x04, 0xC0, 0x00, 0x40, 0x05, 0xC0, 0x00, 0x00, 0x0C, 0xE0, 0x00, 0x00, 0x0D, 0xE0, 0x00 - -ov12_0226D390: ; 0x0226D390 - .byte 0x80, 0x04 - -ov12_0226D392: ; 0x0226D392 - .byte 0x60, 0x00, 0x40, 0x04, 0x60, 0x00, 0x60, 0x04, 0x60, 0x00, 0x40, 0x04, 0x60, 0x00 - .byte 0x60, 0x04, 0x60, 0x00, 0x40, 0x04, 0x60, 0x00 - -ov12_0226D3A8: ; 0x0226D3A8 - .byte 0x00, 0x00 - -ov12_0226D3AA: ; 0x0226D3AA - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0xC0, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00 - -ov12_0226D3C0: ; 0x0226D3C0 - .byte 0x60, 0x04 - -ov12_0226D3C2: ; 0x0226D3C2 - .byte 0x20, 0x00, 0x20, 0x04, 0x20, 0x00, 0x40, 0x04, 0x20, 0x00, 0x20, 0x04, 0x20, 0x00 - .byte 0x40, 0x04, 0x20, 0x00, 0x20, 0x04, 0x20, 0x00 - -ov12_0226D3D8: ; 0x0226D3D8 - .byte 0x00, 0x00 - -ov12_0226D3DA: ; 0x0226D3DA - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0xC0, 0x0C, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x0C, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00 - -ov12_0226D3F0: ; 0x0226D3F0 - .byte 0x80, 0x0D - -ov12_0226D3F2: ; 0x0226D3F2 - .byte 0x60, 0x00, 0xA0, 0x06, 0x60, 0x00, 0x80, 0x0C, 0x60, 0x00, 0xA0, 0x06, 0x60, 0x00 - .byte 0x80, 0x0C, 0x60, 0x00, 0xA0, 0x06, 0x60, 0x00 - -ov12_0226D408: ; 0x0226D408 - .byte 0x00, 0x00 - -ov12_0226D40A: ; 0x0226D40A - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x60, 0x0C, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x0C, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00 - -ov12_0226D420: ; 0x0226D420 - .byte 0xA0, 0x0A - -ov12_0226D422: ; 0x0226D422 - .byte 0x60, 0x00 - -ov12_0226D424: ; 0x0226D424 - .byte 0xA0, 0x0B - -ov12_0226D426: ; 0x0226D426 - .byte 0x60, 0x00, 0x60, 0x0A, 0x60, 0x00, 0x60, 0x0B, 0x60, 0x00 - .byte 0x80, 0x0A, 0x60, 0x00, 0x80, 0x0B, 0x60, 0x00, 0x60, 0x0A, 0x60, 0x00, 0x60, 0x0B, 0x60, 0x00 - .byte 0x80, 0x0A, 0x60, 0x00, 0x80, 0x0B, 0x60, 0x00, 0x60, 0x0A, 0x60, 0x00, 0x60, 0x0B, 0x60, 0x00 - -ov12_0226D450: ; 0x0226D450 - .byte 0x00, 0x00 - -ov12_0226D452: ; 0x0226D452 - .byte 0x00, 0x00 - -ov12_0226D454: ; 0x0226D454 - .byte 0x00, 0x0D - -ov12_0226D456: ; 0x0226D456 - .byte 0x60, 0x00, 0x20, 0x06, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x60, 0x00, 0x20, 0x06, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x60, 0x00, 0x20, 0x06, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00 - -ov12_0226D480: ; 0x0226D480 - .byte 0xE0, 0x04 - -ov12_0226D482: ; 0x0226D482 - .byte 0x00, 0x00, 0x20, 0x0C, 0xC0, 0x00, 0xE0, 0x04, 0x20, 0x00, 0x00, 0x0C, 0xA0, 0x00 - .byte 0xE0, 0x04, 0x00, 0x00, 0x00, 0x0C, 0xC0, 0x00, 0xE0, 0x04, 0x20, 0x00, 0x00, 0x0C, 0xA0, 0x00 - .byte 0xE0, 0x04, 0x00, 0x00, 0x00, 0x0C, 0xC0, 0x00, 0xE0, 0x04, 0x20, 0x00, 0x00, 0x0C, 0xA0, 0x00 - -ov12_0226D4B0: ; 0x0226D4B0 - .byte 0x60, 0x0A - -ov12_0226D4B2: ; 0x0226D4B2 - .byte 0x40, 0x00 - -ov12_0226D4B4: ; 0x0226D4B4 - .byte 0x60, 0x0B - -ov12_0226D4B6: ; 0x0226D4B6 - .byte 0x40, 0x00, 0x20, 0x0A, 0x40, 0x00, 0x20, 0x0B, 0x40, 0x00 - .byte 0x40, 0x0A, 0x40, 0x00, 0x40, 0x0B, 0x40, 0x00, 0x20, 0x0A, 0x40, 0x00, 0x20, 0x0B, 0x40, 0x00 - .byte 0x40, 0x0A, 0x40, 0x00, 0x40, 0x0B, 0x40, 0x00, 0x20, 0x0A, 0x40, 0x00, 0x20, 0x0B, 0x40, 0x00 - -ov12_0226D4E0: ; 0x0226D4E0 - .byte 0xC0, 0x00, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x01, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x26, 0x4E, 0x00, 0x00, 0xC7, 0x00, 0x00, 0x00 - .byte 0xC6, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - -ov12_0226D514: ; 0x0226D514 - .byte 0x40, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xC2, 0x00, 0x00, 0x00, 0x26, 0x4E, 0x00, 0x00 - .byte 0xC1, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -ov12_0226D548: ; 0x0226D548 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00 - .byte 0x26, 0x4E, 0x00, 0x00, 0xB8, 0x00, 0x00, 0x00, 0xB7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -ov12_0226D57C: ; 0x0226D57C - .byte 0xC6, 0x00, 0x84, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 - .byte 0xCB, 0x00, 0x00, 0x00, 0x26, 0x4E, 0x00, 0x00, 0xCA, 0x00, 0x00, 0x00, 0xC9, 0x00, 0x00, 0x00 - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -ov12_0226D5B0: ; 0x0226D5B0 - .byte 0xC0, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x01, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x00, 0x00, 0x28, 0x4E, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00 - .byte 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - -ov12_0226D5E4: ; 0x0226D5E4 - .byte 0xC0, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xBF, 0x00, 0x00, 0x00, 0x26, 0x4E, 0x00, 0x00 - .byte 0xBE, 0x00, 0x00, 0x00, 0xBD, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -ov12_0226D618: ; 0x0226D618 - .byte 0x3A, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xBC, 0x00, 0x00, 0x00 - .byte 0x26, 0x4E, 0x00, 0x00, 0xBB, 0x00, 0x00, 0x00, 0xBA, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -ov12_0226D64C: ; 0x0226D64C - .byte 0x3A, 0x00, 0x2D, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 - .byte 0xC5, 0x00, 0x00, 0x00, 0x26, 0x4E, 0x00, 0x00, 0xC4, 0x00, 0x00, 0x00, 0xC3, 0x00, 0x00, 0x00 - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -ov12_0226D680: ; 0x0226D680 - .byte 0x60, 0x02 - -ov12_0226D682: ; 0x0226D682 - .byte 0xA0, 0x00 - -ov12_0226D684: ; 0x0226D684 - .byte 0x60, 0x03 - -ov12_0226D686: ; 0x0226D686 - .byte 0xA0, 0x00 - -ov12_0226D688: ; 0x0226D688 - .byte 0x00, 0x0A - -ov12_0226D68A: ; 0x0226D68A - .byte 0x60, 0x00 - -ov12_0226D68C: ; 0x0226D68C - .byte 0x00, 0x0B - -ov12_0226D68E: ; 0x0226D68E - .byte 0x60, 0x00 - .byte 0x20, 0x02, 0xE0, 0x00, 0x20, 0x03, 0xE0, 0x00, 0x00, 0x0A, 0x20, 0x00, 0x00, 0x0B, 0x20, 0x00 - .byte 0x40, 0x02, 0xC0, 0x00, 0x40, 0x03, 0xC0, 0x00, 0x00, 0x0A, 0x40, 0x00, 0x00, 0x0B, 0x40, 0x00 - .byte 0x20, 0x02, 0xE0, 0x00, 0x20, 0x03, 0xE0, 0x00, 0x00, 0x0A, 0x20, 0x00, 0x00, 0x0B, 0x20, 0x00 - .byte 0x40, 0x02, 0xC0, 0x00, 0x40, 0x03, 0xC0, 0x00, 0x00, 0x0A, 0x40, 0x00, 0x00, 0x0B, 0x40, 0x00 - .byte 0x20, 0x02, 0xE0, 0x00, 0x20, 0x03, 0xE0, 0x00, 0x00, 0x0A, 0x20, 0x00, 0x00, 0x0B, 0x20, 0x00 - -ov12_0226D6E0: ; 0x0226D6E0 - .byte 0xE3, 0xEE, 0xEE, 0xEE, 0xEE, 0x88, 0x8E, 0xE8, 0xEE, 0x88, 0x8E, 0xE8, 0xEE, 0x88, 0x88, 0xE8 - .byte 0xEE, 0x88, 0x8E, 0xE8, 0xEE, 0x88, 0x8E, 0xE8, 0xE3, 0xEE, 0xEE, 0xEE, 0x32, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0x88, 0x88, 0xE8, 0xEE, 0x88, 0x8E, 0xE8, 0xEE, 0x88, 0x88, 0xE8, 0xEE - .byte 0x88, 0xEE, 0xEE, 0xEE, 0x88, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x22, 0x22, 0x22, 0x22, 0x44, 0x44, 0x44, 0x44 - .byte 0x44, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x25, 0x22, 0x22, 0x22, 0x46, 0x44, 0x44, 0x44 - .byte 0x46, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x22, 0x22, 0x22, 0x66, 0x44, 0x44, 0x44 - .byte 0x66, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x25, 0x22, 0x22, 0x66, 0x46, 0x44, 0x44 - .byte 0x66, 0x46, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x55, 0x22, 0x22, 0x66, 0x66, 0x44, 0x44 - .byte 0x66, 0x66, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x55, 0x25, 0x22, 0x66, 0x66, 0x46, 0x44 - .byte 0x66, 0x66, 0x46, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x55, 0x55, 0x22, 0x66, 0x66, 0x66, 0x44 - .byte 0x66, 0x66, 0x66, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x55, 0x55, 0x25, 0x66, 0x66, 0x66, 0x46 - .byte 0x66, 0x66, 0x66, 0x46, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x55, 0x55, 0x55, 0x66, 0x66, 0x66, 0x66 - .byte 0x66, 0x66, 0x66, 0x66, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x22, 0x22, 0x22, 0x22, 0x44, 0x44, 0x44, 0x44 - .byte 0x44, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x27, 0x22, 0x22, 0x22, 0x48, 0x44, 0x44, 0x44 - .byte 0x48, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x77, 0x22, 0x22, 0x22, 0x88, 0x44, 0x44, 0x44 - .byte 0x88, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x77, 0x27, 0x22, 0x22, 0x88, 0x48, 0x44, 0x44 - .byte 0x88, 0x48, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x77, 0x77, 0x22, 0x22, 0x88, 0x88, 0x44, 0x44 - .byte 0x88, 0x88, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x77, 0x77, 0x27, 0x22, 0x88, 0x88, 0x48, 0x44 - .byte 0x88, 0x88, 0x48, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x77, 0x77, 0x77, 0x22, 0x88, 0x88, 0x88, 0x44 - .byte 0x88, 0x88, 0x88, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x77, 0x77, 0x77, 0x27, 0x88, 0x88, 0x88, 0x48 - .byte 0x88, 0x88, 0x88, 0x48, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x77, 0x77, 0x77, 0x77, 0x88, 0x88, 0x88, 0x88 - .byte 0x88, 0x88, 0x88, 0x88, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x22, 0x22, 0x22, 0x22, 0x44, 0x44, 0x44, 0x44 - .byte 0x44, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x29, 0x22, 0x22, 0x22, 0x4A, 0x44, 0x44, 0x44 - .byte 0x4A, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x99, 0x22, 0x22, 0x22, 0xAA, 0x44, 0x44, 0x44 - .byte 0xAA, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x99, 0x29, 0x22, 0x22, 0xAA, 0x4A, 0x44, 0x44 - .byte 0xAA, 0x4A, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x99, 0x99, 0x22, 0x22, 0xAA, 0xAA, 0x44, 0x44 - .byte 0xAA, 0xAA, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x99, 0x99, 0x29, 0x22, 0xAA, 0xAA, 0x4A, 0x44 - .byte 0xAA, 0xAA, 0x4A, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x99, 0x99, 0x99, 0x22, 0xAA, 0xAA, 0xAA, 0x44 - .byte 0xAA, 0xAA, 0xAA, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x99, 0x99, 0x99, 0x29, 0xAA, 0xAA, 0xAA, 0x4A - .byte 0xAA, 0xAA, 0xAA, 0x4A, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAA, 0xAA, 0xAA - .byte 0xAA, 0xAA, 0xAA, 0xAA, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0x33, 0x33, 0x33, 0x33, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x22, 0x22, 0x22, 0x22 - .byte 0x44, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x44, 0x44, 0x44, 0x44 - .byte 0x33, 0x33, 0x33, 0x33, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x2B, 0x22, 0x22, 0x22 - .byte 0x4C, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x44, 0x44, 0x44, 0x44 - .byte 0x33, 0x33, 0x33, 0x33, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xBB, 0x22, 0x22, 0x22 - .byte 0xCC, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x44, 0x44, 0x44, 0x44 - .byte 0x33, 0x33, 0x33, 0x33, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xBB, 0x2B, 0x22, 0x22 - .byte 0xCC, 0x4C, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x44, 0x44, 0x44, 0x44 - .byte 0x33, 0x33, 0x33, 0x33, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xBB, 0xBB, 0x22, 0x22 - .byte 0xCC, 0xCC, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x44, 0x44, 0x44, 0x44 - .byte 0x33, 0x33, 0x33, 0x33, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xBB, 0xBB, 0x2B, 0x22 - .byte 0xCC, 0xCC, 0x4C, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x44, 0x44, 0x44, 0x44 - .byte 0x33, 0x33, 0x33, 0x33, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xBB, 0xBB, 0xBB, 0x22 - .byte 0xCC, 0xCC, 0xCC, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x44, 0x44, 0x44, 0x44 - .byte 0x33, 0x33, 0x33, 0x33, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xBB, 0xBB, 0xBB, 0x2B - .byte 0xCC, 0xCC, 0xCC, 0x4C, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x44, 0x44, 0x44, 0x44 - .byte 0x33, 0x33, 0x33, 0x33, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xBB, 0xBB, 0xBB, 0xBB - .byte 0xCC, 0xCC, 0xCC, 0xCC, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x44, 0x44, 0x44, 0x44 - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22, 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22 - .byte 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22, 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22 - .byte 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22, 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22 - .byte 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 - .byte 0xFF, 0x88, 0x88, 0x88, 0x82, 0x48, 0x44, 0x44, 0x8F, 0x48, 0x77, 0x47, 0x82, 0x48, 0x87, 0x48 - .byte 0x82, 0x48, 0x44, 0x44, 0x82, 0x48, 0x77, 0x77, 0x82, 0x48, 0x87, 0x88, 0x22, 0x78, 0x87, 0x88 - .byte 0x88, 0x88, 0x88, 0x88, 0x47, 0x44, 0x44, 0x47, 0x47, 0x77, 0x47, 0x47, 0x47, 0x87, 0x48, 0x47 - .byte 0x47, 0x44, 0x44, 0x47, 0x47, 0x77, 0x47, 0x47, 0x48, 0x87, 0x48, 0x47, 0x78, 0x87, 0x78, 0x77 - .byte 0x88, 0x88, 0x88, 0xFF, 0x44, 0x74, 0x88, 0x28, 0x77, 0x47, 0x87, 0xF8, 0x87, 0x48, 0x87, 0x28 - .byte 0x44, 0x44, 0x87, 0x28, 0x47, 0x77, 0x87, 0x28, 0x47, 0x44, 0x87, 0x28, 0x77, 0x77, 0x87, 0x22 - .byte 0xFF, 0xCC, 0xCC, 0xCC, 0xC2, 0x4C, 0x44, 0x44, 0xCF, 0x4C, 0xBB, 0xBB, 0xC2, 0x4C, 0x44, 0x44 - .byte 0xC2, 0x4C, 0xBB, 0xBB, 0xC2, 0x4C, 0xCB, 0xCC, 0xC2, 0x4C, 0xCB, 0xCC, 0x22, 0xBC, 0xCB, 0xCC - .byte 0xCC, 0xCC, 0xCC, 0xCC, 0x4B, 0x44, 0xB4, 0x4C, 0x4B, 0xBB, 0x4B, 0xBB, 0x4B, 0xCB, 0x4C, 0xCB - .byte 0x4B, 0x44, 0x44, 0x4B, 0x4C, 0x4B, 0xBB, 0x4B, 0x4C, 0x4B, 0x44, 0x4B, 0xBC, 0xBB, 0xBB, 0xBB - .byte 0xCC, 0xCC, 0xCC, 0xFF, 0x44, 0x44, 0xCB, 0x2C, 0xBB, 0x4B, 0xCB, 0xFC, 0x44, 0xB4, 0xCB, 0x2C - .byte 0xBB, 0xBB, 0xCC, 0x2C, 0xCB, 0xCC, 0xCC, 0x2C, 0x44, 0x44, 0xCB, 0x2C, 0xBB, 0xBB, 0xCB, 0x22 - .byte 0xFF, 0x33, 0x33, 0x33, 0x32, 0x43, 0x44, 0x44, 0x3F, 0x43, 0x11, 0x11, 0x32, 0x43, 0x44, 0x44 - .byte 0x32, 0x13, 0x11, 0x41, 0x32, 0x33, 0x33, 0x43, 0x32, 0x43, 0x44, 0x44, 0x22, 0x13, 0x11, 0x11 - .byte 0x33, 0x33, 0x33, 0x33, 0x41, 0x31, 0x33, 0x43, 0x41, 0x31, 0x33, 0x43, 0x41, 0x31, 0x33, 0x43 - .byte 0x41, 0x31, 0x33, 0x43, 0x41, 0x31, 0x33, 0x43, 0x41, 0x44, 0x44, 0x41, 0x11, 0x11, 0x11, 0x11 - .byte 0x33, 0x33, 0x33, 0xFF, 0x44, 0x44, 0x31, 0x23, 0x11, 0x41, 0x31, 0xF3, 0x31, 0x43, 0x31, 0x23 - .byte 0x44, 0x44, 0x31, 0x23, 0x11, 0x11, 0x31, 0x23, 0x31, 0x33, 0x33, 0x23, 0x31, 0x33, 0x33, 0x22 - .byte 0xFF, 0xDD, 0xDD, 0xDD, 0xD2, 0x4D, 0x44, 0x44, 0xDF, 0x4D, 0x99, 0x49, 0xD2, 0x4D, 0xD9, 0x4D - .byte 0xD2, 0x4D, 0x44, 0x44, 0xD2, 0x4D, 0x99, 0x99, 0xD2, 0x4D, 0xD9, 0xDD, 0x22, 0x9D, 0xD9, 0xDD - .byte 0xDD, 0xDD, 0xDD, 0xDD, 0x49, 0x44, 0x44, 0x49, 0x49, 0x99, 0x99, 0x49, 0x49, 0x44, 0x44, 0x49 - .byte 0x99, 0x99, 0x49, 0x49, 0xD9, 0xDD, 0x4D, 0x49, 0x4D, 0x44, 0x44, 0x49, 0x9D, 0x99, 0x99, 0x99 - .byte 0xDD, 0xDD, 0xDD, 0xFF, 0x44, 0x49, 0xD9, 0x2D, 0x49, 0x49, 0xD9, 0xFD, 0x49, 0x49, 0xD9, 0x2D - .byte 0x49, 0x49, 0xD9, 0x2D, 0x49, 0x49, 0xD9, 0x2D, 0x49, 0x44, 0xD9, 0x2D, 0x99, 0x99, 0xD9, 0x22 - .byte 0xFF, 0xAA, 0xAA, 0xAA, 0xA2, 0x4A, 0x44, 0x94, 0xAF, 0x4A, 0x99, 0x49, 0xA2, 0x4A, 0x44, 0x44 - .byte 0xA2, 0x4A, 0x99, 0x49, 0xA2, 0x4A, 0xA9, 0x4A, 0xA2, 0x4A, 0x44, 0x44, 0x22, 0x9A, 0x99, 0x99 - .byte 0xAA, 0xAA, 0xAA, 0xAA, 0x4A, 0x44, 0x94, 0x4A, 0x49, 0x99, 0x49, 0x49, 0x49, 0xA9, 0x4A, 0x49 - .byte 0x49, 0x44, 0x44, 0x49, 0x49, 0x49, 0x99, 0x49, 0x49, 0x49, 0x44, 0x49, 0x99, 0x99, 0x99, 0x99 - .byte 0xAA, 0xAA, 0xAA, 0xFF, 0x44, 0x49, 0xA9, 0x2A, 0x49, 0x49, 0xA9, 0xFA, 0x49, 0x49, 0xA9, 0x2A - .byte 0x49, 0x49, 0xA9, 0x2A, 0x49, 0x49, 0xA9, 0x2A, 0x49, 0x44, 0xA9, 0x2A, 0x99, 0x99, 0xA9, 0x22 - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22, 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22 - .byte 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22, 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22 - .byte 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22, 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22 - .byte 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 - .byte 0x2F, 0xEE, 0x2E, 0xFF, 0xE2, 0xAA, 0xEA, 0x22, 0xAE, 0xE9, 0xA9, 0xFE, 0xEE, 0x4E, 0xEE, 0x2E - .byte 0x4E, 0xE2, 0x42, 0x2E, 0xE3, 0x44, 0xE4, 0x23, 0x32, 0xEE, 0x3E, 0x22, 0x22, 0x22, 0x22, 0x22 - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xAA, 0xF2, 0xFF - .byte 0x2A, 0x22, 0x2A, 0xFF, 0x2A, 0xFF, 0x2A, 0xEF, 0xA2, 0xAA, 0x22, 0xEF, 0x2F, 0x2A, 0xF2, 0xEF - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0x2E, 0xFF, 0xFF, 0xFF, 0x2E, 0xFF, 0xFF, 0xFF, 0x2E, 0xEF, 0x2E, 0x2E - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2B, 0xFF, 0xFF - .byte 0xBF, 0xBB, 0xF2, 0xFF, 0x2B, 0x2B, 0x2B, 0xEF, 0xF2, 0x2B, 0x22, 0xEF, 0xBF, 0xBB, 0xF2, 0xEF - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0x2E, 0xFF, 0xFF, 0xFF, 0x2E, 0xFF, 0xFF, 0xFF, 0x2E, 0xEF, 0x2E, 0x2E - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xEF - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0x2E, 0xFF, 0xFF, 0xFF, 0x2E, 0xFF, 0xFF, 0xFF, 0x2E, 0xEF, 0x2E, 0x2E - .byte 0xE3, 0xEE, 0xEE, 0xEE, 0xEE, 0x88, 0x8E, 0xE8, 0xEE, 0x88, 0x8E, 0xE8, 0xEE, 0x88, 0x88, 0xE8 - .byte 0xEE, 0x88, 0x8E, 0xE8, 0xEE, 0x88, 0x8E, 0xE8, 0xE3, 0xEE, 0xEE, 0xEE, 0x32, 0x33, 0x33, 0x33 - .byte 0xEE, 0xEE, 0xEE, 0xEE, 0x88, 0x88, 0xE8, 0xEE, 0x88, 0x8E, 0xE8, 0xEE, 0x88, 0x88, 0xE8, 0xEE - .byte 0x88, 0xEE, 0xEE, 0xEE, 0x88, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33 - .byte 0x3E, 0xFF, 0xFF, 0xFF, 0xEE, 0x22, 0x22, 0x22, 0xEE, 0xFF, 0xFF, 0xFF, 0xEE, 0x22, 0x22, 0x22 - .byte 0xEE, 0x22, 0x22, 0x22, 0xEE, 0x22, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x22, 0x23, 0x22, 0x22, 0x22 - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFE, 0xFF, 0xFF, 0xEE, 0xF2, 0xFF, 0xEF, 0x2E, 0xF2 - .byte 0xFF, 0xEE, 0x22, 0xFF, 0xEF, 0x2E, 0xF2, 0xFF, 0xEF, 0x22, 0xFF, 0xFF, 0x2F, 0xF2, 0xFF, 0xFF - .byte 0xEE, 0xEE, 0xEE, 0xF3, 0x88, 0x88, 0xE8, 0xFE, 0x88, 0x8E, 0xE8, 0xFE, 0x88, 0x88, 0xE8, 0xFE - .byte 0x88, 0xEE, 0xEE, 0xFE, 0x88, 0xEE, 0xEE, 0xFE, 0xEE, 0xEE, 0xEE, 0xF3, 0x33, 0x33, 0x33, 0xFF - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - .byte 0xAA, 0xAA, 0x2A, 0xEF, 0x22, 0x2A, 0x22, 0xEF, 0xFF, 0x2A, 0xFF, 0xEF, 0xFF, 0x22, 0xFF, 0x2F - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - .byte 0x2E, 0xEF, 0x2E, 0x2E, 0x2E, 0xEF, 0x2E, 0x2E, 0xEE, 0x2E, 0xEE, 0x22, 0x22, 0x22, 0x22, 0xF2 - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - .byte 0x2B, 0x22, 0x2B, 0xEF, 0x2B, 0xFF, 0x2B, 0xEF, 0xB2, 0xBB, 0x22, 0xEF, 0x2F, 0x22, 0xF2, 0x2F - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - .byte 0x2E, 0xE4, 0x2E, 0x2E, 0x2E, 0xE4, 0x2E, 0x2E, 0xEE, 0x2E, 0xEE, 0x22, 0x22, 0x22, 0x22, 0xF2 - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - .byte 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0x2F - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - .byte 0x2E, 0xE4, 0x2E, 0x2E, 0x2E, 0xE4, 0x2E, 0x2E, 0xEE, 0x2E, 0xEE, 0x22, 0x22, 0x22, 0x22, 0xF2 - .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF diff --git a/asm/overlay_14.s b/asm/overlay_14.s index 18c28783bb..db7de131d1 100644 --- a/asm/overlay_14.s +++ b/asm/overlay_14.s @@ -30846,7 +30846,7 @@ ov14_021F4D10: ; 0x021F4D10 lsl r0, r0, #2 ldr r0, [r4, r0] ldr r1, _021F4E5C ; =0x0000C101 - bl sub_0200D934 + bl GfGfxHandler_GetPlttProxy str r0, [sp, #0x14] mov r0, #0xc6 lsl r0, r0, #2 @@ -30914,7 +30914,7 @@ ov14_021F4D10: ; 0x021F4D10 lsl r0, r0, #2 ldr r0, [r4, r0] ldr r1, _021F4E5C ; =0x0000C101 - bl sub_0200D934 + bl GfGfxHandler_GetPlttProxy str r0, [sp, #0x14] mov r0, #0xc6 lsl r0, r0, #2 diff --git a/asm/overlay_18.s b/asm/overlay_18.s index 5fd583f889..f03ef028be 100644 --- a/asm/overlay_18.s +++ b/asm/overlay_18.s @@ -23188,7 +23188,7 @@ ov18_021F14B4: ; 0x021F14B4 ldr r1, _021F14F8 ; =0x0000C550 mov r2, #1 add r6, r3, #0 - bl sub_0200D944 + bl GfGfxHandler_GetPlttNumById mov r3, #1 add r7, r0, #0 str r3, [sp] @@ -23262,7 +23262,7 @@ ov18_021F1534: ; 0x021F1534 ldr r1, _021F1594 ; =0x0000C551 ldr r0, [r5, r0] mov r2, #2 - bl sub_0200D944 + bl GfGfxHandler_GetPlttNumById add r6, r0, #0 ldr r1, [sp, #4] add r0, r7, #0 @@ -24290,7 +24290,7 @@ ov18_021F1D98: ; 0x021F1D98 ldr r1, _021F1DE0 ; =0x0000C55B ldr r0, [r6, r0] mov r2, #2 - bl sub_0200D944 + bl GfGfxHandler_GetPlttNumById add r1, r0, #0 ldr r0, [r5, r4] bl UnkImageStruct_SetSpritePalIndex @@ -24819,7 +24819,7 @@ ov18_021F21FC: ; 0x021F21FC ldr r1, _021F226C ; =0x0000C558 ldr r0, [r5, r0] mov r2, #2 - bl sub_0200D944 + bl GfGfxHandler_GetPlttNumById add r6, r0, #0 ldr r0, [sp, #4] bl ov18_021F9688 @@ -25113,7 +25113,7 @@ _021F248A: ldr r1, _021F24D8 ; =0x0000C55A ldr r0, [r7, r0] mov r2, #2 - bl sub_0200D944 + bl GfGfxHandler_GetPlttNumById add r1, r0, #0 mov r0, #0x67 lsl r0, r0, #4 @@ -26783,7 +26783,7 @@ _021F3214: ldr r1, _021F3290 ; =0x0000C55A ldr r0, [r5, r0] mov r2, #2 - bl sub_0200D944 + bl GfGfxHandler_GetPlttNumById add r1, r0, #0 mov r0, #0x67 lsl r0, r0, #4 @@ -38793,7 +38793,7 @@ ov18_021F8FF8: ; 0x021F8FF8 lsl r0, r0, #2 ldr r0, [r4, r0] mov r1, #1 - bl sub_0200B12C + bl GF_PlttResObj_GetVramSlotNum add r2, r0, #0 lsl r2, r2, #0x14 ldr r0, [r4, #4] @@ -38883,7 +38883,7 @@ ov18_021F9068: ; 0x021F9068 lsl r0, r0, #2 ldr r0, [r4, r0] mov r1, #1 - bl sub_0200B12C + bl GF_PlttResObj_GetVramSlotNum add r2, r0, #0 lsl r2, r2, #0x14 ldr r0, [r4, #4] @@ -38982,7 +38982,7 @@ ov18_021F9150: ; 0x021F9150 str r0, [r5, r1] ldr r0, [r5, r1] mov r1, #1 - bl sub_0200B12C + bl GF_PlttResObj_GetVramSlotNum add r2, r0, #0 lsl r2, r2, #0x14 ldr r0, [r5, #4] diff --git a/asm/overlay_40.s b/asm/overlay_40.s index e206600f8d..7204830234 100644 --- a/asm/overlay_40.s +++ b/asm/overlay_40.s @@ -3511,7 +3511,7 @@ _0222D2E6: ldr r1, [sp, #0xc] ldr r0, [r6, #0x1c] ldr r1, [r1] - bl sub_0200D934 + bl GfGfxHandler_GetPlttProxy str r0, [sp, #0x58] ldr r0, [r4] add r1, sp, #0x20 @@ -3845,7 +3845,7 @@ _0222D5BE: str r0, [sp, #0x24] ldr r0, [r4, #8] add r1, r6, #0 - bl sub_0200D934 + bl GfGfxHandler_GetPlttProxy str r0, [sp, #0x28] ldr r0, [r5, #4] add r1, sp, #8 diff --git a/asm/overlay_41.s b/asm/overlay_41.s index 56ab2c0098..8ea2275cb3 100644 --- a/asm/overlay_41.s +++ b/asm/overlay_41.s @@ -9928,7 +9928,7 @@ ov41_0224A734: ; 0x0224A734 ldr r0, [r4, #0x4c] bl Get2DGfxResObjById mov r1, #0 - bl sub_0200B0F8 + bl GF_PlttResObj_GetPlttProxy str r0, [sp, #0x98] ldr r0, [sp, #0xb8] mov r1, #1 diff --git a/asm/overlay_42.s b/asm/overlay_42.s index 21930cec02..2d53d1fff6 100644 --- a/asm/overlay_42.s +++ b/asm/overlay_42.s @@ -1975,11 +1975,11 @@ ov42_02227E78: ; 0x02227E78 str r0, [sp, #4] add r0, r6, #0 mov r1, #1 - bl sub_0200B12C + bl GF_PlttResObj_GetVramSlotNum add r7, r0, #0 add r0, r6, #0 mov r1, #2 - bl sub_0200B12C + bl GF_PlttResObj_GetVramSlotNum add r6, r0, #0 mov r0, #0 mvn r0, r0 diff --git a/asm/overlay_44.s b/asm/overlay_44.s index 71d88b9fcd..94e89f6aeb 100644 --- a/asm/overlay_44.s +++ b/asm/overlay_44.s @@ -14918,7 +14918,7 @@ _02231604: str r0, [sp, #0x40] ldr r0, _0223168C ; =0x00000D2C ldr r0, [r5, r0] - bl sub_0200B0F8 + bl GF_PlttResObj_GetPlttProxy str r0, [sp, #0x44] ldr r0, _022316A4 ; =0x00000D3C ldr r1, [r5, r0] diff --git a/asm/overlay_57.s b/asm/overlay_57.s index 7ec117cb35..b4801bd1d5 100644 --- a/asm/overlay_57.s +++ b/asm/overlay_57.s @@ -2004,7 +2004,7 @@ ov57_022387E0: ; 0x022387E0 add r0, #0xe0 ldr r0, [r0] ldr r1, _022388E0 ; =0x00007530 - bl sub_0200D934 + bl GfGfxHandler_GetPlttProxy str r0, [sp, #0x38] mov r2, #0 mov r0, #0x9b diff --git a/asm/overlay_80_0223A00C.s b/asm/overlay_80_0223A00C.s index 8d0b83f6b7..fcb6a09e5d 100644 --- a/asm/overlay_80_0223A00C.s +++ b/asm/overlay_80_0223A00C.s @@ -849,7 +849,7 @@ _0223A6D6: str r0, [sp, #0x54] ldr r0, [sp, #0x20] ldr r1, [sp, #0x98] - bl sub_0200D934 + bl GfGfxHandler_GetPlttProxy mov r1, #0 str r0, [sp, #0x58] ldr r0, [sp, #0x34] diff --git a/asm/overlay_89.s b/asm/overlay_89.s index fb6e1f5d6e..47350cdd70 100644 --- a/asm/overlay_89.s +++ b/asm/overlay_89.s @@ -3232,7 +3232,7 @@ _0225A2E6: str r0, [sp, #0x50] ldr r1, [sp, #0x98] add r0, r7, #0 - bl sub_0200D934 + bl GfGfxHandler_GetPlttProxy mov r1, #0 str r0, [sp, #0x54] ldr r0, [sp, #0x30] diff --git a/asm/overlay_90.s b/asm/overlay_90.s index cad3caced4..835ef49236 100644 --- a/asm/overlay_90.s +++ b/asm/overlay_90.s @@ -658,7 +658,7 @@ ov90_02258C74: ; 0x02258C74 ldr r1, _02258C88 ; =0x00001388 bl Get2DGfxResObjById mov r1, #1 - bl sub_0200B12C + bl GF_PlttResObj_GetVramSlotNum pop {r3, pc} nop _02258C88: .word 0x00001388 diff --git a/asm/overlay_91.s b/asm/overlay_91.s index 80a52ac29e..dde14c220c 100644 --- a/asm/overlay_91.s +++ b/asm/overlay_91.s @@ -10689,7 +10689,7 @@ _022616FA: ldr r0, [r4, #0x1c] str r0, [sp, #0x34] ldr r0, [r5, #0x60] - bl sub_0200B0F8 + bl GF_PlttResObj_GetPlttProxy str r0, [sp, #0x38] ldr r0, [r5, #0x34] str r0, [sp, #0x3c] diff --git a/asm/overlay_93_thumb_2.s b/asm/overlay_93_thumb_2.s index 9641d97407..0267a5e946 100644 --- a/asm/overlay_93_thumb_2.s +++ b/asm/overlay_93_thumb_2.s @@ -2222,7 +2222,7 @@ ov93_02260CF8: ; 0x02260CF8 ldr r0, [r7, #0x28] ldr r1, _02260E10 ; =0x00002716 mov r2, #2 - bl sub_0200D944 + bl GfGfxHandler_GetPlttNumById str r0, [sp, #0xc] mov r0, #0 str r0, [sp, #0x18] @@ -2372,7 +2372,7 @@ ov93_02260E1C: ; 0x02260E1C ldr r0, [r5, #0x28] ldr r1, _02260F08 ; =0x00002716 mov r2, #2 - bl sub_0200D944 + bl GfGfxHandler_GetPlttNumById str r0, [sp, #4] mov r0, #0 str r0, [sp, #0x10] @@ -4569,7 +4569,7 @@ _02261F42: str r0, [sp, #0x48] ldr r0, [sp, #0x1c] ldr r1, [sp, #0x98] - bl sub_0200D934 + bl GfGfxHandler_GetPlttProxy str r0, [sp, #0x4c] mov r0, #0 str r0, [sp, #0x50] diff --git a/asm/overlay_96.s b/asm/overlay_96.s index 5ff63859ba..07ee41024c 100644 --- a/asm/overlay_96.s +++ b/asm/overlay_96.s @@ -6930,7 +6930,7 @@ _021E8C14: ldr r0, [r6, r0] add r0, r0, r5 ldr r0, [r0, #4] - bl sub_0200B0F8 + bl GF_PlttResObj_GetPlttProxy add r5, r0, #0 add r0, r7, #0 mov r1, #0x20 @@ -7071,7 +7071,7 @@ _021E8CC2: str r0, [sp, #0x24] ldr r0, [r4, #4] ldr r1, [sp, #0x24] - bl sub_0200B0F8 + bl GF_PlttResObj_GetPlttProxy str r0, [sp, #0x28] ldr r0, [r4] bl GF2DGfxResObj_GetCharDataPtr @@ -30732,7 +30732,7 @@ _021F4420: add r7, r0, #0 ldr r0, [sp, #4] add r1, r7, #0 - bl sub_0200B0F8 + bl GF_PlttResObj_GetPlttProxy str r0, [sp, #0xc] add r0, r7, #0 mov r1, #2 @@ -40043,7 +40043,7 @@ ov96_021F8DF4: ; 0x021F8DF4 mov r0, #0xb1 lsl r0, r0, #2 ldr r0, [r5, r0] - bl sub_0200B0F8 + bl GF_PlttResObj_GetPlttProxy str r0, [sp, #0x34] ldr r0, [sp, #0x78] str r0, [sp, #0x38] @@ -55972,7 +55972,7 @@ _02200D90: add r6, r0, #0 add r0, r5, #0 add r1, r6, #0 - bl sub_0200B0F8 + bl GF_PlttResObj_GetPlttProxy str r0, [sp, #8] ldr r1, [sp] ldr r0, [sp, #4] @@ -62143,7 +62143,7 @@ ov96_02203F50: ; 0x02203F50 add r7, r0, #0 add r0, r5, #0 add r1, r7, #0 - bl sub_0200B0F8 + bl GF_PlttResObj_GetPlttProxy str r0, [sp] mov r4, #0 _02203F80: @@ -71471,7 +71471,7 @@ _022089E4: add r6, r0, #0 add r0, r5, #0 add r1, r6, #0 - bl sub_0200B0F8 + bl GF_PlttResObj_GetPlttProxy str r0, [sp, #8] ldr r1, [sp] ldr r0, [sp, #4] diff --git a/asm/overlay_97.s b/asm/overlay_97.s index 9ef90202ed..6164fd8960 100644 --- a/asm/overlay_97.s +++ b/asm/overlay_97.s @@ -2710,7 +2710,7 @@ ov97_0221FBA0: ; 0x0221FBA0 add r6, r0, #0 add r0, r4, #0 add r1, r6, #0 - bl sub_0200B0F8 + bl GF_PlttResObj_GetPlttProxy add r4, r0, #0 add r0, r6, #0 mov r1, #2 diff --git a/asm/render_window.s b/asm/render_window.s index e1e9dd8abd..7244076988 100644 --- a/asm/render_window.s +++ b/asm/render_window.s @@ -2572,7 +2572,7 @@ sub_0200F748: ; 0x0200F748 ldr r1, _0200F828 ; =0x00015CD5 bl Get2DGfxResObjById ldr r1, [sp, #4] - bl sub_0200B0F8 + bl GF_PlttResObj_GetPlttProxy mov r1, #1 bl NNS_G2dGetImagePaletteLocation add r5, r0, #0 diff --git a/asm/unk_0200CE7C.s b/asm/unk_0200CE7C.s deleted file mode 100644 index 476a35b516..0000000000 --- a/asm/unk_0200CE7C.s +++ /dev/null @@ -1,89 +0,0 @@ - .include "asm/macros.inc" - .include "unk_0200CE7C.inc" - .include "global.inc" - - .text - - thumb_func_start sub_0200CE7C -sub_0200CE7C: ; 0x0200CE7C - push {r3, r4, r5, r6, lr} - sub sp, #0xc - add r4, r2, #0 - ldr r2, [sp, #0x2c] - add r6, r3, #0 - str r2, [sp] - ldr r2, [sp, #0x24] - ldr r3, [sp, #0x28] - add r5, r0, #0 - bl sub_0200CDAC - ldr r0, [sp, #0x24] - ldr r3, [sp, #0x20] - str r0, [sp] - ldr r0, [sp, #0x28] - add r1, r4, #0 - add r0, #0x10 - str r0, [sp, #4] - ldr r0, [sp, #0x2c] - add r2, r6, #0 - str r0, [sp, #8] - add r0, r5, #0 - bl PrintUIntOnWindow - add sp, #0xc - pop {r3, r4, r5, r6, pc} - thumb_func_end sub_0200CE7C - - thumb_func_start sub_0200CEB0 -sub_0200CEB0: ; 0x0200CEB0 - push {r3, r4, r5, r6, r7, lr} - add r7, r0, #0 - add r4, r2, #0 - ldr r2, [r7, #0x28] - ldr r6, [sp, #0x18] - lsl r0, r2, #4 - orr r0, r2 - lsl r0, r0, #0x18 - lsr r0, r0, #0x18 - str r0, [sp] - add r0, r7, #0 - add r2, r3, #0 - add r0, #8 - add r3, r4, #0 - bl ConvertUIntToDecimalString - ldrh r1, [r7, #8] - ldr r0, _0200CF14 ; =0x0000FFFF - cmp r1, r0 - beq _0200CF10 - add r4, r7, #0 - mov r5, #0 -_0200CEDC: - ldrh r2, [r4, #8] - cmp r2, #0xa2 - blo _0200CEFA - cmp r2, #0xab - bhi _0200CEFA - ldr r0, [r7, #4] - sub r2, #0xa2 - ldr r1, [r0, #0x14] - lsl r0, r2, #5 - add r0, r1, r0 - add r1, r6, r5 - mov r2, #0x20 - bl MIi_CpuCopy32 - b _0200CF04 -_0200CEFA: - ldr r1, [sp] - add r0, r6, r5 - mov r2, #0x20 - bl MI_CpuFill8 -_0200CF04: - add r4, r4, #2 - ldrh r1, [r4, #8] - ldr r0, _0200CF14 ; =0x0000FFFF - add r5, #0x20 - cmp r1, r0 - bne _0200CEDC -_0200CF10: - pop {r3, r4, r5, r6, r7, pc} - nop -_0200CF14: .word 0x0000FFFF - thumb_func_end sub_0200CEB0 diff --git a/asm/unk_020863F4.s b/asm/unk_020863F4.s index ecae15b5f4..8565a37075 100644 --- a/asm/unk_020863F4.s +++ b/asm/unk_020863F4.s @@ -1738,7 +1738,7 @@ sub_02087090: ; 0x02087090 str r0, [sp, #0x34] ldr r0, [r5, r1] add r1, #0xf7 - bl sub_0200D934 + bl GfGfxHandler_GetPlttProxy str r0, [sp, #0x38] mov r1, #0 mov r0, #0xe2 diff --git a/asm/unk_0208805C.s b/asm/unk_0208805C.s deleted file mode 100644 index 837ed3c4f4..0000000000 --- a/asm/unk_0208805C.s +++ /dev/null @@ -1,348 +0,0 @@ -#include "constants/items.h" -#include "constants/moves.h" -#include "constants/pokemon.h" -#include "constants/ribbon.h" -#include "constants/party_menu.h" -#include "msgdata/msg/msg_0300.h" - .include "asm/macros.inc" - .include "unk_0208805C.inc" - .include "global.inc" - - .public gOverlayTemplate_Battle - .public gNatureStatMods - - .text - - thumb_func_start sub_0208805C -sub_0208805C: ; 0x0208805C - lsl r1, r0, #1 - ldr r0, _02088064 ; =_02103894 - ldrh r0, [r0, r1] - bx lr - .balign 4, 0 -_02088064: .word _02103894 - thumb_func_end sub_0208805C - - thumb_func_start CalculateHpBarPixelsLength -CalculateHpBarPixelsLength: ; 0x02088068 - push {r4, lr} - add r4, r0, #0 - mul r0, r2 - bl _u32_div_f - lsl r0, r0, #0x18 - lsr r0, r0, #0x18 - bne _0208807E - cmp r4, #0 - beq _0208807E - mov r0, #1 -_0208807E: - pop {r4, pc} - thumb_func_end CalculateHpBarPixelsLength - - thumb_func_start sub_02088080 -sub_02088080: ; 0x02088080 - push {r4, lr} - add r4, r0, #0 - lsl r0, r1, #8 - lsl r4, r4, #8 - lsr r1, r0, #1 - cmp r4, r1 - bls _02088092 - mov r0, #3 - pop {r4, pc} -_02088092: - mov r1, #5 - bl _u32_div_f - cmp r4, r0 - bls _020880A0 - mov r0, #2 - pop {r4, pc} -_020880A0: - cmp r4, #0 - beq _020880A8 - mov r0, #1 - b _020880AA -_020880A8: - mov r0, #0 -_020880AA: - lsl r0, r0, #0x18 - lsr r0, r0, #0x18 - pop {r4, pc} - thumb_func_end sub_02088080 - - thumb_func_start CalculateHpBarColor -CalculateHpBarColor: ; 0x020880B0 - push {r4, lr} - add r4, r2, #0 - cmp r0, r1 - bne _020880BC - mov r0, #4 - pop {r4, pc} -_020880BC: - lsl r2, r4, #0x18 - lsr r2, r2, #0x18 - bl CalculateHpBarPixelsLength - add r1, r4, #0 - bl sub_02088080 - pop {r4, pc} - thumb_func_end CalculateHpBarColor - - thumb_func_start sub_020880CC -sub_020880CC: ; 0x020880CC - push {lr} - sub sp, #0xc - cmp r0, #0 - bne _020880EC - mov r0, #6 - str r0, [sp] - mov r2, #1 - str r2, [sp, #4] - mov r0, #0 - str r1, [sp, #8] - add r1, r2, #0 - add r3, r0, #0 - bl BeginNormalPaletteFade - add sp, #0xc - pop {pc} -_020880EC: - mov r0, #6 - str r0, [sp] - mov r0, #1 - str r0, [sp, #4] - mov r0, #0 - str r1, [sp, #8] - mov r1, #8 - add r2, r0, #0 - add r3, r0, #0 - bl BeginNormalPaletteFade - add sp, #0xc - pop {pc} - .balign 4, 0 - thumb_func_end sub_020880CC - - thumb_func_start sub_02088108 -sub_02088108: ; 0x02088108 - push {r4, r5} - mov r5, #0 - ldrsh r3, [r0, r5] - cmp r2, #1 - bgt _0208812A - sub r4, r5, #1 - cmp r2, r4 - blt _02088120 - beq _02088130 - cmp r2, #1 - beq _02088174 - b _020881B8 -_02088120: - add r1, r5, #0 - sub r1, #0xa - cmp r2, r1 - beq _02088150 - b _020881B8 -_0208812A: - cmp r2, #0xa - beq _02088196 - b _020881B8 -_02088130: - sub r2, r3, #1 - strh r2, [r0] - ldrsh r2, [r0, r5] - cmp r2, #0 - bgt _0208813C - strh r1, [r0] -_0208813C: - mov r1, #0 - ldrsh r0, [r0, r1] - cmp r0, r3 - bne _0208814A - add r0, r1, #0 - pop {r4, r5} - bx lr -_0208814A: - mov r0, #2 - pop {r4, r5} - bx lr -_02088150: - add r1, r3, #0 - sub r1, #0xa - strh r1, [r0] - ldrsh r1, [r0, r5] - cmp r1, #0 - bgt _02088160 - mov r1, #1 - strh r1, [r0] -_02088160: - mov r1, #0 - ldrsh r0, [r0, r1] - cmp r0, r3 - bne _0208816E - add r0, r1, #0 - pop {r4, r5} - bx lr -_0208816E: - mov r0, #2 - pop {r4, r5} - bx lr -_02088174: - add r2, r3, #1 - strh r2, [r0] - ldrsh r2, [r0, r5] - cmp r2, r1 - ble _02088182 - mov r1, #1 - strh r1, [r0] -_02088182: - mov r1, #0 - ldrsh r0, [r0, r1] - cmp r0, r3 - bne _02088190 - add r0, r1, #0 - pop {r4, r5} - bx lr -_02088190: - mov r0, #1 - pop {r4, r5} - bx lr -_02088196: - add r2, r3, #0 - add r2, #0xa - strh r2, [r0] - ldrsh r2, [r0, r5] - cmp r2, r1 - ble _020881A4 - strh r1, [r0] -_020881A4: - mov r1, #0 - ldrsh r0, [r0, r1] - cmp r0, r3 - bne _020881B2 - add r0, r1, #0 - pop {r4, r5} - bx lr -_020881B2: - mov r0, #1 - pop {r4, r5} - bx lr -_020881B8: - mov r0, #0 - pop {r4, r5} - bx lr - .balign 4, 0 - thumb_func_end sub_02088108 - - thumb_func_start sub_020881C0 -sub_020881C0: ; 0x020881C0 - push {r4, lr} - ldr r2, _02088208 ; =gSystem - ldr r3, [r2, #0x4c] - mov r2, #0x40 - tst r2, r3 - beq _020881D4 - mov r2, #1 - bl sub_02088108 - pop {r4, pc} -_020881D4: - mov r2, #0x80 - add r4, r3, #0 - tst r4, r2 - beq _020881E4 - sub r2, #0x81 - bl sub_02088108 - pop {r4, pc} -_020881E4: - mov r2, #0x20 - add r4, r3, #0 - tst r4, r2 - beq _020881F4 - sub r2, #0x2a - bl sub_02088108 - pop {r4, pc} -_020881F4: - mov r2, #0x10 - tst r2, r3 - beq _02088202 - mov r2, #0xa - bl sub_02088108 - pop {r4, pc} -_02088202: - mov r0, #0 - pop {r4, pc} - nop -_02088208: .word gSystem - thumb_func_end sub_020881C0 - - thumb_func_start sub_0208820C -sub_0208820C: ; 0x0208820C - push {r4, r5, r6, lr} - sub sp, #0x10 - ldr r6, [sp, #0x28] - add r5, r0, #0 - ldr r4, [sp, #0x20] - ldr r0, [sp, #0x2c] - ldr r3, [sp, #0x30] - cmp r6, #0 - beq _0208822A - cmp r6, #1 - beq _02088244 - cmp r6, #2 - beq _0208825E - add sp, #0x10 - pop {r4, r5, r6, pc} -_0208822A: - str r3, [sp] - str r0, [sp, #4] - mov r0, #0 - str r0, [sp, #8] - str r1, [sp, #0xc] - add r0, r2, #0 - ldr r3, [sp, #0x24] - add r1, r4, #0 - add r2, r5, #0 - bl GfGfxLoader_LoadCharDataFromOpenNarc - add sp, #0x10 - pop {r4, r5, r6, pc} -_02088244: - str r3, [sp] - str r0, [sp, #4] - mov r0, #0 - str r0, [sp, #8] - str r1, [sp, #0xc] - add r0, r2, #0 - ldr r3, [sp, #0x24] - add r1, r4, #0 - add r2, r5, #0 - bl GfGfxLoader_LoadScrnDataFromOpenNarc - add sp, #0x10 - pop {r4, r5, r6, pc} -_0208825E: - ldr r5, [sp, #0x24] - str r0, [sp] - cmp r5, #3 - bgt _02088276 - str r1, [sp, #4] - add r0, r2, #0 - add r1, r4, #0 - mov r2, #0 - bl GfGfxLoader_GXLoadPalFromOpenNarc - add sp, #0x10 - pop {r4, r5, r6, pc} -_02088276: - str r1, [sp, #4] - add r0, r2, #0 - add r1, r4, #0 - mov r2, #4 - bl GfGfxLoader_GXLoadPalFromOpenNarc - add sp, #0x10 - pop {r4, r5, r6, pc} - .balign 4, 0 - thumb_func_end sub_0208820C - - .rodata - -_02103894: - .short 0x20, 0x80, 0x200, 0x800 - .short 0x40, 0x80, 0x100, 0x400 - .short 0x40, 0x80, 0x100, 0x400 - - ; File boundary diff --git a/common.mk b/common.mk index 35f0d4c1c3..a22f784211 100644 --- a/common.mk +++ b/common.mk @@ -119,7 +119,7 @@ XMAP := $(ELF).xMAP EXCCFLAGS := -Cpp_exceptions off -MWCFLAGS = $(DEFINES) $(OPTFLAGS) -sym on -enum int -lang c99 $(EXCCFLAGS) -gccext,on -proc $(PROC) -msgstyle gcc -gccinc -i ./include -i ./include/library -i $(WORK_DIR)/files -I$(WORK_DIR)/lib/include -ipa file -interworking -inline on,noauto -char signed -W all -W pedantic -W noimpl_signedunsigned -W noimplicitconv -W nounusedarg -W nomissingreturn -W error +MWCFLAGS = $(DEFINES) $(OPTFLAGS) -sym on -enum int -lang c99 $(EXCCFLAGS) -gccext,on -proc $(PROC) -msgstyle gcc -gccinc -i ./src -i ./include -i ./include/library -i $(WORK_DIR)/files -I$(WORK_DIR)/lib/include -ipa file -interworking -inline on,noauto -char signed -W all -W pedantic -W noimpl_signedunsigned -W noimplicitconv -W nounusedarg -W nomissingreturn -W error MWASFLAGS = $(DEFINES) -proc $(PROC_S) -g -gccinc -i . -i ./include -i $(WORK_DIR)/asm/include -i $(WORK_DIR)/files -i $(WORK_DIR)/lib/asm/include -i $(WORK_DIR)/lib/NitroDWC/asm/include -i $(WORK_DIR)/lib/NitroSDK/asm/include -i $(WORK_DIR)/lib/syscall/asm/include -i $(WORK_DIR)/asm -i $(WORK_DIR)/files/msgdata -I$(WORK_DIR)/lib/include -DSDK_ASM MWLDFLAGS := -proc $(PROC) -sym on -nopic -nopid -interworking -map closure,unused -symtab sort -m _start -msgstyle gcc diff --git a/files/fielddata/script/scr_seq/scr_seq_0015_D11R0106.s b/files/fielddata/script/scr_seq/scr_seq_0015_D11R0106.s index dda890a4bd..3acdc552f2 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0015_D11R0106.s +++ b/files/fielddata/script/scr_seq/scr_seq_0015_D11R0106.s @@ -94,7 +94,7 @@ scr_seq_D11R0106_000: setflag FLAG_UNK_265 setflag FLAG_HIDE_ROUTE_19_WORKMEN_CLOSED clearflag FLAG_HIDE_ROUTE_19_WORKMEN_OPEN - add_special_game_stat SCORE_EVENT_22 + add_special_game_stat SCORE_EVENT_BADGE_GET setflag FLAG_UNK_13F setflag FLAG_UNK_140 setflag FLAG_UNK_13C diff --git a/files/fielddata/script/scr_seq/scr_seq_0033_D23R0105.s b/files/fielddata/script/scr_seq/scr_seq_0033_D23R0105.s index 7c0b8ac508..c389fbe297 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0033_D23R0105.s +++ b/files/fielddata/script/scr_seq/scr_seq_0033_D23R0105.s @@ -126,7 +126,7 @@ _01DA: compare VAR_SPECIAL_RESULT, 0 goto_if_eq _021D npc_msg msg_0069_D23R0105_00004 - setvar VAR_SPECIAL_x8004, 476 + setvar VAR_SPECIAL_x8004, ITEM_BASEMENT_KEY setvar VAR_SPECIAL_x8005, 1 callstd std_obtain_item_verbose closemsg diff --git a/files/fielddata/script/scr_seq/scr_seq_0157_P01R0302.s b/files/fielddata/script/scr_seq/scr_seq_0157_P01R0302.s index b282a4300d..eab54083fc 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0157_P01R0302.s +++ b/files/fielddata/script/scr_seq/scr_seq_0157_P01R0302.s @@ -58,117 +58,117 @@ _008F: closemsg compare VAR_UNK_4101, 0 goto_if_ne _00B3 - setvar VAR_SPECIAL_x8004, 298 + setvar VAR_SPECIAL_x8004, ITEM_FLAME_PLATE setvar VAR_SPECIAL_x8005, 1 goto _0296 _00B3: compare VAR_UNK_4101, 1 goto_if_ne _00D2 - setvar VAR_SPECIAL_x8004, 299 + setvar VAR_SPECIAL_x8004, ITEM_SPLASH_PLATE setvar VAR_SPECIAL_x8005, 1 goto _0296 _00D2: compare VAR_UNK_4101, 2 goto_if_ne _00F1 - setvar VAR_SPECIAL_x8004, 300 + setvar VAR_SPECIAL_x8004, ITEM_ZAP_PLATE setvar VAR_SPECIAL_x8005, 1 goto _0296 _00F1: compare VAR_UNK_4101, 3 goto_if_ne _0110 - setvar VAR_SPECIAL_x8004, 301 + setvar VAR_SPECIAL_x8004, ITEM_MEADOW_PLATE setvar VAR_SPECIAL_x8005, 1 goto _0296 _0110: compare VAR_UNK_4101, 4 goto_if_ne _012F - setvar VAR_SPECIAL_x8004, 302 + setvar VAR_SPECIAL_x8004, ITEM_ICICLE_PLATE setvar VAR_SPECIAL_x8005, 1 goto _0296 _012F: compare VAR_UNK_4101, 5 goto_if_ne _014E - setvar VAR_SPECIAL_x8004, 303 + setvar VAR_SPECIAL_x8004, ITEM_FIST_PLATE setvar VAR_SPECIAL_x8005, 1 goto _0296 _014E: compare VAR_UNK_4101, 6 goto_if_ne _016D - setvar VAR_SPECIAL_x8004, 304 + setvar VAR_SPECIAL_x8004, ITEM_TOXIC_PLATE setvar VAR_SPECIAL_x8005, 1 goto _0296 _016D: compare VAR_UNK_4101, 7 goto_if_ne _018C - setvar VAR_SPECIAL_x8004, 305 + setvar VAR_SPECIAL_x8004, ITEM_EARTH_PLATE setvar VAR_SPECIAL_x8005, 1 goto _0296 _018C: compare VAR_UNK_4101, 8 goto_if_ne _01AB - setvar VAR_SPECIAL_x8004, 306 + setvar VAR_SPECIAL_x8004, ITEM_SKY_PLATE setvar VAR_SPECIAL_x8005, 1 goto _0296 _01AB: compare VAR_UNK_4101, 9 goto_if_ne _01CA - setvar VAR_SPECIAL_x8004, 307 + setvar VAR_SPECIAL_x8004, ITEM_MIND_PLATE setvar VAR_SPECIAL_x8005, 1 goto _0296 _01CA: compare VAR_UNK_4101, 10 goto_if_ne _01E9 - setvar VAR_SPECIAL_x8004, 308 + setvar VAR_SPECIAL_x8004, ITEM_INSECT_PLATE setvar VAR_SPECIAL_x8005, 1 goto _0296 _01E9: compare VAR_UNK_4101, 11 goto_if_ne _0208 - setvar VAR_SPECIAL_x8004, 309 + setvar VAR_SPECIAL_x8004, ITEM_STONE_PLATE setvar VAR_SPECIAL_x8005, 1 goto _0296 _0208: compare VAR_UNK_4101, 12 goto_if_ne _0227 - setvar VAR_SPECIAL_x8004, 310 + setvar VAR_SPECIAL_x8004, ITEM_SPOOKY_PLATE setvar VAR_SPECIAL_x8005, 1 goto _0296 _0227: compare VAR_UNK_4101, 13 goto_if_ne _0246 - setvar VAR_SPECIAL_x8004, 311 + setvar VAR_SPECIAL_x8004, ITEM_DRACO_PLATE setvar VAR_SPECIAL_x8005, 1 goto _0296 _0246: compare VAR_UNK_4101, 14 goto_if_ne _0265 - setvar VAR_SPECIAL_x8004, 312 + setvar VAR_SPECIAL_x8004, ITEM_DREAD_PLATE setvar VAR_SPECIAL_x8005, 1 goto _0296 _0265: compare VAR_UNK_4101, 15 goto_if_ne _0284 - setvar VAR_SPECIAL_x8004, 313 + setvar VAR_SPECIAL_x8004, ITEM_IRON_PLATE setvar VAR_SPECIAL_x8005, 1 goto _0296 _0284: - setvar VAR_SPECIAL_x8004, 92 + setvar VAR_SPECIAL_x8004, ITEM_NUGGET setvar VAR_SPECIAL_x8005, 1 goto _029C diff --git a/files/fielddata/script/scr_seq/scr_seq_0181_R05R0202.s b/files/fielddata/script/scr_seq/scr_seq_0181_R05R0202.s index 63d62f1975..b0cc1ae3b8 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0181_R05R0202.s +++ b/files/fielddata/script/scr_seq/scr_seq_0181_R05R0202.s @@ -51,7 +51,7 @@ _006E: takeitem ITEM_RAGECANDYBAR, 1, VAR_SPECIAL_RESULT npc_msg msg_0331_R05R0202_00004 closemsg - setvar VAR_SPECIAL_x8004, 391 + setvar VAR_SPECIAL_x8004, TM_EXPLOSION setvar VAR_SPECIAL_x8005, 1 callstd std_obtain_item_verbose _00BE: diff --git a/files/fielddata/script/scr_seq/scr_seq_0684_T26_hdr.s b/files/fielddata/script/scr_seq/scr_seq_0684_T26_hdr.s index 9ede279ece..f350d96191 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0684_T26_hdr.s +++ b/files/fielddata/script/scr_seq/scr_seq_0684_T26_hdr.s @@ -10,7 +10,7 @@ .byte 0 scr_seq_T26_map_scripts_2: - .short VAR_UNK_4134, 4, _EV_scr_seq_T26_002 + 1 + .short VAR_MIDGAME_BADGES, 4, _EV_scr_seq_T26_002 + 1 .short VAR_SCENE_LIGHTHOUSE_JASMINE, 2, _EV_scr_seq_T26_003 + 1 .short 0 diff --git a/files/fielddata/script/scr_seq/scr_seq_0703_T28_hdr.s b/files/fielddata/script/scr_seq/scr_seq_0703_T28_hdr.s index adc15b9ce7..d1b2b0adae 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0703_T28_hdr.s +++ b/files/fielddata/script/scr_seq/scr_seq_0703_T28_hdr.s @@ -8,7 +8,7 @@ .byte 0 scr_seq_T28_map_scripts_2: - .short VAR_UNK_4134, 4, _EV_scr_seq_T28_005 + 1 + .short VAR_MIDGAME_BADGES, 4, _EV_scr_seq_T28_005 + 1 .short 0 .balign 4, 0 diff --git a/files/fielddata/script/scr_seq/scr_seq_0743_T02GYM0101.s b/files/fielddata/script/scr_seq/scr_seq_0743_T02GYM0101.s index b0006fd46a..a3ebe04bea 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0743_T02GYM0101.s +++ b/files/fielddata/script/scr_seq/scr_seq_0743_T02GYM0101.s @@ -55,7 +55,7 @@ scr_seq_T02GYM0101_000: give_badge BADGE_EARTH addvar VAR_UNK_4135, 1 setflag FLAG_UNK_998 - add_special_game_stat SCORE_EVENT_22 + add_special_game_stat SCORE_EVENT_BADGE_GET settrainerflag TRAINER_ACE_TRAINER_M_ARABELLA settrainerflag TRAINER_ACE_TRAINER_F_SALMA settrainerflag TRAINER_ACE_TRAINER_M_BONITA diff --git a/files/fielddata/script/scr_seq/scr_seq_0750_T03.s b/files/fielddata/script/scr_seq/scr_seq_0750_T03.s index b30b936600..0a0094b74f 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0750_T03.s +++ b/files/fielddata/script/scr_seq/scr_seq_0750_T03.s @@ -59,7 +59,7 @@ _00B0: get_game_version VAR_SPECIAL_RESULT compare VAR_SPECIAL_RESULT, 7 goto_if_ne _00E6 - setvar VAR_SPECIAL_x8004, 482 + setvar VAR_SPECIAL_x8004, ITEM_SILVER_WING setvar VAR_SPECIAL_x8005, 1 callstd std_obtain_item_verbose setflag FLAG_UNK_094 @@ -68,7 +68,7 @@ _00B0: goto _0102 _00E6: - setvar VAR_SPECIAL_x8004, 483 + setvar VAR_SPECIAL_x8004, ITEM_RAINBOW_WING setvar VAR_SPECIAL_x8005, 1 callstd std_obtain_item_verbose setflag FLAG_UNK_093 diff --git a/files/fielddata/script/scr_seq/scr_seq_0752_T03GYM0101.s b/files/fielddata/script/scr_seq/scr_seq_0752_T03GYM0101.s index e69b6af5a3..1738d88b54 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0752_T03GYM0101.s +++ b/files/fielddata/script/scr_seq/scr_seq_0752_T03GYM0101.s @@ -97,7 +97,7 @@ scr_seq_T03GYM0101_000: goto_if_eq _01B8 give_badge BADGE_BOULDER addvar VAR_UNK_4135, 1 - add_special_game_stat SCORE_EVENT_22 + add_special_game_stat SCORE_EVENT_BADGE_GET settrainerflag TRAINER_CAMPER_JERRY settrainerflag TRAINER_HIKER_EDWIN npc_msg msg_0462_T03GYM0101_00001 diff --git a/files/fielddata/script/scr_seq/scr_seq_0760_T04GYM0101.s b/files/fielddata/script/scr_seq/scr_seq_0760_T04GYM0101.s index 6889003a09..73dbeb6eef 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0760_T04GYM0101.s +++ b/files/fielddata/script/scr_seq/scr_seq_0760_T04GYM0101.s @@ -216,7 +216,7 @@ scr_seq_T04GYM0101_000: goto_if_eq _035E give_badge BADGE_CASCADE addvar VAR_UNK_4135, 1 - add_special_game_stat SCORE_EVENT_22 + add_special_game_stat SCORE_EVENT_BADGE_GET settrainerflag TRAINER_SWIMMER_F_DIANA settrainerflag TRAINER_SWIMMER_F_BRIANA settrainerflag TRAINER_SWIMMER_F_JOY diff --git a/files/fielddata/script/scr_seq/scr_seq_0778_T06GYM0101.s b/files/fielddata/script/scr_seq/scr_seq_0778_T06GYM0101.s index 4da093069d..cb3f24ed00 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0778_T06GYM0101.s +++ b/files/fielddata/script/scr_seq/scr_seq_0778_T06GYM0101.s @@ -290,7 +290,7 @@ scr_seq_T06GYM0101_023: goto_if_eq _03DD give_badge BADGE_THUNDER addvar VAR_UNK_4135, 1 - add_special_game_stat SCORE_EVENT_22 + add_special_game_stat SCORE_EVENT_BADGE_GET setflag FLAG_UNK_31A hide_person obj_T06GYM0101_stop hide_person obj_T06GYM0101_stop_2 diff --git a/files/fielddata/script/scr_seq/scr_seq_0786_T07GYM0101.s b/files/fielddata/script/scr_seq/scr_seq_0786_T07GYM0101.s index 496ba77d25..8115f3b491 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0786_T07GYM0101.s +++ b/files/fielddata/script/scr_seq/scr_seq_0786_T07GYM0101.s @@ -107,7 +107,7 @@ scr_seq_T07GYM0101_000: goto_if_eq _01BB give_badge BADGE_RAINBOW addvar VAR_UNK_4135, 1 - add_special_game_stat SCORE_EVENT_22 + add_special_game_stat SCORE_EVENT_BADGE_GET settrainerflag TRAINER_TWINS_JO_AND_ZOE settrainerflag TRAINER_LASS_MICHELLE settrainerflag TRAINER_PICNICKER_TANYA diff --git a/files/fielddata/script/scr_seq/scr_seq_0809_T08GYM0101.s b/files/fielddata/script/scr_seq/scr_seq_0809_T08GYM0101.s index ab7413454c..c648e44e5a 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0809_T08GYM0101.s +++ b/files/fielddata/script/scr_seq/scr_seq_0809_T08GYM0101.s @@ -519,7 +519,7 @@ scr_seq_T08GYM0101_001: setvar VAR_TEMP_x400B, 0 give_badge BADGE_SOUL addvar VAR_UNK_4135, 1 - add_special_game_stat SCORE_EVENT_22 + add_special_game_stat SCORE_EVENT_BADGE_GET settrainerflag TRAINER_PICNICKER_CINDY settrainerflag TRAINER_CAMPER_BARRY settrainerflag TRAINER_LASS_LINDA diff --git a/files/fielddata/script/scr_seq/scr_seq_0829_T11GYM0101.s b/files/fielddata/script/scr_seq/scr_seq_0829_T11GYM0101.s index aaab8ec42c..dbc01b036f 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0829_T11GYM0101.s +++ b/files/fielddata/script/scr_seq/scr_seq_0829_T11GYM0101.s @@ -61,7 +61,7 @@ scr_seq_T11GYM0101_000: goto_if_eq _0156 give_badge BADGE_MARSH addvar VAR_UNK_4135, 1 - add_special_game_stat SCORE_EVENT_22 + add_special_game_stat SCORE_EVENT_BADGE_GET setflag FLAG_UNK_998 settrainerflag TRAINER_PSYCHIC_M_FRANKLIN settrainerflag TRAINER_PSYCHIC_M_JARED diff --git a/files/fielddata/script/scr_seq/scr_seq_0843_T20R0101.s b/files/fielddata/script/scr_seq/scr_seq_0843_T20R0101.s index ec5a23bd19..9bdc7eae13 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0843_T20R0101.s +++ b/files/fielddata/script/scr_seq/scr_seq_0843_T20R0101.s @@ -294,7 +294,7 @@ _03BA: goto_if_eq _03F5 get_party_lead_alive VAR_TEMP_x4000 get_partymon_species VAR_TEMP_x4000, VAR_TEMP_x4001 - compare VAR_TEMP_x4001, 172 + compare VAR_TEMP_x4001, SPECIES_PICHU goto_if_ne _03F5 get_partymon_form VAR_TEMP_x4000, VAR_SPECIAL_RESULT compare VAR_SPECIAL_RESULT, 1 @@ -519,7 +519,7 @@ _06D4: buffer_players_name 0 gender_msgbox msg_0543_T20R0101_00019, msg_0543_T20R0101_00020 goto_if_no_item_space ITEM_POTION, 5, _0805 - setvar VAR_SPECIAL_x8004, 17 + setvar VAR_SPECIAL_x8004, ITEM_POTION setvar VAR_SPECIAL_x8005, 5 callstd std_obtain_item_verbose closemsg diff --git a/files/fielddata/script/scr_seq/scr_seq_0859_T22GYM0101.s b/files/fielddata/script/scr_seq/scr_seq_0859_T22GYM0101.s index 4452b0769c..6f16e85e6b 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0859_T22GYM0101.s +++ b/files/fielddata/script/scr_seq/scr_seq_0859_T22GYM0101.s @@ -74,7 +74,7 @@ scr_seq_T22GYM0101_001: compare VAR_SPECIAL_RESULT, 0 goto_if_eq _017E give_badge BADGE_ZEPHYR - add_special_game_stat SCORE_EVENT_22 + add_special_game_stat SCORE_EVENT_BADGE_GET settrainerflag TRAINER_BIRD_KEEPER_GS_ROD settrainerflag TRAINER_BIRD_KEEPER_GS_ABE setvar VAR_SCENE_VIOLET_CITY_OW, 1 diff --git a/files/fielddata/script/scr_seq/scr_seq_0869_T23GYM0102.s b/files/fielddata/script/scr_seq/scr_seq_0869_T23GYM0102.s index 0ff4a01500..6a91efcb6d 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0869_T23GYM0102.s +++ b/files/fielddata/script/scr_seq/scr_seq_0869_T23GYM0102.s @@ -85,7 +85,7 @@ scr_seq_T23GYM0102_001: settrainerflag TRAINER_BUG_CATCHER_BENNY settrainerflag TRAINER_BUG_CATCHER_JOSH settrainerflag TRAINER_TWINS_AMY_AND_MIMI - add_special_game_stat SCORE_EVENT_22 + add_special_game_stat SCORE_EVENT_BADGE_GET npc_msg msg_0567_T23GYM0102_00003 _0136: goto_if_no_item_space ITEM_TM89, 1, _016A diff --git a/files/fielddata/script/scr_seq/scr_seq_0875_T24.s b/files/fielddata/script/scr_seq/scr_seq_0875_T24.s index 9e0539aa71..2dde1c6022 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0875_T24.s +++ b/files/fielddata/script/scr_seq/scr_seq_0875_T24.s @@ -44,7 +44,7 @@ scr_seq_T24_006: closemsg apply_movement obj_T24_middlewoman1_2, _00D8 wait_movement - compare VAR_UNK_4134, 4 + compare VAR_MIDGAME_BADGES, 4 goto_if_eq _00F0 releaseall end @@ -87,7 +87,7 @@ _0111: setvar VAR_SPECIAL_x8005, 2 setvar VAR_SPECIAL_x8006, 2 callstd std_phone_call - setvar VAR_UNK_4134, 5 + setvar VAR_MIDGAME_BADGES, 5 releaseall end diff --git a/files/fielddata/script/scr_seq/scr_seq_0877_T24GYM0101.s b/files/fielddata/script/scr_seq/scr_seq_0877_T24GYM0101.s index 33adfaec10..40ab035191 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0877_T24GYM0101.s +++ b/files/fielddata/script/scr_seq/scr_seq_0877_T24GYM0101.s @@ -41,10 +41,10 @@ scr_seq_T24GYM0101_000: give_badge BADGE_STORM play_fanfare SEQ_ME_BADGE wait_fanfare - addvar VAR_UNK_4134, 1 - add_special_game_stat SCORE_EVENT_22 + addvar VAR_MIDGAME_BADGES, 1 + add_special_game_stat SCORE_EVENT_BADGE_GET setvar VAR_UNK_4116, 1 - compare VAR_UNK_4134, 3 + compare VAR_MIDGAME_BADGES, 3 goto_if_ne _00A6 setvar VAR_SCENE_ROCKET_TAKEOVER, 1 _00A6: diff --git a/files/fielddata/script/scr_seq/scr_seq_0886_T25GYM0101.s b/files/fielddata/script/scr_seq/scr_seq_0886_T25GYM0101.s index 8673a919ec..e9810f9681 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0886_T25GYM0101.s +++ b/files/fielddata/script/scr_seq/scr_seq_0886_T25GYM0101.s @@ -103,7 +103,7 @@ scr_seq_T25GYM0101_000: settrainerflag TRAINER_LASS_CATHY settrainerflag TRAINER_BEAUTY_VICTORIA settrainerflag TRAINER_BEAUTY_SAMANTHA - add_special_game_stat SCORE_EVENT_22 + add_special_game_stat SCORE_EVENT_BADGE_GET move_person_facing obj_T25GYM0101_gsgirl1, 13, 0, 15, DIR_NORTH _017D: npc_msg msg_0582_T25GYM0101_00002 diff --git a/files/fielddata/script/scr_seq/scr_seq_0911_T26.s b/files/fielddata/script/scr_seq/scr_seq_0911_T26.s index 3bef4e4418..ec521bd984 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0911_T26.s +++ b/files/fielddata/script/scr_seq/scr_seq_0911_T26.s @@ -32,7 +32,7 @@ _0057: setvar VAR_SPECIAL_x8005, 2 setvar VAR_SPECIAL_x8006, 2 callstd std_phone_call - setvar VAR_UNK_4134, 5 + setvar VAR_MIDGAME_BADGES, 5 end scr_seq_T26_003: diff --git a/files/fielddata/script/scr_seq/scr_seq_0913_T26GYM0101.s b/files/fielddata/script/scr_seq/scr_seq_0913_T26GYM0101.s index 7333bab9fa..ade6c1a6ec 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0913_T26GYM0101.s +++ b/files/fielddata/script/scr_seq/scr_seq_0913_T26GYM0101.s @@ -133,9 +133,9 @@ scr_seq_T26GYM0101_000: play_fanfare SEQ_ME_BADGE wait_fanfare give_badge BADGE_MINERAL - addvar VAR_UNK_4134, 1 - add_special_game_stat SCORE_EVENT_22 - compare VAR_UNK_4134, 3 + addvar VAR_MIDGAME_BADGES, 1 + add_special_game_stat SCORE_EVENT_BADGE_GET + compare VAR_MIDGAME_BADGES, 3 goto_if_ne _01CB setvar VAR_SCENE_ROCKET_TAKEOVER, 1 _01CB: diff --git a/files/fielddata/script/scr_seq/scr_seq_0922_T27GYM0101.s b/files/fielddata/script/scr_seq/scr_seq_0922_T27GYM0101.s index 0b8fb727cd..d04ec7f81a 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0922_T27GYM0101.s +++ b/files/fielddata/script/scr_seq/scr_seq_0922_T27GYM0101.s @@ -114,8 +114,8 @@ scr_seq_T27GYM0101_001: goto_if_eq _01EF npc_msg msg_0614_T27GYM0101_00001 give_badge BADGE_FOG - addvar VAR_UNK_4134, 1 - add_special_game_stat SCORE_EVENT_22 + addvar VAR_MIDGAME_BADGES, 1 + add_special_game_stat SCORE_EVENT_BADGE_GET setflag FLAG_UNK_998 buffer_players_name 0 npc_msg msg_0614_T27GYM0101_00002 diff --git a/files/fielddata/script/scr_seq/scr_seq_0930_T28.s b/files/fielddata/script/scr_seq/scr_seq_0930_T28.s index a4b05f7b86..3a3ca3d67a 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0930_T28.s +++ b/files/fielddata/script/scr_seq/scr_seq_0930_T28.s @@ -28,7 +28,7 @@ _0047: setvar VAR_SPECIAL_x8005, 2 setvar VAR_SPECIAL_x8006, 2 callstd std_phone_call - setvar VAR_UNK_4134, 5 + setvar VAR_MIDGAME_BADGES, 5 end scr_seq_T28_000: diff --git a/files/fielddata/script/scr_seq/scr_seq_0932_T28GYM0101.s b/files/fielddata/script/scr_seq/scr_seq_0932_T28GYM0101.s index 2717875692..1afdb5bcef 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0932_T28GYM0101.s +++ b/files/fielddata/script/scr_seq/scr_seq_0932_T28GYM0101.s @@ -86,9 +86,9 @@ scr_seq_T28GYM0101_000: settrainerflag TRAINER_BOARDER_PATTON npc_msg msg_0622_T28GYM0101_00001 give_badge BADGE_GLACIER - addvar VAR_UNK_4134, 1 - add_special_game_stat SCORE_EVENT_22 - compare VAR_UNK_4134, 3 + addvar VAR_MIDGAME_BADGES, 1 + add_special_game_stat SCORE_EVENT_BADGE_GET + compare VAR_MIDGAME_BADGES, 3 goto_if_ne _012F setvar VAR_SCENE_ROCKET_TAKEOVER, 1 _012F: diff --git a/files/fielddata/script/scr_seq/scr_seq_0943_T30GYM0101.s b/files/fielddata/script/scr_seq/scr_seq_0943_T30GYM0101.s index 63168a526d..35ef375f7b 100644 --- a/files/fielddata/script/scr_seq/scr_seq_0943_T30GYM0101.s +++ b/files/fielddata/script/scr_seq/scr_seq_0943_T30GYM0101.s @@ -101,7 +101,7 @@ scr_seq_T30GYM0101_000: settrainerflag TRAINER_ACE_TRAINER_M_MIKE settrainerflag TRAINER_ACE_TRAINER_F_FRAN settrainerflag TRAINER_ACE_TRAINER_F_LOLA - add_special_game_stat SCORE_EVENT_22 + add_special_game_stat SCORE_EVENT_BADGE_GET setflag FLAG_UNK_0D1 setflag FLAG_HIDE_BLACKTHORN_DEN_GUARD_INFRONT clearflag FLAG_HIDE_BLACKTHRON_DEN_GUARD_ASIDE diff --git a/include/battle/battle.h b/include/battle/battle.h index 5c3be75f7e..85e4e6a631 100644 --- a/include/battle/battle.h +++ b/include/battle/battle.h @@ -23,6 +23,7 @@ #include "sprite.h" #include "sys_task_api.h" #include "trainer_data.h" +#include "unk_0200CE7C.h" #include "unk_0200CF18.h" typedef struct BattleMessage { @@ -438,49 +439,41 @@ typedef struct BattleContext { typedef struct BattleSystem BattleSystem; typedef struct BattleHpBar { - u8 script; - void *unk4; - void *unk8; + struct { + u8 script; + }; + UnkImageStruct *boxObj; + UnkImageStruct *arrowObj; BattleSystem *bsys; - void *unk10; - s32 exp; - s32 maxExp; - s32 damage; - s32 hpCalc; + SysTask *unk10; + Window unk14; u8 battlerId; u8 type; - u8 unk26; + u8 monId; u8 unk27; s32 hp; s32 maxHp; + s32 gainedHp; + s32 hpCalc; + s32 exp; + s32 maxExp; s32 gainedExp; s32 expCalc; u8 level; - u8 gender; - u8 status; - u8 unk3B; - u8 unk3C; - u8 unk3D; - u8 unk3E; - u8 unk3F_0 : 1; - u8 unk3F_1 : 1; - u8 unk3F_2 : 1; - u8 unk3F_3 : 1; - void *unk40; - u16 unk44; + u8 unk49; + u8 unk_4A; + u8 unk4B; + u8 unk4C; + u8 unk4D; + u8 unk4E; + u8 unk_4F_0 : 1; + u8 unk_4F_1 : 1; + u8 unk_4F_2 : 1; + u8 unk_4F_3 : 1; + SysTask *sysTask; + u16 unk54; } BattleHpBar; -typedef struct OpponentData_UnkSub_70 { - s8 unk0; - s8 unk1; - s8 unk2; - s8 unk3; - s8 unk4; - s8 unk5; - s8 unk6; - u8 unk7; -} OpponentData_UnkSub_70; - typedef struct OpponentData { u32 unk0[6]; u32 unk18; @@ -488,9 +481,6 @@ typedef struct OpponentData { Pokepic *pokepic; u32 *unk24; BattleHpBar hpBar; - OpponentData_UnkSub_70 unk70; - u32 unk78; - u32 *unk7C; void *unk80; u8 unk84[0x110]; u8 unk194; @@ -553,8 +543,8 @@ struct BattleSystem { SOUND_CHATOT *chatotVoice[4]; u32 *unk88; u32 *unk8C; - SpriteRenderer *unk90; - SpriteGfxHandler *unk94; + SpriteRenderer *spriteRenderer; + SpriteGfxHandler *gfxHandler; u32 *unk98; u32 *unk9C; u16 trainerId[4]; @@ -563,8 +553,8 @@ struct BattleSystem { UnkBattleSystemSub17C unk17C[2]; // Battle Background..? u32 *unk19C; u32 *unk1A0[2]; - FontID *hpFont; - FontID *levelFont; + BattleNumberPrinter *hpNumPrinter; + BattleNumberPrinter *levelNumPrinter; void *msgIcon; Options *options; u32 *unk1B8; @@ -574,15 +564,15 @@ struct BattleSystem { void *unk1C8; // related to animations u32 *unk1CC; UnkBattleSystemSub1D0 unk1D0[4]; - UnkBattleSystemSub220 unk220; + UnkBattleSystemSub220 unk210; GameStats *gameStats; - u8 *unk230; - u16 *unk234; + u8 *unk220; + u16 *unk224; u8 sendBuffer[0x1000]; u8 recvBuffer[0x1000]; - u16 unk2238[0x70]; - u16 unk2318[0x70]; - u16 unk23E8; // labeling may be wrong before here + u16 unk2228[0x70]; + u16 unk2308[0x70]; + u16 unk23E8; u16 unk23EA; u16 unk23EC; u16 unk23EE; diff --git a/include/battle/battle_hp_bar.h b/include/battle/battle_hp_bar.h index 95aa4e6a3e..40c68ce7bf 100644 --- a/include/battle/battle_hp_bar.h +++ b/include/battle/battle_hp_bar.h @@ -3,10 +3,22 @@ #include "battle/battle.h" +void ov12_0226498C(BattleHpBar *hpBar, u32 num, u32 flag); void BattleHpBar_LoadResources(BattleHpBar *hpBar); void BattleHpBar_FreeResources(BattleHpBar *hpBar); +void ov12_02264C84(BattleHpBar *hpBar); +void ov12_02264DCC(BattleHpBar *hpBar, int hp); +void ov12_02264E34(BattleHpBar *hpBar, int a1); +int ov12_02264E00(BattleHpBar *hpBar); +int ov12_02264E68(BattleHpBar *hpBar); +void ov12_02264E84(BattleHpBar *hpBar); +void ov12_02264EB4(BattleHpBar *hpBar); +void ov12_02264EE0(BattleHpBar *hpBar, int prio); void BattleHpBar_SetEnabled(BattleHpBar *hpBar, BOOL a1); -u8 ov12_02265B64(u8 a0, u32 battleType); -void ov12_02264EE0(BattleHpBar *hpBar, int a1); +void ov12_02264FB0(BattleHpBar *hpBar, BOOL a1); +u8 BattleHpBar_Util_GetBarTypeFromBattlerSide(u8 a0, u32 battleType); +SysTask *BattleHpBar_BeginExpBarFullFlashEffect(BattleHpBar *hpBar, u8 *a1); +void ov12_02265D70(BattleHpBar *hpBar); +void ov12_02265D74(BattleHpBar *hpBar); #endif diff --git a/include/battle/battle_system.h b/include/battle/battle_system.h index 1a3efc8860..eff1cc1f31 100644 --- a/include/battle/battle_system.h +++ b/include/battle/battle_system.h @@ -19,14 +19,14 @@ int BattleSystem_GetPartySize(BattleSystem *bsys, int battlerId); Pokemon *BattleSystem_GetPartyMon(BattleSystem *bsys, int battlerId, int index); u32 *ov12_0223A8D4(BattleSystem *bsys); u32 *ov12_0223A8DC(BattleSystem *bsys); -SpriteRenderer *ov12_0223A8E4(BattleSystem *bsys); -SpriteGfxHandler *ov12_0223A8EC(BattleSystem *bsys); +SpriteRenderer *BattleSystem_GetSpriteRenderer(BattleSystem *bsys); +SpriteGfxHandler *BattleSystem_GetGfxHandler(BattleSystem *bsys); UnkBattleSystemSub17C *ov12_0223A8F4(BattleSystem *bsys, int index); u32 *ov12_0223A900(BattleSystem *bsys); u32 *ov12_0223A908(BattleSystem *bsys, int index); void ov12_0223A914(BattleSystem *bsys, int index, u32 *a2); -FontID *BattleSystem_GetHpFont(BattleSystem *bsys); -FontID *BattleSystem_GetLevelFont(BattleSystem *bsys); +BattleNumberPrinter *BattleSystem_GetHpNumPrinter(BattleSystem *bsys); +BattleNumberPrinter *BattleSystem_GetLevelNumPrinter(BattleSystem *bsys); MsgData *BattleSystem_GetMessageData(BattleSystem *bsys); u32 *ov12_0223A934(BattleSystem *bsys); PaletteData *BattleSystem_GetPaletteData(BattleSystem *bsys); diff --git a/include/constants/game_stats.h b/include/constants/game_stats.h index 2926bf38e0..b6da856f1b 100644 --- a/include/constants/game_stats.h +++ b/include/constants/game_stats.h @@ -63,7 +63,7 @@ #define SCORE_EVENT_19 19 #define SCORE_EVENT_20 20 #define SCORE_EVENT_REGISTER_SPECIES_CAUGHT 21 -#define SCORE_EVENT_22 22 +#define SCORE_EVENT_BADGE_GET 22 #define SCORE_EVENT_23 23 #define SCORE_EVENT_24 24 #define SCORE_EVENT_25 25 diff --git a/include/constants/vars.h b/include/constants/vars.h index d67d2ee59e..6932c6c475 100644 --- a/include/constants/vars.h +++ b/include/constants/vars.h @@ -320,7 +320,7 @@ #define VAR_UNK_4131 0x4131 #define VAR_UNK_4132 0x4132 #define VAR_UNK_4133 0x4133 -#define VAR_UNK_4134 0x4134 +#define VAR_MIDGAME_BADGES 0x4134 #define VAR_UNK_4135 0x4135 #define VAR_UNK_4136 0x4136 #define VAR_UNK_4137 0x4137 diff --git a/include/heap.h b/include/heap.h index b54ae0d48e..3a02d0628d 100644 --- a/include/heap.h +++ b/include/heap.h @@ -38,6 +38,7 @@ typedef enum HeapID { HEAP_ID_BERRY_POTS_APP = 131, HEAP_ID_RANKINGS_APP = 158, HEAP_ID_VOLTORB_FLIP = 160, + HEAP_ID_MAX, } HeapID; typedef struct HeapParam { diff --git a/include/options_app.h b/include/options_app.h index c7d9a0b87f..15c314adc6 100644 --- a/include/options_app.h +++ b/include/options_app.h @@ -7,7 +7,7 @@ typedef struct OptionsApp_Args { u32 unk0; Options *options; - u32 *unk8; + BOOL *unk8; } OptionsApp_Args; BOOL OptionsMenu_Init(OVY_MANAGER *manager, int *state); diff --git a/include/render_text.h b/include/render_text.h index 1211fb386b..9c7d63ce72 100644 --- a/include/render_text.h +++ b/include/render_text.h @@ -27,10 +27,15 @@ typedef struct TextPrinterSubStruct { u8 autoScrollDelay : 8; } TextPrinterSubStruct; +// Argument to TextFlags_SetAutoScrollParam +#define AUTO_SCROLL_OFF 0 +#define AUTO_SCROLL_ENABLE (1 << 0) +#define AUTO_SCROLL_SPEEDUP (1 << 1) + RenderResult RenderText(TextPrinter *printer); void TextFlags_SetCanABSpeedUpPrint(BOOL enable); void TextPrinter_SetDownArrowBaseTile(int tile); -void TextFlags_SetAutoScrollParam(int a0); +void TextFlags_SetAutoScrollParam(int param); void TextFlags_SetCanTouchSpeedUpPrint(BOOL enable); void TextFlags_SetAlternateDownArrow(BOOL enable); u8 TextFlags_GetHasSpedUpInput(); diff --git a/include/unk_0200ACF0.h b/include/unk_0200ACF0.h index a3807699fb..3a087cca16 100644 --- a/include/unk_0200ACF0.h +++ b/include/unk_0200ACF0.h @@ -23,7 +23,7 @@ void sub_0200B050(GF_2DGfxResObjList *plttResObjList); void sub_0200B084(GF_2DGfxResObj *plttResObj); void sub_0200B0A8(GF_2DGfxResObj *plttResObj); void sub_0200B0CC(GF_2DGfxResObjList *plttResObjList); -NNSG2dImagePaletteProxy *sub_0200B0F8(GF_2DGfxResObj *plttResObj, NNSG2dImageProxy *imageProxy); -int sub_0200B12C(GF_2DGfxResObj *plttResObj, NNS_G2D_VRAM_TYPE vram); +NNSG2dImagePaletteProxy *GF_PlttResObj_GetPlttProxy(GF_2DGfxResObj *plttResObj, NNSG2dImageProxy *imageProxy); +int GF_PlttResObj_GetVramSlotNum(GF_2DGfxResObj *plttResObj, NNS_G2D_VRAM_TYPE vram); #endif // POKEHEARTGOLD_UNK_0200ACF0_H diff --git a/include/unk_0200CE7C.h b/include/unk_0200CE7C.h index 5ac1e932cb..4317d0794e 100644 --- a/include/unk_0200CE7C.h +++ b/include/unk_0200CE7C.h @@ -3,8 +3,17 @@ #include "global.h" +#include "font_types_def.h" #include "message_printer.h" -void sub_0200CE7C(MessagePrinter *msgPrinter, u8 a1, u32 num, u32 ndigits, PrintingMode mode, Window *window, u32 x, u32 y); +typedef struct BattleNumberPrinter { + FontID fontId; + NNSG2dCharacterData *charData; + u16 strbuf[16]; + int fillVal; +} BattleNumberPrinter; + +void sub_0200CE7C(MessagePrinter *msgPrinter, u8 glyphId, u32 num, u32 ndigits, PrintingMode mode, Window *window, u32 x, u32 y); +void sub_0200CEB0(BattleNumberPrinter *unk, u32 num, u32 ndigits, PrintingMode strConvMode, u16 *dest); #endif // GUARD_POKEHEARTGOLD_UNK_0200CE7C_H diff --git a/include/unk_0200CF18.h b/include/unk_0200CF18.h index d7a4ac7312..0e9a0188bf 100644 --- a/include/unk_0200CF18.h +++ b/include/unk_0200CF18.h @@ -27,12 +27,12 @@ typedef struct UnkTemplate_0200D748 { s16 y; s16 z; u16 animation; - u32 spritePriority; - u32 pal; + int spritePriority; + int pal; NNS_G2D_VRAM_TYPE vram; - u32 resIdList[GF_GFX_RES_TYPE_MAX]; - u32 bgPriority; - u32 vramTransfer; + int resIdList[GF_GFX_RES_TYPE_MAX]; + int bgPriority; + int vramTransfer; } UnkTemplate_0200D748; // size=0x34 typedef struct SpriteRenderer { @@ -111,8 +111,8 @@ BOOL SpriteRenderer_LoadAnimResObjFromNarcId(SpriteRenderer *renderer, SpriteGfx BOOL SpriteRenderer_LoadAnimResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int fileId, BOOL compressed, int resId); UnkImageStruct *SpriteRenderer_LoadResourcesAndCreateSprite(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, const UnkTemplate_0200D748 *unkTemplate); UnkImageStruct *SpriteRenderer_LoadResourcesAndCreateSprite_CustomBottomScreenOffset(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, const UnkTemplate_0200D748 *unkTemplate, fx32 yOffset); -NNSG2dImagePaletteProxy *sub_0200D934(SpriteGfxHandler *gfxHandler, int id); -int sub_0200D944(SpriteGfxHandler *gfxHandler, int id, NNS_G2D_VRAM_TYPE vram); +NNSG2dImagePaletteProxy *GfGfxHandler_GetPlttProxy(SpriteGfxHandler *gfxHandler, int id); +int GfGfxHandler_GetPlttNumById(SpriteGfxHandler *gfxHandler, int id, NNS_G2D_VRAM_TYPE vram); BOOL SpriteGfxHandler_UnloadCharObjById(SpriteGfxHandler *gfxHandler, u32 character); BOOL SpriteGfxHandler_UnloadPlttObjById(SpriteGfxHandler *gfxHandler, u32 pal); BOOL SpriteGfxHandler_UnloadCellObjById(SpriteGfxHandler *gfxHandler, u32 cell); diff --git a/include/unk_0208805C.h b/include/unk_0208805C.h index a16ba59b04..e812ff4625 100644 --- a/include/unk_0208805C.h +++ b/include/unk_0208805C.h @@ -1,10 +1,16 @@ #ifndef POKEHEARTGOLD_UNK_0208805C_H #define POKEHEARTGOLD_UNK_0208805C_H +#include "bg_window.h" +#include "filesystem.h" #include "heap.h" -u8 CalculateHpBarPixelsLength(int hp, int maxHp, int pixelsWide); -int CalculateHpBarColor(u16 hp, u16 maxHp, int pixelsWide); -int sub_020880CC(int a0, HeapID heapId); +u16 sub_0208805C(int a0); +u8 CalculateHpBarPixelsLength(u32 hp, u32 maxHp, u8 pixelsWide); +u8 HpBar_GetColorIdx(u32 pixelsCur, u32 pixelsWide); +u8 CalculateHpBarColor(u16 hp, u16 maxHp, u32 pixelsWide); +void sub_020880CC(u8 a0, HeapID heapId); +int sub_020881C0(s16 *a0, u16 a1); +void sub_0208820C(BgConfig *bgConfig, HeapID heapId, NARC *narc, int unused, int fileId, GFBgLayer layer, int kind, u32 szByte, u32 offest); #endif diff --git a/lib/include/nitro/gx/gx_vramcnt.h b/lib/include/nitro/gx/gx_vramcnt.h index 74d232d76f..2c77bed989 100644 --- a/lib/include/nitro/gx/gx_vramcnt.h +++ b/lib/include/nitro/gx/gx_vramcnt.h @@ -4,146 +4,146 @@ #include typedef enum { - GX_VRAM_A = OS_VRAM_BANK_ID_A,// VRAM-A - GX_VRAM_B = OS_VRAM_BANK_ID_B,// VRAM-B - GX_VRAM_C = OS_VRAM_BANK_ID_C,// VRAM-C - GX_VRAM_D = OS_VRAM_BANK_ID_D,// VRAM-D - GX_VRAM_E = OS_VRAM_BANK_ID_E,// VRAM-E - GX_VRAM_F = OS_VRAM_BANK_ID_F,// VRAM-F - GX_VRAM_G = OS_VRAM_BANK_ID_G,// VRAM-G - GX_VRAM_H = OS_VRAM_BANK_ID_H,// VRAM-H - GX_VRAM_I = OS_VRAM_BANK_ID_I,// VRAM-I + GX_VRAM_A = OS_VRAM_BANK_ID_A, // VRAM-A + GX_VRAM_B = OS_VRAM_BANK_ID_B, // VRAM-B + GX_VRAM_C = OS_VRAM_BANK_ID_C, // VRAM-C + GX_VRAM_D = OS_VRAM_BANK_ID_D, // VRAM-D + GX_VRAM_E = OS_VRAM_BANK_ID_E, // VRAM-E + GX_VRAM_F = OS_VRAM_BANK_ID_F, // VRAM-F + GX_VRAM_G = OS_VRAM_BANK_ID_G, // VRAM-G + GX_VRAM_H = OS_VRAM_BANK_ID_H, // VRAM-H + GX_VRAM_I = OS_VRAM_BANK_ID_I, // VRAM-I GX_VRAM_ALL = OS_VRAM_BANK_ID_ALL } GXVRam; typedef enum { GX_VRAM_LCDC_NONE = 0x0000, - GX_VRAM_LCDC_A = GX_VRAM_A, - GX_VRAM_LCDC_B = GX_VRAM_B, - GX_VRAM_LCDC_C = GX_VRAM_C, - GX_VRAM_LCDC_D = GX_VRAM_D, - GX_VRAM_LCDC_E = GX_VRAM_E, - GX_VRAM_LCDC_F = GX_VRAM_F, - GX_VRAM_LCDC_G = GX_VRAM_G, - GX_VRAM_LCDC_H = GX_VRAM_H, - GX_VRAM_LCDC_I = GX_VRAM_I, - GX_VRAM_LCDC_ALL = GX_VRAM_ALL + GX_VRAM_LCDC_A = GX_VRAM_A, + GX_VRAM_LCDC_B = GX_VRAM_B, + GX_VRAM_LCDC_C = GX_VRAM_C, + GX_VRAM_LCDC_D = GX_VRAM_D, + GX_VRAM_LCDC_E = GX_VRAM_E, + GX_VRAM_LCDC_F = GX_VRAM_F, + GX_VRAM_LCDC_G = GX_VRAM_G, + GX_VRAM_LCDC_H = GX_VRAM_H, + GX_VRAM_LCDC_I = GX_VRAM_I, + GX_VRAM_LCDC_ALL = GX_VRAM_ALL } GXVRamLCDC; typedef enum { - GX_VRAM_BG_NONE = 0x0000, - GX_VRAM_BG_16_F = GX_VRAM_F, - GX_VRAM_BG_16_G = GX_VRAM_G, - GX_VRAM_BG_32_FG = GX_VRAM_F | GX_VRAM_G, - GX_VRAM_BG_64_E = GX_VRAM_E, - GX_VRAM_BG_80_EF = GX_VRAM_E | GX_VRAM_F, - GX_VRAM_BG_96_EFG = GX_VRAM_E | GX_VRAM_F | GX_VRAM_G, - GX_VRAM_BG_128_A = GX_VRAM_A, - GX_VRAM_BG_128_B = GX_VRAM_B, - GX_VRAM_BG_128_C = GX_VRAM_C, - GX_VRAM_BG_128_D = GX_VRAM_D, - GX_VRAM_BG_256_AB = GX_VRAM_A | GX_VRAM_B, - GX_VRAM_BG_256_BC = GX_VRAM_B | GX_VRAM_C, - GX_VRAM_BG_256_CD = GX_VRAM_C | GX_VRAM_D, - GX_VRAM_BG_384_ABC = GX_VRAM_A | GX_VRAM_B | GX_VRAM_C, - GX_VRAM_BG_384_BCD = GX_VRAM_B | GX_VRAM_C | GX_VRAM_D, + GX_VRAM_BG_NONE = 0x0000, + GX_VRAM_BG_16_F = GX_VRAM_F, + GX_VRAM_BG_16_G = GX_VRAM_G, + GX_VRAM_BG_32_FG = GX_VRAM_F | GX_VRAM_G, + GX_VRAM_BG_64_E = GX_VRAM_E, + GX_VRAM_BG_80_EF = GX_VRAM_E | GX_VRAM_F, + GX_VRAM_BG_96_EFG = GX_VRAM_E | GX_VRAM_F | GX_VRAM_G, + GX_VRAM_BG_128_A = GX_VRAM_A, + GX_VRAM_BG_128_B = GX_VRAM_B, + GX_VRAM_BG_128_C = GX_VRAM_C, + GX_VRAM_BG_128_D = GX_VRAM_D, + GX_VRAM_BG_256_AB = GX_VRAM_A | GX_VRAM_B, + GX_VRAM_BG_256_BC = GX_VRAM_B | GX_VRAM_C, + GX_VRAM_BG_256_CD = GX_VRAM_C | GX_VRAM_D, + GX_VRAM_BG_384_ABC = GX_VRAM_A | GX_VRAM_B | GX_VRAM_C, + GX_VRAM_BG_384_BCD = GX_VRAM_B | GX_VRAM_C | GX_VRAM_D, GX_VRAM_BG_512_ABCD = GX_VRAM_A | GX_VRAM_B | GX_VRAM_C | GX_VRAM_D, - GX_VRAM_BG_80_EG = GX_VRAM_E | GX_VRAM_G, - GX_VRAM_BG_256_AC = GX_VRAM_A | GX_VRAM_C, - GX_VRAM_BG_256_AD = GX_VRAM_A | GX_VRAM_D, - GX_VRAM_BG_256_BD = GX_VRAM_B | GX_VRAM_D, - GX_VRAM_BG_384_ABD = GX_VRAM_A | GX_VRAM_B | GX_VRAM_D, - GX_VRAM_BG_384_ACD = GX_VRAM_A | GX_VRAM_C | GX_VRAM_D + GX_VRAM_BG_80_EG = GX_VRAM_E | GX_VRAM_G, + GX_VRAM_BG_256_AC = GX_VRAM_A | GX_VRAM_C, + GX_VRAM_BG_256_AD = GX_VRAM_A | GX_VRAM_D, + GX_VRAM_BG_256_BD = GX_VRAM_B | GX_VRAM_D, + GX_VRAM_BG_384_ABD = GX_VRAM_A | GX_VRAM_B | GX_VRAM_D, + GX_VRAM_BG_384_ACD = GX_VRAM_A | GX_VRAM_C | GX_VRAM_D } GXVRamBG; typedef enum { - GX_VRAM_OBJ_NONE = 0x0000, - GX_VRAM_OBJ_16_F = GX_VRAM_F, - GX_VRAM_OBJ_16_G = GX_VRAM_G, - GX_VRAM_OBJ_32_FG = GX_VRAM_F | GX_VRAM_G, - GX_VRAM_OBJ_64_E = GX_VRAM_E, - GX_VRAM_OBJ_80_EF = GX_VRAM_E | GX_VRAM_F, - GX_VRAM_OBJ_80_EG = GX_VRAM_E | GX_VRAM_G, + GX_VRAM_OBJ_NONE = 0x0000, + GX_VRAM_OBJ_16_F = GX_VRAM_F, + GX_VRAM_OBJ_16_G = GX_VRAM_G, + GX_VRAM_OBJ_32_FG = GX_VRAM_F | GX_VRAM_G, + GX_VRAM_OBJ_64_E = GX_VRAM_E, + GX_VRAM_OBJ_80_EF = GX_VRAM_E | GX_VRAM_F, + GX_VRAM_OBJ_80_EG = GX_VRAM_E | GX_VRAM_G, GX_VRAM_OBJ_96_EFG = GX_VRAM_E | GX_VRAM_F | GX_VRAM_G, - GX_VRAM_OBJ_128_A = GX_VRAM_A, - GX_VRAM_OBJ_128_B = GX_VRAM_B, + GX_VRAM_OBJ_128_A = GX_VRAM_A, + GX_VRAM_OBJ_128_B = GX_VRAM_B, GX_VRAM_OBJ_256_AB = GX_VRAM_A | GX_VRAM_B } GXVRamOBJ; typedef enum { - GX_VRAM_TEX_NONE = 0x0000, - GX_VRAM_TEX_0_A = GX_VRAM_A, - GX_VRAM_TEX_0_B = GX_VRAM_B, - GX_VRAM_TEX_0_C = GX_VRAM_C, - GX_VRAM_TEX_0_D = GX_VRAM_D, - GX_VRAM_TEX_01_AB = GX_VRAM_A | GX_VRAM_B, - GX_VRAM_TEX_01_BC = GX_VRAM_B | GX_VRAM_C, - GX_VRAM_TEX_01_CD = GX_VRAM_C | GX_VRAM_D, - GX_VRAM_TEX_012_ABC = GX_VRAM_A | GX_VRAM_B | GX_VRAM_C, - GX_VRAM_TEX_012_BCD = GX_VRAM_B | GX_VRAM_C | GX_VRAM_D, + GX_VRAM_TEX_NONE = 0x0000, + GX_VRAM_TEX_0_A = GX_VRAM_A, + GX_VRAM_TEX_0_B = GX_VRAM_B, + GX_VRAM_TEX_0_C = GX_VRAM_C, + GX_VRAM_TEX_0_D = GX_VRAM_D, + GX_VRAM_TEX_01_AB = GX_VRAM_A | GX_VRAM_B, + GX_VRAM_TEX_01_BC = GX_VRAM_B | GX_VRAM_C, + GX_VRAM_TEX_01_CD = GX_VRAM_C | GX_VRAM_D, + GX_VRAM_TEX_012_ABC = GX_VRAM_A | GX_VRAM_B | GX_VRAM_C, + GX_VRAM_TEX_012_BCD = GX_VRAM_B | GX_VRAM_C | GX_VRAM_D, GX_VRAM_TEX_0123_ABCD = GX_VRAM_A | GX_VRAM_B | GX_VRAM_C | GX_VRAM_D, - GX_VRAM_TEX_01_AC = GX_VRAM_A | GX_VRAM_C, - GX_VRAM_TEX_01_AD = GX_VRAM_A | GX_VRAM_D, - GX_VRAM_TEX_01_BD = GX_VRAM_B | GX_VRAM_D, - GX_VRAM_TEX_012_ABD = GX_VRAM_A | GX_VRAM_B | GX_VRAM_D, - GX_VRAM_TEX_012_ACD = GX_VRAM_A | GX_VRAM_C | GX_VRAM_D + GX_VRAM_TEX_01_AC = GX_VRAM_A | GX_VRAM_C, + GX_VRAM_TEX_01_AD = GX_VRAM_A | GX_VRAM_D, + GX_VRAM_TEX_01_BD = GX_VRAM_B | GX_VRAM_D, + GX_VRAM_TEX_012_ABD = GX_VRAM_A | GX_VRAM_B | GX_VRAM_D, + GX_VRAM_TEX_012_ACD = GX_VRAM_A | GX_VRAM_C | GX_VRAM_D } GXVRamTex; typedef enum { - GX_VRAM_CLEARIMAGE_NONE = 0x0000, + GX_VRAM_CLEARIMAGE_NONE = 0x0000, GX_VRAM_CLEARIMAGE_256_AB = GX_VRAM_A | GX_VRAM_B, GX_VRAM_CLEARIMAGE_256_CD = GX_VRAM_C | GX_VRAM_D, - GX_VRAM_CLEARDEPTH_128_A = GX_VRAM_A, - GX_VRAM_CLEARDEPTH_128_B = GX_VRAM_B, - GX_VRAM_CLEARDEPTH_128_C = GX_VRAM_C, - GX_VRAM_CLEARDEPTH_128_D = GX_VRAM_D + GX_VRAM_CLEARDEPTH_128_A = GX_VRAM_A, + GX_VRAM_CLEARDEPTH_128_B = GX_VRAM_B, + GX_VRAM_CLEARDEPTH_128_C = GX_VRAM_C, + GX_VRAM_CLEARDEPTH_128_D = GX_VRAM_D } GXVRamClearImage; typedef enum { - GX_VRAM_TEXPLTT_NONE = 0x0000, - GX_VRAM_TEXPLTT_0_F = GX_VRAM_F, - GX_VRAM_TEXPLTT_0_G = GX_VRAM_G, - GX_VRAM_TEXPLTT_01_FG = GX_VRAM_F | GX_VRAM_G, - GX_VRAM_TEXPLTT_0123_E = GX_VRAM_E, - GX_VRAM_TEXPLTT_01234_EF = GX_VRAM_E | GX_VRAM_F, + GX_VRAM_TEXPLTT_NONE = 0x0000, + GX_VRAM_TEXPLTT_0_F = GX_VRAM_F, + GX_VRAM_TEXPLTT_0_G = GX_VRAM_G, + GX_VRAM_TEXPLTT_01_FG = GX_VRAM_F | GX_VRAM_G, + GX_VRAM_TEXPLTT_0123_E = GX_VRAM_E, + GX_VRAM_TEXPLTT_01234_EF = GX_VRAM_E | GX_VRAM_F, GX_VRAM_TEXPLTT_012345_EFG = GX_VRAM_E | GX_VRAM_F | GX_VRAM_G } GXVRamTexPltt; typedef enum { - GX_VRAM_BGEXTPLTT_NONE = 0x0000, - GX_VRAM_BGEXTPLTT_01_F = GX_VRAM_F, - GX_VRAM_BGEXTPLTT_23_G = GX_VRAM_G, - GX_VRAM_BGEXTPLTT_0123_E = GX_VRAM_E, + GX_VRAM_BGEXTPLTT_NONE = 0x0000, + GX_VRAM_BGEXTPLTT_01_F = GX_VRAM_F, + GX_VRAM_BGEXTPLTT_23_G = GX_VRAM_G, + GX_VRAM_BGEXTPLTT_0123_E = GX_VRAM_E, GX_VRAM_BGEXTPLTT_0123_FG = GX_VRAM_F | GX_VRAM_G } GXVRamBGExtPltt; typedef enum { GX_VRAM_OBJEXTPLTT_NONE = 0, - GX_VRAM_OBJEXTPLTT_0_F = GX_VRAM_F, - GX_VRAM_OBJEXTPLTT_0_G = GX_VRAM_G + GX_VRAM_OBJEXTPLTT_0_F = GX_VRAM_F, + GX_VRAM_OBJEXTPLTT_0_G = GX_VRAM_G } GXVRamOBJExtPltt; typedef enum { - GX_VRAM_SUB_BG_NONE = 0x0000, + GX_VRAM_SUB_BG_NONE = 0x0000, GX_VRAM_SUB_BG_128_C = GX_VRAM_C, - GX_VRAM_SUB_BG_32_H = GX_VRAM_H, + GX_VRAM_SUB_BG_32_H = GX_VRAM_H, GX_VRAM_SUB_BG_48_HI = GX_VRAM_H | GX_VRAM_I } GXVRamSubBG; typedef enum { - GX_VRAM_SUB_OBJ_NONE = 0x0000, + GX_VRAM_SUB_OBJ_NONE = 0x0000, GX_VRAM_SUB_OBJ_128_D = GX_VRAM_D, - GX_VRAM_SUB_OBJ_16_I = GX_VRAM_I + GX_VRAM_SUB_OBJ_16_I = GX_VRAM_I } GXVRamSubOBJ; typedef enum { - GX_VRAM_SUB_BGEXTPLTT_NONE = 0x0000, + GX_VRAM_SUB_BGEXTPLTT_NONE = 0x0000, GX_VRAM_SUB_BGEXTPLTT_0123_H = GX_VRAM_H } GXVRamSubBGExtPltt; typedef enum { GX_VRAM_SUB_OBJEXTPLTT_NONE = 0x0000, - GX_VRAM_SUB_OBJEXTPLTT_0_I = GX_VRAM_I + GX_VRAM_SUB_OBJEXTPLTT_0_I = GX_VRAM_I } GXVRamSubOBJExtPltt; void GX_SetBankForLCDC(GXVRamLCDC lcdc); @@ -212,4 +212,8 @@ GXVRamSubOBJ GX_DisableBankForSubOBJ(void); GXVRamSubBGExtPltt GX_DisableBankForSubBGExtPltt(void); GXVRamSubOBJExtPltt GX_DisableBankForSubOBJExtPltt(void); -#endif //NITRO_GX_GX_VRAMCNT_H_ +static inline void *G2_GetOBJCharPtr() { + return (void *)HW_OBJ_VRAM; +} + +#endif // NITRO_GX_GX_VRAMCNT_H_ diff --git a/main.lsf b/main.lsf index 369e5178fa..58499ce224 100644 --- a/main.lsf +++ b/main.lsf @@ -36,7 +36,7 @@ Static main Object src/msgdata.o Object src/message_format.o Object src/message_printer.o - Object asm/unk_0200CE7C.o + Object src/unk_0200CE7C.o Object src/unk_0200CF18.o Object src/sys_task_api.o Object asm/render_window.o @@ -281,7 +281,7 @@ Static main Object asm/unk_02087A78.o Object asm/unk_02087E70.o Object asm/unk_02087FD4.o - Object asm/unk_0208805C.o + Object src/unk_0208805C.o Object asm/unk_02088288.o Object asm/unk_0208B1AC.o Object asm/unk_0208C3E4.o @@ -581,7 +581,7 @@ Overlay OVY_12 Object asm/overlay_12_battle_controller_opponent.o Object src/battle/battle_02261FD4.o Object asm/overlay_12_battle_controller.o - Object asm/overlay_12_hp_bar.o + Object src/battle/battle_hp_bar.o Object asm/overlay_12_02265E28.o Object src/battle/battle_input.o Object asm/overlay_12_02266024.o diff --git a/src/battle/battle_022378C0.c b/src/battle/battle_022378C0.c index 85230151c2..c3179e78ca 100644 --- a/src/battle/battle_022378C0.c +++ b/src/battle/battle_022378C0.c @@ -189,8 +189,8 @@ void ov12_02237B6C(BattleSystem *bsys) { RemoveWindow(bsys->window); ov12_02238A30(bsys->bgConfig); ov12_02238A64(bsys); - SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(bsys->unk90, bsys->unk94); - SpriteRenderer_Delete(bsys->unk90); + SpriteRenderer_UnloadResourcesAndRemoveGfxHandler(bsys->spriteRenderer, bsys->gfxHandler); + SpriteRenderer_Delete(bsys->spriteRenderer); GF_DestroyVramTransferManager(); FontID_Release(4); } @@ -231,7 +231,7 @@ void ov12_02237BB8(BattleSystem *bsys) { TextPrinter_SetDownArrowBaseTile(1); ov12_0223A620(bsys); - G2dRenderer_SetSubSurfaceCoords(SpriteRenderer_GetG2dRendererPtr(bsys->unk90), 0, FX32_CONST(272)); + G2dRenderer_SetSubSurfaceCoords(SpriteRenderer_GetG2dRendererPtr(bsys->spriteRenderer), 0, FX32_CONST(272)); } void ov12_02237CC4(BattleSystem *bsys) { diff --git a/src/battle/battle_hp_bar.c b/src/battle/battle_hp_bar.c new file mode 100644 index 0000000000..1b8e091df7 --- /dev/null +++ b/src/battle/battle_hp_bar.c @@ -0,0 +1,1756 @@ +#include "battle/battle_hp_bar.h" + +#include "global.h" + +#include "battle/battle_system.h" +#include "msgdata/msg/msg_0197.h" + +#include "math_util.h" +#include "unk_0208805C.h" + +typedef enum HPBarType { + HP_BAR_TYPE_SINGLE_PLAYER, + HP_BAR_TYPE_SINGLE_ENEMY, + HP_BAR_TYPE_DOUBLE_PLAYER_LHS, + HP_BAR_TYPE_DOUBLE_ENEMY_LHS, + HP_BAR_TYPE_DOUBLE_PLAYER_RHS, + HP_BAR_TYPE_DOUBLE_ENEMY_RHS, + HP_BAR_TYPE_SAFARI, + HP_BAR_TYPE_PALPARK, +} HPBarType; + +#ifdef FAST_HP_BARS +#define USE_SUBPIXELS_TEST (TRUE) +#else +#define USE_SUBPIXELS_TEST (maxHp < pixelsWide) +#endif // FAST_HP_BARS + +ALIGN(4) +static const s8 sHpBarArrowXOffsets[] = { + 72, + 0, + 72, + 0, + 72, + 0, +}; + +typedef struct UnkStruct_ov12_0226D408 { + u16 offset; + u16 size; +} UnkStruct_ov12_0226D408; + +static const UnkStruct_ov12_0226D408 ov12_0226D680[][4] = { + { + { 0x260, 0xA0 }, + { 0x360, 0xA0 }, + { 0xA00, 0x60 }, + { 0xB00, 0x60 }, + }, + { + { 0x220, 0xE0 }, + { 0x320, 0xE0 }, + { 0xA00, 0x20 }, + { 0xB00, 0x20 }, + }, + { + { 0x240, 0xC0 }, + { 0x340, 0xC0 }, + { 0xA00, 0x40 }, + { 0xB00, 0x40 }, + }, + { + { 0x220, 0xE0 }, + { 0x320, 0xE0 }, + { 0xA00, 0x20 }, + { 0xB00, 0x20 }, + }, + { + { 0x240, 0xC0 }, + { 0x340, 0xC0 }, + { 0xA00, 0x40 }, + { 0xB00, 0x40 }, + }, + { + { 0x220, 0xE0 }, + { 0x320, 0xE0 }, + { 0xA00, 0x20 }, + { 0xB00, 0x20 }, + }, +}; + +static const UnkStruct_ov12_0226D408 ov12_0226D4B0[][2] = { + { + { 0xA60, 0x40 }, + { 0xB60, 0x40 }, + }, + { + { 0xA20, 0x40 }, + { 0xB20, 0x40 }, + }, + { + { 0xA40, 0x40 }, + { 0xB40, 0x40 }, + }, + { + { 0xA20, 0x40 }, + { 0xB20, 0x40 }, + }, + { + { 0xA40, 0x40 }, + { 0xB40, 0x40 }, + }, + { + { 0xA20, 0x40 }, + { 0xB20, 0x40 }, + }, +}; + +static const UnkStruct_ov12_0226D408 ov12_0226D420[][2] = { + { + { 0xAA0, 0x60 }, + { 0xBA0, 0x60 }, + }, + { + { 0xA60, 0x60 }, + { 0xB60, 0x60 }, + }, + { + { 0xA80, 0x60 }, + { 0xB80, 0x60 }, + }, + { + { 0xA60, 0x60 }, + { 0xB60, 0x60 }, + }, + { + { 0xA80, 0x60 }, + { 0xB80, 0x60 }, + }, + { + { 0xA60, 0x60 }, + { 0xB60, 0x60 }, + }, +}; + +static const UnkStruct_ov12_0226D408 ov12_0226D450[][2] = { + { + { 0, 0 }, + { 0xD00, 0x60 }, + }, + { + { 0x620, 0x60 }, + { 0, 0 }, + }, + { + { 0, 0 }, + { 0xC00, 0x60 }, + }, + { + { 0x620, 0x60 }, + { 0, 0 }, + }, + { + { 0, 0 }, + { 0xC00, 0x60 }, + }, + { + { 0x620, 0x60 }, + { 0, 0 }, + }, +}; + +static const UnkStruct_ov12_0226D408 ov12_0226D3F0[] = { + { 0xD80, 0x60 }, + { 0x6A0, 0x60 }, + { 0xC80, 0x60 }, + { 0x6A0, 0x60 }, + { 0xC80, 0x60 }, + { 0x6A0, 0x60 }, +}; + +static const UnkStruct_ov12_0226D408 ov12_0226D480[][2] = { + { + { 0x4E0, 0 }, + { 0xC20, 0xC0 }, + }, + { + { 0x4E0, 0x20 }, + { 0xC00, 0xA0 }, + }, + { + { 0x4E0, 0 }, + { 0xC00, 0xC0 }, + }, + { + { 0x4E0, 0x20 }, + { 0xC00, 0xA0 }, + }, + { + { 0x4E0, 0 }, + { 0xC00, 0xC0 }, + }, + { + { 0x4E0, 0x20 }, + { 0xC00, 0xA0 }, + }, +}; + +static const UnkStruct_ov12_0226D408 ov12_0226D3C0[] = { + { 0x460, 0x20 }, + { 0x420, 0x20 }, + { 0x440, 0x20 }, + { 0x420, 0x20 }, + { 0x440, 0x20 }, + { 0x420, 0x20 }, +}; + +static const UnkStruct_ov12_0226D408 ov12_0226D390[] = { + { 0x480, 0x60 }, + { 0x440, 0x60 }, + { 0x460, 0x60 }, + { 0x440, 0x60 }, + { 0x460, 0x60 }, + { 0x440, 0x60 }, +}; + +static const UnkStruct_ov12_0226D408 ov12_0226D370[] = { + { 0x240, 0xC0 }, + { 0x340, 0xC0 }, + { 0xA00, 0xE0 }, + { 0xB00, 0xE0 }, +}; + +static const UnkStruct_ov12_0226D408 ov12_0226D380[] = { + { 0x440, 0xC0 }, + { 0x540, 0xC0 }, + { 0xC00, 0xE0 }, + { 0xD00, 0xE0 }, +}; + +static const UnkStruct_ov12_0226D408 ov12_0226D3A8[] = { + { 0, 0 }, + { 0, 0 }, + { 0x4C0, 0x40 }, + { 0, 0 }, + { 0x4C0, 0x40 }, + { 0, 0 }, +}; + +static const UnkStruct_ov12_0226D408 ov12_0226D3D8[] = { + { 0, 0 }, + { 0, 0 }, + { 0xCC0, 0x20 }, + { 0, 0 }, + { 0xCC0, 0x20 }, + { 0, 0 }, +}; + +static const UnkStruct_ov12_0226D408 ov12_0226D408[] = { + { 0, 0 }, + { 0, 0 }, + { 0xC60, 0x20 }, + { 0, 0 }, + { 0xC60, 0x20 }, + { 0, 0 }, +}; + +static void ov12_02264824(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, PaletteData *plttData, int barType); +static void ov12_022648EC(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, PaletteData *plttData, int barType); +static UnkImageStruct *ov12_02264968(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int barType); +static void ov12_02264B28(BattleHpBar *hpBar); +static void ov12_02264B4C(BattleHpBar *hpBar); +static void ov12_02264B60(BattleHpBar *hpBar); +static void ov12_02264B94(BattleHpBar *hpBar); +static void ov12_02264F00(BattleHpBar *hpBar, int a1); +static void ov12_02264F44(BattleHpBar *hpBar, int x, int y); +static void ov12_02265054(SysTask *task, void *data); +static void ov12_0226516C(BattleHpBar *hpBar); +static void ov12_022652D0(BattleHpBar *hpBar); +static void ov12_02265354(BattleHpBar *hpBar); +static void ov12_02265474(BattleHpBar *hpBar, u32 num); +static void ov12_02265500(BattleHpBar *hpBar); +static void ov12_02265560(BattleHpBar *hpBar); +static void ov12_022655B0(BattleHpBar *hpBar, int a1); +static void BattleHpBar_PrintSafariOrParkBallsString(BattleHpBar *hpBar, u32 flag); +static void BattleHpBar_PrintNumRemainingSafariOrParkBalls(BattleHpBar *hpBar, u32 flag); +static int ov12_022657E4(BattleHpBar *hpBar, BOOL isExp); +static void ov12_02265878(BattleHpBar *hpBar, u8 isExp); +static int BattleHpBar_CalculatePixelsChangeFrame(s32 maxHp, s32 curHp, s32 deltaHp, s32 *pHpCalc, u8 tilesWide, u16 hpChange); +static u8 BattleHpBar_Util_MakeHpBarPixelBuffer(s32 maxHp, s32 hp, s32 deltaHp, s32 *pHpCalc, u8 *pixelBuf, u8 tilesWide); +static u32 BattleHpBar_Util_GetPixelsToGain(s32 exp, s32 gainedExp, s32 maxExp, u8 tilesWide); +static const u8 *BattleHpBar_Util_GetComponentRawGraphic(int componentId); +static const UnkTemplate_0200D748 *BattleHpBar_Util_GetHpBoxSpriteTemplate(u8 barType); +static const UnkTemplate_0200D748 *BattleHpBar_Util_GetArrowSpriteTemplate(u8 barType); +static void Task_ExpBarFullFlash(SysTask *task, void *data); +static void ov12_02265D78(BattleHpBar *hpBar); +static void ov12_02265DA0(BattleHpBar *hpBar); +static void ov12_02265DC4(SysTask *task, void *data); + +static const UnkTemplate_0200D748 sSpriteTemplate_HpBarSinglePlayer = { + .x = 0xC0, + .y = 0x74, + .z = 0, + .animation = 0, + .spritePriority = 0x17, + .pal = 0, + .vram = NNS_G2D_VRAM_TYPE_2DMAIN, + .resIdList = { + 0xBF, + 20006, + 0xBE, + 0xBD, + -1, + -1, + }, + .bgPriority = 0, + .vramTransfer = 0 +}; + +static const UnkTemplate_0200D748 sSpriteTemplate_HpBarSingleEnemy = { + .x = 0x3A, + .y = 0x24, + .z = 0, + .animation = 0, + .spritePriority = 0x18, + .pal = 0, + .vram = NNS_G2D_VRAM_TYPE_2DMAIN, + .resIdList = { + 0xBC, + 20006, + 0xBB, + 0xBA, + -1, + -1, + }, + .bgPriority = 0, + .vramTransfer = 0 +}; + +static const UnkTemplate_0200D748 sSpriteTemplate_HpBarDoublePlayerLHS = { + .x = 0xC0, + .y = 0x67, + .z = 0, + .animation = 0, + .spritePriority = 0x1C, + .pal = 0, + .vram = NNS_G2D_VRAM_TYPE_2DMAIN, + .resIdList = { + 0xC8, + 20006, + 0xC7, + 0xC6, + -1, + -1, + }, + .bgPriority = 0, + .vramTransfer = 0 +}; + +static const UnkTemplate_0200D748 sSpriteTemplate_HpBarDoubleEnemyLHS = { + .x = 0x40, + .y = 0x10, + .z = 0, + .animation = 0, + .spritePriority = 0x19, + .pal = 0, + .vram = NNS_G2D_VRAM_TYPE_2DMAIN, + .resIdList = { + 0xC2, + 20006, + 0xC1, + 0xC0, + -1, + -1, + }, + .bgPriority = 0, + .vramTransfer = 0 +}; + +static const UnkTemplate_0200D748 sSpriteTemplate_HpBarDoublePlayerRHS = { + .x = 0xC6, + .y = 0x84, + .z = 0, + .animation = 0, + .spritePriority = 0x1A, + .pal = 0, + .vram = NNS_G2D_VRAM_TYPE_2DMAIN, + .resIdList = { + 0xCB, + 20006, + 0xCA, + 0xC9, + -1, + -1, + }, + .bgPriority = 0, + .vramTransfer = 0 +}; + +static const UnkTemplate_0200D748 sSpriteTemplate_HpBarDoubleEnemyRHS = { + .x = 0x3A, + .y = 0x2D, + .z = 0, + .animation = 0, + .spritePriority = 0x1B, + .pal = 0, + .vram = NNS_G2D_VRAM_TYPE_2DMAIN, + .resIdList = { + 0xC5, + 20006, + 0xC4, + 0xC3, + -1, + -1, + }, + .bgPriority = 0, + .vramTransfer = 0 +}; + +static const UnkTemplate_0200D748 sSpriteTemplate_Arrow = { + .x = 0, + .y = 0, + .z = 0, + .animation = 0, + .spritePriority = 0x11, + .pal = 0, + .vram = NNS_G2D_VRAM_TYPE_2DMAIN, + .resIdList = { + 0xB9, + 20006, + 0xB8, + 0xB7, + -1, + -1, + }, + .bgPriority = 0, + .vramTransfer = 0 +}; + +static const UnkTemplate_0200D748 sSpriteTemplate_HpBarSafariOrPark = { + .x = 0xC0, + .y = 0x74, + .z = 0, + .animation = 0, + .spritePriority = 0x17, + .pal = 0, + .vram = NNS_G2D_VRAM_TYPE_2DMAIN, + .resIdList = { + 0xFD, + 20008, + 0xFE, + 0xFF, + -1, + -1, + }, + .bgPriority = 0, + .vramTransfer = 0 +}; + +#include "battle/battle_hp_bar_data.h" + +static void ov12_02264824(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, PaletteData *plttData, int barType) { + const UnkTemplate_0200D748 *pRes = BattleHpBar_Util_GetHpBoxSpriteTemplate(barType); + + SpriteRenderer_LoadCharResObjFromOpenNarc(renderer, gfxHandler, narc, pRes->resIdList[GF_GFX_RES_TYPE_CHAR], TRUE, NNS_G2D_VRAM_TYPE_2DMAIN, pRes->resIdList[GF_GFX_RES_TYPE_CHAR]); + sub_0200D68C(plttData, PLTTBUF_MAIN_OBJ, renderer, gfxHandler, narc, 71, FALSE, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20006); + SpriteRenderer_LoadCellResObjFromOpenNarc(renderer, gfxHandler, narc, pRes->resIdList[GF_GFX_RES_TYPE_CELL], TRUE, pRes->resIdList[GF_GFX_RES_TYPE_CELL]); + SpriteRenderer_LoadAnimResObjFromOpenNarc(renderer, gfxHandler, narc, pRes->resIdList[GF_GFX_RES_TYPE_ANIM], TRUE, pRes->resIdList[GF_GFX_RES_TYPE_ANIM]); + sub_0200D68C(plttData, PLTTBUF_MAIN_OBJ, renderer, gfxHandler, narc, 71, FALSE, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20007); + if (barType == 6 || barType == 7) { + sub_0200D68C(plttData, PLTTBUF_MAIN_OBJ, renderer, gfxHandler, narc, 81, FALSE, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20008); + } +} + +static void ov12_022648EC(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, PaletteData *plttData, int barType) { + const UnkTemplate_0200D748 *pRes = BattleHpBar_Util_GetArrowSpriteTemplate(barType); + + if (pRes != NULL) { + SpriteRenderer_LoadCharResObjFromOpenNarc(renderer, gfxHandler, narc, pRes->resIdList[GF_GFX_RES_TYPE_CHAR], TRUE, NNS_G2D_VRAM_TYPE_2DMAIN, pRes->resIdList[GF_GFX_RES_TYPE_CHAR]); + sub_0200D68C(plttData, PLTTBUF_MAIN_OBJ, renderer, gfxHandler, narc, 71, FALSE, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20006); + SpriteRenderer_LoadCellResObjFromOpenNarc(renderer, gfxHandler, narc, pRes->resIdList[GF_GFX_RES_TYPE_CELL], TRUE, pRes->resIdList[GF_GFX_RES_TYPE_CELL]); + SpriteRenderer_LoadAnimResObjFromOpenNarc(renderer, gfxHandler, narc, pRes->resIdList[GF_GFX_RES_TYPE_ANIM], TRUE, pRes->resIdList[GF_GFX_RES_TYPE_ANIM]); + } +} + +static UnkImageStruct *ov12_02264968(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, int barType) { + const UnkTemplate_0200D748 *pRes = BattleHpBar_Util_GetHpBoxSpriteTemplate(barType); + + UnkImageStruct *ret = SpriteRenderer_LoadResourcesAndCreateSprite(renderer, gfxHandler, pRes); + TickSpriteAnimation1Frame(ret->sprite); + return ret; +} + +void ov12_0226498C(BattleHpBar *hpBar, u32 num, u32 flag) { + GF_ASSERT(hpBar->boxObj != NULL); + if (hpBar->type == HP_BAR_TYPE_SAFARI) { + flag &= 0xC00; + } else if (hpBar->type == HP_BAR_TYPE_PALPARK) { + flag &= 0x3000; + } else { + flag &= ~0x3C00; + } + switch (hpBar->type) { + case HP_BAR_TYPE_SINGLE_ENEMY: + case HP_BAR_TYPE_DOUBLE_ENEMY_LHS: + case HP_BAR_TYPE_DOUBLE_ENEMY_RHS: + flag &= ~0x26; + break; + case HP_BAR_TYPE_DOUBLE_PLAYER_LHS: + case HP_BAR_TYPE_DOUBLE_PLAYER_RHS: + flag &= ~0x220; + if (hpBar->unk_4F_3 == 0) { + flag &= ~6; + } else { + flag &= ~1; + } + break; + case HP_BAR_TYPE_SINGLE_PLAYER: + flag &= ~0x200; + break; + case HP_BAR_TYPE_SAFARI: + case HP_BAR_TYPE_PALPARK: + break; + } + if (BattleSystem_GetBattleType(hpBar->bsys) & BATTLE_TYPE_TRAINER) { + flag &= ~0x200; + } + + if (flag & 1) { + ov12_02264DCC(hpBar, 0); + ov12_022657E4(hpBar, FALSE); + } + + if (flag & 2) { + ov12_02265474(hpBar, num); + } + + if (flag & 4) { + ov12_02265500(hpBar); + } + + if (flag & 0x80 || flag & 0x40) { + ov12_022652D0(hpBar); + } + + if (flag & 8) { + ov12_02265354(hpBar); + } + + if (flag & 0x10) { + ov12_0226516C(hpBar); + } + + if (flag & 0x20) { + ov12_02264E34(hpBar, 0); + ov12_022657E4(hpBar, TRUE); + } + + if (flag & 0x200) { + ov12_02265560(hpBar); + } + + if (flag & 0x100) { + switch (hpBar->unk_4A) { + case 0: + default: + ov12_022655B0(hpBar, 38); + break; + case 1: + ov12_022655B0(hpBar, 47); + break; + case 2: + ov12_022655B0(hpBar, 50); + break; + case 3: + ov12_022655B0(hpBar, 53); + break; + case 4: + ov12_022655B0(hpBar, 44); + break; + case 5: + ov12_022655B0(hpBar, 41); + break; + } + } + + if (flag & 0x1400) { + BattleHpBar_PrintSafariOrParkBallsString(hpBar, flag); + } + + if (flag & 0x2800) { + BattleHpBar_PrintNumRemainingSafariOrParkBalls(hpBar, flag); + } +} + +static void ov12_02264B28(BattleHpBar *hpBar) { + if (hpBar->sysTask != NULL) { + SysTask_Destroy(hpBar->sysTask); + hpBar->sysTask = NULL; + } + if (hpBar->boxObj != NULL) { + UnkImageStruct_Delete(hpBar->boxObj); + hpBar->boxObj = NULL; + } +} + +static void ov12_02264B4C(BattleHpBar *hpBar) { + if (hpBar->arrowObj != NULL) { + UnkImageStruct_Delete(hpBar->arrowObj); + hpBar->arrowObj = NULL; + } +} + +static void ov12_02264B60(BattleHpBar *hpBar) { + const UnkTemplate_0200D748 *tmplate = BattleHpBar_Util_GetHpBoxSpriteTemplate(hpBar->type); + SpriteRenderer *renderer = BattleSystem_GetSpriteRenderer(hpBar->bsys); + SpriteGfxHandler *gfxHandler = BattleSystem_GetGfxHandler(hpBar->bsys); + SpriteGfxHandler_UnloadCharObjById(gfxHandler, tmplate->resIdList[GF_GFX_RES_TYPE_CHAR]); + SpriteGfxHandler_UnloadCellObjById(gfxHandler, tmplate->resIdList[GF_GFX_RES_TYPE_CELL]); + SpriteGfxHandler_UnloadAnimObjById(gfxHandler, tmplate->resIdList[GF_GFX_RES_TYPE_ANIM]); +} + +static void ov12_02264B94(BattleHpBar *hpBar) { + const UnkTemplate_0200D748 *tmplate = BattleHpBar_Util_GetArrowSpriteTemplate(hpBar->type); + if (tmplate != NULL) { + SpriteRenderer *renderer = BattleSystem_GetSpriteRenderer(hpBar->bsys); + SpriteGfxHandler *gfxHandler = BattleSystem_GetGfxHandler(hpBar->bsys); + SpriteGfxHandler_UnloadCharObjById(gfxHandler, tmplate->resIdList[GF_GFX_RES_TYPE_CHAR]); + SpriteGfxHandler_UnloadCellObjById(gfxHandler, tmplate->resIdList[GF_GFX_RES_TYPE_CELL]); + SpriteGfxHandler_UnloadAnimObjById(gfxHandler, tmplate->resIdList[GF_GFX_RES_TYPE_ANIM]); + } +} + +#ifdef NONMATCHING +void BattleHpBar_LoadResources(BattleHpBar *hpBar) { + const UnkTemplate_0200D748 *tmplate; + SpriteRenderer *renderer; + SpriteGfxHandler *gfxHandler; + PaletteData *plttData; + NARC *narc; + + narc = NARC_New(NARC_a_0_0_8, HEAP_ID_BATTLE); + + renderer = BattleSystem_GetSpriteRenderer(hpBar->bsys); + gfxHandler = BattleSystem_GetGfxHandler(hpBar->bsys); + plttData = BattleSystem_GetPaletteData(hpBar->bsys); + + tmplate = BattleHpBar_Util_GetHpBoxSpriteTemplate(hpBar->type); + + ov12_02264824(renderer, gfxHandler, narc, plttData, hpBar->type); + hpBar->boxObj = ov12_02264968(renderer, gfxHandler, hpBar->type); + + ov12_022648EC(renderer, gfxHandler, narc, plttData, hpBar->type); + if (hpBar->arrowObj != NULL) { + Sprite_SetPositionXY(hpBar->arrowObj->sprite, tmplate->x - sHpBarArrowXOffsets[hpBar->type], tmplate->y + 0); + } + NARC_Delete(narc); +} +#else +// clang-format off +asm void BattleHpBar_LoadResources(BattleHpBar *hpBar) { + push {r4, r5, r6, r7, lr} + sub sp, #0xc + add r5, r0, #0 + mov r0, #8 + mov r1, #5 + bl NARC_New + add r6, r0, #0 + ldr r0, [r5, #0xc] + bl BattleSystem_GetSpriteRenderer + add r7, r0, #0 + ldr r0, [r5, #0xc] + bl BattleSystem_GetGfxHandler + str r0, [sp, #4] + ldr r0, [r5, #0xc] + bl BattleSystem_GetPaletteData + str r0, [sp, #8] + add r0, r5, #0 + add r0, #0x25 + ldrb r0, [r0, #0] + bl BattleHpBar_Util_GetHpBoxSpriteTemplate + add r4, r0, #0 + add r0, r5, #0 + add r0, #0x25 + ldrb r0, [r0, #0] + ldr r1, [sp, #4] + ldr r3, [sp, #8] + str r0, [sp, #0] + add r0, r7, #0 + add r2, r6, #0 + bl ov12_02264824 + add r2, r5, #0 + add r2, #0x25 + ldrb r2, [r2, #0] + ldr r1, [sp, #4] + add r0, r7, #0 + bl ov12_02264968 + str r0, [r5, #4] + add r0, r5, #0 + add r0, #0x25 + ldrb r0, [r0, #0] + ldr r1, [sp, #4] + ldr r3, [sp, #8] + str r0, [sp, #0] + add r0, r7, #0 + add r2, r6, #0 + bl ov12_022648EC + ldr r0, [r5, #8] + cmp r0, #0 + beq _02264C5A + add r5, #0x25 + ldrb r3, [r5, #0] + ldr r2, =sHpBarArrowXOffsets + mov r1, #0 + ldrsh r1, [r4, r1] + ldrsb r2, [r2, r3] + ldr r0, [r0, #0] + sub r1, r1, r2 + mov r2, #2 + lsl r1, r1, #0x10 + ldrsh r2, [r4, r2] + asr r1, r1, #0x10 + bl Sprite_SetPositionXY +_02264C5A: + add r0, r6, #0 + bl NARC_Delete + add sp, #0xc + pop {r4, r5, r6, r7, pc} +} +// clang-format on +#endif // NONMATCHING + +void BattleHpBar_FreeResources(BattleHpBar *hpBar) { + ov12_02264B28(hpBar); + ov12_02264B60(hpBar); + ov12_02264B4C(hpBar); + ov12_02264B94(hpBar); +} + +void ov12_02264C84(BattleHpBar *hpBar) { + const u8 *src; + void *vramBaseAddr; + NNSG2dImageProxy *imgProxy; + + switch (hpBar->type) { + case HP_BAR_TYPE_DOUBLE_PLAYER_LHS: + case HP_BAR_TYPE_DOUBLE_PLAYER_RHS: + hpBar->unk_4F_3 ^= 1; + vramBaseAddr = G2_GetOBJCharPtr(); + imgProxy = Sprite_GetImageProxy(hpBar->boxObj->sprite); + if (hpBar->unk_4F_3 == 1) { + src = BattleHpBar_Util_GetComponentRawGraphic(70); + MI_CpuCopy16(src, (void *)((u32)vramBaseAddr + ov12_0226D3A8[hpBar->type].offset + 0x20 + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), 0x20); + src = BattleHpBar_Util_GetComponentRawGraphic(71); + MI_CpuCopy16(src, (void *)((u32)vramBaseAddr + ov12_0226D3D8[hpBar->type].offset + 0x20 + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), 0x20); + src = BattleHpBar_Util_GetComponentRawGraphic(69); + MI_CpuCopy16(src, (void *)((u32)vramBaseAddr + ov12_0226D408[hpBar->type].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D408[hpBar->type].size); + ov12_0226498C(hpBar, hpBar->hp, 6); + } else { + src = BattleHpBar_Util_GetComponentRawGraphic(66); + MI_CpuCopy16(src, (void *)((u32)vramBaseAddr + ov12_0226D3A8[hpBar->type].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D3A8[hpBar->type].size); + src = BattleHpBar_Util_GetComponentRawGraphic(68); + MI_CpuCopy16(src, (void *)((u32)vramBaseAddr + ov12_0226D3D8[hpBar->type].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D3D8[hpBar->type].size); + src = BattleHpBar_Util_GetComponentRawGraphic(38); + MI_CpuCopy16(src, (void *)((u32)vramBaseAddr + ov12_0226D3D8[hpBar->type].offset + 0x20 + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), 0x20); + ov12_0226498C(hpBar, hpBar->hp, 1); + } + } +} + +void ov12_02264DCC(BattleHpBar *hpBar, int hp) { + hpBar->hpCalc = 0x80000000; + if (hpBar->hp + hp < 0) { + hp -= (hpBar->hp + hp); + } + if (hpBar->hp + hp > hpBar->maxHp) { + hp -= ((hpBar->hp + hp) - hpBar->maxHp); + } + hpBar->gainedHp = -hp; + if (hpBar->hp < 0) { + hpBar->hp = 0; + } + if (hpBar->hp > hpBar->maxHp) { + hpBar->hp = hpBar->maxHp; + } +} + +int ov12_02264E00(BattleHpBar *hpBar) { + int r4 = ov12_022657E4(hpBar, FALSE); + if (r4 == -1) { + hpBar->hp -= hpBar->gainedHp; + ov12_0226498C(hpBar, hpBar->hp, 2); + } else { + ov12_0226498C(hpBar, r4, 2); + } + return r4; +} + +void ov12_02264E34(BattleHpBar *hpBar, int exp) { + hpBar->expCalc = 0x80000000; + if (hpBar->exp + exp < 0) { + exp -= (hpBar->exp + exp); + } + if (hpBar->exp + exp > hpBar->maxExp) { + exp -= ((hpBar->exp + exp) - hpBar->maxExp); + } + hpBar->gainedExp = -exp; + if (hpBar->exp < 0) { + hpBar->exp = 0; + } + if (hpBar->exp > hpBar->maxExp) { + hpBar->exp = hpBar->maxExp; + } +} + +int ov12_02264E68(BattleHpBar *hpBar) { + int ret = ov12_022657E4(hpBar, TRUE); + if (ret == -1) { + hpBar->exp -= hpBar->gainedExp; + } + return ret; +} + +void ov12_02264E84(BattleHpBar *hpBar) { + if (hpBar->arrowObj != NULL) { + Sprite_SetAnimActiveFlag(hpBar->arrowObj->sprite, TRUE); + ov12_02264F00(hpBar, 1); + } + if (!(BattleSystem_GetBattleType(hpBar->bsys) & (BATTLE_TYPE_PAL_PARK | BATTLE_TYPE_SAFARI))) { + ov12_02265D78(hpBar); + } +} + +void ov12_02264EB4(BattleHpBar *hpBar) { + if (hpBar->arrowObj != NULL) { + Sprite_SetAnimActiveFlag(hpBar->arrowObj->sprite, FALSE); + Sprite_SetAnimCtrlCurrentFrame(hpBar->arrowObj->sprite, 0); + ov12_02264F00(hpBar, 0); + } + ov12_02265DA0(hpBar); +} + +void ov12_02264EE0(BattleHpBar *hpBar, int prio) { + if (hpBar->boxObj != NULL) { + UnkImageStruct_SetSpritePriority(hpBar->boxObj, prio); + if (hpBar->arrowObj != NULL) { + UnkImageStruct_SetSpritePriority(hpBar->arrowObj, prio); + } + } +} + +static void ov12_02264F00(BattleHpBar *hpBar, int a1) { + if (hpBar->arrowObj != NULL) { + if (!(BattleSystem_GetBattleType(hpBar->bsys) & (BATTLE_TYPE_PAL_PARK | BATTLE_TYPE_SAFARI)) || a1 != TRUE) { + UnkImageStruct_SetSpriteVisibleFlag(hpBar->arrowObj, a1); + } + } +} + +void BattleHpBar_SetEnabled(BattleHpBar *hpBar, BOOL a1) { + if (hpBar->boxObj != NULL) { + UnkImageStruct_SetSpriteVisibleFlag(hpBar->boxObj, a1); + ov12_02264F00(hpBar, a1); + } +} + +#ifdef NONMATCHING +static void ov12_02264F44(BattleHpBar *hpBar, int x, int y) { + const UnkTemplate_0200D748 *tmplate; + + GF_ASSERT(hpBar->boxObj != NULL); + + tmplate = BattleHpBar_Util_GetHpBoxSpriteTemplate(hpBar->type); + + Sprite_SetPositionXY(hpBar->boxObj->sprite, tmplate->x + x, tmplate->y + y); + if (hpBar->arrowObj != NULL) { + Sprite_SetPositionXY(hpBar->arrowObj->sprite, + tmplate->x + x - sHpBarArrowXOffsets[hpBar->type], + tmplate->y + y + 0); + } +} +#else +// clang-format off +asm static void ov12_02264F44(BattleHpBar *hpBar, int x, int y) { + push {r3, r4, r5, r6, r7, lr} + add r5, r0, #0 + ldr r0, [r5, #4] + add r6, r1, #0 + add r7, r2, #0 + cmp r0, #0 + bne _02264F56 + bl GF_AssertFail +_02264F56: + add r0, r5, #0 + add r0, #0x25 + ldrb r0, [r0, #0] + bl BattleHpBar_Util_GetHpBoxSpriteTemplate + add r4, r0, #0 + mov r1, #0 + mov r2, #2 + ldrsh r1, [r4, r1] + ldrsh r2, [r4, r2] + ldr r0, [r5, #4] + add r1, r1, r6 + add r2, r2, r7 + lsl r1, r1, #0x10 + lsl r2, r2, #0x10 + ldr r0, [r0, #0] + asr r1, r1, #0x10 + asr r2, r2, #0x10 + bl Sprite_SetPositionXY + ldr r0, [r5, #8] + cmp r0, #0 + beq _02264FA8 + add r5, #0x25 + ldrb r3, [r5, #0] + mov r1, #0 + ldr r2, =sHpBarArrowXOffsets + ldrsh r1, [r4, r1] + ldrsb r2, [r2, r3] + ldr r0, [r0, #0] + add r1, r1, r6 + sub r1, r1, r2 + mov r2, #2 + ldrsh r2, [r4, r2] + lsl r1, r1, #0x10 + asr r1, r1, #0x10 + add r2, r2, r7 + lsl r2, r2, #0x10 + asr r2, r2, #0x10 + bl Sprite_SetPositionXY +_02264FA8: + pop {r3, r4, r5, r6, r7, pc} +} +// clang-format on +#endif // NONMATCHING + +void ov12_02264FB0(BattleHpBar *hpBar, BOOL a1) { + GF_ASSERT(hpBar != NULL); + GF_ASSERT(hpBar->boxObj != NULL); + hpBar->unk_4F_1 = FALSE; + hpBar->unk_4F_0 = a1; + if (!a1) { + switch (hpBar->type) { + case HP_BAR_TYPE_SINGLE_PLAYER: + case HP_BAR_TYPE_DOUBLE_PLAYER_LHS: + case HP_BAR_TYPE_DOUBLE_PLAYER_RHS: + case HP_BAR_TYPE_SAFARI: + case HP_BAR_TYPE_PALPARK: + ov12_02264F44(hpBar, 160, 0); + break; + default: + ov12_02264F44(hpBar, -160, 0); + break; + } + } else { + ov12_02264F44(hpBar, 0, 0); + } + SysTask_CreateOnMainQueue(ov12_02265054, hpBar, 990); +} + +#ifdef NONMATCHING +static void ov12_02265054(SysTask *task, void *data) { + BattleHpBar *hpBar = data; + s16 x, y; + const UnkTemplate_0200D748 *r6; + int r4; + + r4 = 0; + r6 = BattleHpBar_Util_GetHpBoxSpriteTemplate(hpBar->type); + UnkImageStruct_GetSpritePositionXY(hpBar->boxObj, &x, &y); + + switch (hpBar->type) { + case HP_BAR_TYPE_SINGLE_PLAYER: + case HP_BAR_TYPE_DOUBLE_PLAYER_LHS: + case HP_BAR_TYPE_DOUBLE_PLAYER_RHS: + case HP_BAR_TYPE_SAFARI: + case HP_BAR_TYPE_PALPARK: + if (hpBar->unk_4F_0 == 0) { + x -= 24; + if (x < r6->x) { + x = r6->x; + r4++; + } + } else { + x += 24; + if (x > r6->x + 160) { + x = r6->x + 160; + r4++; + } + } + break; + default: + if (hpBar->unk_4F_0 == 0) { + x += 24; + if (x > r6->x) { + x = r6->x; + r4++; + } + } else { + x -= 24; + if (x < r6->x - 24) { + x = r6->x - 24; + r4++; + } + } + break; + } + UnkImageStruct_SetSpritePositionXY(hpBar->boxObj, x, y); + if (hpBar->arrowObj != NULL) { + UnkImageStruct_SetSpritePositionXY(hpBar->arrowObj, x - sHpBarArrowXOffsets[hpBar->type], y + 0); + } + + if (r4 > 0) { + hpBar->unk_4F_1 = TRUE; + SysTask_Destroy(task); + return; + } +} +#else +// clang-format off +asm static void ov12_02265054(SysTask *task, void *data) { + push {r3, r4, r5, r6, r7, lr} + add r5, r1, #0 + add r7, r0, #0 + add r0, r5, #0 + add r0, #0x25 + ldrb r0, [r0, #0] + mov r4, #0 + bl BattleHpBar_Util_GetHpBoxSpriteTemplate + add r6, r0, #0 + add r1, sp, #0 + ldr r0, [r5, #4] + add r1, #2 + add r2, sp, #0 + bl UnkImageStruct_GetSpritePositionXY + add r0, r5, #0 + add r0, #0x25 + ldrb r0, [r0, #0] + cmp r0, #7 + bhi _022650DA + add r0, r0, r0 + add r0, pc + ldrh r0, [r0, #6] + lsl r0, r0, #0x10 + asr r0, r0, #0x10 + add pc, r0 +_0226508A: + lsl r6, r1, #0 // .short _0226509A - _0226508A - 2 ; case 0 + lsl r6, r1, #1 // .short _022650DA - _0226508A - 2 ; case 1 + lsl r6, r1, #0 // .short _0226509A - _0226508A - 2 ; case 2 + lsl r6, r1, #1 // .short _022650DA - _0226508A - 2 ; case 3 + lsl r6, r1, #0 // .short _0226509A - _0226508A - 2 ; case 4 + lsl r6, r1, #1 // .short _022650DA - _0226508A - 2 ; case 5 + lsl r6, r1, #0 // .short _0226509A - _0226508A - 2 ; case 6 + lsl r6, r1, #0 // .short _0226509A - _0226508A - 2 ; case 7 +_0226509A: + add r0, r5, #0 + add r0, #0x4f + ldrb r0, [r0, #0] + lsl r0, r0, #0x1f + lsr r0, r0, #0x1f + add r0, sp, #0 + bne _022650C0 + mov r1, #2 + ldrsh r2, [r0, r1] + sub r2, #0x18 + strh r2, [r0, #2] + add r2, r4, #0 + ldrsh r1, [r0, r1] + ldrsh r2, [r6, r2] + cmp r1, r2 + bge _02265118 + strh r2, [r0, #2] + add r4, r4, #1 + b _02265118 +_022650C0: + mov r1, #2 + ldrsh r2, [r0, r1] + add r2, #0x18 + strh r2, [r0, #2] + add r2, r4, #0 + ldrsh r2, [r6, r2] + ldrsh r1, [r0, r1] + add r2, #0xa0 + cmp r1, r2 + ble _02265118 + strh r2, [r0, #2] + add r4, r4, #1 + b _02265118 +_022650DA: + add r0, r5, #0 + add r0, #0x4f + ldrb r0, [r0, #0] + lsl r0, r0, #0x1f + lsr r0, r0, #0x1f + add r0, sp, #0 + bne _02265100 + mov r1, #2 + ldrsh r2, [r0, r1] + add r2, #0x18 + strh r2, [r0, #2] + mov r2, #0 + ldrsh r1, [r0, r1] + ldrsh r2, [r6, r2] + cmp r1, r2 + ble _02265118 + strh r2, [r0, #2] + add r4, r4, #1 + b _02265118 +_02265100: + mov r1, #2 + ldrsh r2, [r0, r1] + sub r2, #0x18 + strh r2, [r0, #2] + mov r2, #0 + ldrsh r2, [r6, r2] + ldrsh r1, [r0, r1] + sub r2, #0x18 + cmp r1, r2 + bge _02265118 + strh r2, [r0, #2] + add r4, r4, #1 +_02265118: + add r2, sp, #0 + mov r1, #2 + mov r3, #0 + ldrsh r1, [r2, r1] + ldrsh r2, [r2, r3] + ldr r0, [r5, #4] + bl UnkImageStruct_SetSpritePositionXY + ldr r0, [r5, #8] + cmp r0, #0 + beq _0226514C + add r6, sp, #0 + mov r1, #2 + ldrsh r3, [r6, r1] + add r1, r5, #0 + add r1, #0x25 + ldrb r2, [r1, #0] + ldr r1, =sHpBarArrowXOffsets + ldrsb r1, [r1, r2] + mov r2, #0 + ldrsh r2, [r6, r2] + sub r1, r3, r1 + lsl r1, r1, #0x10 + asr r1, r1, #0x10 + bl UnkImageStruct_SetSpritePositionXY +_0226514C: + cmp r4, #0 + ble _02265164 + add r0, r5, #0 + add r0, #0x4f + ldrb r1, [r0, #0] + mov r0, #2 + add r5, #0x4f + orr r0, r1 + strb r0, [r5, #0] + add r0, r7, #0 + bl SysTask_Destroy +_02265164: + pop {r3, r4, r5, r6, r7, pc} +} +// clang-format on +#endif // NONMATCHING + +static void ov12_0226516C(BattleHpBar *hpBar) { + BgConfig *bgConfig; + u8 *srcBuf; + NNSG2dImageProxy *imgProxy; + Window window; + MsgData *msgData; + String *string; + String *string2; + Pokemon *mon; + BoxPokemon *boxMon; + MessageFormat *msgFormat; + + bgConfig = BattleSystem_GetBgConfig(hpBar->bsys); + msgData = BattleSystem_GetMessageData(hpBar->bsys); + msgFormat = BattleSystem_GetMessageFormat(hpBar->bsys); + string = String_New(22, HEAP_ID_BATTLE); + string2 = NewString_ReadMsgData(msgData, msg_0197_00964); + + mon = BattleSystem_GetPartyMon(hpBar->bsys, hpBar->battlerId, hpBar->monId); + boxMon = Mon_GetBoxMon(mon); + BufferBoxMonNickname(msgFormat, 0, boxMon); + StringExpandPlaceholders(msgFormat, string, string2); + + AddTextWindowTopLeftCorner(bgConfig, &window, 8, 2, 0, 15); + AddTextPrinterParameterizedWithColorAndSpacing(&window, 0, string, 0, 0, TEXT_SPEED_NOTRANSFER, MAKE_TEXT_COLOR(14, 2, 15), 0, 0, NULL); + srcBuf = window.pixelBuffer; + + { + void *vramAddr; + u8 *pixelBuffer; + u8 *pixelBuffer2; + + vramAddr = G2_GetOBJCharPtr(); + imgProxy = Sprite_GetImageProxy(hpBar->boxObj->sprite); + pixelBuffer = srcBuf; + pixelBuffer2 = srcBuf + 0x100; + + MI_CpuCopy16(pixelBuffer, (void *)((u32)vramAddr + ov12_0226D680[hpBar->type][0].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D680[hpBar->type][0].size); + MI_CpuCopy16(pixelBuffer2, (void *)((u32)vramAddr + ov12_0226D680[hpBar->type][1].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D680[hpBar->type][1].size); + MI_CpuCopy16(pixelBuffer + ov12_0226D680[hpBar->type][0].size, (void *)((u32)vramAddr + ov12_0226D680[hpBar->type][2].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D680[hpBar->type][2].size); + MI_CpuCopy16(pixelBuffer2 + ov12_0226D680[hpBar->type][1].size, (void *)((u32)vramAddr + ov12_0226D680[hpBar->type][3].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D680[hpBar->type][3].size); + } + RemoveWindow(&window); + String_Delete(string); + String_Delete(string2); +} + +static void ov12_022652D0(BattleHpBar *hpBar) { + int r0, r4; + + if (hpBar->unk49 == 0) { + r0 = 74; + r4 = 62; + } else if (hpBar->unk49 == 1) { + r0 = 72; + r4 = 60; + } else { + r0 = 76; + r4 = 64; + } + const u8 *sp0 = BattleHpBar_Util_GetComponentRawGraphic(r0); + const u8 *r7 = BattleHpBar_Util_GetComponentRawGraphic(r4); + NNSG2dImageProxy *imgProxy = Sprite_GetImageProxy(hpBar->boxObj->sprite); + void *vramAddr = G2_GetOBJCharPtr(); + MI_CpuCopy16(r7, (void *)((u32)vramAddr + ov12_0226D4B0[hpBar->type][0].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D4B0[hpBar->type][0].size); + MI_CpuCopy16(sp0, (void *)((u32)vramAddr + ov12_0226D4B0[hpBar->type][1].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D4B0[hpBar->type][1].size); +} + +static void ov12_02265354(BattleHpBar *hpBar) { + int j, i, k; + u8 *r4 = AllocFromHeap(HEAP_ID_BATTLE, 0x60); + u8 *r7 = AllocFromHeap(HEAP_ID_BATTLE, 0xC0); + MI_CpuFill8(r4, 0xFF, 0x60); + sub_0200CEB0(BattleSystem_GetLevelNumPrinter(hpBar->bsys), hpBar->level, 3, PRINTING_MODE_LEFT_ALIGN, (void *)r4); + NNSG2dImageProxy *imgProxy = Sprite_GetImageProxy(hpBar->boxObj->sprite); + void *vramAddr = G2_GetOBJCharPtr(); + MI_CpuCopy16((void *)((u32)vramAddr + ov12_0226D420[hpBar->type][0].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), r7, ov12_0226D420[hpBar->type][0].size); + MI_CpuCopy16((void *)((u32)vramAddr + ov12_0226D420[hpBar->type][1].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), r7 + 0x60, ov12_0226D420[hpBar->type][1].size); + k = 0; + for (i = 0; i < 0x60; i += 0x20) { + for (j = 0; j < 0x10; ++j) { + r7[i + 0x10 + j] = r4[k]; + r7[i + j + 0x60] = r4[k + 0x10]; + ++k; + } + k += 0x10; + } + u8 *buf1 = r7; + u8 *buf2 = r7 + 0x60; + MI_CpuCopy16(buf1, (void *)((u32)vramAddr + ov12_0226D420[hpBar->type][0].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D420[hpBar->type][0].size); + MI_CpuCopy16(buf2, (void *)((u32)vramAddr + ov12_0226D420[hpBar->type][1].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D420[hpBar->type][1].size); + FreeToHeap(r4); + FreeToHeap(r7); +} + +static void ov12_02265474(BattleHpBar *hpBar, u32 num) { + u8 *r4 = AllocFromHeap(HEAP_ID_BATTLE, 0x60); + MI_CpuFill8(r4, 0xFF, 0x60); + sub_0200CEB0(BattleSystem_GetHpNumPrinter(hpBar->bsys), num, 3, PRINTING_MODE_RIGHT_ALIGN, (void *)r4); + NNSG2dImageProxy *imgProxy = Sprite_GetImageProxy(hpBar->boxObj->sprite); + void *vramAddr = G2_GetOBJCharPtr(); + + MI_CpuCopy16(r4, (void *)((u32)vramAddr + ov12_0226D450[hpBar->type][0].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D450[hpBar->type][0].size); + MI_CpuCopy16(r4 + ov12_0226D450[hpBar->type][0].size, (void *)((u32)vramAddr + ov12_0226D450[hpBar->type][1].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D450[hpBar->type][1].size); + FreeToHeap(r4); +} + +static void ov12_02265500(BattleHpBar *hpBar) { + u8 *r4 = AllocFromHeap(HEAP_ID_BATTLE, 0x60); + MI_CpuFill8(r4, 0xFF, 0x60); + sub_0200CEB0(BattleSystem_GetHpNumPrinter(hpBar->bsys), hpBar->maxHp, 3, PRINTING_MODE_LEFT_ALIGN, (void *)r4); + NNSG2dImageProxy *imgProxy = Sprite_GetImageProxy(hpBar->boxObj->sprite); + void *vramAddr = G2_GetOBJCharPtr(); + + MI_CpuCopy16(r4, (void *)((u32)vramAddr + ov12_0226D3F0[hpBar->type].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D3F0[hpBar->type].size); + FreeToHeap(r4); +} + +static void ov12_02265560(BattleHpBar *hpBar) { + const u8 *r4; + if (hpBar->unk4B == 1) { + r4 = BattleHpBar_Util_GetComponentRawGraphic(59); + } else { + r4 = BattleHpBar_Util_GetComponentRawGraphic(38); + } + NNSG2dImageProxy *imgProxy = Sprite_GetImageProxy(hpBar->boxObj->sprite); + void *vramAddr = G2_GetOBJCharPtr(); + + MI_CpuCopy16(r4, (void *)((u32)vramAddr + ov12_0226D3C0[hpBar->type].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D3C0[hpBar->type].size); +} + +static void ov12_022655B0(BattleHpBar *hpBar, int a1) { + const u8 *r4 = BattleHpBar_Util_GetComponentRawGraphic(a1); + NNSG2dImageProxy *imgProxy = Sprite_GetImageProxy(hpBar->boxObj->sprite); + void *vramAddr = G2_GetOBJCharPtr(); + + MI_CpuCopy16(r4, (void *)((u32)vramAddr + ov12_0226D390[hpBar->type].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D390[hpBar->type].size); +} + +static void BattleHpBar_PrintSafariOrParkBallsString(BattleHpBar *hpBar, u32 flag) { + BgConfig *bgConfig; + u8 *windowBuf; + NNSG2dImageProxy *imgProxy; + Window window; + MsgData *msgData; + String *string; + + bgConfig = BattleSystem_GetBgConfig(hpBar->bsys); + msgData = BattleSystem_GetMessageData(hpBar->bsys); + + if (flag & 0x400) { + string = NewString_ReadMsgData(msgData, msg_0197_00950); // SAFARI BALLS + } else { + string = NewString_ReadMsgData(msgData, msg_0197_01220); // PARK BALLS + } + AddTextWindowTopLeftCorner(bgConfig, &window, 13, 2, 0, 15); + AddTextPrinterParameterizedWithColorAndSpacing(&window, 0, string, 0, 0, TEXT_SPEED_NOTRANSFER, MAKE_TEXT_COLOR(14, 2, 15), 0, 0, NULL); + windowBuf = window.pixelBuffer; + + { + void *vramAddr; + u8 *ptr1; + u8 *ptr2; + + vramAddr = G2_GetOBJCharPtr(); + imgProxy = Sprite_GetImageProxy(hpBar->boxObj->sprite); + ptr1 = windowBuf; + ptr2 = windowBuf + 0x1A0; + MI_CpuCopy16(ptr1, (void *)((u32)vramAddr + ov12_0226D370[0].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D370[0].size); + MI_CpuCopy16(ptr2, (void *)((u32)vramAddr + ov12_0226D370[1].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D370[1].size); + MI_CpuCopy16(ptr1 + ov12_0226D370[0].size, (void *)((u32)vramAddr + ov12_0226D370[2].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D370[2].size); + MI_CpuCopy16(ptr2 + ov12_0226D370[1].size, (void *)((u32)vramAddr + ov12_0226D370[3].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D370[3].size); + } + + RemoveWindow(&window); + String_Delete(string); +} + +static void BattleHpBar_PrintNumRemainingSafariOrParkBalls(BattleHpBar *hpBar, u32 flag) { + BgConfig *bgConfig; + u8 *windowBuf; + NNSG2dImageProxy *imgProxy; + Window window; + MsgData *msgData; + MessageFormat *msgFormat; + String *string; + String *string2; + + bgConfig = BattleSystem_GetBgConfig(hpBar->bsys); + msgData = BattleSystem_GetMessageData(hpBar->bsys); + msgFormat = BattleSystem_GetMessageFormat(hpBar->bsys); + + string = String_New(30, HEAP_ID_BATTLE); + if (flag & 0x400) { + string2 = NewString_ReadMsgData(msgData, msg_0197_00951); // Left: $1 + } else { + string2 = NewString_ReadMsgData(msgData, msg_0197_01221); // Left: $1 + } + BufferIntegerAsString(msgFormat, 0, hpBar->unk27, 2, PRINTING_MODE_RIGHT_ALIGN, TRUE); + StringExpandPlaceholders(msgFormat, string, string2); + AddTextWindowTopLeftCorner(bgConfig, &window, 13, 2, 0, 15); + AddTextPrinterParameterizedWithColorAndSpacing(&window, 0, string, 0, 0, TEXT_SPEED_NOTRANSFER, MAKE_TEXT_COLOR(14, 2, 15), 0, 0, NULL); + windowBuf = window.pixelBuffer; + + { + void *vramAddr; + u8 *ptr1; + u8 *ptr2; + + vramAddr = G2_GetOBJCharPtr(); + imgProxy = Sprite_GetImageProxy(hpBar->boxObj->sprite); + ptr1 = windowBuf; + ptr2 = windowBuf + 0x1A0; + MI_CpuCopy16(ptr1, (void *)((u32)vramAddr + ov12_0226D380[0].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D380[0].size); + MI_CpuCopy16(ptr2, (void *)((u32)vramAddr + ov12_0226D380[1].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D380[1].size); + MI_CpuCopy16(ptr1 + ov12_0226D380[0].size, (void *)((u32)vramAddr + ov12_0226D380[2].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D380[2].size); + MI_CpuCopy16(ptr2 + ov12_0226D380[1].size, (void *)((u32)vramAddr + ov12_0226D380[3].offset + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), ov12_0226D380[3].size); + } + + RemoveWindow(&window); + String_Delete(string); + String_Delete(string2); +} + +static int ov12_022657E4(BattleHpBar *hpBar, BOOL isExp) { + int ret; + if (isExp == FALSE) { + ret = BattleHpBar_CalculatePixelsChangeFrame(hpBar->maxHp, hpBar->hp, hpBar->gainedHp, &hpBar->hpCalc, 6, 1); + } else { + // Supposedly this will make the exp bar move at a consistent speed regardless of the gauge size. + int denom = BattleHpBar_Util_GetPixelsToGain(hpBar->exp, hpBar->gainedExp, hpBar->maxExp, 12); + if (denom == 0) { + denom = 1; + } + ret = BattleHpBar_CalculatePixelsChangeFrame(hpBar->maxExp, hpBar->exp, hpBar->gainedExp, &hpBar->expCalc, 12, abs(hpBar->gainedExp / denom)); + } + if (isExp != FALSE || hpBar->unk_4F_3 != TRUE) { + ov12_02265878(hpBar, isExp); + } + if (ret == -1) { + // we done + if (isExp == FALSE) { + hpBar->hpCalc = 0; + } else { + hpBar->expCalc = 0; + } + } + return ret; +} + +static void ov12_02265878(BattleHpBar *hpBar, u8 isExp) { + u8 i; + u8 pixelBuffer[12]; + u8 tmp; + const u8 *src; + void *vramAddr; + NNSG2dImageProxy *imgProxy; + int sizeTop; + + vramAddr = G2_GetOBJCharPtr(); + imgProxy = Sprite_GetImageProxy(hpBar->boxObj->sprite); + switch (isExp) { + case FALSE: + // hp + switch (HpBar_GetColorIdx(BattleHpBar_Util_MakeHpBarPixelBuffer(hpBar->maxHp, hpBar->hp, hpBar->gainedHp, &hpBar->hpCalc, pixelBuffer, 6), 0x30)) { + case 3: // Green + tmp = 2; + break; + case 2: // Yellow + tmp = 11; + break; + case 1: // Red + default: + tmp = 20; + break; + } + src = BattleHpBar_Util_GetComponentRawGraphic(tmp); + sizeTop = ov12_0226D480[hpBar->type][0].size / 32; + for (i = 0; i < 6; ++i) { + if (i < sizeTop) { + MI_CpuCopy16(src + pixelBuffer[i] * 32, (void *)((u32)vramAddr + ov12_0226D480[hpBar->type][0].offset + i * 32 + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), 0x20); + } else { + MI_CpuCopy16(src + pixelBuffer[i] * 32, (void *)((u32)vramAddr + ov12_0226D480[hpBar->type][1].offset + (i - sizeTop) * 32 + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), 0x20); + } + } + break; + case TRUE: + // exp + BattleHpBar_Util_MakeHpBarPixelBuffer(hpBar->maxExp, hpBar->exp, hpBar->gainedExp, &hpBar->expCalc, pixelBuffer, 12); + if (hpBar->level == 100) { + // Don't fill an exp bar for a level 100 mon + for (i = 0; i < 12; ++i) { + pixelBuffer[i] = 0; + } + } + src = BattleHpBar_Util_GetComponentRawGraphic(29); + for (i = 0; i < 12; ++i) { + if (i < 5) { + MI_CpuCopy16(src + pixelBuffer[i] * 32, (void *)((u32)vramAddr + 0x660 + i * 32 + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), 0x20); + } else { + MI_CpuCopy16(src + pixelBuffer[i] * 32, (void *)((u32)vramAddr + 0xE00 + (i - 5) * 32 + imgProxy->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]), 0x20); + } + } + break; + } +} + +static int BattleHpBar_CalculatePixelsChangeFrame(s32 maxHp, s32 curHp, s32 deltaHp, s32 *pHpCalc, u8 tilesWide, u16 hpChange) { + s32 nowHp; + s32 ret; + u8 pixelsWide; + s32 hpPerPixel; + + pixelsWide = tilesWide * 8; + if (*pHpCalc == 0x80000000) { + // Initialize + if (USE_SUBPIXELS_TEST) { + *pHpCalc = curHp << 8; + } else { + *pHpCalc = curHp; + } + } + nowHp = curHp - deltaHp; + if (nowHp < 0) { + nowHp = 0; + } else if (nowHp > maxHp) { + nowHp = maxHp; + } + if (USE_SUBPIXELS_TEST) { + // Use subpixel mode + if (nowHp == (*pHpCalc >> 8) && (*pHpCalc & 0xFF) == 0) { + return -1; + } + } else { + // Use integer pixel mode + if (nowHp == *pHpCalc) { + return -1; + } + } + if (USE_SUBPIXELS_TEST) { + hpPerPixel = (maxHp << 8) / pixelsWide; + if (deltaHp < 0) { + *pHpCalc += hpPerPixel; + ret = *pHpCalc >> 8; + if (ret >= nowHp) { + *pHpCalc = nowHp << 8; + ret = nowHp; + } + } else { + *pHpCalc -= hpPerPixel; + ret = *pHpCalc >> 8; + if ((*pHpCalc & 0xFF) > 0) { + ++ret; + } + if (ret <= nowHp) { + *pHpCalc = nowHp << 8; + ret = nowHp; + } + } + } else { + if (deltaHp < 0) { + *pHpCalc += hpChange; + if (*pHpCalc > nowHp) { + *pHpCalc = nowHp; + } + } else { + *pHpCalc -= hpChange; + if (*pHpCalc < nowHp) { + *pHpCalc = nowHp; + } + } + ret = *pHpCalc; + } + return ret; +} + +static u8 BattleHpBar_Util_MakeHpBarPixelBuffer(s32 maxHp, s32 hp, s32 deltaHp, s32 *pHpCalc, u8 *pixelBuf, u8 tilesWide) { + int i; + int targetHp; + u32 pixelsWide; + u32 curPixels; + u32 ret; + + targetHp = hp - deltaHp; + if (targetHp < 0) { + targetHp = 0; + } else if (targetHp > maxHp) { + targetHp = maxHp; + } + pixelsWide = tilesWide * 8; + for (i = 0; i < tilesWide; ++i) { + pixelBuf[i] = 0; + } + if (USE_SUBPIXELS_TEST) { + curPixels = (*pHpCalc * pixelsWide / maxHp) >> 8; + } else { + curPixels = *pHpCalc * pixelsWide / maxHp; + } + ret = curPixels; + if (curPixels == 0 && targetHp > 0) { + pixelBuf[0] = 1; + ret = 1; + } else { + for (i = 0; i < tilesWide; ++i) { + if (curPixels >= 8) { + pixelBuf[i] = 8; + curPixels -= 8; + } else { + pixelBuf[i] = curPixels; + break; + } + } + } + return ret; +} + +static u32 BattleHpBar_Util_GetPixelsToGain(s32 exp, s32 gainedExp, s32 maxExp, u8 tilesWide) { + s8 curPixels, targetPixels; + u8 pixelsWide; + s32 targetExp; + + pixelsWide = tilesWide * 8; + + targetExp = exp - gainedExp; + if (targetExp < 0) { + targetExp = 0; + } else if (targetExp > maxExp) { + targetExp = maxExp; + } + curPixels = exp * pixelsWide / maxExp; + targetPixels = targetExp * pixelsWide / maxExp; + return abs(curPixels - targetPixels); +} + +static const u8 *BattleHpBar_Util_GetComponentRawGraphic(int componentId) { + return gBattleHpBar_RawGraphicComponents + componentId * 32; +} + +u8 BattleHpBar_Util_GetBarTypeFromBattlerSide(u8 bside, u32 battleType) { + switch (bside) { + case 0: + if (battleType & BATTLE_TYPE_PAL_PARK) { + return HP_BAR_TYPE_PALPARK; + } + if (battleType & BATTLE_TYPE_SAFARI) { + return HP_BAR_TYPE_SAFARI; + } + return HP_BAR_TYPE_SINGLE_PLAYER; + case 1: + return HP_BAR_TYPE_SINGLE_ENEMY; + case 2: + return HP_BAR_TYPE_DOUBLE_PLAYER_LHS; + case 3: + return HP_BAR_TYPE_DOUBLE_ENEMY_LHS; + case 4: + return HP_BAR_TYPE_DOUBLE_PLAYER_RHS; + case 5: + return HP_BAR_TYPE_DOUBLE_ENEMY_RHS; + default: + GF_ASSERT(FALSE); + return HP_BAR_TYPE_SINGLE_PLAYER; + } +} + +static const UnkTemplate_0200D748 *BattleHpBar_Util_GetHpBoxSpriteTemplate(u8 barType) { + const UnkTemplate_0200D748 *ret; + switch (barType) { + case HP_BAR_TYPE_SINGLE_PLAYER: + ret = &sSpriteTemplate_HpBarSinglePlayer; + break; + case HP_BAR_TYPE_SINGLE_ENEMY: + ret = &sSpriteTemplate_HpBarSingleEnemy; + break; + case HP_BAR_TYPE_DOUBLE_PLAYER_LHS: + ret = &sSpriteTemplate_HpBarDoublePlayerLHS; + break; + case HP_BAR_TYPE_DOUBLE_ENEMY_LHS: + ret = &sSpriteTemplate_HpBarDoubleEnemyLHS; + break; + case HP_BAR_TYPE_DOUBLE_PLAYER_RHS: + ret = &sSpriteTemplate_HpBarDoublePlayerRHS; + break; + case HP_BAR_TYPE_DOUBLE_ENEMY_RHS: + ret = &sSpriteTemplate_HpBarDoubleEnemyRHS; + break; + case HP_BAR_TYPE_SAFARI: + case HP_BAR_TYPE_PALPARK: + ret = &sSpriteTemplate_HpBarSafariOrPark; + break; + default: + GF_ASSERT(FALSE); + return NULL; + } + return ret; +} + +static const UnkTemplate_0200D748 *BattleHpBar_Util_GetArrowSpriteTemplate(u8 barType) { + switch (barType) { + case HP_BAR_TYPE_SINGLE_PLAYER: + case HP_BAR_TYPE_DOUBLE_PLAYER_LHS: + case HP_BAR_TYPE_DOUBLE_PLAYER_RHS: + case HP_BAR_TYPE_SAFARI: + case HP_BAR_TYPE_PALPARK: + return &sSpriteTemplate_Arrow; + case HP_BAR_TYPE_SINGLE_ENEMY: + case HP_BAR_TYPE_DOUBLE_ENEMY_LHS: + case HP_BAR_TYPE_DOUBLE_ENEMY_RHS: + return NULL; + default: + GF_ASSERT(FALSE); + return NULL; + } +} + +typedef struct BattleHpBarExpBarFullFlashEffectTaskData { + BattleHpBar *hpBar; + u8 *pDoneFlag; + u8 state; + u8 plttNum; + s8 ev; +} BattleHpBarExpBarFullFlashEffectTaskData; + +SysTask *BattleHpBar_BeginExpBarFullFlashEffect(BattleHpBar *hpBar, u8 *a1) { + *a1 = 0; + BattleHpBarExpBarFullFlashEffectTaskData *taskData = AllocFromHeap(HEAP_ID_BATTLE, sizeof(BattleHpBarExpBarFullFlashEffectTaskData)); + MI_CpuFill8(taskData, 0, sizeof(BattleHpBarExpBarFullFlashEffectTaskData)); + taskData->hpBar = hpBar; + taskData->pDoneFlag = a1; + return SysTask_CreateOnMainQueue(Task_ExpBarFullFlash, taskData, 1000); +} + +static void Task_ExpBarFullFlash(SysTask *task, void *data) { + BattleHpBarExpBarFullFlashEffectTaskData *taskData = data; + SpriteGfxHandler *gfxHandler = BattleSystem_GetGfxHandler(taskData->hpBar->bsys); + int plttNum; + PaletteData *plttData = BattleSystem_GetPaletteData(taskData->hpBar->bsys); + + switch (taskData->state) { + case 0: + plttNum = GfGfxHandler_GetPlttNumById(gfxHandler, 20007, NNS_G2D_VRAM_TYPE_2DMAIN); + UnkImageStruct_SetSpritePalIndex(taskData->hpBar->boxObj, plttNum); + taskData->plttNum = plttNum; + ++taskData->state; + // break; + case 1: + taskData->ev += 2; + if (taskData->ev >= 10) { + taskData->ev = 10; + ++taskData->state; + } + PaletteData_BlendPalette(plttData, PLTTBUF_MAIN_OBJ, 16 * taskData->plttNum, 0x10, taskData->ev, RGB(5, 29, 28)); + break; + case 2: + taskData->ev -= 2; + if (taskData->ev <= 0) { + taskData->ev = 0; + ++taskData->state; + } + PaletteData_BlendPalette(plttData, PLTTBUF_MAIN_OBJ, 16 * taskData->plttNum, 0x10, taskData->ev, RGB(5, 29, 28)); + break; + default: + plttNum = GfGfxHandler_GetPlttNumById(gfxHandler, 20006, NNS_G2D_VRAM_TYPE_2DMAIN); + UnkImageStruct_SetSpritePalIndex(taskData->hpBar->boxObj, plttNum); + *taskData->pDoneFlag = 1; + FreeToHeap(taskData); + SysTask_Destroy(task); + break; + } +} + +void ov12_02265D70(BattleHpBar *hpBar) { +} + +void ov12_02265D74(BattleHpBar *hpBar) { +} + +static void ov12_02265D78(BattleHpBar *hpBar) { + if (hpBar->sysTask == NULL) { + hpBar->unk54 = 0; + hpBar->sysTask = SysTask_CreateOnMainQueue(ov12_02265DC4, hpBar, 1010); + } +} + +static void ov12_02265DA0(BattleHpBar *hpBar) { + if (hpBar->sysTask != NULL) { + SysTask_Destroy(hpBar->sysTask); + hpBar->sysTask = NULL; + } + hpBar->unk54 = 0; + ov12_02264F44(hpBar, 0, 0); +} + +static void ov12_02265DC4(SysTask *task, void *data) { + BattleHpBar *hpBar = data; + hpBar->unk54 += 20; + if (hpBar->unk54 >= 360) { + hpBar->unk54 -= 360; + } + ov12_02264F44(hpBar, 0, FX_Mul(GF_SinDegNoWrap(hpBar->unk54), FX32_CONST(1.5)) / FX32_ONE); +} diff --git a/src/battle/battle_hp_bar_data.h b/src/battle/battle_hp_bar_data.h new file mode 100644 index 0000000000..b707d3b524 --- /dev/null +++ b/src/battle/battle_hp_bar_data.h @@ -0,0 +1,162 @@ +#include + +// clang-format off + +ALIGN(4) const u8 gBattleHpBar_RawGraphicComponents[] = { + // 0x00 + 0xE3, 0xEE, 0xEE, 0xEE, 0xEE, 0x88, 0x8E, 0xE8, 0xEE, 0x88, 0x8E, 0xE8, 0xEE, 0x88, 0x88, 0xE8, 0xEE, 0x88, 0x8E, 0xE8, 0xEE, 0x88, 0x8E, 0xE8, 0xE3, 0xEE, 0xEE, 0xEE, 0x32, 0x33, 0x33, 0x33, + // 0x01 + 0xEE, 0xEE, 0xEE, 0xEE, 0x88, 0x88, 0xE8, 0xEE, 0x88, 0x8E, 0xE8, 0xEE, 0x88, 0x88, 0xE8, 0xEE, 0x88, 0xEE, 0xEE, 0xEE, 0x88, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x02 + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x22, 0x22, 0x22, 0x22, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x03 + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x25, 0x22, 0x22, 0x22, 0x46, 0x44, 0x44, 0x44, 0x46, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x04 + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x22, 0x22, 0x22, 0x66, 0x44, 0x44, 0x44, 0x66, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x05 + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x25, 0x22, 0x22, 0x66, 0x46, 0x44, 0x44, 0x66, 0x46, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x06 + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x55, 0x22, 0x22, 0x66, 0x66, 0x44, 0x44, 0x66, 0x66, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x07 + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x55, 0x25, 0x22, 0x66, 0x66, 0x46, 0x44, 0x66, 0x66, 0x46, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x08 + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x55, 0x55, 0x22, 0x66, 0x66, 0x66, 0x44, 0x66, 0x66, 0x66, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x09 + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x55, 0x55, 0x25, 0x66, 0x66, 0x66, 0x46, 0x66, 0x66, 0x66, 0x46, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x0a + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x55, 0x55, 0x55, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x0b + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x22, 0x22, 0x22, 0x22, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x0c + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x27, 0x22, 0x22, 0x22, 0x48, 0x44, 0x44, 0x44, 0x48, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x0d + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x77, 0x22, 0x22, 0x22, 0x88, 0x44, 0x44, 0x44, 0x88, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x0e + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x77, 0x27, 0x22, 0x22, 0x88, 0x48, 0x44, 0x44, 0x88, 0x48, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x0f + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x77, 0x77, 0x22, 0x22, 0x88, 0x88, 0x44, 0x44, 0x88, 0x88, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x10 + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x77, 0x77, 0x27, 0x22, 0x88, 0x88, 0x48, 0x44, 0x88, 0x88, 0x48, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x11 + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x77, 0x77, 0x77, 0x22, 0x88, 0x88, 0x88, 0x44, 0x88, 0x88, 0x88, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x12 + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x77, 0x77, 0x77, 0x27, 0x88, 0x88, 0x88, 0x48, 0x88, 0x88, 0x88, 0x48, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x13 + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x77, 0x77, 0x77, 0x77, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x14 + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x22, 0x22, 0x22, 0x22, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x15 + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x29, 0x22, 0x22, 0x22, 0x4A, 0x44, 0x44, 0x44, 0x4A, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x16 + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x99, 0x22, 0x22, 0x22, 0xAA, 0x44, 0x44, 0x44, 0xAA, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x17 + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x99, 0x29, 0x22, 0x22, 0xAA, 0x4A, 0x44, 0x44, 0xAA, 0x4A, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x18 + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x99, 0x99, 0x22, 0x22, 0xAA, 0xAA, 0x44, 0x44, 0xAA, 0xAA, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x19 + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x99, 0x99, 0x29, 0x22, 0xAA, 0xAA, 0x4A, 0x44, 0xAA, 0xAA, 0x4A, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x1a + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x99, 0x99, 0x99, 0x22, 0xAA, 0xAA, 0xAA, 0x44, 0xAA, 0xAA, 0xAA, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x1b + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x99, 0x99, 0x99, 0x29, 0xAA, 0xAA, 0xAA, 0x4A, 0xAA, 0xAA, 0xAA, 0x4A, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x1c + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x1d + 0x33, 0x33, 0x33, 0x33, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x22, 0x22, 0x22, 0x22, 0x44, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x44, 0x44, 0x44, 0x44, + // 0x1e + 0x33, 0x33, 0x33, 0x33, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x2B, 0x22, 0x22, 0x22, 0x4C, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x44, 0x44, 0x44, 0x44, + // 0x1f + 0x33, 0x33, 0x33, 0x33, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xBB, 0x22, 0x22, 0x22, 0xCC, 0x44, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x44, 0x44, 0x44, 0x44, + // 0x20 + 0x33, 0x33, 0x33, 0x33, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xBB, 0x2B, 0x22, 0x22, 0xCC, 0x4C, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x44, 0x44, 0x44, 0x44, + // 0x21 + 0x33, 0x33, 0x33, 0x33, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xBB, 0xBB, 0x22, 0x22, 0xCC, 0xCC, 0x44, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x44, 0x44, 0x44, 0x44, + // 0x22 + 0x33, 0x33, 0x33, 0x33, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xBB, 0xBB, 0x2B, 0x22, 0xCC, 0xCC, 0x4C, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x44, 0x44, 0x44, 0x44, + // 0x23 + 0x33, 0x33, 0x33, 0x33, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xBB, 0xBB, 0xBB, 0x22, 0xCC, 0xCC, 0xCC, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x44, 0x44, 0x44, 0x44, + // 0x24 + 0x33, 0x33, 0x33, 0x33, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xBB, 0xBB, 0xBB, 0x2B, 0xCC, 0xCC, 0xCC, 0x4C, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x44, 0x44, 0x44, 0x44, + // 0x25 + 0x33, 0x33, 0x33, 0x33, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCC, 0xCC, 0xCC, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x44, 0x44, 0x44, 0x44, + // 0x26 + 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22, 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + // 0x27 + 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22, 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + // 0x28 + 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22, 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + // 0x29 + 0xFF, 0x88, 0x88, 0x88, 0x82, 0x48, 0x44, 0x44, 0x8F, 0x48, 0x77, 0x47, 0x82, 0x48, 0x87, 0x48, 0x82, 0x48, 0x44, 0x44, 0x82, 0x48, 0x77, 0x77, 0x82, 0x48, 0x87, 0x88, 0x22, 0x78, 0x87, 0x88, + // 0x2a + 0x88, 0x88, 0x88, 0x88, 0x47, 0x44, 0x44, 0x47, 0x47, 0x77, 0x47, 0x47, 0x47, 0x87, 0x48, 0x47, 0x47, 0x44, 0x44, 0x47, 0x47, 0x77, 0x47, 0x47, 0x48, 0x87, 0x48, 0x47, 0x78, 0x87, 0x78, 0x77, + // 0x2b + 0x88, 0x88, 0x88, 0xFF, 0x44, 0x74, 0x88, 0x28, 0x77, 0x47, 0x87, 0xF8, 0x87, 0x48, 0x87, 0x28, 0x44, 0x44, 0x87, 0x28, 0x47, 0x77, 0x87, 0x28, 0x47, 0x44, 0x87, 0x28, 0x77, 0x77, 0x87, 0x22, + // 0x2c + 0xFF, 0xCC, 0xCC, 0xCC, 0xC2, 0x4C, 0x44, 0x44, 0xCF, 0x4C, 0xBB, 0xBB, 0xC2, 0x4C, 0x44, 0x44, 0xC2, 0x4C, 0xBB, 0xBB, 0xC2, 0x4C, 0xCB, 0xCC, 0xC2, 0x4C, 0xCB, 0xCC, 0x22, 0xBC, 0xCB, 0xCC, + // 0x2d + 0xCC, 0xCC, 0xCC, 0xCC, 0x4B, 0x44, 0xB4, 0x4C, 0x4B, 0xBB, 0x4B, 0xBB, 0x4B, 0xCB, 0x4C, 0xCB, 0x4B, 0x44, 0x44, 0x4B, 0x4C, 0x4B, 0xBB, 0x4B, 0x4C, 0x4B, 0x44, 0x4B, 0xBC, 0xBB, 0xBB, 0xBB, + // 0x2e + 0xCC, 0xCC, 0xCC, 0xFF, 0x44, 0x44, 0xCB, 0x2C, 0xBB, 0x4B, 0xCB, 0xFC, 0x44, 0xB4, 0xCB, 0x2C, 0xBB, 0xBB, 0xCC, 0x2C, 0xCB, 0xCC, 0xCC, 0x2C, 0x44, 0x44, 0xCB, 0x2C, 0xBB, 0xBB, 0xCB, 0x22, + // 0x2f + 0xFF, 0x33, 0x33, 0x33, 0x32, 0x43, 0x44, 0x44, 0x3F, 0x43, 0x11, 0x11, 0x32, 0x43, 0x44, 0x44, 0x32, 0x13, 0x11, 0x41, 0x32, 0x33, 0x33, 0x43, 0x32, 0x43, 0x44, 0x44, 0x22, 0x13, 0x11, 0x11, + // 0x30 + 0x33, 0x33, 0x33, 0x33, 0x41, 0x31, 0x33, 0x43, 0x41, 0x31, 0x33, 0x43, 0x41, 0x31, 0x33, 0x43, 0x41, 0x31, 0x33, 0x43, 0x41, 0x31, 0x33, 0x43, 0x41, 0x44, 0x44, 0x41, 0x11, 0x11, 0x11, 0x11, + // 0x31 + 0x33, 0x33, 0x33, 0xFF, 0x44, 0x44, 0x31, 0x23, 0x11, 0x41, 0x31, 0xF3, 0x31, 0x43, 0x31, 0x23, 0x44, 0x44, 0x31, 0x23, 0x11, 0x11, 0x31, 0x23, 0x31, 0x33, 0x33, 0x23, 0x31, 0x33, 0x33, 0x22, + // 0x32 + 0xFF, 0xDD, 0xDD, 0xDD, 0xD2, 0x4D, 0x44, 0x44, 0xDF, 0x4D, 0x99, 0x49, 0xD2, 0x4D, 0xD9, 0x4D, 0xD2, 0x4D, 0x44, 0x44, 0xD2, 0x4D, 0x99, 0x99, 0xD2, 0x4D, 0xD9, 0xDD, 0x22, 0x9D, 0xD9, 0xDD, + // 0x33 + 0xDD, 0xDD, 0xDD, 0xDD, 0x49, 0x44, 0x44, 0x49, 0x49, 0x99, 0x99, 0x49, 0x49, 0x44, 0x44, 0x49, 0x99, 0x99, 0x49, 0x49, 0xD9, 0xDD, 0x4D, 0x49, 0x4D, 0x44, 0x44, 0x49, 0x9D, 0x99, 0x99, 0x99, + // 0x34 + 0xDD, 0xDD, 0xDD, 0xFF, 0x44, 0x49, 0xD9, 0x2D, 0x49, 0x49, 0xD9, 0xFD, 0x49, 0x49, 0xD9, 0x2D, 0x49, 0x49, 0xD9, 0x2D, 0x49, 0x49, 0xD9, 0x2D, 0x49, 0x44, 0xD9, 0x2D, 0x99, 0x99, 0xD9, 0x22, + // 0x35 + 0xFF, 0xAA, 0xAA, 0xAA, 0xA2, 0x4A, 0x44, 0x94, 0xAF, 0x4A, 0x99, 0x49, 0xA2, 0x4A, 0x44, 0x44, 0xA2, 0x4A, 0x99, 0x49, 0xA2, 0x4A, 0xA9, 0x4A, 0xA2, 0x4A, 0x44, 0x44, 0x22, 0x9A, 0x99, 0x99, + // 0x36 + 0xAA, 0xAA, 0xAA, 0xAA, 0x4A, 0x44, 0x94, 0x4A, 0x49, 0x99, 0x49, 0x49, 0x49, 0xA9, 0x4A, 0x49, 0x49, 0x44, 0x44, 0x49, 0x49, 0x49, 0x99, 0x49, 0x49, 0x49, 0x44, 0x49, 0x99, 0x99, 0x99, 0x99, + // 0x37 + 0xAA, 0xAA, 0xAA, 0xFF, 0x44, 0x49, 0xA9, 0x2A, 0x49, 0x49, 0xA9, 0xFA, 0x49, 0x49, 0xA9, 0x2A, 0x49, 0x49, 0xA9, 0x2A, 0x49, 0x49, 0xA9, 0x2A, 0x49, 0x44, 0xA9, 0x2A, 0x99, 0x99, 0xA9, 0x22, + // 0x38 + 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22, 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + // 0x39 + 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22, 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + // 0x3a + 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22, 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + // 0x3b + 0x2F, 0xEE, 0x2E, 0xFF, 0xE2, 0xAA, 0xEA, 0x22, 0xAE, 0xE9, 0xA9, 0xFE, 0xEE, 0x4E, 0xEE, 0x2E, 0x4E, 0xE2, 0x42, 0x2E, 0xE3, 0x44, 0xE4, 0x23, 0x32, 0xEE, 0x3E, 0x22, 0x22, 0x22, 0x22, 0x22, + // 0x3c + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xAA, 0xF2, 0xFF, 0x2A, 0x22, 0x2A, 0xFF, 0x2A, 0xFF, 0x2A, 0xEF, 0xA2, 0xAA, 0x22, 0xEF, 0x2F, 0x2A, 0xF2, 0xEF, + // 0x3d + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2E, 0xFF, 0xFF, 0xFF, 0x2E, 0xFF, 0xFF, 0xFF, 0x2E, 0xEF, 0x2E, 0x2E, + // 0x3e + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2B, 0xFF, 0xFF, 0xBF, 0xBB, 0xF2, 0xFF, 0x2B, 0x2B, 0x2B, 0xEF, 0xF2, 0x2B, 0x22, 0xEF, 0xBF, 0xBB, 0xF2, 0xEF, + // 0x3f + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2E, 0xFF, 0xFF, 0xFF, 0x2E, 0xFF, 0xFF, 0xFF, 0x2E, 0xEF, 0x2E, 0x2E, + // 0x40 + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xEF, + // 0x41 + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2E, 0xFF, 0xFF, 0xFF, 0x2E, 0xFF, 0xFF, 0xFF, 0x2E, 0xEF, 0x2E, 0x2E, + // 0x42 + 0xE3, 0xEE, 0xEE, 0xEE, 0xEE, 0x88, 0x8E, 0xE8, 0xEE, 0x88, 0x8E, 0xE8, 0xEE, 0x88, 0x88, 0xE8, 0xEE, 0x88, 0x8E, 0xE8, 0xEE, 0x88, 0x8E, 0xE8, 0xE3, 0xEE, 0xEE, 0xEE, 0x32, 0x33, 0x33, 0x33, + // 0x43 + 0xEE, 0xEE, 0xEE, 0xEE, 0x88, 0x88, 0xE8, 0xEE, 0x88, 0x8E, 0xE8, 0xEE, 0x88, 0x88, 0xE8, 0xEE, 0x88, 0xEE, 0xEE, 0xEE, 0x88, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x33, 0x33, 0x33, 0x33, + // 0x44 + 0x3E, 0xFF, 0xFF, 0xFF, 0xEE, 0x22, 0x22, 0x22, 0xEE, 0xFF, 0xFF, 0xFF, 0xEE, 0x22, 0x22, 0x22, 0xEE, 0x22, 0x22, 0x22, 0xEE, 0x22, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x22, 0x23, 0x22, 0x22, 0x22, + // 0x45 + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFE, 0xFF, 0xFF, 0xEE, 0xF2, 0xFF, 0xEF, 0x2E, 0xF2, 0xFF, 0xEE, 0x22, 0xFF, 0xEF, 0x2E, 0xF2, 0xFF, 0xEF, 0x22, 0xFF, 0xFF, 0x2F, 0xF2, 0xFF, 0xFF, + // 0x46 + 0xEE, 0xEE, 0xEE, 0xF3, 0x88, 0x88, 0xE8, 0xFE, 0x88, 0x8E, 0xE8, 0xFE, 0x88, 0x88, 0xE8, 0xFE, 0x88, 0xEE, 0xEE, 0xFE, 0x88, 0xEE, 0xEE, 0xFE, 0xEE, 0xEE, 0xEE, 0xF3, 0x33, 0x33, 0x33, 0xFF, + // 0x47 + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // 0x48 + 0xAA, 0xAA, 0x2A, 0xEF, 0x22, 0x2A, 0x22, 0xEF, 0xFF, 0x2A, 0xFF, 0xEF, 0xFF, 0x22, 0xFF, 0x2F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // 0x49 + 0x2E, 0xEF, 0x2E, 0x2E, 0x2E, 0xEF, 0x2E, 0x2E, 0xEE, 0x2E, 0xEE, 0x22, 0x22, 0x22, 0x22, 0xF2, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // 0x4a + 0x2B, 0x22, 0x2B, 0xEF, 0x2B, 0xFF, 0x2B, 0xEF, 0xB2, 0xBB, 0x22, 0xEF, 0x2F, 0x22, 0xF2, 0x2F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // 0x4b + 0x2E, 0xE4, 0x2E, 0x2E, 0x2E, 0xE4, 0x2E, 0x2E, 0xEE, 0x2E, 0xEE, 0x22, 0x22, 0x22, 0x22, 0xF2, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // 0x4c + 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0x2F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // 0x4d + 0x2E, 0xE4, 0x2E, 0x2E, 0x2E, 0xE4, 0x2E, 0x2E, 0xEE, 0x2E, 0xEE, 0x22, 0x22, 0x22, 0x22, 0xF2, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +}; diff --git a/src/battle/battle_system.c b/src/battle/battle_system.c index 2d9b5e34f0..6d70a2a90f 100644 --- a/src/battle/battle_system.c +++ b/src/battle/battle_system.c @@ -107,12 +107,12 @@ u32 *ov12_0223A8DC(BattleSystem *bsys) { return bsys->unk8C; } -SpriteRenderer *ov12_0223A8E4(BattleSystem *bsys) { - return bsys->unk90; +SpriteRenderer *BattleSystem_GetSpriteRenderer(BattleSystem *bsys) { + return bsys->spriteRenderer; } -SpriteGfxHandler *ov12_0223A8EC(BattleSystem *bsys) { - return bsys->unk94; +SpriteGfxHandler *BattleSystem_GetGfxHandler(BattleSystem *bsys) { + return bsys->gfxHandler; } UnkBattleSystemSub17C *ov12_0223A8F4(BattleSystem *bsys, int index) { @@ -131,12 +131,12 @@ void ov12_0223A914(BattleSystem *bsys, int index, u32 *a2) { bsys->unk1A0[index] = a2; } -FontID *BattleSystem_GetHpFont(BattleSystem *bsys) { - return bsys->hpFont; +BattleNumberPrinter *BattleSystem_GetHpNumPrinter(BattleSystem *bsys) { + return bsys->hpNumPrinter; } -FontID *BattleSystem_GetLevelFont(BattleSystem *bsys) { - return bsys->levelFont; +BattleNumberPrinter *BattleSystem_GetLevelNumPrinter(BattleSystem *bsys) { + return bsys->levelNumPrinter; } MsgData *BattleSystem_GetMessageData(BattleSystem *bsys) { @@ -848,11 +848,11 @@ void BattleSystem_SetBackground(BattleSystem *bsys) { u32 *src; u32 *dst; - bsys->unk230 = AllocFromHeap(HEAP_ID_BATTLE, 0x10000); - bsys->unk234 = AllocFromHeap(HEAP_ID_BATTLE, 0x200); + bsys->unk220 = AllocFromHeap(HEAP_ID_BATTLE, 0x10000); + bsys->unk224 = AllocFromHeap(HEAP_ID_BATTLE, 0x200); - MIi_CpuCopy32((void *)0x6010000, (u32 *)bsys->unk230, 0x10000); - dst = (u32 *)bsys->unk234; + MIi_CpuCopy32((void *)0x6010000, (u32 *)bsys->unk220, 0x10000); + dst = (u32 *)bsys->unk224; src = (u32 *)PaletteData_GetUnfadedBuf(bsys->palette, PLTTBUF_MAIN_BG); MIi_CpuCopy32(src, dst, 0x200); @@ -877,7 +877,7 @@ void BattleSystem_SetBackground(BattleSystem *bsys) { data = (vram[0x700 + objY * 0x100 + objX * 0x20 + i / 2] & 0xF); } if (data) { - bsys->unk230[bgY * 0x800 + bgX * 0x40 + i] = data + 0x70; + bsys->unk220[bgY * 0x800 + bgX * 0x40 + i] = data + 0x70; } } } @@ -894,7 +894,7 @@ void BattleSystem_SetBackground(BattleSystem *bsys) { data = (vram[i / 2] & 0xF); } if (data) { - bsys->unk230[0x9800 + i] = data + 0x70; + bsys->unk220[0x9800 + i] = data + 0x70; } } @@ -909,32 +909,32 @@ void BattleSystem_SetBackground(BattleSystem *bsys) { data = (vram[0x400 + (objX / 8) * 0x400 + (objX % 8) * 0x20 + objY * 0x100 + i / 2] & 0xF); } if (data) { - bsys->unk230[bgY * 0x800 + bgX * 0x40 + i] = data + 0x70; + bsys->unk220[bgY * 0x800 + bgX * 0x40 + i] = data + 0x70; } } } } - BG_LoadCharTilesData(bsys->bgConfig, 3, bsys->unk230, 0x10000, 0); + BG_LoadCharTilesData(bsys->bgConfig, 3, bsys->unk220, 0x10000, 0); ov12_02266008(&bsys->unk17C[0]); ov12_02266008(&bsys->unk17C[1]); } u8 *ov12_0223BAD0(BattleSystem *bsys) { - return bsys->unk230; + return bsys->unk220; } u16 *ov12_0223BAD8(BattleSystem *bsys) { - return bsys->unk234; + return bsys->unk224; } u16 *ov12_0223BAE0(BattleSystem *bsys) { - return &bsys->unk2238[0]; + return &bsys->unk2228[0]; } u16 *ov12_0223BAEC(BattleSystem *bsys) { - return &bsys->unk2318[0]; + return &bsys->unk2308[0]; } int BattleSystem_GetWeather(BattleSystem *bsys) { @@ -1042,7 +1042,7 @@ void BattleSystem_HpBar_Init(BattleSystem *bsys) { for (i = 0; i < bsys->maxBattlers; i++) { hpBar = OpponentData_GetHpBar(bsys->opponentData[i]); hpBar->bsys = bsys; - hpBar->type = ov12_02265B64(ov12_02261258(bsys->opponentData[i]), BattleSystem_GetBattleType(bsys)); + hpBar->type = BattleHpBar_Util_GetBarTypeFromBattlerSide(ov12_02261258(bsys->opponentData[i]), BattleSystem_GetBattleType(bsys)); BattleHpBar_LoadResources(hpBar); BattleHpBar_SetEnabled(hpBar, FALSE); } diff --git a/src/choose_starter_app.c b/src/choose_starter_app.c index 305ab18d94..7c05dd2112 100644 --- a/src/choose_starter_app.c +++ b/src/choose_starter_app.c @@ -299,7 +299,7 @@ BOOL ChooseStarter_Init(OVY_MANAGER *ovy, int *state_p) { initBallModelPositions(work); createMonSprites(work); TextFlags_SetCanABSpeedUpPrint(FALSE); - TextFlags_SetAutoScrollParam(TRUE); + TextFlags_SetAutoScrollParam(AUTO_SCROLL_ENABLE); TextFlags_SetCanTouchSpeedUpPrint(FALSE); return TRUE; } @@ -540,7 +540,7 @@ BOOL ChooseStarter_Exit(OVY_MANAGER *ovy, int *state) { struct ChooseStarterArgs *args = OverlayManager_GetArgs(ovy); TextFlags_SetCanABSpeedUpPrint(FALSE); - TextFlags_SetAutoScrollParam(FALSE); + TextFlags_SetAutoScrollParam(AUTO_SCROLL_OFF); TextFlags_SetCanTouchSpeedUpPrint(FALSE); args->cursorPos = work->curSelection; Main_SetVBlankIntrCB(NULL, NULL); @@ -1201,7 +1201,7 @@ static void loadOneMonObj(GF_2DGfxResMan *charResMan, GF_2DGfxResMan *plttResMan sub_0200ADA4(charResObj); sub_0200B00C(plttResObj); charProxy = sub_0200AF00(charResObj); - plttProxy = sub_0200B0F8(plttResObj, charProxy); + plttProxy = GF_PlttResObj_GetPlttProxy(plttResObj, charProxy); imageloc = NNS_G2dGetImageLocation(charProxy, NNS_G2D_VRAM_TYPE_2DSUB); plttloc = NNS_G2dGetImagePaletteLocation(plttProxy, NNS_G2D_VRAM_TYPE_2DSUB); DC_FlushRange(charData, 0xC80); diff --git a/src/credits/credits.c b/src/credits/credits.c index e253d0edc5..4dbe2b42c4 100644 --- a/src/credits/credits.c +++ b/src/credits/credits.c @@ -930,7 +930,7 @@ static void LoadCutsceneSpriteResources(CreditsAppWork *work) { GF_2DGfxResObj *charResObj = work->cutsceneRsrs[i].charResObj; GF_2DGfxResObj *plttResObj = work->cutsceneRsrs[i].plttResObj; NNSG2dImageProxy *imageProxy = sub_0200AF00(charResObj); - NNSG2dImagePaletteProxy *plttProxy = sub_0200B0F8(plttResObj, imageProxy); + NNSG2dImagePaletteProxy *plttProxy = GF_PlttResObj_GetPlttProxy(plttResObj, imageProxy); cutsceneWork->spriteGfx[i].imageProxy = imageProxy; cutsceneWork->spriteGfx[i].plttProxy = plttProxy; diff --git a/src/oaks_speech.c b/src/oaks_speech.c index 00e827bb24..8ec5fffb3e 100644 --- a/src/oaks_speech.c +++ b/src/oaks_speech.c @@ -943,7 +943,7 @@ static BOOL OakSpeech_PrintDialogMsg(OakSpeechData *data, int msgNum, int waitBu DrawFrameAndWindow2(&data->dialogWindow, FALSE, 0x3E2, 4); TextFlags_SetCanABSpeedUpPrint(TRUE); - TextFlags_SetAutoScrollParam(FALSE); + TextFlags_SetAutoScrollParam(AUTO_SCROLL_OFF); 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 1d3adfacbf..ed1397a812 100644 --- a/src/options_app.c +++ b/src/options_app.c @@ -67,7 +67,7 @@ typedef struct OptionsApp_Data { BgConfig *bgConfig; OptionsApp_Options options; Options *playerOptionsUnused; // unused copy of playerOptions - u32 *unk20; + BOOL *unk20; Options *playerOptions; MsgData *msgData; u8 filler2C[0x8]; diff --git a/src/party_context_menu.c b/src/party_context_menu.c index 266c25dea6..8474b72765 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); - TextFlags_SetAutoScrollParam(0); + TextFlags_SetAutoScrollParam(AUTO_SCROLL_OFF); 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/render_text.c b/src/render_text.c index ba0500db9e..c2b01c9fd4 100644 --- a/src/render_text.c +++ b/src/render_text.c @@ -583,10 +583,10 @@ void TextFlags_UnsetFastForwardTouchButtonHitbox(void) { void TextFlags_BeginAutoScroll(BOOL noSpeedUp) { if (noSpeedUp == FALSE) { TextFlags_SetCanABSpeedUpPrint(TRUE); - TextFlags_SetAutoScrollParam(3); + TextFlags_SetAutoScrollParam(AUTO_SCROLL_ENABLE | AUTO_SCROLL_SPEEDUP); TextFlags_SetCanTouchSpeedUpPrint(TRUE); } else { - TextFlags_SetAutoScrollParam(1); + TextFlags_SetAutoScrollParam(AUTO_SCROLL_ENABLE); TextFlags_SetCanABSpeedUpPrint(FALSE); TextFlags_SetCanTouchSpeedUpPrint(FALSE); } @@ -594,6 +594,6 @@ void TextFlags_BeginAutoScroll(BOOL noSpeedUp) { void TextFlags_EndAutoScroll(void) { TextFlags_SetCanABSpeedUpPrint(FALSE); - TextFlags_SetAutoScrollParam(0); + TextFlags_SetAutoScrollParam(AUTO_SCROLL_OFF); TextFlags_SetCanTouchSpeedUpPrint(FALSE); } diff --git a/src/scrcmd_c.c b/src/scrcmd_c.c index de75212e6a..266a0b4b8a 100644 --- a/src/scrcmd_c.c +++ b/src/scrcmd_c.c @@ -849,7 +849,7 @@ BOOL ScrCmd_TrainerTips(ScriptContext *ctx) { StringExpandPlaceholders(*msg_fmt, *unk, *tmp_str); TextFlags_SetCanABSpeedUpPrint(TRUE); - TextFlags_SetAutoScrollParam(FALSE); + TextFlags_SetAutoScrollParam(AUTO_SCROLL_OFF); TextFlags_SetCanTouchSpeedUpPrint(FALSE); Window *window = ov01_021F3D80(fieldSystem->unk68); diff --git a/src/system.c b/src/system.c index 009e797dd1..8c4f55751d 100644 --- a/src/system.c +++ b/src/system.c @@ -107,7 +107,7 @@ void sub_0201A1B4(void) { while (heap_size_pre & 3) { heap_size_pre++; } - InitHeapSystem(sDefaultHeapSpec, NELEMS(sDefaultHeapSpec), 161, heap_size_pre); + InitHeapSystem(sDefaultHeapSpec, NELEMS(sDefaultHeapSpec), HEAP_ID_MAX, heap_size_pre); } void InitSystemForTheGame(void) { diff --git a/src/unk_02009D48.c b/src/unk_02009D48.c index 670f5e059f..769b8134fe 100644 --- a/src/unk_02009D48.c +++ b/src/unk_02009D48.c @@ -54,7 +54,7 @@ void CreateSpriteResourcesHeader(struct SpriteResourcesHeader *hdr, int charId, GF_ASSERT(proxy != NULL); hdr->charData = NULL; } - hdr->plttProxy = sub_0200B0F8(plttObj, proxy); + hdr->plttProxy = GF_PlttResObj_GetPlttProxy(plttObj, proxy); hdr->imageProxy = proxy; hdr->cellData = GF2DGfxResObj_GetCellDataPtr(cellObj); if (cellAnmObj != NULL) { diff --git a/src/unk_0200ACF0.c b/src/unk_0200ACF0.c index eaf255c2f3..a1da95c7de 100644 --- a/src/unk_0200ACF0.c +++ b/src/unk_0200ACF0.c @@ -198,7 +198,7 @@ void sub_0200B0CC(GF_2DGfxResObjList *plttResObjList) { } } -NNSG2dImagePaletteProxy *sub_0200B0F8(GF_2DGfxResObj *plttResObj, NNSG2dImageProxy *imageProxy) { +NNSG2dImagePaletteProxy *GF_PlttResObj_GetPlttProxy(GF_2DGfxResObj *plttResObj, NNSG2dImageProxy *imageProxy) { GF_ASSERT(plttResObj != NULL); GF_ASSERT(GF2DGfxResObj_GetResType(plttResObj) == GF_GFX_RES_TYPE_PLTT); @@ -210,8 +210,8 @@ NNSG2dImagePaletteProxy *sub_0200B0F8(GF_2DGfxResObj *plttResObj, NNSG2dImagePro } } -int sub_0200B12C(GF_2DGfxResObj *plttResObj, NNS_G2D_VRAM_TYPE vram) { - NNSG2dImagePaletteProxy *plttProxy = sub_0200B0F8(plttResObj, NULL); +int GF_PlttResObj_GetVramSlotNum(GF_2DGfxResObj *plttResObj, NNS_G2D_VRAM_TYPE vram) { + NNSG2dImagePaletteProxy *plttProxy = GF_PlttResObj_GetPlttProxy(plttResObj, NULL); int location = NNS_G2dGetImagePaletteLocation(plttProxy, vram); if (location != -1) { location /= 32; diff --git a/src/unk_0200CE7C.c b/src/unk_0200CE7C.c new file mode 100644 index 0000000000..219246f967 --- /dev/null +++ b/src/unk_0200CE7C.c @@ -0,0 +1,24 @@ +#include "unk_0200CE7C.h" + +void sub_0200CE7C(MessagePrinter *msgPrinter, u8 glyphId, u32 num, u32 ndigits, PrintingMode mode, Window *window, u32 x, u32 y) { + sub_0200CDAC(msgPrinter, glyphId, window, x, y); + PrintUIntOnWindow(msgPrinter, num, ndigits, mode, window, x + 16, y); +} + +void sub_0200CEB0(BattleNumberPrinter *unk, u32 num, u32 ndigits, PrintingMode strConvMode, u16 *dest) { + u8 fillVal = (unk->fillVal << 4) | unk->fillVal; + ConvertUIntToDecimalString(unk->strbuf, num, strConvMode, ndigits); + for (int i = 0; unk->strbuf[i] != EOS; ++i) { + if (unk->strbuf[i] >= CHAR_JP_0 && unk->strbuf[i] <= CHAR_JP_9) { + const u8 *src = (const u8 *)unk->charData->pRawData + 32 * (unk->strbuf[i] - CHAR_JP_0); + u8 *dst = (u8 *)dest + i * 32; + MI_CpuCopy32( + src, + dst, + 32); + } else { + u8 *dst = (u8 *)dest + i * 32; + MI_CpuFill8(dst, fillVal, 32); + } + } +} diff --git a/src/unk_0200CF18.c b/src/unk_0200CF18.c index 4e9cbf4529..006ee7c57e 100644 --- a/src/unk_0200CF18.c +++ b/src/unk_0200CF18.c @@ -345,7 +345,7 @@ s8 SpriteRenderer_LoadPlttResObjFromNarcId(SpriteRenderer *renderer, SpriteGfxHa if (obj != NULL) { GF_ASSERT(sub_0200B00C(obj) == TRUE); MyInsertResObjIntoList(gfxHandler->_2dGfxResObjList[GF_GFX_RES_TYPE_PLTT], obj); - return sub_0200B12C(obj, vram); + return GF_PlttResObj_GetVramSlotNum(obj, vram); } GF_ASSERT(0); return -1; @@ -359,7 +359,7 @@ s8 SpriteRenderer_LoadPlttResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfx if (obj != NULL) { GF_ASSERT(sub_0200B00C(obj) == TRUE); MyInsertResObjIntoList(gfxHandler->_2dGfxResObjList[GF_GFX_RES_TYPE_PLTT], obj); - return sub_0200B12C(obj, vram); + return GF_PlttResObj_GetVramSlotNum(obj, vram); } GF_ASSERT(0); return -1; @@ -487,12 +487,12 @@ static UnkImageStruct *MyLoadResourcesAndCreateSprite(SpriteRenderer *renderer, return ret; } -NNSG2dImagePaletteProxy *sub_0200D934(SpriteGfxHandler *gfxHandler, int id) { - return sub_0200B0F8(Get2DGfxResObjById(gfxHandler->_2dGfxResMan[GF_GFX_RES_TYPE_PLTT], id), NULL); +NNSG2dImagePaletteProxy *GfGfxHandler_GetPlttProxy(SpriteGfxHandler *gfxHandler, int id) { + return GF_PlttResObj_GetPlttProxy(Get2DGfxResObjById(gfxHandler->_2dGfxResMan[GF_GFX_RES_TYPE_PLTT], id), NULL); } -int sub_0200D944(SpriteGfxHandler *gfxHandler, int id, NNS_G2D_VRAM_TYPE vram) { - return sub_0200B12C(Get2DGfxResObjById(gfxHandler->_2dGfxResMan[GF_GFX_RES_TYPE_PLTT], id), vram); +int GfGfxHandler_GetPlttNumById(SpriteGfxHandler *gfxHandler, int id, NNS_G2D_VRAM_TYPE vram) { + return GF_PlttResObj_GetVramSlotNum(Get2DGfxResObjById(gfxHandler->_2dGfxResMan[GF_GFX_RES_TYPE_PLTT], id), vram); } BOOL SpriteGfxHandler_UnloadCharObjById(SpriteGfxHandler *gfxHandler, u32 character) { diff --git a/src/unk_0208805C.c b/src/unk_0208805C.c new file mode 100644 index 0000000000..d7e95894f4 --- /dev/null +++ b/src/unk_0208805C.c @@ -0,0 +1,144 @@ +#include "unk_0208805C.h" + +#include "global.h" + +#include "gf_gfx_loader.h" +#include "system.h" +#include "unk_0200FA24.h" + +u8 sub_02088108(s16 *a0, u16 a1, s16 a2); + +static const u16 _02103894[] = { + 0x20, + 0x80, + 0x200, + 0x800, + 0x40, + 0x80, + 0x100, + 0x400, + 0x40, + 0x80, + 0x100, + 0x400, +}; + +u16 sub_0208805C(int a0) { + return _02103894[a0]; +} + +u8 CalculateHpBarPixelsLength(u32 hp, u32 maxHp, u8 pixelsWide) { + u8 ret = hp * pixelsWide / maxHp; + if (ret == 0 && hp != 0) { + ret = 1; + } + return ret; +} + +u8 HpBar_GetColorIdx(u32 pixelsCur, u32 pixelsWide) { + pixelsCur <<= 8; + pixelsWide <<= 8; + + if (pixelsCur > pixelsWide / 2) { + return 3; // green + } else if (pixelsCur > pixelsWide / 5) { + return 2; // yellow + } else if (pixelsCur > 0) { + return 1; // red + } + + return 0; // fainted +} + +u8 CalculateHpBarColor(u16 hp, u16 maxHp, u32 pixelsWide) { + if (hp == maxHp) { + return 4; + } + return HpBar_GetColorIdx(CalculateHpBarPixelsLength(hp, maxHp, pixelsWide), pixelsWide); +} + +void sub_020880CC(u8 a0, HeapID heapId) { + if (a0 == 0) { + BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, heapId); + } else { + BeginNormalPaletteFade(0, 8, 0, RGB_BLACK, 6, 1, heapId); + } +} + +u8 sub_02088108(s16 *a0, u16 a1, s16 a2) { + s16 prev = *a0; + switch (a2) { + case -1: + --(*a0); + if (*a0 <= 0) { + *a0 = a1; + } + if (*a0 == prev) { + return 0; + } + return 2; + case -10: + *a0 -= 10; + if (*a0 <= 0) { + *a0 = 1; + } + if (*a0 == prev) { + return 0; + } + return 2; + case 1: + ++(*a0); + if (*a0 > a1) { + *a0 = 1; + } + if (*a0 == prev) { + return 0; + } + return 1; + case 10: + *a0 += 10; + if (*a0 > a1) { + *a0 = a1; + } + if (*a0 == prev) { + return 0; + } + return 1; + } + + return 0; +} + +int sub_020881C0(s16 *a0, u16 a1) { + if (gSystem.newAndRepeatedKeys & PAD_KEY_UP) { + return sub_02088108(a0, a1, 1); + } + if (gSystem.newAndRepeatedKeys & PAD_KEY_DOWN) { + return sub_02088108(a0, a1, -1); + } + if (gSystem.newAndRepeatedKeys & PAD_KEY_LEFT) { + return sub_02088108(a0, a1, -10); + } + if (gSystem.newAndRepeatedKeys & PAD_KEY_RIGHT) { + return sub_02088108(a0, a1, 10); + } + return 0; +} + +void sub_0208820C(BgConfig *bgConfig, HeapID heapId, NARC *narc, int unused, int fileId, GFBgLayer layer, int kind, u32 szByte, u32 offset) { + switch (kind) { + case 0: + GfGfxLoader_LoadCharDataFromOpenNarc(narc, fileId, bgConfig, layer, offset, szByte, FALSE, heapId); + break; + case 1: + GfGfxLoader_LoadScrnDataFromOpenNarc(narc, fileId, bgConfig, layer, offset, szByte, FALSE, heapId); + break; + case 2: + if (layer <= GF_BG_LYR_MAIN_3) { + GfGfxLoader_GXLoadPalFromOpenNarc(narc, fileId, GF_PAL_LOCATION_MAIN_BG, (enum GFPalSlotOffset)offset, szByte, heapId); + } else { + GfGfxLoader_GXLoadPalFromOpenNarc(narc, fileId, GF_PAL_LOCATION_SUB_BG, (enum GFPalSlotOffset)offset, szByte, heapId); + } + break; + } +} diff --git a/tools/asmdiff/asmdiff.sh b/tools/asmdiff/asmdiff.sh index 0c98e8b93d..7798aff6ce 100755 --- a/tools/asmdiff/asmdiff.sh +++ b/tools/asmdiff/asmdiff.sh @@ -151,7 +151,7 @@ while [[ $# -gt 0 ]]; do done # Build C utils on demand -make -C "${MYDIR}" --no-print-directory "$mktgt" +make -C "${MYDIR}" -q --no-print-directory "$mktgt" if [ "$mktgt" = "clean" ]; then rm -rf "${MYDIR}"/.bins "${MYDIR}"/.files exit 0