Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid ub on course segment #643

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/code_800029B0.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,20 @@ void func_80003040(void) {
spawn_foliage(d_course_mario_raceway_tree_spawns);
break;
case COURSE_BOWSER_CASTLE:
#ifdef AVOID_UB
find_vtx_and_set_colours(d_course_bowsers_castle_packed_dl_1350, 0x32, 0, 0, 0);
#else
// d_course_bowsers_castle_packed_dl_1350
find_vtx_and_set_colours(0x07001350, 0x32, 0, 0, 0);
#endif
break;
case COURSE_BANSHEE_BOARDWALK:
#ifdef AVOID_UB
find_vtx_and_set_colours(d_course_banshee_boardwalk_packed_dl_878, -0x80, 0, 0, 0);
#else
// d_course_banshee_boardwalk_packed_dl_878
find_vtx_and_set_colours(0x07000878, -0x80, 0, 0, 0);
#endif
break;
case COURSE_YOSHI_VALLEY:
vec3f_set(position, -2300.0f, 0.0f, 634.0f);
Expand All @@ -336,18 +344,29 @@ void func_80003040(void) {
spawn_foliage(d_course_moo_moo_farm_tree_spawn);
break;
case COURSE_SHERBET_LAND:
#ifdef AVOID_UB
find_vtx_and_set_colours(d_course_sherbet_land_packed_dl_1EB8, -0x4C, 0xFF, 0xFF, 0xFF);
find_vtx_and_set_colours(d_course_sherbet_land_packed_dl_2308, -0x6A, 0xFF, 0xFF, 0xFF);
#else
// d_course_sherbet_land_packed_dl_1EB8
find_vtx_and_set_colours(0x07001EB8, -0x4C, 0xFF, 0xFF, 0xFF);
// d_course_sherbet_land_packed_dl_2308
find_vtx_and_set_colours(0x07002308, -0x6A, 0xFF, 0xFF, 0xFF);
#endif
break;
case COURSE_RAINBOW_ROAD:
#ifdef AVOID_UB
find_vtx_and_set_colours(d_course_rainbow_road_packed_dl_2068, -0x6A, 0xFF, 0xFF, 0xFF);
find_vtx_and_set_colours(d_course_rainbow_road_packed_dl_1E18, -0x6A, 0xFF, 0xFF, 0xFF);
find_vtx_and_set_colours(d_course_rainbow_road_packed_dl_1318, -1, 0xFF, 0xFF, 0);
#else
// d_course_rainbow_road_packed_dl_2068
find_vtx_and_set_colours(0x07002068, -0x6A, 0xFF, 0xFF, 0xFF);
// d_course_rainbow_road_packed_dl_1E18
find_vtx_and_set_colours(0x07001E18, -0x6A, 0xFF, 0xFF, 0xFF);
// d_course_rainbow_road_packed_dl_1318
find_vtx_and_set_colours(0x07001318, -1, 0xFF, 0xFF, 0);
#endif
break;
case COURSE_WARIO_STADIUM:
vec3f_set(position, -131.0f, 83.0f, 286.0f);
Expand All @@ -356,6 +375,16 @@ void func_80003040(void) {
add_actor_to_empty_slot(position, rotation, velocity, ACTOR_WARIO_SIGN);
vec3f_set(position, -2622.0f, 79.0f, 739.0f);
add_actor_to_empty_slot(position, rotation, velocity, ACTOR_WARIO_SIGN);
#ifdef AVOID_UB
find_vtx_and_set_colours(d_course_wario_stadium_packed_dl_C50, 0x64, 0xFF, 0xFF, 0xFF);
find_vtx_and_set_colours(d_course_wario_stadium_packed_dl_BD8, 0x64, 0xFF, 0xFF, 0xFF);
find_vtx_and_set_colours(d_course_wario_stadium_packed_dl_B60, 0x64, 0xFF, 0xFF, 0xFF);
find_vtx_and_set_colours(d_course_wario_stadium_packed_dl_AE8, 0x64, 0xFF, 0xFF, 0xFF);
find_vtx_and_set_colours(d_course_wario_stadium_packed_dl_CC8, 0x64, 0xFF, 0xFF, 0xFF);
find_vtx_and_set_colours(d_course_wario_stadium_packed_dl_D50, 0x64, 0xFF, 0xFF, 0xFF);
find_vtx_and_set_colours(d_course_wario_stadium_packed_dl_DD0, 0x64, 0xFF, 0xFF, 0xFF);
find_vtx_and_set_colours(d_course_wario_stadium_packed_dl_E48, 0x64, 0xFF, 0xFF, 0xFF);
#else
// d_course_wario_stadium_packed_dl_C50
find_vtx_and_set_colours(0x07000C50, 0x64, 0xFF, 0xFF, 0xFF);
// d_course_wario_stadium_packed_dl_BD8
Expand All @@ -372,10 +401,15 @@ void func_80003040(void) {
find_vtx_and_set_colours(0x07000DD0, 0x64, 0xFF, 0xFF, 0xFF);
// d_course_wario_stadium_packed_dl_E48
find_vtx_and_set_colours(0x07000E48, 0x64, 0xFF, 0xFF, 0xFF);
#endif
break;
case COURSE_DK_JUNGLE:
#ifdef AVOID_UB
find_vtx_and_set_colours(d_course_dks_jungle_parkway_packed_dl_3FA8, 0x78, 0xFF, 0xFF, 0xFF);
#else
// d_course_dks_jungle_parkway_packed_dl_3FA8
find_vtx_and_set_colours(0x07003FA8, 0x78, 0xFF, 0xFF, 0xFF);
#endif
break;
default:
break;
Expand Down
16 changes: 15 additions & 1 deletion src/ending/code_80281780.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "main.h"
#include "menus.h"
#include "render_courses.h"
#include "courses/royal_raceway/course_displaylists.inc.h"

u8 defaultCharacterIds[] = { 1, 2, 3, 4, 5, 6, 7, 0 };

Expand Down Expand Up @@ -126,7 +127,19 @@ void load_ceremony_cutscene(void) {
D_800DC5BC = (u16) 0;
D_800DC5C8 = (u16) 0;
gCollisionMesh = (CollisionTriangle*) gNextFreeMemoryAddress;
//! @bug these segmented addresses need to be symbols for mobility
//! @bug these segmented addresses need to be symbols for mobility
#ifdef AVOID_UB
generate_collision_mesh_with_default_section_id(d_course_royal_raceway_packed_dl_67E8, -1);
generate_collision_mesh_with_default_section_id(d_course_royal_raceway_packed_dl_AEF8, -1);
generate_collision_mesh_with_default_section_id(d_course_royal_raceway_packed_dl_A970, 8);
generate_collision_mesh_with_default_section_id(d_course_royal_raceway_packed_dl_AC30, 8);
generate_collision_mesh_with_default_section_id(d_course_royal_raceway_packed_dl_CE0, 0x10);
generate_collision_mesh_with_default_section_id(d_course_royal_raceway_packed_dl_E88, 0x10);
generate_collision_mesh_with_default_section_id(d_course_royal_raceway_packed_dl_A618, -1);
generate_collision_mesh_with_default_section_id(d_course_royal_raceway_packed_dl_A618, -1);
generate_collision_mesh_with_default_section_id(d_course_royal_raceway_packed_dl_23F8, 1);
generate_collision_mesh_with_default_section_id(d_course_royal_raceway_packed_dl_2478, 1);
#else
// d_course_royal_raceway_packed_dl_67E8
generate_collision_mesh_with_default_section_id((Gfx*) 0x070067E8, -1);
// d_course_royal_raceway_packed_dl_AEF8
Expand All @@ -147,6 +160,7 @@ void load_ceremony_cutscene(void) {
generate_collision_mesh_with_default_section_id((Gfx*) 0x070023F8, 1);
// d_course_royal_raceway_packed_dl_2478
generate_collision_mesh_with_default_section_id((Gfx*) 0x07002478, 1);
#endif
func_80295C6C();
debug_switch_character_ceremony_cutscene();
func_802818BC();
Expand Down
Loading
Loading