diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2023-09-02 15:34:29 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-02 15:34:29 -0400 |
| commit | 4fa13e4132cf8adb2f07bb34927e62e525c8cc79 (patch) | |
| tree | 5f00c923350f9386a7f46b0c50b888c878d7eacf /src | |
| parent | 9cceea48f31bdeea1c2933a1f64a74b60b80f17a (diff) | |
Move libultra function declarations to libultra headers (#1196)
* Delete unused headers
* Move PR and io to ultra64
* move headers to ultra64
* more cleanups
* more reorganizing
* i think that should be all
* format
* ifdef guards cleanup
* Add IO_READ and IO_WRITE macros for future use
* warnings
* review
Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
* warnings again
* warn
* ifdef guards
* fix merge
* fix merge
* fix merge
* bss
* padutils.h
* bss
* bss
* bss
* fix merge
* bss
* bss
* bss
* fix merge
* fixes
* fixes
* bss
* bss
* fix merge
* fix
* fix
* fix includepaths
* fix paths
* bss
* fix
* ultra64/ -> PR/
* header guards
* fix ehader guards
* fix
* fix++
* format
* bss is borken
* prevent 2
* :despair:
* bss
* rename assert to dbg_hungup
* fix
* a
* fix
* bss
* fix
* bss
* bss
---------
Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
Diffstat (limited to 'src')
69 files changed, 125 insertions, 100 deletions
diff --git a/src/boot_O2/assert.c b/src/boot_O2/debug.c index 04fcf87fe..3933b585e 100644 --- a/src/boot_O2/assert.c +++ b/src/boot_O2/debug.c @@ -1,11 +1,11 @@ #include "global.h" #include "fault.h" -void __assert(const char* file, u32 lineNum) { +void _dbg_hungup(const char* file, int lineNum) { osGetThreadId(NULL); Fault_AddHungupAndCrash(file, lineNum); } -void func_800862B4(void) { +void Reset(void) { Fault_AddHungupAndCrash("Reset", 0); } diff --git a/src/boot_O2/loadfragment.c b/src/boot_O2/loadfragment.c index 517c82bbb..b22b1a692 100644 --- a/src/boot_O2/loadfragment.c +++ b/src/boot_O2/loadfragment.c @@ -9,6 +9,7 @@ * The main difference between them seems to be the lack of vramEnd arguments here. * Instead they are calculated on the fly. */ + #include "global.h" #include "system_malloc.h" #include "loadfragment.h" diff --git a/src/boot_O2/mtxuty-cvt.c b/src/boot_O2/mtxuty-cvt.c index 2c1634392..a5da24522 100644 --- a/src/boot_O2/mtxuty-cvt.c +++ b/src/boot_O2/mtxuty-cvt.c @@ -15,5 +15,5 @@ void MtxConv_F2L(Mtx* mtx, MtxF* mf) { } void MtxConv_L2F(MtxF* mtx, Mtx* mf) { - guMtxL2F(mtx, mf); + guMtxL2F(mtx->mf, mf); } diff --git a/src/boot_O2/padutils.c b/src/boot_O2/padutils.c index accd09e11..1c6bbe868 100644 --- a/src/boot_O2/padutils.c +++ b/src/boot_O2/padutils.c @@ -1,4 +1,4 @@ -#include "global.h" +#include "padutils.h" void PadUtils_Init(Input* input) { bzero(input, sizeof(Input)); diff --git a/src/boot_O2_g3/fault.c b/src/boot_O2_g3/fault.c index b2afc3f95..f62dfb8b7 100644 --- a/src/boot_O2_g3/fault.c +++ b/src/boot_O2_g3/fault.c @@ -44,6 +44,7 @@ #include "fault.h" #include "global.h" #include "vt.h" +#include "PR/osint.h" #include "stackcheck.h" #include "z64thread.h" diff --git a/src/boot_O2_g3/yaz0.c b/src/boot_O2_g3/yaz0.c index 31166c3b5..edb7fc5cc 100644 --- a/src/boot_O2_g3/yaz0.c +++ b/src/boot_O2_g3/yaz0.c @@ -1,4 +1,3 @@ -#include "prevent_bss_reordering.h" #include "global.h" #include "fault.h" diff --git a/src/code/game.c b/src/code/game.c index dc1e1b93e..4f2df63cd 100644 --- a/src/code/game.c +++ b/src/code/game.c @@ -11,6 +11,7 @@ #include "z64vismono.h" #include "z64viszbuf.h" #include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" +#include "debug.h" s32 gFramerateDivisor = 1; f32 gFramerateDivisorF = 1.0f; @@ -168,7 +169,7 @@ void GameState_InitArena(GameState* gameState, size_t size) { } THA_Init(&gameState->heap, NULL, 0); - __assert("../game.c", 1035); + _dbg_hungup("../game.c", 1035); } void GameState_Realloc(GameState* gameState, size_t size) { @@ -192,7 +193,7 @@ void GameState_Realloc(GameState* gameState, size_t size) { THA_Init(&gameState->heap, gameArena, size); } else { THA_Init(&gameState->heap, NULL, 0); - __assert("../game.c", 1074); + _dbg_hungup("../game.c", 1074); } } diff --git a/src/code/padmgr.c b/src/code/padmgr.c index eb6a811b7..ae40fc1a4 100644 --- a/src/code/padmgr.c +++ b/src/code/padmgr.c @@ -32,8 +32,8 @@ */ #include "global.h" -#include "io/controller.h" -#include "ultra64/motor.h" +#include "PR/controller.h" +#include "PR/os_motor.h" #include "fault.h" #define PADMGR_RETRACE_MSG (1 << 0) diff --git a/src/code/z_actor_dlftbls.c b/src/code/z_actor_dlftbls.c index 012c118fb..d48ed24bc 100644 --- a/src/code/z_actor_dlftbls.c +++ b/src/code/z_actor_dlftbls.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" #include "fault.h" diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 924000f92..ae871c8a6 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -1,4 +1,3 @@ -#include "prevent_bss_reordering.h" #include "global.h" #include "fault.h" #include "fixed_point.h" diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 95d2e36f9..c2e00e206 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -44,6 +44,7 @@ */ #include "global.h" +#include "libc/string.h" #include "z64quake.h" #include "z64shrink_window.h" #include "z64view.h" diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 24371cdbe..ba9199dbb 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -1,5 +1,6 @@ -#include "prevent_bss_reordering.h" #include "PR/ultratypes.h" +#include "prevent_bss_reordering.h" +#include "prevent_bss_reordering2.h" // Variables are put before most headers as a hacky way to bypass bss reordering struct CutsceneCamera; diff --git a/src/code/z_eventmgr.c b/src/code/z_eventmgr.c index 88ec794fc..fed5ec48c 100644 --- a/src/code/z_eventmgr.c +++ b/src/code/z_eventmgr.c @@ -3,8 +3,10 @@ * * Manages all cutscenes except for manual */ + #include "global.h" #include "z64shrink_window.h" +#include "libc/string.h" ActorCutscene sGlobalCutsceneList[] = { // CS_ID_GLOBAL_78 diff --git a/src/code/z_pause.c b/src/code/z_pause.c index 5f212b7ae..b16cc62c1 100644 --- a/src/code/z_pause.c +++ b/src/code/z_pause.c @@ -20,6 +20,8 @@ */ #include "z64frameadvance.h" +#include "libc/stdbool.h" +#include "padutils.h" #include "macros.h" void FrameAdvance_Init(FrameAdvanceContext* frameAdvCtx) { diff --git a/src/code/z_play.c b/src/code/z_play.c index ccbf1f0c4..48fbb1f2d 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -32,6 +32,7 @@ u8 sMotionBlurStatus; #include "overlays/gamestates/ovl_opening/z_opening.h" #include "overlays/gamestates/ovl_file_choose/z_file_select.h" #include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" +#include "debug.h" s32 gDbgCamEnabled = false; u8 D_801D0D54 = false; @@ -335,11 +336,11 @@ void Play_SetupTransition(PlayState* this, s32 transitionType) { default: fbdemoType = -1; - __assert("../z_play.c", 1420); + _dbg_hungup("../z_play.c", 1420); } } else { fbdemoType = -1; - __assert("../z_play.c", 1423); + _dbg_hungup("../z_play.c", 1423); } transitionCtx->transitionType = transitionType; diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index e272bbfea..a890090ff 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -3,6 +3,7 @@ * Description: Set of library functions to interact with the Player system */ +#include "prevent_bss_reordering.h" #include "global.h" #include "objects/gameplay_keep/gameplay_keep.h" diff --git a/src/code/z_room.c b/src/code/z_room.c index 78eb5f98e..28a297499 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -1,4 +1,5 @@ #include "global.h" +#include "debug.h" void Room_Noop(PlayState* play, Room* room, Input* input, s32 arg3) { } @@ -380,7 +381,7 @@ RoomShapeImageMultiBgEntry* Room_GetImageMultiBgEntry(RoomShapeImageMulti* roomS bgEntry++; } - __assert("../z_room.c", 849); + _dbg_hungup("../z_room.c", 849); return NULL; } @@ -461,7 +462,7 @@ void Room_DrawImage(PlayState* play, Room* room, u32 flags) { } else if (roomShape->amountType == ROOM_SHAPE_IMAGE_AMOUNT_MULTI) { Room_DrawImageMulti(play, room, flags); } else { - __assert("../z_room.c", 965); + _dbg_hungup("../z_room.c", 965); } } @@ -516,7 +517,7 @@ size_t Room_AllocateAndLoad(PlayState* play, RoomContext* roomCtx) { roomCtx->roomMemPages[0] = THA_AllocTailAlign16(&play->state.heap, maxRoomSize); if (roomCtx->roomMemPages[0] == NULL) { - __assert("../z_room.c", 1078); + _dbg_hungup("../z_room.c", 1078); } roomCtx->roomMemPages[1] = (void*)((uintptr_t)roomCtx->roomMemPages[0] + maxRoomSize); roomCtx->activeMemPage = 0; diff --git a/src/code/z_vimode.c b/src/code/z_vimode.c index 778c89c14..8e3d1c59f 100644 --- a/src/code/z_vimode.c +++ b/src/code/z_vimode.c @@ -1,6 +1,7 @@ #include "global.h" +#include "debug.h" #include "z64vimode.h" -#include "ultra64/viint.h" +#include "PR/viint.h" typedef struct { /* 0x00 */ u32 burst; @@ -143,7 +144,7 @@ void ViMode_Configure(OSViMode* viMode, s32 type, s32 tvType, s32 loRes, s32 ant viMode->fldRegs[0].vBurst = ptr->vBurst; viMode->fldRegs[1].vBurst = ptr->vBurst; } else { - __assert("../z_vimode.c", 216); + _dbg_hungup("../z_vimode.c", 216); } viMode->comRegs.hStart += (leftAdjust << 16) + (s16)rightAdjust; diff --git a/src/libultra/gu/guS2DInitBg.c b/src/libultra/gu/guS2DInitBg.c index d2e5a2b04..c87176f49 100644 --- a/src/libultra/gu/guS2DInitBg.c +++ b/src/libultra/gu/guS2DInitBg.c @@ -1,4 +1,5 @@ #include "global.h" +#include "PR/gs2dex.h" void guS2DInitBg(uObjBg* bg) { u32 size; diff --git a/src/libultra/gu/lookathil.c b/src/libultra/gu/lookathil.c index dcb05b3d9..22540337c 100644 --- a/src/libultra/gu/lookathil.c +++ b/src/libultra/gu/lookathil.c @@ -1,7 +1,5 @@ #include "global.h" -#define FTOFRAC8(x) ((s32)MIN(((x) * (128.0f)), 127.0f) & 0xFF) - void guLookAtHiliteF(f32 mf[4][4], LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp, f32 xl1, f32 yl1, f32 zl1, /* light 1 direction */ f32 xl2, f32 yl2, f32 zl2, /* light 2 direction */ diff --git a/src/libultra/io/contreaddata.c b/src/libultra/io/contreaddata.c index 27bd0b8ed..21a8b90ce 100644 --- a/src/libultra/io/contreaddata.c +++ b/src/libultra/io/contreaddata.c @@ -1,5 +1,7 @@ #include "global.h" +void __osPackReadData(void); + s32 osContStartReadData(OSMesgQueue* mq) { s32 ret; int i; @@ -37,7 +39,7 @@ void osContGetReadData(OSContPad* data) { } } -void __osPackReadData() { +void __osPackReadData(void) { u8* ptr; __OSContReadFormat readformat; int i; diff --git a/src/libultra/io/motor.c b/src/libultra/io/motor.c index 9e0eb127e..ba934d800 100644 --- a/src/libultra/io/motor.c +++ b/src/libultra/io/motor.c @@ -1,6 +1,6 @@ -#include "ultra64/motor.h" +#include "PR/os_motor.h" -#include "io/controller.h" +#include "PR/controller.h" #include "functions.h" #define BANK_ADDR 0x400 diff --git a/src/libultra/io/osViModeMpalLan1.c b/src/libultra/io/osViModeMpalLan1.c index ccccf68ae..a7f5173a9 100644 --- a/src/libultra/io/osViModeMpalLan1.c +++ b/src/libultra/io/osViModeMpalLan1.c @@ -1,5 +1,5 @@ #include "global.h" -#include "ultra64/viint.h" +#include "PR/viint.h" OSViMode osViModeMpalLan1 = { OS_VI_MPAL_LAN1, // type diff --git a/src/libultra/io/osViModeNtscHpf1.c b/src/libultra/io/osViModeNtscHpf1.c index 5f88f4e94..672a2a17f 100644 --- a/src/libultra/io/osViModeNtscHpf1.c +++ b/src/libultra/io/osViModeNtscHpf1.c @@ -1,5 +1,5 @@ #include "global.h" -#include "ultra64/viint.h" +#include "PR/viint.h" OSViMode osViModeNtscHpf1 = { OS_VI_NTSC_HPF1, // type diff --git a/src/libultra/io/osViModeNtscLan1.c b/src/libultra/io/osViModeNtscLan1.c index 86eb473b7..afbe46fab 100644 --- a/src/libultra/io/osViModeNtscLan1.c +++ b/src/libultra/io/osViModeNtscLan1.c @@ -1,5 +1,5 @@ #include "global.h" -#include "ultra64/viint.h" +#include "PR/viint.h" OSViMode osViModeNtscLan1 = { OS_VI_NTSC_LAN1, // type diff --git a/src/libultra/io/osViModePalLan1.c b/src/libultra/io/osViModePalLan1.c index f875bb731..66ae4e6f1 100644 --- a/src/libultra/io/osViModePalLan1.c +++ b/src/libultra/io/osViModePalLan1.c @@ -1,5 +1,5 @@ #include "global.h" -#include "ultra64/viint.h" +#include "PR/viint.h" OSViMode osViModePalLan1 = { OS_VI_PAL_LAN1, // type diff --git a/src/libultra/io/pfschecker.c b/src/libultra/io/pfschecker.c index d3a635768..79045ce1b 100644 --- a/src/libultra/io/pfschecker.c +++ b/src/libultra/io/pfschecker.c @@ -1,4 +1,4 @@ -#include "PR/pfs.h" +#include "PR/os_pfs.h" #include "global.h" #define CHECK_IPAGE(p) \ diff --git a/src/libultra/io/pfsdeletefile.c b/src/libultra/io/pfsdeletefile.c index 39e9aa898..3d6558a0d 100644 --- a/src/libultra/io/pfsdeletefile.c +++ b/src/libultra/io/pfsdeletefile.c @@ -1,4 +1,4 @@ -#include "PR/pfs.h" +#include "PR/os_pfs.h" #include "global.h" s32 __osPfsReleasePages(OSPfs* pfs, __OSInode* inode, u8 initialPage, u8 bank, __OSInodeUnit* finalPage); diff --git a/src/libultra/io/pfsfilestate.c b/src/libultra/io/pfsfilestate.c index f06c8d937..887eac1f6 100644 --- a/src/libultra/io/pfsfilestate.c +++ b/src/libultra/io/pfsfilestate.c @@ -1,4 +1,4 @@ -#include "PR/pfs.h" +#include "PR/os_pfs.h" #include "global.h" s32 osPfsFileState(OSPfs* pfs, s32 fileNo, OSPfsState* state) { diff --git a/src/libultra/io/pfsfreeblocks.c b/src/libultra/io/pfsfreeblocks.c index b90979c59..2f8c6493f 100644 --- a/src/libultra/io/pfsfreeblocks.c +++ b/src/libultra/io/pfsfreeblocks.c @@ -1,5 +1,5 @@ #include "global.h" -#include "PR/pfs.h" +#include "PR/os_pfs.h" s32 osPfsFreeBlocks(OSPfs* pfs, s32* leftoverBytes) { s32 j; diff --git a/src/libultra/io/pfsinitpak.c b/src/libultra/io/pfsinitpak.c index cc226f834..f4d917b62 100644 --- a/src/libultra/io/pfsinitpak.c +++ b/src/libultra/io/pfsinitpak.c @@ -1,4 +1,4 @@ -#include "PR/pfs.h" +#include "PR/os_pfs.h" #include "global.h" s32 __osPfsCheckRamArea(OSPfs* pfs); diff --git a/src/libultra/io/pfsisplug.c b/src/libultra/io/pfsisplug.c index 474c7f914..99a2cbc42 100644 --- a/src/libultra/io/pfsisplug.c +++ b/src/libultra/io/pfsisplug.c @@ -1,5 +1,5 @@ -#include "PR/pfs.h" -#include "io/controller.h" +#include "PR/os_pfs.h" +#include "PR/controller.h" #include "global.h" void __osPfsRequestData(u8 poll); diff --git a/src/libultra/io/pfsselectbank.c b/src/libultra/io/pfsselectbank.c index 6cc43a470..59a69fccb 100644 --- a/src/libultra/io/pfsselectbank.c +++ b/src/libultra/io/pfsselectbank.c @@ -1,4 +1,4 @@ -#include "PR/pfs.h" +#include "PR/os_pfs.h" #include "global.h" s32 __osPfsSelectBank(OSPfs* pfs, u8 bank) { diff --git a/src/libultra/io/vigetcurrframebuf.c b/src/libultra/io/vigetcurrframebuf.c index bace58ded..8127a3f63 100644 --- a/src/libultra/io/vigetcurrframebuf.c +++ b/src/libultra/io/vigetcurrframebuf.c @@ -1,8 +1,8 @@ #include "global.h" -u32* osViGetCurrentFramebuffer(void) { +void* osViGetCurrentFramebuffer(void) { register u32 prevInt = __osDisableInt(); - u32* curBuf = __osViCurr->buffer; + void* curBuf = __osViCurr->buffer; __osRestoreInt(prevInt); diff --git a/src/libultra/io/vimgr.c b/src/libultra/io/vimgr.c index 13f63c90d..f38974b8a 100644 --- a/src/libultra/io/vimgr.c +++ b/src/libultra/io/vimgr.c @@ -1,6 +1,7 @@ #include "global.h" +#include "PR/osint.h" #include "stack.h" -#include "osint.h" +#include "PR/osint.h" OSThread viThread; STACK(sViStack, 0x1000); diff --git a/src/libultra/os/gethwinterrupt.c b/src/libultra/os/gethwinterrupt.c index dacd43910..711985df7 100644 --- a/src/libultra/os/gethwinterrupt.c +++ b/src/libultra/os/gethwinterrupt.c @@ -1,7 +1,8 @@ #include "global.h" -#include "os_internal.h" +#include "PR/os_internal.h" +#include "PR/osint.h" -void __osGetHWIntrRoutine(s32 idx, OSMesgQueue** outQueue, OSMesg* outMsg) { +void __osGetHWIntrRoutine(OSHWIntr idx, OSMesgQueue** outQueue, OSMesg* outMsg) { *outQueue = __osHwIntTable[idx].queue; *outMsg = __osHwIntTable[idx].msg; } diff --git a/src/libultra/os/initialize.c b/src/libultra/os/initialize.c index 4fabb4c4d..8eb97c28c 100644 --- a/src/libultra/os/initialize.c +++ b/src/libultra/os/initialize.c @@ -9,6 +9,8 @@ typedef struct { /* 0xC */ u32 ins_0C; // nop } struct_exceptionPreamble; // size = 0x10 +extern struct_exceptionPreamble __osExceptionPreamble; + u64 osClockRate = OS_CLOCK_RATE; s32 osViClock = VI_NTSC_CLOCK; UNK_TYPE4 __osShutdown = 0; @@ -30,7 +32,7 @@ void __createSpeedParam(void) { D_8009D1A8.relDuration = HW_REG(PI_BSD_DOM2_RLS_REG, u32); } -void osInitialize(void) { +void __osInitialize_common(void) { u32 pifdata; D_8009CF70 = 1; @@ -43,10 +45,10 @@ void osInitialize(void) { while (__osSiRawWriteIo(0x1FC007FC, pifdata | 8)) {} - *(struct_exceptionPreamble*)0x80000000 = *((struct_exceptionPreamble*)__osExceptionPreamble); - *(struct_exceptionPreamble*)0x80000080 = *((struct_exceptionPreamble*)__osExceptionPreamble); - *(struct_exceptionPreamble*)0x80000100 = *((struct_exceptionPreamble*)__osExceptionPreamble); - *(struct_exceptionPreamble*)0x80000180 = *((struct_exceptionPreamble*)__osExceptionPreamble); + *(struct_exceptionPreamble*)0x80000000 = __osExceptionPreamble; + *(struct_exceptionPreamble*)0x80000080 = __osExceptionPreamble; + *(struct_exceptionPreamble*)0x80000100 = __osExceptionPreamble; + *(struct_exceptionPreamble*)0x80000180 = __osExceptionPreamble; osWritebackDCache(0x80000000, 400); osInvalICache(0x80000000, 400); diff --git a/src/libultra/os/resetglobalintmask.c b/src/libultra/os/resetglobalintmask.c index c2561d712..6289a1d4c 100644 --- a/src/libultra/os/resetglobalintmask.c +++ b/src/libultra/os/resetglobalintmask.c @@ -1,6 +1,6 @@ #include "global.h" -void __osResetGlobalIntMask(u32 mask) { +void __osResetGlobalIntMask(OSHWIntr mask) { register s32 prevInt = __osDisableInt(); __OSGlobalIntMask &= ~(mask & ~0x401); diff --git a/src/libultra/os/seteventmesg.c b/src/libultra/os/seteventmesg.c index 26e837fcf..d5c8407f4 100644 --- a/src/libultra/os/seteventmesg.c +++ b/src/libultra/os/seteventmesg.c @@ -1,8 +1,9 @@ #include "global.h" +#include "PR/osint.h" UNK_TYPE4 D_80097F10 = 0; -__OSEventState __osEventStateTab[16]; +__OSEventState __osEventStateTab[OS_NUM_EVENTS]; void osSetEventMesg(OSEvent e, OSMesgQueue* mq, OSMesg m) { register u32 saveMask; diff --git a/src/libultra/os/setglobalintmask.c b/src/libultra/os/setglobalintmask.c index 6b7895d6d..067343f6e 100644 --- a/src/libultra/os/setglobalintmask.c +++ b/src/libultra/os/setglobalintmask.c @@ -1,6 +1,6 @@ #include "global.h" -void __osSetGlobalIntMask(u32 mask) { +void __osSetGlobalIntMask(OSHWIntr mask) { register s32 prevInt = __osDisableInt(); __OSGlobalIntMask |= mask; diff --git a/src/libultra/os/sethwinterrupt.c b/src/libultra/os/sethwinterrupt.c index 6ba72be7a..4f536cade 100644 --- a/src/libultra/os/sethwinterrupt.c +++ b/src/libultra/os/sethwinterrupt.c @@ -1,6 +1,7 @@ #include "global.h" +#include "PR/osint.h" -void __osSetHWIntrRoutine(s32 idx, OSMesgQueue* queue, OSMesg msg) { +void __osSetHWIntrRoutine(OSHWIntr idx, OSMesgQueue* queue, OSMesg msg) { register s32 prevInt = __osDisableInt(); __osHwIntTable[idx].queue = queue; diff --git a/src/libultra/os/virtualtophysical.c b/src/libultra/os/virtualtophysical.c index 6bdb2ccb3..403ab5f4f 100644 --- a/src/libultra/os/virtualtophysical.c +++ b/src/libultra/os/virtualtophysical.c @@ -1,5 +1,5 @@ #include "PR/ultratypes.h" -#include "osint.h" +#include "PR/osint.h" #include "libc/stdint.h" #include "global.h" diff --git a/src/libultra/rmon/sprintf.c b/src/libultra/rmon/sprintf.c index 446a74702..9f3610fe0 100644 --- a/src/libultra/rmon/sprintf.c +++ b/src/libultra/rmon/sprintf.c @@ -1,4 +1,5 @@ #include "global.h" +#include "libc/string.h" void* proutSprintf(void* dst, const char* fmt, size_t size) { return (void*)((uintptr_t)memcpy(dst, fmt, size) + size); @@ -12,7 +13,7 @@ int vsprintf(char* dst, char* fmt, va_list args) { return ans; } -int sprintf(char* dst, char* fmt, ...) { +int sprintf(char* dst, const char* fmt, ...) { int ans; va_list args; va_start(args, fmt); diff --git a/src/libultra/rmon/xldtob.c b/src/libultra/rmon/xldtob.c index 66c058396..e30bf4b81 100644 --- a/src/libultra/rmon/xldtob.c +++ b/src/libultra/rmon/xldtob.c @@ -1,4 +1,5 @@ #include "global.h" +#include "libc/string.h" #define BUFF_LEN 0x20 diff --git a/src/libultra/rmon/xlitob.c b/src/libultra/rmon/xlitob.c index 6c53ee094..70b9c32a4 100644 --- a/src/libultra/rmon/xlitob.c +++ b/src/libultra/rmon/xlitob.c @@ -1,4 +1,5 @@ #include "global.h" +#include "libc/string.h" #define BUFF_LEN 0x18 diff --git a/src/libultra/rmon/xprintf.c b/src/libultra/rmon/xprintf.c index 6caac436f..3fc6b5e2a 100644 --- a/src/libultra/rmon/xprintf.c +++ b/src/libultra/rmon/xprintf.c @@ -1,4 +1,5 @@ #include "global.h" +#include "libc/string.h" #define ATOI(i, a) \ for (i = 0; *a >= '0' && *a <= '9'; a++) \ @@ -28,6 +29,8 @@ char spaces[] = " "; char zeroes[] = "00000000000000000000000000000000"; +void _Putfld(_Pft* px, va_list* pap, unsigned char code, unsigned char* ac); + int _Printf(PrintCallback pfn, void* arg, const char* fmt, va_list ap) { _Pft x; x.nchar = 0; diff --git a/src/libultra/voice/voicecheckresult.c b/src/libultra/voice/voicecheckresult.c index 7d1e5c0a5..252472192 100644 --- a/src/libultra/voice/voicecheckresult.c +++ b/src/libultra/voice/voicecheckresult.c @@ -1,9 +1,10 @@ /** * File: voicecheckresult.c */ -#include "ultra64/controller_voice.h" -#include "ultra64/os_voice.h" -#include "io/controller.h" + +#include "PR/controller_voice.h" +#include "PR/controller.h" +#include "PR/os_voice.h" s32 __osVoiceCheckResult(OSVoiceHandle* hd, u8* status) { s32 errorCode = __osVoiceGetStatus(hd->mq, hd->channel, status); diff --git a/src/libultra/voice/voicecheckword.c b/src/libultra/voice/voicecheckword.c index 1a2695b51..b4c05d90c 100644 --- a/src/libultra/voice/voicecheckword.c +++ b/src/libultra/voice/voicecheckword.c @@ -3,7 +3,7 @@ * * Checks whether or not a word can be registered in the dictionary */ -#include "io/controller.h" +#include "PR/controller.h" // TODO: SJIS support s32 osVoiceCheckWord(u8* word) { diff --git a/src/libultra/voice/voicecleardictionary.c b/src/libultra/voice/voicecleardictionary.c index e474bc2fd..eceb9bb71 100644 --- a/src/libultra/voice/voicecleardictionary.c +++ b/src/libultra/voice/voicecleardictionary.c @@ -10,9 +10,9 @@ * is initialized with the osVoiceClearDictionary function */ -#include "ultra64/controller_voice.h" -#include "ultra64/os_voice.h" -#include "io/controller.h" +#include "PR/controller_voice.h" +#include "PR/controller.h" +#include "PR/os_voice.h" s32 osVoiceClearDictionary(OSVoiceHandle* hd, u8 numWords) { s32 errorCode; diff --git a/src/libultra/voice/voicecontread2.c b/src/libultra/voice/voicecontread2.c index 1477e570b..0f39ee308 100644 --- a/src/libultra/voice/voicecontread2.c +++ b/src/libultra/voice/voicecontread2.c @@ -2,8 +2,8 @@ * File: voicecontread2.c */ -#include "ultra64/controller_voice.h" -#include "io/controller.h" +#include "PR/controller_voice.h" +#include "PR/controller.h" #include "functions.h" #include "variables.h" diff --git a/src/libultra/voice/voicecontread36.c b/src/libultra/voice/voicecontread36.c index 83d0fdf2e..9f23bf979 100644 --- a/src/libultra/voice/voicecontread36.c +++ b/src/libultra/voice/voicecontread36.c @@ -2,8 +2,8 @@ * File: voicecontread36.c */ -#include "ultra64/controller_voice.h" -#include "io/controller.h" +#include "PR/controller_voice.h" +#include "PR/controller.h" #include "functions.h" #include "variables.h" diff --git a/src/libultra/voice/voicecontrolgain.c b/src/libultra/voice/voicecontrolgain.c index 61cccde70..bac3871d7 100644 --- a/src/libultra/voice/voicecontrolgain.c +++ b/src/libultra/voice/voicecontrolgain.c @@ -4,9 +4,9 @@ * Adjusts the input gain of the Voice Recognition System */ -#include "ultra64/controller_voice.h" -#include "ultra64/os_voice.h" -#include "io/controller.h" +#include "PR/controller_voice.h" +#include "PR/os_voice.h" +#include "PR/controller.h" #include "macros.h" u8 sDigitalTable[] = { 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0 }; diff --git a/src/libultra/voice/voicecontwrite20.c b/src/libultra/voice/voicecontwrite20.c index cc3af385e..dd9d7e07f 100644 --- a/src/libultra/voice/voicecontwrite20.c +++ b/src/libultra/voice/voicecontwrite20.c @@ -2,8 +2,8 @@ * File: voicecontwrite20.c */ -#include "ultra64/controller_voice.h" -#include "io/controller.h" +#include "PR/controller_voice.h" +#include "PR/controller.h" #include "functions.h" #include "variables.h" diff --git a/src/libultra/voice/voicecontwrite4.c b/src/libultra/voice/voicecontwrite4.c index 06239219a..103d3e798 100644 --- a/src/libultra/voice/voicecontwrite4.c +++ b/src/libultra/voice/voicecontwrite4.c @@ -2,8 +2,8 @@ * File: voicecontwrite4.c */ -#include "ultra64/controller_voice.h" -#include "io/controller.h" +#include "PR/controller_voice.h" +#include "PR/controller.h" #include "functions.h" #include "variables.h" diff --git a/src/libultra/voice/voicegetreaddata.c b/src/libultra/voice/voicegetreaddata.c index d271f71c7..5e5a2b62b 100644 --- a/src/libultra/voice/voicegetreaddata.c +++ b/src/libultra/voice/voicegetreaddata.c @@ -4,9 +4,9 @@ * Gets voice recognition result from the Voice Recognition System */ -#include "ultra64/controller_voice.h" -#include "ultra64/os_voice.h" -#include "io/controller.h" +#include "PR/controller_voice.h" +#include "PR/os_voice.h" +#include "PR/controller.h" s32 osVoiceGetReadData(OSVoiceHandle* hd, OSVoiceData* result) { static u8 sHandleStatus; diff --git a/src/libultra/voice/voicegetstatus.c b/src/libultra/voice/voicegetstatus.c index 444ae6233..b19348908 100644 --- a/src/libultra/voice/voicegetstatus.c +++ b/src/libultra/voice/voicegetstatus.c @@ -2,8 +2,8 @@ * File: voicegetstatus.c */ -#include "ultra64/controller_voice.h" -#include "io/controller.h" +#include "PR/controller_voice.h" +#include "PR/controller.h" #include "functions.h" s32 __osVoiceGetStatus(OSMesgQueue* mq, s32 channel, u8* status) { diff --git a/src/libultra/voice/voiceinit.c b/src/libultra/voice/voiceinit.c index 2a777edaf..f8c965f70 100644 --- a/src/libultra/voice/voiceinit.c +++ b/src/libultra/voice/voiceinit.c @@ -4,9 +4,9 @@ * Initializes Voice Recognition System control structure and hardware */ -#include "ultra64/controller_voice.h" -#include "ultra64/os_voice.h" -#include "io/controller.h" +#include "PR/controller_voice.h" +#include "PR/os_voice.h" +#include "PR/controller.h" #include "functions.h" #include "macros.h" @@ -14,7 +14,7 @@ static u8 sCmds[] = { 0x1E, 0x6E, 0x08, 0x56, 0x03, }; -s32 osVoiceInit(OSMesgQueue* mq, OSVoiceHandle* hd, s32 channel) { +s32 osVoiceInit(OSMesgQueue* mq, OSVoiceHandle* hd, int channel) { s32 errorCode; s32 i; u8 status = 0; diff --git a/src/libultra/voice/voicemaskdictionary.c b/src/libultra/voice/voicemaskdictionary.c index a8f090329..225c45dee 100644 --- a/src/libultra/voice/voicemaskdictionary.c +++ b/src/libultra/voice/voicemaskdictionary.c @@ -4,13 +4,13 @@ * Mask words registered in the voice recognition system */ -#include "ultra64/controller_voice.h" -#include "ultra64/os_voice.h" -#include "io/controller.h" +#include "PR/controller_voice.h" +#include "PR/os_voice.h" +#include "PR/controller.h" #include "functions.h" #include "macros.h" -s32 osVoiceMaskDictionary(OSVoiceHandle* hd, u8* maskPattern, s32 size) { +s32 osVoiceMaskDictionary(OSVoiceHandle* hd, u8* maskPattern, int size) { s32 errorCode; s32 i; s32 j; diff --git a/src/libultra/voice/voicesetadconverter.c b/src/libultra/voice/voicesetadconverter.c index 2a6ebfbc7..55403dae6 100644 --- a/src/libultra/voice/voicesetadconverter.c +++ b/src/libultra/voice/voicesetadconverter.c @@ -2,8 +2,8 @@ * File: voicesetadconverter.c */ -#include "ultra64/controller_voice.h" -#include "io/controller.h" +#include "PR/controller_voice.h" +#include "PR/controller.h" #include "functions.h" #include "variables.h" diff --git a/src/libultra/voice/voicesetword.c b/src/libultra/voice/voicesetword.c index 2dfe58b94..82b0f88aa 100644 --- a/src/libultra/voice/voicesetword.c +++ b/src/libultra/voice/voicesetword.c @@ -4,9 +4,9 @@ * Registers words to the Voice Recognition System dictionary */ -#include "ultra64/controller_voice.h" -#include "ultra64/os_voice.h" -#include "io/controller.h" +#include "PR/controller_voice.h" +#include "PR/os_voice.h" +#include "PR/controller.h" #include "functions.h" #include "macros.h" diff --git a/src/libultra/voice/voicestartreaddata.c b/src/libultra/voice/voicestartreaddata.c index 398d10a15..0ff35fd2b 100644 --- a/src/libultra/voice/voicestartreaddata.c +++ b/src/libultra/voice/voicestartreaddata.c @@ -4,9 +4,9 @@ * Start voice recognition by the Voice Recognition System */ -#include "ultra64/controller_voice.h" -#include "ultra64/os_voice.h" -#include "io/controller.h" +#include "PR/controller_voice.h" +#include "PR/os_voice.h" +#include "PR/controller.h" s32 osVoiceStartReadData(OSVoiceHandle* hd) { s32 errorCode; diff --git a/src/libultra/voice/voicestopread.c b/src/libultra/voice/voicestopread.c index 570613428..905efb19f 100644 --- a/src/libultra/voice/voicestopread.c +++ b/src/libultra/voice/voicestopread.c @@ -4,9 +4,9 @@ * Forcibly stops voice recognition processing by the Voice Recognition System */ -#include "ultra64/controller_voice.h" -#include "ultra64/os_voice.h" -#include "io/controller.h" +#include "PR/controller_voice.h" +#include "PR/os_voice.h" +#include "PR/controller.h" s32 osVoiceStopReadData(OSVoiceHandle* hd) { s32 errorCode; diff --git a/src/overlays/actors/ovl_Bg_Dblue_Balance/z_bg_dblue_balance.c b/src/overlays/actors/ovl_Bg_Dblue_Balance/z_bg_dblue_balance.c index 47f0dec92..5d0ac3bc5 100644 --- a/src/overlays/actors/ovl_Bg_Dblue_Balance/z_bg_dblue_balance.c +++ b/src/overlays/actors/ovl_Bg_Dblue_Balance/z_bg_dblue_balance.c @@ -4,7 +4,6 @@ * Description: Great Bay Temple - Seesaw and Waterwheel w/ Platforms */ -#include "prevent_bss_reordering.h" #include "z_bg_dblue_balance.h" #include "objects/object_dblue_object/object_dblue_object.h" diff --git a/src/overlays/actors/ovl_Boss_02/z_boss_02.c b/src/overlays/actors/ovl_Boss_02/z_boss_02.c index 751aa5523..bf3aa576d 100644 --- a/src/overlays/actors/ovl_Boss_02/z_boss_02.c +++ b/src/overlays/actors/ovl_Boss_02/z_boss_02.c @@ -4,7 +4,6 @@ * Description: Twinmold */ -#include "prevent_bss_reordering.h" #include "z_boss_02.h" #include "z64rumble.h" #include "z64shrink_window.h" diff --git a/src/overlays/actors/ovl_En_Az/z_en_az.c b/src/overlays/actors/ovl_En_Az/z_en_az.c index 8d1e306bb..8b98808e1 100644 --- a/src/overlays/actors/ovl_En_Az/z_en_az.c +++ b/src/overlays/actors/ovl_En_Az/z_en_az.c @@ -4,6 +4,7 @@ * Description: Beaver Bros */ +#include "prevent_bss_reordering.h" #include "z_en_az.h" #include "overlays/actors/ovl_En_Twig/z_en_twig.h" #include "overlays/actors/ovl_En_Fish/z_en_fish.h" diff --git a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c index 7aae1c742..7fbd43a54 100644 --- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c +++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c @@ -7,6 +7,7 @@ #include "z_en_horse_game_check.h" #include "z64horse.h" #include "objects/object_horse_game_check/object_horse_game_check.h" +#include "debug.h" #define FLAGS (ACTOR_FLAG_10) @@ -128,13 +129,13 @@ s32 func_808F8CCC(EnHorseGameCheck* this, PlayState* play2) { this->horse1 = (EnHorse*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, -1149.0f, -106.0f, 470.0f, 0, 0x7FFF, 0, ENHORSE_PARAMS(ENHORSE_PARAM_BANDIT, ENHORSE_4)); if (this->horse1 == NULL) { - __assert("../z_en_horse_game_check.c", 1517); + _dbg_hungup("../z_en_horse_game_check.c", 1517); } this->horse2 = (EnHorse*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, -1376.0f, -106.0f, 470.0f, 0, 0x7FFF, 0, ENHORSE_PARAMS(ENHORSE_PARAM_BANDIT, ENHORSE_5)); if (this->horse2 == NULL) { - __assert("../z_en_horse_game_check.c", 1526); + _dbg_hungup("../z_en_horse_game_check.c", 1526); } this->unk_17C = -1; diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index 39e092e2f..8bbbaca14 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -4,7 +4,6 @@ * Description: Grass / Bush */ -#include "prevent_bss_reordering.h" #include "z_en_kusa.h" #include "objects/object_kusa/object_kusa.h" #include "objects/gameplay_keep/gameplay_keep.h" diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 435406885..a1f238240 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -4,7 +4,6 @@ * Description: Player */ -#include "prevent_bss_reordering.h" #include "global.h" #include "z64horse.h" #include "z64quake.h" diff --git a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c index 1104a28a3..c552e7c50 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c +++ b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c @@ -5,6 +5,7 @@ */ #include "z_eff_ss_kakera.h" +#include "debug.h" #define rReg0 regs[0] #define rGravity regs[1] @@ -62,7 +63,7 @@ u32 EffectSsKakera_Init(PlayState* play, u32 index, EffectSs* this, void* initPa break; } } else { - __assert("../z_eff_kakera.c", 193); + _dbg_hungup("../z_eff_kakera.c", 193); } this->draw = EffectSsKakera_Draw; this->update = EffectSsKakera_Update; |
