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 2 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
98 changes: 66 additions & 32 deletions src/code_800029B0.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,20 @@ void func_80003040(void) {
spawn_foliage(d_course_mario_raceway_tree_spawns);
break;
case COURSE_BOWSER_CASTLE:
// d_course_bowsers_castle_packed_dl_1350
find_vtx_and_set_colours(0x07001350, 0x32, 0, 0, 0);
#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:
// d_course_banshee_boardwalk_packed_dl_878
find_vtx_and_set_colours(0x07000878, -0x80, 0, 0, 0);
#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 @@ -339,18 +347,29 @@ void func_80003040(void) {
spawn_foliage(d_course_moo_moo_farm_tree_spawn);
break;
case COURSE_SHERBET_LAND:
// 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);
#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:
// 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);
#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 @@ -359,26 +378,41 @@ 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);
// d_course_wario_stadium_packed_dl_C50
find_vtx_and_set_colours(0x07000C50, 0x64, 0xFF, 0xFF, 0xFF);
// d_course_wario_stadium_packed_dl_BD8
find_vtx_and_set_colours(0x07000BD8, 0x64, 0xFF, 0xFF, 0xFF);
// d_course_wario_stadium_packed_dl_B60
find_vtx_and_set_colours(0x07000B60, 0x64, 0xFF, 0xFF, 0xFF);
// d_course_wario_stadium_packed_dl_AE8
find_vtx_and_set_colours(0x07000AE8, 0x64, 0xFF, 0xFF, 0xFF);
// d_course_wario_stadium_packed_dl_CC8
find_vtx_and_set_colours(0x07000CC8, 0x64, 0xFF, 0xFF, 0xFF);
// d_course_wario_stadium_packed_dl_D50
find_vtx_and_set_colours(0x07000D50, 0x64, 0xFF, 0xFF, 0xFF);
// d_course_wario_stadium_packed_dl_DD0
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);
#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
find_vtx_and_set_colours(0x07000BD8, 0x64, 0xFF, 0xFF, 0xFF);
// d_course_wario_stadium_packed_dl_B60
find_vtx_and_set_colours(0x07000B60, 0x64, 0xFF, 0xFF, 0xFF);
// d_course_wario_stadium_packed_dl_AE8
find_vtx_and_set_colours(0x07000AE8, 0x64, 0xFF, 0xFF, 0xFF);
// d_course_wario_stadium_packed_dl_CC8
find_vtx_and_set_colours(0x07000CC8, 0x64, 0xFF, 0xFF, 0xFF);
// d_course_wario_stadium_packed_dl_D50
find_vtx_and_set_colours(0x07000D50, 0x64, 0xFF, 0xFF, 0xFF);
// d_course_wario_stadium_packed_dl_DD0
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:
// d_course_dks_jungle_parkway_packed_dl_3FA8
find_vtx_and_set_colours(0x07003FA8, 0x78, 0xFF, 0xFF, 0xFF);
#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
54 changes: 34 additions & 20 deletions 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 @@ -132,26 +133,39 @@ void load_ceremony_cutscene(void) {
D_800DC5C8 = (u16)0;
gCollisionMesh = (CollisionTriangle *) gNextFreeMemoryAddress;
//! @bug these segmented addresses need to be symbols for mobility
// d_course_royal_raceway_packed_dl_67E8
generate_collision_mesh_with_default_section_id((Gfx *)0x070067E8, -1);
// d_course_royal_raceway_packed_dl_AEF8
generate_collision_mesh_with_default_section_id((Gfx *)0x0700AEF8, -1);
// d_course_royal_raceway_packed_dl_A970
generate_collision_mesh_with_default_section_id((Gfx *)0x0700A970, 8);
// d_course_royal_raceway_packed_dl_AC30
generate_collision_mesh_with_default_section_id((Gfx *)0x0700AC30, 8);
// d_course_royal_raceway_packed_dl_CE0
generate_collision_mesh_with_default_section_id((Gfx *)0x07000CE0, 0x10);
// d_course_royal_raceway_packed_dl_E88
generate_collision_mesh_with_default_section_id((Gfx *)0x07000E88, 0x10);
// d_course_royal_raceway_packed_dl_A618
generate_collision_mesh_with_default_section_id((Gfx *)0x0700A618, -1);
// d_course_royal_raceway_packed_dl_A618
generate_collision_mesh_with_default_section_id((Gfx *)0x0700A618, -1);
// d_course_royal_raceway_packed_dl_23F8
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);
#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
generate_collision_mesh_with_default_section_id((Gfx *)0x0700AEF8, -1);
// d_course_royal_raceway_packed_dl_A970
generate_collision_mesh_with_default_section_id((Gfx *)0x0700A970, 8);
// d_course_royal_raceway_packed_dl_AC30
generate_collision_mesh_with_default_section_id((Gfx *)0x0700AC30, 8);
// d_course_royal_raceway_packed_dl_CE0
generate_collision_mesh_with_default_section_id((Gfx *)0x07000CE0, 0x10);
// d_course_royal_raceway_packed_dl_E88
generate_collision_mesh_with_default_section_id((Gfx *)0x07000E88, 0x10);
// d_course_royal_raceway_packed_dl_A618
generate_collision_mesh_with_default_section_id((Gfx *)0x0700A618, -1);
// d_course_royal_raceway_packed_dl_A618
generate_collision_mesh_with_default_section_id((Gfx *)0x0700A618, -1);
// d_course_royal_raceway_packed_dl_23F8
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