Game now boots, Floomba still not visible

This commit is contained in:
gheskett
2021-10-06 02:18:25 -04:00
parent c425f8e51b
commit a6d62b5734
5 changed files with 54 additions and 4 deletions

View File

@@ -5079,6 +5079,21 @@ const BehaviorScript bhvFloomba[] = {
GOTO(bhvGoomba + 1),
};
#ifdef HD_INTRO_TEXTURES
const BehaviorScript bhvFloombaStartup[] = {
BEGIN(OBJ_LIST_PUSHABLE),
SET_INT(oIsFloomba, 1),
SET_FLOAT(oDrawingDistance, 20000),
OR_INT(oFlags, OBJ_FLAG_ACTIVE_FROM_AFAR),
LOAD_ANIMATIONS(oAnimations, goomba_seg8_anims_0801DA4C),
SET_HOME(),
CALL_NATIVE(bhv_goomba_init),
BEGIN_LOOP(),
CALL_NATIVE(bhv_goomba_update),
END_LOOP(),
};
#endif
const BehaviorScript bhvFloombaTripletSpawner[] = {
BEGIN(OBJ_LIST_PUSHABLE),
SET_INT(oIsFloomba, 1),

View File

@@ -449,6 +449,9 @@ extern const BehaviorScript bhvGoomba[];
extern const BehaviorScript bhvGoombaTripletSpawner[];
#ifdef FLOOMBAS
extern const BehaviorScript bhvFloomba[];
#ifdef HD_INTRO_TEXTURES
extern const BehaviorScript bhvFloombaStartup[];
#endif
extern const BehaviorScript bhvFloombaTripletSpawner[];
#endif
extern const BehaviorScript bhvChainChomp[];

View File

@@ -279,6 +279,3 @@
#undef GODDARD_EASTER_EGG
#define DISABLE_DEMO
#endif
#if defined(HD_INTRO_TEXTURES) && !defined(FLOOMBAS)
#define FLOOMBAS
#endif

View File

@@ -23,6 +23,8 @@
#include "config.h"
#include "game/print.h"
#include "game/object_list_processor.h"
const LevelScript level_intro_splash_screen[] = {
INIT_LEVEL(),
#ifdef SKIP_TITLE_SCREEN
@@ -31,12 +33,39 @@ const LevelScript level_intro_splash_screen[] = {
FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd),
LOAD_RAW(/*seg*/ 0x13, _behaviorSegmentRomStart, _behaviorSegmentRomEnd),
LOAD_YAY0(/*seg*/ 0x07, _intro_segment_7SegmentRomStart, _intro_segment_7SegmentRomEnd),
#if defined(HD_INTRO_TEXTURES) && defined(FLOOMBAS)
LOAD_YAY0( /*seg*/ 0x08, _common0_yay0SegmentRomStart, _common0_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0F, _common0_geoSegmentRomStart, _common0_geoSegmentRomEnd),
// Load "Super Mario 64" logo
ALLOC_LEVEL_POOL(),
LOAD_MODEL_FROM_GEO(MODEL_GOOMBA, goomba_geo),
AREA(/*index*/ 1, intro_geo_splash_screen),
OBJECT(/*model*/ MODEL_GOOMBA, /*pos*/ 0, 0, 0, /*angle*/ 0, 0, 0, /*behParam*/ 0x00010000, /*beh*/ bhvFloomba),
OBJECT(/*model*/ MODEL_GOOMBA, /*pos*/ 0, 0, 0, /*angle*/ 0, 0, 0, /*behParam*/ 0x00010000, /*beh*/ bhvFloombaStartup),
END_AREA(),
FREE_LEVEL_POOL(),
// Start animation
LOAD_AREA(/*area*/ 1),
CALL(/*arg*/ LVL_INTRO_PLAY_ITS_A_ME_MARIO, /*func*/ lvl_intro_update),
CALL(/*arg*/ 0, /*func*/ load_mario_area),
// CALL(/*arg*/ 0, /*func*/ lvl_init_or_update),
// CALL_LOOP(/*arg*/ 1, /*func*/ lvl_init_or_update),
JUMP_LINK_PUSH_ARG(75),
CALL(/*arg*/ 0, /*func*/ update_objects),
SLEEP(/*frames*/ 1),
JUMP_N_TIMES(),
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_INTO_COLOR, /*time*/ 16, /*color*/ 0x00, 0x00, 0x00),
JUMP_LINK_PUSH_ARG(16),
CALL(/*arg*/ 0, /*func*/ update_objects),
SLEEP(/*frames*/ 1),
JUMP_N_TIMES(),
#else
// Load "Super Mario 64" logo
ALLOC_LEVEL_POOL(),
AREA(/*index*/ 1, intro_geo_splash_screen),
END_AREA(),
FREE_LEVEL_POOL(),
@@ -47,6 +76,7 @@ const LevelScript level_intro_splash_screen[] = {
SLEEP(/*frames*/ 75),
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_INTO_COLOR, /*time*/ 16, /*color*/ 0x00, 0x00, 0x00),
SLEEP(/*frames*/ 16),
#endif
CMD2A(/*unk2*/ 1),
CLEAR_LEVEL(),
SLEEP(/*frames*/ 2),

View File

@@ -787,6 +787,11 @@ static void treat_far_home_as_mario(f32 threshold) {
o->oAngleToMario = atan2s(d[2], d[0]);
o->oDistanceToMario = 25000.0f;
} else {
if (!gMarioObject) {
o->oDistanceToMario = 20000.0f;
return;
}
vec3_diff(d, &o->oHomeVec, &gMarioObject->oPosVec);
distance = vec3_sumsq(d);