Finishwide screen. Impl IVector2D MinimapDimensions

This commit is contained in:
MegaMech
2025-01-05 12:26:27 -07:00
parent 5ee24ab2aa
commit e993944089
46 changed files with 196 additions and 253 deletions
@@ -26,8 +26,8 @@ glabel func_8004F168
/* 04FDC8 8004F1C8 46002082 */ mul.s $f2, $f4, $f0
/* 04FDCC 8004F1CC 01284821 */ addu $t1, $t1, $t0
/* 04FDD0 8004F1D0 3C0A8019 */ lui $t2, %hi(D_8018D2F0) # $t2, 0x8019
/* 04FDD4 8004F1D4 3C0C8019 */ lui $t4, %hi(D_8018D2B0) # $t4, 0x8019
/* 04FDD8 8004F1D8 858CD2B0 */ lh $t4, %lo(D_8018D2B0)($t4)
/* 04FDD4 8004F1D4 3C0C8019 */ lui $t4, %hi(gMinimapWidth) # $t4, 0x8019
/* 04FDD8 8004F1D8 858CD2B0 */ lh $t4, %lo(gMinimapWidth)($t4)
/* 04FDDC 8004F1DC 854AD2F0 */ lh $t2, %lo(D_8018D2F0)($t2)
/* 04FDE0 8004F1E0 8529D2C0 */ lh $t1, %lo(D_8018D2C0)($t1) # -0x2d40($t1)
/* 04FDE4 8004F1E4 4600120D */ trunc.w.s $f8, $f2
@@ -50,9 +50,9 @@ glabel func_8004F168
/* 04FE24 8004F224 00084C00 */ sll $t1, $t0, 0x10
/* 04FE28 8004F228 85ADD2D8 */ lh $t5, %lo(D_8018D2D8)($t5) # -0x2d28($t5)
/* 04FE2C 8004F22C 85CED2F8 */ lh $t6, %lo(D_8018D2F8)($t6)
/* 04FE30 8004F230 3C198019 */ lui $t9, %hi(D_8018D2B8) # $t9, 0x8019
/* 04FE30 8004F230 3C198019 */ lui $t9, %hi(gMinimapHeight) # $t9, 0x8019
/* 04FE34 8004F234 4600628D */ trunc.w.s $f10, $f12
/* 04FE38 8004F238 8739D2B8 */ lh $t9, %lo(D_8018D2B8)($t9)
/* 04FE38 8004F238 8739D2B8 */ lh $t9, %lo(gMinimapHeight)($t9)
/* 04FE3C 8004F23C 00095403 */ sra $t2, $t1, 0x10
/* 04FE40 8004F240 030A2021 */ addu $a0, $t8, $t2
/* 04FE44 8004F244 3C188019 */ lui $t8, %hi(D_8018D2E8) # $t8, 0x8019
+2 -2
View File
@@ -1037,14 +1037,14 @@ void func_800591B4(void) {
if (D_80165800[0] != 0) {
func_8004EE54(0);
if (gModeSelection != BATTLE) {
func_8004F020(0);
set_minimap_finishline_position(0);
}
func_8004F3E4(0);
}
if ((gScreenModeSelection == SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL) && (D_80165800[1] != 0)) {
func_8004EE54(1);
if (gModeSelection != BATTLE) {
func_8004F020(1);
set_minimap_finishline_position(1);
}
func_8004F3E4(1);
}
+2 -4
View File
@@ -546,17 +546,15 @@ extern u8* D_8018D248[];
extern f32 D_8018D2A0;
extern s32 D_8018D2A4;
extern s32 D_8018D2AC;
extern s16 D_8018D2B0;
extern s16 gMinimapWidth;
extern s32 D_8018D2B4;
extern s16 D_8018D2B8;
extern s16 gMinimapHeight;
extern s32 D_8018D2BC;
extern s16 D_8018D2C0[];
extern s32 D_8018D2C8[];
extern s16 D_8018D2D8[];
extern s16 D_8018D2E0;
extern s16 D_8018D2E8;
extern s16 D_8018D2F0;
extern s16 D_8018D2F8;
extern u16 D_8018D300;
extern u16 D_8018D308;
extern u16 D_8018D310;
+2 -4
View File
@@ -111,9 +111,9 @@ f32 D_8018D2A0;
s32 D_8018D2A4;
UNUSED s32 D_8018D2A8;
s32 D_8018D2AC;
s16 D_8018D2B0;
s16 gMinimapWidth;
s32 D_8018D2B4;
s16 D_8018D2B8;
s16 gMinimapHeight;
s32 D_8018D2BC;
s16 D_8018D2C0[4];
s32 D_8018D2C8[4];
@@ -122,9 +122,7 @@ s16 D_8018D2E0;
UNUSED s32 D_8018D2E4;
s16 D_8018D2E8;
UNUSED s32 D_8018D2EC;
s16 D_8018D2F0;
UNUSED s32 D_8018D2F4;
s16 D_8018D2F8;
UNUSED s32 D_8018D2FC;
u16 D_8018D300;
UNUSED s32 D_8018D304;
+5 -7
View File
@@ -165,10 +165,10 @@ void init_item_window(s32 objectIndex) {
void func_8006EEE8(s32 courseId) {
D_8018D240 = (uintptr_t) CourseManager_GetProps()->MinimapTexture;
// This is incredibly dumb. D_800E5548 ought to be something more like
// `u16 D_800E5548[][2]` but that doesn't match for some insane reason
D_8018D2B0 = CourseManager_GetProps()->D_800E5548[0]; // D_800E5548[courseId * 2];
D_8018D2B8 = CourseManager_GetProps()->D_800E5548[1]; // D_800E5548[courseId * 2 + 1];
// This is incredibly dumb. MinimapDimensions ought to be something more like
// `u16 MinimapDimensions[][2]` but that doesn't match for some insane reason
gMinimapWidth = CourseManager_GetProps()->MinimapDimensions.X; // MinimapDimensions[courseId * 2];
gMinimapHeight = CourseManager_GetProps()->MinimapDimensions.Z; // MinimapDimensions[courseId * 2 + 1];
}
void func_8006EF60(void) {
@@ -345,7 +345,7 @@ void func_8006F008(void) {
// D_8018D2E8 = 31;
}
if (gIsMirrorMode != 0) {
D_8018D2E0 = D_8018D2B0 - D_8018D2E0;
D_8018D2E0 = gMinimapWidth - D_8018D2E0;
}
if (gPlayerCount == 4) {
D_8018D2C0[0] = 160;
@@ -572,8 +572,6 @@ void func_8006FA94(void) {
gHUDDisable = D_8018D214;
D_801657AE = gHUDDisable;
D_8018D20C = 0;
D_8018D2F8 = 0;
D_8018D2F0 = D_8018D2F8;
D_8018D320 = 3;
D_8018D2AC = 0;
D_8018D2BC = 0;
-1
View File
@@ -32,7 +32,6 @@ void init_hud_three_four_player(void);
void init_hud_two_player_horizontal(void);
extern s16 D_800E5520[];
extern s16 D_800E5548[];
extern u8* gCourseOutlineTextures[0x14]; // 800e54d0
#endif
+1 -1
View File
@@ -206,7 +206,7 @@ s16 D_800E5520[] = {
0x1000, 0x0c00, 0x0800, 0x0c00, 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x0800,
};
s16 D_800E5548[] = {
s16 minimapDimensions[] = {
0x0040, 0x0040, 0x0040, 0x0040, 0x0040, 0x0040, 0x0040, 0x0040, 0x0040, 0x0040, 0x0040,
0x0040, 0x0040, 0x0040, 0x0040, 0x0040, 0x0040, 0x0060, 0x0040, 0x0040, 0x0080, 0x0040,
0x0040, 0x0060, 0x0040, 0x0040, 0x0040, 0x0060, 0x0040, 0x0040, 0x0040, 0x0040, 0x0040,
+1 -1
View File
@@ -25,7 +25,7 @@ extern Vtx gBalloonVertexPlane1[];
extern Vtx gBalloonVertexPlane2[];
extern u8* gCourseOutlineTextures[];
extern s16 D_800E5520[];
extern s16 D_800E5548[];
extern s16 minimapDimensions[];
extern u16 D_800E55A0[];
extern u16 D_800E55B0[];
extern u8 D_800E55D0[][3];
+99
View File
@@ -0,0 +1,99 @@
#pragma once
#include <libultraship.h>
/**
* @file CoreMath.h
*
* Basic vector structs for manipulating 2D and 3D coordinates
*
*/
struct FVector {
float x, y, z;
FVector& operator=(const FVector& other) {
x = other.x;
y = other.y;
z = other.z;
return *this;
}
};
/**
* For providing X and Z when you do not need Y
* Some actors set themselves on the surface automatically
* which means it does not use a Y coordinate
* The train follows a set Y value. The hedgehog's patrolPoint only uses X and Z.
*/
struct FVector2D {
float x, z;
FVector2D& operator=(const FVector2D& other) {
x = other.x;
z = other.z;
return *this;
}
};
// Sets integer X Z coordinates
struct IVector2D {
int32_t X, Z;
IVector2D() : X(0), Z(0) {} // Default constructor
IVector2D(int32_t x, int32_t z) : X(x), Z(z) {} // Constructor to initialize with values
IVector2D& operator=(const IVector2D& other) {
X = other.X;
Z = other.Z;
return *this;
}
};
struct FRotation {
float pitch, yaw, roll;
FRotation& operator=(const FRotation& other) {
pitch = other.pitch;
yaw = other.yaw;
roll = other.roll;
return *this;
}
};
/**
* For selecting a section of a course path
* Usage: IPathSpan(point1, point2) --> IPathSpan(40, 65)
*/
struct IPathSpan {
int Start, End;
// Default Constructor
IPathSpan() : Start(0), End(0) {}
// Parameterized Constructor
IPathSpan(int InStart, int InEnd)
: Start(InStart), End(InEnd) {}
// Copy Assignment Operator
IPathSpan& operator=(const IPathSpan& Other) {
if (this != &Other) { // Avoid self-assignment
Start = Other.Start;
End = Other.End;
}
return *this;
}
// Equality Operator
bool operator==(const IPathSpan& Other) const {
return Start == Other.Start && End == Other.End;
}
// Inequality Operator
bool operator!=(const IPathSpan& Other) const {
return !(*this == Other);
}
};
+6 -1
View File
@@ -20,6 +20,11 @@ typedef struct {
RGB8 FloorTopLeft;
} SkyboxColours;
typedef struct {
int32_t X;
int32_t Z;
} IVector2D_C;
typedef struct {
const char* Id;
const char* Name;
@@ -28,7 +33,7 @@ typedef struct {
const char* AIBehaviour;
const char* MinimapTexture;
s32 LakituTowType;
s16 D_800E5548[2];
IVector2D_C MinimapDimensions;
float AIMaximumSeparation;
float AIMinimumSeparation;
float NearPersp;
+1 -74
View File
@@ -1,6 +1,7 @@
#pragma once
#include <libultraship.h>
#include "CoreMath.h"
#include "objects/Object.h"
#include "Cup.h"
#include "vehicles/Vehicle.h"
@@ -24,80 +25,6 @@ extern "C" {
#include "engine/Engine.h"
};
struct FVector {
float x, y, z;
FVector& operator=(const FVector& other) {
x = other.x;
y = other.y;
z = other.z;
return *this;
}
};
/**
* For providing X and Z when you do not need Y
* Some actors set themselves on the surface automatically
* which means it does not use a Y coordinate
* The train follows a set Y value. The hedgehog's patrolPoint only uses X and Z.
*/
struct FVector2D {
float x, z;
FVector2D& operator=(const FVector2D& other) {
x = other.x;
z = other.z;
return *this;
}
};
struct FRotation {
float pitch, yaw, roll;
FRotation& operator=(const FRotation& other) {
pitch = other.pitch;
yaw = other.yaw;
roll = other.roll;
return *this;
}
};
/**
* For selecting a section of a course path
* Usage: IPathSpan(point1, point2) --> IPathSpan(40, 65)
*/
struct IPathSpan {
int Start, End;
// Default Constructor
IPathSpan() : Start(0), End(0) {}
// Parameterized Constructor
IPathSpan(int InStart, int InEnd)
: Start(InStart), End(InEnd) {}
// Copy Assignment Operator
IPathSpan& operator=(const IPathSpan& Other) {
if (this != &Other) { // Avoid self-assignment
Start = Other.Start;
End = Other.End;
}
return *this;
}
// Equality Operator
bool operator==(const IPathSpan& Other) const {
return Start == Other.Start && End == Other.End;
}
// Inequality Operator
bool operator!=(const IPathSpan& Other) const {
return !(*this == Other);
}
};
class OObject;
class Cup; // <-- Forward declaration
class Course;
+1 -2
View File
@@ -68,8 +68,7 @@ BansheeBoardwalk::BansheeBoardwalk() {
this->gfxSize = 3689;
Props.textures = banshee_boardwalk_textures;
Props.MinimapTexture = gTextureCourseOutlineBansheeBoardwalk;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Id = "mk:banshee_boardwalk";
Props.Name = "banshee boardwalk";
+1 -2
View File
@@ -44,8 +44,7 @@ BigDonut::BigDonut() {
this->gfxSize = 528;
Props.textures = big_donut_textures;
Props.MinimapTexture = gTextureCourseOutlineBigDonut;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Name = "big donut";
Props.DebugName = "doughnut";
+2 -2
View File
@@ -46,8 +46,8 @@ BlockFort::BlockFort() {
this->gfxSize = 699;
Props.textures = block_fort_textures;
Props.MinimapTexture = gTextureCourseOutlineBlockFort;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Name = "block fort";
Props.DebugName = "block";
+1 -2
View File
@@ -72,8 +72,7 @@ BowsersCastle::BowsersCastle() {
this->gfxSize = 4900;
Props.textures = bowsers_castle_textures;
Props.MinimapTexture = gTextureCourseOutlineBowsersCastle;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Id = "mk:bowsers_castle";
Props.Name = "bowser's castle";
+1 -2
View File
@@ -64,8 +64,7 @@ ChocoMountain::ChocoMountain() {
this->gfxSize = 2910;
Props.textures = choco_mountain_textures;
Props.MinimapTexture = gTextureCourseOutlineChocoMountain;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Id = "mk:choco_mountain";
Props.Name = "choco mountain";
+2 -2
View File
@@ -3,9 +3,9 @@
#include <libultraship.h>
// C-compatible function declaration
#ifdef __cplusplus
#include "CoreMath.h"
#include "engine/objects/Lakitu.h"
extern "C" {
#endif
@@ -57,7 +57,7 @@ public:
const char* AIBehaviour;
const char* MinimapTexture;
s32 LakituTowType;
s16 D_800E5548[2];
IVector2D MinimapDimensions;
float AIMaximumSeparation;
float AIMinimumSeparation;
float NearPersp;
+1 -2
View File
@@ -72,8 +72,7 @@ DKJungle::DKJungle() {
this->gfxSize = 4997;
Props.textures = dks_jungle_parkway_textures;
Props.MinimapTexture = gTextureCourseOutlineDksJungleParkway;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Name = "d.k.'s jungle parkway";
Props.DebugName = "jungle";
+1 -2
View File
@@ -44,8 +44,7 @@ DoubleDeck::DoubleDeck() {
this->gfxSize = 699;
Props.textures = double_deck_textures;
Props.MinimapTexture = gTextureCourseOutlineDoubleDeck;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Name = "double deck";
Props.DebugName = "deck";
+2 -2
View File
@@ -5,6 +5,7 @@
#include "FrappeSnowland.h"
#include "World.h"
#include "CoreMath.h"
#include "engine/actors/AFinishline.h"
#include "engine/objects/BombKart.h"
#include "engine/objects/Snowman.h"
@@ -51,8 +52,7 @@ FrappeSnowland::FrappeSnowland() {
this->gfxSize = 4140;
Props.textures = frappe_snowland_textures;
Props.MinimapTexture = gTextureCourseOutlineFrappeSnowland;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Name = "frappe snowland";
Props.DebugName = "snow";
+1 -2
View File
@@ -58,8 +58,7 @@ KalimariDesert::KalimariDesert() {
this->gfxSize = 5328;
Props.textures = kalimari_desert_textures;
Props.MinimapTexture = gTextureCourseOutlineKalimariDesert;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 96;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Name = "kalimari desert";
Props.DebugName = "desert";
+1
View File
@@ -1,6 +1,7 @@
#pragma once
#include <libultraship.h>
#include "CoreMath.h"
#include "Course.h"
#include "engine/vehicles/Train.h"
+2 -2
View File
@@ -1,5 +1,6 @@
#include <libultraship.h>
#include <libultra/gbi.h>
#include "../CoreMath.h"
#include <vector>
#include <memory>
@@ -61,8 +62,7 @@ KoopaTroopaBeach::KoopaTroopaBeach() {
this->gfxSize = 5720;
Props.textures = koopa_troopa_beach_textures;
Props.MinimapTexture = gTextureCourseOutlineKoopaTroopaBeach;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Id = "mk:koopa_beach";
Props.Name = "koopa troopa beach";
+1
View File
@@ -1,6 +1,7 @@
#pragma once
#include <libultraship.h>
#include "../CoreMath.h"
#include "Course.h"
#include "World.h"
+1 -2
View File
@@ -88,8 +88,7 @@ LuigiRaceway::LuigiRaceway() {
this->gfxSize = 6377;
Props.textures = luigi_raceway_textures;
Props.MinimapTexture = gTextureCourseOutlineLuigiRaceway;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 96;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Id = "mk:luigi_raceway";
Props.Name = "luigi raceway";
+1 -2
View File
@@ -73,8 +73,7 @@ MarioRaceway::MarioRaceway() {
this->gfxSize = 3367;
Props.textures = mario_raceway_textures;
Props.MinimapTexture = gTextureCourseOutlineMarioRaceway;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Id = "mk:mario_raceway";
Props.Name = "Mario Raceway";
+1 -2
View File
@@ -74,8 +74,7 @@ MooMooFarm::MooMooFarm() {
this->gfxSize = 3304;
Props.textures = moo_moo_farm_textures;
Props.MinimapTexture = gTextureCourseOutlineMooMooFarm;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Name = "moo moo farm";
Props.DebugName = "farm";
+1 -2
View File
@@ -89,8 +89,7 @@ PodiumCeremony::PodiumCeremony() {
this->gfx = d_course_royal_raceway_packed_dls;
this->gfxSize = 5670;
Props.textures = podium_ceremony_textures;
Props.D_800E5548[0] = 0;
Props.D_800E5548[1] = 0;
Props.MinimapDimensions = IVector2D(0, 0);
Props.Name = "royal raceway";
Props.DebugName = "p circuit";
+1
View File
@@ -1,6 +1,7 @@
#pragma once
#include <libultraship.h>
#include "CoreMath.h"
#include "Course.h"
extern "C" {
+1 -2
View File
@@ -48,8 +48,7 @@ RainbowRoad::RainbowRoad() {
this->gfxSize = 5670;
Props.textures = rainbow_road_textures;
Props.MinimapTexture = gTextureCourseOutlineRainbowRoad;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 96;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Name = "rainbow road";
Props.DebugName = "rainbow";
+1 -2
View File
@@ -86,8 +86,7 @@ RoyalRaceway::RoyalRaceway() {
this->gfxSize = 5670;
Props.textures = royal_raceway_textures;
Props.MinimapTexture = gTextureCourseOutlineRoyalRaceway;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Name = "royal raceway";
Props.DebugName = "p circuit";
+1 -2
View File
@@ -49,8 +49,7 @@ SherbetLand::SherbetLand() {
this->gfxSize = 1803;
Props.textures = sherbet_land_textures;
Props.MinimapTexture = gTextureCourseOutlineSherbetLand;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Name = "sherbet land";
Props.DebugName = "sherbet";
+1 -2
View File
@@ -65,8 +65,7 @@ Skyscraper::Skyscraper() {
this->gfxSize = 548;
Props.textures = skyscraper_textures;
Props.MinimapTexture = gTextureCourseOutlineSkyscraper;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Name = "skyscraper";
Props.DebugName = "skyscraper";
+2 -2
View File
@@ -1,5 +1,6 @@
#include <libultraship.h>
#include <libultra/gbi.h>
#include "CoreMath.h"
#include <vector>
#include <memory>
@@ -61,8 +62,7 @@ TestCourse::TestCourse() {
this->gfxSize = 100;
this->textures = NULL;
Props.MinimapTexture = gTextureCourseOutlineMarioRaceway;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Id = "mk:test_course";
Props.Name = "Test Course";
+1 -2
View File
@@ -70,8 +70,7 @@ ToadsTurnpike::ToadsTurnpike() {
this->gfxSize = 3427;
Props.textures = toads_turnpike_textures;
Props.MinimapTexture = gTextureCourseOutlineToadsTurnpike;
Props.D_800E5548[0] = 128;
Props.D_800E5548[1] = 64;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Name = "toad's turnpike";
Props.DebugName = "highway";
+1 -2
View File
@@ -66,8 +66,7 @@ WarioStadium::WarioStadium() {
this->gfxSize = 5272;
Props.textures = wario_stadium_textures;
Props.MinimapTexture = gTextureCourseOutlineWarioStadium;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Name = "wario stadium";
Props.DebugName = "stadium";
+2 -2
View File
@@ -1,5 +1,6 @@
#include <libultraship.h>
#include <libultra/gbi.h>
#include "CoreMath.h"
#include <vector>
#include <memory>
@@ -60,8 +61,7 @@ YoshiValley::YoshiValley() {
Props.textures = yoshi_valley_textures;
Props.MinimapTexture = gTextureCourseOutlineYoshiValley;
Props.D_800E5548[0] = 64;
Props.D_800E5548[1] = 64;
Props.MinimapDimensions = IVector2D(ResourceGetTexWidthByName(Props.MinimapTexture), ResourceGetTexHeightByName(Props.MinimapTexture));
Props.Name = "yoshi valley";
Props.DebugName = "maze";
+2
View File
@@ -2,6 +2,8 @@
#include <libultra/gbi.h>
#include "Crab.h"
#include <vector>
#include "CoreMath.h"
#include "port/Game.h"
+1
View File
@@ -3,6 +3,7 @@
#include <libultraship.h>
#include <vector>
#include "engine/objects/Object.h"
#include "CoreMath.h"
#include "World.h"
extern "C" {
-16
View File
@@ -730,22 +730,6 @@ void func_80042330_default(s32 x, s32 y, u16 angle, f32 scale) {
AddHudMatrix(matrix, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
// Centers in an area of the screen for 3P mode
void func_80042330_3P(s32 x, s32 y, u16 angle, f32 scale) {
Mat4 matrix;
s32 offset = ((OTRGetDimensionFromRightEdge(SCREEN_WIDTH) - SCREEN_WIDTH) / 2);
// + 5 is just an alignment guess.
x += offset + 5;
mtxf_translation_x_y_rotate_z_scale_x_y(matrix, x, y, angle, scale);
// convert_to_fixed_point_matrix(&gGfxPool->mtxHud[gMatrixHudCount], matrix);
// gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]),
// G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
AddHudMatrix(matrix, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
void func_80042330_portrait(s32 x, s32 y, u16 angle, f32 scale, s16 lapCount) {
Mat4 matrix;
//printf("panel %d %d %d\n", x, (s32)OTRGetDimensionFromLeftEdge(x), (s32)OTRGetDimensionFromLeftEdge(0));
-1
View File
@@ -71,7 +71,6 @@ void func_80041D34(void);
void set_matrix_hud_screen(void);
void func_80042330(s32, s32, u16, f32);
void func_80042330_default(s32 x, s32 y, u16 angle, f32 scale);
void func_80042330_3P(s32 x, s32 y, u16 angle, f32 scale);
void func_80042330_portrait(s32, s32, u16, f32, s16);
void func_80042330_wide(s32, s32, u16, f32);
void mtxf_set_matrix_transformation(Mat4, Vec3f, Vec3su, f32);
+2 -1
View File
@@ -3480,7 +3480,7 @@ void load_texture(const char* texture) {
}
/**
* If you need to reset a texture cache after a modification,
* If you need to reset a texture after a modification,
* this will reload the texture.
*/
void load_texture_reset_cache(const char* texture) {
@@ -3500,6 +3500,7 @@ void load_texture_reset_cache(const char* texture) {
sMenuTextureEntries += 1;
}
// Provide an index for sMenuTextureMap
void replace_texture(s32 index, const char* newTexture) {
sMenuTextureList[sMenuTextureMap[index].offset] = newTexture;
sMenuTextureMap[index].textureData = newTexture;
+33 -83
View File
@@ -518,11 +518,7 @@ void func_800463B0(s32 arg0, s32 arg1, u16 arg2, f32 arg3, u8* texture, Vtx* arg
func_80042330(arg0, arg1, arg2, arg3);
break;
case SCREEN_MODE_3P_4P_SPLITSCREEN:
if (gPlayerCount == 3) {
func_80042330_3P(arg0, arg1, arg2, arg3);
} else {
func_80042330_default(arg0, arg1, arg2, arg3);
}
func_80042330_default(arg0, arg1, arg2, arg3);
break;
}
@@ -539,11 +535,7 @@ void func_80046424(s32 arg0, s32 arg1, u16 arg2, f32 arg3, u8* texture, Vtx* arg
func_80042330(arg0, arg1, arg2, arg3);
break;
case SCREEN_MODE_3P_4P_SPLITSCREEN:
if (gPlayerCount == 3) {
func_80042330_3P(arg0, arg1, arg2, arg3);
} else {
func_80042330_default(arg0, arg1, arg2, arg3);
}
func_80042330_default(arg0, arg1, arg2, arg3);
break;
}
@@ -1683,27 +1675,6 @@ void render_texture_rectangle_wide(s32 x, s32 y, s32 width, s32 height, s32 arg4
// 1 << 10);
}
// Renders the finishline in 3P mode.
void render_texture_rectangle_3P(s32 x, s32 y, s32 width, s32 height, s32 arg4, s32 arg5, s32 arg6) {
s32 xh = (((x + width) - 1));
s32 yh = (((y + height) - 1) << 2);
s32 xl = ((x));
s32 yl = y << 2;
s32 xh2 = (((x + width)));
s32 yh2 = ((y + height) << 2);
// Center item in area of screen
s32 center = (s32)((OTRGetDimensionFromRightEdge(SCREEN_WIDTH) - SCREEN_WIDTH) / 2) + ((SCREEN_WIDTH / 4) + (SCREEN_WIDTH / 2));
s32 coordX = (s32)(center - (width / 2)) << 2;
s32 coordX2 = (s32)(center + (width / 2)) << 2;
printf("center %d, width %d, coordX %d\n", center, width, coordX >> 2);
gSPWideTextureRectangle(gDisplayListHead++, coordX, yl,
coordX2, yh2, G_TX_RENDERTILE, arg4 << 5, (arg5 << 5), 1 << 10,
1 << 10);
}
void render_texture_rectangle_wrap(s32 x, s32 y, s32 width, s32 height, s32 mode) {
// (0, 0) means texture coordinates will be rendered from the top left corner
render_texture_rectangle(x, y, width, height, 0, 0, mode);
@@ -1759,30 +1730,6 @@ void func_8004B97C_wide(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
}
}
void func_8004B97C_3P(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
UNUSED s32 pad[2];
s32 sp2C;
s32 var_a1;
s32 var_v0;
s32 var_v1;
if ((-arg2 < arg0) && (-arg3 < arg1)) {
var_v0 = 0;
var_v1 = 0;
sp2C = arg0;
var_a1 = arg1;
if (arg0 < 0) {
var_v1 = -arg0;
sp2C = 0;
}
if (arg1 < 0) {
var_v0 = -arg1;
var_a1 = 0;
}
render_texture_rectangle_3P(sp2C, var_a1, arg2 - var_v1, arg3 - var_v0, var_v1, var_v0, arg4);
}
}
void func_8004BA08(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
UNUSED s32 pad[2];
s32 sp2C;
@@ -1996,15 +1943,6 @@ void draw_hud_2d_texture_wide(s32 x, s32 y, u32 width, u32 height, u8* texture)
gSPDisplayList(gDisplayListHead++, D_0D007EB8);
}
void draw_hud_2d_texture_3P(s32 x, s32 y, u32 width, u32 height, u8* texture) {
gSPDisplayList(gDisplayListHead++, D_0D008108);
gSPDisplayList(gDisplayListHead++, D_0D007EF8);
gDPSetAlphaCompare(gDisplayListHead++, G_AC_THRESHOLD);
load_texture_block_rgba16_mirror(texture, width, height);
func_8004B97C_3P(x - (width >> 1), y - (height >> 1), width, height, 0);
gSPDisplayList(gDisplayListHead++, D_0D007EB8);
}
void func_8004C450(s32 arg0, s32 arg1, u32 arg2, u32 arg3, u8* texture) {
gSPDisplayList(gDisplayListHead++, D_0D007F38);
@@ -2109,11 +2047,7 @@ void draw_hud_2d_texture_8x8(s32 x, s32 y, u8* texture) {
draw_hud_2d_texture_wide(x, y, 8, 8, texture);
break;
case SCREEN_MODE_3P_4P_SPLITSCREEN:
if (gPlayerCount == 3) {
draw_hud_2d_texture_3P(x, y, 8, 8, texture);
} else {
draw_hud_2d_texture(x, y, 8, 8, texture);
}
draw_hud_2d_texture(x, y, 8, 8, texture);
break;
}
}
@@ -2705,13 +2639,13 @@ void func_8004ED40(s32 arg0) {
void func_8004EE54(s32 arg0) {
if (gIsMirrorMode != 0) {
func_8004D4E8(D_8018D2C0[arg0] + D_8018D2F0, D_8018D2D8[arg0] + D_8018D2F8, (u8*) D_8018D240, (s32) D_8018D300,
(s32) D_8018D308, (s32) D_8018D310, 0x000000FF, (s32) D_8018D2B0, (s32) D_8018D2B8,
(s32) D_8018D2B0, (s32) D_8018D2B8);
func_8004D4E8(D_8018D2C0[arg0], D_8018D2D8[arg0], (u8*) D_8018D240, (s32) D_8018D300,
(s32) D_8018D308, (s32) D_8018D310, 0x000000FF, (s32) gMinimapWidth, (s32) gMinimapHeight,
(s32) gMinimapWidth, (s32) gMinimapHeight);
} else {
func_8004D37C(D_8018D2C0[arg0] + D_8018D2F0, D_8018D2D8[arg0] + D_8018D2F8, (u8*) D_8018D240, (s32) D_8018D300,
(s32) D_8018D308, (s32) D_8018D310, 0x000000FF, (s32) D_8018D2B0, (s32) D_8018D2B8,
(s32) D_8018D2B0, (s32) D_8018D2B8);
func_8004D37C(D_8018D2C0[arg0], D_8018D2D8[arg0], (u8*) D_8018D240, (s32) D_8018D300,
(s32) D_8018D308, (s32) D_8018D310, 0x000000FF, (s32) gMinimapWidth, (s32) gMinimapHeight,
(s32) gMinimapWidth, (s32) gMinimapHeight);
}
}
@@ -2719,20 +2653,28 @@ void func_8004EF9C(s32 arg0) {
s16 temp_t0;
s16 temp_v0;
temp_v0 = CourseManager_GetProps()->D_800E5548[0]; // D_800E5548[arg0 * 2];
temp_t0 = CourseManager_GetProps()->D_800E5548[1]; // D_800E5548[arg0 * 2 + 1];
temp_v0 = CourseManager_GetProps()->MinimapDimensions.X;
temp_t0 = CourseManager_GetProps()->MinimapDimensions.Z;
func_8004D37C(0x00000104, 0x0000003C, CourseManager_GetProps()->MinimapTexture, 0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF, temp_v0,
temp_t0, temp_v0, temp_t0);
}
void func_8004F020(s32 arg0) {
void set_minimap_finishline_position(s32 arg0) {
f32 var_f0;
f32 var_f2;
s32 center = 0;
//! @todo: Hardcode these x and y values. Because why not?
//! @todo: Hardcode these x and y values. Because why not?
var_f2 = ((D_8018D2C0[arg0] + D_8018D2F0) - (D_8018D2B0 / 2)) + D_8018D2E0;
var_f0 = ((D_8018D2D8[arg0] + D_8018D2F8) - (D_8018D2B8 / 2)) + D_8018D2E8;
if (gPlayerCount == 3) {
center = ((OTRGetDimensionFromRightEdge(SCREEN_WIDTH) - SCREEN_WIDTH) / 2) + ((SCREEN_WIDTH / 4) + (SCREEN_WIDTH / 2));
} else {
center = D_8018D2C0[arg0];
}
//minimap center pos - minimap left edge + offset
var_f2 = (center - (gMinimapWidth / 2)) + D_8018D2E0;
var_f0 = (D_8018D2D8[arg0] - (gMinimapHeight / 2)) + D_8018D2E8;
if (GetCourse() == GetMarioRaceway()) {
var_f0 = var_f0 - 2.0;
} else if (GetCourse() == GetChocoMountain()) {
@@ -2757,13 +2699,21 @@ void func_8004F168(s32 arg0, s32 playerId, s32 characterId) {
f32 thing1;
s16 temp_a0;
s16 temp_a1;
s32 center = 0;
Player* player = &gPlayerOne[playerId];
if (player->type & (1 << 15)) {
thing0 = player->pos[0] * D_8018D2A0;
thing1 = player->pos[2] * D_8018D2A0;
temp_a0 = ((D_8018D2C0[arg0] + D_8018D2F0) - (D_8018D2B0 / 2)) + D_8018D2E0 + (s16) (thing0);
temp_a1 = ((D_8018D2D8[arg0] + D_8018D2F8) - (D_8018D2B8 / 2)) + D_8018D2E8 + (s16) (thing1);
if (gPlayerCount == 3) {
center = ((OTRGetDimensionFromRightEdge(SCREEN_WIDTH) - SCREEN_WIDTH) / 2) + ((SCREEN_WIDTH / 4) + (SCREEN_WIDTH / 2));
} else {
center = D_8018D2C0[arg0];
}
temp_a0 = (center - (gMinimapWidth / 2)) + D_8018D2E0 + (s16) (thing0);
temp_a1 = (D_8018D2D8[arg0] - (gMinimapHeight / 2)) + D_8018D2E8 + (s16) (thing1);
if (characterId != 8) {
if ((gGPCurrentRaceRankByPlayerId[playerId] == 0) && (gModeSelection != 3) && (gModeSelection != 1)) {
#if EXPLICIT_AND == 1
+1 -5
View File
@@ -207,9 +207,6 @@ void func_8004B614(s32, s32, s32, s32, s32, s32, s32);
void func_8004B6C4(s32, s32, s32);
void func_8004B72C(s32, s32, s32, s32, s32, s32, s32);
void render_texture_rectangle_wrap(s32, s32, s32, s32, s32);
void render_texture_rectangle_3P(s32 x, s32 y, s32 width, s32 height, s32 arg4, s32 arg5, s32 arg6);
void func_8004B97C_3P(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4);
void draw_hud_2d_texture_3P(s32 x, s32 y, u32 width, u32 height, u8* texture);
void func_8004BB34(void);
void func_8004BB3C(s32, s32, s32, s32, f32);
void func_8004BD14(s32, s32, u32, u32, s32, u8*, u8*);
@@ -221,7 +218,6 @@ void func_8004C148(s16, s16, s16, u16, u16, u16, u16);
void func_8004C354(void);
void func_8004C35C(void);
void draw_hud_2d_texture_wide(s32, s32, u32, u32, u8*);
void draw_hud_2d_texture_3P(s32 x, s32 y, u32 width, u32 height, u8* texture);
void func_8004C450(s32, s32, u32, u32, u8*);
void func_8004C53C(s32, s32, u32, u32, u8*);
void func_8004C628(s32, s32, u32, u32, u8*);
@@ -300,7 +296,7 @@ void func_8004ED40(s32);
void func_8004EE54(s32);
void func_8004EF9C(s32);
void func_8004F020(s32);
void set_minimap_finishline_position(s32);
void func_8004F168(s32, s32, s32);
void func_8004F3E4(s32);
s32 func_8004F674(s32*, s32);
+1 -1
View File
@@ -567,7 +567,7 @@ s32 validate_save_data_checksum_backup(void) {
// Check if controller has a Controller Pak connected.
// Return PAK if it does, otherwise return NO_PAK.
s32 check_for_controller_pak(s32 controller) {
u8 controllerBitpattern;
u8 controllerBitpattern = 0;
UNUSED s32 phi_v0;
if ((controller >= MAXCONTROLLERS) || (controller < 0)) {
+1 -1
View File
@@ -30,7 +30,7 @@ s32 mio0encode(s32 input, s32 arg1, s32 arg2) {
}
void tkmk00decode(u8* src, u8* arg1, u8* dest, s32 n) {
memcpy(dest, src, 0x1000);
//memcpy(dest, src, 0x1000);
}
void osStartThread(OSThread* thread) {