Merge pull request #127 from MegaMech/modsnew

[modding] wip changes
This commit is contained in:
MegaMech
2024-11-25 19:15:10 -07:00
committed by GitHub
84 changed files with 1593 additions and 1421 deletions
-194
View File
@@ -589,197 +589,3 @@ add_custom_target(
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/spaghetti.otr" "${CMAKE_BINARY_DIR}/spaghetti.otr"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/ship.otr" "${CMAKE_BINARY_DIR}/ship.otr"
)
if(MSVC)
set (WAMR_BUILD_PLATFORM "windows")
else()
set (WAMR_BUILD_PLATFORM "linux")
endif()
# Set WAMR_BUILD_TARGET, currently values supported:
# "X86_64", "AMD_64", "X86_32", "AARCH64[sub]", "ARM[sub]", "THUMB[sub]",
# "MIPS", "XTENSA", "RISCV64[sub]", "RISCV32[sub]"
if (NOT DEFINED WAMR_BUILD_TARGET)
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm64|aarch64)")
set (WAMR_BUILD_TARGET "AARCH64")
if (NOT DEFINED WAMR_BUILD_SIMD)
set (WAMR_BUILD_SIMD 1)
endif ()
elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64")
set (WAMR_BUILD_TARGET "RISCV64")
elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
# Build as X86_64 by default in 64-bit platform
set (WAMR_BUILD_TARGET "X86_64")
if (NOT DEFINED WAMR_BUILD_SIMD)
set (WAMR_BUILD_SIMD 1)
endif ()
elseif (CMAKE_SIZEOF_VOID_P EQUAL 4)
# Build as X86_32 by default in 32-bit platform
set (WAMR_BUILD_TARGET "X86_32")
else ()
message(SEND_ERROR "Unsupported build target platform!")
endif ()
endif ()
if (NOT DEFINED WAMR_BUILD_INTERP)
# Enable Interpreter by default
set (WAMR_BUILD_INTERP 1)
endif ()
if (NOT DEFINED WAMR_BUILD_AOT)
# Enable AOT by default.
set (WAMR_BUILD_AOT 1)
endif ()
if (NOT DEFINED WAMR_BUILD_JIT)
# Disable JIT by default.
set (WAMR_BUILD_JIT 0)
endif ()
if (NOT DEFINED WAMR_BUILD_FAST_JIT)
# Disable Fast JIT by default
set (WAMR_BUILD_FAST_JIT 0)
endif ()
if (NOT DEFINED WAMR_BUILD_LIBC_BUILTIN)
# Enable libc builtin support by default
set (WAMR_BUILD_LIBC_BUILTIN 1)
endif ()
if (NOT DEFINED WAMR_BUILD_LIBC_WASI)
# Enable libc wasi support by default
set (WAMR_BUILD_LIBC_WASI 1)
endif ()
if (NOT DEFINED WAMR_BUILD_FAST_INTERP)
# Enable fast interpreter
set (WAMR_BUILD_FAST_INTERP 1)
endif ()
if (NOT DEFINED WAMR_BUILD_MULTI_MODULE)
# Disable multiple modules by default
set (WAMR_BUILD_MULTI_MODULE 0)
endif ()
if (NOT DEFINED WAMR_BUILD_LIB_PTHREAD)
# Disable pthread library by default
set (WAMR_BUILD_LIB_PTHREAD 0)
endif ()
if (NOT DEFINED WAMR_BUILD_LIB_WASI_THREADS)
# Disable wasi threads library by default
set (WAMR_BUILD_LIB_WASI_THREADS 0)
endif()
if (NOT DEFINED WAMR_BUILD_MINI_LOADER)
# Disable wasm mini loader by default
set (WAMR_BUILD_MINI_LOADER 0)
endif ()
if (NOT DEFINED WAMR_BUILD_SIMD)
# Enable SIMD by default
set (WAMR_BUILD_SIMD 1)
endif ()
if (NOT DEFINED WAMR_BUILD_REF_TYPES)
# Disable reference types by default
set (WAMR_BUILD_REF_TYPES 0)
endif ()
if (NOT DEFINED WAMR_BUILD_DEBUG_INTERP)
# Disable Debug feature by default
set (WAMR_BUILD_DEBUG_INTERP 0)
endif ()
if (WAMR_BUILD_DEBUG_INTERP EQUAL 1)
set (WAMR_BUILD_FAST_INTERP 0)
set (WAMR_BUILD_MINI_LOADER 0)
set (WAMR_BUILD_SIMD 0)
endif ()
# if enable wasi-nn, both wasi-nn-backends and iwasm
# need to use same WAMR (dynamic) libraries
if (WAMR_BUILD_WASI_NN EQUAL 1)
set (WAMR_BUILD_SHARED 1)
endif ()
if(MSVC)
if (WAMR_BUILD_LIBC_WASI EQUAL 1)
set (CMAKE_C_STANDARD 11)
if (MSVC)
add_compile_options(/experimental:c11atomics)
endif()
else()
set (CMAKE_C_STANDARD 99)
endif()
endif()
set (WAMR_BUILD_DUMP_CALL_STACK 1)
set (WAMR_ROOT_DIR lib/wasm-micro-runtime)
include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake)
add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE})
if(MSVC)
#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWIN32_LEAN_AND_MEAN")
if (NOT MINGW)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
endif ()
# set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat -Wformat-security")
# set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion -Wsign-conversion")
if (WAMR_BUILD_TARGET MATCHES "X86_.*" OR WAMR_BUILD_TARGET STREQUAL "AMD_64")
if (NOT (CMAKE_C_COMPILER MATCHES ".*clang.*" OR CMAKE_C_COMPILER_ID MATCHES ".*Clang" OR MSVC))
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mindirect-branch-register")
endif ()
endif ()
# The following flags are to enhance security, but it may impact performance,
# we disable them by default.
#if (WAMR_BUILD_TARGET MATCHES "X86_.*" OR WAMR_BUILD_TARGET STREQUAL "AMD_64")
# set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftrapv -D_FORTIFY_SOURCE=2")
#endif ()
#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-strong --param ssp-buffer-size=4")
#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-z,noexecstack,-z,relro,-z,now")
include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake)
add_executable (iwasm main.c ${UNCOMMON_SHARED_SOURCE})
install (TARGETS iwasm DESTINATION bin)
target_link_libraries (iwasm vmlib ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS})
if (MINGW)
target_link_libraries (iwasm ws2_32)
endif ()
add_library (libiwasm SHARED ${WAMR_RUNTIME_LIB_SOURCE})
install (TARGETS libiwasm DESTINATION lib)
set_target_properties (libiwasm PROPERTIES OUTPUT_NAME libiwasm)
target_link_libraries (libiwasm ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS})
if (MINGW)
target_link_libraries (libiwasm ws2_32)
endif ()
if (WIN32)
target_link_libraries(libiwasm ntdll)
target_link_libraries(iwasm ntdll)
endif()
else()
target_link_libraries (${PROJECT_NAME} PRIVATE vmlib)
include_directories(
${WAMR_ROOT_DIR}/core
)
endif ()
-1
View File
@@ -10,7 +10,6 @@
binary: spaghetti.otr
headers: include/assets
code: assets/code
metadata: [yamls/courses]
segments:
- 0x000000
- 0x000000
+8
View File
@@ -4,6 +4,10 @@
#include "spline.h"
#include <common_structs.h>
#ifdef __cplusplus
extern "C" {
#endif
#define OBJECT_LIST_SIZE 0x226
#define SOME_OBJECT_INDEX_LIST_SIZE 32
@@ -451,4 +455,8 @@ extern s8 D_8018D230;
//! Some sort of limiter on how many of some object type can spawn
extern s32 D_8018D3C4;
#ifdef __cplusplus
}
#endif
#endif
+19
View File
@@ -0,0 +1,19 @@
set(LUS_BTN_A KbScancode::LUS_KB_SHIFT)
set(LUS_BTN_B KbScancode::LUS_KB_CONTROL)
set(LUS_BTN_L KbScancode::LUS_KB_Q)
set(LUS_BTN_R KbScancode::LUS_KB_SPACE)
set(LUS_BTN_Z KbScancode::LUS_KB_Z)
set(LUS_BTN_START KbScancode::LUS_KB_ENTER)
set(LUS_BTN_STICKUP KbScancode::LUS_KB_ARROWKEY_UP)
set(LUS_BTN_STICKDOWN KbScancode::LUS_KB_ARROWKEY_DOWN)
set(LUS_BTN_STICKLEFT KbScancode::LUS_KB_ARROWKEY_LEFT)
set(LUS_BTN_STICKRIGHT KbScancode::LUS_KB_ARROWKEY_RIGHT)
set(LUS_BTN_CUP KbScancode::LUS_KB_T)
set(LUS_BTN_CDOWN KbScancode::LUS_KB_G)
set(LUS_BTN_CLEFT KbScancode::LUS_KB_F)
set(LUS_BTN_CRIGHT KbScancode::LUS_KB_H)
set(LUS_BTN_DUP KbScancode::LUS_KB_NUMPAD8)
set(LUS_BTN_DDOWN KbScancode::LUS_KB_NUMPAD2)
set(LUS_BTN_DLEFT KbScancode::LUS_KB_NUMPAD4)
set(LUS_BTN_DRIGHT KbScancode::LUS_KB_NUMPAD6)
include("libultraship/cmake/cvars.cmake")
@@ -4,6 +4,7 @@
#include <main.h>
#include <actors_extended.h>
#include <code_800029B0.h>
#include "port/Game.h"
void func_802B3B44(struct ShellActor* shell) {
u16 currentWaypoint;
+1
View File
@@ -3,6 +3,7 @@
#include <code_800029B0.h>
#include <defines.h>
#include "collision.h"
#include "port/Game.h"
/**
* @brief Updates the green shell actor.
+1
View File
@@ -7,6 +7,7 @@
#include <main.h>
#include <libultra/gbi.h>
#include "code_80057C60.h"
#include "engine/Matrix.h"
Vec3s sOriginalPosAnimation;
s16 isNotTheFirst;
+1 -1
View File
@@ -179,7 +179,7 @@ void setup_race(void) {
struct Controller* controller;
int i;
printf("Setup Race!\n");
LUSLOG_DEBUG("Setup Race!", 0);
gPlayerCountSelection1 = gPlayerCount;
if (gGamestate != RACING) {
+17 -14
View File
@@ -38,6 +38,7 @@
#include "data/some_data.h"
#include <assets/some_data.h>
#include "port/Game.h"
#include "engine/Matrix.h"
//! @warning this macro is undef'd at the end of this file
#define MAKE_RGB(r, g, b) (((r) << 0x10) | ((g) << 0x08) | (b << 0x00))
@@ -151,7 +152,7 @@ UNUSED s8 D_801657E0;
s8 D_801657E1;
s8 D_801657E2;
s8 D_801657E3;
s8 D_801657E4;
s8 gHUDModes;
s8 D_801657E5;
bool D_801657E6;
u8 D_801657E7;
@@ -701,6 +702,7 @@ void render_object_for_player(s32 cameraId) {
CourseManager_RenderCourseObjects(cameraId);
CourseManager_TrainSmokeDraw(cameraId);
CourseManager_DrawThwomps(cameraId);
// switch (gCurrentCourseId) {
// case COURSE_MARIO_RACEWAY:
@@ -963,7 +965,7 @@ void func_80058F78(void) {
set_matrix_hud_screen();
if ((!gDemoMode) && (gIsHUDVisible != 0) && (D_801657D8 == 0)) {
draw_item_window(PLAYER_ONE);
if (D_801657E4 != 2) {
if (gHUDModes != 2) {
render_hud_timer(PLAYER_ONE);
draw_simplified_lap_count(PLAYER_ONE);
func_8004EB38(0);
@@ -1059,7 +1061,7 @@ void func_800591B4(void) {
}
}
}
if ((D_801657E4 != 2) && (gModeSelection == GRAND_PRIX) && (D_8018D2BC != 0)) {
if ((gHUDModes != 2) && (gModeSelection == GRAND_PRIX) && (D_8018D2BC != 0)) {
func_80050320();
}
func_800590D4();
@@ -1135,7 +1137,7 @@ void render_hud_lap_3p_4p(s32 playerId) {
draw_lap_count(playerHUD[playerId].lapX - 12, playerHUD[playerId].lapY + 4,
playerHUD[playerId].alsoLapCount);
}
if (D_801657E4 == 2) {
if (gHUDModes == 2) {
if (playerHUD[playerId].unk_74 && D_80165608) {
func_80047910(playerHUD[playerId].unk_6C, playerHUD[playerId].unk_6E, 0, 1.0f,
(u8*) common_tlut_portrait_bomb_kart_and_question_mark, common_texture_portrait_bomb_kart,
@@ -1288,7 +1290,8 @@ void func_80059AC8(void) {
func_80059A88(PLAYER_FOUR);
break;
}
func_8005A71C();
CourseManager_TickThwomps(); // func_8005A71C();
}
}
@@ -1499,14 +1502,14 @@ void func_8005A3C0(void) {
switch (gPlayerCountSelection1) {
case 1:
if (gControllerOne->buttonPressed & R_CBUTTONS) {
if (++D_801657E4 >= 3) {
D_801657E4 = 0;
if (++gHUDModes >= 3) {
gHUDModes = 0;
}
if (D_801657E4 == 2) {
if (gHUDModes == 2) {
D_801657E8 = false;
D_801657E6 = false;
D_801657F0 = true;
} else if (D_801657E4 == 1) {
} else if (gHUDModes == 1) {
D_801657E8 = false;
D_801657E6 = true;
D_801657F0 = false;
@@ -1544,14 +1547,14 @@ void func_8005A3C0(void) {
if (gModeSelection != BATTLE) {
D_801657F0 = (D_801657F0 + 1) & 1;
}
D_801657E4 = (D_801657E4 + 1) & 1;
gHUDModes = (gHUDModes + 1) & 1;
b = true;
}
break;
case 4:
if ((gControllerOne->buttonPressed & R_CBUTTONS) || (gControllerTwo->buttonPressed & R_CBUTTONS) ||
(gControllerThree->buttonPressed & R_CBUTTONS) || (gControllerFour->buttonPressed & R_CBUTTONS)) {
D_801657E4 = (D_801657E4 + 1) & 1;
gHUDModes = (gHUDModes + 1) & 1;
D_801657F8 = (D_801657F8 + 1) & 1;
D_80165800[0] = (D_80165800[0] + 1) & 1;
if (gModeSelection != BATTLE) {
@@ -1568,9 +1571,9 @@ void func_8005A3C0(void) {
}
void func_8005A71C(void) {
if (GetCourse() == GetBowsersCastle()) {
//if (GetCourse() == GetBowsersCastle()) {
func_80081210();
}
//}
}
void update_object(void) {
@@ -2610,7 +2613,7 @@ void func_8005CB60(s32 playerId, s32 lapCount) {
break;
case 3: /* switch 1 */
if ((D_8018D114 == 0) || (D_8018D114 == 1)) {
D_801657E4 = 0;
gHUDModes = 0;
D_801657E6 = 0;
D_801657F0 = 0;
D_801657E8 = 1;
+1 -1
View File
@@ -331,7 +331,7 @@ extern s8 D_801657D8;
extern s8 D_801657E1;
extern s8 D_801657E2;
extern s8 D_801657E3;
extern s8 D_801657E4;
extern s8 gHUDModes;
extern s8 D_801657E5;
extern bool D_801657E6;
extern u8 D_801657E7;
+8 -8
View File
@@ -370,7 +370,7 @@ void func_8006F008(void) {
}
void func_8006F824(s32 arg0) {
D_80165808 = D_801657E4;
D_80165808 = gHUDModes;
D_80165810 = D_801657E6;
D_80165820 = D_801657F0;
D_80165818 = D_801657E8;
@@ -385,14 +385,14 @@ void func_8006F824(s32 arg0) {
void func_8006F8CC(void) {
if (D_8018EDFC == 0) {
D_8018EDFC = 1;
D_801657E4 = 0;
gHUDModes = 0;
D_801657E6 = 0;
D_801657F0 = 0;
D_801657E8 = 1;
D_80165800[0] = D_80165800[1] = 1;
if (gPlayerCount == 4) {
if (gModeSelection != 3) {
D_801657E4 = 1;
gHUDModes = 1;
D_801657F0 = 1;
D_801657F8 = 1;
D_80165800[0] = D_80165800[1] = 0;
@@ -405,7 +405,7 @@ void func_8006F8CC(void) {
D_801657F8 = 1;
} else if (gPlayerCount == 2) {
if (gModeSelection != (s32) 3) {
D_801657E4 = 1;
gHUDModes = 1;
D_801657F0 = 1;
D_80165800[0] = D_80165800[1] = 0;
}
@@ -414,7 +414,7 @@ void func_8006F8CC(void) {
}
func_8006F824(0);
} else {
D_801657E4 = D_80165808;
gHUDModes = D_80165808;
D_801657E6 = D_80165810;
D_801657F0 = D_80165820;
D_801657E8 = D_80165818;
@@ -1067,9 +1067,9 @@ void init_hud_one_player(void) {
playerHUD[PLAYER_ONE].lapCompletionTimeXs[0] = 0x012C;
playerHUD[PLAYER_ONE].lapCompletionTimeXs[1] = 0x012C;
playerHUD[PLAYER_ONE].timerY = 0x0011;
playerHUD[PLAYER_ONE].lapX = -0x0028;
playerHUD[PLAYER_ONE].lapAfterImage1X = -0x0028;
playerHUD[PLAYER_ONE].lapAfterImage2X = -0x0028;
playerHUD[PLAYER_ONE].lapX = -40;
playerHUD[PLAYER_ONE].lapAfterImage1X = -40;
playerHUD[PLAYER_ONE].lapAfterImage2X = -40;
playerHUD[PLAYER_ONE].lapY = 0x0019;
playerHUD[PLAYER_ONE].itemBoxX = 0x00A0;
playerHUD[PLAYER_ONE].itemBoxY = -0x0020;
+68 -29
View File
@@ -3284,6 +3284,42 @@ Gfx* draw_box_fill_wide(Gfx* displayListHead, s32 ulx, s32 uly, s32 lrx, s32 lry
// draw a box with a solid outline
Gfx* draw_box(Gfx* displayListHead, s32 ulx, s32 uly, s32 lrx, s32 lry, u32 red, u32 green, u32 blue, u32 alpha) {
red &= 0xFF;
green &= 0xFF;
blue &= 0xFF;
alpha &= 0xFF;
if (lrx < ulx) {
swap_values(&ulx, &lrx);
}
if (lry < uly) {
swap_values(&uly, &lry);
}
if ((ulx >= 0x140) || (uly >= 0xF0)) {
return displayListHead;
}
if (ulx < 0) {
ulx = 0;
}
if (uly < 0) {
uly = 0;
}
if ((lrx < 0) || (lry < 0)) {
return displayListHead;
}
if (lrx >= 0x141) {
lrx = 0x140;
}
if (lry >= 0xF1) {
lry = 0xF0;
}
gSPDisplayList(displayListHead++, D_02008008);
gDPSetPrimColor(displayListHead++, 0, 0, red, green, blue, alpha);
gDPFillRectangle(displayListHead++, ulx, uly, lrx, lry);
gDPPipeSync(displayListHead++);
return displayListHead;
}
Gfx* draw_box_wide(Gfx* displayListHead, s32 ulx, s32 uly, s32 lrx, s32 lry, u32 red, u32 green, u32 blue, u32 alpha) {
red &= 0xFF;
green &= 0xFF;
blue &= 0xFF;
@@ -3316,7 +3352,6 @@ Gfx* draw_box(Gfx* displayListHead, s32 ulx, s32 uly, s32 lrx, s32 lry, u32 red,
gDPSetPrimColor(displayListHead++, 0, 0, red, green, blue, alpha);
gDPFillWideRectangle(displayListHead++, OTRGetRectDimensionFromLeftEdge(ulx), uly,
OTRGetRectDimensionFromRightEdge(lrx), lry);
//gDPFillRectangle(displayListHead++, ulx, uly, lrx, lry);
gDPPipeSync(displayListHead++);
return displayListHead;
}
@@ -3325,6 +3360,10 @@ Gfx* func_80098FC8(Gfx* displayListHead, s32 ulx, s32 uly, s32 lrx, s32 lry) {
return draw_box_fill(displayListHead, ulx, uly, lrx, lry, 0, 0, 0, 0xFF);
}
Gfx* func_80098FC8_wide(Gfx* displayListHead, s32 ulx, s32 uly, s32 lrx, s32 lry) {
return draw_box_fill_wide(displayListHead, ulx, uly, lrx, lry, 0, 0, 0, 0xFF);
}
void dma_copy_base_729a30(u64* arg0, size_t nbytes, void* vaddr) {
#ifdef TARGET_N64
OSIoMesg sp30;
@@ -4729,7 +4768,7 @@ void func_8009CBE4(s32 arg0, s32 arg1, s32 arg2) {
h = unk->screenHeight;
}
color = &D_800E7AE8[arg2];
gDisplayListHead = draw_box(gDisplayListHead, x - (w / 2), y - (h / 2), (w / 2) + x, (h / 2) + y, color->red,
gDisplayListHead = draw_box_wide(gDisplayListHead, x - (w / 2), y - (h / 2), (w / 2) + x, (h / 2) + y, color->red,
color->green, color->blue, 0xFF - (D_8018E7D0[arg0] * 0xFF / D_8018E7B8[arg0]));
if ((arg1 == 0) && (D_8018E7D0[arg0] += 1, (D_8018E7D0[arg0] >= D_8018E7B8[arg0]))) {
@@ -5146,7 +5185,7 @@ void func_8009D77C(s32 arg0, s32 arg1, s32 arg2) {
someMath0 += var_t3;
someMath1 = temp_t8;
someMath1 += var_t4;
gDisplayListHead = draw_box(gDisplayListHead, var_t3 - temp_v1, var_t4 - temp_t8, someMath0, someMath1,
gDisplayListHead = draw_box_wide(gDisplayListHead, var_t3 - temp_v1, var_t4 - temp_t8, someMath0, someMath1,
temp_v0_2->red, temp_v0_2->green, temp_v0_2->blue, var_t2);
if (arg1 == 0) {
D_8018E7D0[arg0]++;
@@ -5198,7 +5237,7 @@ void func_8009D998(s32 arg0) {
someMath1 = temp_v1;
someMath1 += var_t1;
gDisplayListHead =
draw_box(gDisplayListHead, var_t0 - temp_v0, var_t1 - temp_v1, someMath0, someMath1, 0, 0, 0, 0x000000FF);
draw_box_wide(gDisplayListHead, var_t0 - temp_v0, var_t1 - temp_v1, someMath0, someMath1, 0, 0, 0, 0x000000FF);
}
void func_8009DAA8(void) {
@@ -5213,7 +5252,7 @@ void func_8009DAA8(void) {
if ((s32) var_t0 >= 0x100) {
var_t0 = 0x000000FF;
}
gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x00000140, 0x000000F0, 0, 0, 0, (s32) var_t0);
gDisplayListHead = draw_box_wide(gDisplayListHead, 0, 0, 0x00000140, 0x000000F0, 0, 0, 0, (s32) var_t0);
}
void func_8009DB8C(void) {
@@ -5264,7 +5303,7 @@ void func_8009DB8C(void) {
if (var_v1 >= 0x100) {
var_v1 = 0x000000FF;
}
gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x00000140, 0x000000F0, 0, 0, 0, var_v1);
gDisplayListHead = draw_box_wide(gDisplayListHead, 0, 0, 0x00000140, 0x000000F0, 0, 0, 0, var_v1);
}
void func_8009DEF8(u32 arg0, u32 arg1) {
@@ -6676,13 +6715,13 @@ void func_800A1350(struct_8018D9E0_entry* arg0) {
case 0:
case 2:
case 4:
gDisplayListHead = draw_box(gDisplayListHead, arg0->column, arg0->row, arg0->column + 0x40,
gDisplayListHead = draw_box_wide(gDisplayListHead, arg0->column, arg0->row, arg0->column + 0x40,
arg0->row + 0x4C, 0, 0, 0, 0x00000064);
break;
case 1:
case 3:
thing = arg0->unk1C;
gDisplayListHead = draw_box(gDisplayListHead, arg0->column + thing, arg0->row,
gDisplayListHead = draw_box_wide(gDisplayListHead, arg0->column + thing, arg0->row,
(arg0->column - thing) + 0x40, arg0->row + 0x4C, 0, 0, 0, 0x00000064);
break;
}
@@ -6740,7 +6779,7 @@ void func_800A15EC(struct_8018D9E0_entry* arg0) {
s16 courseId = gCupCourseOrder[(arg0->type - 0x7C) / 4][(arg0->type - 0x7C) % 4];
gDisplayListHead =
func_8009C204(gDisplayListHead, segmented_to_virtual_dupe(D_800E7D74[courseId]), arg0->column, arg0->row, 2);
gDisplayListHead = draw_box(gDisplayListHead, arg0->column, arg0->row + 0x27, arg0->column + 0x40, arg0->row + 0x30,
gDisplayListHead = draw_box_wide(gDisplayListHead, arg0->column, arg0->row + 0x27, arg0->column + 0x40, arg0->row + 0x30,
0, 0, 0, 0xFF);
gDisplayListHead = func_8009C204(gDisplayListHead, segmented_to_virtual_dupe(D_800E7DC4[courseId]), arg0->column,
arg0->row + 0x27, 3);
@@ -6928,7 +6967,7 @@ void func_800A1FB0(struct_8018D9E0_entry* arg0) {
char sp98[3];
struct_8018EE10_entry* var_v1;
gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x00000140, 0x000000F0, 0, 0, 0, 0x00000064);
gDisplayListHead = draw_box_wide(gDisplayListHead, 0, 0, 0x00000140, 0x000000F0, 0, 0, 0, 0x00000064);
switch (D_8018EDEC) { /* switch 1 */
case 0x15: /* switch 1 */
case 0x16: /* switch 1 */
@@ -7174,15 +7213,15 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A1FB0.s")
void func_800A2D1C(struct_8018D9E0_entry* arg0) {
switch (D_80164A28) {
case 1:
gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0, 0x13F, 0x28);
gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0xC7, 0x13F, 0xEF);
gDisplayListHead = func_80098FC8_wide(gDisplayListHead, 0, 0, 0x13F, 0x28);
gDisplayListHead = func_80098FC8_wide(gDisplayListHead, 0, 0xC7, 0x13F, 0xEF);
arg0->unk1C = 0x28;
break;
case 2:
arg0->unk1C -= 2;
if (arg0->unk1C > 0) {
gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0, 0x13F, arg0->unk1C);
gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0xEF - arg0->unk1C, 0x13F, 0xEF);
gDisplayListHead = func_80098FC8_wide(gDisplayListHead, 0, 0, 0x13F, arg0->unk1C);
gDisplayListHead = func_80098FC8_wide(gDisplayListHead, 0, 0xEF - arg0->unk1C, 0x13F, 0xEF);
} else {
arg0->type = 0;
}
@@ -7193,8 +7232,8 @@ void func_800A2D1C(struct_8018D9E0_entry* arg0) {
} else {
arg0->unk1C -= 2;
if (arg0->unk1C > 0) {
gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0, 0x13F, arg0->unk1C);
gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0xEF - arg0->unk1C, 0x13F, 0xEF);
gDisplayListHead = func_80098FC8_wide(gDisplayListHead, 0, 0, 0x13F, arg0->unk1C);
gDisplayListHead = func_80098FC8_wide(gDisplayListHead, 0, 0xEF - arg0->unk1C, 0x13F, 0xEF);
} else {
arg0->type = 0;
}
@@ -7765,7 +7804,7 @@ void render_pause_menu_time_trials(struct_8018D9E0_entry* arg0) {
s32 var_s0;
s32 zero = 0; // ?
gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, 0x0000008C);
gDisplayListHead = draw_box_wide(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, 0x0000008C);
set_text_color(TEXT_YELLOW);
draw_text(0x000000A0, 0x00000050, CourseManager_GetProps()->Name, 0, 1.0f,
1.0f);
@@ -7814,7 +7853,7 @@ void render_pause_menu_versus(struct_8018D9E0_entry* arg0) {
temp_t0 = temp_v0->screenStartY;
temp_t3 = temp_v0->screenWidth / 2;
temp_t4 = temp_v0->screenHeight / 2;
gDisplayListHead = draw_box(gDisplayListHead, temp_v1 - temp_t3, temp_t0 - temp_t4, temp_v1 + temp_t3,
gDisplayListHead = draw_box_wide(gDisplayListHead, temp_v1 - temp_t3, temp_t0 - temp_t4, temp_v1 + temp_t3,
temp_t0 + temp_t4, 0, 0, 0, 0x0000008C);
temp_s3 = &D_800E8540[(gScreenModeSelection * 4) + (gIsGamePaused - 1)];
for (var_s0 = 0; var_s0 < 4; var_s0++) {
@@ -7845,7 +7884,7 @@ void render_pause_grand_prix(struct_8018D9E0_entry* arg0) {
temp_t0 = temp_v0->screenStartY;
temp_t3 = temp_v0->screenWidth / 2;
temp_t4 = temp_v0->screenHeight / 2;
gDisplayListHead = draw_box(gDisplayListHead, temp_v1 - temp_t3, temp_t0 - temp_t4, temp_v1 + temp_t3,
gDisplayListHead = draw_box_wide(gDisplayListHead, temp_v1 - temp_t3, temp_t0 - temp_t4, temp_v1 + temp_t3,
temp_t0 + temp_t4, 0, 0, 0, 140);
temp_s3 = &D_800E85C0[(gScreenModeSelection * 4) + (gIsGamePaused - 1)];
temp_s0 = ((get_string_width(gCupNames[GetCupIndex()]) * one) + 10.0f) / 2;
@@ -7878,7 +7917,7 @@ void render_pause_battle(struct_8018D9E0_entry* arg0) {
temp_t0 = temp_v0->screenStartY;
temp_t3 = temp_v0->screenWidth / 2;
temp_t4 = temp_v0->screenHeight / 2;
gDisplayListHead = draw_box(gDisplayListHead, temp_v1 - temp_t3, temp_t0 - temp_t4, temp_v1 + temp_t3,
gDisplayListHead = draw_box_wide(gDisplayListHead, temp_v1 - temp_t3, temp_t0 - temp_t4, temp_v1 + temp_t3,
temp_t0 + temp_t4, 0, 0, 0, 0x0000008C);
temp_s3 = &D_800E8600[(gScreenModeSelection * 4) + (gIsGamePaused - 1)];
for (var_a1 = 0; var_a1 < 4; var_a1++) {
@@ -7956,7 +7995,7 @@ void func_800A5738(struct_8018D9E0_entry* arg0) {
if ((arg0->unk1C >= 0x1E) && ((gGlobalTimer / 16) % 2)) {
why = get_string_width(gTextPauseButton[5]) * 0.8f;
gDisplayListHead =
draw_box(gDisplayListHead, 0x000000C0, 0x00000021, (s32) (why) + 0xC6, 0x00000032, 0, 0, 0, 0x00000096);
draw_box_wide(gDisplayListHead, 0x000000C0, 0x00000021, (s32) (why) + 0xC6, 0x00000032, 0, 0, 0, 0x00000096);
set_text_color(1);
func_80093324(0x000000BF, 0x00000030, gTextPauseButton[5], 0, 0.8f, 0.8f);
}
@@ -7968,7 +8007,7 @@ void func_800A5738(struct_8018D9E0_entry* arg0) {
var_s1 = 0x0000008C;
var_s2 = 0x000000FF;
}
gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, var_s1);
gDisplayListHead = draw_box_wide(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, var_s1);
gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, var_s2);
set_text_color(3);
func_80093754(0x000000A0, 0x00000050, CourseManager_GetProps()->Name,
@@ -8122,14 +8161,14 @@ void func_800A6154(struct_8018D9E0_entry* arg0) {
s32 var_s1;
if (arg0->cursor == 0) {
gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, arg0->unk1C);
gDisplayListHead = draw_box_wide(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, arg0->unk1C);
set_text_color(3);
gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, (arg0->unk1C * 0xFF) / 100);
for (var_s1 = 0, var_s0 = 0x96; var_s0 < 0xBE; var_s1++, var_s0 += 0x14) {
func_80093358(0x0000008C, var_s0, gTextPauseButton[(var_s1 * 3) + 1], 0, 1.0f, 1.0f);
}
} else {
gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, 0x00000064);
gDisplayListHead = draw_box_wide(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, 0x00000064);
for (var_s1 = 0, var_s0 = 0x96; var_s1 < 2; var_s1++, var_s0 += 0x14) {
text_rainbow_effect(arg0->cursor - 0xB, var_s1, TEXT_YELLOW);
func_80093324(0x0000008C, var_s0, gTextPauseButton[(var_s1 * 3) + 1], 0, 1.0f, 1.0f);
@@ -8154,12 +8193,12 @@ void func_800A638C(struct_8018D9E0_entry* arg0) {
UNUSED s8** var_s2;
if (arg0->cursor == 0) {
gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, arg0->unk1C);
gDisplayListHead = draw_box_wide(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, arg0->unk1C);
set_text_color(5);
gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, (arg0->unk1C * 0xFF) / 100);
func_80093754(0x000000A0, arg0->row + 0x1E, D_800E7778[gModeSelection / 3], 0, 1.0f, 1.0f);
} else {
gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, 0x00000064);
gDisplayListHead = draw_box_wide(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, 0x00000064);
set_text_color(5);
draw_text(0x000000A0, arg0->row + 0x1E, D_800E7778[gModeSelection / 3], 0, 1.0f, 1.0f);
}
@@ -8411,10 +8450,10 @@ void func_800A70E8(struct_8018D9E0_entry* arg0) {
void func_800A7258(struct_8018D9E0_entry* arg0) {
if (arg0->cursor == 0) {
// If shading layer is fading in
gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x13F, 0xEF, 0, 0, 0, arg0->unk1C);
gDisplayListHead = draw_box_wide(gDisplayListHead, 0, 0, 0x13F, 0xEF, 0, 0, 0, arg0->unk1C);
} else {
// All other stages of the podium scene
gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x13F, 0xEF, 0, 0, 0, 0x64);
gDisplayListHead = draw_box_wide(gDisplayListHead, 0, 0, 0x13F, 0xEF, 0, 0, 0, 0x64);
}
}
@@ -9180,7 +9219,7 @@ void func_800A8CA4(struct_8018D9E0_entry* arg0) {
// Wut?
if ((var_s0 != (temp_v0->unk1C % 4)) != 0) {
gDisplayListHead =
draw_box(gDisplayListHead, D_800E7208[var_s0][0].column + temp_s2,
draw_box_wide(gDisplayListHead, D_800E7208[var_s0][0].column + temp_s2,
D_800E7208[var_s0][0].row + temp_s3, D_800E7208[var_s0][1].column + temp_s2,
D_800E7208[var_s0][1].row + temp_s3, 0, 0, 0, 0x00000064);
}
+1
View File
@@ -174,6 +174,7 @@ Gfx* func_80098558(Gfx*, u32, u32, u32, u32, u32, u32, s32, s32);
Gfx* func_800987D0(Gfx*, u32, u32, u32, u32, s32, s32, u8*, u32, s32);
Gfx* draw_box_fill(Gfx*, s32, s32, s32, s32, s32, s32, s32, s32);
Gfx* draw_box(Gfx*, s32, s32, s32, s32, u32, u32, u32, u32);
Gfx* draw_box_wide(Gfx*, s32, s32, s32, s32, u32, u32, u32, u32);
Gfx* func_80098FC8(Gfx*, s32, s32, s32, s32);
void dma_copy_base_729a30(u64*, size_t, void*);
void dma_copy_base_7fa3c0(u64*, size_t, void*);
+8
View File
@@ -7,6 +7,10 @@
#include <assets/other_textures.h>
#include "objects.h"
#ifdef __cplusplus
extern "C" {
#endif
extern Vtx D_800E49C0[];
extern Vtx D_800E4AC0[];
extern Vtx D_800E4BC0[];
@@ -87,4 +91,8 @@ extern StarData gWarioStadiumStars[];
extern u8 D_800E6F30[][3];
extern u8 D_800E6F48[][3];
#ifdef __cplusplus
}
#endif
#endif
+15 -9
View File
@@ -22,6 +22,8 @@
#include "code_80057C60.h"
#include "defines.h"
#include "src/port/Engine.h"
f32 D_802856B0 = 98.0f;
f32 D_802856B4 = 12.0f;
f32 gOrderedSizeSlidingBorders = 52.0f;
@@ -1558,25 +1560,29 @@ void play_cutscene(CinematicCamera* camera) {
* Used at the beginning of award ceremony and throughout credits.
*/
void ceremony_transition_sliding_borders(void) {
f32 temp_f0;
f32 temp_f14;
f32 uly;
f32 lry;
temp_f14 = D_802856B0 - gSizeSlidingBorders;
if (temp_f14 < 0.0f) {
temp_f14 = 0.0f;
lry = D_802856B0 - gSizeSlidingBorders;
if (lry < 0.0f) {
lry = 0.0f;
}
temp_f0 = D_802856B0 + gSizeSlidingBorders;
uly = D_802856B0 + gSizeSlidingBorders;
// clang-format off
// Note that this MUST be on one line. All hail significant whitespace in C!
do {if (temp_f0 > 240.0f) { temp_f0 = 239.0f; } } while (0);
do {if (uly > 240.0f) { uly = 239.0f; } } while (0);
// clang-format on
gDPPipeSync(gDisplayListHead++);
gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
gDPSetCycleType(gDisplayListHead++, G_CYC_FILL);
gDPSetFillColor(gDisplayListHead++, (GPACK_RGBA5551(0, 0, 0, 1) << 16 | GPACK_RGBA5551(0, 0, 0, 1)));
gDPFillRectangle(gDisplayListHead++, 0, 0, 319, (s32) temp_f14);
gDPFillRectangle(gDisplayListHead++, 0, (s32) temp_f0, 319, 239);
gDPFillWideRectangle(gDisplayListHead++, OTRGetRectDimensionFromLeftEdge(0), 0, OTRGetGameRenderWidth(), (s32)lry);
gDPFillWideRectangle(gDisplayListHead++, OTRGetRectDimensionFromLeftEdge(0), (s32)uly, OTRGetGameRenderWidth(), 239);
//gDPFillRectangle(gDisplayListHead++, 0, 0, 319, (s32) lry);
//gDPFillRectangle(gDisplayListHead++, 0, (s32) uly, 319, 239);
gDPSetCycleType(gDisplayListHead++, G_CYC_1CYCLE);
adjust_f32_value_transition(&gSizeSlidingBorders, gOrderedSizeSlidingBorders, D_802856BC / D_802856B4);
}
+1
View File
@@ -28,6 +28,7 @@
#include "engine/Engine.h"
#include "engine/courses/Course.h"
#include "engine/Matrix.h"
#include "port/Game.h"
s32 D_802874A0;
// s32 D_802874A4[5];
+2
View File
@@ -19,6 +19,8 @@ Mtx* GetEffectMatrix(void);
void ClearHudMatrixPool(void);
void ClearEffectsMatrixPool(void);
void ClearObjectsMatrixPool(void);
void AddKartMatrix(Mat4 mtx, s32 flags);
void AddShadowMatrix(Mat4 mtx, s32 flags);
#ifdef __cplusplus
}
+16 -3
View File
@@ -46,8 +46,14 @@ static size_t busses;
static size_t tankerTrucks;
static size_t cars;
static size_t boats;
void World::AddTrain(size_t numCarriages, f32 speed, uint32_t waypoint) {
Vehicles.push_back(std::make_unique<ATrain>(trains, numCarriages, speed, waypoint));
static size_t thwomps;
/**
* Note that you can only remove the tender if there are no carriages
* @arg waypoint initial waypoint to spawn at.
*/
void World::AddTrain(ATrain::TenderStatus tender, size_t numCarriages, f32 speed, uint32_t waypoint) {
Vehicles.push_back(std::make_unique<ATrain>(trains, tender, numCarriages, speed, waypoint));
trains++;
}
@@ -77,7 +83,7 @@ void World::AddCar(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoin
}
void World::ClearVehicles(void) {
trains = trucks = busses = tankerTrucks = cars = boats = 0;
trains = trucks = busses = tankerTrucks = cars = boats = thwomps = 0;
Vehicles.clear();
}
@@ -91,6 +97,13 @@ void World::AddBombKart(Vec3f pos, TrackWaypoint* waypoint, uint16_t waypointInd
BombKarts.push_back(std::make_unique<OBombKart>(pos, waypoint, waypointIndex, state, unk_3C));
}
void World::AddThwomp(s16 x, s16 z, s16 direction, f32 scale, s16 behaviour, s16 primAlpha, u16 boundingBoxSize) {
Thwomps.push_back(
std::make_unique<OThwomp>(thwomps, x, z, direction, scale, behaviour, primAlpha, boundingBoxSize));
thwomps++;
gNumActiveThwomps = thwomps;
}
u32 World::GetCupIndex() {
return this->CupIndex;
}
+9 -3
View File
@@ -7,7 +7,9 @@
#include "vehicles/Train.h"
#include "vehicles/Car.h"
#include "vehicles/OBombKart.h"
#include "vehicles/Train.h"
#include "TrainCrossing.h"
#include "vehicles/OThwomp.h"
#include <memory>
#include "Actor.h"
@@ -23,6 +25,7 @@ class AVehicle;
class ATrain;
class ACar;
class TrainCrossing;
class OThwomp;
class World {
@@ -122,12 +125,12 @@ public:
std::vector<Cup*> Cups;
size_t CupIndex = 1;
std::vector<std::unique_ptr<GameObject>> GameObjects;
std::vector<AActor*> Actors;
std::vector<std::unique_ptr<GameObject>> GameObjects;
/** Actors */
void AddBoat(f32 speed, uint32_t waypoint);
void AddTrain(size_t numCarriages, f32 speed, uint32_t waypoint);
void AddTrain(ATrain::TenderStatus tender, size_t numCarriages, f32 speed, uint32_t waypoint);
void AddTruck(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint);
void AddBus(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint);
void AddTankerTruck(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint);
@@ -136,8 +139,11 @@ public:
void ClearVehicles(void);
/** Objects **/
void AddBombKart(Vec3f pos, TrackWaypoint* waypoint, uint16_t waypointIndex, uint16_t state, f32 unk_3C);
std::vector<std::unique_ptr<OBombKart>> BombKarts;
void AddBombKart(Vec3f pos, TrackWaypoint* waypoint, uint16_t waypointIndex, uint16_t state, f32 unk_3C);
std::vector<std::unique_ptr<OThwomp>> Thwomps;
void AddThwomp(s16 x, s16 z, s16 direction, f32 scale, s16 behaviour, s16 primAlpha, u16 boundingBoxSize = 7);
TrainCrossing* AddCrossing(Vec3f position, u32 waypointMin, u32 waypointMax, f32 approachRadius, f32 exitRadius);
std::vector<std::shared_ptr<TrainCrossing>> Crossings;
+38 -21
View File
@@ -149,29 +149,47 @@ void BowsersCastle::InitCourseObjects() {
size_t objectId;
size_t i;
gNumActiveThwomps = NUM_THWOMPS_100CC_EXTRA;
gThowmpSpawnList = gThwompSpawns100CCExtra;
switch (gCCSelection) { /* switch 1; irregular */
case CC_100: /* switch 1 */
case CC_EXTRA: /* switch 1 */
switch (gCCSelection) {
case CC_100:
case CC_EXTRA:
gWorldInstance.AddThwomp(0x0320, 0xf92a, 0xC000, 1.0f, 1, 0);
gWorldInstance.AddThwomp(0x044c, 0xf92a, 0xC000, 1.0f, 1, 1);
gWorldInstance.AddThwomp(0x02bc, 0xf95c, 0xC000, 1.0f, 2, 0);
gWorldInstance.AddThwomp(0x04b0, 0xf8f8, 0xC000, 1.0f, 2, 1);
gWorldInstance.AddThwomp(0x04b0, 0xf5ba, 0xC000, 1.0f, 3, 0);
gWorldInstance.AddThwomp(0x04b0, 0xf592, 0xC000, 1.0f, 3, 1);
gWorldInstance.AddThwomp(0x091a, 0xf5bf, 0xC000, 1.0f, 4, 0);
gWorldInstance.AddThwomp(0x091a, 0xf597, 0xC000, 1.0f, 4, 1);
gWorldInstance.AddThwomp(0x0596, 0xf92f, 0xC000, 1.5f, 6, 0);
gWorldInstance.AddThwomp(0x082a, 0xf9f2, 0x4000, 1.0f, 5, 0);
gWorldInstance.AddThwomp(0x073a, 0xf9f2, 0x4000, 1.0f, 5, 1);
break;
case CC_50: /* switch 1 */
gNumActiveThwomps = NUM_THWOMPS_50CC;
gThowmpSpawnList = gThomwpSpawns50CC;
case CC_50:
gWorldInstance.AddThwomp(0x3B6, 0xF92A, 0xC000, 1.0f, 1, 0);
gWorldInstance.AddThwomp(0x0352, 0xf95c, 0xC000, 1.0f, 2, 0);
gWorldInstance.AddThwomp(0x04b0, 0xf5ba, 0xC000, 1.0f, 3, 0);
gWorldInstance.AddThwomp(0x04b0, 0xf592, 0xC000, 1.0f, 3, 1);
gWorldInstance.AddThwomp(0x091a, 0xf5b0, 0xC000, 1.0f, 4, 0);
gWorldInstance.AddThwomp(0x0596, 0xf92f, 0xC000, 1.5f, 6, 0);
gWorldInstance.AddThwomp(0x082a, 0xf9f2, 0x4000, 1.0f, 5, 0);
gWorldInstance.AddThwomp(0x073a, 0xf9f2, 0x4000, 1.0f, 5, 1);
break;
case CC_150: /* switch 1 */
gNumActiveThwomps = NUM_THWOMPS_150CC;
gThowmpSpawnList = gThomwpSpawns150CC;
case CC_150:
gWorldInstance.AddThwomp(0x0320, 0xf92a, 0xC000, 1.0f, 1, 0);
gWorldInstance.AddThwomp(0x044c, 0xf92a, 0xC000, 1.0f, 1, 1);
gWorldInstance.AddThwomp(0x02bc, 0xf95c, 0xC000, 1.0f, 2, 0);
gWorldInstance.AddThwomp(0x04b0, 0xf8f8, 0xC000, 1.0f, 2, 1);
gWorldInstance.AddThwomp(0x04b0, 0xf5ba, 0xC000, 1.0f, 3, 0);
gWorldInstance.AddThwomp(0x04b0, 0xf592, 0xC000, 1.0f, 3, 1);
gWorldInstance.AddThwomp(0x091a, 0xf5c9, 0xC000, 1.0f, 4, 0);
gWorldInstance.AddThwomp(0x091a, 0xf5ab, 0xC000, 1.0f, 4, 1);
gWorldInstance.AddThwomp(0x091a, 0xf58d, 0xC000, 1.0f, 4, 2);
gWorldInstance.AddThwomp(0x0596, 0xf92f, 0xC000, 1.5f, 6, 0);
gWorldInstance.AddThwomp(0x082a, 0xf9f2, 0x4000, 1.0f, 5, 0);
gWorldInstance.AddThwomp(0x073a, 0xf9f2, 0x4000, 1.0f, 5, 1);
break;
}
for (i = 0; i < gNumActiveThwomps; i++) {
objectId = indexObjectList1[i];
init_object(objectId, 0);
gObjectList[objectId].origin_pos[0] = gThowmpSpawnList[i].startX * xOrientation;
gObjectList[objectId].origin_pos[2] = gThowmpSpawnList[i].startZ;
gObjectList[objectId].unk_0D5 = gThowmpSpawnList[i].unk_4;
gObjectList[objectId].primAlpha = gThowmpSpawnList[i].unk_6;
}
// Handle the big statue's fire breath
objectId = indexObjectList2[0];
init_object(objectId, 0);
@@ -196,12 +214,11 @@ void BowsersCastle::InitCourseObjects() {
}
void BowsersCastle::UpdateCourseObjects() {
func_80081208();
update_flame_particle();
}
void BowsersCastle::RenderCourseObjects(s32 cameraId) {
render_object_thwomps(cameraId);
//render_object_thwomps(cameraId);
render_object_bowser_flame(cameraId);
}
+9 -2
View File
@@ -117,7 +117,10 @@ void Course::Load() {
// Extract packed DLs
u8* packed = reinterpret_cast<u8*>(LOAD_ASSET_RAW(this->gfx));
Gfx* gfx = (Gfx*) allocate_memory(sizeof(Gfx) * this->gfxSize); // Size of unpacked DLs
assert(gfx != NULL);
if (gfx == NULL) {
printf("Failed to allocate course displaylist memory\n");
}
gSegmentTable[7] = reinterpret_cast<uintptr_t>(&gfx[0]);
displaylist_unpack(reinterpret_cast<uintptr_t *>(gfx), reinterpret_cast<uintptr_t>(packed), 0);
@@ -236,6 +239,10 @@ void Course::Collision() {}
void Course::ScrollingTextures() {}
void Course::DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection) {}
void Course::Destroy() { }
void Course::Destroy() {}
bool Course::IsMod() {
return false;
}
Course* currentCourse = nullptr;
+1
View File
@@ -114,6 +114,7 @@ public:
virtual void ScrollingTextures();
virtual void DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection);
virtual void Destroy();
virtual bool IsMod();
private:
void Init();
};
+18 -5
View File
@@ -201,14 +201,27 @@ void KalimariDesert::MinimapFinishlinePosition() {
void KalimariDesert::SpawnVehicles() {
generate_train_waypoints();
s32 numTrains = 2;
s32 centerWaypoint = 160;
// Spawn two trains
for (size_t i = 0; i < numTrains; ++i) {
uint32_t waypoint = CalculateWaypointDistribution(i, numTrains, gVehicle2DWaypointLength, centerWaypoint);
gWorldInstance.AddTrain(5, 2.5f, waypoint);
for (size_t i = 0; i < _numTrains; ++i) {
uint32_t waypoint = CalculateWaypointDistribution(i, _numTrains, gVehicle2DWaypointLength, centerWaypoint);
if (CVarGetInteger("gMultiplayerNoFeatureCuts", 0) == false) {
// Multiplayer modes have no tender and no carriages
if (gActiveScreenMode != SCREEN_MODE_1P) {
_tender = ATrain::TenderStatus::NO_TENDER;
_numCarriages = 0;
}
// 2 player versus mode has a tender and a carriage
if ((gModeSelection == VERSUS) && (gPlayerCountSelection1 == 2)) {
_tender = ATrain::TenderStatus::HAS_TENDER;
_numCarriages = 1;
}
}
gWorldInstance.AddTrain(_tender, _numCarriages, 2.5f, waypoint);
}
if (gModeSelection == VERSUS) {
+6
View File
@@ -2,6 +2,7 @@
#include <libultraship.h>
#include "Course.h"
#include "engine/vehicles/Train.h"
extern "C" {
#include "assets/kalimari_desert_vertices.h"
@@ -38,4 +39,9 @@ public:
virtual void SpawnVehicles() override;
virtual void Collision() override;
virtual void Destroy() override;
private:
size_t _numTrains = 2;
size_t _numCarriages = 5;
ATrain::TenderStatus _tender = ATrain::TenderStatus::HAS_TENDER;
};
+16 -50
View File
@@ -33,6 +33,7 @@ extern "C" {
#include "memory.h"
#include "courses/staff_ghost_data.h"
#include "framebuffer_effects.h"
#include "skybox_and_splitscreen.h"
extern const char *luigi_raceway_dls[];
extern s16 currentScreenSection;
}
@@ -241,6 +242,16 @@ void LuigiRaceway::Render(struct UnkStruct_800DC5EC* arg0) {
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
// Invalidate Jumbotron textures so they update each frame
// This could be more efficient if we exposed the non-opcode based invalidation to be called
// inside copy_framebuffers_port
gSPInvalidateTexCache(gDisplayListHead++, gSegmentTable[5] + 0xF800);
gSPInvalidateTexCache(gDisplayListHead++, gSegmentTable[5] + 0x10800);
gSPInvalidateTexCache(gDisplayListHead++, gSegmentTable[5] + 0x11800);
gSPInvalidateTexCache(gDisplayListHead++, gSegmentTable[5] + 0x12800);
gSPInvalidateTexCache(gDisplayListHead++, gSegmentTable[5] + 0x13800);
gSPInvalidateTexCache(gDisplayListHead++, gSegmentTable[5] + 0x14800);
if (func_80290C20(arg0->camera) == 1) {
gDPSetCombineMode(gDisplayListHead++, G_CC_SHADE, G_CC_SHADE);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
@@ -278,58 +289,13 @@ void LuigiRaceway::Render(struct UnkStruct_800DC5EC* arg0) {
currentScreenSection = 0;
}
uintptr_t fb = (uintptr_t) gSegmentTable[5] + 0xF800;
FB_WriteFramebufferSliceToCPU(gDisplayListHead, (void*)fb, true);
// FB_DrawFromFramebuffer(gDisplayListHead, 0, fb, true);
// FB_CopyToFramebuffer(gDisplayListHead, 0, fb, false, NULL);
/**
* The jumbo television screen is split into six sections each section is copied one at a time.
* This is done to fit within the n64's texture size requirements; 64x32
* The jumbo television screen used to be split into six sections to fit into the n64's texture size restrictions
* It isn't split into six sections anymore
*/
switch (currentScreenSection) {
case 0:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC, D_800DC5E0, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xF800));
#endif
break;
case 1:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC + 64, D_800DC5E0, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x10800));
#endif
break;
case 2:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC, D_800DC5E0 + 32, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x11800));
#endif
break;
case 3:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC + 64, D_800DC5E0 + 32, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x12800));
#endif
break;
case 4:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC, D_800DC5E0 + 64, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x13800));
#endif
break;
case 5:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC + 64, D_800DC5E0 + 64, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x14800));
#endif
break;
}
copy_jumbotron_fb_port(D_800DC5DC, D_800DC5E0, currentScreenSection,
(u16*) gPortFramebuffers[prevFrame],
(u16*) (gSegmentTable[5] + 0xF800));
}
}
+20 -14
View File
@@ -107,13 +107,19 @@ MarioRaceway::MarioRaceway() {
void MarioRaceway::Load() {
Course::Load();
generate_collision_mesh_with_defaults(segmented_gfx_to_virtual(reinterpret_cast<void*>(0x07001140)));
generate_collision_mesh_with_defaults(segmented_gfx_to_virtual((void*)0x07001140));
// Generate pipe collision mesh
if (gScreenModeSelection == SCREEN_MODE_1P) {
// d_course_mario_raceway_packed_dl_8E8
generate_collision_mesh_with_defaults(segmented_gfx_to_virtual(reinterpret_cast<void*>(0x070008E8)));
generate_collision_mesh_with_defaults(segmented_gfx_to_virtual((void*)0x070008E8));
} else {
// d_course_mario_raceway_packed_dl_2D68
generate_collision_mesh_with_defaults(segmented_gfx_to_virtual(reinterpret_cast<void*>(0x07002D68)));
if (CVarGetInteger("gDisableLod", 0) == true) {
generate_collision_mesh_with_defaults(segmented_gfx_to_virtual((void*)0x070008E8));
} else {
// d_course_mario_raceway_packed_dl_2D68
generate_collision_mesh_with_defaults(segmented_gfx_to_virtual((void*)0x07002D68));
}
}
parse_course_displaylists((TrackSectionsI*)LOAD_ASSET_RAW(d_course_mario_raceway_addr));
@@ -270,12 +276,12 @@ void MarioRaceway::Render(struct UnkStruct_800DC5EC* arg0) {
case 2:
case 17:
if ((temp_t0 == 2) || (temp_t0 == 1)) {
func_802911C4();
render_mario_raceway_pipe();
}
break;
case 3:
if (temp_t0 != 0) {
func_802911C4();
render_mario_raceway_pipe();
}
break;
case 4:
@@ -285,13 +291,13 @@ void MarioRaceway::Render(struct UnkStruct_800DC5EC* arg0) {
if (temp_t0 == 1) {
func_80291198();
}
func_802911C4();
render_mario_raceway_pipe();
}
break;
case 5:
case 6:
if ((temp_t0 == 2) || (temp_t0 == 3)) {
func_802911C4();
render_mario_raceway_pipe();
} else {
func_80291198();
}
@@ -299,13 +305,13 @@ void MarioRaceway::Render(struct UnkStruct_800DC5EC* arg0) {
case 7:
func_80291198();
if ((temp_t0 == 2) || (temp_t0 == 3)) {
func_802911C4();
render_mario_raceway_pipe();
}
break;
case 8:
case 9:
if (temp_t0 != 1) {
func_802911C4();
render_mario_raceway_pipe();
}
/* fallthrough */
case 10:
@@ -315,15 +321,15 @@ void MarioRaceway::Render(struct UnkStruct_800DC5EC* arg0) {
break;
case 11:
if (temp_t0 == 0) {
func_802911C4();
render_mario_raceway_pipe();
func_80291198();
} else if (temp_t0 == 3) {
func_802911C4();
render_mario_raceway_pipe();
}
break;
case 12:
if ((temp_t0 == 0) || (temp_t0 == 3)) {
func_802911C4();
render_mario_raceway_pipe();
}
break;
case 13:
@@ -331,7 +337,7 @@ void MarioRaceway::Render(struct UnkStruct_800DC5EC* arg0) {
if (temp_t0 != 1) {
case 15:
case 16:
func_802911C4();
render_mario_raceway_pipe();
}
break;
}
+11 -7
View File
@@ -12,8 +12,8 @@
#include "assets/bowsers_castle_data.h"
#include "assets/bowsers_castle_displaylists.h"
#include "engine/actors/ATree.h"
#include "engine/actors/ACloud.h"
#include "engine/vehicles/Train.h"
extern "C" {
#include "main.h"
@@ -185,8 +185,8 @@ void TestCourse::SpawnActors() {
ACTOR_RAILROAD_CROSSING));
rrxing->crossingTrigger = crossing1;
Vec3f pos = {-80, 7, -20};
gWorldInstance.AddActor(new ACloud(pos));
//Vec3f pos = {-80, 7, -20};
//gWorldInstance.AddActor(new ACloud(pos));
}
// Likely sets minimap boundaries
@@ -265,13 +265,13 @@ void TestCourse::SpawnVehicles() {
gVehicle2DWaypointLength = 53;
D_80162EB0 = spawn_actor_on_surface(test_course_path2D[0].x, 2000.0f, test_course_path2D[0].z);
gWorldInstance.AddTrain(5, 2.5f, 0);
gWorldInstance.AddTrain(5, 2.5f, 8);
//gWorldInstance.AddTrain(ATrain::TenderStatus::HAS_TENDER, 5, 2.5f, 0);
//gWorldInstance.AddTrain(ATrain::TenderStatus::HAS_TENDER, 5, 2.5f, 8);
Vec3f pos = {0, 0, 0};
gWorldInstance.AddBombKart(pos, &D_80164550[0][25], 25, 2, 0.8333333f);
gWorldInstance.AddBombKart(pos, &D_80164550[0][45], 45, 3, 0.8333333f);
gWorldInstance.AddBombKart(pos, &D_80164550[0][25], 25, 4, 0.8333333f);
gWorldInstance.AddBombKart(pos, &D_80164550[0][45], 45, 4, 0.8333333f);
}
@@ -340,3 +340,7 @@ void TestCourse::RenderCredits() {
void TestCourse::Collision() {}
void TestCourse::Destroy() { }
bool TestCourse::IsMod() {
return true;
}
+1
View File
@@ -39,4 +39,5 @@ public:
virtual void SpawnVehicles() override;
virtual void UpdateVehicles() override;
virtual void Destroy() override;
virtual bool IsMod() override;
};
+23 -37
View File
@@ -218,52 +218,38 @@ void ToadsTurnpike::RenderCredits() {
void ToadsTurnpike::Collision() {}
void ToadsTurnpike::SpawnVehicles() {
uint32_t waypoint;
f32 a = ((gCCSelection * 90.0) / 216.0f) + 4.583333333333333;
f32 b = ((gCCSelection * 90.0) / 216.0f) + 2.9166666666666665;
a /= 2; // Normally vehicle logic is only ran every 2 frames. This slows the vehicles down to match.
b /= 2;
uint32_t waypoint;
// Other game modes spawn seven of each vehicle
if (gModeSelection == TIME_TRIALS) {
for (size_t i = 0; i < NUM_TIME_TRIAL_BOX_TRUCKS; i++) {
waypoint = CalculateWaypointDistribution(i, NUM_TIME_TRIAL_BOX_TRUCKS, gWaypointCountByPathIndex[0], 0);
gWorldInstance.AddTruck(a, b, &D_80164550[0][0], waypoint);
}
_numTrucks = 8;
_numBuses = 8;
_numTankerTrucks = 8;
_numCars = 8;
}
for (size_t i = 0; i < _numTrucks; i++) {
waypoint = CalculateWaypointDistribution(i, _numTrucks, gWaypointCountByPathIndex[0], 0);
gWorldInstance.AddTruck(a, b, &D_80164550[0][0], waypoint);
}
for (size_t i = 0; i < NUM_TIME_TRIAL_SCHOOL_BUSES; i++) {
waypoint = CalculateWaypointDistribution(i, NUM_TIME_TRIAL_SCHOOL_BUSES, gWaypointCountByPathIndex[0], 75);
gWorldInstance.AddBus(a, b, &D_80164550[0][0], waypoint);
}
for (size_t i = 0; i < _numBuses; i++) {
waypoint = CalculateWaypointDistribution(i, _numBuses, gWaypointCountByPathIndex[0], 75);
gWorldInstance.AddBus(a, b,&D_80164550[0][0], waypoint);
}
for (size_t i = 0; i < NUM_TIME_TRIAL_TANKER_TRUCKS; i++) {
waypoint = CalculateWaypointDistribution(i, NUM_TIME_TRIAL_TANKER_TRUCKS, gWaypointCountByPathIndex[0], 50);
gWorldInstance.AddTankerTruck(a, b, &D_80164550[0][0], waypoint);
}
for (size_t i = 0; i < _numTankerTrucks; i++) {
waypoint = CalculateWaypointDistribution(i, _numTankerTrucks, gWaypointCountByPathIndex[0], 50);
gWorldInstance.AddTankerTruck(a, b, &D_80164550[0][0], waypoint);
}
for (size_t i = 0; i < NUM_TIME_TRIAL_CARS; i++) {
waypoint = CalculateWaypointDistribution(i, NUM_TIME_TRIAL_CARS, gWaypointCountByPathIndex[0], 25);
gWorldInstance.AddCar(a, b, &D_80164550[0][0], waypoint);
}
} else { // All other modes
for (size_t i = 0; i < NUM_RACE_BOX_TRUCKS; i++) {
uint32_t waypoint = CalculateWaypointDistribution(i, NUM_RACE_BOX_TRUCKS, gWaypointCountByPathIndex[0], 0);
gWorldInstance.AddTruck(a, b, &D_80164550[0][0], waypoint);
}
for (size_t i = 0; i < NUM_RACE_SCHOOL_BUSES; i++) {
waypoint = CalculateWaypointDistribution(i, NUM_RACE_SCHOOL_BUSES, gWaypointCountByPathIndex[0], 75);
gWorldInstance.AddBus(a, b,&D_80164550[0][0], waypoint);
}
for (size_t i = 0; i < NUM_RACE_TANKER_TRUCKS; i++) {
waypoint = CalculateWaypointDistribution(i, NUM_RACE_TANKER_TRUCKS, gWaypointCountByPathIndex[0], 50);
gWorldInstance.AddTankerTruck(a, b, &D_80164550[0][0], waypoint);
}
for (size_t i = 0; i < NUM_RACE_CARS; i++) {
waypoint = CalculateWaypointDistribution(i, NUM_RACE_CARS, gWaypointCountByPathIndex[0], 25);
gWorldInstance.AddCar(a, b, &D_80164550[0][0], waypoint);
}
for (size_t i = 0; i < _numCars; i++) {
waypoint = CalculateWaypointDistribution(i, _numCars, gWaypointCountByPathIndex[0], 25);
gWorldInstance.AddCar(a, b, &D_80164550[0][0], waypoint);
}
if (gModeSelection == VERSUS) {
+5
View File
@@ -39,4 +39,9 @@ public:
virtual void Collision() override;
virtual void SpawnVehicles() override;
virtual void Destroy() override;
private:
size_t _numTrucks = 7;
size_t _numBuses = 7;
size_t _numTankerTrucks = 7;
size_t _numCars = 7;
};
+9 -44
View File
@@ -32,6 +32,7 @@ extern "C" {
#include "collision.h"
#include "code_8003DC40.h"
#include "memory.h"
#include "skybox_and_splitscreen.h"
extern const char *wario_stadium_dls[];
extern s16 currentScreenSection;
}
@@ -248,50 +249,14 @@ void WarioStadium::Render(struct UnkStruct_800DC5EC* arg0) {
if (currentScreenSection > 5) {
currentScreenSection = 0;
}
switch (currentScreenSection) {
case 0:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC, D_800DC5E0, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x8800));
#endif
break;
case 1:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC + 64, D_800DC5E0, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x9800));
#endif
break;
case 2:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC, D_800DC5E0 + 32, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xA800));
#endif
break;
case 3:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC + 64, D_800DC5E0 + 32, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xB800));
#endif
break;
case 4:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC, D_800DC5E0 + 64, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xC800));
#endif
break;
case 5:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC + 64, D_800DC5E0 + 64, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xD800));
#endif
break;
}
/**
* The jumbo television screen used to be split into six sections to fit into the n64's texture size restrictions
* It isn't split into six sections anymore
*/
copy_jumbotron_fb_port(D_800DC5DC, D_800DC5E0, currentScreenSection,
(u16*) gPortFramebuffers[prevFrame],
(u16*) (gSegmentTable[5] + 0x8800));
}
}
+2 -5
View File
@@ -31,11 +31,8 @@ ABoat::ABoat(size_t idx, f32 speed, u32 waypoint) {
WaypointIndex = Index * 0xB4;
ActorIndex = -1;
if (gPlayerCount >= 3) {
IsActive = 0;
} else {
IsActive = 1;
}
IsActive = 1;
Velocity[0] = 0.0f;
Velocity[1] = 0.0f;
Velocity[2] = 0.0f;
+131 -54
View File
@@ -22,6 +22,7 @@ extern "C" {
#include "defines.h"
#include "code_80005FD0.h"
#include "math_util_2.h"
#include "collision.h"
extern s8 gPlayerCount;
}
@@ -50,6 +51,9 @@ OBombKart::OBombKart(Vec3f pos, TrackWaypoint* waypoint, uint16_t waypointIndex,
Pos[0] = _pos[0];
Pos[1] = _pos[1];
Pos[2] = _pos[2];
_spawnPos[0] = _pos[0];
_spawnPos[1] = _pos[1];
_spawnPos[2] = _pos[2];
CenterY = _pos[1];
WheelPos[0][0] = _pos[0];
WheelPos[0][1] = _pos[1];
@@ -97,10 +101,8 @@ void OBombKart::Tick() {
f32 temp_f2;
f32 temp_f2_4;
f32 sp94;
f32 var_f20;
f32 sp88;
f32 var_f22;
f32 var_f24;
Vec3f newPos;
States state;
u16 bounceTimer;
UNUSED u16 sp4C;
@@ -117,9 +119,9 @@ void OBombKart::Tick() {
}
if (((Unk_4A != 1) || (GetCourse() == GetPodiumCeremony()))) {
var_f22 = Pos[0];
var_f20 = Pos[1];
var_f24 = Pos[2];
newPos[0] = Pos[0];
newPos[1] = Pos[1];
newPos[2] = Pos[2];
waypoint = WaypointIndex;
unk_3C = Unk_3C;
someRot = SomeRot;
@@ -129,9 +131,9 @@ void OBombKart::Tick() {
if (GetCourse() == GetPodiumCeremony()) {
if (D_8016347E == 1) {
player = gPlayerFour;
temp_f0 = var_f22 - player->pos[0];
temp_f2 = var_f20 - player->pos[1];
temp_f12 = var_f24 - player->pos[2];
temp_f0 = newPos[0] - player->pos[0];
temp_f2 = newPos[2] - player->pos[1];
temp_f12 = newPos[2] - player->pos[2];
if ((((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) + (temp_f12 * temp_f12)) < 25.0f) {
circleTimer = 0;
state = States::EXPLODE;
@@ -144,9 +146,9 @@ void OBombKart::Tick() {
for (size_t i = 0; i < gPlayerCount; i++) {
player = &gPlayers[i];
if (!(player->effects & 0x80000000)) {
temp_f0 = var_f22 - player->pos[0];
temp_f2 = var_f20 - player->pos[1];
temp_f12 = var_f24 - player->pos[2];
temp_f0 = newPos[0] - player->pos[0];
temp_f2 = newPos[1] - player->pos[1];
temp_f12 = newPos[2] - player->pos[2];
if ((((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) + (temp_f12 * temp_f12)) < 25.0f) {
state = States::EXPLODE;
circleTimer = 0;
@@ -167,12 +169,12 @@ void OBombKart::Tick() {
sp118 = coss(temp_t6) * 25.0;
temp_f0_3 = sins(temp_t6) * 25.0;
temp_v0_2 = &D_80164550[0][waypoint];
var_f22 = temp_v0_2->posX + sp118;
var_f20 = CenterY + 3.5f;
var_f24 = temp_v0_2->posZ + temp_f0_3;
D_80162FB0[0] = var_f22;
D_80162FB0[1] = var_f20;
D_80162FB0[2] = var_f24;
newPos[0] = temp_v0_2->posX + sp118;
newPos[1] = CenterY + 3.5f;
newPos[2] = temp_v0_2->posZ + temp_f0_3;
D_80162FB0[0] = newPos[0];
D_80162FB0[1] = newPos[1];
D_80162FB0[2] = newPos[2];
temp_t7 = (((circleTimer + 1) % 360) * 0xFFFF) / 360;
sp118 = coss(temp_t7) * 25.0;
temp_f0_3 = sins(temp_t7) * 25.0;
@@ -187,12 +189,12 @@ void OBombKart::Tick() {
sp118 = coss(temp_t6) * 25.0;
temp_f0_3 = sins(temp_t6) * 25.0;
temp_v0_2 = &D_80164550[0][waypoint];
var_f22 = temp_v0_2->posX + sp118;
var_f20 = CenterY + 3.5f;
var_f24 = temp_v0_2->posZ + temp_f0_3;
D_80162FB0[0] = var_f22;
D_80162FB0[1] = var_f20;
D_80162FB0[2] = var_f24;
newPos[0] = temp_v0_2->posX + sp118;
newPos[1] = CenterY + 3.5f;
newPos[2] = temp_v0_2->posZ + temp_f0_3;
D_80162FB0[0] = newPos[0];
D_80162FB0[1] = newPos[1];
D_80162FB0[2] = newPos[2];
temp_t7 = (((circleTimer + 1) % 360) * 0xFFFF) / 360;
sp118 = coss(temp_t7) * 25.0;
temp_f0_3 = sins(temp_t7) * 25.0;
@@ -202,7 +204,7 @@ void OBombKart::Tick() {
someRot = (get_angle_between_two_vectors(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520;
break;
case States::STATIONARY:
var_f20 = CenterY + 3.5f;
newPos[1] = CenterY + 3.5f;
someRot = 0;
break;
@@ -210,7 +212,7 @@ void OBombKart::Tick() {
if ((D_8016347C == 0) || (gNearestWaypointByPlayerId[3] < 5)) {
break;
} else {
waypoint = func_8000D2B4(var_f22, var_f20, var_f24, waypoint, 3);
waypoint = func_8000D2B4(newPos[0], newPos[1], newPos[2], waypoint, 3);
if ((waypoint < 0) || (gWaypointCountByPathIndex[3] < waypoint)) {
waypoint = 0;
}
@@ -225,29 +227,36 @@ void OBombKart::Tick() {
D_80162FC0[2] = temp_v0_4->posZ;
someRot = (get_angle_between_two_vectors(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520;
} else {
D_80162FB0[0] = var_f22;
D_80162FB0[1] = var_f20;
D_80162FB0[2] = var_f24;
D_80162FB0[0] = newPos[0];
D_80162FB0[1] = newPos[1];
D_80162FB0[2] = newPos[2];
D_80162FC0[0] = -2409.197f;
D_80162FC0[1] = 0.0f;
D_80162FC0[2] = -355.254f;
someRot = (get_angle_between_two_vectors(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520;
}
temp_f14 = ((D_80162FB0[0] + D_80162FC0[0]) * 0.5f) - var_f22;
temp_f16 = ((D_80162FB0[2] + D_80162FC0[2]) * 0.5f) - var_f24;
temp_f14 = ((D_80162FB0[0] + D_80162FC0[0]) * 0.5f) - newPos[0];
temp_f16 = ((D_80162FB0[2] + D_80162FC0[2]) * 0.5f) - newPos[2];
temp_f0_4 = sqrtf((temp_f14 * temp_f14) + (temp_f16 * temp_f16));
if (temp_f0_4 > 0.01f) {
var_f22 += (Unk_3C * temp_f14) / temp_f0_4;
var_f24 += (Unk_3C * temp_f16) / temp_f0_4;
newPos[0] += (Unk_3C * temp_f14) / temp_f0_4;
newPos[2] += (Unk_3C * temp_f16) / temp_f0_4;
} else {
var_f22 += temp_f14 / 5.0f;
var_f24 += temp_f16 / 5.0f;
newPos[0] += temp_f14 / 5.0f;
newPos[2] += temp_f16 / 5.0f;
}
var_f20 = calculate_surface_height(var_f22, 2000.0f, var_f24, _Collision.meshIndexZX) + 3.5f;
if (var_f20 < (-1000.0)) {
var_f20 = Pos[1];
newPos[1] = calculate_surface_height(newPos[0], 2000.0f, newPos[2], _Collision.meshIndexZX) + 3.5f;
if (newPos[1] < (-1000.0)) {
newPos[1] = Pos[1];
}
check_bounding_collision(&_Collision, 10.0f, var_f22, var_f20, var_f24);
check_bounding_collision(&_Collision, 10.0f, newPos[0], newPos[1], newPos[2]);
}
break;
case States::CHASE:
if (!_target) {
_target = OBombKart::FindTarget();
} else {
OBombKart::Chase(_target, newPos);
}
break;
case States::EXPLODE:
@@ -259,7 +268,7 @@ void OBombKart::Tick() {
D_80162FC0[0] = temp_v0_4->posX;
D_80162FC0[1] = temp_v0_4->posY;
D_80162FC0[2] = temp_v0_4->posZ;
var_f20 += 3.0f - (circleTimer * 0.3f);
newPos[1] += 3.0f - (circleTimer * 0.3f);
someRot = (get_angle_between_two_vectors(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520;
break;
default:
@@ -271,7 +280,7 @@ void OBombKart::Tick() {
sp118 = coss(0xFFFF - someRot) * circleTimer;
var_f18 = sins(0xFFFF - someRot) * circleTimer;
circleTimer++;
temp_f2_4 = (var_f20 - 2.3f) + (sp108 / 3.0f);
temp_f2_4 = (newPos[1] - 2.3f) + (sp108 / 3.0f);
spAC = temp_f2_4;
spA0 = temp_f2_4;
sp94 = temp_f2_4;
@@ -282,7 +291,7 @@ void OBombKart::Tick() {
} else {
sp118 = coss(0xFFFF - someRot) * 1.5f;
var_f18 = sins(0xFFFF - someRot) * 1.5f;
temp_f16_2 = var_f20 - 2.3f;
temp_f16_2 = newPos[1] - 2.3f;
temp_f12_3 = (bounceTimer % 3) * 0.15f;
temp_f14_2 = temp_f16_2 - temp_f12_3;
temp_f12_4 = temp_f16_2 + temp_f12_3;
@@ -290,25 +299,25 @@ void OBombKart::Tick() {
sp94 = temp_f14_2;
spA0 = temp_f12_4;
sp88 = temp_f12_4;
var_f20 += sins((bounceTimer * 0x13FFEC) / 360);
newPos[1] += sins((bounceTimer * 0x13FFEC) / 360);
bounceTimer = (bounceTimer + 1) % 18;
}
WheelPos[0][0] = (sp118 - var_f18) + var_f22;
WheelPos[0][0] = (sp118 - var_f18) + newPos[0];
WheelPos[0][1] = spAC;
WheelPos[0][2] = (var_f18 + sp118) + var_f24;
WheelPos[1][0] = (var_f18 + sp118) + var_f22;
WheelPos[0][2] = (var_f18 + sp118) + newPos[2];
WheelPos[1][0] = (var_f18 + sp118) + newPos[0];
WheelPos[1][1] = spA0;
WheelPos[1][2] = (var_f18 - sp118) + var_f24;
WheelPos[2][0] = ((-sp118) - var_f18) + var_f22;
WheelPos[1][2] = (var_f18 - sp118) + newPos[2];
WheelPos[2][0] = ((-sp118) - var_f18) + newPos[0];
WheelPos[2][1] = sp94;
WheelPos[2][2] = ((-var_f18) + sp118) + var_f24;
WheelPos[3][0] = ((-sp118) + var_f18) + var_f22;
WheelPos[2][2] = ((-var_f18) + sp118) + newPos[2];
WheelPos[3][0] = ((-sp118) + var_f18) + newPos[0];
WheelPos[3][1] = sp88;
WheelPos[3][2] = ((-var_f18) - sp118) + var_f24;
Pos[0] = var_f22;
Pos[1] = var_f20;
Pos[2] = var_f24;
WheelPos[3][2] = ((-var_f18) - sp118) + newPos[2];
Pos[0] = newPos[0];
Pos[1] = newPos[1];
Pos[2] = newPos[2];
WaypointIndex = waypoint;
Unk_3C = unk_3C;
SomeRot = someRot;
@@ -447,3 +456,71 @@ void OBombKart::Waypoint(s32 screenId) {
void OBombKart::Collision(s32 playerId, Player* player) {
}
Player* OBombKart::FindTarget() {
for (size_t i = 0; i < NUM_PLAYERS; i++) {
if (gPlayers[i].type & PLAYER_HUMAN) {
if (is_within_distance_2d(Pos[0], Pos[2], gPlayers[i].pos[0], gPlayers[i].pos[2], 500)) {
return &gPlayers[i];
}
}
}
return NULL;
}
void OBombKart::Chase(Player* player, Vec3f pos) {
const f32 speed = 2.7f; // Speed the kart uses in a chase
if (!player) return; // Ensure player is valid
// Calculate the directional vector toward the player
Vec3f direction;
direction[0] = player->pos[0] - pos[0];
direction[1] = player->pos[1] - pos[1];
direction[2] = player->pos[2] - pos[2];
// Calculate the distance in the XZ plane
f32 xz_dist = sqrtf((direction[0] * direction[0]) + (direction[2] * direction[2]));
// Reset distance
if (xz_dist > 700.0f) {
_target = NULL;
pos[0] = _spawnPos[0];
pos[1] = _spawnPos[1];
pos[2] = _spawnPos[2];
return;
}
// Break off the chase if player has boo item
if (player->effects & BOO_EFFECT) {
_target = NULL;
pos[0] = _spawnPos[0];
pos[1] = _spawnPos[1];
pos[2] = _spawnPos[2];
return;
}
if (xz_dist > 0.0f) {
// Normalize the direction vector in the XZ plane
direction[0] /= xz_dist;
direction[2] /= xz_dist;
// Scale the movement by a fixed step size
pos[0] += direction[0] * speed;
pos[2] += direction[2] * speed;
}
Vec3f newPosition;
newPosition[0] = pos[0];
newPosition[1] = pos[1];
newPosition[2] = pos[2];
newPosition[1] = calculate_surface_height(pos[0], 2000.0f, pos[2], _Collision.meshIndexZX) + 3.5f;
pos[0] = newPosition[0];
pos[1] = newPosition[1];
pos[2] = newPosition[2];
check_bounding_collision(&_Collision, 10.0f, pos[0], pos[1], pos[2]);
}
+9
View File
@@ -27,6 +27,7 @@ private:
CCW,
CW,
STATIONARY,
CHASE,
EXPLODE,
PODIUM_CEREMONY,
};
@@ -61,4 +62,12 @@ public:
void SomeRender(Vec3f arg1);
void LoadMtx();
void Waypoint(s32 screenId);
private:
Player* FindTarget();
void Chase(Player*, Vec3f pos);
Vec3f _spawnPos;
Player* _target = NULL;
};
+669
View File
@@ -0,0 +1,669 @@
#include <libultraship.h>
#include <libultra/gbi.h>
#include "engine/vehicles/OThwomp.h"
#include <vector>
#include "port/Game.h"
extern "C" {
#include "macros.h"
#include "main.h"
#include "actors.h"
#include "math_util.h"
#include "sounds.h"
#include "update_objects.h"
#include "render_player.h"
#include "external.h"
#include "bomb_kart.h"
#include "collision.h"
#include "code_80086E70.h"
#include "render_objects.h"
#include "code_80057C60.h"
#include "defines.h"
#include "code_80005FD0.h"
#include "math_util_2.h"
#include "collision.h"
#include "assets/bowsers_castle_data.h"
#include "ceremony_and_credits.h"
#include "objects.h"
#include "update_objects.h"
#include "render_objects.h"
extern s8 gPlayerCount;
}
OThwomp::OThwomp(s32 i, s16 x, s16 z, s16 direction, f32 scale, s16 behaviour, s16 primAlpha, u16 boundingBoxSize) {
if (i >= 32) {
printf("MAX THWOMPS REACHED (32), skipping\n");
return;
}
_idx = i;
_faceDirection = direction;
_boundingBoxSize = boundingBoxSize;
State = (States)behaviour;
s32 objectId = indexObjectList1[i];
init_object(objectId, 0);
gObjectList[objectId].origin_pos[0] = x * xOrientation;
gObjectList[objectId].origin_pos[2] = z;
gObjectList[objectId].unk_0D5 = behaviour;
gObjectList[objectId].primAlpha = primAlpha;
gObjectList[objectId].boundingBoxSize = boundingBoxSize + 5;
if (scale == 0.0f) {
scale = 1.0f;
}
gObjectList[objectId].sizeScaling = scale;
}
void OThwomp::Tick() { // func_80081210
Player* player;
s32 objectIndex;
s32 var_s2_3;
s32 var_s4;
objectIndex = indexObjectList1[_idx];
func_800722CC(objectIndex, 0x00000010);
func_8008A4CC(objectIndex);
OThwomp::func_8007F8D8();
objectIndex = indexObjectList1[_idx];
if (gObjectList[objectIndex].state != 0) {
switch (State) {
case STATIONARY:
OThwomp::StationaryBehaviour(objectIndex);
break;
case MOVE_AND_ROTATE:
OThwomp::MoveAndRotateBehaviour(objectIndex);
break;
case MOVE_FAR:
OThwomp::MoveFarBehaviour(objectIndex);
break;
case STATIONARY_FAST:
OThwomp::StationaryFastBehaviour(objectIndex);
break;
case JAILED:
OThwomp::JailedBehaviour(objectIndex);
break;
case SLIDE:
OThwomp::SlidingBehaviour(objectIndex);
break;
}
}
player = gPlayerOne;
for (var_s4 = 0; var_s4 < NUM_PLAYERS; var_s4++, player++) {
player->tyres[FRONT_LEFT].unk_14 &= ~3;
player->unk_046 &= ~0x0006;
objectIndex = indexObjectList1[_idx];
if (!(player->effects & BOO_EFFECT)) {
OThwomp::func_80080B28(objectIndex, var_s4);
}
if (is_obj_flag_status_active(objectIndex, 0x00020000) != 0) {
func_80080A14(objectIndex, player);
}
if (is_obj_flag_status_active(objectIndex, 0x00010000) != 0) {
func_80080A4C(objectIndex, var_s4);
}
}
func_8007542C(3);
objectIndex = indexObjectList1[_idx];
if (func_80072320(objectIndex, 0x00000020) == 0) {
return;
}
func_800722CC(objectIndex, 0x00000020);
func_80080FEC(objectIndex);
for (var_s4 = 0; var_s4 < gObjectParticle2_SIZE; var_s4++) {
objectIndex = gObjectParticle2[var_s4];
if (objectIndex == DELETED_OBJECT_ID) {
return;
}
if (gObjectList[objectIndex].state == 0) {
return;
}
func_800810F4(objectIndex);
if (gObjectList[objectIndex].state != 0) {
return;
}
delete_object_wrapper(&gObjectParticle2[var_s4]);
}
}
void OThwomp::func_8007F8D8() {
Player* player;
s32 objectIndex;
s32 var_s0;
s32 someIndex;
s32 var_s4;
Object* object;
player = gPlayerOne;
var_s4 = 1;
objectIndex = indexObjectList1[_idx];
object = &gObjectList[objectIndex];
if (object->unk_0D5 == 3) {
var_s0 = 0;
if ((object->state >= 2) && (func_80072354(objectIndex, 8) != 0)) {
var_s0 = 1;
}
var_s4 *= var_s0;
}
if (var_s4 != 0) {
for (var_s0 = 0; var_s0 < 4; var_s0++, player++) {
if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_KART_AI)) {
if (OThwomp::func_8007F75C(var_s0) != 0) {
break;
}
}
}
}
}
s32 OThwomp::func_8007F75C(s32 playerId) {
s32 someIndex;
s32 objectIndex;
s32 temp_s7;
s32 var_s6;
s32 waypoint;
waypoint = gNearestWaypointByPlayerId[playerId];
var_s6 = 0;
if ((waypoint >= 0xAA) && (waypoint < 0xB5)) {
temp_s7 = random_int(0x0032U) + 0x32;
objectIndex = indexObjectList1[_idx];
if (gObjectList[objectIndex].unk_0D5 == 3) {
var_s6 = 1;
func_8007F660(objectIndex, playerId, temp_s7);
}
} else if ((waypoint >= 0xD7) && (waypoint < 0xE2)) {
objectIndex = indexObjectList1[_idx];
if (gObjectList[objectIndex].unk_0D5 == 3) {
var_s6 = 1;
func_8007F6C4(objectIndex, playerId);
}
}
return var_s6;
}
void OThwomp::func_80080B28(s32 objectIndex, s32 playerId) {
f32 temp_f0;
Player* temp_s0;
temp_s0 = &gPlayerOne[playerId];
if (is_obj_flag_status_active(objectIndex, 0x00000200) != 0) {
if (!(temp_s0->soundEffects & 0x100)) {
temp_f0 = func_80088F54(objectIndex, temp_s0);
if ((temp_f0 <= 9.0) && !(temp_s0->effects & 0x04000000) &&
(has_collided_horizontally_with_player(objectIndex, temp_s0) != 0)) {
if ((temp_s0->type & 0x8000) && !(temp_s0->type & 0x100)) {
if (!(temp_s0->effects & 0x200)) {
func_80089474(objectIndex, playerId, 1.4f, 1.1f, SOUND_ARG_LOAD(0x19, 0x00, 0xA0, 0x4C));
} else if (func_80072354(objectIndex, 0x00000040) != 0) {
if (temp_s0->type & 0x1000) {
func_800C98B8(temp_s0->pos, temp_s0->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0xA2, 0x4A));
} else {
func_800C9060((u8) playerId, SOUND_ARG_LOAD(0x19, 0x01, 0xA2, 0x4A));
}
func_80080DE4(objectIndex);
func_80075304(gObjectList[objectIndex].pos, 3, 3, D_8018D3C4);
set_object_flag_status_false(objectIndex, 0x00000200);
func_800722A4(objectIndex, 0x00000040);
func_80086F60(objectIndex);
func_800726CC(objectIndex, 0x000000C8);
}
}
} else if ((temp_f0 <= 17.5) && (func_80072320(objectIndex, 1) != 0) &&
(is_within_horizontal_distance_of_player(objectIndex, temp_s0, (temp_s0->unk_094 * 0.5) + _boundingBoxSize) !=
0)) {
if ((temp_s0->type & 0x8000) && !(temp_s0->type & 0x100)) {
if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) {
func_80072180();
}
func_800722A4(objectIndex, 2);
temp_s0->unk_040 = (s16) objectIndex;
temp_s0->unk_046 |= 2;
temp_s0->soundEffects |= 0x100;
func_80088FF0(temp_s0);
}
}
} else {
func_80088FF0(temp_s0);
}
}
}
void OThwomp::Draw(s32 cameraId) {
s32 objectIndex = 0;
s32 i;
UNUSED s32 stackPadding0;
s16 minusone, plusone;
Camera* camera;
Object* object;
camera = &camera1[cameraId];
if (cameraId == PLAYER_ONE) {
objectIndex = indexObjectList1[_idx];
set_object_flag_status_false(objectIndex, 0x00070000);
func_800722CC(objectIndex, 0x00000110);
}
translate_thwomp_lights(objectIndex);
objectIndex = indexObjectList1[_idx];
minusone = gObjectList[objectIndex].unk_0DF - 1;
plusone = gObjectList[objectIndex].unk_0DF + 1;
if (gGamestate != CREDITS_SEQUENCE) {
OThwomp::DrawModel(objectIndex);
}
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D0079C8);
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
gSPNumLights(gDisplayListHead++, 1);
gSPLight(gDisplayListHead++, &D_800E4668.l[0], LIGHT_1);
gSPLight(gDisplayListHead++, &D_800E4668.a, LIGHT_2);
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BOTH);
gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_LIGHTING | G_SHADING_SMOOTH);
load_texture_block_rgba16_mirror((u8*)d_course_bowsers_castle_thwomp_side, 0x00000020, 0x00000020);
for (i = 0; i < gObjectParticle3_SIZE; i++) {
objectIndex = gObjectParticle3[i];
if (objectIndex != NULL_OBJECT_ID) {
object = &gObjectList[objectIndex];
if ((object->state > 0) && (State == MOVE_FAR) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) {
rsp_set_matrix_transformation(object->pos, object->orientation, object->sizeScaling);
gSPVertex(gDisplayListHead++, (uintptr_t)D_0D005C00, 3, 0);
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D006930);
}
}
}
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
gSPTexture(gDisplayListHead++, 0x0001, 0x0001, 0, G_TX_RENDERTILE, G_OFF);
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D007AE0);
load_texture_block_ia8_nomirror(D_8018D490, 0x00000020, 0x00000020);
func_8004B3C8(0);
D_80183E80[0] = 0;
D_80183E80[2] = 0x8000;
for (i = 0; i < gObjectParticle2_SIZE; i++) {
objectIndex = gObjectParticle2[i];
if (objectIndex != NULL_OBJECT_ID) {
object = &gObjectList[objectIndex];
if ((object->state >= 2) && (State == MOVE_AND_ROTATE) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) {
func_8004B138(0x000000FF, 0x000000FF, 0x000000FF, (s32) object->primAlpha);
D_80183E80[1] = func_800418AC(object->pos[0], object->pos[2], camera->pos);
func_800431B0(object->pos, D_80183E80, object->sizeScaling, (Vtx*)D_0D005AE0);
}
}
}
}
void OThwomp::DrawModel(s32 objectIndex) {
if ((gObjectList[objectIndex].state >= 2) && (func_80072354(objectIndex, 0x00000040) != 0)) {
func_8004A7AC(objectIndex, 1.75f);
rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation,
gObjectList[objectIndex].sizeScaling);
thwomp_lights(objectIndex);
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D007828);
gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16);
gDPLoadTLUT_pal256(gDisplayListHead++, d_course_bowsers_castle_thwomp_tlut);
rsp_load_texture_mask((u8*)gObjectList[objectIndex].activeTexture, 0x00000010, 0x00000040, 4);
gSPDisplayList(gDisplayListHead++, gObjectList[objectIndex].model);
}
}
/** Behaviours **/
void OThwomp::StationaryBehaviour(s32 objectIndex) { // func_8007ED6C
UNUSED s32 stackPadding[4];
switch (gObjectList[objectIndex].state) {
case 0:
break;
case 1:
OThwomp::func_8007EC30(objectIndex);
break;
case 2:
set_and_run_timer_object(objectIndex, 0x0000003C);
break;
case 3:
func_80072568(objectIndex, 0x00000032);
break;
case 4:
if (func_8007E59C(objectIndex) != 0) {
func_800725E8(objectIndex, 0x0000012C, 2);
} else {
func_800726CC(objectIndex, 2);
}
break;
}
func_8007E63C(objectIndex);
object_calculate_new_pos_offset(objectIndex);
gObjectList[objectIndex].direction_angle[1] = gObjectList[objectIndex].orientation[1];
func_80073514(objectIndex);
}
// Stationary
void OThwomp::func_8007EC30(s32 objectIndex) {
Object* object;
object = &gObjectList[objectIndex];
object->surfaceHeight = 0.0f;
object->origin_pos[1] = 0.0f;
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
if (gIsMirrorMode != 0) {
set_obj_direction_angle(objectIndex, 0U, -_faceDirection, 0U);
set_obj_orientation(objectIndex, 0U, -_faceDirection, 0U);
} else {
set_obj_direction_angle(objectIndex, 0U, _faceDirection, 0U);
set_obj_orientation(objectIndex, 0U, _faceDirection, 0U);
}
init_texture_object(objectIndex, (uint8_t*) d_course_bowsers_castle_thwomp_tlut, (const char**) d_course_bowsers_castle_thwomp_faces,
0x10U, (u16) 0x00000040);
object->model = (Gfx*)d_course_bowsers_castle_dl_thwomp;
object->unk_01C[1] = 30.0f;
set_object_flag_status_true(objectIndex, 0x05000220);
object->type = 0;
object->unk_0DF = 6;
func_800724DC(objectIndex);
object_next_state(objectIndex);
}
void OThwomp::MoveAndRotateBehaviour(s32 objectIndex) { // func_8007F5A8
switch (gObjectList[objectIndex].state) { /* irregular */
case 0:
break;
case 1:
OThwomp::func_8007EE5C(objectIndex);
break;
case 3:
func_80072568(objectIndex, 0x00000032);
break;
case 4:
func_80086FD4(objectIndex);
object_next_state(objectIndex);
break;
}
func_8007E63C(objectIndex);
func_8007F544(objectIndex);
object_calculate_new_pos_offset(objectIndex);
func_80073514(objectIndex);
}
// MoveAndRotateBehaviour
void OThwomp::func_8007EE5C(s32 objectIndex) {
Object* object;
init_texture_object(objectIndex, (u8*)d_course_bowsers_castle_thwomp_tlut, (const char**) d_course_bowsers_castle_thwomp_faces,
0x10U, (u16) 0x00000040);
object = &gObjectList[objectIndex];
object->model = (Gfx*)d_course_bowsers_castle_dl_thwomp;
set_object_flag_status_true(objectIndex, 0x04000220);
object->type = 0;
object->unk_0DF = 6;
func_80086E70(objectIndex);
object->surfaceHeight = 0.0f;
object->origin_pos[1] = 0.0f;
set_obj_origin_offset(objectIndex, 0.0f, 20.0f, 0.0f);
object->unk_01C[1] = 20.0f;
if (gIsMirrorMode != 0) {
set_obj_direction_angle(objectIndex, 0U, -_faceDirection, 0U);
set_obj_orientation(objectIndex, 0U, -_faceDirection, 0U);
} else {
set_obj_direction_angle(objectIndex, 0U, _faceDirection, 0U);
set_obj_orientation(objectIndex, 0U, _faceDirection, 0U);
}
object->unk_0AE = 1;
if (object->primAlpha == 0) {
object->unk_0DD = 1;
} else {
object->unk_0DD = 2;
}
object_next_state(objectIndex);
}
void OThwomp::MoveFarBehaviour(s32 objectIndex) { // func_8007FFC0
switch (gObjectList[objectIndex].state) {
case 0:
break;
case 1:
OThwomp::func_8007FA08(objectIndex);
break;
case 3:
func_80072568(objectIndex, 0x00000032);
break;
case 4:
object_next_state(objectIndex);
func_80086FD4(objectIndex);
break;
}
func_8007E63C(objectIndex);
func_8007FF5C(objectIndex);
object_calculate_new_pos_offset(objectIndex);
func_80073514(objectIndex);
}
// MoveFarBehaviour
void OThwomp::func_8007FA08(s32 objectIndex) {
Object* object;
init_texture_object(objectIndex, (u8*)d_course_bowsers_castle_thwomp_tlut, (const char**) d_course_bowsers_castle_thwomp_faces,
0x10U, (u16) 0x00000040);
object = &gObjectList[objectIndex];
object->model = (Gfx*)d_course_bowsers_castle_dl_thwomp;
set_object_flag_status_true(objectIndex, 0x04000220);
object->type = 0;
object->surfaceHeight = 0.0f;
object->origin_pos[1] = 0.0f;
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
if (gIsMirrorMode != 0) {
set_obj_orientation(objectIndex, 0U, 0xC000U, 0U);
} else {
set_obj_orientation(objectIndex, 0U, 0x4000U, 0U);
}
object->velocity[0] = 0.0f;
object->direction_angle[1] = object->orientation[1];
object->unk_0DD = 1;
object->unk_0DF = 8;
object->offset[1] = 15.0f;
object->unk_01C[1] = 15.0f;
object_next_state(objectIndex);
}
void OThwomp::StationaryFastBehaviour(s32 objectIndex) { // func_800801FC
Object* object;
object = &gObjectList[objectIndex];
switch (object->state) {
case 0:
break;
case 1:
OThwomp::func_80080078(objectIndex);
break;
case 2:
set_and_run_timer_object(objectIndex, object->timer);
break;
case 3:
func_80072568(objectIndex, 0x00000032);
break;
case 4:
object->timer = 0x0000003C;
func_800726CC(objectIndex, 2);
break;
}
func_8007E63C(objectIndex);
object_calculate_new_pos_offset(objectIndex);
func_80073514(objectIndex);
}
// StationaryFastBehaviour
void OThwomp::func_80080078(s32 objectIndex) { // func_80080078
Object* object;
init_texture_object(objectIndex, (u8*)d_course_bowsers_castle_thwomp_tlut, (const char**) d_course_bowsers_castle_thwomp_faces,
0x10U, (u16) 0x00000040);
object = &gObjectList[objectIndex];
object->model = (Gfx*)d_course_bowsers_castle_dl_thwomp;
set_object_flag_status_true(objectIndex, 0x04000220);
object->type = 2;
object->unk_0DF = 8;
set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
object->surfaceHeight = 0.0f;
object->origin_pos[1] = 0.0f;
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
object->unk_01C[1] = 30.0f;
if (gIsMirrorMode != 0) {
set_obj_orientation(objectIndex, 0U, -_faceDirection, 0U);
} else {
set_obj_orientation(objectIndex, 0U, _faceDirection, 0U);
}
switch (object->primAlpha) { /* irregular */
case 0:
object->timer = 2;
break;
case 1:
object->timer = 0x0000003C;
break;
case 2:
object->timer = 0x00000078;
break;
case 3:
object->timer = 0x000000B4;
break;
}
func_800724DC(objectIndex);
object_next_state(objectIndex);
}
void OThwomp::JailedBehaviour(s32 objectIndex) { // func_80080408
switch (gObjectList[objectIndex].state) {
case 0:
break;
case 1:
OThwomp::func_800802C0(objectIndex);
break;
case 2:
func_8008A6DC(objectIndex, 100.0f);
if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) {
func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity,
SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x45));
object_next_state(objectIndex);
}
break;
case 3:
if (func_800730BC(objectIndex, 3, 5, 1, 6, 6) != 0) {
gObjectList[objectIndex].textureListIndex = 0;
}
break;
case 4:
if (set_and_run_timer_object(objectIndex, 0x0000012C) != 0) {
func_800726CC(objectIndex, 2);
}
break;
}
object_calculate_new_pos_offset(objectIndex);
func_80073514(objectIndex);
}
// JailedBehaviour
void OThwomp::func_800802C0(s32 objectIndex) {
Object* object;
object = &gObjectList[objectIndex];
object->unk_0D8 = 0;
init_texture_object(objectIndex, (u8*)d_course_bowsers_castle_thwomp_tlut, (const char**) d_course_bowsers_castle_thwomp_faces,
0x10U, (u16) 0x00000040);
object->model = (Gfx*)d_course_bowsers_castle_dl_thwomp;
object->textureListIndex = 0;
//object->sizeScaling = 1.5f;
set_object_flag_status_true(objectIndex, 0x05000220);
object->type = 1;
object->unk_0DF = 6;
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
object->surfaceHeight = 0.0f;
object->origin_pos[1] = 0.0f;
object->offset[1] = 10.0f;
object->unk_01C[1] = 10.0f;
if (gIsMirrorMode != 0) {
set_obj_orientation(objectIndex, 0U, 0x4000U, 0U);
} else {
set_obj_orientation(objectIndex, 0U, 0xC000U, 0U);
}
object->offset[0] = 0.0f;
object->offset[2] = 0.0f;
func_800724DC(objectIndex);
object_next_state(objectIndex);
}
void OThwomp::SlidingBehaviour(s32 objectIndex) { // func_800808CC
switch (gObjectList[objectIndex].state) { /* irregular */
case 0:
break;
case 1:
OThwomp::func_80080524(objectIndex);
break;
case 2:
func_800730BC(objectIndex, 3, 5, 1, 6, -1);
break;
}
if (gObjectList[objectIndex].state >= 2) {
func_8007E63C(objectIndex);
func_8008085C(objectIndex);
func_80073514(objectIndex);
if (gGamestate != 9) {
if ((D_8018D40C == 0) && (gObjectList[objectIndex].state == 2)) {
func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity,
SOUND_ARG_LOAD(0x19, 0x03, 0x60, 0x45));
}
} else if ((gCutsceneShotTimer < 0xBF) && (((s16) gCutsceneShotTimer % 88) == 0x0000001E)) {
func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity,
SOUND_ARG_LOAD(0x19, 0x03, 0x60, 0x45));
}
}
}
// SlidingBehaviour
void OThwomp::func_80080524(s32 objectIndex) {
Object* object;
init_texture_object(objectIndex, (u8*)d_course_bowsers_castle_thwomp_tlut, (const char**) d_course_bowsers_castle_thwomp_faces,
0x10U, (u16) 0x00000040);
object = &gObjectList[objectIndex];
object->model = (Gfx*)d_course_bowsers_castle_dl_thwomp;
object->textureListIndex = 0;
set_object_flag_status_true(objectIndex, 0x04000220);
object->type = 0;
object->unk_0DF = 0x0A;
func_80086E70(objectIndex);
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
object->surfaceHeight = 70.0f;
object->origin_pos[1] = 70.0f;
object->unk_01C[1] = 0.0f;
set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
if ((gIsMirrorMode != 0) || (gGamestate == CREDITS_SEQUENCE)) {
set_obj_orientation(objectIndex, 0U, -_faceDirection, 0U);
} else {
set_obj_orientation(objectIndex, 0U, _faceDirection, 0U);
}
switch (object->primAlpha) { /* irregular */
case 0:
object->unk_0DD = 2;
object->velocity[2] = -1.0f;
break;
case 1:
object->unk_0DD = 2;
object->velocity[2] = -1.5f;
break;
}
func_800722A4(objectIndex, 0x00000080);
object_next_state(objectIndex);
}
+77
View File
@@ -0,0 +1,77 @@
#pragma once
#include <libultraship.h>
#include <vector>
extern "C" {
#include "macros.h"
#include "main.h"
#include "vehicles.h"
#include "waypoints.h"
#include "common_structs.h"
#include "objects.h"
}
//! @todo Make shadow size bigger if thwomp is scaled up
//! @todo make adjustable properties for squishSize and boundingBoxSize
/**
* Thwomp GameObject
*
* The game automatically places the actor on the ground so you do not need to provide a Y coordinate value.
*
* @arg direction the rotational direction the thwomp is facing.
* @arg behaviour the behaviour of the thwomp, uses values 1-6.
* @arg primAlpha unknown
* @arg boundingBoxSize optional. The size of the bounding box for the thwomp. Default value is 12
*/
class OThwomp {
private:
enum States : uint16_t {
DISABLED,
STATIONARY,
MOVE_AND_ROTATE,
MOVE_FAR, // Requires enough space to work
STATIONARY_FAST,
SLIDE, // Moves sideways left / right
JAILED // Has no collision
};
public:
States State = States::DISABLED;
explicit OThwomp(s32 i, s16 x, s16 z, s16 direction, f32 scale, s16 behaviour, s16 primAlpha, u16 boundingBoxSize);
void Tick();
void func_80080B28(s32 objectIndex, s32 playerId);
void Draw(s32 playerId);
void DrawModel(s32);
s32 func_8007F75C(s32 playerId);
void func_8007F8D8();
void StationaryBehaviour(s32 objectIndex);
void func_8007EC30(s32 objectIndex);
void MoveAndRotateBehaviour(s32 objectIndex);
void func_8007EE5C(s32 objectIndex);
void MoveFarBehaviour(s32 objectIndex);
void func_8007FA08(s32 objectIndex);
void StationaryFastBehaviour(s32 objectIndex);
void func_80080078(s32 objectIndex);
void JailedBehaviour(s32 objectIndex);
void func_800802C0(s32 objectIndex);
void SlidingBehaviour(s32 objectIndex);
void func_80080524(s32 objectIndex);
private:
s32 _idx;
s16 _faceDirection;
//! @todo Write this better. This effects the squish size and the bounding box size.
// We should probably return to the programmer the pointer to the actor so they can do thwomp->squishSize = value.
u16 _boundingBoxSize;
};
+12 -23
View File
@@ -22,7 +22,7 @@ extern "C" {
// #include "common_structs.h"
}
ATrain::ATrain(size_t idx, size_t numCarriages, f32 speed, uint32_t waypoint) {
ATrain::ATrain(size_t idx, ATrain::TenderStatus tender, size_t numCarriages, f32 speed, uint32_t waypoint) {
u16 waypointOffset;
TrainCarStuff* ptr1;
Path2D* pos;
@@ -59,30 +59,19 @@ ATrain::ATrain(size_t idx, size_t numCarriages, f32 speed, uint32_t waypoint) {
// Only use locomotive unless overwritten below.
NumCars = LOCOMOTIVE_ONLY;
// Spawn all rolling stock in single player mode.
switch (gScreenModeSelection) {
case SCREEN_MODE_1P: // single player
Tender.isActive = 1;
// clang-format off
// Same line required for matching...
for (size_t i = 0; i < numCarriages; i++) { PassengerCars[i].isActive = 1; }
// clang-format on
NumCars = NUM_TENDERS + numCarriages;
break;
// Spawn locomotive, tender, and one passenger car in versus 2/3 player mode.
case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: // multiplayer fall-through
case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL:
if (gModeSelection != GRAND_PRIX) {
Tender.isActive = 1;
PassengerCars[4].isActive = 1;
NumCars = NUM_TENDERS + NUM_2P_PASSENGER_CARS;
}
break;
// Fall back in-case someone tries to spawn a train with carriages but no tender; not allowed.
if (numCarriages > 0) {
tender = HAS_TENDER;
}
Tender.isActive = static_cast<bool>(tender);
for (size_t i = 0; i < numCarriages; i++) {
PassengerCars[i].isActive = 1;
}
NumCars = NUM_TENDERS + numCarriages;
AnotherSmokeTimer = 0;
}
+6 -1
View File
@@ -14,6 +14,11 @@ class AVehicle; // Forward declare
class ATrain : public AVehicle {
public:
enum TenderStatus {
NO_TENDER,
HAS_TENDER,
};
TrainCarStuff Locomotive;
TrainCarStuff Tender;
std::vector<TrainCarStuff> PassengerCars;
@@ -30,7 +35,7 @@ class ATrain : public AVehicle {
int16_t AnotherSmokeTimer = 0;
int16_t SmokeTimer = 0;
explicit ATrain(size_t idx, size_t numCarriages, f32 speed, uint32_t waypoint);
explicit ATrain(size_t idx, ATrain::TenderStatus tender, size_t numCarriages, f32 speed, uint32_t waypoint);
virtual void Spawn() override;
virtual void BeginPlay() override;
+1
View File
@@ -46,6 +46,7 @@
#include "enhancements/freecam/freecam.h"
#include "engine/wasm.h"
#include "port/Game.h"
#include "engine/Matrix.h"
// Declarations (not in this file)
void func_80091B78(void);
+50
View File
@@ -13,6 +13,9 @@
#include "defines.h"
#include "camera.h"
#include "port/Engine.h"
#include "engine/Matrix.h"
#pragma intrinsic(sqrtf)
UNUSED void operator_or(s32* arg0, s32 arg1) {
@@ -697,6 +700,53 @@ UNUSED void func_800421FC(s32 x, s32 y, f32 scale) {
void func_80042330(s32 x, s32 y, u16 angle, f32 scale) {
Mat4 matrix;
//printf("panel %d %d %d\n", x, (s32)OTRGetDimensionFromLeftEdge(x), (s32)OTRGetDimensionFromLeftEdge(0));
if (gHUDModes != 2) {
if (x < (SCREEN_WIDTH / 2)) {
x = (s32)OTRGetDimensionFromLeftEdge(x);
} else {
x = (s32)OTRGetDimensionFromRightEdge(x);
}
}
mtxf_translation_x_y_rotate_z_scale_x_y(matrix, x, y, angle, scale);
// convert_to_fixed_point_matrix(&gGfxPool->mtxHud[gMatrixHudCount], matrix);
// gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]),
// G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
AddHudMatrix(matrix, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
void func_80042330_portrait(s32 x, s32 y, u16 angle, f32 scale, s16 lapCount) {
Mat4 matrix;
//printf("panel %d %d %d\n", x, (s32)OTRGetDimensionFromLeftEdge(x), (s32)OTRGetDimensionFromLeftEdge(0));
if ((gHUDModes != 2) && (D_801657E2 == 0) || (CVarGetInteger("gImprovements", 0) == true)) {
if (x < (SCREEN_WIDTH / 2)) {
x = (s32)OTRGetDimensionFromLeftEdge(x);
} else {
x = (s32)OTRGetDimensionFromRightEdge(x);
}
}
mtxf_translation_x_y_rotate_z_scale_x_y(matrix, x, y, angle, scale);
// convert_to_fixed_point_matrix(&gGfxPool->mtxHud[gMatrixHudCount], matrix);
// gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]),
// G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
AddHudMatrix(matrix, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
void func_80042330_wide(s32 x, s32 y, u16 angle, f32 scale) {
Mat4 matrix;
if (x < (SCREEN_WIDTH / 2)) {
x = (s32)OTRGetDimensionFromLeftEdge(x);
} else {
x = (s32)OTRGetDimensionFromRightEdge(x);
}
mtxf_translation_x_y_rotate_z_scale_x_y(matrix, x, y, angle, scale);
// convert_to_fixed_point_matrix(&gGfxPool->mtxHud[gMatrixHudCount], matrix);
// gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]),
+2
View File
@@ -70,6 +70,8 @@ void func_80041D24(void);
void func_80041D34(void);
void set_matrix_hud_screen(void);
void func_80042330(s32, s32, u16, f32);
void func_80042330_portrait(s32, s32, u16, f32, s16);
void func_80042330_wide(s32, s32, u16, f32);
void mtxf_set_matrix_transformation(Mat4, Vec3f, Vec3su, f32);
void mtxf_set_matrix_scale_transl(Mat4, Vec3f, Vec3f, f32);
void mtxf_set_matrix_gObjectList(s32, Mat4);
+1
View File
@@ -22,6 +22,7 @@
#include "sounds.h"
#include "port/Game.h"
#include "src/enhancements/moon_jump.h"
#include "engine/Matrix.h"
extern s32 D_8018D168;
+35
View File
@@ -31,6 +31,7 @@
#include "engine/courses/PodiumCeremony.h"
#include "engine/TrainCrossing.h"
#include "engine/vehicles/OBombKart.h"
#include "Smoke.h"
@@ -39,6 +40,7 @@ extern "C" {
#include "audio/load.h"
#include "audio/external.h"
#include "networking/networking.h"
#include "render_courses.h"
//#include "engine/wasm.h"
}
@@ -293,6 +295,8 @@ extern "C" {
void CourseManager_ClearVehicles(void) {
gWorldInstance.ClearVehicles();
gWorldInstance.BombKarts.clear();
gWorldInstance.Thwomps.clear();
}
void CourseManager_CrossingTrigger() {
@@ -333,6 +337,14 @@ extern "C" {
}
void CourseManager_RenderCourse(struct UnkStruct_800DC5EC* arg0) {
if (gWorldInstance.CurrentCourse->IsMod() == false) {
if ((CVarGetInteger("gFreecam", 0) == true)) {
// Render credits courses
func_8029569C();
return;
}
}
if (gWorldInstance.CurrentCourse) {
gWorldInstance.CurrentCourse->Render(arg0);
}
@@ -466,6 +478,29 @@ extern "C" {
}
}
extern Vec3su D_80165834;
void CourseManager_TickThwomps() {
// TickLights
if (gWorldInstance.Thwomps.size()) {
D_80165834[0] += 0x100;
D_80165834[1] += 0x200;
}
for (auto& thwomp : gWorldInstance.Thwomps) {
if (thwomp) {
thwomp->Tick();
}
}
}
void CourseManager_DrawThwomps(s32 cameraId) {
for (auto& thwomp : gWorldInstance.Thwomps) {
if (thwomp) {
thwomp->Draw(cameraId);
}
}
}
size_t GetCupCursorPosition() {
return gWorldInstance.CurrentCup->CursorPosition;
}
+41
View File
@@ -82,6 +82,40 @@ void CourseManager_BombKartsWaypoint(s32 cameraId);
void CourseManager_ScrollingTextures();
s32 CourseManager_GetCrossingOnTriggered(uintptr_t* crossing);
void CourseManager_VehiclesSpawn();
void CourseManager_DrawWater(struct UnkStruct_800DC5EC* screen, uint16_t pathCounter, uint16_t cameraRot, uint16_t playerDirection);
void CourseManager_AICrossingBehaviour(s32 playerId);
void CourseManager_ClearVehicles(void);
void CourseManager_DrawVehicles(s32 playerId);
void CourseManager_DrawThwomps(s32 cameraId);
void CourseManager_TickThwomps();
void CourseManager_CrossingTrigger();
void CourseManager_VehiclesCollision(s32 playerId, Player* player);
void CourseManager_VehiclesTick();
void CourseManager_TickBombKarts();
void CourseManager_TickActors();
void CourseManager_TrainSmokeTick(void);
void CourseManager_DrawBattleBombKarts(s32 cameraId);
void CourseManager_DrawBombKarts(s32 cameraId);
void CourseManager_TrainSmokeDraw(s32 cameraId);
size_t GetCupCursorPosition();
void SetCupCursorPosition(size_t position);
@@ -92,12 +126,17 @@ void SetCourseFromCup();
void* GetCourse(void);
void SetCourseById(s32 course);
void SetCourseByClass(void* course);
struct Actor* m_GetActor(size_t index);
void m_DeleteActor(size_t index);
struct Actor* m_AddBaseActor(void);
size_t m_GetActorSize();
size_t m_FindActorIndex(struct Actor* actor);
void m_ActorCollision(Player* player, struct Actor* actor);
void m_ClearActors(void);
void* GetMarioRaceway(void);
@@ -151,6 +190,8 @@ void* GetSpecialCup(void);
void* GetBattleCup(void);
void* GetCup();
#ifdef __cplusplus
}
#endif
+10 -4
View File
@@ -15,7 +15,11 @@
#include <Fast3D/gfx_pc.h>
#include "port/Engine.h"
extern "C" {}
extern "C" {
extern s32 gGamestateNext;
extern s32 gMenuSelection;
#include "defines.h"
}
namespace GameUI {
std::shared_ptr<GameMenuBar> mGameMenuBar;
@@ -446,7 +450,8 @@ void DrawGameMenu() {
"Ctrl+R"
#endif
)) {
// gNextGameState = GSTATE_BOOT;
gGamestateNext = MAIN_MENU_FROM_QUIT;
gMenuSelection = START_MENU;
}
#if !defined(__SWITCH__) && !defined(__WIIU__)
@@ -471,12 +476,13 @@ void DrawEnhancementsMenu() {
if (UIWidgets::BeginMenu("Gameplay")) {
UIWidgets::WindowButton("Freecam", "gFreecam", GameUI::mFreecamWindow,
{ .tooltip = "Allows you to fly around the course" });
UIWidgets::CVarCheckbox("No multiplayer feature cuts", "gMultiplayerNoFeatureCuts",
{ .tooltip = "Allows full train and jumbotron in multiplayer, etc." });
UIWidgets::CVarCheckbox("General Improvements", "gImprovements", { .tooltip = "General improvements to the game experience." });
UIWidgets::CVarCheckbox(
"No Level of Detail (LOD)", "gDisableLod",
{ .tooltip = "Disable Level of Detail (LOD) to avoid models using lower poly versions at a distance" });
UIWidgets::CVarCheckbox("Select any star from menu", "gCompletedGame",
{ .tooltip = "Unlocks extra mode and sets all gold cups." });
UIWidgets::CVarCheckbox("Disable Culling", "gNoCulling", { .tooltip = "Disable original culling of mk64" });
UIWidgets::CVarSliderFloat(
+1 -1
View File
@@ -850,7 +850,7 @@ void spawn_piranha_plants(struct ActorSpawnData* spawnData) {
}
}
void spawn_palm_trees(const char* spawnData) {
void spawn_palm_trees(struct ActorSpawnData* spawnData) {
struct ActorSpawnData* temp_s0 = spawnData;
struct PalmTree* temp_v1;
Vec3f startingPos;
+1
View File
@@ -15,6 +15,7 @@
#include "update_objects.h"
#include "effects.h"
#include "sounds.h"
#include "port/Game.h"
void copy_collision(Collision* src, Collision* dest) {
dest->unk30 = src->unk30;
-5
View File
@@ -9,7 +9,6 @@
#include "collision.h"
#include "math_util.h"
#include "code_800029B0.h"
#include <assert.h>
#include <defines.h>
#include "port/Game.h"
@@ -1818,10 +1817,6 @@ void set_vtx_buffer(uintptr_t addr, u32 numVertices, u32 bufferIndex) {
u32 i;
Vtx* vtx = (Vtx*) addr;
for (i = 0; i < numVertices; i++) {
// printf("VTX: 0x%llX",vtx);
if (vtx == 0) {
assert(false);
}
vtxBuffer[bufferIndex] = vtx;
vtx++;
bufferIndex++;
+1
View File
@@ -7,6 +7,7 @@
#include "buffers/trig_tables.h"
#include "math.h"
#include "memory.h"
#include "engine/Matrix.h"
#pragma intrinsic(sqrtf, fabs)
-4
View File
@@ -19,7 +19,6 @@
#include "courses/all_course_offsets.h"
#include "defines.h"
#include <assert.h>
#include <course_offsets.h>
#include "engine/courses/Course.h"
@@ -63,7 +62,6 @@ void* get_next_available_memory_addr(uintptr_t size) {
if (gNextFreeMemoryAddress > sPoolEnd) {
printf("[memory.c] get_next_available_memory_addr(): Memory Pool Out of Bounds! Out of memory!\n");
PRINT_MEMPOOL;
assert(true);
}
return (void*) freeSpace;
@@ -199,7 +197,6 @@ void* allocate_memory(size_t size) {
printf("[memory.c] allocate_memory(): gFreeMemorySize below zero!\n");
printf("gFreeMemorySize: 0x%X", gFreeMemorySize);
PRINT_MEMPOOL;
assert(false);
}
freeSpace = (uintptr_t) gNextFreeMemoryAddress;
@@ -208,7 +205,6 @@ void* allocate_memory(size_t size) {
if (gNextFreeMemoryAddress > sPoolEnd) {
printf("[memory.c] allocate_memory(): Memory Pool Out of Bounds! Out of memory!\n");
PRINT_MEMPOOL;
assert(false);
}
return (void*) freeSpace;
+15 -18
View File
@@ -20,7 +20,6 @@
#include "courses/all_course_data.h"
#include "courses/all_course_packed.h"
#include "courses/all_course_offsets.h"
#include <assert.h>
#include "port/Game.h"
#include "enhancements/collision_viewer.h"
@@ -187,11 +186,15 @@ void func_80291198(void) {
gSPDisplayList(gDisplayListHead++, ((uintptr_t) segmented_gfx_to_virtual(0x07001140))); //
}
void func_802911C4(void) {
void render_mario_raceway_pipe(void) {
if (gScreenModeSelection == SCREEN_MODE_1P) {
// d_course_mario_raceway_packed_dl_8E8
gSPDisplayList(gDisplayListHead++, ((uintptr_t) segmented_gfx_to_virtual(0x070008E8)));
} else {
if (CVarGetInteger("gDisableLod", 0) == true) {
gSPDisplayList(gDisplayListHead++, ((uintptr_t) segmented_gfx_to_virtual(0x070008E8)));
return;
}
// d_course_mario_raceway_packed_dl_2D68
gSPDisplayList(gDisplayListHead++, ((uintptr_t) segmented_gfx_to_virtual(0x07002D68)));
}
@@ -548,12 +551,12 @@ void render_mario_raceway(struct UnkStruct_800DC5EC* arg0) {
case 2:
case 17:
if ((playerDirection == 2) || (playerDirection == 1)) {
func_802911C4();
render_mario_raceway_pipe();
}
break;
case 3:
if (playerDirection != 0) {
func_802911C4();
render_mario_raceway_pipe();
}
break;
case 4:
@@ -563,13 +566,13 @@ void render_mario_raceway(struct UnkStruct_800DC5EC* arg0) {
if (playerDirection == 1) {
func_80291198();
}
func_802911C4();
render_mario_raceway_pipe();
}
break;
case 5:
case 6:
if ((playerDirection == 2) || (playerDirection == 3)) {
func_802911C4();
render_mario_raceway_pipe();
} else {
func_80291198();
}
@@ -577,13 +580,13 @@ void render_mario_raceway(struct UnkStruct_800DC5EC* arg0) {
case 7:
func_80291198();
if ((playerDirection == 2) || (playerDirection == 3)) {
func_802911C4();
render_mario_raceway_pipe();
}
break;
case 8:
case 9:
if (playerDirection != 1) {
func_802911C4();
render_mario_raceway_pipe();
}
/* fallthrough */
case 10:
@@ -593,15 +596,15 @@ void render_mario_raceway(struct UnkStruct_800DC5EC* arg0) {
break;
case 11:
if (playerDirection == 0) {
func_802911C4();
render_mario_raceway_pipe();
func_80291198();
} else if (playerDirection == 3) {
func_802911C4();
render_mario_raceway_pipe();
}
break;
case 12:
if ((playerDirection == 0) || (playerDirection == 3)) {
func_802911C4();
render_mario_raceway_pipe();
}
break;
case 13:
@@ -609,7 +612,7 @@ void render_mario_raceway(struct UnkStruct_800DC5EC* arg0) {
if (playerDirection != 1) {
case 15:
case 16:
func_802911C4();
render_mario_raceway_pipe();
}
break;
}
@@ -1396,12 +1399,6 @@ void render_course(struct UnkStruct_800DC5EC* arg0) {
return;
}
if ((CVarGetInteger("gFreecam", 0) == true)) {
// Render credits courses
func_8029569C();
return;
}
if (creditsRenderMode) {
func_8029569C();
return;
+2 -1
View File
@@ -16,7 +16,7 @@ s32 func_80290C20(Camera*);
void parse_course_displaylists(TrackSectionsI* asset);
void render_course_segments(const char*[], struct UnkStruct_800DC5EC*);
void func_80291198(void);
void func_802911C4(void);
void render_mario_raceway_pipe(void);
void render_choco_mountain(struct UnkStruct_800DC5EC*);
void render_bowsers_castle(struct UnkStruct_800DC5EC*);
void render_banshee_boardwalk(struct UnkStruct_800DC5EC*);
@@ -36,6 +36,7 @@ void render_double_deck(struct UnkStruct_800DC5EC*);
void render_dks_jungle_parkway(struct UnkStruct_800DC5EC*);
void render_big_donut(struct UnkStruct_800DC5EC*);
void func_8029569C(void);
void course_init(void);
void render_course(struct UnkStruct_800DC5EC*);
void func_80295BF8(s32);
void func_80295C6C(void);
+1
View File
@@ -416,6 +416,7 @@ void func_802A487C(Vtx* arg0, UNUSED struct UnkStruct_800DC5EC* arg1, UNUSED s32
}
void func_802A4A0C(Vtx* vtx, struct UnkStruct_800DC5EC* arg1, UNUSED s32 arg2, UNUSED s32 arg3, UNUSED f32* arg4) {
//! @todo Confirm if this crash still happens and fix if so
s32 id = arg1 - D_8015F480;
arg1->camera = &cameras[id]; // bad fix of bowser castle crash where camera get an invalid value
Camera* camera = arg1->camera;
+140 -33
View File
@@ -41,6 +41,7 @@
#include <assets/bowsers_castle_data.h>
#include <assets/frappe_snowland_data.h>
#include "port/Game.h"
#include "port/Engine.h"
#include "engine/Engine.h"
#include "engine/courses/Course.h"
@@ -1293,7 +1294,7 @@ void func_8004A2F4(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 red, s32 green, s
void func_8004A384(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 red, s32 green, s32 blue, s32 alpha, u8* texture,
Vtx* arg9, s32 argA, s32 argB, s32 argC, s32 argD) {
func_80042330(arg0, arg1, arg2, arg3);
func_80042330_wide(arg0, arg1, arg2, arg3);
gSPDisplayList(gDisplayListHead++, D_0D007A60);
func_8004B414(red, green, blue, alpha);
func_80049970(texture, arg9, argA, argB, argC, argD);
@@ -1577,17 +1578,67 @@ void func_8004B7DC(s32 x, s32 y, s32 width, s32 height, s32 arg4, s32 arg5, s32
if (arg6 == 0) {
//! @todo Update to F3DEX. Uses OLD definition for gspTextureRectangle.
gSPTextureRectangle(gDisplayListHead++, xl, yl, xh, yh, G_TX_RENDERTILE, arg4 << 5, (arg5 << 5), 4 << 10,
1 << 10);
1 << 10);
return;
}
gSPTextureRectangle(gDisplayListHead++, xl, yl, xh2, yh2, G_TX_RENDERTILE, arg4 << 5, (arg5 << 5), 1 << 10,
1 << 10);
1 << 10);
}
void func_8004B7DC_wide(s32 x, s32 y, s32 width, s32 height, s32 arg4, s32 arg5, s32 arg6) {
s32 xh = (((x + width) - 1));
s32 yh = (((y + height) - 1) << 2);
s32 xl = ((x));
s32 yl = y * 4;
s32 xh2 = (((x + width)));
s32 yh2 = ((y + height) << 2);
// if center of image is to the left side of the screen then align left,
// otherwise align right
s32 coordX = 0;
s32 coordX2 = 0;
if (arg6 == 0) {
if ((xl - (width / 2)) < (SCREEN_WIDTH / 2)) {
coordX = (s32)OTRGetDimensionFromLeftEdge(xl) << 2;
coordX2 = (s32)(xh) << 2;
} else {
coordX = (s32)OTRGetDimensionFromRightEdge(xl) << 2;
coordX2 = (s32)OTRGetDimensionFromRightEdge(xh) << 2;
}
//! @todo Update to F3DEX. Uses OLD definition for gspTextureRectangle.
gSPWideTextureRectangle(gDisplayListHead++, coordX, yl, coordX2, yh, G_TX_RENDERTILE, arg4 << 5, (arg5 << 5), 4 << 10,
1 << 10);
//OTRGetDimensionFromLeftEdge
//gSPTextureRectangle(gDisplayListHead++, xl, yl, xh, yh, G_TX_RENDERTILE, arg4 << 5, (arg5 << 5), 4 << 10,
// 1 << 10);
} else {
if ((xl - (width / 2)) < (SCREEN_WIDTH / 2)) {
coordX = (s32)OTRGetDimensionFromLeftEdge(xl) << 2;
coordX2 = (s32)(xh2) << 2;
} else {
coordX = (s32)OTRGetDimensionFromRightEdge(xl) << 2;
coordX2 = (s32)OTRGetDimensionFromRightEdge(xh2) << 2;
}
gSPWideTextureRectangle(gDisplayListHead++, coordX, yl,
coordX2, yh2, G_TX_RENDERTILE, arg4 << 5, (arg5 << 5), 1 << 10,
1 << 10);
}
//gSPTextureRectangle(gDisplayListHead++, xl, yl, xh2, yh2, G_TX_RENDERTILE, arg4 << 5, (arg5 << 5), 1 << 10,
// 1 << 10);
}
void func_8004B950(s32 x, s32 y, s32 width, s32 height, s32 arg4) {
func_8004B7DC(x, y, width, height, 0, 0, arg4);
}
// Positions item window, the Lap 1/2/3, TIME texture, and minimap on the screen.
void func_8004B97C(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
UNUSED s32 pad[2];
s32 sp2C;
@@ -1612,6 +1663,30 @@ void func_8004B97C(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
}
}
void func_8004B97C_wide(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
UNUSED s32 pad[2];
s32 sp2C;
s32 var_a1;
s32 var_v0;
s32 var_v1;
if ((-arg2 < arg0) && (-arg3 < arg1)) {
var_v0 = 0;
var_v1 = 0;
sp2C = arg0;
var_a1 = arg1;
if (arg0 < 0) {
var_v1 = -arg0;
sp2C = 0;
}
if (arg1 < 0) {
var_v0 = -arg1;
var_a1 = 0;
}
func_8004B7DC_wide(sp2C, var_a1, arg2 - var_v1, arg3 - var_v0, var_v1, var_v0, arg4);
}
}
void func_8004BA08(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
UNUSED s32 pad[2];
s32 sp2C;
@@ -1636,6 +1711,7 @@ void func_8004BA08(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
}
}
// Places the timer on the screen
void func_8004BA98(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) {
UNUSED s32 pad[2];
s32 sp34;
@@ -1662,7 +1738,37 @@ void func_8004BA98(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s
sp30 = 0;
phi_a3 = arg3 + arg1;
}
func_8004B7DC(sp34, sp30, sp2C, phi_a3, phi_v0, phi_v1, arg6);
func_8004B7DC_wide(sp34, sp30, sp2C, phi_a3, phi_v0, phi_v1, arg6);
}
}
void func_8004BA98_wide(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) {
UNUSED s32 pad[2];
s32 sp34;
s32 sp30;
s32 sp2C;
s32 phi_a3;
s32 phi_v0;
s32 phi_v1;
if ((-arg2 < arg0) && (-arg3 < arg1)) {
sp34 = arg0;
sp30 = arg1;
phi_v0 = arg4;
sp2C = arg2;
phi_a3 = arg3;
phi_v1 = arg5;
if (arg0 < 0) {
phi_v0 = arg4 - arg0;
sp34 = 0;
sp2C = arg2 + arg0;
}
if (arg1 < 0) {
phi_v1 = arg5 - arg1;
sp30 = 0;
phi_a3 = arg3 + arg1;
}
func_8004B7DC_wide(sp34, sp30, sp2C, phi_a3, phi_v0, phi_v1, arg6);
}
}
@@ -1749,7 +1855,7 @@ void func_8004C268(u32 arg0, u32 arg1, u8* texture, u32 width, u32 arg4, u32 hei
for (i = 0; (u32) i < (arg4 / height); i++) {
load_texture_block_rgba16_mirror(img2, width, height);
func_8004B97C(arg0, arg1, width, height, arg6);
func_8004B97C_wide(arg0, arg1, width, height, arg6);
//! @todo fakematch?
#ifdef AVOID_UB
img2 += (width * height) * 2;
@@ -1771,7 +1877,7 @@ void draw_hud_2d_texture(s32 x, s32 y, u32 width, u32 height, u8* texture) {
gSPDisplayList(gDisplayListHead++, D_0D007EF8);
gDPSetAlphaCompare(gDisplayListHead++, G_AC_THRESHOLD);
load_texture_block_rgba16_mirror(texture, width, height);
func_8004B97C(x - (width >> 1), y - (height >> 1), width, height, 0);
func_8004B97C_wide(x - (width >> 1), y - (height >> 1), width, height, 0);
gSPDisplayList(gDisplayListHead++, D_0D007EB8);
}
@@ -1780,7 +1886,7 @@ void func_8004C450(s32 arg0, s32 arg1, u32 arg2, u32 arg3, u8* texture) {
gSPDisplayList(gDisplayListHead++, D_0D007F38);
func_8004B614(D_801656C0, D_801656D0, D_801656E0, 0x80, 0x80, 0x80, 0xFF);
load_texture_block_rgba16_mirror(texture, arg2, arg3);
func_8004B97C(arg0 - (arg2 >> 1), arg1 - (arg3 >> 1), arg2, arg3, 1);
func_8004B97C_wide(arg0 - (arg2 >> 1), arg1 - (arg3 >> 1), arg2, arg3, 1);
gSPDisplayList(gDisplayListHead++, D_0D007EB8);
}
@@ -1790,7 +1896,7 @@ UNUSED void func_8004C53C(s32 arg0, s32 arg1, u32 arg2, u32 arg3, u8* texture) {
gSPDisplayList(gDisplayListHead++, D_0D007EF8);
gDPSetAlphaCompare(gDisplayListHead++, G_AC_THRESHOLD);
load_texture_tile_rgba16_nomirror(texture, arg2, arg3);
func_8004B97C(arg0 - (arg2 >> 1), arg1 - (arg3 >> 1), arg2, arg3, 0);
func_8004B97C_wide(arg0 - (arg2 >> 1), arg1 - (arg3 >> 1), arg2, arg3, 0);
gSPDisplayList(gDisplayListHead++, D_0D007EB8);
}
@@ -1799,7 +1905,7 @@ void func_8004C628(s32 arg0, s32 arg1, u32 arg2, u32 arg3, u8* texture) {
gSPDisplayList(gDisplayListHead++, D_0D007EF8);
gDPSetAlphaCompare(gDisplayListHead++, G_AC_THRESHOLD);
load_texture_block_rgba32_nomirror(texture, arg2, arg3);
func_8004B97C(arg0 - (arg2 >> 1), arg1 - (arg3 >> 1), arg2, arg3, 1);
func_8004B97C_wide(arg0 - (arg2 >> 1), arg1 - (arg3 >> 1), arg2, arg3, 1);
gSPDisplayList(gDisplayListHead++, D_0D007EB8);
}
@@ -1938,7 +2044,7 @@ UNUSED void func_8004CD48(s32 arg0, s32 arg1, UNUSED u8* texture, s32 width, s32
for (i = 0; i < arg4 / height; i++) {
load_texture_block_ia16_nomirror(img, width, height);
func_8004B97C(arg0 - (width / 2), var_s0, width, height, 1);
func_8004B97C_wide(arg0 - (width / 2), var_s0, width, height, 1);
img += width * height * 2;
var_s0 += height;
}
@@ -1951,7 +2057,7 @@ UNUSED void func_8004CE8C(s32 arg0, s32 arg1, u8* texture, s32 width, s32 arg4,
for (i = 0; i < arg4 / height; i++) {
load_texture_block_ia8_nomirror(img, width, height);
func_8004B97C(arg0 - (width / 2), var_s0, width, height, 1);
func_8004B97C_wide(arg0 - (width / 2), var_s0, width, height, 1);
img += width * height;
var_s0 += height;
}
@@ -1988,7 +2094,7 @@ UNUSED void func_8004D0D4(s32 arg0, s32 arg1, u8* texture, s32 width, s32 arg4,
for (i = 0; i < arg4 / height; i++) {
func_80044924(img, width, height);
func_8004B97C(arg0 - (width / 2), var_s0, width, height, 1);
func_8004B97C_wide(arg0 - (width / 2), var_s0, width, height, 1);
img += width * height;
var_s0 += height;
}
@@ -2007,7 +2113,7 @@ void func_8004D210(s32 arg0, s32 arg1, u8* texture, s32 arg3, s32 arg4, s32 arg5
for (i = 0; i < arg8 / height; i++) {
func_80044924(img, width, height);
func_8004B97C(arg0 - (width / 2), var_s3, width, height, 1);
func_8004B97C_wide(arg0 - (width / 2), var_s3, width, height, 1);
img += (width * height) / 2;
var_s3 += height;
}
@@ -2026,7 +2132,7 @@ void func_8004D37C(s32 arg0, s32 arg1, u8* texture, s32 arg3, s32 arg4, s32 arg5
for (i = 0; i < arg8 / height; i++) {
func_80044F34(img, width, height);
func_8004B97C(arg0 - (width / 2), var_s3, width, height, 1);
func_8004B97C_wide(arg0 - (width / 2), var_s3, width, height, 1);
img += (width * height) / 2;
var_s3 += height;
}
@@ -2095,7 +2201,7 @@ void func_8004D7B4(s32 arg0, s32 arg1, u8* texture, s32 arg3, s32 arg4) {
temp_s5 = (s32) ((sins(temp_s0) * temp_f20) + (f32) (arg0 - (arg3 / 2)));
sins(temp_s0);
load_texture_block_ia16_nomirror(img, arg3, 1);
func_8004B97C(temp_s5, var_s3, arg3, 1, 1);
func_8004B97C_wide(temp_s5, var_s3, arg3, 1, 1);
var_s1 += temp_s7;
var_s3 += 1;
@@ -2129,7 +2235,7 @@ void func_8004D93C(s32 arg0, s32 arg1, u8* texture, s32 arg3, s32 arg4) {
temp_s6 = (s32) ((sins(temp_s0) * temp_f20) + (f32) (arg0 - (var)));
sins(temp_s0);
load_texture_block_ia8_nomirror(img, arg3, 1);
func_8004B97C(temp_s6, var_s4, arg3, 1, 1);
func_8004B97C_wide(temp_s6, var_s4, arg3, 1, 1);
var_s1 += temp_s7;
img = &img[arg3];
var_s4 += 1;
@@ -2161,7 +2267,7 @@ UNUSED void func_8004DAB8(s32 arg0, s32 arg1, u8* texture, s32 arg3, s32 arg4) {
temp_s6 = (s32) ((sins(temp_s0) * temp_f20) + (f32) (arg0 - (var)));
sins(temp_s0);
func_80044924(img, arg3, 1);
func_8004B97C(temp_s6, var_s4, arg3, 1, 1);
func_8004B97C_wide(temp_s6, var_s4, arg3, 1, 1);
var_s1 += temp_s7;
img += arg3;
var_s4 += 1;
@@ -2232,6 +2338,7 @@ UNUSED void func_8004DF24(s32 arg0, s32 arg1, u8* arg2) {
func_8004CF9C(arg0, arg1, arg2, 128, 32, 128, 32);
}
// Positions the item box on screen
void func_8004DF5C(s32 arg0, s32 arg1, u8* texture, s32 width, s32 arg4, s32 height) {
s32 var_s0 = var_s0 = arg1 - (arg4 / 2);
u8* img = texture;
@@ -2269,7 +2376,7 @@ void func_8004E06C(s32 arg0, s32 arg1, u8* texture, s32 arg3, s32 arg4) {
temp_s6 = (u32) ((sins(temp_s0) * temp_f20) + (f32) (arg0 - var));
sins(temp_s0);
rsp_load_texture(img, arg3, 1);
func_8004B97C(temp_s6, var_s4, arg3, 1, 1);
func_8004B97C_wide(temp_s6, var_s4, arg3, 1, 1);
var_s1 += temp_s7;
img += arg3;
var_s4 += 1;
@@ -2736,9 +2843,9 @@ void draw_lap_count(s16 lapX, s16 lapY, s8 lap) {
load_texture_block_rgba16_mirror((u8*) common_texture_hud_123, 32, 8);
// Display current lap. Ex. 1/3
func_8004BA98(lapX, lapY, 8, 8, lap * 8, 0, 0); // display the digit
func_8004BA98(lapX + 8, lapY, 8, 8, 24, 0, 0); // display the /
func_8004BA98(lapX + 16, lapY, 8, 8, 16, 0, 0); // display the 3
func_8004BA98_wide(lapX, lapY, 8, 8, lap * 8, 0, 0); // display the digit
func_8004BA98_wide(lapX + 8, lapY, 8, 8, 24, 0, 0); // display the /
func_8004BA98_wide(lapX + 16, lapY, 8, 8, 16, 0, 0); // display the 3
gSPDisplayList(gDisplayListHead++, D_0D007EB8);
}
@@ -2751,7 +2858,7 @@ void func_8004FDB4(f32 arg0, f32 arg1, s16 arg2, s16 arg3, s16 characterId, s32
rsp_load_texture(common_texture_portrait_question_mark, 0x00000020, 0x00000020);
gSPDisplayList(gDisplayListHead++, D_0D0069E0);
} else {
func_80042330(arg0, arg1, 0U, 1.0f);
func_80042330_portrait(arg0, arg1, 0U, 1.0f, arg3);
gSPDisplayList(gDisplayListHead++, D_0D007DB8);
func_8004B35C(0x000000FF, 0x000000FF, 0x000000FF, arg5);
gDPLoadTLUT_pal256(gDisplayListHead++, gPortraitTLUTs[characterId]);
@@ -2762,7 +2869,7 @@ void func_8004FDB4(f32 arg0, f32 arg1, s16 arg2, s16 arg3, s16 characterId, s32
gSPDisplayList(gDisplayListHead++, D_0D0069E0);
}
if (arg6 != 0) {
func_80042330(arg0, arg1, 0U, 1.0f);
func_80042330_portrait(arg0, arg1, 0U, 1.0f, arg3);
gSPDisplayList(gDisplayListHead++, D_0D007A60);
func_8004B35C(D_8018D3E4, D_8018D3E8, D_8018D3EC, 0x000000FF);
func_80044924(common_texture_character_portrait_border, 0x20, 0x20);
@@ -2774,9 +2881,9 @@ void func_8004FDB4(f32 arg0, f32 arg1, s16 arg2, s16 arg3, s16 characterId, s32
gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_hud_type_C_rank_font);
rsp_load_texture(common_texture_hud_type_C_rank_font[arg2], 0x00000010, 0x00000010);
if (arg7 != 0) {
func_80042330((s32) (arg0 + 9.0f), (s32) (arg1 + 7.0f), 0U, 1.0f);
func_80042330_portrait((s32) (arg0 + 9.0f), (s32) (arg1 + 7.0f), 0U, 1.0f, arg3);
} else {
func_80042330((s32) (arg0 - 9.0f), (s32) (arg1 + 7.0f), 0U, 1.0f);
func_80042330_portrait((s32) (arg0 - 9.0f), (s32) (arg1 + 7.0f), 0U, 1.0f, arg3);
}
gSPDisplayList(gDisplayListHead++, D_0D006980);
}
@@ -3073,9 +3180,9 @@ void func_80050E34(s32 playerId, s32 arg1) {
gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_hud_type_C_rank_tiny_font);
rsp_load_texture(common_texture_hud_type_C_rank_tiny_font[arg1 + 1], 8, 8);
if (spB8 != 0) {
func_80042330(spD0 + 0x26, (spC4 + spCC) + 4, 0U, 1.0f);
func_80042330_portrait(spD0 + 0x26, (spC4 + spCC) + 4, 0U, 1.0f, lapCount);
} else {
func_80042330(spD0 + 0x1B, (spC4 + spCC) + 4, 0U, 1.0f);
func_80042330_portrait(spD0 + 0x1B, (spC4 + spCC) + 4, 0U, 1.0f, lapCount);
}
gSPDisplayList(gDisplayListHead++, D_0D006950);
if ((player == gPlayerOne) && (gScreenModeSelection == SCREEN_MODE_1P)) {
@@ -3651,7 +3758,7 @@ void render_lakitu(s32 cameraId) {
}
}
void func_800534A4(UNUSED s32 arg0) {
void translate_thwomp_lights(UNUSED s32 arg0) {
func_800419F8();
// Lights1 *D_800E4638l = (Lights1 *) LOAD_ASSET(D_800E4638);
D_800E4638.l[0].l.dir[0] = D_80165840[0];
@@ -3659,7 +3766,7 @@ void func_800534A4(UNUSED s32 arg0) {
D_800E4638.l[0].l.dir[2] = D_80165840[2];
}
void func_800534E8(s32 objectIndex) {
void thwomp_lights(s32 objectIndex) {
// Lights1 *D_800E4638l = (Lights1 *) LOAD_ASSET(D_800E4638);
// Lights1 *D_800E4650l = (Lights1 *) LOAD_ASSET(D_800E4650);
@@ -3699,7 +3806,7 @@ void render_object_thwomps_model(s32 objectIndex) {
func_8004A7AC(objectIndex, 1.75f);
rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation,
gObjectList[objectIndex].sizeScaling);
func_800534E8(objectIndex);
thwomp_lights(objectIndex);
gSPDisplayList(gDisplayListHead++, D_0D007828);
gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16);
gDPLoadTLUT_pal256(gDisplayListHead++, d_course_bowsers_castle_thwomp_tlut);
@@ -3726,17 +3833,17 @@ void render_object_thwomps(s32 cameraId) {
}
}
func_800534A4(objectIndex);
translate_thwomp_lights(objectIndex);
for (i = 0; i < gNumActiveThwomps; i++) {
objectIndex = indexObjectList1[i];
minusone = gObjectList[objectIndex].unk_0DF - 1;
plusone = gObjectList[objectIndex].unk_0DF + 1;
if (gGamestate != 9) {
if (gGamestate != CREDITS_SEQUENCE) {
if ((D_8018CF68[cameraId] >= minusone) && (plusone >= D_8018CF68[cameraId]) &&
(is_object_visible_on_camera(objectIndex, camera, 0x8000U) != 0)) {
render_object_thwomps_model(objectIndex);
}
} else {
} else { // CREDITS_SEQUENCE
render_object_thwomps_model(objectIndex);
}
}
+4 -2
View File
@@ -345,8 +345,8 @@ void render_object_snowmans_list_2(s32);
void render_object_snowmans_list_1(s32);
void render_object_snowmans(s32);
void render_lakitu(s32);
void func_800534A4(s32);
void func_800534E8(s32);
void translate_thwomp_lights(s32);
void thwomp_lights(s32);
void render_object_thwomps_model(s32);
void render_object_thwomps(s32);
void func_80053D74(s32, s32, s32);
@@ -431,6 +431,8 @@ void func_80057B14(s32, s32, char*, u32);
void func_80057B80(s32, s32, char*, u32);
void func_80057BEC(s32, s32, char*, u32);
extern Lights1 D_800E4668;
extern f32 D_801637C4;
extern s32 D_801637E8;
extern f32 D_801637F0;
+10 -3
View File
@@ -31,6 +31,7 @@
#include <assets/wario_kart.h>
#include <assets/donkeykong_kart.h>
#include "port/Game.h"
#include "engine/Matrix.h"
s8 gRenderingFramebufferByPlayer[] = { 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02 };
@@ -739,7 +740,9 @@ void render_players_on_screen_two(void) {
}
// Call moved to sync kart and wheel tlut loading/rendering
load_kart_texture_and_render_kart_particle_on_screen_two();
if (gPlayersToRenderCount != 0) {
load_kart_texture_and_render_kart_particle_on_screen_two();
}
try_rendering_player(gPlayerOne, PLAYER_ONE, PLAYER_TWO);
try_rendering_player(gPlayerTwo, PLAYER_TWO, PLAYER_TWO);
@@ -785,7 +788,9 @@ void render_players_on_screen_three(void) {
init_render_player(gPlayerThree, camera3, PLAYER_THREE, PLAYER_THREE);
init_render_player(gPlayerFour, camera3, PLAYER_FOUR, PLAYER_THREE);
load_kart_texture_and_render_kart_particle_on_screen_three();
if (gPlayersToRenderCount != 0) {
load_kart_texture_and_render_kart_particle_on_screen_three();
}
try_rendering_player(gPlayerOne, PLAYER_ONE, PLAYER_THREE);
try_rendering_player(gPlayerTwo, PLAYER_TWO, PLAYER_THREE);
@@ -813,7 +818,9 @@ void render_players_on_screen_four(void) {
init_render_player(gPlayerThree, camera4, PLAYER_THREE, PLAYER_FOUR);
init_render_player(gPlayerFour, camera4, PLAYER_FOUR, PLAYER_FOUR);
load_kart_texture_and_render_kart_particle_on_screen_four();
if (gPlayersToRenderCount != 0) {
load_kart_texture_and_render_kart_particle_on_screen_four();
}
try_rendering_player(gPlayerOne, PLAYER_ONE, PLAYER_FOUR);
try_rendering_player(gPlayerTwo, PLAYER_TWO, PLAYER_FOUR);
+4 -4
View File
@@ -2175,7 +2175,7 @@ void update_flame_particle(void) {
}
}
void init_object_smoke_paticle(s32 objectIndex, Vec3f arg1, s16 arg2) {
void init_object_smoke_particle(s32 objectIndex, Vec3f arg1, s16 arg2) {
Object* object;
init_object(objectIndex, (s32) arg2);
@@ -2196,7 +2196,7 @@ void init_smoke_particle(Vec3f arg0, UNUSED f32 arg1, s16 arg2) {
objectIndex = add_unused_obj_index(gObjectParticle4, &gNextFreeObjectParticle4, gObjectParticle4_SIZE);
if (objectIndex != NULL_OBJECT_ID) {
init_object_smoke_paticle(objectIndex, arg0, arg2);
init_object_smoke_particle(objectIndex, arg0, arg2);
}
}
@@ -2255,7 +2255,7 @@ void func_80076F2C(void) {
}
}
void init_object_smoke_particle(s32 objectIndex, s32 flameIndex) {
void init_object_smoke_particle2(s32 objectIndex, s32 flameIndex) {
init_object(objectIndex, 3);
gObjectList[objectIndex].unk_0D5 = 0xB;
@@ -2279,7 +2279,7 @@ void init_smoke_particles(s32 arg0) {
objectIndex = add_unused_obj_index(gObjectParticle4, &gNextFreeObjectParticle4, gObjectParticle4_SIZE);
if (objectIndex != NULL_OBJECT_ID) {
init_object_smoke_particle(objectIndex, arg0);
init_object_smoke_particle2(objectIndex, arg0);
}
}
+2 -2
View File
@@ -152,13 +152,13 @@ void func_800769D8(s32);
void func_80076AEC(s32);
void func_80076B7C(void);
void update_flame_particle(void);
void init_object_smoke_paticle(s32, Vec3f, s16);
void init_object_smoke_particle(s32, Vec3f, s16);
void init_smoke_particle(Vec3f, f32, s16);
void func_80076DC4(s32);
void func_80076E14(s32);
void func_80076ED8(s32);
void func_80076F2C(void);
void init_object_smoke_particle(s32, s32);
void init_object_smoke_particle2(s32, s32);
void init_smoke_particles(s32);
void func_800773D8(f32*, s32);
void func_80077428(s32);
+1 -1
Submodule torch updated: 6edf65beca...3bea96b12b
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 3
name: banshee boardwalk
debug_name: ghost
cup: SPECIAL_CUP
cup_index: 2
course_length: 747m
kart_ai_behaviour_ptr: D_0D009058
kart_ai_maximum_separation: 40.0f
kart_ai_minimum_separation: 0.4f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 53
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x006e, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x00be, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x00fa, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x01db, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0262, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x02EE, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: [d_course_banshee_boardwalk_track_waypoints, "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: [d_course_banshee_boardwalk_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [0, 0, 0, 0, 0, 0]
sky_colors2: [0, 0, 0, 0, 0, 0]
-38
View File
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 19
name: big donut
debug_name: doughnut
cup: BATTLE_CUP
cup_index: 0
course_length: ""
kart_ai_behaviour_ptr: D_0D008F18
kart_ai_maximum_separation: -1.0f
kart_ai_minimum_separation: 0.5f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 40
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x0014, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0028, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x003c, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0050, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0064, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0078, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x008c, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [0, 0, 0, 0, 0, 0]
sky_colors2: [0, 0, 0, 0, 0, 0]
-38
View File
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 15
name: block fort
debug_name: block
cup: BATTLE_CUP
cup_index: 1
course_length: ""
kart_ai_behaviour_ptr: D_0D008F18
kart_ai_maximum_separation: -1.0f
kart_ai_minimum_separation: 0.1f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 53
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x0014, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0028, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x003c, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0050, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0064, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0078, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x008c, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [128, 4280, 6136, 216, 7144, 32248]
sky_colors2: [216, 7144, 32248, 0, 0, 0]
-38
View File
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 2
name: bowser's castle
debug_name: castle
cup: STAR_CUP
cup_index: 3
course_length: 777m
kart_ai_behaviour_ptr: D_0D008FB8
kart_ai_maximum_separation: 35.0f
kart_ai_minimum_separation: 0.2f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 53
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x0032, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0096, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x00c8, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0104, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x01b3, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x030C, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: [d_course_bowsers_castle_track_waypoints, "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: [d_course_bowsers_castle_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [48, 1544, 49528, 0, 0, 0]
sky_colors2: [0, 0, 0, 0, 0, 0]
-38
View File
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 1
name: choco mountain
debug_name: mountain
cup: FLOWER_CUP
cup_index: 2
course_length: 687m
kart_ai_behaviour_ptr: D_0D008F80
kart_ai_maximum_separation: 35.0f
kart_ai_minimum_separation: 0.3f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 53
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x008c, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x00a5, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x014a, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0226, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0253, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x02BC, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: [d_course_choco_mountain_track_waypoints, "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: [d_course_choco_mountain_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [255, 255, 255, 255, 255, 255]
sky_colors2: [255, 255, 255, 255, 255, 255]
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 18
name: d.k.'s jungle parkway
debug_name: jungle
cup: SPECIAL_CUP
cup_index: 0
course_length: 893m
kart_ai_behaviour_ptr: D_0D0093C0
kart_ai_maximum_separation: 40.0f
kart_ai_minimum_separation: 0.1f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 53
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x0032, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0064, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0096, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x00be, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x00fa, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x0370, 0x0001, 0x0001, 0x0001, 0x01F4, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: [d_course_dks_jungle_parkway_track_waypoints, "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: [d_course_dks_jungle_parkway_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [255, 174, 0, 255, 229, 124]
sky_colors2: [22, 145, 22, 0, 0, 0]
-38
View File
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 17
name: double deck
debug_name: deck
cup: BATTLE_CUP
cup_index: 2
course_length: ""
kart_ai_behaviour_ptr: D_0D008F18
kart_ai_maximum_separation: -1.0f
kart_ai_minimum_separation: 0.5f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 53
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x0014, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0028, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x003c, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0050, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0064, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0078, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x008c, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [113, 70, 255, 255, 184, 99]
sky_colors2: [255, 224, 240, 0, 0, 0]
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 5
name: frappe snowland
debug_name: snow
cup: FLOWER_CUP
cup_index: 1
course_length: 734m
kart_ai_behaviour_ptr: D_0D0090F8
kart_ai_maximum_separation: 50.0f
kart_ai_minimum_separation: 0.3f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 53
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x0032, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0064, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0096, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0122, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x015e, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x02EE, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: [d_course_frappe_snowland_track_waypoints, "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: [d_course_frappe_snowland_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [28, 11, 90, 0, 99, 164]
sky_colors2: [0, 99, 164, 0, 0, 0]
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 11
name: kalimari desert
debug_name: desert
cup: MUSHROOM_CUP
cup_index: 3
course_length: 753m
kart_ai_behaviour_ptr: D_0D009260
kart_ai_maximum_separation: 50.0f
kart_ai_minimum_separation: 0.3f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 53
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x0032, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x008a, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0118, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0194, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x01fe, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x02BC, 0x0001, 0x0001, 0x0001, 0x0226, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: [d_course_kalimari_desert_track_waypoints, "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: [d_course_kalimari_desert_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [195, 231, 255, 255, 192, 0]
sky_colors2: [255, 192, 0, 0, 0, 0]
-38
View File
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 6
name: koopa troopa beach
debug_name: beach
cup: MUSHROOM_CUP
cup_index: 2
course_length: 691m
kart_ai_behaviour_ptr: D_0D009158
kart_ai_maximum_separation: 50.0f
kart_ai_minimum_separation: 0.5f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 53
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x003c, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0078, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x00c8, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0118, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x01b3, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x02BC, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: [d_course_koopa_troopa_beach_track_waypoints, "d_course_koopa_troopa_beach_track_waypoints_2", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: [d_course_koopa_troopa_beach_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [48, 1688, 54136, 216, 7144, 32248]
sky_colors2: [48, 1688, 54136, 0, 0, 0]
-38
View File
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 8
name: luigi raceway
debug_name: l circuit
cup: MUSHROOM_CUP
cup_index: 0
course_length: 717m
kart_ai_behaviour_ptr: D_0D0091E8
kart_ai_maximum_separation: 50.0f
kart_ai_minimum_separation: 0.7f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 48
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x0032, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x00c8, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0131, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x01b8, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0203, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x02DA, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: [d_course_luigi_raceway_track_waypoints, "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: [d_course_luigi_raceway_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [128, 4280, 6136, 216, 7144, 32248]
sky_colors2: [216, 7144, 32248, 0, 0, 0]
-38
View File
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 0
name: mario raceway
debug_name: m circuit
cup: FLOWER_CUP
cup_index: 3
course_length: 567m
kart_ai_behaviour_ptr: D_0D008F28
kart_ai_maximum_separation: 50.0f
kart_ai_minimum_separation: 0.3f
D_800DCBB4: D_800DCB34
cpu_steering_sensitivity: 48
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x0028, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0064, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0109, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x011d, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x01a4, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x0258, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: [d_course_mario_raceway_track_waypoints, "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: [d_course_mario_raceway_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [128, 4280, 6136, 216, 7144, 32248]
sky_colors2: [0, 0, 0, 0, 0, 0]
-38
View File
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 9
name: moo moo farm
debug_name: farm
cup: MUSHROOM_CUP
cup_index: 1
course_length: 527m
kart_ai_behaviour_ptr: D_0D009210
kart_ai_maximum_separation: 50.0f
kart_ai_minimum_separation: 0.5f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 48
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x0032, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x008c, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x00e1, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x013c, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x01b2, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x0230, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: [d_course_moo_moo_farm_track_waypoints, "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: [d_course_moo_moo_farm_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [0, 18, 255, 197, 211, 255]
sky_colors2: [255, 184, 99, 0, 0, 0]
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 20
name: # unknown (does not exist)
debug_name: # unk (does not exist)
cup: null
cup_index: -1
course_length: null
kart_ai_behaviour_ptr: D_0D008F18
kart_ai_maximum_separation: 40.0f # entry
kart_ai_minimum_separation: 0.5f # entry
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 53 # entry
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x0003, 0x0005, 1.25, 0.0, 0.0, 0.0, 0.0]
- [0x0028, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x003c, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0050, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0064, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0078, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x008c, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x01F4, 0x01F4, 0x01F4, 0x01F4, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [0.0f, 0.0f, 0.0f, 0.0f]
D_0D009568: [0.0f, 0.0f, 0.0f, 0.0f]
D_0D0096B8: [0.0f, 0.0f, 0.0f, 0.0f]
D_0D009808: [0.0f, 0.0f, 0.0f, 0.0f]
# Course waypoints
path_table: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: [podium_ceremony_path, podium_ceremony_path_2, podium_ceremony_path_3, podium_ceremony_path_4]
sky_colors: [238, 144, 255, 255, 224, 240]
sky_colors2: [255, 224, 240, 0, 0, 0]
-38
View File
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 13
name: rainbow road
debug_name: rainbow
cup: SPECIAL_CUP
cup_index: 3
course_length: 2000m
kart_ai_behaviour_ptr: D_0D0092C8
kart_ai_maximum_separation: 50.0f
kart_ai_minimum_separation: 0.4f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 38
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x0032, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0064, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0096, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x00c8, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x00fa, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x076C, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: [d_course_rainbow_road_track_waypoints, "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: [d_course_rainbow_road_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [0, 0, 0, 0, 0, 0]
sky_colors2: [0, 0, 0, 0, 0, 0]
-38
View File
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 7
name: royal raceway
debug_name: p circuit
cup: STAR_CUP
cup_index: 2
course_length: 1025m
kart_ai_behaviour_ptr: D_0D009188
kart_ai_maximum_separation: 50.0f
kart_ai_minimum_separation: 0.4f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 53
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x0032, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0064, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0128, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0190, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x02ea, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x03E8, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: [d_course_royal_raceway_track_waypoints, "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: [d_course_royal_raceway_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [238, 144, 255, 255, 224, 240]
sky_colors2: [255, 224, 240, 0, 0, 0]
-38
View File
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 12
name: sherbet land
debug_name: sherbet
cup: STAR_CUP
cup_index: 1
course_length: 756m
kart_ai_behaviour_ptr: D_0D009280
kart_ai_maximum_separation: 50.0f
kart_ai_minimum_separation: 0.3f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 53
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x0032, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0064, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0096, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x00c8, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x00fa, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x02BC, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: [d_course_sherbet_land_track_waypoints, "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: [d_course_sherbet_land_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [128, 4280, 6136, 216, 7144, 32248]
sky_colors2: [216, 7144, 32248, 128, 4280, 6136]
-38
View File
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 16
name: skyscraper
debug_name: skyscraper
cup: BATTLE_CUP
cup_index: 3
course_length: ""
kart_ai_behaviour_ptr: D_0D008F18
kart_ai_maximum_separation: -1.0f
kart_ai_minimum_separation: 0.5f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 53
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x0014, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0028, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x003c, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0050, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0064, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x0078, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
- [0x008c, 0x0000, 1.0, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: ["&nullPath", "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [0, 0, 0, 0, 0, 0]
sky_colors2: [0, 0, 0, 0, 0, 0]
-38
View File
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 10
name: toad's turnpike
debug_name: highway
cup: FLOWER_CUP
cup_index: 0
course_length: 1036m
kart_ai_behaviour_ptr: D_0D009238
kart_ai_maximum_separation: 50.0f
kart_ai_minimum_separation: 0.5f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 40
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x0032, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0064, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0096, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x00c8, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x00fa, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x03E8, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: [d_course_toads_turnpike_track_waypoints, "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: [d_course_toads_turnpike_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [0, 2, 94, 209, 65, 23]
sky_colors2: [209, 65, 23, 0, 0, 0]
-38
View File
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 14
name: wario stadium
debug_name: stadium
cup: STAR_CUP
cup_index: 0
course_length: 1591m
kart_ai_behaviour_ptr: D_0D009310
kart_ai_maximum_separation: 50.0f
kart_ai_minimum_separation: 0.6f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 53
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x0032, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0064, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0096, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x00c8, 0x0001, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x00fa, 0x0003, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
- [0x0000, 0x0000, 0.8333333, 0.0, 0.0, 0.0, 0.0]
path_sizes: [0x0640, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
D_0D0096B8: [3.3333332f, 3.9166667f, 4.5f, 5.0833334f]
D_0D009808: [3.75f, 5.1666665f, 5.75f, 6.3333334f]
# Course waypoints
path_table: [d_course_wario_stadium_track_waypoints, "&nullPath", "&nullPath", "&nullPath"]
# Unused except in podium ceremony
path_table_unknown: [d_course_wario_stadium_unknown_waypoints, "&nullPath", "&nullPath", "&nullPath"]
sky_colors: [20, 30, 56, 40, 60, 110]
sky_colors2: [0, 0, 0, 0, 0, 0]
-38
View File
@@ -1,38 +0,0 @@
course:
type: MK64:METADATA
offset: 0x0
id: 4
name: yoshi valley
debug_name: maze
cup: SPECIAL_CUP
cup_index: 1
course_length: 772m
kart_ai_behaviour_ptr: D_0D0090B8
kart_ai_maximum_separation: 35.0f
kart_ai_minimum_separation: 0.0f
D_800DCBB4: D_800DCAF4
cpu_steering_sensitivity: 53
bomb_kart_spawns: # 7 bomb kart spawn locations
- [0x0000, 0x0000, 0.8333333, -1533.0, -682.0, -103.0, 0.0]
- [0x000a, 0x0000, 0.8333333, -1565.0, -619.0, -109.0, 0.0]
- [0x0014, 0x0000, 0.8333333, -1529.0, -579.0, -109.0, 0.0]
- [0x001e, 0x0000, 0.8333333, -1588.0, -534.0, -106.0, 0.0]
- [0x0028, 0x0000, 0.8333333, -1598.0, -207.0, -105.0, 0.0]
- [0x0032, 0x0000, 0.8333333, -1646.0, -147.0, -93.0, 0.0]
- [0x003c, 0x0000, 0.8333333, -2532.0, -445.0, -90.0, 0.0]
path_sizes: [0x02B2, 0x02A8, 0x02B2, 0x0320, 0x0001, 0x0000, 0x0000, 0x0000]
# unk common_textures data
D_0D009418: [4.1666665f, 5.5833334f, 6.1666665f, 6.75f]
D_0D009568: [3.75f, 4.5833334f, 4.5833334f, 4.5833334f]
D_0D0096B8: [3.3333332f, 3.3333332f, 3.3333332f, 3.3333332f]
D_0D009808: [2.9166667f, 3.75f, 3.75f, 3.75f]
# Course waypoints
path_table: [d_course_yoshi_valley_track_waypoints, "d_course_yoshi_valley_track_waypoints_2", "d_course_yoshi_valley_track_waypoints_3", "d_course_yoshi_valley_track_waypoints_4"]
# Unused except in podium ceremony
path_table_unknown: [d_course_yoshi_valley_unknown_waypoints, d_course_yoshi_valley_unknown_waypoints_2, d_course_yoshi_valley_unknown_waypoints_3, d_course_yoshi_valley_unknown_waypoints_4]
sky_colors: [113, 70, 255, 255, 184, 99]
sky_colors2: [95, 40, 15, 0, 0, 0]
+30
View File
@@ -0,0 +1,30 @@
:config:
force: true
header:
code:
- '#include <libultraship.h>'
header:
- '#include <libultraship.h>'
audio_setup:
type: NAUDIO:V1:AUDIO_SETUP
audio_seq:
size: 0x23180
offset: 0xBC5F60
audio_bank:
size: 0x13840
offset: 0x966260
audio_table:
size: 0x24C4C0
offset: 0x979AA0
audio_sample_bank_table:
{ type: NAUDIO:V1:AUDIO_TABLE, format: SAMPLE, offset: 0x966260, symbol: gSampleBankTableInit }
audio_seq_table:
{ type: NAUDIO:V1:AUDIO_TABLE, format: SEQUENCE, offset: 0xBC5F60, symbol: gSeqTableInit }
audio_soundfont_table:
{ type: NAUDIO:V1:AUDIO_TABLE, format: SOUNDFONT, offset: 0x979AA4, symbol: gSoundFontTableInit }
audio_seq_font_table:
{ type: ARRAY, count: 283, array_type: u8, offset: 0xBE90E0, symbol: gSeqFontTableInit }
-4
View File
@@ -1,4 +0,0 @@
course_metadata:
type: mk64:metadata
input_directory: yamls/courses
out_directory: "assets/course_metadata"
-14
View File
@@ -1,14 +0,0 @@
:config:
vram:
addr: 0x802854B0
offset: 0x3F0
header:
code:
- '#include <assets/credits_text.h>'
header:
- '#include <libultraship.h>'
- '#include <align_asset_macro.h>'
gCreditsText:
symbol: gCreditsText
type: text
offset: 0x802854B0