mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-08-01 00:18:46 -04:00
update with the decomp (#97)
* Update menus.c (#634) * Update common_data.yml (#635) * Renames for screenId and other changes (#636) * screenId renames * Rename surface map to collision mesh (#637) * Rename some stack vars (#638) * Fix syntax error (#639) * Rename some stack vars * Update collision.c * Collision Documentation (#640) * Collision related renames * update doxygen (#649) * change bool (#644) Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * Update (#642) * Delete trig_tables_bss.c (#650) * fix typo audio (#656) * fix typo src actor (#657) Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * fix typo include (#658) Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * fix course (#659) Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * fix typo debug (#660) Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * fix typo data (#661) Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * replace number with const (#665) * fix typo buffers (#655) * fix typo buffers * tweak ld file * rename to sMemoryPool * add a warning --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * fix typo src (#654) * fix typo src * fix non matcing * Update code_80091750.c --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * fix typo racing (#653) * fix typo racing * get it match * replace G_LINE3D to G_QUAD --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * fix typo src (#652) Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * fix ending typo (#651) * Action more info when it doesn't match and fix first diff (#662) * Update linux-compile.yml * fix first-diff * Update first-diff.py --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * document texture of kart (#663) * document texture of kart * change screenPlayerId to screenId * some documentation around object * Revert "some documentation around object" This reverts commit cbb39078e036bf2a417bed67359e910213acab28. * more rename --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * Make evaluate_collision_players_palm_tree better (#667) This matches just the same as before, but using those two casts instead of shifts seems more likely to be accurate to the original source code Signed-off-by: Gabriel Ravier <gabravier@gmail.com> * add fedora instruciton (#666) Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * start documenting animation (#668) * start documenting animation * Update course_data.c * change comment * update libultra asm (#648) * update libultra asm * fix gcc __osThreadTail --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * Document Vehicles (#641) * start doc collision * fix merge * finish rename fonction related to vehicle * document around waypoint of vehicle * make some modification * make some change and rename one * copy_ to oldPos * doc smoke ferry and train * some rename * fix some renaming * precise index * rename a funciton * simplify waypoint_vehicles * change some name * change some name * rename move_to_point_direction * fix some conflict * Update code_80005FD0.c * Update code_80005FD0.h --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * Label a save info loop (#645) * save info * more gcc progress * fix a value and do a rename (#669) * update clang and add action (#664) * update clang and add action * try clang on course folder only * forget two file * Update course_displaylists.inc.c * forget few other file * Update course_vertices.inc.c * format all code while get it match * second pass * format other dir * disable clang format on bad ido code * fix some tabulation * revert format on tool dir * Update clang-format.yml * ignore gbi.h * add some read me instruction * fix error * format and fixing error * Update README.md --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * Update linkonly_generator.py (#670) * some rename for torch (#588) * rename gBombKartSpawns, and fix cup ID * Update doxygen_syms.md * rename for gCourseIndexInCup and his constant * rename to gCupSelectedCourseIndex * forget a change in constant * fix compilation issue * Update Dockerfile to latest Ubuntu LTS + fixed missing cmake (#674) * Fix color font matrix function (#676) * Fix label variables used in menus (#675) * Fix label variables used in menus * split D_800F2BDC and clang format menu.c --------- Co-authored-by: coco875 <pereira.jannin@gmail.com> * Fix some libultra struct types (#677) * Uintptr (#671) * Update render_courses.c * Update math_util.c * Update math_util.c * Update math_util.h * Update render_courses.c * Clang suggest (#678) * add clang suggestion * Update clang-format-suggest.yml * Update clang-format-suggest.yml * simplify * switch to ubuntu * Update clang-format-suggest.yml * update ubuntu --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * Clang pr (#679) * Create clang-pr.yml * Update clang-pr.yml * Update osCreateMesgQueue.c * Update osCreateMesgQueue.c * Update clang-pr.yml * Update clang-pr.yml * Update clang-format.yml * clang format (#680) Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com> * some rename in ceremony (#647) * rename ceremony * apply some suggestion * some rename --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * clang format (#681) Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com> * Rename Object Timing Related Code (#673) * start making models extraction with blender * finishing extract model * Update fast64 * extract course * Update fast64 * Update fast64 * simplify import of course_displaylists and course_textures and remplace adress with texture * Update fast64 * change data format and simplify the thread queue * move in a blender folder * remove fast64 * re add fast64 * add model_extract and fast64_blender in makefile * multithread with make file split the models into multiple json and add course segment * Update fast64 * remove old model_extract * remove the error when he don't find blender * start rename around course section * rename around object * update submodule fast64 * fix compilation issue and add some model to extract * Update fast64 * remove fast64 * re add fast64 * update submodule * fix compilation issue * add other collision gfx and prepare reorganise file * re arrange json * Create README.MD * Update README.MD * Update README.MD * update fast64 * rename to initiate_next_state * Revert "Merge branch '3d-objects' into general-object" This reverts commit f5347b38cc75af4d10ee3726dc1524c1c71d6849, reversing changes made to a353c4d954fb5b50c8b48fe3f9d67c95ccaab299. * revert the revert... * revert 3d-models PR * finish some revert * Update code_80005FD0.c * fix code_80091750.c * Update code_80091750.c * rename isTimerRunning to isTimerActive and set_object_timer_running to set_object_timer_state * rename to initialize_next_state * rename to object_next_state --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * extract models with blender (#577) * start making models extraction with blender * finishing extract model * Update fast64 * extract course * Update fast64 * Update fast64 * simplify import of course_displaylists and course_textures and remplace adress with texture * Update fast64 * change data format and simplify the thread queue * move in a blender folder * remove fast64 * re add fast64 * add model_extract and fast64_blender in makefile * multithread with make file split the models into multiple json and add course segment * Update fast64 * remove old model_extract * remove the error when he don't find blender * start rename around course section * update submodule fast64 * fix compilation issue and add some model to extract * Update fast64 * remove fast64 * re add fast64 * update submodule * fix compilation issue * add other collision gfx and prepare reorganise file * re arrange json * Create README.MD * Update README.MD * Update README.MD * update fast64 --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * other * fix some error of compilation * finish fix all error --------- Signed-off-by: Gabriel Ravier <gabravier@gmail.com> Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> Co-authored-by: Gabriel Ravier <gabravier@gmail.com> Co-authored-by: MisterSheeple <27652712+MisterSheeple@users.noreply.github.com> Co-authored-by: AloXado320 <38191089+AloXado320@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com>
This commit is contained in:
@@ -4,8 +4,17 @@
|
||||
#include <assets/choco_mountain_data.h>
|
||||
|
||||
void func_8029CF0C(struct ActorSpawnData* spawnData, struct FallingRock* rock) {
|
||||
#ifndef TARGET_N64
|
||||
struct ActorSpawnData* temp_v0 = (struct ActorSpawnData*) LOAD_ASSET(spawnData);
|
||||
#else
|
||||
s32 segment = SEGMENT_NUMBER2(spawnData);
|
||||
s32 offset = SEGMENT_OFFSET(spawnData);
|
||||
struct ActorSpawnData* temp_v0 = (struct ActorSpawnData*) VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset);
|
||||
#endif
|
||||
Vec3s sp24 = { 60, 120, 180 };
|
||||
#ifndef TARGET_N64
|
||||
temp_v0 += rock->unk_06;
|
||||
#endif
|
||||
rock->respawnTimer = sp24[rock->unk_06]; // * 2
|
||||
rock->pos[0] = (f32) temp_v0[rock->unk_06].pos[0] * gCourseDirection;
|
||||
rock->pos[1] = (f32) temp_v0[rock->unk_06].pos[1] + 10.0f;
|
||||
@@ -21,7 +30,14 @@ void func_8029CF0C(struct ActorSpawnData* spawnData, struct FallingRock* rock) {
|
||||
* @param spawnData
|
||||
*/
|
||||
void spawn_falling_rocks(struct ActorSpawnData* spawnData) {
|
||||
#ifndef TARGET_N64
|
||||
struct ActorSpawnData* temp_s0 = (struct ActorSpawnData*) LOAD_ASSET(spawnData);
|
||||
#else
|
||||
s32 addr = SEGMENT_NUMBER2(spawnData);
|
||||
s32 offset = SEGMENT_OFFSET(spawnData);
|
||||
// Casting this to prevent warning does not work.
|
||||
struct ActorSpawnData* temp_s0 = (struct ActorSpawnData*) VIRTUAL_TO_PHYSICAL2(gSegmentTable[addr] + offset);
|
||||
#endif
|
||||
struct FallingRock* temp_v1;
|
||||
Vec3f startingPos;
|
||||
Vec3f startingVelocity;
|
||||
|
||||
@@ -26,6 +26,14 @@
|
||||
#define ADSR_GOTO -2
|
||||
#define ADSR_RESTART -3
|
||||
|
||||
// Envelopes are always stored as big endian, to match sequence files which are
|
||||
// byte blobs and can embed envelopes. Hence this byteswapping macro.
|
||||
#if IS_BIG_ENDIAN
|
||||
#define BSWAP16(x) (x)
|
||||
#else
|
||||
#define BSWAP16(x) (((x) & 0xff) << 8 | (((x) >> 8) & 0xff))
|
||||
#endif
|
||||
|
||||
void sequence_channel_process_sound(struct SequenceChannel* seqChannel, s32 recalculateVolume);
|
||||
void sequence_player_process_sound(struct SequencePlayer* seqPlayer);
|
||||
f32 get_portamento_freq_scale(struct Portamento* p);
|
||||
|
||||
@@ -57,9 +57,6 @@ typedef struct {
|
||||
/* 0xB4 */ f32 unk_B4;
|
||||
} Camera; /* size = 0xB8 */
|
||||
|
||||
typedef BAD_RETURN(s32) (*CameraEvent)(Camera* c);
|
||||
typedef CameraEvent CutsceneShot;
|
||||
|
||||
void camera_init(f32, f32, f32, s16, u32, s32);
|
||||
void func_8001CA10(Camera*);
|
||||
void func_8001CA24(Player*, f32);
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@
|
||||
|
||||
/* Function Prototypes */
|
||||
|
||||
void setup_camera_podium_ceremony(void);
|
||||
void func_802816B8(void);
|
||||
void update_camera_podium_ceremony(void);
|
||||
void init_camera_podium_ceremony(void);
|
||||
|
||||
// guPerspective params
|
||||
|
||||
|
||||
+1
-1
@@ -188,7 +188,7 @@ void setup_race(void) {
|
||||
gCourseDirection = 1.0f;
|
||||
}
|
||||
if (gModeSelection == GRAND_PRIX) {
|
||||
gCurrentCourseId = gCupCourseOrder[gCupSelection][gCupCourseSelection];
|
||||
gCurrentCourseId = gCupCourseOrder[gCupSelection][gCourseIndexInCup];
|
||||
}
|
||||
gActiveScreenMode = gScreenModeSelection;
|
||||
if (gCurrentCourseId != gCurrentlyLoadedCourseId) {
|
||||
|
||||
+31
-31
@@ -2388,7 +2388,7 @@ s16 find_closest_waypoint_track_section(f32 posX, f32 posY, f32 posZ, u16 trackS
|
||||
/**
|
||||
* Tries to find the waypoint nearest to (posX, posY, posZ)
|
||||
* Only consider waypoints in the same segment as trackSectionId
|
||||
* Only considers waypoints within 500 units of (posX, posY, posZ)
|
||||
* Only considers waypoints within 500 units of(posX, posY, posZ)
|
||||
* Looks 3 waypoints behind and 6 waypoints ahead of waypointIndex
|
||||
**/
|
||||
s16 func_8000C884(f32 posX, f32 posY, f32 posZ, s16 waypointIndex, s32 pathIndex, u16 trackSectionId) {
|
||||
@@ -2931,24 +2931,24 @@ void set_bomb_kart_spawn_positions(void) {
|
||||
s32 var_s3;
|
||||
TrackWaypoint* temp_v0;
|
||||
UNUSED BombKart* var_s0;
|
||||
BombKartSpawn* temp_s1;
|
||||
BombKartSpawn* bombKartSpawn;
|
||||
|
||||
for (var_s3 = 0; var_s3 < NUM_BOMB_KARTS_VERSUS; var_s3++) {
|
||||
temp_s1 = &gBombKartSpawns[gCurrentCourseId][var_s3];
|
||||
bombKartSpawn = &gBombKartSpawns[gCurrentCourseId][var_s3];
|
||||
switch (gCurrentCourseId) {
|
||||
case COURSE_YOSHI_VALLEY:
|
||||
startingXPos = temp_s1->startingXPos;
|
||||
startingZPos = temp_s1->startingZPos;
|
||||
startingXPos = bombKartSpawn->startingXPos;
|
||||
startingZPos = bombKartSpawn->startingZPos;
|
||||
startingYPos = spawn_actor_on_surface(startingXPos, 2000.0f, startingZPos);
|
||||
break;
|
||||
case COURSE_AWARD_CEREMONY:
|
||||
temp_v0 = &D_80164550[3][temp_s1->waypointIndex];
|
||||
temp_v0 = &D_80164550[3][bombKartSpawn->waypointIndex];
|
||||
startingXPos = temp_v0->posX;
|
||||
startingYPos = temp_v0->posY;
|
||||
startingZPos = temp_v0->posZ;
|
||||
break;
|
||||
default:
|
||||
temp_v0 = &D_80164550[0][temp_s1->waypointIndex];
|
||||
temp_v0 = &D_80164550[0][bombKartSpawn->waypointIndex];
|
||||
startingXPos = temp_v0->posX;
|
||||
startingYPos = temp_v0->posY;
|
||||
startingZPos = temp_v0->posZ;
|
||||
@@ -2969,11 +2969,11 @@ void set_bomb_kart_spawn_positions(void) {
|
||||
gBombKarts[var_s3].wheel4Pos[0] = startingXPos;
|
||||
gBombKarts[var_s3].wheel4Pos[1] = startingYPos;
|
||||
gBombKarts[var_s3].wheel4Pos[2] = startingZPos;
|
||||
gBombKarts[var_s3].waypointIndex = temp_s1->waypointIndex;
|
||||
gBombKarts[var_s3].unk_3C = temp_s1->unk_04;
|
||||
gBombKarts[var_s3].waypointIndex = bombKartSpawn->waypointIndex;
|
||||
gBombKarts[var_s3].unk_3C = bombKartSpawn->unk_04;
|
||||
gBombKarts[var_s3].bounceTimer = 0;
|
||||
gBombKarts[var_s3].circleTimer = 0;
|
||||
gBombKarts[var_s3].state = temp_s1->startingState;
|
||||
gBombKarts[var_s3].state = bombKartSpawn->startingState;
|
||||
gBombKarts[var_s3].unk_4A = 0;
|
||||
gBombKarts[var_s3].unk_4C = 1;
|
||||
gBombKarts[var_s3].yPos = startingYPos;
|
||||
@@ -5423,26 +5423,26 @@ void func_80014D30(s32 cameraId, s32 pathIndex) {
|
||||
(f32) temp_v0->posZ);
|
||||
}
|
||||
|
||||
void func_80014DE4(s32 arg0) {
|
||||
void func_80014DE4(s32 cameraIndex) {
|
||||
s32 cameraId;
|
||||
|
||||
D_801646CC = 0;
|
||||
D_80164678[arg0] = D_80164670[arg0];
|
||||
if ((gModeSelection != 1) && ((gCupCourseSelection == 0) || (gDemoMode == (u16) 1))) {
|
||||
D_80164678[arg0] = 0;
|
||||
} else if ((D_80164678[arg0] != 0) && (D_80164678[arg0] != (s16) 1) && (D_80164678[arg0] != 2) &&
|
||||
(D_80164678[arg0] != 3)) {
|
||||
D_80164678[arg0] = 0;
|
||||
D_80164678[cameraIndex] = D_80164670[cameraIndex];
|
||||
if ((gModeSelection != 1) && ((gCourseIndexInCup == COURSE_ONE) || (gDemoMode == (u16) 1))) {
|
||||
D_80164678[cameraIndex] = 0;
|
||||
} else if ((D_80164678[cameraIndex] != 0) && (D_80164678[cameraIndex] != (s16) 1) &&
|
||||
(D_80164678[cameraIndex] != 2) && (D_80164678[cameraIndex] != 3)) {
|
||||
D_80164678[cameraIndex] = 0;
|
||||
}
|
||||
D_80164680[arg0] = -1;
|
||||
D_80164680[cameraIndex] = -1;
|
||||
D_80163238 = 0;
|
||||
D_801646C0[arg0] = 0;
|
||||
D_801646C0[cameraIndex] = 0;
|
||||
D_801646C8 = 0;
|
||||
D_801646D0[arg0].unk0 = 0;
|
||||
D_801646D0[arg0].unk2 = 0;
|
||||
D_801646D0[arg0].unk4 = 0;
|
||||
D_801646D0[cameraIndex].unk0 = 0;
|
||||
D_801646D0[cameraIndex].unk2 = 0;
|
||||
D_801646D0[cameraIndex].unk4 = 0;
|
||||
if ((gModeSelection == 1) && (D_8018EDFC == 0)) {
|
||||
D_80164678[arg0] = 0;
|
||||
D_80164678[cameraIndex] = 0;
|
||||
}
|
||||
|
||||
for (cameraId = 0; cameraId < 4; cameraId++) {
|
||||
@@ -5529,7 +5529,7 @@ f32 func_80014EE4(f32 arg0, s32 arg1) {
|
||||
return arg0;
|
||||
}
|
||||
|
||||
void func_800151A4(Camera* camera, s32 arg1) {
|
||||
void calculate_camera_up_vector(Camera* camera, s32 cameraIndex) {
|
||||
f32 xnorm;
|
||||
f32 ynorm;
|
||||
f32 znorm;
|
||||
@@ -5540,7 +5540,7 @@ void func_800151A4(Camera* camera, s32 arg1) {
|
||||
f32 sp28;
|
||||
u16 thing;
|
||||
|
||||
thing = D_801646C0[arg1];
|
||||
thing = D_801646C0[cameraIndex];
|
||||
if (thing == 0) {
|
||||
camera->up[0] = 0.0f;
|
||||
camera->up[2] = 0.0f;
|
||||
@@ -6662,10 +6662,10 @@ void func_80019890(s32 playerId, s32 cameraId) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_80019B50(s32 arg0, u16 arg1) {
|
||||
void func_80019B50(s32 cameraIndex, u16 arg1) {
|
||||
u16 var_v0;
|
||||
|
||||
var_v0 = D_801646C0[arg0];
|
||||
var_v0 = D_801646C0[cameraIndex];
|
||||
if (var_v0 < arg1) {
|
||||
if ((arg1 - var_v0) < 0x8000) {
|
||||
var_v0 += 0x5A;
|
||||
@@ -6689,10 +6689,10 @@ void func_80019B50(s32 arg0, u16 arg1) {
|
||||
}
|
||||
} else if ((var_v0 - arg1) >= 0x8000) {
|
||||
var_v0 += 0x5A;
|
||||
if (!arg0) {} // wtf?
|
||||
if (!cameraIndex) {} // wtf?
|
||||
}
|
||||
}
|
||||
D_801646C0[arg0] = (s16) var_v0;
|
||||
D_801646C0[cameraIndex] = (s16) var_v0;
|
||||
}
|
||||
|
||||
void func_80019C50(s32 arg0) {
|
||||
@@ -6720,7 +6720,7 @@ void func_80019D2C(Camera* camera, Player* player, s32 arg2) {
|
||||
|
||||
playerId = camera->playerId;
|
||||
if ((D_80163378 != 0) && (gCurrentCourseId == 8)) {
|
||||
func_800151A4(camera, arg2);
|
||||
calculate_camera_up_vector(camera, arg2);
|
||||
nearestWaypoint = gNearestWaypointByPlayerId[playerId];
|
||||
if (((nearestWaypoint >= 0x65) && (nearestWaypoint < 0xFA)) ||
|
||||
((nearestWaypoint >= 0x1AF) && (nearestWaypoint < 0x226))) {
|
||||
@@ -6956,7 +6956,7 @@ void func_8001A588(UNUSED u16* localD_80152300, Camera* camera, Player* player,
|
||||
func_80019D2C(camera, player, cameraIndex);
|
||||
} else {
|
||||
D_801646C0[cameraIndex] = 0;
|
||||
func_800151A4(camera, cameraIndex);
|
||||
calculate_camera_up_vector(camera, cameraIndex);
|
||||
}
|
||||
switch ((u16) D_801646CC) {
|
||||
case 1:
|
||||
|
||||
+1
-1
@@ -194,7 +194,7 @@ void func_80014D30(s32, s32);
|
||||
void func_80014DE4(s32);
|
||||
f32 func_80014EE4(f32, s32);
|
||||
|
||||
void func_800151A4(Camera*, s32);
|
||||
void calculate_camera_up_vector(Camera*, s32);
|
||||
void func_8001530C(void);
|
||||
void func_80015314(s32, f32, s32);
|
||||
void func_80015390(Camera*, Player*, s32);
|
||||
|
||||
+2
-2
@@ -6188,8 +6188,8 @@ void render_balloon(Vec3f arg0, f32 arg1, s16 arg2, s16 arg3) {
|
||||
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
gSPVertex(gDisplayListHead++, gBalloonVertexPlane1, 4, 0);
|
||||
gSPDisplayList(gDisplayListHead++, common_square_plain_render);
|
||||
// D_8018D4C0 is correct. But interestingly, IDO seems to set "-0x40" to a different register so the texture
|
||||
// still looks fine.
|
||||
// D_8018D4C0 is correct. But interestingly, IDO seems to set "-0x40" to a different register so the texture still
|
||||
// looks fine.
|
||||
gDPLoadTextureBlock(gDisplayListHead++, D_8018D4C0 - 0x40, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0,
|
||||
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
|
||||
G_TX_NOLOD);
|
||||
|
||||
+1
-1
@@ -146,7 +146,7 @@ void init_item_window(s32 objectIndex) {
|
||||
|
||||
temp_v0 = (ItemWindowObjects*) &gObjectList[objectIndex];
|
||||
temp_v0->currentItem = ITEM_NONE;
|
||||
temp_v0->itemDisplay = temp_v0->currentItem;
|
||||
temp_v0->textureListIndex = temp_v0->currentItem;
|
||||
temp_v0->tlutList = (u8*) common_tlut_item_window_none;
|
||||
temp_v0->activeTLUT = (u8*) common_tlut_item_window_none;
|
||||
temp_v0->textureList = common_texture_item_window_none;
|
||||
|
||||
+10
-10
@@ -1507,7 +1507,7 @@ void func_8008A9B8(s32 objectIndex) {
|
||||
object = &gObjectList[objectIndex];
|
||||
object->controlPoints++;
|
||||
object->unk_09A = (s16) (10000 / (s16) (object->controlPoints[0].velocity));
|
||||
object->timer = 0;
|
||||
object->animationTimer = 0;
|
||||
func_8008A920(objectIndex);
|
||||
}
|
||||
|
||||
@@ -1516,7 +1516,7 @@ void func_8008AA3C(s32 objectIndex) {
|
||||
object = &gObjectList[objectIndex];
|
||||
object->controlPoints = object->spline->controlPoints;
|
||||
object->unk_084[9] = 0;
|
||||
object->timer = 0;
|
||||
object->animationTimer = 0;
|
||||
/*
|
||||
This is INCREDIBLY stupid. This should really be
|
||||
temp_v0->unk_084[8] = temp_v0->spline->numControlPoints;
|
||||
@@ -1539,8 +1539,8 @@ void func_8008AB10(s32 objectIndex) {
|
||||
object->offset[0] += object->velocity[0];
|
||||
object->offset[1] += object->velocity[1];
|
||||
object->offset[2] += object->velocity[2];
|
||||
object->timer += (u16) object->unk_09A;
|
||||
if (object->timer >= 0x2710) {
|
||||
object->animationTimer += (u16) object->unk_09A;
|
||||
if (object->animationTimer >= 0x2710) {
|
||||
object->unk_084[9] = (u16) object->unk_084[9] + 1;
|
||||
if (((u16) object->unk_084[9] + 1) == (u16) object->unk_084[8]) {
|
||||
object->unk_0AE += 1;
|
||||
@@ -1734,7 +1734,7 @@ void func_8008B3E4(s32 objectIndex) {
|
||||
if (is_obj_index_flag_status_inactive(objectIndex, 8) != 0) {
|
||||
object = &gObjectList[objectIndex];
|
||||
object->unk_084[9] = 0;
|
||||
object->timer = 0;
|
||||
object->animationTimer = 0;
|
||||
object->controlPoints = object->spline->controlPoints;
|
||||
/*
|
||||
This is INCREDIBLY stupid. This should really be
|
||||
@@ -1748,7 +1748,7 @@ void func_8008B3E4(s32 objectIndex) {
|
||||
}
|
||||
|
||||
void func_8008B44C(s32 objectIndex) {
|
||||
gObjectList[objectIndex].timer = 0;
|
||||
gObjectList[objectIndex].animationTimer = 0;
|
||||
gObjectList[objectIndex].controlPoints++;
|
||||
}
|
||||
|
||||
@@ -1768,7 +1768,7 @@ void func_8008B478(s32 objectIndex, s32 arg1) {
|
||||
// I think the game treats each spline as being having a lenght of 10000
|
||||
// This is getting the percent along the spline we want to reach,
|
||||
// which is then treated as the `t` value given to the curve calculations
|
||||
sp34 = ((f32) gObjectList[objectIndex].timer / 10000.0);
|
||||
sp34 = ((f32) gObjectList[objectIndex].animationTimer / 10000.0);
|
||||
// Calculate the curve at `t`
|
||||
func_8008B17C(objectIndex, sp34);
|
||||
if (is_obj_flag_status_active(objectIndex, 0x800) != 0) {
|
||||
@@ -1781,7 +1781,7 @@ void func_8008B478(s32 objectIndex, s32 arg1) {
|
||||
temp = gObjectList[objectIndex].controlPoints[1].velocity;
|
||||
|
||||
gObjectList[objectIndex].unk_09A = 10000.0 / (((temp - var_f6) * sp34) + var_f6);
|
||||
gObjectList[objectIndex].timer += gObjectList[objectIndex].unk_09A;
|
||||
gObjectList[objectIndex].animationTimer += gObjectList[objectIndex].unk_09A;
|
||||
}
|
||||
|
||||
void func_8008B620(s32 objectIndex) {
|
||||
@@ -1790,7 +1790,7 @@ void func_8008B620(s32 objectIndex) {
|
||||
|
||||
func_8008B478(objectIndex, 0);
|
||||
object = &gObjectList[objectIndex];
|
||||
if (object->timer >= 0x2710) {
|
||||
if (object->animationTimer >= 0x2710) {
|
||||
// Have to do it this way due to the u16 cast
|
||||
object->unk_084[9] = (u16) object->unk_084[9] + 1;
|
||||
if (((u16) object->unk_084[9] + 3) == (u16) object->unk_084[8]) {
|
||||
@@ -1806,7 +1806,7 @@ void func_8008B6A4(s32 objectIndex) {
|
||||
|
||||
func_8008B478(objectIndex, 1);
|
||||
object = &gObjectList[objectIndex];
|
||||
if (object->timer >= 0x2710) {
|
||||
if (object->animationTimer >= 0x2710) {
|
||||
// Have to do it this way due to the u16 cast
|
||||
object->unk_084[9] = (u16) object->unk_084[9] + 1;
|
||||
if ((u16) object->unk_084[9] == (u16) object->unk_084[8]) {
|
||||
|
||||
@@ -47,6 +47,7 @@ UNUSED void func_800914E0(void) {
|
||||
camera->pos[1] = (f32) (tempData->pos[1] + 7);
|
||||
camera->pos[2] = (f32) (tempData->pos[2] - 20);
|
||||
camera->lookAt[0] = gPlayerOneCopy->pos[0];
|
||||
|
||||
camera->lookAt[1] = gPlayerOneCopy->pos[1];
|
||||
camera->lookAt[2] = gPlayerOneCopy->pos[2];
|
||||
check_bounding_collision(&camera->collision, 20.0f, camera->pos[0], camera->pos[1], camera->pos[2]);
|
||||
|
||||
+86
-55
@@ -1256,7 +1256,7 @@ void func_80091EE4(void) {
|
||||
tmp = func_800B5F30();
|
||||
|
||||
if ((D_8018EDFB != 0) && (tmp == 0)) {
|
||||
temp_s2 = (gCupSelection * 4) + gCupCourseSelection;
|
||||
temp_s2 = (gCupSelection * 4) + gCourseIndexInCup;
|
||||
func_800B6708();
|
||||
|
||||
for (temp_s0 = 0; temp_s0 < 2; ++temp_s0) {
|
||||
@@ -2547,17 +2547,30 @@ Gfx* func_800959F8(Gfx* displayListHead, Vtx* arg1) {
|
||||
} else {
|
||||
index = ((gTextColor * 2) + ((s32) gGlobalTimer % 2)) - 4;
|
||||
}
|
||||
if (arg1 == &a_D_02007BB8[0]) {
|
||||
#ifdef AVOID_UB
|
||||
if (arg1 == D_02007BB8) {
|
||||
gSPDisplayList(displayListHead++, D_800E84CC[index]);
|
||||
} else if (arg1 == &a_D_02007BB8[18]) {
|
||||
} else if (arg1 == &D_02007BB8[18]) {
|
||||
gSPDisplayList(displayListHead++, D_800E84EC[index]);
|
||||
} else if (arg1 == &a_D_02007BB8[36]) {
|
||||
} else if (arg1 == &D_02007BB8[36]) {
|
||||
gSPDisplayList(displayListHead++, D_800E850C[index]);
|
||||
}
|
||||
#else
|
||||
if (arg1 == D_02007BB8) {
|
||||
gSPDisplayList(displayListHead++, D_800E84CC[index]);
|
||||
} else if (arg1 == D_02007CD8) {
|
||||
gSPDisplayList(displayListHead++, D_800E84EC[index]);
|
||||
} else if (arg1 == D_02007DF8) {
|
||||
gSPDisplayList(displayListHead++, D_800E850C[index]);
|
||||
}
|
||||
#endif
|
||||
|
||||
return displayListHead;
|
||||
}
|
||||
|
||||
#ifdef AVOID_UB
|
||||
#define MTX_TYPE Mtx
|
||||
#else
|
||||
typedef struct {
|
||||
u16 i[4][4];
|
||||
u16 f[4][4];
|
||||
@@ -2574,28 +2587,42 @@ typedef union {
|
||||
s32 w;
|
||||
} TheWhyUnion;
|
||||
|
||||
#define MTX_TYPE Mtx2
|
||||
#endif
|
||||
|
||||
// Why... Why... Why... This function is so bad it's not going in the header.
|
||||
void func_80095AE0(Mtx2* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
|
||||
void func_80095AE0(MTX_TYPE* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
|
||||
#ifdef AVOID_UB
|
||||
// Use Mat4 array to set matrix values using guMtxF2L. This helps little-endian systems.
|
||||
Mat4 src;
|
||||
src[0][0] = arg3;
|
||||
src[0][1] = 0.0f;
|
||||
src[0][2] = 0.0f;
|
||||
src[0][3] = 0.0f;
|
||||
src[1][0] = 0.0f;
|
||||
src[1][1] = arg4;
|
||||
src[1][2] = 0.0f;
|
||||
src[1][3] = 0.0f;
|
||||
src[2][0] = 0.0f;
|
||||
src[2][1] = 0.0f;
|
||||
src[2][2] = 1.0f;
|
||||
src[2][3] = 0.0f;
|
||||
src[3][0] = arg1;
|
||||
src[3][1] = arg2;
|
||||
src[3][2] = 0.0f;
|
||||
src[3][3] = 1.0f;
|
||||
guMtxF2L(src, arg0);
|
||||
#else
|
||||
TheWhyUnion sp14;
|
||||
TheWhyUnion sp10;
|
||||
TheWhyUnion spC;
|
||||
TheWhyUnion sp8;
|
||||
s32 i;
|
||||
|
||||
#ifdef AVOID_UB
|
||||
size_t row;
|
||||
size_t col;
|
||||
for (row = 0; row < 4; row++) {
|
||||
for (col = 0; col < 4; col++) {
|
||||
arg0->m[row][col] = 0;
|
||||
}
|
||||
}
|
||||
#else
|
||||
// clang-format off
|
||||
// should be inline
|
||||
for(i = 0; i < 16; i++) { arg0->m[0][i] = 0; }
|
||||
// clang-format on
|
||||
#endif
|
||||
|
||||
sp14.w = arg3 * 65536.0f;
|
||||
sp10.w = arg4 * 65536.0f;
|
||||
@@ -2611,8 +2638,11 @@ void func_80095AE0(Mtx2* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
|
||||
arg0->u.f[1][1] = sp10.s[1];
|
||||
arg0->u.f[3][0] = spC.s[1];
|
||||
arg0->u.f[3][1] = sp8.s[1];
|
||||
#endif
|
||||
}
|
||||
|
||||
#undef MTX_TYPE
|
||||
|
||||
Gfx* func_80095BD0(Gfx* displayListHead, u8* arg1, f32 arg2, f32 arg3, u32 arg4, u32 arg5, f32 arg6, f32 arg7) {
|
||||
Vtx* var_a1;
|
||||
Mtx* sp28;
|
||||
@@ -3342,11 +3372,6 @@ Gfx* draw_box(Gfx* displayListHead, s32 ulx, s32 uly, s32 lrx, s32 lry, u32 red,
|
||||
return displayListHead;
|
||||
}
|
||||
|
||||
//! @todo Need to call this somewhere on func_800A2D1C
|
||||
Gfx* draw_box_fill_wide_wrap(Gfx* displayListHead, s32 ulx, s32 uly, s32 lrx, s32 lry) {
|
||||
return draw_box_fill_wide(displayListHead, ulx, uly, lrx, lry, 0, 0, 0, 0xFF);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -3439,16 +3464,22 @@ void func_80099184(MkTexture* arg0) {
|
||||
if (var_a1_2 % 8) {
|
||||
var_a1_2 = ((var_a1_2 / 8) * 8) + 8;
|
||||
}
|
||||
// dma_copy_base_729a30(var_s1->textureData, var_a1_2, D_8018D9B4);
|
||||
// mio0decode(D_8018D9B4, &D_8018D9B0[gD_8018E118TotalSize]);
|
||||
// size_t texSize = ResourceGetTexSizeByName(var_s1->textureData);
|
||||
// memcpy(&D_8018D9B0[gD_8018E118TotalSize], var_s1->textureData, texSize);
|
||||
// mio0decode(D_8018D9B4, &D_8018D9B0[gD_8018E118TotalSize]);
|
||||
// size_t texSize = ResourceGetTexSizeByName(var_s1->textureData);
|
||||
// memcpy(&D_8018D9B0[gD_8018E118TotalSize], var_s1->textureData, texSize);
|
||||
#ifdef TARGET_N64
|
||||
dma_copy_base_729a30(var_s1->textureData, var_a1_2, D_8018D9B4);
|
||||
mio0decode(D_8018D9B4, (u8*) &D_8018D9B0[gD_8018E118TotalSize]);
|
||||
#else
|
||||
strcpy(&D_8018D9B0[gD_8018E118TotalSize], var_s1->textureData);
|
||||
#endif
|
||||
} else {
|
||||
// dma_copy_base_729a30(var_s1->textureData, (var_s1->height * var_s1->width) * 2,
|
||||
// &D_8018D9B0[gD_8018E118TotalSize]); memcpy(&D_8018D9B0[gD_8018E118TotalSize], var_s1->textureData,
|
||||
// var_s1->width * var_s1->height*2);
|
||||
#ifdef TARGET_N64
|
||||
dma_copy_base_729a30(var_s1->textureData, var_s1->height * var_s1->width * 2,
|
||||
&D_8018D9B0[gD_8018E118TotalSize]);
|
||||
#else
|
||||
strcpy(&D_8018D9B0[gD_8018E118TotalSize], var_s1->textureData);
|
||||
#endif
|
||||
}
|
||||
thing[gNumD_8018E118Entries].textureData = var_s1->textureData;
|
||||
thing[gNumD_8018E118Entries].offset = gD_8018E118TotalSize;
|
||||
@@ -4986,7 +5017,7 @@ void func_8009CE64(s32 arg0) {
|
||||
}
|
||||
gCupSelection = gCupSelectionByCourseId[gCurrentCourseId];
|
||||
D_800DC540 = (s32) gCupSelection;
|
||||
gCupCourseSelection = (s8) gPerCupIndexByCourseId[gCurrentCourseId];
|
||||
gCourseIndexInCup = (s8) gPerCupIndexByCourseId[gCurrentCourseId];
|
||||
break;
|
||||
case 3: /* switch 3 */
|
||||
switch (gMenuSelection) {
|
||||
@@ -5068,7 +5099,7 @@ void func_8009CE64(s32 arg0) {
|
||||
}
|
||||
gCupSelection = gCupSelectionByCourseId[gCurrentCourseId];
|
||||
D_800DC540 = gCupSelection;
|
||||
gCupCourseSelection = gPerCupIndexByCourseId[gCurrentCourseId];
|
||||
gCourseIndexInCup = gPerCupIndexByCourseId[gCurrentCourseId];
|
||||
switch (gDebugGotoScene) { /* switch 6; irregular */
|
||||
case 1: /* switch 6 */
|
||||
break;
|
||||
@@ -5779,7 +5810,7 @@ void add_8018D9E0_entry(s32 type, s32 column, s32 row, s8 priority) {
|
||||
}
|
||||
}
|
||||
if ((var_ra->unk1C == 0) || (var_ra->unk20 != 0)) {
|
||||
func_800B559C((gCupSelection * 4) + gCupCourseSelection);
|
||||
func_800B559C((gCupSelection * 4) + gCourseIndexInCup);
|
||||
}
|
||||
break;
|
||||
case 0xE6:
|
||||
@@ -6060,7 +6091,7 @@ void func_8009F5E0(struct_8018D9E0_entry* arg0) {
|
||||
case 0x18: /* switch 6 */
|
||||
case 0x19: /* switch 6 */
|
||||
var_v1 = D_800E86B0[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
var_a1 = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
var_a1 = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
switch (arg0->type) { /* switch 5 */
|
||||
case 0x12: /* switch 5 */
|
||||
case 0x13: /* switch 5 */
|
||||
@@ -7200,7 +7231,7 @@ void func_800A2EB8(struct_8018D9E0_entry* arg0) {
|
||||
func_80093324(arg0->column + 0x1E, arg0->row + 0x19, "results", 0, 1.0f, 1.0f);
|
||||
set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_2);
|
||||
func_80093324(arg0->column + 0x2C, arg0->row + 0x28, "round", 0, 0.7f, 0.7f);
|
||||
convert_number_to_ascii(gCupCourseSelection + 1, sp68);
|
||||
convert_number_to_ascii(gCourseIndexInCup + 1, sp68);
|
||||
func_80093324(arg0->column + 0x57, arg0->row + 0x28, &sp68[1], 0, 0.7f, 0.7f);
|
||||
for (var_s2 = 0; var_s2 < 4; var_s2++) {
|
||||
if (gGPCurrentRacePlayerIdByRank[var_s2] < gPlayerCount) {
|
||||
@@ -7279,7 +7310,7 @@ void func_800A34A8(struct_8018D9E0_entry* arg0) {
|
||||
func_80093324(arg0->column + 0x19, 0x19 - arg0->row, "driver's points", 0, 0.8f, 0.8f);
|
||||
set_text_color(5);
|
||||
func_80093324(arg0->column + 0x36, 0x28 - arg0->row, "round", 0, 0.7f, 0.7f);
|
||||
convert_number_to_ascii(gCupCourseSelection + 1, sp78);
|
||||
convert_number_to_ascii(gCourseIndexInCup + 1, sp78);
|
||||
func_80093324(arg0->column + 0x61, (0x28 & 0xFFFFFFFF) - arg0->row, &sp78[1], 0, 0.7f, 0.7f);
|
||||
for (rank = 0; rank < 4; rank++) {
|
||||
test = arg0->cursor;
|
||||
@@ -7412,8 +7443,8 @@ void func_800A3C84(struct_8018D9E0_entry* arg0) {
|
||||
s32 rowOffset;
|
||||
|
||||
set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_1);
|
||||
draw_text(arg0->column + 0x43, arg0->row + 0x19,
|
||||
gCourseNamesDup[gCupCourseOrder[gCupSelection][gCupCourseSelection]], 0, 0.6f, 0.6f);
|
||||
draw_text(arg0->column + 0x43, arg0->row + 0x19, gCourseNamesDup[gCupCourseOrder[gCupSelection][gCourseIndexInCup]],
|
||||
0, 0.6f, 0.6f);
|
||||
set_text_color(TEXT_YELLOW);
|
||||
draw_text(arg0->column + 0x46, arg0->row + 0x28, D_800E7730, 0, 0.75f, 0.75f);
|
||||
for (recordType = 0, rowOffset = 0; recordType < TIME_TRIAL_3LAP_RECORD_5; recordType += 1, rowOffset += 0xF) {
|
||||
@@ -7452,8 +7483,8 @@ void func_800A3E60(struct_8018D9E0_entry* arg0) {
|
||||
}
|
||||
|
||||
set_text_color(4);
|
||||
draw_text(arg0->column + 0x55, 0x19 - arg0->row,
|
||||
gCourseNamesDup[gCupCourseOrder[gCupSelection][gCupCourseSelection]], 0, 0.6f, 0.6f);
|
||||
draw_text(arg0->column + 0x55, 0x19 - arg0->row, gCourseNamesDup[gCupCourseOrder[gCupSelection][gCourseIndexInCup]],
|
||||
0, 0.6f, 0.6f);
|
||||
set_text_color(3);
|
||||
draw_text(arg0->column + 0x55, 0x28 - arg0->row, D_800E7730, 0, 0.75f, 0.75f);
|
||||
for (var_s1 = 0; var_s1 < 4; var_s1++) {
|
||||
@@ -7750,7 +7781,7 @@ void render_pause_menu_time_trials(struct_8018D9E0_entry* arg0) {
|
||||
|
||||
gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x0000013F, 0x000000EF, 0, 0, 0, 0x0000008C);
|
||||
set_text_color(TEXT_YELLOW);
|
||||
draw_text(0x000000A0, 0x00000050, gCourseNamesDup[gCupCourseOrder[gCupSelection][gCupCourseSelection]], 0, 1.0f,
|
||||
draw_text(0x000000A0, 0x00000050, gCourseNamesDup[gCupCourseOrder[gCupSelection][gCourseIndexInCup]], 0, 1.0f,
|
||||
1.0f);
|
||||
set_text_color(TEXT_RED);
|
||||
draw_text(0x0000009D, 0x00000060, D_800E7728[0], 0, 0.8f, 0.8f);
|
||||
@@ -7838,7 +7869,7 @@ void render_pause_grand_prix(struct_8018D9E0_entry* arg0) {
|
||||
set_text_color(TEXT_YELLOW);
|
||||
draw_text(160 + temp_s0, temp_s3->row - 50, D_800E76CC[gCCSelection], 0, 1.0f, 1.0f);
|
||||
set_text_color(TEXT_YELLOW);
|
||||
draw_text(160, temp_s3->row - 30, gCourseNamesDup[gCupCourseOrder[gCupSelection][gCupCourseSelection]], 0, 1.0f,
|
||||
draw_text(160, temp_s3->row - 30, gCourseNamesDup[gCupCourseOrder[gCupSelection][gCourseIndexInCup]], 0, 1.0f,
|
||||
1.0f);
|
||||
for (var_s0 = 0; var_s0 < 2; var_s0++) {
|
||||
text_rainbow_effect(arg0->cursor - 31, var_s0, TEXT_YELLOW);
|
||||
@@ -7953,7 +7984,7 @@ void func_800A5738(struct_8018D9E0_entry* arg0) {
|
||||
gDisplayListHead = draw_box(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, gCourseNamesDup[gCupCourseOrder[gCupSelection][gCupCourseSelection]], 0,
|
||||
func_80093754(0x000000A0, 0x00000050, gCourseNamesDup[gCupCourseOrder[gCupSelection][gCourseIndexInCup]], 0,
|
||||
1.0f, 1.0f);
|
||||
switch (arg0->cursor) { /* switch 1 */
|
||||
case 1: /* switch 1 */
|
||||
@@ -8996,7 +9027,7 @@ void func_800A8270(s32 arg0, struct_8018D9E0_entry* arg1) {
|
||||
} else {
|
||||
gDisplayListHead = func_80098FC8(gDisplayListHead, var_s3, var_s0, var_s4, var_s0 + 0x35);
|
||||
}
|
||||
for (var_s0 += 0x41, var_s2 = 0; var_s2 <= D_800F2B60[0][arg0]; var_s2++, var_s0 += 0x12) {
|
||||
for (var_s0 += 0x41, var_s2 = 0; var_s2 <= gPlayerModeSelection[arg0]; var_s2++, var_s0 += 0x12) {
|
||||
if ((var_s2 == D_800E86AC[arg0]) && ((arg0 + 1) == gPlayerCount) && (gMainMenuSelectionDepth >= 4)) {
|
||||
if (gMainMenuSelectionDepth == GAME_MODE_SELECTION) {
|
||||
gDisplayListHead =
|
||||
@@ -9126,8 +9157,8 @@ void func_800A8A98(struct_8018D9E0_entry* arg0) {
|
||||
gDPPipeSync(gDisplayListHead++);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_DECALRGBA, G_CC_DECALRGBA);
|
||||
for (someIndex = 0; someIndex < 4; someIndex++) {
|
||||
if ((someIndex == gCupCourseSelection) && (D_8018EDEC >= 2) && (gModeSelection != GRAND_PRIX)) {
|
||||
for (someIndex = 0; someIndex < NUM_COURSES_PER_CUP; someIndex++) {
|
||||
if ((someIndex == gCourseIndexInCup) && (D_8018EDEC >= 2) && (gModeSelection != GRAND_PRIX)) {
|
||||
if ((D_8018EDEC == 2) || (D_8018EDEC == 4)) {
|
||||
gDisplayListHead = draw_flash_select_case_slow(
|
||||
gDisplayListHead, D_800E7208[someIndex][0].column + temp_s2, D_800E7208[someIndex][0].row + temp_s3,
|
||||
@@ -9213,7 +9244,7 @@ void func_800A8F48(UNUSED struct_8018D9E0_entry* arg0) {
|
||||
break;
|
||||
case 2:
|
||||
default:
|
||||
if (func_800B639C((gCupSelection * 4) + gCupCourseSelection) >= 0) {
|
||||
if (func_800B639C((gCupSelection * 4) + gCourseIndexInCup) >= 0) {
|
||||
gDisplayListHead = func_80098FC8(gDisplayListHead, 0x00000057, 0x00000070, 0x00000096, 0x00000081);
|
||||
gDisplayListHead = func_8009BA74(gDisplayListHead, D_02004A0C, 0x00000057, 0x00000070);
|
||||
}
|
||||
@@ -9673,7 +9704,7 @@ void func_800A9E58(struct_8018D9E0_entry* arg0) {
|
||||
break;
|
||||
}
|
||||
|
||||
temp_a1 = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
temp_a1 = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
switch (arg0->cursor) { /* switch 5; irregular */
|
||||
case 0: /* switch 5 */
|
||||
if ((temp_a1 != sp20) && (temp_a1 != sp1C)) {
|
||||
@@ -10403,7 +10434,7 @@ void func_800AB314(struct_8018D9E0_entry* arg0) {
|
||||
arg0->cursor = 0;
|
||||
arg0->unk20 = 0;
|
||||
for (var_a1 = 0; var_a1 < 4; var_a1++) {
|
||||
if (gCupCourseSelection == var_a1) {
|
||||
if (gCourseIndexInCup == var_a1) {
|
||||
sp24[var_a1]->visible = one;
|
||||
if (arg0->unk1C != var_a1) {
|
||||
arg0->unk1C = var_a1;
|
||||
@@ -10906,7 +10937,7 @@ void func_800AC458(struct_8018D9E0_entry* arg0) {
|
||||
if (arg0->unk1C <= 0) {
|
||||
arg0->cursor = 0x0000000A;
|
||||
arg0->unk1C = 0;
|
||||
if (gCupCourseSelection == 3) {
|
||||
if (gCourseIndexInCup == 3) {
|
||||
for (var_a1 = 0; var_a1 < 8; var_a1++) {
|
||||
if (D_80164478[gCharacterIdByGPOverallRank[var_a1]] < gPlayerCount) {
|
||||
func_800B536C(var_a1);
|
||||
@@ -11305,7 +11336,7 @@ void func_800AD2E8(struct_8018D9E0_entry* arg0) {
|
||||
break;
|
||||
case 0: /* switch 4 */
|
||||
func_800B6708();
|
||||
arg0->cursor = func_800B6348((gCupSelection * 4) + gCupCourseSelection) + 0x11;
|
||||
arg0->cursor = func_800B6348((gCupSelection * 4) + gCourseIndexInCup) + 0x11;
|
||||
var_v1 = 1;
|
||||
play_sound2(SOUND_MENU_SELECT);
|
||||
break;
|
||||
@@ -11352,7 +11383,7 @@ void func_800AD2E8(struct_8018D9E0_entry* arg0) {
|
||||
if (osPfsFindFile(&gControllerPak1FileHandle, gCompanyCode, gGameCode, (u8*) gGameName,
|
||||
(u8*) gExtCode, &gControllerPak1FileNote) == 0) {
|
||||
func_800B6708();
|
||||
arg0->cursor = func_800B6348((gCupSelection * 4) + gCupCourseSelection) + 0x11;
|
||||
arg0->cursor = func_800B6348((gCupSelection * 4) + gCourseIndexInCup) + 0x11;
|
||||
play_sound2(SOUND_MENU_SELECT);
|
||||
return;
|
||||
}
|
||||
@@ -11402,7 +11433,7 @@ void func_800AD2E8(struct_8018D9E0_entry* arg0) {
|
||||
case 17: /* switch 1 */
|
||||
case 18: /* switch 1 */
|
||||
arg0->unk20 = arg0->cursor - 0x11;
|
||||
if (func_800B639C((gCupSelection * 4) + gCupCourseSelection) != arg0->unk20) {
|
||||
if (func_800B639C((gCupSelection * 4) + gCourseIndexInCup) != arg0->unk20) {
|
||||
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) {
|
||||
if (arg0->cursor >= 0x12) {
|
||||
arg0->cursor--;
|
||||
@@ -11709,7 +11740,7 @@ void func_800AE218(struct_8018D9E0_entry* arg0) {
|
||||
break;
|
||||
case PFS_NO_ERROR: /* switch 3 */
|
||||
func_800B6708();
|
||||
arg0->cursor = func_800B6348((gCupSelection * 4) + gCupCourseSelection) + 0x1E;
|
||||
arg0->cursor = func_800B6348((gCupSelection * 4) + gCourseIndexInCup) + 0x1E;
|
||||
var_v1 = 1;
|
||||
break;
|
||||
case PFS_ERR_NEW_PACK: /* switch 3 */
|
||||
@@ -11758,7 +11789,7 @@ void func_800AE218(struct_8018D9E0_entry* arg0) {
|
||||
if (osPfsFindFile(&gControllerPak1FileHandle, gCompanyCode, gGameCode, (u8*) gGameName,
|
||||
(u8*) gExtCode, &gControllerPak1FileNote) == 0) {
|
||||
func_800B6708();
|
||||
arg0->cursor = func_800B6348((gCupSelection * 4) + gCupCourseSelection) + 0x1E;
|
||||
arg0->cursor = func_800B6348((gCupSelection * 4) + gCourseIndexInCup) + 0x1E;
|
||||
play_sound2(SOUND_MENU_SELECT);
|
||||
return;
|
||||
}
|
||||
@@ -11804,7 +11835,7 @@ void func_800AE218(struct_8018D9E0_entry* arg0) {
|
||||
case 30: /* switch 1 */
|
||||
case 31: /* switch 1 */
|
||||
arg0->unk20 = (u32) arg0->cursor - 0x1E;
|
||||
if (func_800B639C((gCupSelection * 4) + gCupCourseSelection) != arg0->unk20) {
|
||||
if (func_800B639C((gCupSelection * 4) + gCourseIndexInCup) != arg0->unk20) {
|
||||
if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) {
|
||||
if (arg0->cursor >= 0x1F) {
|
||||
arg0->cursor--;
|
||||
@@ -12127,14 +12158,14 @@ void func_800AF270(struct_8018D9E0_entry* arg0) {
|
||||
if (D_802874D8.unk1D >= 3) {
|
||||
arg0->cursor = 4;
|
||||
func_800CA0B8();
|
||||
func_800C90F4(0U, (sp30 * 0x10) + 0x29008003);
|
||||
func_800C90F4(0U, (sp30 * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x03));
|
||||
func_800CA0A0();
|
||||
} else {
|
||||
arg0->cursor = 3;
|
||||
func_8009A640(arg0->D_8018DEE0_index, 0, sp30,
|
||||
segmented_to_virtual_dupe_2(gCharacterCelebrateAnimation[temp_v0]));
|
||||
func_800CA0B8();
|
||||
func_800C90F4(0U, (sp30 * 0x10) + 0x29008007);
|
||||
func_800C90F4(0U, (sp30 * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x07));
|
||||
func_800CA0A0();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -400,6 +400,7 @@ void func_800AF740(struct_8018D9E0_entry*);
|
||||
|
||||
// This really, really shouldn't be in this header file, but I don't know where else to put it
|
||||
void rmonPrintf(const char*, ...);
|
||||
void tkmk00decode(u8*, u8*, u8*, s32);
|
||||
|
||||
/* File specific defines */
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "ceremony_and_credits.h"
|
||||
#include "main.h"
|
||||
|
||||
void setup_camera_podium_ceremony(void) {
|
||||
void update_camera_podium_ceremony(void) {
|
||||
Camera* camera;
|
||||
f32 x_dist;
|
||||
f32 y_dist;
|
||||
@@ -26,7 +26,7 @@ void setup_camera_podium_ceremony(void) {
|
||||
}
|
||||
|
||||
// GP podium ceremony camera settings?
|
||||
void func_802816B8(void) {
|
||||
void init_camera_podium_ceremony(void) {
|
||||
cameras[0].pos[0] = -3133.0f;
|
||||
cameras[0].pos[1] = 19.0f;
|
||||
cameras[0].pos[2] = -467.0f;
|
||||
|
||||
+325
-254
File diff suppressed because it is too large
Load Diff
@@ -48,7 +48,7 @@ struct credits_data_1FA0 {
|
||||
*
|
||||
* See the sCutsceneVars[] array in camera.c for more details.
|
||||
*/
|
||||
struct CinematicCamera {
|
||||
typedef struct {
|
||||
/* 0x00 */ Vec3f pos;
|
||||
/* 0x0C */ Vec3f lookAt;
|
||||
/* 0x18 */ f32 unk18;
|
||||
@@ -67,7 +67,7 @@ struct CinematicCamera {
|
||||
/* 0x68 */ f32 unk68;
|
||||
/* 0x6C */ s16 unk6C;
|
||||
/* 0x6E */ s16 unk6E;
|
||||
}; // size = 0x70
|
||||
} CinematicCamera; // size = 0x70
|
||||
|
||||
struct struct_80282C40 {
|
||||
s8 unk0;
|
||||
@@ -99,11 +99,14 @@ struct CutsceneSplinePoint {
|
||||
};
|
||||
|
||||
struct Cutscene {
|
||||
/* 0x0 */ void (*shot)(struct CinematicCamera*);
|
||||
/* 0x0 */ void (*shot)(CinematicCamera*);
|
||||
/* 0x4 */ s16 duration;
|
||||
/* 0x6 */ // s16 pad;
|
||||
}; /* size = 0x8 */
|
||||
|
||||
typedef void (*CameraEvent)(CinematicCamera* c);
|
||||
typedef CameraEvent CutsceneShot;
|
||||
|
||||
/* Function Prototypes */
|
||||
|
||||
void init_cinematic_camera(void);
|
||||
@@ -116,88 +119,88 @@ void vec3f_copy_return_dupe(Vec3f, Vec3f);
|
||||
void vec3s_copy_dupe(Vec3s, Vec3s);
|
||||
void func_80282040(void);
|
||||
void func_80282048(void);
|
||||
void func_80282050(Vec3f, Vec3f, s16);
|
||||
void func_802820F8(Vec3f, Vec3f, s16);
|
||||
void rotate_y_vec3f(Vec3f, Vec3f, s16);
|
||||
void rotate_x_vec3f(Vec3f, Vec3f, s16);
|
||||
s32 f32_lerp(f32*, f32, f32);
|
||||
s32 func_80282200(Vec3s, s16, s16);
|
||||
s32 set_transition_colour_fade_alpha_ending(f32*, f32, f32);
|
||||
s32 func_80282364(s16*, s16, s16);
|
||||
bool ease_out_transition(s16*, s16, s16);
|
||||
bool adjust_f32_value_transition(f32*, f32, f32);
|
||||
bool adjust_s16_value_transition(s16*, s16, s16);
|
||||
void reset_spline(void);
|
||||
void func_80282434(struct CinematicCamera*);
|
||||
void func_80282454(Vec3f, Vec3f, f32*, s16*, s16*);
|
||||
void func_80282504(Vec3f, Vec3f, f32, s16, s16);
|
||||
void func_802825C8(Vec3f, Vec3f, Vec3f, Vec3s);
|
||||
void func_80282700(f32, Vec3f, f32*, f32[], f32[], f32[], f32[]);
|
||||
void reset_spline_wrap(CinematicCamera*);
|
||||
void calculate_distance_angle_y_and_angle_y_to_xz(Vec3f, Vec3f, f32*, s16*, s16*);
|
||||
void apply_distance_angle_y_and_angle_y_to_xz(Vec3f, Vec3f, f32, s16, s16);
|
||||
void aborting_cinematic_function(Vec3f, Vec3f, Vec3f, Vec3s);
|
||||
void evaluate_cubic_spline(f32, Vec3f, f32*, f32[], f32[], f32[], f32[]);
|
||||
s32 move_point_along_spline(Vec3f, f32*, struct struct_80283430[], s16*, f32*);
|
||||
void func_80282BE4(struct struct_80283430*, s8, u8, s8, Vec3s, s32);
|
||||
void func_80282C40(struct struct_80283430*, struct struct_80282C40*, s32);
|
||||
s32 func_80282D90(struct CinematicCamera*, struct struct_80286A04*, struct struct_80286A04*, s32);
|
||||
void func_80282E58(struct CinematicCamera*, struct struct_80282C40*, s32);
|
||||
void func_80282EAC(s32, struct CinematicCamera*, s16, s16, s16);
|
||||
s32 move_cinematic_camera_along_spline(CinematicCamera*, struct struct_80286A04*, struct struct_80286A04*, s32);
|
||||
void func_80282E58(CinematicCamera*, struct struct_80282C40*, s32);
|
||||
void func_80282EAC(s32, CinematicCamera*, s16, s16, s16);
|
||||
void func_80282F00(s16*, s16);
|
||||
void func_80282F44(s32, struct CinematicCamera*, Camera*);
|
||||
void func_802830B4(struct CinematicCamera*, s16, s16, s16);
|
||||
void func_80283100(struct CinematicCamera*, f32*);
|
||||
void func_80282F44(s32, CinematicCamera*, Camera*);
|
||||
void func_802830B4(CinematicCamera*, s16, s16, s16);
|
||||
void func_80283100(CinematicCamera*, f32*);
|
||||
void func_80283240(s16);
|
||||
s32 cutscene_event(CameraEvent event, struct CinematicCamera*, s16, s16);
|
||||
s32 cutscene_event(CameraEvent event, CinematicCamera*, s16, s16);
|
||||
s32 func_80283330(s32);
|
||||
s32 func_8028336C(struct CinematicCamera*, Camera*);
|
||||
s32 func_80283428(void);
|
||||
void func_80283968(struct CinematicCamera*);
|
||||
void func_80283994(struct CinematicCamera*);
|
||||
void func_802839B4(struct CinematicCamera*);
|
||||
void func_802839CC(struct CinematicCamera*);
|
||||
void func_802839E0(struct CinematicCamera*);
|
||||
void play_sound_welcome(struct CinematicCamera*);
|
||||
void func_80283A34(struct CinematicCamera*);
|
||||
void play_sound_congratulation(struct CinematicCamera*);
|
||||
void play_sound_balloon_pop(struct CinematicCamera*);
|
||||
void play_sound_fish(struct CinematicCamera*);
|
||||
void play_sound_fish_2(struct CinematicCamera*);
|
||||
void play_sound_shoot_trophy(struct CinematicCamera*);
|
||||
void play_sound_podium(struct CinematicCamera*);
|
||||
void play_sound_trophy(struct CinematicCamera*);
|
||||
void func_80283A54(struct CinematicCamera*);
|
||||
void func_80283A7C(struct CinematicCamera*);
|
||||
void func_80283B6C(struct CinematicCamera*);
|
||||
void func_80283BA4(struct CinematicCamera*);
|
||||
void func_80283BF0(struct CinematicCamera*);
|
||||
void func_80283C14(struct CinematicCamera*);
|
||||
void func_80283C38(struct CinematicCamera*);
|
||||
void func_80283C58(struct CinematicCamera*);
|
||||
void func_80283C78(struct CinematicCamera*);
|
||||
void func_80283CA8(struct CinematicCamera*);
|
||||
void func_80283CD0(struct CinematicCamera*);
|
||||
void play_sound_farewell(struct CinematicCamera*);
|
||||
void func_80283D2C(struct CinematicCamera*);
|
||||
void func_80283EA0(struct CinematicCamera*);
|
||||
void func_80283ED0(struct CinematicCamera*);
|
||||
void func_80283EF8(struct CinematicCamera*);
|
||||
void func_80283F6C(struct CinematicCamera*);
|
||||
void func_80283FCC(struct CinematicCamera*);
|
||||
void func_80283FF4(struct CinematicCamera*);
|
||||
void func_80284068(struct CinematicCamera*);
|
||||
void func_802840C8(struct CinematicCamera*);
|
||||
void func_80284154(struct CinematicCamera*);
|
||||
void func_80284184(struct CinematicCamera*);
|
||||
void func_802841E8(struct CinematicCamera*);
|
||||
void func_8028422C(struct CinematicCamera*);
|
||||
void func_802842A8(struct CinematicCamera*);
|
||||
void func_802842D8(struct CinematicCamera*);
|
||||
void func_80284308(struct CinematicCamera*);
|
||||
void func_80284418(struct CinematicCamera*);
|
||||
void func_80284494(struct CinematicCamera*);
|
||||
void func_802844FC(struct CinematicCamera*);
|
||||
void func_8028454C(struct CinematicCamera*);
|
||||
void func_802845EC(struct CinematicCamera*);
|
||||
void func_8028461C(struct CinematicCamera*);
|
||||
void func_80284648(struct CinematicCamera*);
|
||||
s32 func_8028336C(CinematicCamera*, Camera*);
|
||||
s32 cinematic_stub(void);
|
||||
void wrap_func_8028100C(CinematicCamera*);
|
||||
void wrap_func_80280FFC(CinematicCamera*);
|
||||
void animation_apears_sliding_borders(CinematicCamera*);
|
||||
void animation_disapears_sliding_borders(CinematicCamera*);
|
||||
void wrap_func_80092C80(CinematicCamera*);
|
||||
void play_sound_welcome(CinematicCamera*);
|
||||
void wrap_func_800CA0CC(CinematicCamera*);
|
||||
void play_sound_congratulation(CinematicCamera*);
|
||||
void play_sound_balloon_pop(CinematicCamera*);
|
||||
void play_sound_fish(CinematicCamera*);
|
||||
void play_sound_fish_2(CinematicCamera*);
|
||||
void play_sound_shoot_trophy(CinematicCamera*);
|
||||
void play_sound_podium(CinematicCamera*);
|
||||
void play_sound_trophy(CinematicCamera*);
|
||||
void func_80283A54(CinematicCamera*);
|
||||
void func_80283A7C(CinematicCamera*);
|
||||
void func_80283B6C(CinematicCamera*);
|
||||
void func_80283BA4(CinematicCamera*);
|
||||
void func_80283BF0(CinematicCamera*);
|
||||
void func_80283C14(CinematicCamera*);
|
||||
void wrap_func_800CB134(CinematicCamera*);
|
||||
void wrap_func_800CB14C(CinematicCamera*);
|
||||
void func_80283C78(CinematicCamera*);
|
||||
void func_80283CA8(CinematicCamera*);
|
||||
void func_80283CD0(CinematicCamera*);
|
||||
void play_sound_farewell(CinematicCamera*);
|
||||
void func_80283D2C(CinematicCamera*);
|
||||
void func_80283EA0(CinematicCamera*);
|
||||
void copy_player_two_in_camera(CinematicCamera*);
|
||||
void lerp_player_two_in_camera(CinematicCamera*);
|
||||
void func_80283F6C(CinematicCamera*);
|
||||
void copy_player_three_in_camera(CinematicCamera*);
|
||||
void lerp_player_three_in_camera(CinematicCamera*);
|
||||
void func_80284068(CinematicCamera*);
|
||||
void func_802840C8(CinematicCamera*);
|
||||
void func_80284154(CinematicCamera*);
|
||||
void func_80284184(CinematicCamera*);
|
||||
void func_802841E8(CinematicCamera*);
|
||||
void func_8028422C(CinematicCamera*);
|
||||
void func_802842A8(CinematicCamera*);
|
||||
void func_802842D8(CinematicCamera*);
|
||||
void func_80284308(CinematicCamera*);
|
||||
void func_80284418(CinematicCamera*);
|
||||
void func_80284494(CinematicCamera*);
|
||||
void func_802844FC(CinematicCamera*);
|
||||
void func_8028454C(CinematicCamera*);
|
||||
void func_802845EC(CinematicCamera*);
|
||||
void func_8028461C(CinematicCamera*);
|
||||
void func_80284648(CinematicCamera*);
|
||||
void func_802846AC(void);
|
||||
void func_802846B4(struct CinematicCamera*);
|
||||
void func_802846E4(struct CinematicCamera*);
|
||||
void func_802847CC(struct CinematicCamera*);
|
||||
void play_cutscene(struct CinematicCamera*);
|
||||
void transition_sliding_borders(void);
|
||||
void func_802846B4(CinematicCamera*);
|
||||
void func_802846E4(CinematicCamera*);
|
||||
void func_802847CC(CinematicCamera*);
|
||||
void play_cutscene(CinematicCamera*);
|
||||
void ceremony_transition_sliding_borders(void);
|
||||
|
||||
/* This is where I'd put my static data, if I had any */
|
||||
|
||||
@@ -205,9 +208,9 @@ extern s32 D_80283FCC;
|
||||
extern s32 D_80283FF4;
|
||||
extern f32 D_802856B0;
|
||||
extern f32 D_802856B4;
|
||||
extern f32 D_802856B8;
|
||||
extern f32 gOrderedSizeSlidingBorders;
|
||||
extern f32 D_802856BC;
|
||||
extern f32 D_802856C0;
|
||||
extern f32 gSizeSlidingBorders;
|
||||
extern s32 D_802856C4;
|
||||
extern s32 D_802856C8[]; // padding?
|
||||
extern s16 sCutsceneShot;
|
||||
@@ -215,7 +218,7 @@ extern s16 gCutsceneShotTimer;
|
||||
extern s32 D_802876D4;
|
||||
extern s32 D_802876D8;
|
||||
extern s32 D_802876DC; // fake/padding? Or D8 is array?
|
||||
extern struct CinematicCamera D_802876E0;
|
||||
extern CinematicCamera D_802876E0;
|
||||
extern struct struct_80283431 D_80287750[];
|
||||
extern struct struct_80283430 D_80287818[];
|
||||
extern struct struct_80283430 D_80287998[];
|
||||
@@ -248,7 +251,7 @@ extern struct struct_80282C40 D_80285B90[];
|
||||
extern struct struct_80282C40 D_80285BA8[];
|
||||
extern struct struct_80282C40 D_80285C38[];
|
||||
extern struct struct_80282C40 D_80285C74[];
|
||||
extern struct Cutscene D_80285D10[];
|
||||
extern struct Cutscene gCutScene[];
|
||||
extern s16 D_80285D14;
|
||||
extern s32 D_802876D4;
|
||||
extern s32 D_802876D8;
|
||||
|
||||
@@ -65,7 +65,7 @@ void func_80280038(void) {
|
||||
render_course_actors(D_800DC5EC);
|
||||
render_object(PLAYER_ONE + SCREEN_MODE_1P);
|
||||
render_player_snow_effect(PLAYER_ONE + SCREEN_MODE_1P);
|
||||
transition_sliding_borders();
|
||||
ceremony_transition_sliding_borders();
|
||||
func_80281C40();
|
||||
init_rdp();
|
||||
func_80093F10();
|
||||
|
||||
@@ -160,7 +160,7 @@ void load_ceremony_cutscene(void) {
|
||||
init_hud();
|
||||
func_8001C05C();
|
||||
balloons_and_fireworks_init();
|
||||
func_802816B8();
|
||||
init_camera_podium_ceremony();
|
||||
func_80093E60();
|
||||
D_801625F8 = (uintptr_t) gHeapEndPtr - gNextFreeMemoryAddress;
|
||||
D_801625FC = ((f32) D_801625F8 / 1000.0f);
|
||||
|
||||
@@ -132,7 +132,7 @@ void func_80281D00(void) {
|
||||
func_80021B0C();
|
||||
gSPDisplayList(gDisplayListHead++, VIRTUAL_TO_PHYSICAL2(&D_80284EE0));
|
||||
func_80093F10();
|
||||
transition_sliding_borders();
|
||||
ceremony_transition_sliding_borders();
|
||||
func_80281C40();
|
||||
init_rdp();
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ void func_80281540(void) {
|
||||
void podium_ceremony_loop(void) {
|
||||
gMatrixObjectCount = 0;
|
||||
D_802874FC = 0;
|
||||
setup_camera_podium_ceremony();
|
||||
update_camera_podium_ceremony();
|
||||
func_80028F70();
|
||||
func_80022744();
|
||||
func_80059AC8();
|
||||
|
||||
+68
-58
@@ -54,7 +54,7 @@ s32 gMenuDelayTimer;
|
||||
s8 D_8018EE08;
|
||||
s8 gCupSelection;
|
||||
s8 D_8018EE0A;
|
||||
s8 gCupCourseSelection;
|
||||
s8 gCourseIndexInCup;
|
||||
s8 D_8018EE0C;
|
||||
struct_8018EE10_entry D_8018EE10[2];
|
||||
|
||||
@@ -81,29 +81,38 @@ s8 unref_800E86E0[4] = { 0, 0, 0, 1 };
|
||||
|
||||
u32 sVIGammaOffDitherOn = OS_VI_GAMMA_OFF | OS_VI_DITHER_FILTER_ON;
|
||||
|
||||
/*** Const/rodata Data ***/
|
||||
// used to set gScreenModeSelection; might be smaller; could be function static data
|
||||
// Used to set gScreenModeSelection; might be smaller; could be function static data
|
||||
const s8 D_800F2B50[] = { 0, 1, 2, 3, 3 };
|
||||
|
||||
// set to gPlayerCount, then that sets gPlayerCountSelection1
|
||||
// Set to gPlayerCount, then that sets gPlayerCountSelection1
|
||||
const s8 D_800F2B58[] = { 1, 2, 2, 3, 4 };
|
||||
|
||||
// Limit for each column in one-two-three-four players selection
|
||||
const s8 D_800F2B60[5][3] = {
|
||||
{ 1, 2, 1 }, { 1, 2, 1 }, { 0, 2, 2 }, { 0, 2, 0 }, { 0, 2, 0 },
|
||||
// {0, 3, 1},
|
||||
// {0, 3, 3},
|
||||
// {0, 3, 0},
|
||||
// {0, 3, 0},
|
||||
// Set indexed slots numbers for one-two-three-four mode selection
|
||||
const s8 gPlayerModeSelection[] = { 1, 2, 1, 1 };
|
||||
|
||||
// Limit for each index column in one-two-three-four mode selection
|
||||
const s8 gGameModePlayerColumnDefault[][3] = {
|
||||
{ 2, 1, 0 }, // 1p (GP options, TT options, ...)
|
||||
{ 2, 2, 0 }, // 2p (GP options, VS options, Battle)
|
||||
{ 2, 0, 0 }, // 3p (VS options, Battle, ...)
|
||||
{ 2, 0, 0 }, // 4p (VS options, Battle, ...)
|
||||
};
|
||||
|
||||
// is this another union GameModePack? Figure out when decomping.
|
||||
const s32 gGameModeFromNumPlayersAndRowSelection[5][3] = {
|
||||
{ 0x03010003, 0x03000300, 0x00030000 }, // Despite this matching, there is no way this line belongs in this array
|
||||
{ GRAND_PRIX, TIME_TRIALS, 0x00000000 }, // first column
|
||||
{ GRAND_PRIX, VERSUS, BATTLE }, // second
|
||||
{ VERSUS, BATTLE, 0x00000000 }, // third
|
||||
{ VERSUS, BATTLE, 0x00000000 }, // four
|
||||
// Limit for each index column in one-two-three-four mode selection
|
||||
// for extra mode (mirror mode), hence the extra value (3 instead of 2)
|
||||
const s8 gGameModePlayerColumnExtra[][3] = {
|
||||
{ 3, 1, 0 }, // 1p (GP options, TT options, ...)
|
||||
{ 3, 3, 0 }, // 2p (GP options, VS options, Battle)
|
||||
{ 3, 0, 0 }, // 3p (VS options, Battle, ...)
|
||||
{ 3, 0, 0 }, // 4p (VS options, Battle, ...)
|
||||
};
|
||||
|
||||
// Modes to select in one-two-three-four mode selection
|
||||
const s32 gGameModePlayerSelection[][3] = {
|
||||
{ GRAND_PRIX, TIME_TRIALS, 0x00000000 }, // 1p game modes
|
||||
{ GRAND_PRIX, VERSUS, BATTLE }, // 2p game modes
|
||||
{ VERSUS, BATTLE, 0x00000000 }, // 3p game modes
|
||||
{ VERSUS, BATTLE, 0x00000000 }, // 4p game modes
|
||||
};
|
||||
|
||||
// map from character grid position id to character id
|
||||
@@ -124,9 +133,10 @@ const s16 gCupCourseOrder[5][4] = {
|
||||
{ COURSE_BIG_DONUT, COURSE_BLOCK_FORT, COURSE_DOUBLE_DECK, COURSE_SKYSCRAPER },
|
||||
};
|
||||
|
||||
const s8 D_800F2BDC[8] = { 1, 0, 0, 0, 0, 1, 3, 4 };
|
||||
const s8 D_800F2BDC[4] = { 1, 0, 0, 0 };
|
||||
const s8 D_800F2BE0[4] = { 0, 1, 3, 4 };
|
||||
|
||||
const union GameModePack D_800F2BE4 = { { 0, 1, 2, 3 } };
|
||||
const union GameModePack gSoundMenuPack = { { SOUND_STEREO, SOUND_HEADPHONES, SOUND_UNUSED, SOUND_MONO } };
|
||||
|
||||
/**************************/
|
||||
|
||||
@@ -821,7 +831,7 @@ void logo_intro_menu_act(struct Controller* arg0, UNUSED u16 arg1) {
|
||||
gGamestateNext = 4; // Enter race state
|
||||
gCCSelection = CC_100;
|
||||
gCupSelection = 1;
|
||||
gCupCourseSelection = 0;
|
||||
gCourseIndexInCup = 0;
|
||||
gCurrentCourseId = 0;
|
||||
gScreenModeSelection = SCREEN_MODE_1P;
|
||||
gCharacterSelections[0] = 0;
|
||||
@@ -1196,7 +1206,7 @@ void func_800B28C8(void) {
|
||||
// be whether 'Begin' or 'Data' is selected. Not used for Battle.
|
||||
s8 temp_v0 = D_800E86B0[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
// Determine which game mode was selected based on the number of players and the row selected on the main menu
|
||||
switch (gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]]) {
|
||||
switch (gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]) {
|
||||
case GRAND_PRIX:
|
||||
gCCSelection = temp_v0;
|
||||
gPlaceItemBoxes = 1;
|
||||
@@ -1238,7 +1248,7 @@ void main_menu_act(struct Controller* controller, u16 arg1) {
|
||||
if (!func_800B4520()) {
|
||||
switch (gMainMenuSelectionDepth) {
|
||||
case BLANK_MAIN_MENU: {
|
||||
newMode = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
break;
|
||||
}
|
||||
case PLAYER_NUM_SELECTION: {
|
||||
@@ -1272,32 +1282,32 @@ void main_menu_act(struct Controller* controller, u16 arg1) {
|
||||
func_800CA330(0x19);
|
||||
D_8018EDE0 = 1;
|
||||
play_sound2(SOUND_MENU_GO_BACK);
|
||||
newMode = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
} else if (btnAndStick & A_BUTTON) {
|
||||
// L800B2C00
|
||||
gMainMenuSelectionDepth = GAME_MODE_SELECTION;
|
||||
func_800B44AC();
|
||||
play_sound2(SOUND_MENU_SELECT);
|
||||
newMode = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
} else if (btnAndStick & CONT_L) {
|
||||
// L800B2C58
|
||||
gMainMenuSelectionDepth = OPTIONS_SELECTION;
|
||||
func_8009E280();
|
||||
play_sound2(SOUND_MENU_OPTION);
|
||||
newMode = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
} else if (btnAndStick & CONT_R) {
|
||||
gMainMenuSelectionDepth = DATA_SELECTION;
|
||||
func_8009E258();
|
||||
play_sound2(SOUND_MENU_DATA);
|
||||
newMode = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
} else {
|
||||
newMode = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GAME_MODE_SELECTION: {
|
||||
if (btnAndStick & D_JPAD) {
|
||||
if (D_800E86AC[gPlayerCount - 1] < D_800F2B58[gPlayerCount + 7]) {
|
||||
if (D_800E86AC[gPlayerCount - 1] < gPlayerModeSelection[gPlayerCount - 1]) {
|
||||
D_800E86AC[gPlayerCount - 1] += 1;
|
||||
func_800B44AC();
|
||||
play_sound2(SOUND_MENU_CURSOR_MOVE);
|
||||
@@ -1316,10 +1326,10 @@ void main_menu_act(struct Controller* controller, u16 arg1) {
|
||||
gMainMenuSelectionDepth = PLAYER_NUM_SELECTION;
|
||||
func_800B44AC();
|
||||
play_sound2(SOUND_MENU_GO_BACK);
|
||||
newMode = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
} else if (btnAndStick & A_BUTTON) {
|
||||
// L800B2E3C
|
||||
switch (gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]]) {
|
||||
switch (gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]) {
|
||||
case 0:
|
||||
gMainMenuSelectionDepth = GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION;
|
||||
play_sound2(SOUND_MENU_GP);
|
||||
@@ -1343,9 +1353,9 @@ void main_menu_act(struct Controller* controller, u16 arg1) {
|
||||
// L800B2F04
|
||||
func_800B44AC();
|
||||
gMenuTimingCounter = 0;
|
||||
newMode = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
} else {
|
||||
newMode = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1355,8 +1365,8 @@ void main_menu_act(struct Controller* controller, u16 arg1) {
|
||||
gMenuTimingCounter++;
|
||||
if ((gMenuTimingCounter == 100 || gMenuTimingCounter % 300 == 0)) {
|
||||
// L800B2FAC
|
||||
if (gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]] == 0 ||
|
||||
gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]] == 2) {
|
||||
if (gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]] == 0 ||
|
||||
gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]] == 2) {
|
||||
play_sound2(SOUND_MENU_SELECT_LEVEL);
|
||||
}
|
||||
}
|
||||
@@ -1372,12 +1382,12 @@ void main_menu_act(struct Controller* controller, u16 arg1) {
|
||||
if (btnAndStick & D_JPAD) {
|
||||
sp24 = false;
|
||||
if (func_800B555C()) {
|
||||
if (sp28 < D_800F2B60[gPlayerCount + 4][D_800E86AC[gPlayerCount - 1] + 1]) {
|
||||
if (sp28 < gGameModePlayerColumnExtra[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1] + 1]) {
|
||||
sp24 = true;
|
||||
}
|
||||
} else {
|
||||
// L800B30D4
|
||||
if (sp28 < D_800F2B60[gPlayerCount][D_800E86AC[gPlayerCount - 1] + 1]) {
|
||||
if (sp28 < gGameModePlayerColumnDefault[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1] + 1]) {
|
||||
sp24 = true;
|
||||
}
|
||||
}
|
||||
@@ -1394,7 +1404,7 @@ void main_menu_act(struct Controller* controller, u16 arg1) {
|
||||
gMainMenuSelectionDepth = GAME_MODE_SELECTION;
|
||||
func_800B44AC();
|
||||
play_sound2(SOUND_MENU_GO_BACK);
|
||||
newMode = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
} else if (btnAndStick & A_BUTTON) {
|
||||
// L800B31DC
|
||||
func_800B44AC();
|
||||
@@ -1406,10 +1416,10 @@ void main_menu_act(struct Controller* controller, u16 arg1) {
|
||||
play_sound2(SOUND_MENU_SELECT);
|
||||
gMenuTimingCounter = 0;
|
||||
}
|
||||
newMode = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
} else {
|
||||
// L800B3294
|
||||
newMode = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1420,7 +1430,7 @@ void main_menu_act(struct Controller* controller, u16 arg1) {
|
||||
}
|
||||
// L800B330C
|
||||
if (btnAndStick & B_BUTTON) {
|
||||
switch (gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]]) {
|
||||
switch (gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
@@ -1435,25 +1445,25 @@ void main_menu_act(struct Controller* controller, u16 arg1) {
|
||||
func_800B44AC();
|
||||
play_sound2(SOUND_MENU_GO_BACK);
|
||||
gMenuTimingCounter = 0;
|
||||
newMode = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
} else if (btnAndStick & A_BUTTON) {
|
||||
// L800B33D8
|
||||
func_8009E1C0();
|
||||
play_sound2(SOUND_MENU_OK_CLICKED);
|
||||
func_800B28C8();
|
||||
newMode = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
} else {
|
||||
newMode = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case OPTIONS_SELECTION:
|
||||
case DATA_SELECTION: {
|
||||
newMode = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
newMode = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]];
|
||||
newMode = gGameModePlayerSelection[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]];
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1693,7 +1703,7 @@ void course_select_menu_act(struct Controller* arg0, u16 arg1) {
|
||||
}
|
||||
|
||||
D_800DC540 = gCupSelection;
|
||||
gCurrentCourseId = gCupCourseOrder[gCupSelection][gCupCourseSelection];
|
||||
gCurrentCourseId = gCupCourseOrder[gCupSelection][gCourseIndexInCup];
|
||||
if ((buttonAndStickPress & B_BUTTON) != 0) {
|
||||
func_8009E208();
|
||||
play_sound2(SOUND_MENU_GO_BACK);
|
||||
@@ -1704,7 +1714,7 @@ void course_select_menu_act(struct Controller* arg0, u16 arg1) {
|
||||
} else {
|
||||
D_8018EDEC = 3;
|
||||
play_sound2(SOUND_MENU_SELECT);
|
||||
gCurrentCourseId = gCupCourseOrder[gCupSelection][CUP_COURSE_ONE];
|
||||
gCurrentCourseId = gCupCourseOrder[gCupSelection][COURSE_ONE];
|
||||
gMenuTimingCounter = 0;
|
||||
}
|
||||
func_800B44AC();
|
||||
@@ -1712,18 +1722,18 @@ void course_select_menu_act(struct Controller* arg0, u16 arg1) {
|
||||
break;
|
||||
case 2:
|
||||
case 4:
|
||||
if (((buttonAndStickPress & D_JPAD) != 0) && (gCupCourseSelection < CUP_COURSE_FOUR)) {
|
||||
++gCupCourseSelection;
|
||||
if (((buttonAndStickPress & D_JPAD) != 0) && (gCourseIndexInCup < COURSE_FOUR)) {
|
||||
++gCourseIndexInCup;
|
||||
func_800B44AC();
|
||||
play_sound2(SOUND_MENU_CURSOR_MOVE);
|
||||
}
|
||||
if (((buttonAndStickPress & U_JPAD) != 0) && (gCupCourseSelection > CUP_COURSE_ONE)) {
|
||||
--gCupCourseSelection;
|
||||
if (((buttonAndStickPress & U_JPAD) != 0) && (gCourseIndexInCup > COURSE_ONE)) {
|
||||
--gCourseIndexInCup;
|
||||
func_800B44AC();
|
||||
play_sound2(SOUND_MENU_CURSOR_MOVE);
|
||||
}
|
||||
|
||||
gCurrentCourseId = gCupCourseOrder[gCupSelection][gCupCourseSelection];
|
||||
gCurrentCourseId = gCupCourseOrder[gCupSelection][gCourseIndexInCup];
|
||||
if ((buttonAndStickPress & B_BUTTON) != 0) {
|
||||
if (D_8018EDEC == 2) {
|
||||
D_8018EDEC = 1;
|
||||
@@ -1814,7 +1824,7 @@ void func_800B3F74(s32 menuSelection) {
|
||||
gIsMirrorMode = 0;
|
||||
gEnableDebugMode = DEBUG_MODE;
|
||||
gCupSelection = MUSHROOM_CUP;
|
||||
gCupCourseSelection = 0;
|
||||
gCourseIndexInCup = 0;
|
||||
gTimeTrialDataCourseIndex = 0;
|
||||
if (gPlayerCount <= 0) {
|
||||
gPlayerCount = 1;
|
||||
@@ -1822,7 +1832,7 @@ void func_800B3F74(s32 menuSelection) {
|
||||
if (gPlayerCount >= 5) {
|
||||
gPlayerCount = 4;
|
||||
}
|
||||
D_8018EDF1 = D_800F2BDC[gPlayerCount + 3];
|
||||
D_8018EDF1 = D_800F2BE0[gPlayerCount - 1];
|
||||
func_800CA008(0, 0);
|
||||
func_800C8EAC(1);
|
||||
D_8018EDFC = 0;
|
||||
@@ -1884,7 +1894,7 @@ void func_800B3F74(s32 menuSelection) {
|
||||
case 0: {
|
||||
D_8018EDEE = 1;
|
||||
if (gGamestate == 0) {
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (i = 0; i < ARRAY_COUNT(gCharacterGridSelections); i++) {
|
||||
if (i < gPlayerCount) {
|
||||
gCharacterGridSelections[i] = i + 1;
|
||||
} else {
|
||||
@@ -1942,7 +1952,7 @@ void func_800B3F74(s32 menuSelection) {
|
||||
play_sound2(SOUND_MENU_SELECT_MAP);
|
||||
D_8018EE0A = 0;
|
||||
if (gModeSelection == GRAND_PRIX) {
|
||||
gCupCourseSelection = 0;
|
||||
gCourseIndexInCup = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(gGPPointsByCharacterId); i++) {
|
||||
@@ -1962,7 +1972,7 @@ void func_800B44BC(void) {
|
||||
UNUSED u32 pad;
|
||||
union GameModePack pack;
|
||||
|
||||
pack = D_800F2BE4;
|
||||
pack = gSoundMenuPack;
|
||||
if ((gSoundMode == SOUND_STEREO) || (gSoundMode == SOUND_HEADPHONES) || (gSoundMode == SOUND_MONO)) {
|
||||
func_800C3448(pack.modes[gSoundMode] | 0xE0000000);
|
||||
}
|
||||
|
||||
+6
-6
@@ -70,7 +70,7 @@ extern s32 gMenuDelayTimer;
|
||||
extern s8 D_8018EE08;
|
||||
extern s8 gCupSelection;
|
||||
extern s8 D_8018EE0A;
|
||||
extern s8 gCupCourseSelection;
|
||||
extern s8 gCourseIndexInCup;
|
||||
extern s8 D_8018EE0C;
|
||||
extern struct_8018EE10_entry D_8018EE10[];
|
||||
|
||||
@@ -89,14 +89,14 @@ extern u32 sVIGammaOffDitherOn;
|
||||
|
||||
extern const s8 D_800F2B50[5];
|
||||
extern const s8 D_800F2B58[5];
|
||||
extern const s8 D_800F2B60[5][3];
|
||||
extern const s32 gGameModeFromNumPlayersAndRowSelection[5][3];
|
||||
extern const s8 gPlayerModeSelection[];
|
||||
extern const s8 gGameModePlayerColumnDefault[][3];
|
||||
extern const s8 gGameModePlayerColumnExtra[][3];
|
||||
extern const s32 gGameModePlayerSelection[][3];
|
||||
extern const s8 D_800F2BAC[8];
|
||||
extern const s16 gCupCourseOrder[NUM_CUPS][NUM_COURSES_PER_CUP];
|
||||
|
||||
extern const s8 D_800F2BDC[8];
|
||||
|
||||
extern const union GameModePack D_800F2BE4;
|
||||
extern const union GameModePack gSoundMenuPack;
|
||||
|
||||
// end of menus.c variables
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ void network_cup_vote(uint32_t course) {
|
||||
void set_course(const char* data) {
|
||||
if (data != NULL) {
|
||||
gCupSelection = data[0];
|
||||
gCurrentCourseId = gCupCourseOrder[gCupSelection][CUP_COURSE_ONE];
|
||||
gCurrentCourseId = gCupCourseOrder[gCupSelection][COURSE_ONE];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ void networking_start_session(const char* data) {
|
||||
gGamestateNext = RACING;
|
||||
gCCSelection = CC_150;
|
||||
// gCupSelection = FLOWER_CUP;
|
||||
gCupCourseSelection = CUP_COURSE_ONE;
|
||||
gCourseIndexInCup = COURSE_ONE;
|
||||
gScreenModeSelection = SCREEN_MODE_1P;
|
||||
gModeSelection = GRAND_PRIX;
|
||||
gPlayerCount = 1;
|
||||
|
||||
+17
-16
@@ -1,23 +1,24 @@
|
||||
#include "libultra_internal.h"
|
||||
|
||||
NO_REORDER OSThread* __osThreadTail = NULL;
|
||||
NO_REORDER u32 __osTest = -1;
|
||||
NO_REORDER OSThread* __osRunQueue = (OSThread*) &__osThreadTail;
|
||||
NO_REORDER OSThread* __osActiveQueue = (OSThread*) &__osThreadTail;
|
||||
OSThread* __osRunningThread = NULL;
|
||||
OSThread* __osFaultedThread = NULL;
|
||||
struct __osThreadTail __osThreadTail = { NULL, -1 };
|
||||
OSThread* __osRunQueue = (OSThread*) &__osThreadTail;
|
||||
OSThread* __osActiveQueue = (OSThread*) &__osThreadTail;
|
||||
OSThread* __osRunningThread = { 0 };
|
||||
OSThread* __osFaultedThread = { 0 };
|
||||
|
||||
void __osDequeueThread(OSThread** queue, OSThread* thread) {
|
||||
register OSThread** a2;
|
||||
register OSThread* a3;
|
||||
a2 = queue;
|
||||
a3 = *a2;
|
||||
while (a3 != NULL) {
|
||||
if (a3 == thread) {
|
||||
*a2 = thread->next;
|
||||
void __osDequeueThread(register OSThread** queue, register OSThread* t) {
|
||||
register OSThread* pred;
|
||||
register OSThread* succ;
|
||||
|
||||
pred = (OSThread*) queue;
|
||||
succ = pred->next;
|
||||
|
||||
while (succ != NULL) {
|
||||
if (succ == t) {
|
||||
pred->next = t->next;
|
||||
return;
|
||||
}
|
||||
a2 = &a3->next;
|
||||
a3 = *a2;
|
||||
pred = succ;
|
||||
succ = pred->next;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,11 +64,11 @@ void __osDevMgrMain(void* args) {
|
||||
break;
|
||||
case 15:
|
||||
osRecvMesg(sp34->accessQueue, &dummy, OS_MESG_BLOCK);
|
||||
ret = sp34->epiDmaCallback(mb->piHandle, OS_READ, mb->devAddr, mb->dramAddr, mb->size);
|
||||
ret = sp34->edma_func(mb->piHandle, OS_READ, mb->devAddr, mb->dramAddr, mb->size);
|
||||
break;
|
||||
case 16:
|
||||
osRecvMesg(sp34->accessQueue, &dummy, OS_MESG_BLOCK);
|
||||
ret = sp34->epiDmaCallback(mb->piHandle, OS_WRITE, mb->devAddr, mb->dramAddr, mb->size);
|
||||
ret = sp34->edma_func(mb->piHandle, OS_WRITE, mb->devAddr, mb->dramAddr, mb->size);
|
||||
break;
|
||||
case 10:
|
||||
osSendMesg(mb->hdr.retQueue, mb, OS_MESG_NOBLOCK);
|
||||
|
||||
@@ -9,6 +9,8 @@ extern u8 leoDiskStack[OS_PIM_STACKSIZE]; // technically should have a OS_LEO_ST
|
||||
|
||||
extern u32 D_800EA5F0;
|
||||
|
||||
u8 leoDiskStack[OS_PIM_STACKSIZE]; // technically should have a OS_LEO_STACKSIZE or something..
|
||||
|
||||
s32 __osLeoInterrupt() {
|
||||
u32 stat;
|
||||
volatile u32 pistat;
|
||||
|
||||
@@ -23,10 +23,10 @@ void __osViSwapContext() {
|
||||
} else {
|
||||
s1->x.scale = s0->comRegs.xScale;
|
||||
}
|
||||
if (s1->state & 4) {
|
||||
if (s1->unk00 & 4) {
|
||||
sp34 = (u32) (s0->fldRegs[field].yScale & 0xfff);
|
||||
s1->y.scale = s1->y.factor * sp34;
|
||||
s1->y.scale |= s0->fldRegs[field].yScale & ~0xfff;
|
||||
s1->unk2c = s1->unk24 * sp34;
|
||||
s1->unk2c |= s0->fldRegs[field].yScale & ~0xfff;
|
||||
} else {
|
||||
s1->y.scale = s0->fldRegs[field].yScale;
|
||||
}
|
||||
|
||||
+2
-2
@@ -149,8 +149,8 @@ s32 __osPfsReleasePages(OSPfs* pfs, __OSInode* inode, u8 start_page, u16* sum, u
|
||||
s32 __osBlockSum(OSPfs* pfs, u8 page_no, u16* sum, u8 bank);
|
||||
s32 __osContRamRead(OSMesgQueue* mq, int channel, u16 address, u8* buffer);
|
||||
s32 __osContRamWrite(OSMesgQueue* mq, int channel, u16 address, u8* buffer, int force);
|
||||
void __osContGetInitData(u8* pattern, OSContStatus* data);
|
||||
void __osPackRequestData(u8 cmd);
|
||||
void __osContGetInitData(u8* bitpattern, OSContStatus* status);
|
||||
void __osPackRequestData(u8 command);
|
||||
void __osPfsRequestData(u8 cmd);
|
||||
void __osPfsGetInitData(u8* pattern, OSContStatus* data);
|
||||
u8 __osContAddressCrc(u16 addr);
|
||||
|
||||
@@ -1,185 +0,0 @@
|
||||
#include "libultra_internal.h"
|
||||
#include <PR/rcp.h>
|
||||
#include "bstring.h"
|
||||
#include "piint.h"
|
||||
#include "osint.h"
|
||||
|
||||
u8 leoDiskStack[OS_PIM_STACKSIZE]; // technically should have a OS_LEO_STACKSIZE or something..
|
||||
|
||||
#ifdef VERSION_SH
|
||||
|
||||
//! @todo so many magic constants :'(
|
||||
static void __osLeoResume(void);
|
||||
static void __osLeoAbnormalResume(void);
|
||||
|
||||
s32 __osLeoInterrupt() {
|
||||
u32 stat;
|
||||
volatile u32 pi_stat;
|
||||
u32 bm_stat;
|
||||
__OSTranxInfo* info;
|
||||
__OSBlockInfo* blockInfo;
|
||||
stat = 0;
|
||||
info = &__osDiskHandle->transferInfo;
|
||||
blockInfo = &info->block[info->blockNum];
|
||||
pi_stat = IO_READ(PI_STATUS_REG);
|
||||
if (pi_stat & PI_STATUS_DMA_BUSY) {
|
||||
__OSGlobalIntMask = __OSGlobalIntMask & ~SR_IBIT4; // cartridge interrupt
|
||||
blockInfo->errStatus = LEO_ERROR_29;
|
||||
__osLeoResume();
|
||||
return 1;
|
||||
}
|
||||
WAIT_ON_IOBUSY(pi_stat);
|
||||
stat = IO_READ(LEO_STATUS);
|
||||
if (stat & LEO_STATUS_MECHANIC_INTERRUPT) {
|
||||
WAIT_ON_IOBUSY(pi_stat);
|
||||
IO_WRITE(LEO_BM_CTL, info->bmCtlShadow | LEO_BM_CTL_CLR_MECHANIC_INTR);
|
||||
blockInfo->errStatus = LEO_ERROR_GOOD;
|
||||
return 0;
|
||||
}
|
||||
if (info->cmdType == LEO_CMD_TYPE_2) {
|
||||
return 1;
|
||||
}
|
||||
if (stat & LEO_STATUS_BUFFER_MANAGER_ERROR) {
|
||||
WAIT_ON_IOBUSY(pi_stat);
|
||||
stat = IO_READ(LEO_STATUS);
|
||||
blockInfo->errStatus = LEO_ERROR_22;
|
||||
__osLeoResume();
|
||||
IO_WRITE(PI_STATUS_REG, PI_STATUS_CLR_INTR);
|
||||
__OSGlobalIntMask |= OS_IM_PI;
|
||||
return 1;
|
||||
}
|
||||
if (info->cmdType == LEO_CMD_TYPE_1) {
|
||||
if ((stat & LEO_STATUS_DATA_REQUEST) == 0) {
|
||||
if (info->sectorNum + 1 != info->transferMode * 85) {
|
||||
blockInfo->errStatus = LEO_ERROR_24;
|
||||
__osLeoAbnormalResume();
|
||||
return 1;
|
||||
}
|
||||
IO_WRITE(PI_STATUS_REG, PI_STATUS_CLR_INTR);
|
||||
__OSGlobalIntMask |= OS_IM_PI;
|
||||
blockInfo->errStatus = LEO_ERROR_GOOD;
|
||||
__osLeoResume();
|
||||
return 1;
|
||||
}
|
||||
blockInfo->dramAddr = (void*) ((u32) blockInfo->dramAddr + blockInfo->sectorSize);
|
||||
info->sectorNum++;
|
||||
osEPiRawStartDma(__osDiskHandle, OS_WRITE, LEO_SECTOR_BUFF, blockInfo->dramAddr, blockInfo->sectorSize);
|
||||
return 1;
|
||||
}
|
||||
if (info->cmdType == LEO_CMD_TYPE_0) {
|
||||
if (info->transferMode == LEO_SECTOR_MODE) {
|
||||
if ((s32) blockInfo->C1ErrNum + 17 < info->sectorNum) {
|
||||
blockInfo->errStatus = LEO_ERROR_GOOD;
|
||||
__osLeoAbnormalResume();
|
||||
return 1;
|
||||
}
|
||||
if ((stat & LEO_STATUS_DATA_REQUEST) == 0) {
|
||||
blockInfo->errStatus = LEO_ERROR_23;
|
||||
__osLeoAbnormalResume();
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
blockInfo->dramAddr = (void*) ((u32) blockInfo->dramAddr + blockInfo->sectorSize);
|
||||
}
|
||||
bm_stat = IO_READ(LEO_BM_STATUS);
|
||||
if ((bm_stat & LEO_BM_STATUS_C1SINGLE && bm_stat & LEO_BM_STATUS_C1DOUBLE) || bm_stat & LEO_BM_STATUS_MICRO) {
|
||||
if (blockInfo->C1ErrNum > 3) {
|
||||
if (info->transferMode != LEO_SECTOR_MODE || info->sectorNum > 0x52) {
|
||||
blockInfo->errStatus = LEO_ERROR_23;
|
||||
__osLeoAbnormalResume();
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
int errNum = blockInfo->C1ErrNum;
|
||||
blockInfo->C1ErrSector[errNum] = info->sectorNum + 1;
|
||||
}
|
||||
blockInfo->C1ErrNum++;
|
||||
}
|
||||
if (stat & LEO_STATUS_C2_TRANSFER) {
|
||||
if (info->sectorNum != 87) {
|
||||
blockInfo->errStatus = LEO_ERROR_24;
|
||||
__osLeoAbnormalResume();
|
||||
}
|
||||
if (info->transferMode == LEO_TRACK_MODE && info->blockNum == 0) {
|
||||
info->blockNum = 1;
|
||||
info->sectorNum = -1;
|
||||
info->block[1].dramAddr = (void*) ((u32) info->block[1].dramAddr - info->block[1].sectorSize);
|
||||
|
||||
blockInfo->errStatus = LEO_ERROR_22;
|
||||
} else {
|
||||
IO_WRITE(PI_STATUS_REG, PI_STATUS_CLR_INTR);
|
||||
__OSGlobalIntMask |= OS_IM_PI;
|
||||
info->cmdType = LEO_CMD_TYPE_2;
|
||||
blockInfo->errStatus = LEO_ERROR_GOOD;
|
||||
}
|
||||
osEPiRawStartDma(__osDiskHandle, OS_READ, LEO_C2_BUFF, blockInfo->C2Addr, blockInfo->sectorSize * 4);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (info->sectorNum == -1 && info->transferMode == LEO_TRACK_MODE && info->blockNum == 1) {
|
||||
__OSBlockInfo* bptr = &info->block[0];
|
||||
if (bptr->C1ErrNum == 0) {
|
||||
if (((u32*) bptr->C2Addr)[0] | ((u32*) bptr->C2Addr)[1] | ((u32*) bptr->C2Addr)[2] |
|
||||
((u32*) bptr->C2Addr)[3]) {
|
||||
bptr->errStatus = LEO_ERROR_24;
|
||||
__osLeoAbnormalResume();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
bptr->errStatus = 0;
|
||||
__osLeoResume();
|
||||
}
|
||||
info->sectorNum++;
|
||||
if (stat & LEO_STATUS_DATA_REQUEST) {
|
||||
if (info->sectorNum > 0x54) {
|
||||
blockInfo->errStatus = LEO_ERROR_24;
|
||||
__osLeoAbnormalResume();
|
||||
return 1;
|
||||
}
|
||||
osEPiRawStartDma(__osDiskHandle, 0, LEO_SECTOR_BUFF, blockInfo->dramAddr, blockInfo->sectorSize);
|
||||
blockInfo->errStatus = LEO_ERROR_GOOD;
|
||||
return 1;
|
||||
}
|
||||
if (info->sectorNum <= 0x54) {
|
||||
blockInfo->errStatus = LEO_ERROR_24;
|
||||
__osLeoAbnormalResume();
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
blockInfo->errStatus = LEO_ERROR_4;
|
||||
__osLeoAbnormalResume();
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void __osLeoAbnormalResume(void) {
|
||||
__OSTranxInfo* info;
|
||||
u32 pi_stat;
|
||||
info = &__osDiskHandle->transferInfo;
|
||||
WAIT_ON_IOBUSY(pi_stat);
|
||||
IO_WRITE(LEO_BM_CTL, info->bmCtlShadow | LEO_BM_CTL_RESET);
|
||||
WAIT_ON_IOBUSY(pi_stat);
|
||||
IO_WRITE(LEO_BM_CTL, info->bmCtlShadow);
|
||||
__osLeoResume();
|
||||
IO_WRITE(PI_STATUS_REG, PI_STATUS_CLR_INTR);
|
||||
__OSGlobalIntMask |= OS_IM_PI;
|
||||
}
|
||||
|
||||
static void __osLeoResume(void) {
|
||||
__OSEventState* es;
|
||||
OSMesgQueue* mq;
|
||||
s32 last;
|
||||
es = &__osEventStateTab[OS_EVENT_PI];
|
||||
mq = es->messageQueue;
|
||||
if (mq == NULL || MQ_IS_FULL(mq)) {
|
||||
return;
|
||||
}
|
||||
last = (mq->first + mq->validCount) % mq->msgCount;
|
||||
mq->msg[last] = es->message;
|
||||
mq->validCount++;
|
||||
if (mq->mtqueue->next != NULL) {
|
||||
__osEnqueueThread(&D_80334898, __osPopThread(&mq->mtqueue));
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -10,14 +10,10 @@ typedef struct __OSEventState {
|
||||
} __OSEventState;
|
||||
#endif
|
||||
|
||||
typedef struct // __osThreadTail
|
||||
{
|
||||
/* 0x00 */ OSThread* next;
|
||||
/* 0x04 */ OSPri priority;
|
||||
/* 0x08 */ OSThread* queue;
|
||||
/* 0x0c */ OSThread* tlnext;
|
||||
|
||||
} OSThreadTail;
|
||||
extern struct __osThreadTail {
|
||||
OSThread* next;
|
||||
OSPri priority;
|
||||
} __osThreadTail;
|
||||
|
||||
/*
|
||||
* This define is needed because the original definitions in __osDequeueThread.c are declared
|
||||
@@ -35,10 +31,10 @@ typedef struct {
|
||||
} OSThread_ListHead;
|
||||
|
||||
// Original OSThread_ListHead definitions
|
||||
extern OSThread* __osThreadTail;
|
||||
extern OSThread* __osActiveQueue;
|
||||
extern OSThread* __osRunQueue;
|
||||
extern OSThread* __osRunningThread;
|
||||
extern OSThread* __osActiveQueue;
|
||||
extern OSThread* __osFaultedThread;
|
||||
extern OSThread* __osRunQueue;
|
||||
|
||||
// Original EEPROM definitions
|
||||
extern u32 D_80365E00[15];
|
||||
|
||||
+34
-32
@@ -1,5 +1,5 @@
|
||||
#include "libultra_internal.h"
|
||||
#include "osContInternal.h"
|
||||
#include "controller.h"
|
||||
|
||||
void __osPackRequestData(u8);
|
||||
void __osContGetInitData(u8*, OSContStatus*);
|
||||
@@ -9,6 +9,7 @@ u32 _osContInitialized = 0;
|
||||
extern u64 osClockRate;
|
||||
|
||||
// these probably belong in EEPROMlongread or something
|
||||
ALIGNED16 OSPifRam __osContPifRam;
|
||||
u8 __osContLastCmd;
|
||||
u8 _osContNumControllers;
|
||||
OSTimer D_80196548;
|
||||
@@ -34,9 +35,9 @@ s32 osContInit(OSMesgQueue* mq, u8* bitpattern, OSContStatus* status) {
|
||||
//! @todo figure out what it means
|
||||
_osContNumControllers = 4;
|
||||
__osPackRequestData(0);
|
||||
ret = __osSiRawStartDma(OS_WRITE, _osContCmdBuf);
|
||||
ret = __osSiRawStartDma(OS_WRITE, __osContPifRam.ramarray);
|
||||
osRecvMesg(mq, &mesg, OS_MESG_BLOCK);
|
||||
ret = __osSiRawStartDma(OS_READ, _osContCmdBuf);
|
||||
ret = __osSiRawStartDma(OS_READ, __osContPifRam.ramarray);
|
||||
osRecvMesg(mq, &mesg, OS_MESG_BLOCK);
|
||||
__osContGetInitData(bitpattern, status);
|
||||
__osContLastCmd = 0;
|
||||
@@ -45,48 +46,49 @@ s32 osContInit(OSMesgQueue* mq, u8* bitpattern, OSContStatus* status) {
|
||||
return ret;
|
||||
}
|
||||
void __osContGetInitData(u8* bitpattern, OSContStatus* status) {
|
||||
OSContPackedRequest* cmdBufPtr;
|
||||
OSContPackedRequest response;
|
||||
u8* ptr;
|
||||
__OSContRequesFormat response;
|
||||
s32 i;
|
||||
u8 sp7;
|
||||
u8 bits;
|
||||
|
||||
sp7 = 0;
|
||||
cmdBufPtr = &(_osContCmdBuf[0].request);
|
||||
for (i = 0; i < _osContNumControllers; i++, cmdBufPtr++, status++) {
|
||||
response = *(OSContPackedRequest*) cmdBufPtr;
|
||||
status->errnum = (response.rxLen & 0xc0) >> 4;
|
||||
bits = 0;
|
||||
ptr = (u8*) __osContPifRam.ramarray;
|
||||
for (i = 0; i < _osContNumControllers; i++, ptr += sizeof(response), status++) {
|
||||
response = *((__OSContRequesFormat*) (ptr));
|
||||
status->errnum = CHNL_ERR(response);
|
||||
if (status->errnum == 0) {
|
||||
status->type = response.data2 << 8 | response.data1;
|
||||
status->status = response.data3;
|
||||
status->type = response.typel << 8 | response.typeh;
|
||||
status->status = response.status;
|
||||
|
||||
sp7 |= 1 << i;
|
||||
bits |= 1 << i;
|
||||
}
|
||||
}
|
||||
*bitpattern = sp7;
|
||||
|
||||
*bitpattern = bits;
|
||||
}
|
||||
void __osPackRequestData(u8 command) {
|
||||
OSContPackedRequest* cmdBufPtr;
|
||||
OSContPackedRequest request;
|
||||
u8* ptr;
|
||||
__OSContRequesFormat requestHeader;
|
||||
s32 i;
|
||||
|
||||
// some kind of weird zeroing code
|
||||
for (i = 0; i < 0x10; i++) {
|
||||
*((u32*) &_osContCmdBuf + i) = 0;
|
||||
for (i = 0; i < ARRLEN(__osContPifRam.ramarray) + 1; i++) {
|
||||
__osContPifRam.ramarray[i] = 0;
|
||||
}
|
||||
|
||||
_osContPifCtrl = 1;
|
||||
cmdBufPtr = &_osContCmdBuf[0].request;
|
||||
request.padOrEnd = 255;
|
||||
request.txLen = 1;
|
||||
request.rxLen = 3;
|
||||
request.command = command;
|
||||
request.data1 = 255;
|
||||
request.data2 = 255;
|
||||
request.data3 = 255;
|
||||
request.data4 = 255;
|
||||
__osContPifRam.pifstatus = CONT_CMD_EXE;
|
||||
ptr = (u8*) __osContPifRam.ramarray;
|
||||
requestHeader.dummy = CONT_CMD_NOP;
|
||||
requestHeader.txsize = CONT_CMD_RESET_TX;
|
||||
requestHeader.rxsize = CONT_CMD_RESET_RX;
|
||||
requestHeader.cmd = command;
|
||||
requestHeader.typeh = CONT_CMD_NOP;
|
||||
requestHeader.typel = CONT_CMD_NOP;
|
||||
requestHeader.status = CONT_CMD_NOP;
|
||||
requestHeader.dummy1 = CONT_CMD_NOP;
|
||||
|
||||
for (i = 0; i < _osContNumControllers; i++) {
|
||||
*cmdBufPtr++ = request;
|
||||
*(__OSContRequesFormat*) ptr = requestHeader;
|
||||
ptr += sizeof(requestHeader);
|
||||
}
|
||||
cmdBufPtr->padOrEnd = 254;
|
||||
*ptr = CONT_CMD_END;
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#ifndef _ULTRA64_CONTROLLER_INTERNAL_H_
|
||||
#define _ULTRA64_CONTROLLER_INTERNAL_H_
|
||||
|
||||
typedef struct {
|
||||
u8 padOrEnd;
|
||||
u8 txLen;
|
||||
u8 rxLen; // includes errno
|
||||
u8 command;
|
||||
u16 button;
|
||||
s8 rawStickX;
|
||||
s8 rawStickY;
|
||||
} OSContPackedRead;
|
||||
|
||||
typedef struct {
|
||||
u8 padOrEnd;
|
||||
u8 txLen;
|
||||
u8 rxLen;
|
||||
u8 command;
|
||||
u8 data1;
|
||||
u8 data2;
|
||||
u8 data3;
|
||||
u8 data4;
|
||||
} OSContPackedRequest;
|
||||
|
||||
typedef union {
|
||||
OSContPackedRead read;
|
||||
OSContPackedRequest request;
|
||||
u32 as_raw[2];
|
||||
} OSContPackedStruct;
|
||||
|
||||
#ifdef AVOID_UB
|
||||
// Fix the OSContPackedStruct array
|
||||
extern OSContPackedStruct _osContCmdBuf[8];
|
||||
|
||||
// And fix the last element
|
||||
#define _osContPifCtrl _osContCmdBuf[7].as_raw[1]
|
||||
#else
|
||||
// Original OSContPackedStruct definitions
|
||||
extern OSContPackedStruct _osContCmdBuf[7];
|
||||
extern u32 _osContPifCtrl;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,16 +1,7 @@
|
||||
#include "libultra_internal.h"
|
||||
#include "osContInternal.h"
|
||||
#include "controller.h"
|
||||
#include <macros.h>
|
||||
|
||||
#ifndef AVOID_UB
|
||||
ALIGNED8 OSContPackedStruct _osContCmdBuf[7];
|
||||
UNUSED static u32 unused; // padding between these two variables
|
||||
u32 _osContPifCtrl;
|
||||
#else
|
||||
// Reordered gcc vars above will disturb the aliasing done to access all 8 members of this array, hence AVOID_UB.
|
||||
ALIGNED8 OSContPackedStruct _osContCmdBuf[8];
|
||||
#endif
|
||||
|
||||
extern u8 __osContLastCmd;
|
||||
extern u8 _osContNumControllers;
|
||||
|
||||
@@ -18,56 +9,66 @@ void __osPackReadData(void);
|
||||
s32 osContStartReadData(OSMesgQueue* mesg) {
|
||||
s32 ret = 0;
|
||||
s32 i;
|
||||
|
||||
__osSiGetAccess();
|
||||
if (__osContLastCmd != 1) {
|
||||
|
||||
if (__osContLastCmd != CONT_CMD_READ_BUTTON) {
|
||||
__osPackReadData();
|
||||
ret = __osSiRawStartDma(OS_WRITE, _osContCmdBuf);
|
||||
ret = __osSiRawStartDma(OS_WRITE, __osContPifRam.ramarray);
|
||||
osRecvMesg(mesg, NULL, OS_MESG_BLOCK);
|
||||
}
|
||||
for (i = 0; i < 0x10; i++) {
|
||||
*((u32*) &_osContCmdBuf + i) = 255;
|
||||
|
||||
for (i = 0; i < ARRLEN(__osContPifRam.ramarray) + 1; i++) {
|
||||
__osContPifRam.ramarray[i] = CONT_CMD_NOP;
|
||||
}
|
||||
|
||||
_osContPifCtrl = 0;
|
||||
ret = __osSiRawStartDma(OS_READ, _osContCmdBuf);
|
||||
__osContLastCmd = 1;
|
||||
__osContPifRam.pifstatus = 0;
|
||||
ret = __osSiRawStartDma(OS_READ, __osContPifRam.ramarray);
|
||||
__osContLastCmd = CONT_CMD_READ_BUTTON;
|
||||
|
||||
__osSiRelAccess();
|
||||
|
||||
return ret;
|
||||
}
|
||||
void osContGetReadData(OSContPad* pad) {
|
||||
OSContPackedRead* cmdBufPtr;
|
||||
OSContPackedRead response;
|
||||
u8* ptr = (u8*) __osContPifRam.ramarray;
|
||||
__OSContReadFormat readformat;
|
||||
s32 i;
|
||||
cmdBufPtr = &_osContCmdBuf[0].read;
|
||||
for (i = 0; i < _osContNumControllers; i++, cmdBufPtr++, pad++) {
|
||||
response = *cmdBufPtr;
|
||||
pad->errno = (response.rxLen & 0xc0) >> 4;
|
||||
if (pad->errno == 0) {
|
||||
pad->button = response.button;
|
||||
pad->stick_x = response.rawStickX;
|
||||
pad->stick_y = response.rawStickY;
|
||||
|
||||
for (i = 0; i < _osContNumControllers; i++, ptr += sizeof(readformat), pad++) {
|
||||
readformat = *(__OSContReadFormat*) ptr;
|
||||
pad->errno = CHNL_ERR(readformat);
|
||||
|
||||
if (pad->errno != 0) {
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
||||
pad->button = readformat.button;
|
||||
pad->stick_x = readformat.stick_x;
|
||||
pad->stick_y = readformat.stick_y;
|
||||
}
|
||||
}
|
||||
void __osPackReadData() {
|
||||
OSContPackedRead* cmdBufPtr;
|
||||
OSContPackedRead request;
|
||||
u8* ptr = (u8*) __osContPifRam.ramarray;
|
||||
__OSContReadFormat readformat;
|
||||
s32 i;
|
||||
cmdBufPtr = &_osContCmdBuf[0].read;
|
||||
for (i = 0; i < 0x10; i++) {
|
||||
*((u32*) &_osContCmdBuf + i) = 0;
|
||||
|
||||
for (i = 0; i < ARRLEN(__osContPifRam.ramarray) + 1; i++) {
|
||||
__osContPifRam.ramarray[i] = 0;
|
||||
}
|
||||
|
||||
_osContPifCtrl = 1;
|
||||
request.padOrEnd = 255;
|
||||
request.txLen = 1;
|
||||
request.rxLen = 4;
|
||||
request.command = 1;
|
||||
request.button = 65535;
|
||||
request.rawStickX = -1;
|
||||
request.rawStickY = -1;
|
||||
__osContPifRam.pifstatus = CONT_CMD_EXE;
|
||||
readformat.dummy = CONT_CMD_NOP;
|
||||
readformat.txsize = CONT_CMD_READ_BUTTON_TX;
|
||||
readformat.rxsize = CONT_CMD_READ_BUTTON_RX;
|
||||
readformat.cmd = CONT_CMD_READ_BUTTON;
|
||||
readformat.button = 0xFFFF;
|
||||
readformat.stick_x = -1;
|
||||
readformat.stick_y = -1;
|
||||
|
||||
for (i = 0; i < _osContNumControllers; i++) {
|
||||
*cmdBufPtr++ = request;
|
||||
*(__OSContReadFormat*) ptr = readformat;
|
||||
ptr += sizeof(readformat);
|
||||
}
|
||||
cmdBufPtr->padOrEnd = 254;
|
||||
*ptr = CONT_CMD_END;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
#include "libultra_internal.h"
|
||||
|
||||
void osCreateMesgQueue(OSMesgQueue* mq, OSMesg* msgBuf, s32 count) {
|
||||
mq->mtqueue = (OSThread*) &__osThreadTail; //?
|
||||
mq->fullqueue = (OSThread*) &__osThreadTail;
|
||||
mq->mtqueue = (OSThread*) &__osThreadTail.next;
|
||||
mq->fullqueue = (OSThread*) &__osThreadTail.next;
|
||||
mq->validCount = 0;
|
||||
mq->first = 0;
|
||||
mq->msgCount = count;
|
||||
mq->msg = msgBuf;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -44,8 +44,8 @@ void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQ, OSMesg* cmdBuf, s32 cmdMsgC
|
||||
__osPiDevMgr.cmdQueue = cmdQ;
|
||||
__osPiDevMgr.eventQueue = &__osPiMesgQueue;
|
||||
__osPiDevMgr.accessQueue = &gOsPiMessageQueue;
|
||||
__osPiDevMgr.piDmaCallback = osPiRawStartDma;
|
||||
__osPiDevMgr.epiDmaCallback = osEPiRawStartDma;
|
||||
__osPiDevMgr.dma_func = osPiRawStartDma;
|
||||
__osPiDevMgr.edma_func = osEPiRawStartDma;
|
||||
osCreateThread(&piMgrThread, 0, __osDevMgrMain, (void*) &__osPiDevMgr, &piMgrStack[0x400], pri);
|
||||
osStartThread(&piMgrThread);
|
||||
__osRestoreInt(int_disabled);
|
||||
|
||||
@@ -35,7 +35,7 @@ s32 osEepromRead(OSMesgQueue* mq, u8 address, u8* buffer) {
|
||||
ret = __osSiRawStartDma(OS_WRITE, &__osEepPifRam);
|
||||
osRecvMesg(mq, NULL, OS_MESG_BLOCK);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(__osEepPifRam.ramarray) + 1; i++) {
|
||||
for (i = 0; i < ARRLEN(__osEepPifRam.ramarray) + 1; i++) {
|
||||
__osEepPifRam.ramarray[i] = CONT_CMD_NOP;
|
||||
}
|
||||
__osEepPifRam.pifstatus = 0;
|
||||
@@ -66,7 +66,7 @@ void __osPackEepReadData(u8 address) {
|
||||
__OSContEepromFormat eepromformat;
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(__osEepPifRam.ramarray) + 1; i++) {
|
||||
for (i = 0; i < ARRLEN(__osEepPifRam.ramarray) + 1; i++) {
|
||||
__osEepPifRam.ramarray[i] = CONT_CMD_NOP;
|
||||
}
|
||||
__osEepPifRam.pifstatus = CONT_CMD_EXE;
|
||||
@@ -75,7 +75,7 @@ void __osPackEepReadData(u8 address) {
|
||||
eepromformat.rxsize = CONT_CMD_READ_EEPROM_RX;
|
||||
eepromformat.cmd = CONT_CMD_READ_EEPROM;
|
||||
eepromformat.address = address;
|
||||
for (i = 0; i < ARRAY_COUNT(eepromformat.data); i++) {
|
||||
for (i = 0; i < ARRLEN(eepromformat.data); i++) {
|
||||
eepromformat.data[i] = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "libultra_internal.h"
|
||||
#include "osContInternal.h"
|
||||
#include "controller.h"
|
||||
#include "macros.h"
|
||||
|
||||
@@ -37,7 +36,7 @@ s32 osEepromWrite(OSMesgQueue* mq, u8 address, u8* buffer) {
|
||||
ret = __osSiRawStartDma(OS_WRITE, &__osEepPifRam);
|
||||
osRecvMesg(mq, NULL, OS_MESG_BLOCK);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(__osEepPifRam.ramarray) + 1; i++) {
|
||||
for (i = 0; i < ARRLEN(__osEepPifRam.ramarray) + 1; i++) {
|
||||
__osEepPifRam.ramarray[i] = CONT_CMD_NOP;
|
||||
}
|
||||
|
||||
@@ -61,7 +60,7 @@ void __osPackEepWriteData(u8 address, u8* buffer) {
|
||||
__OSContEepromFormat eepromformat;
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(__osEepPifRam.ramarray) + 1; i++) {
|
||||
for (i = 0; i < ARRLEN(__osEepPifRam.ramarray) + 1; i++) {
|
||||
__osEepPifRam.ramarray[i] = CONT_CMD_NOP;
|
||||
}
|
||||
__osEepPifRam.pifstatus = CONT_CMD_EXE;
|
||||
@@ -71,7 +70,7 @@ void __osPackEepWriteData(u8 address, u8* buffer) {
|
||||
eepromformat.cmd = CONT_CMD_WRITE_EEPROM;
|
||||
eepromformat.address = address;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(eepromformat.data); i++) {
|
||||
for (i = 0; i < ARRLEN(eepromformat.data); i++) {
|
||||
eepromformat.data[i] = *buffer++;
|
||||
}
|
||||
|
||||
@@ -89,7 +88,7 @@ s32 __osEepStatus(OSMesgQueue* mq, OSContStatus* data) {
|
||||
u8* ptr = (u8*) __osEepPifRam.ramarray;
|
||||
__OSContRequesFormat requestformat;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(__osEepPifRam.ramarray) + 1; i++) {
|
||||
for (i = 0; i < ARRLEN(__osEepPifRam.ramarray) + 1; i++) {
|
||||
__osEepPifRam.ramarray[i] = 0;
|
||||
}
|
||||
__osEepPifRam.pifstatus = CONT_CMD_EXE;
|
||||
|
||||
@@ -6,6 +6,6 @@ void osViSwapBuffer(void* vaddr) {
|
||||
u32 int_disabled = __osDisableInt();
|
||||
__osViNext->buffer = vaddr;
|
||||
//! @todo figure out what this flag means
|
||||
__osViNext->state |= 0x10;
|
||||
__osViNext->unk00 |= 0x10;
|
||||
__osRestoreInt(int_disabled);
|
||||
}
|
||||
|
||||
@@ -419,7 +419,7 @@ void func_802B5CAC(s16 arg0, s16 arg1, Vec3f arg2) {
|
||||
}
|
||||
|
||||
void func_802B5D30(s16 arg0, s16 arg1, s32 arg2) {
|
||||
func_802B5D64(0x9000000, arg0, arg1, arg2);
|
||||
func_802B5D64((Lights1*) 0x9000000, arg0, arg1, arg2);
|
||||
}
|
||||
|
||||
void func_802B5D64(Lights1* addr, s16 arg1, s16 arg2, s32 arg3) {
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
#include <libultraship.h>
|
||||
#include <common_structs.h>
|
||||
|
||||
// #define sins(x) gSineTable[(u16) (x) >> 4]
|
||||
// #define coss(x) gCosineTable[(u16) (x) >> 4]
|
||||
|
||||
// #define min(a, b) ((a) <= (b) ? (a) : (b))
|
||||
// #define max(a, b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
|
||||
@@ -144,16 +144,16 @@ void func_8028E3A0(void) {
|
||||
|
||||
if (D_80150120) {
|
||||
|
||||
if (gCupCourseSelection == CUP_COURSE_FOUR) {
|
||||
if (gCourseIndexInCup == COURSE_FOUR) {
|
||||
gGotoMode = ENDING;
|
||||
} else {
|
||||
D_800DC544++;
|
||||
gCupCourseSelection++;
|
||||
gCourseIndexInCup++;
|
||||
gGotoMode = RACING;
|
||||
}
|
||||
} else {
|
||||
D_800DC544++;
|
||||
gCupCourseSelection++;
|
||||
gCourseIndexInCup++;
|
||||
gGotoMode = RACING;
|
||||
}
|
||||
}
|
||||
|
||||
+42
-45
@@ -78,7 +78,7 @@ extern u32 isFlycam;
|
||||
void render_course_segments(const char* addr[], struct UnkStruct_800DC5EC* arg1) {
|
||||
Player* player = arg1->player;
|
||||
Camera* camera = arg1->camera;
|
||||
s16 var_a3;
|
||||
s16 direction;
|
||||
s16 index;
|
||||
s16 sp1E;
|
||||
s16 temp_v0_3;
|
||||
@@ -86,31 +86,31 @@ void render_course_segments(const char* addr[], struct UnkStruct_800DC5EC* arg1)
|
||||
if (gIsMirrorMode) {
|
||||
rot = (u16) camera->rot[1];
|
||||
if (rot < 0x2000) {
|
||||
var_a3 = 2;
|
||||
direction = SOUTH;
|
||||
} else if (rot < 0x6000) {
|
||||
var_a3 = 3;
|
||||
direction = WEST;
|
||||
} else if (rot < 0xA000) {
|
||||
var_a3 = 0;
|
||||
direction = NORTH;
|
||||
} else if (rot < 0xE000) {
|
||||
var_a3 = 1;
|
||||
direction = EAST;
|
||||
} else {
|
||||
var_a3 = 2;
|
||||
direction = SOUTH;
|
||||
}
|
||||
} else {
|
||||
rot = (u16) camera->rot[1];
|
||||
if (rot < 0x2000) {
|
||||
var_a3 = 2;
|
||||
direction = SOUTH;
|
||||
} else if (rot < 0x6000) {
|
||||
var_a3 = 1;
|
||||
direction = EAST;
|
||||
} else if (rot < 0xA000) {
|
||||
var_a3 = 0;
|
||||
direction = NORTH;
|
||||
} else if (rot < 0xE000) {
|
||||
var_a3 = 3;
|
||||
direction = WEST;
|
||||
} else {
|
||||
var_a3 = 2;
|
||||
direction = SOUTH;
|
||||
}
|
||||
}
|
||||
arg1->playerDirection = var_a3;
|
||||
arg1->playerDirection = direction;
|
||||
|
||||
if (D_80152300[camera - camera1] == 1) {
|
||||
sp1E = get_track_section_id(camera->collision.meshIndexZX);
|
||||
@@ -176,7 +176,7 @@ void render_course_segments(const char* addr[], struct UnkStruct_800DC5EC* arg1)
|
||||
}
|
||||
|
||||
arg1->pathCounter = index;
|
||||
index = ((index - 1) * 4) + var_a3;
|
||||
index = ((index - 1) * 4) + direction;
|
||||
gSPDisplayList(gDisplayListHead++, addr[index]);
|
||||
|
||||
if (CVarGetInteger("gDisableLod", 0) == 1 && gCurrentCourseId == COURSE_BOWSER_CASTLE &&
|
||||
@@ -530,7 +530,7 @@ void func_8029122C(struct UnkStruct_800DC5EC* arg0, s32 playerId) {
|
||||
void render_mario_raceway(struct UnkStruct_800DC5EC* arg0) {
|
||||
UNUSED s32 pad;
|
||||
u16 sp22 = arg0->pathCounter;
|
||||
u16 temp_t0 = arg0->playerDirection;
|
||||
u16 playerDirection = arg0->playerDirection;
|
||||
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
|
||||
@@ -551,20 +551,20 @@ void render_mario_raceway(struct UnkStruct_800DC5EC* arg0) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 17:
|
||||
if ((temp_t0 == 2) || (temp_t0 == 1)) {
|
||||
if ((playerDirection == 2) || (playerDirection == 1)) {
|
||||
func_802911C4();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (temp_t0 != 0) {
|
||||
if (playerDirection != 0) {
|
||||
func_802911C4();
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (temp_t0 == 0) {
|
||||
if (playerDirection == 0) {
|
||||
func_80291198();
|
||||
} else {
|
||||
if (temp_t0 == 1) {
|
||||
if (playerDirection == 1) {
|
||||
func_80291198();
|
||||
}
|
||||
func_802911C4();
|
||||
@@ -572,7 +572,7 @@ void render_mario_raceway(struct UnkStruct_800DC5EC* arg0) {
|
||||
break;
|
||||
case 5:
|
||||
case 6:
|
||||
if ((temp_t0 == 2) || (temp_t0 == 3)) {
|
||||
if ((playerDirection == 2) || (playerDirection == 3)) {
|
||||
func_802911C4();
|
||||
} else {
|
||||
func_80291198();
|
||||
@@ -580,37 +580,37 @@ void render_mario_raceway(struct UnkStruct_800DC5EC* arg0) {
|
||||
break;
|
||||
case 7:
|
||||
func_80291198();
|
||||
if ((temp_t0 == 2) || (temp_t0 == 3)) {
|
||||
if ((playerDirection == 2) || (playerDirection == 3)) {
|
||||
func_802911C4();
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
case 9:
|
||||
if (temp_t0 != 1) {
|
||||
if (playerDirection != 1) {
|
||||
func_802911C4();
|
||||
}
|
||||
/* fallthrough */
|
||||
case 10:
|
||||
if (temp_t0 != 2) {
|
||||
if (playerDirection != 2) {
|
||||
func_80291198();
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
if (temp_t0 == 0) {
|
||||
if (playerDirection == 0) {
|
||||
func_802911C4();
|
||||
func_80291198();
|
||||
} else if (temp_t0 == 3) {
|
||||
} else if (playerDirection == 3) {
|
||||
func_802911C4();
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
if ((temp_t0 == 0) || (temp_t0 == 3)) {
|
||||
if ((playerDirection == 0) || (playerDirection == 3)) {
|
||||
func_802911C4();
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
case 14:
|
||||
if (temp_t0 != 1) {
|
||||
if (playerDirection != 1) {
|
||||
case 15:
|
||||
case 16:
|
||||
func_802911C4();
|
||||
@@ -712,7 +712,7 @@ void render_bowsers_castle(struct UnkStruct_800DC5EC* arg0) {
|
||||
if (D_802B87BC > 255) {
|
||||
D_802B87BC = 0;
|
||||
}
|
||||
render_course_segments(bowsers_castle_dls, arg0);
|
||||
render_course_segments((uintptr_t) bowsers_castle_dls, arg0);
|
||||
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
|
||||
@@ -785,7 +785,7 @@ void render_yoshi_valley(struct UnkStruct_800DC5EC* arg0) {
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_MODULATEI);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
render_course_segments(yoshi_valley_dls, arg0);
|
||||
render_course_segments((uintptr_t) d_course_yoshi_valley_dl_list, arg0);
|
||||
gDPPipeSync(gDisplayListHead++);
|
||||
}
|
||||
|
||||
@@ -804,7 +804,7 @@ void render_frappe_snowland(struct UnkStruct_800DC5EC* arg0) {
|
||||
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
render_course_segments(frappe_snowland_dls, arg0);
|
||||
render_course_segments((uintptr_t) d_course_frappe_snowland_dl_list, arg0);
|
||||
}
|
||||
|
||||
void render_koopa_troopa_beach(struct UnkStruct_800DC5EC* arg0) {
|
||||
@@ -824,7 +824,7 @@ void render_koopa_troopa_beach(struct UnkStruct_800DC5EC* arg0) {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
// d_course_koopa_troopa_beach_packed_dl_9688
|
||||
gSPDisplayList(gDisplayListHead++, segmented_gfx_to_virtual(0x07009688));
|
||||
render_course_segments(koopa_troopa_beach_dls1, arg0);
|
||||
render_course_segments(d_course_koopa_troopa_beach_dl_list1, arg0);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
|
||||
@@ -971,7 +971,7 @@ void render_luigi_raceway(struct UnkStruct_800DC5EC* arg0) {
|
||||
void render_moo_moo_farm(struct UnkStruct_800DC5EC* arg0) {
|
||||
UNUSED s32 pad[13];
|
||||
s16 temp_s0 = arg0->pathCounter;
|
||||
s16 temp_s1 = arg0->playerDirection;
|
||||
s16 playerDirection = arg0->playerDirection;
|
||||
|
||||
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
@@ -988,53 +988,50 @@ void render_moo_moo_farm(struct UnkStruct_800DC5EC* arg0) {
|
||||
render_course_segments(moo_moo_farm_dls, arg0);
|
||||
|
||||
if ((temp_s0 < 14) && (temp_s0 > 10)) {
|
||||
if ((temp_s1 == 2) || (temp_s1 == 3) || (temp_s1 == 1)) {
|
||||
if ((playerDirection == 2) || (playerDirection == 3) || (playerDirection == 1)) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_13FF8);
|
||||
}
|
||||
|
||||
} else if (temp_s0 < 16) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_13FF8);
|
||||
} else if (temp_s0 < 19) {
|
||||
if (temp_s1 != 2) {
|
||||
if (playerDirection != 2)
|
||||
gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_13FF8);
|
||||
}
|
||||
|
||||
} else if (temp_s0 < 20) {
|
||||
if (temp_s1 == 0) {
|
||||
if (playerDirection == 0)
|
||||
gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_13FF8);
|
||||
}
|
||||
}
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_MODULATEI);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
|
||||
if ((temp_s0 >= 16) && (temp_s0 < 24)) {
|
||||
if ((temp_s1 == 2) || (temp_s1 == 3)) {
|
||||
if ((playerDirection == 2) || (playerDirection == 3)) {
|
||||
// d_course_moo_moo_farm_packed_dl_5410
|
||||
gSPDisplayList(gDisplayListHead++, segmented_gfx_to_virtual(0x07005410));
|
||||
}
|
||||
|
||||
} else if (temp_s0 < 9) {
|
||||
if (temp_s1 == 2) {
|
||||
if (playerDirection == 2) {
|
||||
// d_course_moo_moo_farm_packed_dl_5410
|
||||
gSPDisplayList(gDisplayListHead++, segmented_gfx_to_virtual(0x07005410));
|
||||
}
|
||||
}
|
||||
if (temp_s0 < 4) {
|
||||
if (temp_s1 != 0) {
|
||||
if (playerDirection != 0) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_14060);
|
||||
}
|
||||
|
||||
} else if (temp_s0 < 8) {
|
||||
if (temp_s1 == 2) {
|
||||
if (playerDirection == 2) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_14060);
|
||||
}
|
||||
|
||||
} else if (temp_s0 >= 22) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_14060);
|
||||
} else if (temp_s0 >= 18) {
|
||||
if ((temp_s1 == 0) || (temp_s1 == 3)) {
|
||||
if ((playerDirection == 0) || (playerDirection == 3))
|
||||
gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_14060);
|
||||
}
|
||||
}
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
|
||||
@@ -1056,7 +1053,7 @@ void render_toads_turnpike(struct UnkStruct_800DC5EC* arg0) {
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_PASS2);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2);
|
||||
|
||||
render_course_segments(toads_turnpike_dls, arg0);
|
||||
render_course_segments((uintptr_t) d_course_toads_turnpike_dl_list, arg0);
|
||||
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_DECALRGBA, G_CC_PASS2);
|
||||
@@ -1111,7 +1108,7 @@ void render_sherbet_land(struct UnkStruct_800DC5EC* arg0) {
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_MODULATEI);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
render_course_segments(sherbet_land_dls, arg0);
|
||||
render_course_segments((uintptr_t) sherbet_land_dls, arg0);
|
||||
}
|
||||
|
||||
void render_rainbow_road(UNUSED struct UnkStruct_800DC5EC* arg0) {
|
||||
@@ -1275,7 +1272,7 @@ void render_dks_jungle_parkway(struct UnkStruct_800DC5EC* arg0) {
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
|
||||
render_course_segments(dks_jungle_parkway_dls, arg0);
|
||||
render_course_segments((uintptr_t) d_course_dks_jungle_parkway_unknown_dl_list, arg0);
|
||||
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
}
|
||||
|
||||
@@ -4274,7 +4274,7 @@ void func_800557B4(s32 objectIndex, u32 arg1, u32 arg2) {
|
||||
object->sizeScaling);
|
||||
gSPDisplayList(gDisplayListHead++, D_0D0077D0);
|
||||
render_animated_model((Armature*) object->model, (Animation**) object->vertex,
|
||||
(s16) object->unk_0D8, (s16) object->itemDisplay);
|
||||
(s16) object->unk_0D8, (s16) object->textureListIndex);
|
||||
}
|
||||
} else if (arg1 < 0x15F91U) {
|
||||
func_8004A7AC(objectIndex, 1.5f);
|
||||
@@ -4283,7 +4283,7 @@ void func_800557B4(s32 objectIndex, u32 arg1, u32 arg2) {
|
||||
rsp_set_matrix_transformation(object->pos, object->orientation, object->sizeScaling);
|
||||
gSPDisplayList(gDisplayListHead++, D_0D0077D0);
|
||||
render_animated_model((Armature*) object->model, (Animation**) object->vertex, (s16) object->unk_0D8,
|
||||
(s16) object->itemDisplay);
|
||||
(s16) object->textureListIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4352,7 +4352,7 @@ void func_80055AB8(s32 objectIndex, s32 cameraId) {
|
||||
gSPDisplayList(gDisplayListHead++, D_0D0077D0);
|
||||
render_animated_model((Armature*) gObjectList[objectIndex].model,
|
||||
(Animation**) gObjectList[objectIndex].vertex, 0,
|
||||
(s16) gObjectList[objectIndex].itemDisplay);
|
||||
(s16) gObjectList[objectIndex].textureListIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-12
@@ -246,10 +246,9 @@ u32 func_800B4DF4(u8* arr) {
|
||||
|
||||
// Get a time trial record, infer course index
|
||||
s32 func_800B4E24(s32 recordIndex) {
|
||||
return func_800B4DF4(
|
||||
gSaveData.allCourseTimeTrialRecords.cupRecords[(((gCupSelection * 4) + gCupCourseSelection) / 4)]
|
||||
.courseRecords[(((gCupSelection * 4) + gCupCourseSelection) % 4)]
|
||||
.records[recordIndex]);
|
||||
return func_800B4DF4(gSaveData.allCourseTimeTrialRecords.cupRecords[(((gCupSelection * 4) + gCourseIndexInCup) / 4)]
|
||||
.courseRecords[(((gCupSelection * 4) + gCourseIndexInCup) % 4)]
|
||||
.records[recordIndex]);
|
||||
}
|
||||
|
||||
// Get a time trial record, but take the course index as an argument
|
||||
@@ -261,10 +260,9 @@ u32 func_800B4EB4(s32 recordIndex, s32 courseIndex) {
|
||||
|
||||
// Get Best Lap record of the inferred course index
|
||||
s32 func_800B4F2C(void) {
|
||||
return func_800B4DF4(
|
||||
gSaveData.allCourseTimeTrialRecords.cupRecords[(((gCupSelection * 4) + gCupCourseSelection) / 4)]
|
||||
.courseRecords[(((gCupSelection * 4) + gCupCourseSelection) % 4)]
|
||||
.records[TIME_TRIAL_1LAP_RECORD]);
|
||||
return func_800B4DF4(gSaveData.allCourseTimeTrialRecords.cupRecords[(((gCupSelection * 4) + gCourseIndexInCup) / 4)]
|
||||
.courseRecords[(((gCupSelection * 4) + gCourseIndexInCup) % 4)]
|
||||
.records[TIME_TRIAL_1LAP_RECORD]);
|
||||
}
|
||||
|
||||
// Get the best single lap time record of the given course index
|
||||
@@ -281,7 +279,7 @@ s32 func_800B5020(u32 time, s32 charId) {
|
||||
s32 j;
|
||||
CourseTimeTrialRecords* tt;
|
||||
|
||||
course = gCupSelection * 4 + gCupCourseSelection;
|
||||
course = gCupSelection * 4 + gCourseIndexInCup;
|
||||
tt = &gSaveData.allCourseTimeTrialRecords.cupRecords[course / 4].courseRecords[course % 4];
|
||||
|
||||
i = 0;
|
||||
@@ -328,7 +326,7 @@ s32 func_800B5218(void) {
|
||||
s32 checkLapIndex;
|
||||
s32 character;
|
||||
s32 lapBitmask;
|
||||
recordIndex = (gCupSelection * 4) + gCupCourseSelection;
|
||||
recordIndex = (gCupSelection * 4) + gCourseIndexInCup;
|
||||
recordPointer =
|
||||
&gSaveData.allCourseTimeTrialRecords.cupRecords[recordIndex / 4].courseRecords[recordIndex % 4].records[0][0];
|
||||
lapBitmask = 1;
|
||||
@@ -787,7 +785,7 @@ s32 func_800B6178(s32 arg0) {
|
||||
if (var_v0 == 0) {
|
||||
temp_s3->ghostDataSaved = 1;
|
||||
if (gGamestate == 4) {
|
||||
temp_s3->courseIndex = (gCupSelection * 4) + gCupCourseSelection;
|
||||
temp_s3->courseIndex = (gCupSelection * 4) + gCourseIndexInCup;
|
||||
}
|
||||
temp_s3->unk_00 = D_80162DFC;
|
||||
temp_s3->characterId = (u8) D_80162DE0;
|
||||
@@ -836,7 +834,7 @@ s32 func_800B63F0(s32 arg0) {
|
||||
func_80005AE8(gPlayerThree);
|
||||
|
||||
phi_s3 = 0;
|
||||
if (((gCupSelection * 4) + gCupCourseSelection) != D_8018EE10[arg0].courseIndex) {
|
||||
if (((gCupSelection * 4) + gCourseIndexInCup) != D_8018EE10[arg0].courseIndex) {
|
||||
phi_s3 = 2;
|
||||
} else if (D_80162DFC != D_8018EE10[arg0].unk_00) {
|
||||
phi_s3 = 3;
|
||||
|
||||
+3
-3
@@ -486,7 +486,7 @@ void func_80039DA4(void) {
|
||||
0, 1, 2, 3, 4, 5, 6, 7,
|
||||
};
|
||||
|
||||
if (((gCupCourseSelection == CUP_COURSE_ONE) && (D_8016556E == 0)) || (gDemoMode == 1) ||
|
||||
if (((gCourseIndexInCup == COURSE_ONE) && (D_8016556E == 0)) || (gDemoMode == 1) ||
|
||||
(gDebugMenuSelection == DEBUG_MENU_EXITED)) {
|
||||
for (i = 0; i < NUM_PLAYERS; i++) {
|
||||
D_80165270[i] = sp2C[i];
|
||||
@@ -504,7 +504,7 @@ UNUSED s16 D_800E43A8 = 0;
|
||||
|
||||
void spawn_players_gp_one_player(f32* arg0, f32* arg1, f32 arg2) {
|
||||
func_80039DA4();
|
||||
if (((gCupCourseSelection == CUP_COURSE_ONE) && (D_8016556E == 0)) || (gDemoMode == 1) ||
|
||||
if (((gCourseIndexInCup == COURSE_ONE) && (D_8016556E == 0)) || (gDemoMode == 1) ||
|
||||
(gDebugMenuSelection == DEBUG_MENU_EXITED)) {
|
||||
s16 rand;
|
||||
s16 i;
|
||||
@@ -638,7 +638,7 @@ void spawn_players_versus_one_player(f32* arg0, f32* arg1, f32 arg2) {
|
||||
|
||||
void spawn_players_gp_two_player(f32* arg0, f32* arg1, f32 arg2) {
|
||||
func_80039DA4();
|
||||
if ((gCupCourseSelection == CUP_COURSE_ONE) || (gDemoMode == 1) || (gDebugMenuSelection == DEBUG_MENU_EXITED)) {
|
||||
if ((gCourseIndexInCup == COURSE_ONE) || (gDemoMode == 1) || (gDebugMenuSelection == DEBUG_MENU_EXITED)) {
|
||||
s16 rand;
|
||||
s16 i;
|
||||
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
#ifndef TEXTURES_H
|
||||
#define TEXTURES_H
|
||||
|
||||
#ifndef TARGET_N64
|
||||
#include <libultraship.h>
|
||||
#include <assets/texture_tkmk00.h>
|
||||
#else
|
||||
#include <PR/ultratypes.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief struct for a texture use in menu mainly
|
||||
|
||||
+328
-324
File diff suppressed because it is too large
Load Diff
@@ -26,11 +26,11 @@ void func_800722CC(s32, s32);
|
||||
void func_800722F8(s32, s32);
|
||||
bool func_80072320(s32, s32);
|
||||
bool func_80072354(s32, s32);
|
||||
void set_object_unk_0CB(s32, s32);
|
||||
void set_object_timer_state(s32, s32);
|
||||
void init_object(s32, s32);
|
||||
void func_80072408(s32);
|
||||
void func_80072428(s32);
|
||||
void func_80072488(s32);
|
||||
void object_next_state(s32);
|
||||
void func_800724DC(s32);
|
||||
void func_800724F8(s32, s32);
|
||||
s16 func_80072530(s32);
|
||||
@@ -41,7 +41,7 @@ void func_8007266C(s32);
|
||||
void func_800726CC(s32, s32);
|
||||
void func_8007271C(s32, s32);
|
||||
void func_8007274C(s32);
|
||||
s32 func_8007278C(s32, s32);
|
||||
bool set_and_run_timer_object(s32, s32);
|
||||
s32 func_8007281C(s32, s32);
|
||||
s32 func_800728B0(s32, s32, s32);
|
||||
void func_80072950(s32, s32, s32, s32);
|
||||
|
||||
Reference in New Issue
Block a user