Skip to content

Commit

Permalink
Uintptr (#671)
Browse files Browse the repository at this point in the history
* Update render_courses.c

* Update math_util.c

* Update math_util.c

* Update math_util.h

* Update render_courses.c
  • Loading branch information
MegaMech authored Sep 11, 2024
1 parent 3f353d7 commit b6ba045
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/racing/math_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,10 @@ 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(uintptr_t addr, s16 arg1, s16 arg2, s32 arg3) {
void func_802B5D64(Lights1 *addr, s16 arg1, s16 arg2, s32 arg3) {
u32 segment = SEGMENT_NUMBER2(addr);
u32 offset = SEGMENT_OFFSET(addr);
UNUSED s32 pad;
Expand Down
2 changes: 1 addition & 1 deletion src/racing/math_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void mtxf_s16_rotate_z(Mat4, s16);
void func_802B5B14(Vec3f b, Vec3s rotate); // unused
void func_802B5CAC(s16, s16, Vec3f);
void func_802B5D30(s16, s16, s32);
void func_802B5D64(uintptr_t, s16, s16, s32);
void func_802B5D64(Lights1*, s16, s16, s32);
void mtxf_scale(Mat4, f32);
void mtxf_pos_rotation_xyz(Mat4, Vec3f, Vec3s);
void mtxf_translate_vec3f_mat3(Vec3f, Mat3);
Expand Down
22 changes: 11 additions & 11 deletions src/racing/render_courses.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ void render_moo_moo_farm(struct UnkStruct_800DC5EC* arg0) {
s16 temp_s0 = arg0->pathCounter;
s16 temp_s1 = arg0->playerDirection;

func_802B5D64((uintptr_t) D_800DC610, D_802B87D4, 0, 1);
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
Expand Down Expand Up @@ -1012,7 +1012,7 @@ void render_moo_moo_farm(struct UnkStruct_800DC5EC* arg0) {
void render_toads_turnpike(struct UnkStruct_800DC5EC* arg0) {
UNUSED s32 pad[13];

func_802B5D64((uintptr_t) &D_800DC610, D_802B87D4, 0, 1);
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
Expand All @@ -1039,7 +1039,7 @@ void render_toads_turnpike(struct UnkStruct_800DC5EC* arg0) {

void render_kalimari_desert(struct UnkStruct_800DC5EC* arg0) {

func_802B5D64((uintptr_t) D_800DC610, D_802B87D4, 0, 1);
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);

gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
Expand Down Expand Up @@ -1168,7 +1168,7 @@ void render_wario_stadium(struct UnkStruct_800DC5EC* arg0) {

void render_block_fort(UNUSED struct UnkStruct_800DC5EC* arg0) {

func_802B5D64((uintptr_t) &D_800DC610, D_802B87D4, 0, 1);
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
Expand All @@ -1177,7 +1177,7 @@ void render_block_fort(UNUSED struct UnkStruct_800DC5EC* arg0) {
}

void render_skyscraper(UNUSED struct UnkStruct_800DC5EC* arg0) {
func_802B5D64((uintptr_t) &D_800DC610, D_802B87D4, 0, 1);
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
Expand All @@ -1201,7 +1201,7 @@ void render_skyscraper(UNUSED struct UnkStruct_800DC5EC* arg0) {

void render_double_deck(UNUSED struct UnkStruct_800DC5EC* arg0) {

func_802B5D64((uintptr_t) D_800DC610, D_802B87D4, 0, 1);
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
Expand All @@ -1213,8 +1213,8 @@ void render_double_deck(UNUSED struct UnkStruct_800DC5EC* arg0) {

void render_dks_jungle_parkway(struct UnkStruct_800DC5EC* arg0) {

func_802B5D64((uintptr_t) D_800DC610, D_802B87D4, 0, 1);
func_802B5D64((uintptr_t) &D_800DC610[1], D_802B87D4, D_802B87D0, 1);
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
func_802B5D64(&D_800DC610[1], D_802B87D4, D_802B87D0, 1);

gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK | G_LIGHTING);
Expand All @@ -1239,7 +1239,7 @@ void render_big_donut(struct UnkStruct_800DC5EC* arg0) {

gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
func_802B5D64((uintptr_t) D_800DC610, D_802B87D4, 0, 1);
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);

Expand Down Expand Up @@ -1326,7 +1326,7 @@ void func_8029569C(void) {

void render_course(struct UnkStruct_800DC5EC* arg0) {

func_802B5D64((uintptr_t) D_800DC610, D_802B87D4, 0, 1);
func_802B5D64(D_800DC610, D_802B87D4, 0, 1);
if (creditsRenderMode) {
func_8029569C();
return;
Expand Down Expand Up @@ -1514,7 +1514,7 @@ void func_80295D88(void) {
D_8015F8E4 = -80.0f;
break;
case COURSE_YOSHI_VALLEY:
func_802B5D64((uintptr_t) &d_course_yoshi_valley_lights4, -0x38F0, 0x1C70, 1);
func_802B5D64(&d_course_yoshi_valley_lights4, -0x38F0, 0x1C70, 1);
parse_course_displaylists((uintptr_t) d_course_yoshi_valley_addr);
func_80295C6C();
D_8015F8E4 = gCourseMinY - 10.0f;
Expand Down

0 comments on commit b6ba045

Please sign in to comment.