Skip to content

Commit

Permalink
Merge pull request #336 from PikalaxALT/misc_documentation
Browse files Browse the repository at this point in the history
Battle HP Bar and related code
  • Loading branch information
PikalaxALT authored Oct 7, 2024
2 parents e615488 + 72f7f0f commit bec92f1
Show file tree
Hide file tree
Showing 123 changed files with 2,559 additions and 4,100 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_01_021E7FDC.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_02.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_05.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions asm/include/overlay_07.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_08.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_100.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_101.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_108.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_112.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions asm/include/overlay_12_02264824.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions asm/include/overlay_12_02265E28.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions asm/include/overlay_12_02266024.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions asm/include/overlay_12_battle_command.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions asm/include/overlay_12_battle_controller_opponent.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_14.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions asm/include/overlay_18.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_40.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_41.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_42.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_44.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_57.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_80_0223A00C.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_89.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_90.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_91.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions asm/include/overlay_93_thumb_2.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_96.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/overlay_97.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/render_window.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion asm/include/unk_020863F4.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 0 additions & 17 deletions asm/include/unk_0208805C.inc

This file was deleted.

2 changes: 1 addition & 1 deletion asm/overlay_01_021E7FDC.s
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion asm/overlay_02_02245B80.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit bec92f1

Please sign in to comment.