mirror of
https://github.com/n64decomp/mk64
synced 2026-07-30 23:54:31 -04:00
Match func_8006F008 (#519)
This commit is contained in:
+7
-12
@@ -312,8 +312,9 @@ s8 func_800C15D0(u8 bank, u8 soundId, u8 channel) {
|
||||
return var_a0;
|
||||
}
|
||||
|
||||
// This is likely functionally equivallent.
|
||||
#ifdef NON_MATCHING
|
||||
s8 func_800C16E8(f32 arg0, f32 arg1, u8 arg2) {
|
||||
s8 func_800C16E8(f32 arg0, f32 arg1, u8 cameraId) {
|
||||
f32 var_f0;
|
||||
f32 var_f14;
|
||||
f32 var_f16;
|
||||
@@ -333,19 +334,13 @@ s8 func_800C16E8(f32 arg0, f32 arg1, u8 arg2) {
|
||||
var_f16 = 5.0f;
|
||||
var_f18 = 3.3333333f;
|
||||
}
|
||||
if (arg0 < 0.0f) {
|
||||
var_f20 = -arg0;
|
||||
} else {
|
||||
var_f20 = arg0;
|
||||
}
|
||||
var_f20 = (arg0 < 0.0f) ? -arg0 : arg0;
|
||||
|
||||
if (var_f2 < var_f20) {
|
||||
var_f20 = var_f2;
|
||||
}
|
||||
if (arg1 < 0.0f) {
|
||||
var_f0 = -arg1;
|
||||
} else {
|
||||
var_f0 = arg1;
|
||||
}
|
||||
var_f0 = (arg1 < 0.0f) ? -arg1 : arg1;
|
||||
|
||||
if (var_f2 < var_f0) {
|
||||
var_f0 = var_f2;
|
||||
}
|
||||
@@ -366,7 +361,7 @@ s8 func_800C16E8(f32 arg0, f32 arg1, u8 arg2) {
|
||||
}
|
||||
return (s8) (s32) ((var_f2 * 127.0f) + 0.5f);
|
||||
}
|
||||
return (arg2 & 1) * 0x7F;
|
||||
return (cameraId & 1) * 0x7F;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/audio/external/func_800C16E8.s")
|
||||
|
||||
+46
-46
@@ -137,7 +137,7 @@ s32 D_801634F4;
|
||||
Test D_801634F8[10];
|
||||
PathNoY *D_80163598;
|
||||
s32 D_8016359C;
|
||||
TrainStuff sTrains[NUM_TRAINS];
|
||||
TrainStuff gTrains[NUM_TRAINS];
|
||||
u16 isCrossingTriggeredByIndex[2];
|
||||
u16 D_801637BC[2];
|
||||
PaddleWheelBoatStuff gFerries[NUM_PADDLE_WHEEL_BOATS];
|
||||
@@ -4556,20 +4556,20 @@ void init_course_vehicles(void) {
|
||||
switch (gCurrentCourseId) {
|
||||
case COURSE_KALAMARI_DESERT:
|
||||
for(loopIndex = 0; loopIndex < NUM_TRAINS; loopIndex++) {
|
||||
tempLocomotive = &sTrains[loopIndex].locomotive;
|
||||
tempLocomotive = &gTrains[loopIndex].locomotive;
|
||||
origXPos = tempLocomotive->position[0];
|
||||
origZPos = tempLocomotive->position[2];
|
||||
trainCarYRot = func_8000DBAC(tempLocomotive->position, &tempLocomotive->waypointIndex, sTrains[loopIndex].someMultiplier);
|
||||
trainCarYRot = func_8000DBAC(tempLocomotive->position, &tempLocomotive->waypointIndex, gTrains[loopIndex].someMultiplier);
|
||||
tempLocomotive->velocity[0] = tempLocomotive->position[0] - origXPos;
|
||||
tempLocomotive->velocity[2] = tempLocomotive->position[2] - origZPos;
|
||||
vec3s_set(trainCarRot, 0, trainCarYRot, 0);
|
||||
tempLocomotive->actorIndex = addActorToEmptySlot(tempLocomotive->position, trainCarRot, tempLocomotive->velocity, ACTOR_TRAIN_ENGINE);
|
||||
|
||||
tempTender = &sTrains[loopIndex].tender;
|
||||
tempTender = &gTrains[loopIndex].tender;
|
||||
if (tempTender->isActive == 1) {
|
||||
origXPos = tempTender->position[0];
|
||||
origZPos = tempTender->position[2];
|
||||
trainCarYRot = func_8000DBAC(tempTender->position, &tempTender->waypointIndex, sTrains[loopIndex].someMultiplier);
|
||||
trainCarYRot = func_8000DBAC(tempTender->position, &tempTender->waypointIndex, gTrains[loopIndex].someMultiplier);
|
||||
tempTender->velocity[0] = tempTender->position[0] - origXPos;
|
||||
tempTender->velocity[2] = tempTender->position[2] - origZPos;
|
||||
vec3s_set(trainCarRot, 0, trainCarYRot, 0);
|
||||
@@ -4577,11 +4577,11 @@ void init_course_vehicles(void) {
|
||||
}
|
||||
|
||||
for(loopIndex2 = 0; loopIndex2 < NUM_PASSENGER_CAR_ENTRIES; loopIndex2++) {
|
||||
tempPassengerCar = &sTrains[loopIndex].passengerCars[loopIndex2];
|
||||
tempPassengerCar = &gTrains[loopIndex].passengerCars[loopIndex2];
|
||||
if (tempPassengerCar->isActive == 1) {
|
||||
origXPos = tempPassengerCar->position[0];
|
||||
origZPos = tempPassengerCar->position[2];
|
||||
trainCarYRot = func_8000DBAC(tempPassengerCar->position, &tempPassengerCar->waypointIndex, sTrains[loopIndex].someMultiplier);
|
||||
trainCarYRot = func_8000DBAC(tempPassengerCar->position, &tempPassengerCar->waypointIndex, gTrains[loopIndex].someMultiplier);
|
||||
tempPassengerCar->velocity[0] = tempPassengerCar->position[0] - origXPos;
|
||||
tempPassengerCar->velocity[2] = tempPassengerCar->position[2] - origZPos;
|
||||
vec3s_set(trainCarRot, 0, trainCarYRot, 0);
|
||||
@@ -4658,38 +4658,38 @@ void func_800127E0(void) {
|
||||
waypointOffset = (((i * D_8016359C) / NUM_TRAINS) + 160) % D_8016359C;
|
||||
|
||||
// 120.0f is about the maximum usable value
|
||||
sTrains[i].someMultiplier = 5.0f;
|
||||
gTrains[i].someMultiplier = 5.0f;
|
||||
for (j = 0; j < NUM_PASSENGER_CAR_ENTRIES; j++) {
|
||||
waypointOffset += 4;
|
||||
ptr1 = &sTrains[i].passengerCars[j];
|
||||
ptr1 = &gTrains[i].passengerCars[j];
|
||||
ptr2 = &D_80163598[waypointOffset];
|
||||
func_80012780(ptr1, ptr2, waypointOffset);
|
||||
}
|
||||
// Smaller offset for the tender
|
||||
waypointOffset += 3;
|
||||
ptr1 = &sTrains[i].tender;
|
||||
ptr1 = &gTrains[i].tender;
|
||||
ptr2 = &D_80163598[waypointOffset];
|
||||
func_80012780(ptr1, ptr2, waypointOffset);
|
||||
|
||||
waypointOffset += 4;
|
||||
ptr1 = &sTrains[i].locomotive;
|
||||
ptr1 = &gTrains[i].locomotive;
|
||||
ptr2 = &D_80163598[waypointOffset];
|
||||
func_80012780(ptr1, ptr2, waypointOffset);
|
||||
|
||||
// Only use locomotive unless overwritten below.
|
||||
sTrains[i].numCars = LOCOMOTIVE_ONLY;
|
||||
gTrains[i].numCars = LOCOMOTIVE_ONLY;
|
||||
}
|
||||
|
||||
// Spawn all rolling stock in single player mode.
|
||||
switch (gScreenModeSelection) {
|
||||
case SCREEN_MODE_1P: // single player
|
||||
for (i = 0; i < NUM_TRAINS; i++) {
|
||||
sTrains[i].tender.isActive = 1;
|
||||
gTrains[i].tender.isActive = 1;
|
||||
|
||||
// Same line required for matching...
|
||||
for (j = 0; j < NUM_PASSENGER_CAR_ENTRIES; j++) { sTrains[i].passengerCars[j].isActive = 1; }
|
||||
for (j = 0; j < NUM_PASSENGER_CAR_ENTRIES; j++) { gTrains[i].passengerCars[j].isActive = 1; }
|
||||
|
||||
sTrains[i].numCars = NUM_TENDERS + NUM_PASSENGER_CAR_ENTRIES;
|
||||
gTrains[i].numCars = NUM_TENDERS + NUM_PASSENGER_CAR_ENTRIES;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -4698,9 +4698,9 @@ void func_800127E0(void) {
|
||||
case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL:
|
||||
if (gModeSelection != GRAND_PRIX) {
|
||||
for (i = 0; i < NUM_TRAINS; i++) {
|
||||
sTrains[i].tender.isActive = 1;
|
||||
sTrains[i].passengerCars[4].isActive = 1;
|
||||
sTrains[i].numCars = NUM_TENDERS + NUM_2P_PASSENGER_CARS;
|
||||
gTrains[i].tender.isActive = 1;
|
||||
gTrains[i].passengerCars[4].isActive = 1;
|
||||
gTrains[i].numCars = NUM_TENDERS + NUM_2P_PASSENGER_CARS;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -4740,53 +4740,53 @@ void func_80012AC0(void) {
|
||||
D_80162FCC += 1;
|
||||
|
||||
for (i = 0; i < NUM_TRAINS; i++) {
|
||||
temp_s0 = (u16) sTrains[i].locomotive.waypointIndex;
|
||||
temp_s0 = (u16) gTrains[i].locomotive.waypointIndex;
|
||||
|
||||
temp_f20 = sTrains[i].locomotive.position[0];
|
||||
temp_f22 = sTrains[i].locomotive.position[2];
|
||||
temp_f20 = gTrains[i].locomotive.position[0];
|
||||
temp_f22 = gTrains[i].locomotive.position[2];
|
||||
|
||||
temp_v0 = func_8000DBAC(sTrains[i].locomotive.position, &sTrains[i].locomotive.waypointIndex, sTrains[i].someMultiplier);
|
||||
temp_v0 = func_8000DBAC(gTrains[i].locomotive.position, &gTrains[i].locomotive.waypointIndex, gTrains[i].someMultiplier);
|
||||
|
||||
sTrains[i].locomotive.velocity[0] = sTrains[i].locomotive.position[0] - temp_f20;
|
||||
sTrains[i].locomotive.velocity[2] = sTrains[i].locomotive.position[2] - temp_f22;
|
||||
gTrains[i].locomotive.velocity[0] = gTrains[i].locomotive.position[0] - temp_f20;
|
||||
gTrains[i].locomotive.velocity[2] = gTrains[i].locomotive.position[2] - temp_f22;
|
||||
|
||||
func_80012A48(&sTrains[i].locomotive, temp_v0);
|
||||
func_80012A48(&gTrains[i].locomotive, temp_v0);
|
||||
|
||||
if ((temp_s0 != sTrains[i].locomotive.waypointIndex)
|
||||
&& ((sTrains[i].locomotive.waypointIndex == 0x00BE)
|
||||
|| (sTrains[i].locomotive.waypointIndex == 0x0140))) {
|
||||
func_800C98B8(sTrains[i].locomotive.position, sTrains[i].locomotive.velocity, 0x1901800E);
|
||||
if ((temp_s0 != gTrains[i].locomotive.waypointIndex)
|
||||
&& ((gTrains[i].locomotive.waypointIndex == 0x00BE)
|
||||
|| (gTrains[i].locomotive.waypointIndex == 0x0140))) {
|
||||
func_800C98B8(gTrains[i].locomotive.position, gTrains[i].locomotive.velocity, 0x1901800E);
|
||||
} else if (random_int(100) == 0) {
|
||||
func_800C98B8(sTrains[i].locomotive.position, sTrains[i].locomotive.velocity, 0x1901800D);
|
||||
func_800C98B8(gTrains[i].locomotive.position, gTrains[i].locomotive.velocity, 0x1901800D);
|
||||
}
|
||||
|
||||
sTrains[i].someFlags = func_800061DC(sTrains[i].locomotive.position, 2000.0f, sTrains[i].someFlags);
|
||||
if ((((s16) D_80162FCC % 5) == 0) && (sTrains[i].someFlags != 0)) {
|
||||
sp90[0] = sTrains[i].locomotive.position[0];
|
||||
sp90[1] = (f32) ((f64) sTrains[i].locomotive.position[1] + 65.0);
|
||||
sp90[2] = (f32) ((f64) sTrains[i].locomotive.position[2] + 25.0);
|
||||
func_80006114(sp90, sTrains[i].locomotive.position, temp_v0);
|
||||
gTrains[i].someFlags = func_800061DC(gTrains[i].locomotive.position, 2000.0f, gTrains[i].someFlags);
|
||||
if ((((s16) D_80162FCC % 5) == 0) && (gTrains[i].someFlags != 0)) {
|
||||
sp90[0] = gTrains[i].locomotive.position[0];
|
||||
sp90[1] = (f32) ((f64) gTrains[i].locomotive.position[1] + 65.0);
|
||||
sp90[2] = (f32) ((f64) gTrains[i].locomotive.position[2] + 25.0);
|
||||
func_80006114(sp90, gTrains[i].locomotive.position, temp_v0);
|
||||
func_800755FC(i, sp90, 1.1f);
|
||||
}
|
||||
|
||||
car = &sTrains[i].tender;
|
||||
car = &gTrains[i].tender;
|
||||
|
||||
if (car->isActive == 1) {
|
||||
temp_f20 = car->position[0];
|
||||
temp_f22 = car->position[2];
|
||||
temp_v0 = func_8000DBAC(car->position, &car->waypointIndex, sTrains[i].someMultiplier);
|
||||
temp_v0 = func_8000DBAC(car->position, &car->waypointIndex, gTrains[i].someMultiplier);
|
||||
car->velocity[0] = car->position[0] - temp_f20;
|
||||
car->velocity[2] = car->position[2] - temp_f22;
|
||||
func_80012A48(car, temp_v0);
|
||||
}
|
||||
|
||||
for (j = 0; j < NUM_PASSENGER_CAR_ENTRIES; j++) {
|
||||
car = &sTrains[i].passengerCars[j];
|
||||
car = &gTrains[i].passengerCars[j];
|
||||
if (car->isActive == 1) {
|
||||
temp_f20 = car->position[0];
|
||||
temp_f22 = car->position[2];
|
||||
|
||||
temp_v0 = func_8000DBAC(car->position, &car->waypointIndex, sTrains[i].someMultiplier);
|
||||
temp_v0 = func_8000DBAC(car->position, &car->waypointIndex, gTrains[i].someMultiplier);
|
||||
car->velocity[0] = car->position[0] - temp_f20;
|
||||
car->velocity[2] = car->position[2] - temp_f22;
|
||||
func_80012A48(car, temp_v0);
|
||||
@@ -4809,7 +4809,7 @@ void func_80012DC0(s32 playerId, Player *player) {
|
||||
playerPosX = player->pos[0];
|
||||
playerPosZ = player->pos[2];
|
||||
for (trainIndex = 0; trainIndex < NUM_TRAINS; trainIndex++) {
|
||||
trainCar = &sTrains[trainIndex].locomotive;
|
||||
trainCar = &gTrains[trainIndex].locomotive;
|
||||
x_dist = playerPosX - trainCar->position[0];
|
||||
z_dist = playerPosZ - trainCar->position[2];
|
||||
if ((x_dist > -100.0) && (x_dist < 100.0)) {
|
||||
@@ -4817,7 +4817,7 @@ void func_80012DC0(s32 playerId, Player *player) {
|
||||
if (func_80006018(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], trainCar->velocity[2], 60.0f, 20.0f, playerPosX, playerPosZ) == 1) {
|
||||
player->statusEffects |= REVERSE_EFFECT;
|
||||
}
|
||||
trainCar = &sTrains[trainIndex].tender;
|
||||
trainCar = &gTrains[trainIndex].tender;
|
||||
if (trainCar->isActive == 1) {
|
||||
if (func_80006018(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], trainCar->velocity[2], 30.0f, 20.0f, playerPosX, playerPosZ) == 1) {
|
||||
player->statusEffects |= REVERSE_EFFECT;
|
||||
@@ -4827,7 +4827,7 @@ void func_80012DC0(s32 playerId, Player *player) {
|
||||
}
|
||||
|
||||
for (passengerCarIndex = 0; passengerCarIndex < NUM_PASSENGER_CAR_ENTRIES; passengerCarIndex++) {
|
||||
trainCar = &sTrains[trainIndex].passengerCars[passengerCarIndex];
|
||||
trainCar = &gTrains[trainIndex].passengerCars[passengerCarIndex];
|
||||
x_dist = playerPosX - trainCar->position[0];
|
||||
z_dist = playerPosZ - trainCar->position[2];
|
||||
if (trainCar->isActive == 1) {
|
||||
@@ -4858,17 +4858,17 @@ void func_80013054(void) {
|
||||
isCrossingTriggeredByIndex[1] = 0;
|
||||
|
||||
for (i = 0; i < NUM_TRAINS; i++) {
|
||||
temp_f16 = sTrains[i].locomotive.waypointIndex / ((f32) D_8016359C);
|
||||
temp_f16 = gTrains[i].locomotive.waypointIndex / ((f32) D_8016359C);
|
||||
temp_f18 = 0.72017354f;
|
||||
temp_f12 = 0.42299348f;
|
||||
|
||||
if (((temp_f12 - 0.1) < temp_f16)
|
||||
&& (temp_f16 < ((((f64) sTrains[i].numCars) * 0.01) + (temp_f12 + 0.01)))) {
|
||||
&& (temp_f16 < ((((f64) gTrains[i].numCars) * 0.01) + (temp_f12 + 0.01)))) {
|
||||
|
||||
isCrossingTriggeredByIndex[0] = 1;
|
||||
}
|
||||
if (((temp_f18 - 0.1) < temp_f16)
|
||||
&& (temp_f16 < ((((f64) sTrains[i].numCars) * 0.01) + (temp_f18 + 0.01)))) {
|
||||
&& (temp_f16 < ((((f64) gTrains[i].numCars) * 0.01) + (temp_f18 + 0.01)))) {
|
||||
|
||||
isCrossingTriggeredByIndex[1] = 1;
|
||||
}
|
||||
|
||||
+126
-143
@@ -20,6 +20,7 @@
|
||||
#include "main.h"
|
||||
#include "menus.h"
|
||||
#include "data/other_textures.h"
|
||||
#include "hud_renderer.h"
|
||||
|
||||
void init_object_list(void) {
|
||||
|
||||
@@ -250,223 +251,205 @@ void func_8006EF60(void) {
|
||||
GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8006EF60.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 08138748803d75e73e4a94bb0c619a273754ee9c on Oct-09-2023
|
||||
extern s32 D_801655C8;
|
||||
extern s16 D_80165718;
|
||||
extern s16 D_80165720;
|
||||
extern s16 D_80165728;
|
||||
extern u8 *D_80165880;
|
||||
extern f32 D_8018D2A0;
|
||||
extern s16 D_8018D2C0;
|
||||
extern s16 D_8018D2D8;
|
||||
extern s16 D_8018D2E0;
|
||||
extern s16 D_8018D2E8;
|
||||
extern s16 D_8018D300;
|
||||
extern s16 D_8018D308;
|
||||
extern s16 D_8018D310;
|
||||
extern s16 D_8018D318;
|
||||
s16 gCurrentCourseId; /* unable to generate initializer */
|
||||
static u8 gTextureExhaust0[0x479];
|
||||
static u8 gTextureExhaust1[0x485];
|
||||
static u8 gTextureExhaust2[0x4F4];
|
||||
static u8 gTextureExhaust3[0x3C8];
|
||||
static u8 gTextureExhaust4[0x3F8];
|
||||
static u8 gTextureExhaust5[0x443];
|
||||
|
||||
//static u8 gTextureExhaust0[0x479];
|
||||
//static u8 gTextureExhaust1[0x485];
|
||||
//static u8 gTextureExhaust2[0x4F4];
|
||||
//static u8 gTextureExhaust3[0x3C8];
|
||||
//static u8 gTextureExhaust4[0x3F8];
|
||||
//static u8 gTextureExhaust5[0x443];
|
||||
|
||||
void func_8006F008(void) {
|
||||
s16 temp_a0;
|
||||
s16 var_t9;
|
||||
|
||||
D_801655C8 = 0;
|
||||
xOrientation = 1.0f;
|
||||
if (gIsMirrorMode != 0) {
|
||||
xOrientation = -1.0f;
|
||||
}
|
||||
D_8018D2C0.unk0 = 0x0101;
|
||||
D_8018D2D8.unk0 = 0x00AA;
|
||||
D_8018D300 = 0x00FF;
|
||||
D_8018D308 = 0x00FF;
|
||||
temp_a0 = gCurrentCourseId;
|
||||
D_8018D310 = 0x00FF;
|
||||
D_8018D318 = 0x00FF;
|
||||
if (temp_a0 < 0x14) {
|
||||
func_8006EEE8((s32) temp_a0);
|
||||
D_8018D2C0[0] = 257;
|
||||
D_8018D2D8[0] = 170;
|
||||
D_8018D300 = 255;
|
||||
D_8018D308 = 255;
|
||||
D_8018D310 = 255;
|
||||
D_8018D318 = 255;
|
||||
if (gCurrentCourseId < NUM_COURSES - 1) {
|
||||
func_8006EEE8((s32) gCurrentCourseId);
|
||||
}
|
||||
switch (temp_a0) {
|
||||
case 0:
|
||||
D_8018D220 = dma_textures(gTextureExhaust5, 0x00000443U, 0x00001000U);
|
||||
switch (gCurrentCourseId) {
|
||||
case COURSE_MARIO_RACEWAY:
|
||||
D_8018D220 = dma_textures(gTextureExhaust5, 0x443, 0x1000);
|
||||
D_8018D2A0 = 0.022f;
|
||||
D_8018D2E0 = 6;
|
||||
D_8018D2E8 = 0x001C;
|
||||
D_8018D2C0.unk0 = 0x0104;
|
||||
D_8018D2D8.unk0 = 0x00AA;
|
||||
D_8018D2E8 = 28;
|
||||
D_8018D2C0[0] = 260;
|
||||
D_8018D2D8[0] = 170;
|
||||
D_80165718 = 0;
|
||||
D_80165720 = 5;
|
||||
D_80165728 = -0x00F0;
|
||||
D_80165728 = -240;
|
||||
break;
|
||||
case 1:
|
||||
case COURSE_CHOCO_MOUNTAIN:
|
||||
D_8018D2A0 = 0.022f;
|
||||
D_8018D2C0.unk0 = 0x0109;
|
||||
D_8018D2E0 = 0x0013;
|
||||
var_t9 = 0x0025;
|
||||
block_26:
|
||||
D_8018D2E8 = var_t9;
|
||||
D_8018D2C0[0] = 265;
|
||||
D_8018D2E0 = 19;
|
||||
D_8018D2E8 = 37;
|
||||
break;
|
||||
case 2:
|
||||
D_8018D2C0.unk0 = 0x0109;
|
||||
case COURSE_BOWSER_CASTLE:
|
||||
D_8018D2C0[0] = 265;
|
||||
D_8018D2A0 = 0.0174f;
|
||||
D_8018D2E0 = 0x000C;
|
||||
D_8018D2E8 = 0x0030;
|
||||
D_8018D2E0 = 12;
|
||||
D_8018D2E8 = 48;
|
||||
break;
|
||||
case 3:
|
||||
D_80165880 = dma_textures(gTextureGhosts, 0x00004CC2U, 0x0000D980U);
|
||||
case COURSE_BANSHEE_BOARDWALK:
|
||||
D_80165880 = dma_textures(gTextureGhosts, 0x4CC2, 0xD980);
|
||||
D_8018D2A0 = 0.016f;
|
||||
D_8018D2C0.unk0 = 0x0106;
|
||||
D_8018D2E0 = 0x0037;
|
||||
D_8018D2E8 = 0x0027;
|
||||
D_8018D2C0[0] = 0x0106;
|
||||
D_8018D2E0 = 55;
|
||||
D_8018D2E8 = 39;
|
||||
break;
|
||||
case 4:
|
||||
D_8018D220 = dma_textures(gTextureExhaust0, 0x00000479U, 0x00000C00U);
|
||||
case COURSE_YOSHI_VALLEY:
|
||||
D_8018D220 = dma_textures(gTextureExhaust0, 0x479, 0xC00);
|
||||
D_8018D2A0 = 0.018f;
|
||||
D_8018D2E0 = 0x003D;
|
||||
D_8018D2E8 = 0x0026;
|
||||
D_8018D2E0 = 61;
|
||||
D_8018D2E8 = 38;
|
||||
break;
|
||||
case 5:
|
||||
D_8018D2C0.unk0 = 0x0106;
|
||||
case COURSE_FRAPPE_SNOWLAND:
|
||||
D_8018D2C0[0] = 262;
|
||||
D_8018D2A0 = 0.016f;
|
||||
D_8018D2E0 = 0x0024;
|
||||
D_8018D2E8 = 0x0028;
|
||||
D_8018D300 = 0x0048;
|
||||
D_8018D308 = 0x0064;
|
||||
D_8018D310 = 0x00FF;
|
||||
D_8018D2E0 = 36;
|
||||
D_8018D2E8 = 40;
|
||||
D_8018D300 = 72;
|
||||
D_8018D308 = 100;
|
||||
D_8018D310 = 255;
|
||||
break;
|
||||
case 6:
|
||||
D_8018D220 = dma_textures(gTextureExhaust3, 0x000003C8U, 0x00001000U);
|
||||
case COURSE_KOOPA_BEACH:
|
||||
D_8018D220 = dma_textures(gTextureExhaust3, 0x3C8U, 0x1000);
|
||||
D_8018D2A0 = 0.014f;
|
||||
D_8018D2C0.unk0 = 0x010C;
|
||||
D_8018D2E0 = 0x0028;
|
||||
D_8018D2E8 = 0x0015;
|
||||
D_8018D2C0[0] = 268;
|
||||
D_8018D2E0 = 40;
|
||||
D_8018D2E8 = 21;
|
||||
break;
|
||||
case 7:
|
||||
D_8018D220 = dma_textures(gTextureExhaust4, 0x000003F8U, 0x00001000U);
|
||||
D_8018D2C0.unk0 = 0x0106;
|
||||
case COURSE_ROYAL_RACEWAY:
|
||||
D_8018D220 = dma_textures(gTextureExhaust4, 0x3F8, 0x1000);
|
||||
D_8018D2C0[0] = 262;
|
||||
D_8018D2A0 = 0.014f;
|
||||
D_8018D2E0 = 0x0025;
|
||||
D_8018D2E8 = 0x0032;
|
||||
D_80165718 = -0x0040;
|
||||
D_8018D2E0 = 37;
|
||||
D_8018D2E8 = 50;
|
||||
D_80165718 = -64;
|
||||
D_80165720 = 5;
|
||||
D_80165728 = -0x014A;
|
||||
D_80165728 = -330;
|
||||
break;
|
||||
case 8:
|
||||
D_8018D220 = dma_textures(gTextureExhaust2, 0x000004F4U, 0x00000C00U);
|
||||
case COURSE_LUIGI_RACEWAY:
|
||||
D_8018D220 = dma_textures(gTextureExhaust2, 0x4F4U, 0xC00);
|
||||
D_8018D2A0 = 0.0155f;
|
||||
D_8018D2C0.unk0 = 0x010F;
|
||||
D_8018D2E0 = 0x002D;
|
||||
D_8018D2E8 = 0x003C;
|
||||
D_80165718 = -0x008C;
|
||||
D_80165720 = -0x002C;
|
||||
D_80165728 = -0x00D7;
|
||||
D_8018D2C0[0] = 271;
|
||||
D_8018D2E0 = 45;
|
||||
D_8018D2E8 = 60;
|
||||
D_80165718 = -140;
|
||||
D_80165720 = -44;
|
||||
D_80165728 = -215;
|
||||
break;
|
||||
case 9:
|
||||
D_8018D220 = dma_textures(gTextureExhaust0, 0x00000479U, 0x00000C00U);
|
||||
case COURSE_MOO_MOO_FARM:
|
||||
D_8018D220 = dma_textures(gTextureExhaust0, 0x479, 0xC00);
|
||||
D_8018D2A0 = 0.0155f;
|
||||
D_8018D2C0.unk0 = 0x010F;
|
||||
D_8018D2E0 = 0x0012;
|
||||
D_8018D2E8 = 0x0024;
|
||||
D_8018D2C0[0] = 271;
|
||||
D_8018D2E0 = 18;
|
||||
D_8018D2E8 = 36;
|
||||
break;
|
||||
case 10:
|
||||
case COURSE_TOADS_TURNPIKE:
|
||||
D_8018D2A0 = 0.013f;
|
||||
D_8018D2C0.unk0 = 0x00FC;
|
||||
D_8018D2E0 = 0x0039;
|
||||
D_8018D2E8 = 0x002C;
|
||||
D_8018D2C0[0] = 252;
|
||||
D_8018D2E0 = 57;
|
||||
D_8018D2E8 = 44;
|
||||
break;
|
||||
case 11:
|
||||
D_8018D2C0.unk0 = 0x0107;
|
||||
D_8018D2D8.unk0 = 0x00A5;
|
||||
D_8018D220 = dma_textures(gTextureExhaust5, 0x00000443U, 0x00001000U);
|
||||
case COURSE_KALAMARI_DESERT:
|
||||
D_8018D2C0[0] = 263;
|
||||
D_8018D2D8[0] = 165;
|
||||
D_8018D220 = dma_textures(gTextureExhaust5, 0x443, 0x1000);
|
||||
D_8018D2A0 = 0.015f;
|
||||
D_8018D2E0 = 0x0037;
|
||||
D_8018D2E8 = 0x001B;
|
||||
D_8018D2E0 = 55;
|
||||
D_8018D2E8 = 27;
|
||||
break;
|
||||
case 12:
|
||||
D_8018D220 = dma_textures(gTextureExhaust1, 0x00000485U, 0x00000C00U);
|
||||
case COURSE_SHERBET_LAND:
|
||||
D_8018D220 = dma_textures(gTextureExhaust1, 0x485, 0xC00);
|
||||
D_8018D2A0 = 0.015f;
|
||||
D_8018D2C0.unk0 = 0x0106;
|
||||
D_8018D2E0 = 0x0034;
|
||||
D_8018D2E8 = 0x0021;
|
||||
D_8018D300 = 0x0048;
|
||||
D_8018D308 = 0x0064;
|
||||
D_8018D310 = 0x00FF;
|
||||
D_8018D2C0[0] = 262;
|
||||
D_8018D2E0 = 52;
|
||||
D_8018D2E8 = 33;
|
||||
D_8018D300 = 72;
|
||||
D_8018D308 = 100;
|
||||
D_8018D310 = 255;
|
||||
break;
|
||||
case 13:
|
||||
case COURSE_RAINBOW_ROAD:
|
||||
D_8018D2A0 = 0.0103f;
|
||||
D_8018D2C0.unk0 = 0x0105;
|
||||
D_8018D2D8.unk0 = 0x00A6;
|
||||
D_8018D2E0 = 0x0027;
|
||||
D_8018D2E8 = 0x0037;
|
||||
D_8018D2C0[0] = 261;
|
||||
D_8018D2D8[0] = 166;
|
||||
D_8018D2E0 = 39;
|
||||
D_8018D2E8 = 55;
|
||||
break;
|
||||
case 14:
|
||||
case COURSE_WARIO_STADIUM:
|
||||
D_8018D2A0 = 0.0155f;
|
||||
D_8018D2C0.unk0 = 0x0106;
|
||||
D_8018D2E0 = 0x0035;
|
||||
D_8018D2E8 = 0x0023;
|
||||
D_8018D2C0[0] = 0x0106;
|
||||
D_8018D2E0 = 53;
|
||||
D_8018D2E8 = 35;
|
||||
break;
|
||||
case 15:
|
||||
case COURSE_BLOCK_FORT:
|
||||
D_8018D2A0 = 0.0335f;
|
||||
D_8018D2E0 = 0x0020;
|
||||
D_8018D2E8 = 0x0020;
|
||||
D_8018D2E0 = 32;
|
||||
D_8018D2E8 = 32;
|
||||
break;
|
||||
case 16:
|
||||
case COURSE_SKYSCRAPER:
|
||||
D_8018D2A0 = 0.0445f;
|
||||
D_8018D2E0 = 0x0020;
|
||||
D_8018D2E8 = 0x0020;
|
||||
D_8018D2E0 = 32;
|
||||
D_8018D2E8 = 32;
|
||||
break;
|
||||
case 17:
|
||||
case COURSE_DOUBLE_DECK:
|
||||
D_8018D2A0 = 0.0285f;
|
||||
D_8018D2E0 = 0x0020;
|
||||
D_8018D2E8 = 0x0020;
|
||||
D_8018D2E0 = 32;
|
||||
D_8018D2E8 = 32;
|
||||
break;
|
||||
case 18:
|
||||
case COURSE_DK_JUNGLE:
|
||||
D_8018D2A0 = 0.0155f;
|
||||
D_8018D2C0.unk0 = 0x00FF;
|
||||
D_8018D2E0 = 0x001D;
|
||||
D_8018D2E8 = 0x002F;
|
||||
D_8018D2C0[0] = 255;
|
||||
D_8018D2E0 = 29;
|
||||
D_8018D2E8 = 47;
|
||||
break;
|
||||
case 19:
|
||||
case COURSE_BIG_DONUT:
|
||||
D_8018D2A0 = 0.0257f;
|
||||
D_8018D2E0 = 0x0020;
|
||||
var_t9 = 0x001F;
|
||||
goto block_26;
|
||||
D_8018D2E0 = 32;
|
||||
D_8018D2E8 = 31;
|
||||
}
|
||||
if (gIsMirrorMode != 0) {
|
||||
D_8018D2E0 = D_8018D2B0 - D_8018D2E0;
|
||||
}
|
||||
if (gPlayerCount == 4) {
|
||||
D_8018D2C0.unk0 = 0x00A0;
|
||||
D_8018D2D8.unk0 = 0x0078;
|
||||
D_8018D2C0[0] = 160;
|
||||
D_8018D2D8[0] = 120;
|
||||
return;
|
||||
}
|
||||
if (gPlayerCount == 3) {
|
||||
D_8018D2C0.unk0 = 0x00EB;
|
||||
D_8018D2D8.unk0 = 0x00AF;
|
||||
D_8018D2C0[0] = 235;
|
||||
D_8018D2D8[0] = 175;
|
||||
return;
|
||||
}
|
||||
if (gPlayerCount == 2) {
|
||||
if (gCurrentCourseId != 0x000A) {
|
||||
D_8018D2C0.unk2 = 0x0109;
|
||||
D_8018D2C0.unk0 = D_8018D2C0.unk2;
|
||||
if (gCurrentCourseId != 10) {
|
||||
D_8018D2C0[1] = 265;
|
||||
D_8018D2C0[0] = D_8018D2C0[1];
|
||||
} else {
|
||||
D_8018D2C0.unk2 = 0x00FF;
|
||||
D_8018D2C0.unk0 = D_8018D2C0.unk2;
|
||||
D_8018D2C0[1] = 255;
|
||||
D_8018D2C0[0] = D_8018D2C0[1];
|
||||
}
|
||||
D_8018D2D8.unk0 = 0x0041;
|
||||
D_8018D2D8.unk2 = 0x00B4;
|
||||
D_8018D2D8[0] = 65;
|
||||
D_8018D2D8[1] = 180;
|
||||
}
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8006F008.s")
|
||||
#endif
|
||||
|
||||
extern s8 D_801657E4;
|
||||
extern bool8 D_801657E6;
|
||||
|
||||
+2
-2
@@ -1644,7 +1644,7 @@ void func_80075838(void) {
|
||||
if (D_80165790 != 0) {
|
||||
D_80165790 -= 1;
|
||||
}
|
||||
if ((sTrains[0].someFlags != 0) || (D_8016578C != 0)) {
|
||||
if ((gTrains[0].someFlags != 0) || (D_8016578C != 0)) {
|
||||
count = 0;
|
||||
for (i = 0; i < 128; i++) {
|
||||
temp_a0 = D_8018C3F0[i];
|
||||
@@ -1663,7 +1663,7 @@ void func_80075838(void) {
|
||||
D_8016578C = 100;
|
||||
}
|
||||
}
|
||||
if ((sTrains[1].someFlags != 0) || (D_80165790 != 0)) {
|
||||
if ((gTrains[1].someFlags != 0) || (D_80165790 != 0)) {
|
||||
count = 0;
|
||||
for (i = 0; i < 128; i++) {
|
||||
temp_a0 = D_8018C630[i];
|
||||
|
||||
+3
-3
@@ -3685,7 +3685,7 @@ void func_800541BC(s32 cameraId) {
|
||||
// Render smoke for any number of trains. Don't know enough about these variables yet.
|
||||
#ifdef AVOID_UB_WIP
|
||||
for (j = 0; j < NUM_TRAINS; j++) {
|
||||
if ((sTrains[j].someFlags != 0) && (func_80041980(&sTrains[j].locomotive.position, camera, 0x4000U) != 0)) {
|
||||
if ((gTrains[j].someFlags != 0) && (func_80041980(&gTrains[j].locomotive.position, camera, 0x4000U) != 0)) {
|
||||
|
||||
for (i = 0; i < 128; i++) {
|
||||
// Need to make a way to increase this array for each train.
|
||||
@@ -3695,14 +3695,14 @@ void func_800541BC(s32 cameraId) {
|
||||
}
|
||||
#else
|
||||
|
||||
if ((sTrains[0].someFlags != 0) && (func_80041980(&sTrains[0].locomotive.position, camera, 0x4000U) != 0)) {
|
||||
if ((gTrains[0].someFlags != 0) && (func_80041980(&gTrains[0].locomotive.position, camera, 0x4000U) != 0)) {
|
||||
|
||||
for (i = 0; i < D_8018C3F0_SIZE; i++) {
|
||||
func_800540CC(D_8018C3F0[i], cameraId);
|
||||
}
|
||||
|
||||
}
|
||||
if ((sTrains[1].someFlags != 0) && (func_80041980(&sTrains[1].locomotive.position, camera, 0x4000U) != 0)) {
|
||||
if ((gTrains[1].someFlags != 0) && (func_80041980(&gTrains[1].locomotive.position, camera, 0x4000U) != 0)) {
|
||||
for (i = 0; i < D_8018C630_SIZE; i++) {
|
||||
func_800540CC(D_8018C630[i], cameraId);
|
||||
}
|
||||
|
||||
@@ -477,6 +477,7 @@ extern s16 D_8018D2F8;
|
||||
extern u16 D_8018D300;
|
||||
extern u16 D_8018D308;
|
||||
extern u16 D_8018D310;
|
||||
extern u16 D_8018D318;
|
||||
extern s32 D_8018D3E0; // some alpha
|
||||
extern s32 D_8018D3E4; // some red
|
||||
extern s32 D_8018D3E8; // some green
|
||||
|
||||
+1
-1
@@ -378,7 +378,7 @@ UNUSED u8 *func_802A841C(u8* arg0, s32 arg1, s32 arg2) {
|
||||
return temp_v0;
|
||||
}
|
||||
|
||||
u8 *dma_textures(u8 texture[], u32 arg1, u32 arg2) {
|
||||
u8 *dma_textures(u8 texture[], size_t arg1, size_t arg2) {
|
||||
u8 *temp_v0;
|
||||
void *temp_a0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user