diff options
| author | KiritoDv <kiritodev01@gmail.com> | 2024-05-03 18:20:20 -0600 |
|---|---|---|
| committer | KiritoDv <kiritodev01@gmail.com> | 2024-05-03 18:20:20 -0600 |
| commit | 1fbf28a78d8b6dd8136aa628b5b1bc3d4c9b9223 (patch) | |
| tree | dd726cd42cc4f8d72c7f0f932104781bf84f5773 /src | |
| parent | c78629d5b9b23fa93154bbf43352eaa24454f63c (diff) | |
Fixed more errors, we are rendering the logo, Yay
Diffstat (limited to 'src')
| -rw-r--r-- | src/audio/load.c | 2 | ||||
| -rw-r--r-- | src/code_80005FD0.h | 2 | ||||
| -rw-r--r-- | src/code_80091750.c | 18 | ||||
| -rw-r--r-- | src/code_800AF9B0.c | 7 | ||||
| -rw-r--r-- | src/crash_screen.c | 2 | ||||
| -rw-r--r-- | src/ending/code_80281780.c | 1 | ||||
| -rw-r--r-- | src/ending/podium_ceremony_actors.c | 1 | ||||
| -rw-r--r-- | src/main.c | 80 | ||||
| -rw-r--r-- | src/main.h | 5 | ||||
| -rw-r--r-- | src/menus.c | 4 | ||||
| -rw-r--r-- | src/menus.h | 2 | ||||
| -rwxr-xr-x | src/os/guMtxCatL.c | 2 | ||||
| -rw-r--r-- | src/os/libultra_internal.h | 2 | ||||
| -rw-r--r-- | src/port/Engine.cpp | 3 | ||||
| -rw-r--r-- | src/port/Game.cpp | 7 | ||||
| -rw-r--r-- | src/racing/collision.h | 2 | ||||
| -rw-r--r-- | src/racing/memory.c | 214 | ||||
| -rw-r--r-- | src/racing/memory.h | 50 | ||||
| -rw-r--r-- | src/update_objects.h | 2 |
19 files changed, 212 insertions, 194 deletions
diff --git a/src/audio/load.c b/src/audio/load.c index b18bc8fa1..08096203c 100644 --- a/src/audio/load.c +++ b/src/audio/load.c @@ -11,6 +11,8 @@ #include "audio/port_eu.h" #include "buffers/gfx_output_buffer.h" +#include <string.h> + #define ALIGN16(val) (((val) + 0xF) & ~0xF) struct SequencePlayer gSequencePlayers[SEQUENCE_PLAYERS]; diff --git a/src/code_80005FD0.h b/src/code_80005FD0.h index a3d57cbe3..4350ca9d5 100644 --- a/src/code_80005FD0.h +++ b/src/code_80005FD0.h @@ -413,6 +413,6 @@ extern s32 D_8016448C; extern u16 D_801637BE; extern u16 D_80163E2A; -extern Gfx D_0D0076F8[]; +// extern Gfx D_0D0076F8[]; #endif diff --git a/src/code_80091750.c b/src/code_80091750.c index a32a8e83f..12f606898 100644 --- a/src/code_80091750.c +++ b/src/code_80091750.c @@ -3312,12 +3312,12 @@ Gfx *func_80097AE4(Gfx *displayListHead, s8 fmt, s32 arg2, s32 arg3, u8 *arg4, s dsdx = 0x8000 / (32 - width); gDPLoadTextureTile(displayListHead++, arg4, fmt, G_IM_SIZ_16b, 64, 64, temp, i, temp + 32, i + 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); gSPTextureRectangle(displayListHead++, (arg2 + width) << 2, arg3 << 2, (arg2 + 32) << 2, (arg3 + 32) << 2, 0, 0, 0, dsdx, 1024); - + arg2 += 32; - + gDPLoadTextureTile(displayListHead++, arg4, fmt, G_IM_SIZ_16b, 64, 64, temp + 32, i, temp + 64, i + 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); gSPTextureRectangle(displayListHead++, arg2 << 2, arg3 << 2, ((arg2 - width) + 32) << 2, (arg3 + 32) << 2, 0, 0, 0, dsdx, 1024); - + arg2 = arg2Copy; arg3 += 32; } @@ -3335,7 +3335,7 @@ Gfx *func_80097E58(Gfx *displayListHead, s8 fmt, u32 arg2, u32 arg3, u32 arg4, u s32 temp2 = 32; if (width >= 32) { return displayListHead; } - + arg6Copy = arg6; lrs = arg9 / 2; @@ -3524,17 +3524,15 @@ void func_80099110(void) { * @return void* */ void *segmented_to_virtual_dupe(const void *addr) { - size_t segment = (uintptr_t) addr >> 24; - size_t offset = (uintptr_t) addr & 0x00FFFFFF; - - return (void *) ((gSegmentTable[segment] + offset) + 0x80000000); + return addr; } void *segmented_to_virtual_dupe_2(const void *addr) { - size_t segment = (uintptr_t) addr >> 24; + /*size_t segment = (uintptr_t) addr >> 24; size_t offset = (uintptr_t) addr & 0x00FFFFFF; - return (void *) ((gSegmentTable[segment] + offset) + 0x80000000); + return (void *) ((gSegmentTable[segment] + offset) + 0x80000000);*/ + return addr; } #ifdef NON_MATCHING diff --git a/src/code_800AF9B0.c b/src/code_800AF9B0.c index 361087020..faac24fc7 100644 --- a/src/code_800AF9B0.c +++ b/src/code_800AF9B0.c @@ -8,6 +8,7 @@ #include "memory.h" #include "main.h" #include "math_util.h" +#include <stdlib.h> /*** Data ***/ Ambient D_800E8680 = {{ @@ -32,8 +33,8 @@ Vtx *D_8018EDBC; #define SQ(x) ((x) * (x)) void func_800AF9B0(void) { - D_8018EDB8 = (void *)get_next_available_memory_addr(480 * sizeof(Vtx)); - D_8018EDBC = (void *)get_next_available_memory_addr(480 * sizeof(Vtx)); + D_8018EDB8 = (void *)calloc(480, sizeof(Vtx)); + D_8018EDBC = (void *)calloc(480, sizeof(Vtx)); } // could be a normal vertex, not a color... @@ -186,7 +187,7 @@ void func_800B0004(void) { for (j = 0; j < 12; j++) { res1 = sins(D_8018EDB0 - (j * D_8018EDB2)) * 84.0f * j * 0.18f; res2 = sins(D_8018EDB0 - ((j + 1) * D_8018EDB2)) * 84.0f * (j + 1) * 0.18f; - func_800AF9E4(&(&vtxs[j * 4])[i * 48], j, i, 84, res1, res2, (j * 84), 84); + func_800AF9E4(&vtxs[j * 4 + i * 48], j, i, 84, res1, res2, (j * 84), 84); } } func_800AFF58(vtxs); diff --git a/src/crash_screen.c b/src/crash_screen.c index f41229dd2..10248e8b4 100644 --- a/src/crash_screen.c +++ b/src/crash_screen.c @@ -258,5 +258,5 @@ void create_debug_thread(void) { } void start_debug_thread(void) { - osStartThread(&D_80162790); + // osStartThread(&D_80162790); } diff --git a/src/ending/code_80281780.c b/src/ending/code_80281780.c index fb61da51e..513532b46 100644 --- a/src/ending/code_80281780.c +++ b/src/ending/code_80281780.c @@ -20,6 +20,7 @@ #include "main.h" #include "menus.h" #include "render_courses.h" +#include <string.h> #define bcopy memcpy diff --git a/src/ending/podium_ceremony_actors.c b/src/ending/podium_ceremony_actors.c index e115007c6..4ec792ce9 100644 --- a/src/ending/podium_ceremony_actors.c +++ b/src/ending/podium_ceremony_actors.c @@ -17,6 +17,7 @@ #include "code_80005FD0.h" #include "code_80281C40.h" #include "math_util.h" +#include <string.h> s32 fireworkConeColour[] = { 0x00FF4080, // pink diff --git a/src/main.c b/src/main.c index 1903101ca..41291a323 100644 --- a/src/main.c +++ b/src/main.c @@ -265,15 +265,17 @@ void start_sptask(s32 taskType) { gActiveSPTask->state = SPTASK_STATE_RUNNING; } +extern void Graphics_PushFrame(Gfx* data); + /** * Initializes the Fast3D OSTask structure. * Loads F3DEX or F3DLX based on the number of players **/ void create_gfx_task_structure(void) { gGfxSPTask->msgqueue = &gGfxVblankQueue; - gGfxSPTask->msg = OS_MESG_32(2); - gGfxSPTask->task.t.type = M_GFXTASK; - gGfxSPTask->task.t.flags = OS_TASK_DP_WAIT; + // gGfxSPTask->msg = OS_MESG_32(2); + // gGfxSPTask->task.t.type = M_GFXTASK; + // gGfxSPTask->task.t.flags = OS_TASK_DP_WAIT; // gGfxSPTask->task.t.ucode_boot = rspF3DBootStart; // gGfxSPTask->task.t.ucode_boot_size = ((u8 *) rspF3DBootEnd - (u8 *) rspF3DBootStart); // The split-screen multiplayer racing state uses F3DLX which has a simple subpixel calculation. @@ -286,19 +288,21 @@ void create_gfx_task_structure(void) { // gGfxSPTask->task.t.ucode = gspF3DLXTextStart; // gGfxSPTask->task.t.ucode_data = gspF3DLXDataStart; // } - gGfxSPTask->task.t.flags = 0; - gGfxSPTask->task.t.flags = OS_TASK_DP_WAIT; + // gGfxSPTask->task.t.flags = 0; + // gGfxSPTask->task.t.flags = OS_TASK_DP_WAIT; // gGfxSPTask->task.t.ucode_size = SP_UCODE_SIZE; // gGfxSPTask->task.t.ucode_data_size = SP_UCODE_DATA_SIZE; - gGfxSPTask->task.t.dram_stack = (u64 *) &gGfxSPTaskStack; - // gGfxSPTask->task.t.dram_stack_size = SP_DRAM_STACK_SIZE8; - gGfxSPTask->task.t.output_buff = (u64 *) &gGfxSPTaskOutputBuffer; - gGfxSPTask->task.t.output_buff_size = (u64 *) ((u8 *) gGfxSPTaskOutputBuffer + sizeof(gGfxSPTaskOutputBuffer)); - gGfxSPTask->task.t.data_ptr = (u64 *) gGfxPool->gfxPool; - gGfxSPTask->task.t.data_size = (gDisplayListHead - gGfxPool->gfxPool) * sizeof(Gfx); + // gGfxSPTask->task.t.dram_stack = (u64 *) &gGfxSPTaskStack; + // // gGfxSPTask->task.t.dram_stack_size = SP_DRAM_STACK_SIZE8; + // gGfxSPTask->task.t.output_buff = (u64 *) &gGfxSPTaskOutputBuffer; + // gGfxSPTask->task.t.output_buff_size = (u64 *) ((u8 *) gGfxSPTaskOutputBuffer + sizeof(gGfxSPTaskOutputBuffer)); + // gGfxSPTask->task.t.data_ptr = (u64 *) gGfxPool->gfxPool; + // gGfxSPTask->task.t.data_size = (gDisplayListHead - gGfxPool->gfxPool) * sizeof(Gfx); func_8008C214(); - gGfxSPTask->task.t.yield_data_ptr = (u64 *) &gGfxSPTaskYieldBuffer; - gGfxSPTask->task.t.yield_data_size = OS_YIELD_DATA_SIZE; + // gGfxSPTask->task.t.yield_data_ptr = (u64 *) &gGfxSPTaskYieldBuffer; + // gGfxSPTask->task.t.yield_data_size = OS_YIELD_DATA_SIZE; + + Graphics_PushFrame(gGfxPool->gfxPool); } @@ -353,7 +357,7 @@ void read_controllers(void) { OSMesg msg; osContStartReadData(&gSIEventMesgQueue); - osRecvMesg(&gSIEventMesgQueue, &msg, OS_MESG_BLOCK); + // osRecvMesg(&gSIEventMesgQueue, &msg, OS_MESG_BLOCK); osContGetReadData(gControllerPads); update_controller(0); update_controller(1); @@ -454,14 +458,14 @@ void config_gfx_pool(void) { */ void display_and_vsync(void) { profiler_log_thread5_time(BEFORE_DISPLAY_LISTS); - osRecvMesg(&gGfxVblankQueue, &gMainReceivedMesg, OS_MESG_BLOCK); + // osRecvMesg(&gGfxVblankQueue, &gMainReceivedMesg, OS_MESG_BLOCK); exec_display_list(&gGfxPool->spTask); profiler_log_thread5_time(AFTER_DISPLAY_LISTS); - osRecvMesg(&gGameVblankQueue, &gMainReceivedMesg, OS_MESG_BLOCK); + // osRecvMesg(&gGameVblankQueue, &gMainReceivedMesg, OS_MESG_BLOCK); osViSwapBuffer((void *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[sRenderedFramebuffer])); profiler_log_thread5_time(THREAD5_END); - osRecvMesg(&gGameVblankQueue, &gMainReceivedMesg, OS_MESG_BLOCK); - crash_screen_set_framebuffer(gPhysicalFramebuffers[sRenderedFramebuffer]); + // osRecvMesg(&gGameVblankQueue, &gMainReceivedMesg, OS_MESG_BLOCK); + // crash_screen_set_framebuffer(gPhysicalFramebuffers[sRenderedFramebuffer]); if (++sRenderedFramebuffer == 3) { sRenderedFramebuffer = 0; @@ -504,6 +508,8 @@ void dma_copy(u8 *dest, u8 *romAddr, size_t size) { } } +static u8 memoryPool[0xAB630]; + /** * Setup main segments and framebuffers. */ @@ -515,14 +521,15 @@ void setup_game_memory(void) { // uintptr_t allocatedMemory; // UNUSED s32 unknown_padding; -// init_segment_racing(); -// gHeapEndPtr = SEG_RACING; + init_segment_racing(); + // gHeapEndPtr = SEG_RACING; // set_segment_base_addr(0, (void *) SEG_START); // // Memory pool size of 0xAB630 -// initialize_memory_pool(MEMORY_POOL_START, MEMORY_POOL_END); + bzero(memoryPool, sizeof(memoryPool)); + initialize_memory_pool(memoryPool, memoryPool + sizeof(memoryPool)); -// func_80000BEC(); + func_80000BEC(); // // Initialize trig tables segment // osInvalDCache((void *) TRIG_TABLES, TRIG_TABLES_SIZE); @@ -1170,6 +1177,7 @@ void update_gamestate(void) { } void thread5_game_loop(void) { + setup_game_memory(); osCreateMesgQueue(&gGfxVblankQueue, gGfxMesgBuf, 1); osCreateMesgQueue(&gGameVblankQueue, &gGameMesgBuf, 1); init_controllers(); @@ -1177,7 +1185,7 @@ void thread5_game_loop(void) { clear_nmi_buffer(); } - set_vblank_handler(2, &gGameVblankHandler, &gGameVblankQueue, (OSMesg *)(OS_EVENT_SW2)); + // set_vblank_handler(2, &gGameVblankHandler, &gGameVblankQueue, (OSMesg *)(OS_EVENT_SW2)); // These variables track stats such as player wins. // In the event of a console reset, it remembers them. gNmiUnknown1 = &pAppNmiBuffer[0]; // 2 u8's, tracks number of times player 1/2 won a VS race @@ -1189,22 +1197,22 @@ void thread5_game_loop(void) { rendering_init(); read_controllers(); func_800C5CB8(); +} - while(true) { - func_800CB2C4(); +void thread5_iteration(void){ + // func_800CB2C4(); - // Update the gamestate if it has changed (racing, menus, credits, etc.). - if (gGamestateNext != gGamestate) { - gGamestate = gGamestateNext; - update_gamestate(); - } - profiler_log_thread5_time(THREAD5_START); - config_gfx_pool(); - read_controllers(); - game_state_handler(); - end_master_display_list(); - display_and_vsync(); + // Update the gamestate if it has changed (racing, menus, credits, etc.). + if (gGamestateNext != gGamestate) { + gGamestate = gGamestateNext; + update_gamestate(); } + profiler_log_thread5_time(THREAD5_START); + config_gfx_pool(); + read_controllers(); + game_state_handler(); + end_master_display_list(); + display_and_vsync(); } /** diff --git a/src/main.h b/src/main.h index 2adc38a68..7a0dd5123 100644 --- a/src/main.h +++ b/src/main.h @@ -19,7 +19,7 @@ #define MTX_HUD_POOL_SIZE_MAX MTX_HUD_POOL_SIZE - 50 #endif -#define MTX_OBJECT_POOL_SIZE 128 +#define MTX_OBJECT_POOL_SIZE 512 //! @todo Verify with proper documentation // functions called by mtxShadow multiply by 8 @@ -40,7 +40,7 @@ #define MTX_EFFECT_POOL_SIZE_MAX MTX_EFFECT_POOL_SIZE + 100 #endif -#define GFX_POOL_SIZE 7500 +#define GFX_POOL_SIZE 15000 struct GfxPool { /* 0x00000 */ Mtx mtxScreen; // Matrix for skybox and startup logo @@ -102,6 +102,7 @@ void func_8000262C(void); void func_80002658(void); void update_gamestate(void); void thread5_game_loop(void); +void thread5_iteration(void); void thread4_audio(void*); diff --git a/src/menus.c b/src/menus.c index 7a2bdcde4..bdecd0e18 100644 --- a/src/menus.c +++ b/src/menus.c @@ -1524,7 +1524,7 @@ void player_select_menu_act(struct Controller *controller, u16 arg1) { if (!func_800B4520()) { switch (D_8018EDEE) { - case 1: + case 1: { saved_selection = gCharacterGridSelections[arg1]; if (saved_selection == 0) { @@ -1565,7 +1565,7 @@ void player_select_menu_act(struct Controller *controller, u16 arg1) { func_800B44AC(); gMenuTimingCounter = 0; } - + // L800B3768 if (D_8018EDE8[arg1] == 0) { if ((btnAndStick & CONT_RIGHT) && (btnAndStick & CONT_DOWN)) { diff --git a/src/menus.h b/src/menus.h index e789caf7b..85ad94508 100644 --- a/src/menus.h +++ b/src/menus.h @@ -49,7 +49,7 @@ extern f32 D_8018EDDC; extern s32 D_8018EDE0; extern s8 gCharacterGridSelections[]; -extern s8 D_8018EDE8[]; +extern bool D_8018EDE8[]; extern s8 D_8018EDEC; extern s8 gMainMenuSelectionDepth; extern s8 D_8018EDEE; diff --git a/src/os/guMtxCatL.c b/src/os/guMtxCatL.c index f7b22d482..ad220bb59 100755 --- a/src/os/guMtxCatL.c +++ b/src/os/guMtxCatL.c @@ -32,7 +32,7 @@ #include <libultraship.h> -void guMtxXFMF(Mtx *, float, float, float, float *, float *, float *); +// void guMtxXFMF(Mtx *, float, float, float, float *, float *, float *); void guMtxCatF(float mf[4][4], float nf[4][4], float res[4][4]); void guMtxCatL(Mtx *m, Mtx *n, Mtx *res) { diff --git a/src/os/libultra_internal.h b/src/os/libultra_internal.h index dd1ac555f..c241ca8df 100644 --- a/src/os/libultra_internal.h +++ b/src/os/libultra_internal.h @@ -81,7 +81,7 @@ s32 __osSpSetPc(void *); s32 __osSpDeviceBusy(void); s32 __osSiDeviceBusy(void); s32 __osSpRawStartDma(u32 dir, void *sp_ptr, void *dram_ptr, size_t size); -void __osSetHWIntrRoutine(OSHWIntr interrupt, s32 (*handler)(void)); +void __osSetHWIntrRoutine(OSHWIntr interrupt, s32 (*callback)(void), void* sp); s32 __osLeoInterrupt(); void __osViInit(void); OSViContext *__osViGetCurrentContext(void); diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp index f3466be60..2e65f5cf4 100644 --- a/src/port/Engine.cpp +++ b/src/port/Engine.cpp @@ -22,7 +22,7 @@ GameEngine* GameEngine::Instance; GameEngine::GameEngine() { std::vector<std::string> OTRFiles; - if (const std::string cube_path = LUS::Context::GetPathRelativeToAppDirectory("sp.otr"); std::filesystem::exists(cube_path)) { + if (const std::string cube_path = LUS::Context::GetPathRelativeToAppDirectory("mkcube.otr"); std::filesystem::exists(cube_path)) { OTRFiles.push_back(cube_path); } if (const std::string sm64_otr_path = LUS::Context::GetPathRelativeToAppBundle("sm64.otr"); std::filesystem::exists(sm64_otr_path)) { @@ -60,6 +60,7 @@ void GameEngine::Destroy(){ bool ShouldClearTextureCacheAtEndOfFrame = false; + void GameEngine::StartFrame() const{ using LUS::KbScancode; const int32_t dwScancode = this->context->GetWindow()->GetLastScancode(); diff --git a/src/port/Game.cpp b/src/port/Game.cpp index 42f84a103..cb62afb73 100644 --- a/src/port/Game.cpp +++ b/src/port/Game.cpp @@ -19,9 +19,10 @@ extern "C" void Timer_Update(); void push_frame() { // GameEngine::StartAudioFrame(); GameEngine::Instance->StartFrame(); + thread5_iteration(); + // thread5_game_loop(); // Graphics_ThreadUpdate();w // Timer_Update(); - // thread5_iteration(); // GameEngine::EndAudioFrame(); } @@ -34,8 +35,8 @@ extern "C" int main(int argc, char *argv[]) { #endif GameEngine::Create(); - audio_init(); - sound_init(); + // audio_init(); + // sound_init(); thread5_game_loop(); GameEngine::Instance->ProcessFrame(push_frame); GameEngine::Instance->Destroy(); diff --git a/src/racing/collision.h b/src/racing/collision.h index 4391e9660..9505175b8 100644 --- a/src/racing/collision.h +++ b/src/racing/collision.h @@ -35,7 +35,7 @@ void set_vertex_data_with_defaults(Gfx*); void set_vertex_data_with_default_section_id(Gfx*, s8); void find_and_set_vertex_data(Gfx*, s8, u16); void find_and_set_tile_size(uintptr_t, s32, s32); -void set_vertex_colours(u32, u32, s32, s8, u8, u8, u8); +void set_vertex_colours(uintptr_t, u32, s32, s8, u8, u8, u8); void find_vtx_and_set_colours(uintptr_t, s8, u8, u8, u8); void subtract_scaled_vector(Vec3f, f32, Vec3f); diff --git a/src/racing/memory.c b/src/racing/memory.c index 6ce49aaed..038d528fb 100644 --- a/src/racing/memory.c +++ b/src/racing/memory.c @@ -16,7 +16,7 @@ s32 sGfxSeekPosition; s32 sPackedSeekPosition; -u32 sPoolFreeSpace; +uintptr_t sPoolFreeSpace; struct MainPoolBlock *sPoolListHeadL; struct MainPoolBlock *sPoolListHeadR; @@ -34,11 +34,11 @@ s32 memoryPadding[2]; * @param size of memory to allocate. * @return Address of free memory */ -void *get_next_available_memory_addr(u32 size) { - u32 *freeSpace = (u32 *)gNextFreeMemoryAddress; +void *get_next_available_memory_addr(uintptr_t size) { + uintptr_t freeSpace = gNextFreeMemoryAddress; size = ALIGN16(size); gNextFreeMemoryAddress += size; - return freeSpace; + return (void*) freeSpace; } /** @@ -96,17 +96,18 @@ void initialize_memory_pool(uintptr_t poolStart, uintptr_t poolEnd) { gFreeMemorySize = (poolEnd - poolStart) - 0x10; gNextFreeMemoryAddress = poolStart; + int bp = 0; } /** * @brief Allocates memory and adjusts gFreeMemorySize. */ -void *allocate_memory(u32 size) { - u32 *freeSpace; +void *allocate_memory(uintptr_t size) { + uintptr_t freeSpace; size = ALIGN16(size); gFreeMemorySize -= size; - freeSpace = (u32 *) gNextFreeMemoryAddress; + freeSpace = (uintptr_t ) gNextFreeMemoryAddress; gNextFreeMemoryAddress += size; return (void *) freeSpace; @@ -122,7 +123,7 @@ UNUSED void func_802A7D54(s32 arg0, s32 arg1) { */ void *load_data(uintptr_t startAddr, uintptr_t endAddr) { void *allocated; - u32 size = endAddr - startAddr; + uintptr_t size = endAddr - startAddr; allocated = allocate_memory(size); if (allocated != 0) { @@ -131,7 +132,7 @@ void *load_data(uintptr_t startAddr, uintptr_t endAddr) { return (void *) allocated; } -UNUSED void main_pool_init(u32 start, u32 end) { +UNUSED void main_pool_init(uintptr_t start, uintptr_t end) { start = ALIGN16(start); end = ALIGN16(end - 15); @@ -150,7 +151,7 @@ UNUSED void main_pool_init(u32 start, u32 end) { * specified side of the pool (MEMORY_POOL_LEFT or MEMORY_POOL_RIGHT). * If there is not enough space, return NULL. */ -UNUSED void *main_pool_alloc(u32 size, u32 side) { +UNUSED void *main_pool_alloc(uintptr_t size, uintptr_t side) { struct MainPoolBlock *newListHead; void *addr = NULL; @@ -179,7 +180,7 @@ UNUSED void *main_pool_alloc(u32 size, u32 side) { * newer blocks are freed as well. * Return the amount of free space left in the pool. */ -UNUSED u32 main_pool_free(void *addr) { +UNUSED uintptr_t main_pool_free(void *addr) { struct MainPoolBlock *block = (struct MainPoolBlock *) ((u8 *) addr - 8); struct MainPoolBlock *oldListHead = (struct MainPoolBlock *) ((u8 *) addr - 8); @@ -201,7 +202,7 @@ UNUSED u32 main_pool_free(void *addr) { return sPoolFreeSpace; } // main_pool_realloc -UNUSED void *main_pool_realloc(void *addr, u32 size) { +UNUSED void *main_pool_realloc(void *addr, uintptr_t size) { void *newAddr = NULL; struct MainPoolBlock *block = (struct MainPoolBlock *) ((u8 *) addr - 8); @@ -212,13 +213,13 @@ UNUSED void *main_pool_realloc(void *addr, u32 size) { return newAddr; } -UNUSED s32 main_pool_available(void) { +UNUSED uintptr_t main_pool_available(void) { return sPoolFreeSpace - 8; } -UNUSED u32 main_pool_push_state(void) { +UNUSED uintptr_t main_pool_push_state(void) { struct MainPoolState *prevState = gMainPoolState; - u32 freeSpace = sPoolFreeSpace; + uintptr_t freeSpace = sPoolFreeSpace; struct MainPoolBlock *lhead = sPoolListHeadL; struct MainPoolBlock *rhead = sPoolListHeadR; @@ -234,7 +235,7 @@ UNUSED u32 main_pool_push_state(void) { * Restore pool state from a previous call to main_pool_push_state. Return the * amount of free space left in the pool. */ -UNUSED u32 main_pool_pop_state(void) { +UNUSED uintptr_t main_pool_pop_state(void) { sPoolFreeSpace = gMainPoolState->freeSpace; sPoolListHeadL = gMainPoolState->listHeadL; sPoolListHeadR = gMainPoolState->listHeadR; @@ -244,8 +245,8 @@ UNUSED u32 main_pool_pop_state(void) { // similar to sm64 dma_read UNUSED void *func_802A80B0(u8 *dest, u8 *srcStart, u8 *srcEnd) { void *addr; - u32 size = srcStart - dest; - addr = main_pool_alloc(size, (u32) srcEnd); + uintptr_t size = srcStart - dest; + addr = main_pool_alloc(size, (uintptr_t) srcEnd); if (addr != 0) { @@ -269,12 +270,12 @@ UNUSED void *load_segment(s32 segment, u8 *srcStart, u8 *srcEnd, u8 *side) { // Similar to sm64 load_to_fixed_pool_addr? UNUSED void *func_802A8190(s32 arg0, u8 *arg1) { - //u32 srcSize = ALIGN16(srcEnd - srcStart); - //u32 destSize = ALIGN16((u8 *) sPoolListHeadR - destAddr); + //uintptr_t srcSize = ALIGN16(srcEnd - srcStart); + //uintptr_t destSize = ALIGN16((u8 *) sPoolListHeadR - destAddr); void *addr; - u32 temp_v0 = D_802B8CD4[arg0].unk4; - u32 temp_v1 = D_802B8CD4[arg0].unk8; - u32 temp_v2 = D_802B8CD4[arg0].unk2; + uintptr_t temp_v0 = D_802B8CD4[arg0].unk4; + uintptr_t temp_v1 = D_802B8CD4[arg0].unk8; + uintptr_t temp_v2 = D_802B8CD4[arg0].unk2; addr = func_802A80B0((u8 *) temp_v0, (u8 *) temp_v1, arg1); //dest = main_pool_alloc(destSize, MEMORY_POOL_RIGHT); @@ -301,7 +302,7 @@ UNUSED void func_802A81EC(void) { } while (phi_s0 != 3); } -UNUSED struct AllocOnlyPool *alloc_only_pool_init(u32 size, u32 side) { +UNUSED struct AllocOnlyPool *alloc_only_pool_init(uintptr_t size, uintptr_t side) { void *addr; struct AllocOnlyPool *subPool = NULL; @@ -317,13 +318,13 @@ UNUSED struct AllocOnlyPool *alloc_only_pool_init(u32 size, u32 side) { return subPool; } -UNUSED u32 func_802A82AC(s32 arg0) { - u32 temp_v0; - u32 phi_v1; +UNUSED uintptr_t func_802A82AC(s32 arg0) { + uintptr_t temp_v0; + uintptr_t phi_v1; temp_v0 = D_801502A0 - arg0; phi_v1 = 0; - if (temp_v0 >= (u32) gDisplayListHead) { + if (temp_v0 >= (uintptr_t) gDisplayListHead) { D_801502A0 = temp_v0; phi_v1 = temp_v0; } @@ -335,7 +336,7 @@ UNUSED u32 func_802A82AC(s32 arg0) { */ u8 *dma_compressed_vtx(u8 *start, u8 *end) { u8 *freeSpace; - u32 size; + uintptr_t size; size = ALIGN16(end - start); freeSpace = (u8 *) gNextFreeMemoryAddress; @@ -345,8 +346,8 @@ u8 *dma_compressed_vtx(u8 *start, u8 *end) { } // unused mio0 decode func. -UNUSED s32 func_802A8348(s32 arg0, s32 arg1, s32 arg2) { - u32 offset; +UNUSED uintptr_t func_802A8348(s32 arg0, s32 arg1, s32 arg2) { + uintptr_t offset; UNUSED void *pad; uintptr_t oldAddr; void *newAddr; @@ -355,9 +356,9 @@ UNUSED s32 func_802A8348(s32 arg0, s32 arg1, s32 arg2) { oldAddr = gNextFreeMemoryAddress; newAddr = (void *) (oldAddr + offset); pad = &newAddr; - osInvalDCache(newAddr, offset); + // osInvalDCache(newAddr, offset); //osPiStartDma(&gDmaIoMesg, 0, 0, (uintptr_t) &_other_texturesSegmentRomStart[SEGMENT_OFFSET(arg0)], newAddr, offset, &gDmaMesgQueue); - osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, 1); + // osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, 1); func_80040030((u8 *) newAddr, (u8 *) oldAddr); gNextFreeMemoryAddress += offset; @@ -396,8 +397,8 @@ u8 *dma_textures(u8 texture[], size_t arg1, size_t arg2) { // return temp_v0; } -u32 MIO0_0F(u8 *arg0, u32 arg1, u32 arg2) { - // u32 oldHeapEndPtr; +uintptr_t MIO0_0F(u8 *arg0, uintptr_t arg1, uintptr_t arg2) { + // uintptr_t oldHeapEndPtr; // void *temp_v0; // arg1 = ALIGN16(arg1); @@ -413,12 +414,12 @@ u32 MIO0_0F(u8 *arg0, u32 arg1, u32 arg2) { // return oldHeapEndPtr; } -void func_802A86A8(CourseVtx *data, u32 arg1) { +void func_802A86A8(CourseVtx *data, uintptr_t arg1) { CourseVtx *courseVtx = data; Vtx *vtx; s32 tmp = ALIGN16(arg1 * 0x10); #ifdef AVOID_UB - u32 i; + uintptr_t i; #else s32 i; #endif @@ -429,7 +430,7 @@ void func_802A86A8(CourseVtx *data, u32 arg1) { gHeapEndPtr -= tmp; vtx = (Vtx *) gHeapEndPtr; - // s32 to u32 comparison required for matching. + // s32 to uintptr_t comparison required for matching. for (i = 0; i < arg1; i++) { if (gIsMirrorMode) { vtx->v.ob[0] = -courseVtx->ob[0]; @@ -457,7 +458,7 @@ void func_802A86A8(CourseVtx *data, u32 arg1) { } } -void decompress_vtx(CourseVtx *arg0, u32 vertexCount) { +void decompress_vtx(CourseVtx *arg0, uintptr_t vertexCount) { s32 size = ALIGN16(vertexCount * 0x18); void *freeSpace; u8 *vtxCompressed = arg0; @@ -496,7 +497,7 @@ void unpack_lights(Gfx *arg0, UNUSED u8 *arg1, s8 arg2) { } void unpack_displaylist(Gfx *arg0, u8 *args, UNUSED s8 opcode) { - u32 temp_v0 = args[sPackedSeekPosition++]; + uintptr_t temp_v0 = args[sPackedSeekPosition++]; uintptr_t temp_t7 = ((args[sPackedSeekPosition++]) << 8 | temp_v0) * 8; arg0[sGfxSeekPosition].words.w0 = 0x06000000; // Segment seven addr @@ -532,70 +533,70 @@ void unpack_cull_displaylist(Gfx *arg0, UNUSED u8 *arg1, UNUSED s8 arg2) { sGfxSeekPosition++; } -void unpack_combine_mode1(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { +void unpack_combine_mode1(Gfx *arg0, UNUSED u8 *arg1, UNUSED uintptr_t arg2) { Gfx macro[] = {gsDPSetCombineMode(G_CC_MODULATERGBA, G_CC_MODULATERGBA)}; arg0[sGfxSeekPosition].words.w0 = macro->words.w0; arg0[sGfxSeekPosition].words.w1 = macro->words.w1; sGfxSeekPosition++; } -void unpack_combine_mode2(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { +void unpack_combine_mode2(Gfx *arg0, UNUSED u8 *arg1, UNUSED uintptr_t arg2) { Gfx macro[] = {gsDPSetCombineMode(G_CC_MODULATERGBDECALA, G_CC_MODULATERGBDECALA)}; arg0[sGfxSeekPosition].words.w0 = macro->words.w0; arg0[sGfxSeekPosition].words.w1 = macro->words.w1; sGfxSeekPosition++; } -void unpack_combine_mode_shade(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { +void unpack_combine_mode_shade(Gfx *arg0, UNUSED u8 *arg1, UNUSED uintptr_t arg2) { Gfx macro[] = {gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE)}; arg0[sGfxSeekPosition].words.w0 = macro->words.w0; arg0[sGfxSeekPosition].words.w1 = macro->words.w1; sGfxSeekPosition++; } -void unpack_combine_mode4(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { +void unpack_combine_mode4(Gfx *arg0, UNUSED u8 *arg1, UNUSED uintptr_t arg2) { Gfx macro[] = {gsDPSetCombineMode(G_CC_MODULATERGBDECALA, G_CC_MODULATERGBDECALA)}; arg0[sGfxSeekPosition].words.w0 = macro->words.w0; arg0[sGfxSeekPosition].words.w1 = macro->words.w1; sGfxSeekPosition++; } -void unpack_combine_mode5(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { +void unpack_combine_mode5(Gfx *arg0, UNUSED u8 *arg1, UNUSED uintptr_t arg2) { Gfx macro[] = {gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA)}; arg0[sGfxSeekPosition].words.w0 = macro->words.w0; arg0[sGfxSeekPosition].words.w1 = macro->words.w1; sGfxSeekPosition++; } -void unpack_render_mode_opaque(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { +void unpack_render_mode_opaque(Gfx *arg0, UNUSED u8 *arg1, UNUSED uintptr_t arg2) { Gfx macro[] = {gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2)}; arg0[sGfxSeekPosition].words.w0 = macro->words.w0; arg0[sGfxSeekPosition].words.w1 = macro->words.w1; sGfxSeekPosition++; } -void unpack_render_mode_tex_edge(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { +void unpack_render_mode_tex_edge(Gfx *arg0, UNUSED u8 *arg1, UNUSED uintptr_t arg2) { Gfx macro[] = {gsDPSetRenderMode(G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2)}; arg0[sGfxSeekPosition].words.w0 = macro->words.w0; arg0[sGfxSeekPosition].words.w1 = macro->words.w1; sGfxSeekPosition++; } -void unpack_render_mode_translucent(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { +void unpack_render_mode_translucent(Gfx *arg0, UNUSED u8 *arg1, UNUSED uintptr_t arg2) { Gfx macro[] = {gsDPSetRenderMode(G_RM_AA_ZB_XLU_SURF, G_RM_AA_ZB_XLU_SURF2)}; arg0[sGfxSeekPosition].words.w0 = macro->words.w0; arg0[sGfxSeekPosition].words.w1 = macro->words.w1; sGfxSeekPosition++; } -void unpack_render_mode_opaque_decal(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { +void unpack_render_mode_opaque_decal(Gfx *arg0, UNUSED u8 *arg1, UNUSED uintptr_t arg2) { Gfx macro[] = {gsDPSetRenderMode(G_RM_AA_ZB_OPA_DECAL, G_RM_AA_ZB_OPA_DECAL)}; arg0[sGfxSeekPosition].words.w0 = macro->words.w0; arg0[sGfxSeekPosition].words.w1 = macro->words.w1; sGfxSeekPosition++; } -void unpack_render_mode_translucent_decal(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 arg2) { +void unpack_render_mode_translucent_decal(Gfx *arg0, UNUSED u8 *arg1, UNUSED uintptr_t arg2) { Gfx macro[] = {gsDPSetRenderMode(G_RM_AA_ZB_XLU_DECAL, G_RM_AA_ZB_XLU_DECAL)}; arg0[sGfxSeekPosition].words.w0 = macro->words.w0; arg0[sGfxSeekPosition].words.w1 = macro->words.w1; @@ -604,9 +605,9 @@ void unpack_render_mode_translucent_decal(Gfx *arg0, UNUSED u8 *arg1, UNUSED u32 void unpack_tile_sync(Gfx *gfx, u8 *args, s8 opcode) { Gfx tileSync[] = { gsDPTileSync() }; - u32 temp_a0; - u32 lo; - u32 hi; + uintptr_t temp_a0; + uintptr_t lo; + uintptr_t hi; s32 width; s32 height; @@ -700,20 +701,20 @@ void unpack_tile_sync(Gfx *gfx, u8 *args, s8 opcode) { } void unpack_tile_load_sync(Gfx *gfx, u8 *args, s8 opcode) { - UNUSED u32 var; + UNUSED uintptr_t var; Gfx tileSync[] = { gsDPTileSync() }; Gfx loadSync[] = { gsDPLoadSync() }; - u32 arg; - u32 lo; - u32 hi; - u32 addr; - u32 width; - u32 height; - u32 fmt; - u32 siz; - u32 tmem; - u32 tile; + uintptr_t arg; + uintptr_t lo; + uintptr_t hi; + uintptr_t addr; + uintptr_t width; + uintptr_t height; + uintptr_t fmt; + uintptr_t siz; + uintptr_t tmem; + uintptr_t tile; switch (opcode) { case 32: @@ -806,11 +807,11 @@ void unpack_texture_off(Gfx *arg0, UNUSED u8 *args, UNUSED s8 arg2) { } void unpack_vtx1(Gfx *gfx, u8 *args, UNUSED s8 arg2) { - u32 temp_t7; - u32 temp_t7_2; + uintptr_t temp_t7; + uintptr_t temp_t7_2; - u32 temp = args[sPackedSeekPosition++]; - u32 temp2 = ((args[sPackedSeekPosition++] << 8) | temp) * 0x10; + uintptr_t temp = args[sPackedSeekPosition++]; + uintptr_t temp2 = ((args[sPackedSeekPosition++] << 8) | temp) * 0x10; temp = args[sPackedSeekPosition++]; temp_t7 = temp & 0x3F; @@ -823,9 +824,9 @@ void unpack_vtx1(Gfx *gfx, u8 *args, UNUSED s8 arg2) { } void unpack_vtx2(Gfx *gfx, u8 *args, s8 arg2) { - u32 temp_t9; - u32 temp_v1; - u32 temp_v2; + uintptr_t temp_t9; + uintptr_t temp_v1; + uintptr_t temp_v2; temp_v1 = args[sPackedSeekPosition++]; temp_v2 = ((args[sPackedSeekPosition++] << 8) | temp_v1) * 0x10; @@ -838,10 +839,10 @@ void unpack_vtx2(Gfx *gfx, u8 *args, s8 arg2) { } void unpack_triangle(Gfx *gfx, u8 *args, UNUSED s8 arg2) { - u32 temp_v0; - u32 phi_a0; - u32 phi_a2; - u32 phi_a3; + uintptr_t temp_v0; + uintptr_t phi_a0; + uintptr_t phi_a2; + uintptr_t phi_a3; temp_v0 = args[sPackedSeekPosition++]; @@ -864,13 +865,13 @@ void unpack_triangle(Gfx *gfx, u8 *args, UNUSED s8 arg2) { } void unpack_quadrangle(Gfx *gfx, u8 *args, UNUSED s8 arg2) { - u32 temp_v0; - u32 phi_t0; - u32 phi_a3; - u32 phi_a0; - u32 phi_t2; - u32 phi_t1; - u32 phi_a2; + uintptr_t temp_v0; + uintptr_t phi_t0; + uintptr_t phi_a3; + uintptr_t phi_a0; + uintptr_t phi_t2; + uintptr_t phi_t1; + uintptr_t phi_a2; temp_v0 = args[sPackedSeekPosition++]; @@ -910,11 +911,11 @@ void unpack_quadrangle(Gfx *gfx, u8 *args, UNUSED s8 arg2) { } void unpack_spline_3D(Gfx *gfx, u8 *arg1, UNUSED s8 arg2) { - u32 temp_v0; - u32 phi_a0; - u32 phi_t0; - u32 phi_a3; - u32 phi_a2; + uintptr_t temp_v0; + uintptr_t phi_a0; + uintptr_t phi_t0; + uintptr_t phi_a3; + uintptr_t phi_a2; temp_v0 = arg1[sPackedSeekPosition++]; @@ -959,11 +960,11 @@ UNUSED void func_802A9AEC(void) { * This issue is prevented so long as the packed file adheres to correct opcodes and unpack code * increments the file pointer the correct number of times. */ -void displaylist_unpack(uintptr_t *data, uintptr_t finalDisplaylistOffset, u32 arg2) { +void displaylist_unpack(uintptr_t *data, uintptr_t finalDisplaylistOffset, uintptr_t arg2) { u8 *packed_dl = data; Gfx *gfx; - u32 addr; + uintptr_t addr; u8 opcode; @@ -1254,19 +1255,19 @@ void displaylist_unpack(uintptr_t *data, uintptr_t finalDisplaylistOffset, u32 a struct UnkStr_802AA7C8 { u8 *unk0; - u32 unk4; - u32 unk8; - u32 unkC; + uintptr_t unk4; + uintptr_t unk8; + uintptr_t unkC; }; -void decompress_textures(u32 *arg0) { +void decompress_textures(uintptr_t arg0) { struct UnkStr_802AA7C8 *phi_s0 = (struct UnkStr_802AA7C8 *) arg0; struct UnkStr_802AA7C8 *temp_s0; - u32 temp_t2; + uintptr_t temp_t2; u8 *temp_a0; - u32 phi_v0; - u32 sp20; + uintptr_t phi_v0; + uintptr_t sp20; phi_v0 = 0; temp_s0 = phi_s0; @@ -1296,18 +1297,21 @@ void decompress_textures(u32 *arg0) { } void *decompress_segments(u8 *start, u8 *end) { - UNUSED u32 pad; - u32 sp28; - u32 size = ALIGN16(end - start); + int bp = 0; + + return; + UNUSED uintptr_t pad; + uintptr_t sp28; + uintptr_t size = ALIGN16(end - start); u8 *heapEnd; - u32 *freeSpace; + uintptr_t freeSpace; heapEnd = (u8 *) gHeapEndPtr - size; // sp20 = temp_a0; dma_copy(heapEnd, start, size); - sp28 = *(u32 *) (heapEnd + 4); + sp28 = (uintptr_t) (heapEnd + 4); sp28 = ALIGN16(sp28); - freeSpace = (u32 *) gNextFreeMemoryAddress; + freeSpace = (uintptr_t ) gNextFreeMemoryAddress; mio0decode(heapEnd, (u8 *)freeSpace); gNextFreeMemoryAddress += sp28; return (void *)freeSpace; @@ -1326,12 +1330,12 @@ u8 *load_course(s32 courseId) { // u8 *vertexRomStart; // mio0 compressed // u8 *vertexRomEnd; // UNUSED s32 pad2[2]; - // u32 *textures; + // uintptr_t textures; // CourseVtx *vertexStart; // mio0 compressed // u8 *packedStart; - // u32 vertexCount; + // uintptr_t vertexCount; // u8 *finalDisplaylistOffset; - // u32 unknown1; + // uintptr_t unknown1; // s32 prevLoadedAddress_saved; // u8 *offsetRomStart; // u8 *offsetRomEnd; diff --git a/src/racing/memory.h b/src/racing/memory.h index a1bde7e91..b8256a5f2 100644 --- a/src/racing/memory.h +++ b/src/racing/memory.h @@ -8,7 +8,7 @@ struct MainPoolBlock { }; struct MainPoolState { - u32 freeSpace; + uintptr_t freeSpace; struct MainPoolBlock *listHeadL; struct MainPoolBlock *listHeadR; struct MainPoolState *prev; @@ -41,31 +41,31 @@ struct AllocOnlyPool { extern f32 vtxStretchY; -void *get_next_available_memory_addr(u32); +void *get_next_available_memory_addr(uintptr_t); uintptr_t set_segment_base_addr(s32, void*); void *get_segment_base_addr(s32); void *segmented_to_virtual(const void *); void move_segment_table_to_dmem(void); void initialize_memory_pool(uintptr_t, uintptr_t); void *decompress_segments(u8*, u8*); -void *allocate_memory(u32); +void *allocate_memory(uintptr_t); void *load_data(uintptr_t, uintptr_t); void func_802A7D54(s32, s32); -void main_pool_init(u32, u32); -void *main_pool_alloc(u32, u32); -u32 main_pool_free(void*); -void *main_pool_realloc(void*, u32); -s32 main_pool_available(void); -u32 main_pool_push_state(void); -u32 main_pool_pop_state(void); +void main_pool_init(uintptr_t, uintptr_t); +void *main_pool_alloc(uintptr_t, uintptr_t); +uintptr_t main_pool_free(void*); +void *main_pool_realloc(void*, uintptr_t); +uintptr_t main_pool_available(void); +uintptr_t main_pool_push_state(void); +uintptr_t main_pool_pop_state(void); void *func_802A80B0(u8*, u8*, u8*); void func_802A81EC(void); -struct AllocOnlyPool *alloc_only_pool_init(u32, u32); -u32 func_802A82AC(s32); -s32 func_802A8348(s32, s32, s32); -u8 *dma_textures(u8*, u32, u32); -u32 MIO0_0F(u8*, u32, u32); +struct AllocOnlyPool *alloc_only_pool_init(uintptr_t, uintptr_t); +uintptr_t func_802A82AC(s32); +uintptr_t func_802A8348(s32, s32, s32); +u8 *dma_textures(u8*, size_t, size_t); +uintptr_t MIO0_0F(u8*, uintptr_t, uintptr_t); void func_802A8844(void); void unpack_lights(Gfx*, u8*, s8); void unpack_displaylist(Gfx*, u8*, s8); @@ -73,16 +73,16 @@ void unpack_end_displaylist(Gfx*, u8*, s8); void unpack_set_geometry_mode(Gfx*, u8*, s8); void unpack_clear_geometry_mode(Gfx*, u8*, s8); void unpack_cull_displaylist(Gfx*, u8*, s8); -void unpack_combine_mode1(Gfx*, u8*, u32); -void unpack_combine_mode2(Gfx*, u8*, u32); -void unpack_combine_mode_shade(Gfx*, u8*, u32); -void unpack_combine_mode4(Gfx*, u8*, u32); -void unpack_combine_mode5(Gfx*, u8*, u32); -void unpack_render_mode_opaque(Gfx*, u8*, u32); -void unpack_render_mode_tex_edge(Gfx*, u8*, u32); -void unpack_render_mode_translucent(Gfx*, u8*, u32); -void unpack_render_mode_opaque_decal(Gfx*, u8*, u32); -void unpack_render_mode_translucent_decal(Gfx*, u8*, u32); +void unpack_combine_mode1(Gfx*, u8*, uintptr_t); +void unpack_combine_mode2(Gfx*, u8*, uintptr_t); +void unpack_combine_mode_shade(Gfx*, u8*, uintptr_t); +void unpack_combine_mode4(Gfx*, u8*, uintptr_t); +void unpack_combine_mode5(Gfx*, u8*, uintptr_t); +void unpack_render_mode_opaque(Gfx*, u8*, uintptr_t); +void unpack_render_mode_tex_edge(Gfx*, u8*, uintptr_t); +void unpack_render_mode_translucent(Gfx*, u8*, uintptr_t); +void unpack_render_mode_opaque_decal(Gfx*, u8*, uintptr_t); +void unpack_render_mode_translucent_decal(Gfx*, u8*, uintptr_t); void unpack_tile_sync(Gfx*, u8*, s8); void unpack_tile_load_sync(Gfx*, u8*, s8); void unpack_texture_on(Gfx*, u8*, s8); diff --git a/src/update_objects.h b/src/update_objects.h index 4c592f23f..86e04602f 100644 --- a/src/update_objects.h +++ b/src/update_objects.h @@ -200,7 +200,7 @@ void func_8007A88C(s32); void func_8007A910(s32); void update_object_lakitu(s32); void func_8007AA44(s32); -void func_8007ABFC(s32, s32); +void func_8007ABFC(s32, bool); void consume_item(s32); u8 gen_random_item(s16, s16); u8 gen_random_item_human(s16, s16); |
