Merge pull request #387 from HackerN64/develop/2.0.1
HackerSM64 2.0.2 Release
This commit is contained in:
88 files changed
+3206
-1086
No files matched your search
+2078
-48
File diff suppressed because it is too large.
Load diff
@@ -323,11 +323,25 @@ ifeq ($(filter clean distclean print-%,$(MAKECMDGOALS)),)
|
||||
ifeq ($(NOEXTRACT),0)
|
||||
DUMMY != $(PYTHON) extract_assets.py $(VERSION) >&2 || echo FAIL
|
||||
ifeq ($(DUMMY),FAIL)
|
||||
$(error Failed to extract assets)
|
||||
$(error Failed to extract assets from US ROM)
|
||||
endif
|
||||
DUMMY != $(PYTHON) extract_assets.py jp >&2 || echo FAIL
|
||||
ifeq ($(DUMMY),FAIL)
|
||||
$(error Failed to extract assets)
|
||||
ifneq (,$(wildcard baserom.jp.z64))
|
||||
DUMMY != $(PYTHON) extract_assets.py jp >&2 || echo FAIL
|
||||
ifeq ($(DUMMY),FAIL)
|
||||
$(error Failed to extract assets from JP ROM)
|
||||
endif
|
||||
endif
|
||||
ifneq (,$(wildcard baserom.eu.z64))
|
||||
DUMMY != $(PYTHON) extract_assets.py eu >&2 || echo FAIL
|
||||
ifeq ($(DUMMY),FAIL)
|
||||
$(error Failed to extract assets from EU ROM)
|
||||
endif
|
||||
endif
|
||||
ifneq (,$(wildcard baserom.sh.z64))
|
||||
DUMMY != $(PYTHON) extract_assets.py sh >&2 || echo FAIL
|
||||
ifeq ($(DUMMY),FAIL)
|
||||
$(error Failed to extract assets from SH ROM)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -616,7 +630,8 @@ $(BUILD_DIR)/src/usb/usb.o: CFLAGS += -Wno-unused-variable -Wno-sign-compare -Wn
|
||||
$(BUILD_DIR)/src/usb/debug.o: OPT_FLAGS := -O0
|
||||
$(BUILD_DIR)/src/usb/debug.o: CFLAGS += -Wno-unused-parameter -Wno-maybe-uninitialized
|
||||
# File specific opt flags
|
||||
$(BUILD_DIR)/src/audio/*.o: OPT_FLAGS := -Os -fno-jump-tables
|
||||
$(BUILD_DIR)/src/audio/heap.o: OPT_FLAGS := -Os -fno-jump-tables
|
||||
$(BUILD_DIR)/src/audio/synthesis.o: OPT_FLAGS := -Os -fno-jump-tables
|
||||
|
||||
$(BUILD_DIR)/src/engine/surface_collision.o: OPT_FLAGS := $(COLLISION_OPT_FLAGS)
|
||||
$(BUILD_DIR)/src/engine/math_util.o: OPT_FLAGS := $(MATH_UTIL_OPT_FLAGS)
|
||||
|
||||
@@ -29,6 +29,7 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin
|
||||
- **CrashOveride**: creating the [ultrasm64](https://github.com/CrashOveride95/ultrasm64) repo
|
||||
- **falcobuster**: Original coordinate overflow fix (world scale), ASM version of extended bounds
|
||||
- **anonymous_moose**: porting falco's extended bounds to decomp
|
||||
- **tuxlovesyou**: `LOAD_MIO0_TEXTURE` macro and moral support
|
||||
|
||||
Thanks to Frame#5375 and AloXado320 for also helping with silhouette stuff
|
||||
|
||||
|
||||
File renamed without changes.
|
Before Width: | Height: | Size: 995 B After Width: | Height: | Size: 995 B |
@@ -10,7 +10,7 @@ ALIGNED8 static const Texture flyguy_seg8_texture_0800E088[] = {
|
||||
|
||||
// 0x0800F088
|
||||
ALIGNED8 static const Texture flyguy_seg8_texture_0800F088[] = {
|
||||
#include "actors/flyguy/flyguy_face.rgba16.inc.c"
|
||||
#include "actors/flyguy/flyguy_face.custom.rgba16.inc.c"
|
||||
};
|
||||
|
||||
// 0x0800F888
|
||||
|
||||
@@ -96,7 +96,7 @@ static const Vtx warp_pipe_seg3_vertex_03007DC0[] = {
|
||||
|
||||
// 0x03007E40
|
||||
ALIGNED8 static const Texture warp_pipe_seg3_texture_03007E40[] = {
|
||||
#include "actors/warp_pipe/warp_pipe_side.rgba16.inc.c"
|
||||
#include "actors/warp_pipe/warp_pipe_side.custom.rgba16.inc.c"
|
||||
};
|
||||
|
||||
// 0x03008E40 - 0x03008F98
|
||||
|
||||
File renamed without changes.
|
Before Width: | Height: | Size: 1012 B After Width: | Height: | Size: 1012 B |
@@ -791,6 +791,7 @@ const BehaviorScript bhvWfBreakableWallLeft[] = {
|
||||
// WF breakable walls - common:
|
||||
OR_INT(oFlags, (OBJ_FLAG_ACTIVE_FROM_AFAR | OBJ_FLAG_COMPUTE_DIST_TO_MARIO | OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
|
||||
SET_HITBOX(/*Radius*/ 300, /*Height*/ 400),
|
||||
SET_FLOAT(oDrawingDistance, 4500),
|
||||
SET_INT(oIntangibleTimer, 0),
|
||||
BEGIN_LOOP(),
|
||||
CALL_NATIVE(bhv_wf_breakable_wall_loop),
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
* AUDIO SETTINGS *
|
||||
******************/
|
||||
|
||||
// Fixes the castle music sometimes triggering after getting a dialog
|
||||
// Fixes the castle music sometimes triggering after getting a dialog.
|
||||
#define CASTLE_MUSIC_FIX
|
||||
|
||||
// Increase audio heap size to allow for more concurrent notes to be played and for more custom sequences/banks to be imported (not supported for SH)
|
||||
// Increases the audio heap size to allow for more concurrent notes to be played and for more custom sequences/banks to be imported (not supported for SH).
|
||||
#define EXPAND_AUDIO_HEAP
|
||||
|
||||
// Use a much better implementation of reverb over vanilla's fake echo reverb. Great for caves or eerie levels, as well as just a better audio experience in general.
|
||||
// Uses a much better implementation of reverb over vanilla's fake echo reverb. Great for caves or eerie levels, as well as just a better audio experience in general.
|
||||
// Reverb parameters can be configured in audio/synthesis.c to meet desired aesthetic/performance needs. Currently US/JP only. Hurts emulator and console performance.
|
||||
//#define BETTER_REVERB
|
||||
// #define BETTER_REVERB
|
||||
@@ -3,11 +3,11 @@
|
||||
/**********************
|
||||
* BENCHMARK SETTINGS *
|
||||
**********************/
|
||||
/**
|
||||
* Enabling this will enable a set of defines in order to run a benchmark on the game
|
||||
* Currently this just starts the credits, and enables puppyprint debug
|
||||
*/
|
||||
|
||||
/**
|
||||
* Enabling this will enable a set of defines in order to run a benchmark on the game.
|
||||
* Currently this just starts the credits, and enables PUPPYPRINT_DEBUG.
|
||||
*/
|
||||
// #define ENABLE_CREDITS_BENCHMARK
|
||||
|
||||
#ifdef ENABLE_CREDITS_BENCHMARK
|
||||
|
||||
@@ -4,37 +4,37 @@
|
||||
* CAMERA SETTINGS *
|
||||
*******************/
|
||||
|
||||
// Force the camera mode to your choice (except when swimming or flying)
|
||||
// Forces the camera mode to your choice (except when swimming or flying).
|
||||
// It does this by setting the area's camera->defMode to this mode, and also
|
||||
// changes hardcoded modes to use c->defMode
|
||||
// Note: removes door cutscenes due to the way they're designed to work with specific modes
|
||||
// Search for FORCED_CAMERA_MODE in camera.c for more information
|
||||
// changes hardcoded modes to use c->defMode.
|
||||
// Note: removes door cutscenes due to the way they're designed to work with specific modes.
|
||||
// Search for FORCED_CAMERA_MODE in camera.c for more information.
|
||||
#define FORCED_CAMERA_MODE CAMERA_MODE_8_DIRECTIONS
|
||||
|
||||
// Changes hardcoded camera mode reverting to instead use the area's default mode (defMode)
|
||||
// If you're using a FORCED_CAMERA_MODE, this must be on for it to work
|
||||
// Changes hardcoded camera mode reverting to instead use the area's default mode (defMode).
|
||||
// If you're using a FORCED_CAMERA_MODE, this must be on for it to work.
|
||||
#define USE_COURSE_DEFAULT_MODE
|
||||
|
||||
/***** Movement specific camera modes: *****/
|
||||
// Camera mode when Mario is < 400 units away from the water surface (default is CAMERA_MODE_WATER_SURFACE)
|
||||
// Camera mode when Mario is < 400 units away from the water surface (default is CAMERA_MODE_WATER_SURFACE).
|
||||
#define WATER_SURFACE_CAMERA_MODE CAMERA_MODE_WATER_SURFACE
|
||||
// Camera mode when Mario is > 800 units away from the water surface (default is CAMERA_MODE_BEHIND_MARIO)
|
||||
// Camera mode when Mario is > 800 units away from the water surface (default is CAMERA_MODE_BEHIND_MARIO).
|
||||
#define DEEP_WATER_CAMERA_MODE CAMERA_MODE_BEHIND_MARIO
|
||||
// Camera mode when Mario is flying (default is CAMERA_MODE_BEHIND_MARIO)
|
||||
// Camera mode when Mario is flying (default is CAMERA_MODE_BEHIND_MARIO).
|
||||
#define FLYING_CAMERA_MODE CAMERA_MODE_BEHIND_MARIO
|
||||
/*******************************************/
|
||||
|
||||
// Makes the camera approach Mario's height much more quickly
|
||||
// Makes the camera approach Mario's height much more quickly.
|
||||
#define FAST_VERTICAL_CAMERA_MOVEMENT
|
||||
|
||||
// Enables "parallel lakitu camera" or "aglab cam" which lets you move the camera smoothly with the dpad
|
||||
// Enables "parallel lakitu camera" or "aglab cam" which lets you move the camera smoothly with the D-pad.
|
||||
#define PARALLEL_LAKITU_CAM
|
||||
|
||||
// Enables Puppy Camera 2, a rewritten camera that can be freely configured and modified.
|
||||
// #define PUPPYCAM
|
||||
|
||||
// Note: Reonucam is available, but because we had no time to test it properly, it's included as a patch rather than being in the code by default.
|
||||
// Run this command to apply the patch if you want to use it:
|
||||
// Run this command to apply the patch if you want to use it:
|
||||
// tools/apply_patch.sh enhancements/reonucam.patch
|
||||
// Consider it a beta, but it should work fine. Please report any bugs with it. Applying the patch will simply add a define here, so you can still turn it off even after patching.
|
||||
|
||||
@@ -42,13 +42,13 @@
|
||||
/***** Vanilla config options *****/
|
||||
/**********************************/
|
||||
|
||||
// Included for ENABLE_VANILLA_LEVEL_SPECIFIC_CHECKS define
|
||||
// Included for ENABLE_VANILLA_LEVEL_SPECIFIC_CHECKS define.
|
||||
#include "config_game.h"
|
||||
|
||||
// Allow course specific camera processing
|
||||
// You will likely want this disabled in non-vanilla hacks
|
||||
// Allow course specific camera processing.
|
||||
// You will likely want this disabled in non-vanilla hacks.
|
||||
// This is automatically enabled when ENABLE_VANILLA_LEVEL_SPECIFIC_CHECKS is enabled,
|
||||
// but feel free to override it if you really want to for some reason
|
||||
// but feel free to override it if you really want to for some reason/
|
||||
#ifdef ENABLE_VANILLA_LEVEL_SPECIFIC_CHECKS
|
||||
#define ENABLE_VANILLA_CAM_PROCESSING
|
||||
#endif
|
||||
@@ -8,10 +8,10 @@
|
||||
// The defined number is the forward speed threshold before the change is active, since it's only noticeable at lower speeds.
|
||||
#define FAST_FLOOR_ALIGN 10
|
||||
|
||||
// Automatically calculate the optimal collision distance for an object based on its vertices.
|
||||
// Automatically calculates the optimal collision distance for an object based on its vertices.
|
||||
#define AUTO_COLLISION_DISTANCE
|
||||
|
||||
// Allow all surfaces types to have force, (doesn't require setting force, just allows it to be optional).
|
||||
// Allows all surfaces types to have force, (doesn't require setting force, just allows it to be optional).
|
||||
#define ALL_SURFACES_HAVE_FORCE
|
||||
|
||||
// Number of walls that can push Mario at once. Vanilla is 4.
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
// -- CUTSCENE SKIPS --
|
||||
|
||||
// Skip peach letter cutscene
|
||||
// Skips the peach letter cutscene.
|
||||
#define PEACH_SKIP
|
||||
|
||||
// Uncomment this if you want to skip the title screen (Super Mario 64 logo)
|
||||
//#define SKIP_TITLE_SCREEN
|
||||
// Skips the title/splash screen (Super Mario 64 logo).
|
||||
// #define SKIP_TITLE_SCREEN
|
||||
@@ -7,46 +7,50 @@
|
||||
// Enables most debug options, including PUPPYPRINT_DEBUG.
|
||||
// #define DEBUG_ALL
|
||||
|
||||
// Disables all debug options (except PUPPYPRINT)
|
||||
// Disables all debug options (except PUPPYPRINT).
|
||||
#define DISABLE_ALL
|
||||
|
||||
// Enables a comprehensive standalone profiler. Automatically enabled by PUPPYPRINT_DEBUG.
|
||||
// If not using PUPPYPRINT_DEBUG, press L to toggle the profiler.
|
||||
// #define USE_PROFILER
|
||||
|
||||
// TEST LEVEL
|
||||
// Uncomment this define and set a test level in order to boot straight into said level.
|
||||
// This allows you to quickly test the level you're working on.
|
||||
// If you want the game to boot normally, just comment out the define again.
|
||||
// #define TEST_LEVEL LEVEL_BOB
|
||||
|
||||
// Enable debug level select. Hold L while the game boots to turn it on.
|
||||
// Enables debug level select. Hold L while the game boots to turn it on.
|
||||
#define DEBUG_LEVEL_SELECT
|
||||
|
||||
// Enable debug free move (DPad up to enter, A to exit).
|
||||
// Enables debug free move (D-pad up to enter, A to exit).
|
||||
#define ENABLE_DEBUG_FREE_MOVE
|
||||
|
||||
// Include a custom, enhanced performance profiler. (Enables PUPPYPRINT by default in config_safeguards).
|
||||
// Enables a custom, enhanced performance profiler. (Enables PUPPYPRINT by default in config_safeguards).
|
||||
// #define PUPPYPRINT_DEBUG 1
|
||||
|
||||
// Use cycles instead of microseconds in Puppyprint debug output.
|
||||
// Uses cycles instead of microseconds in Puppyprint debug output.
|
||||
// #define PUPPYPRINT_DEBUG_CYCLES
|
||||
|
||||
// A vanilla style debug mode. It doesn't rely on a text engine, but it's much less powerful that PUPPYPRINT_DEBUG.
|
||||
// Press DPAD left to show the debug UI.
|
||||
// A vanilla style debug mode. It doesn't rely on a text engine, but it's much less powerful that PUPPYPRINT_DEBUG.
|
||||
// Press D-pad left to show the debug UI.
|
||||
// #define VANILLA_STYLE_CUSTOM_DEBUG
|
||||
|
||||
// Visual debug enables some collision visuals. Tapping Right on the dpad will cycle between visual hitboxes, visual surfaces, both, and neither.
|
||||
// Visual debug enables some collision visuals. Tapping Right on the D-pad will cycle between visual hitboxes, visual surfaces, both, and neither.
|
||||
// If puppyprint is enabled, then this can be cycled only while the screen is active.
|
||||
// #define VISUAL_DEBUG
|
||||
|
||||
// Open all courses and doors. Used for debugging purposes to unlock all content.
|
||||
// Opens all courses and doors. Used for debugging purposes to unlock all content.
|
||||
#define UNLOCK_ALL
|
||||
|
||||
// Same as above, but also reads all save file flags as complete.
|
||||
// This will not overwrite existing save file data unless you save over it.
|
||||
// #define COMPLETE_SAVE_FILE
|
||||
|
||||
// Removes the limit on FPS
|
||||
// Removes the limit on FPS.
|
||||
// #define UNLOCK_FPS
|
||||
|
||||
// Include vanilla debug functionality.
|
||||
// Includes vanilla debug functionality.
|
||||
// #define VANILLA_DEBUG
|
||||
|
||||
// Forces a crash when the game starts. Useful for debugging the crash screen.
|
||||
|
||||
@@ -4,65 +4,62 @@
|
||||
* GAME SETTINGS *
|
||||
*****************/
|
||||
|
||||
/**
|
||||
/**
|
||||
* Enables some mechanics that change behavior depending on hardcoded level numbers.
|
||||
* You may also need to change sLevelsWithRooms in object_helpers.c
|
||||
* TODO: separate this into separate defines, behavior params, or make these mechanics otherwise dynamic
|
||||
* You may also need to change sLevelsWithRooms in object_helpers.c.
|
||||
* TODO: separate this into separate defines, behavior params, or make these mechanics otherwise dynamic.
|
||||
*/
|
||||
// #define ENABLE_VANILLA_LEVEL_SPECIFIC_CHECKS
|
||||
|
||||
// Disable lives and hide the lives counter
|
||||
// Disables lives and hides the lives counter.
|
||||
#define DISABLE_LIVES
|
||||
|
||||
// Save number of lives to the save file (Does nothing if DISABLE_LIVES is enabled)
|
||||
// Saves the number of lives to the save file (Does nothing if DISABLE_LIVES is enabled).
|
||||
#define SAVE_NUM_LIVES
|
||||
|
||||
// The number of lives Mario starts with after a game over or starting the game for the first time (must be lower than 127)
|
||||
// This is the number of lives Mario starts with after a game over or starting the game for the first time (must be lower than 127).
|
||||
#define DEFAULT_NUM_LIVES 4
|
||||
|
||||
// This can be 0..127
|
||||
// This can be 0..127.
|
||||
#define MAX_NUM_LIVES 100
|
||||
|
||||
// This can be 0..32767
|
||||
// This can be 0..32767.
|
||||
#define MAX_NUM_COINS 999
|
||||
|
||||
// Air/Breath meter is separate from health meter when underwater
|
||||
// Air/breath meter is separate from health meter when underwater.
|
||||
// #define BREATH_METER
|
||||
|
||||
// Number of coins to spawn the "100 coin" star. If you remove the define altogether, then there won't be a 100 coin star at all.
|
||||
#define X_COIN_STAR 100
|
||||
|
||||
/*
|
||||
* Stars don't kick you out of the level (does not play nicely with vanilla)
|
||||
* In v2.0 there are numerous issues with this define that can be seen here https://github.com/Reonu/HackerSM64/issues/258
|
||||
* Use at your own risk.
|
||||
*/
|
||||
// Stars don't kick you out of the level (does not play nicely with vanilla).
|
||||
// #define NON_STOP_STARS
|
||||
|
||||
// Uncomment this if you want global star IDs (useful for creating an open world hack ala MVC)
|
||||
// Bowser keys always exit the level. Only has an effect if NON_STOP_STARS is enabled.
|
||||
// #define KEYS_EXIT_LEVEL
|
||||
|
||||
// Uncomment this if you want global star IDs (useful for creating an open world hack ala MVC).
|
||||
// #define GLOBAL_STAR_IDS
|
||||
|
||||
// Number of possible unique model ID's (keep it higher than 256)
|
||||
// Number of possible unique model ID's (keep it higher than 256).
|
||||
#define MODEL_ID_COUNT 256
|
||||
|
||||
// Number of supported areas per level.
|
||||
#define AREA_COUNT 8
|
||||
|
||||
// Makes signs and NPCs easier to talk to.
|
||||
// NOTE: Currently has issues with talking to Bowser post-fight,
|
||||
// https://github.com/Reonu/HackerSM64/issues/273
|
||||
// #define EASIER_DIALOG_TRIGGER
|
||||
|
||||
// Show an "A" when Mario is able to talk [requires EASIER_DIALOG_TRIGGER]
|
||||
// Shows an "A" when Mario is able to talk [requires EASIER_DIALOG_TRIGGER].
|
||||
// #define DIALOG_INDICATOR
|
||||
|
||||
// Include the English characters that were missing from US segment2
|
||||
// J, Q, V, X, Z, ¨, !, !!, ?, &, %, ., and the beta key.
|
||||
// [MAKE SURE TO ALSO BUILD FROM JP/SH AND EU TO OBTAIN THE ASSETS]
|
||||
// [MAKE SURE TO INCLUDE EU AND JP/SH BASEROMS IN THE REPO TO OBTAIN THE ASSETS]
|
||||
// If this is disabled, backup assets will be used.
|
||||
// #define COMPLETE_EN_US_SEGMENT2
|
||||
|
||||
/// Removes multi-language cake screen
|
||||
// Removes multi-language cake screen.
|
||||
#define EU_CUSTOM_CAKE_FIX
|
||||
|
||||
// Adds multiple languages to the game. Just a placeholder for the most part, because it only works with EU, and must be enabled with EU.
|
||||
@@ -71,5 +68,6 @@
|
||||
// Prevents infinite death loops by always restoring Mario's health when he's warped to any kind of warp while dead.
|
||||
#define PREVENT_DEATH_LOOP
|
||||
|
||||
// The level that the game starts in after file select. The levelscript needs to have a MARIO_POS command for this to work.
|
||||
// The level that the game starts with immediately after file select.
|
||||
// The levelscript needs to have a MARIO_POS command for this to work.
|
||||
#define START_LEVEL LEVEL_CASTLE_GROUNDS
|
||||
@@ -4,11 +4,11 @@
|
||||
* GODDARD SETTINGS *
|
||||
********************/
|
||||
|
||||
// Uncomment this if you want to keep the mario head and not skip it
|
||||
// Enables Goddard (the Mario head).
|
||||
// #define KEEP_MARIO_HEAD
|
||||
|
||||
// Goddard easter egg from Shindou (has no effect if KEEP_MARIO_HEAD is disabled)
|
||||
// Enables the Goddard easter egg from Shindou (has no effect if KEEP_MARIO_HEAD is disabled).
|
||||
#define GODDARD_EASTER_EGG
|
||||
|
||||
// Disables the demo that plays when idle on the start screen (has no effect if KEEP_MARIO_HEAD is disabled)
|
||||
// Disables the demo that plays when idle on the start screen (has no effect if KEEP_MARIO_HEAD is disabled).
|
||||
#define DISABLE_DEMO
|
||||
@@ -4,21 +4,21 @@
|
||||
* GRAPHICS SETTINGS *
|
||||
*********************/
|
||||
|
||||
// Size of how large the master display list (gDisplayListHead) can be. 6400 is vanilla
|
||||
// The size of the master display list (gDisplayListHead). 6400 is vanilla.
|
||||
#define GFX_POOL_SIZE 10000
|
||||
|
||||
// Show a watermark in the title screen that reads "Made with HackerSM64", instead of the copyright message
|
||||
// Show a watermark on the title screen that reads "Made with HackerSM64", instead of the copyright message.
|
||||
#define INTRO_CREDIT
|
||||
|
||||
// Spawn floombas in the title screen
|
||||
// Spawns floombas on the title screen.
|
||||
#define INTRO_FLOOMBAS
|
||||
|
||||
// Enable widescreen (16:9) support
|
||||
// Enables widescreen (16:9) support.
|
||||
#define WIDE
|
||||
|
||||
// Skybox size modifier, changing this will add support for larger skybox images. NOTE: Vanilla skyboxes may break if you change this option. Be sure to rescale them accordingly.
|
||||
// Whenever you change this, make sure to run "make -C tools clean" to rebuild the skybox tool (alternatively go into skyconv.c and change the file in any way (like adding/deleting a space) to specifically rebuild that tool).
|
||||
// When increasing this, you should probably also increase the GFX pool size. (the GFX_POOL_SIZE define above)
|
||||
// When increasing this, you should probably also increase the GFX pool size (the GFX_POOL_SIZE define above).
|
||||
#define SKYBOX_SIZE 1
|
||||
|
||||
// When this option is enabled, LODs will ONLY work on console.
|
||||
@@ -26,17 +26,17 @@
|
||||
// Regardless of whether this setting is enabled or not, you can use gIsConsole to wrap your own code in a console check.
|
||||
#define AUTO_LOD
|
||||
|
||||
// Include Puppyprint, a display library for text and large images.
|
||||
// Automatically included when PUPPYPRINT_DEBUG is enabled
|
||||
// Enables Puppyprint, a display library for text and large images.
|
||||
// Automatically enabled when PUPPYPRINT_DEBUG is enabled.
|
||||
// #define PUPPYPRINT
|
||||
|
||||
// Disable AA (Improves console performance but causes visible seams between unconnected geometry).
|
||||
// Disables AA (Improves console performance but causes visible seams between unconnected geometry).
|
||||
// #define DISABLE_AA
|
||||
|
||||
// Makes the coins ia8 64x64 instead of ia16 32x32. Uses new ia8 textures so that vanilla coins look better.
|
||||
#define IA8_COINS
|
||||
|
||||
// Similar to the above, but 30 FPS (Textures by InTheBeef, cleaned up by Arceveti)
|
||||
// Similar to the above, but 30 FPS (Textures by InTheBeef, cleaned up by Arceveti).
|
||||
#define IA8_30FPS_COINS
|
||||
|
||||
// Use .rej microcode for certain objects (experimental - only should be used when F3DEX_GBI_2 is defined).
|
||||
@@ -45,7 +45,7 @@
|
||||
// #define OBJECTS_REJ
|
||||
|
||||
/**
|
||||
* Mario's silhouette when behind solid objects/surfaces
|
||||
* Mario's silhouette when behind solid objects/surfaces.
|
||||
* Also enables new render layers, such as LAYER_ALPHA_DECAL.
|
||||
* The number is the intensity of the silhouette, from 0-255.
|
||||
* NOTE: The overlap between Mario's model parts is visible on certain HLE plugins.
|
||||
@@ -63,24 +63,28 @@
|
||||
// Fixes the game reading the ia8 burn smoke texture as an rgba16.
|
||||
#define BURN_SMOKE_FIX
|
||||
|
||||
// Disable the fix to Koopa's unshelled model.
|
||||
// Disables the fix to Koopa's unshelled model.
|
||||
#define KOOPA_KEEP_PINK_SHORTS
|
||||
|
||||
// Uses the star object's model in the star dance cutscene.
|
||||
// This has a side effect of making the star dance star also transparent when Mario collects a transparent star.
|
||||
// #define STAR_DANCE_USES_STARS_MODEL
|
||||
|
||||
// Lightweight directional lighting engine by Fazana. Intended for giving proximity and positional pointlights to small objects.
|
||||
// NOTE: Stil breaks occasionally, and PUPPYLIGHT_NODE doesn't work in areas that aren't area 1.
|
||||
// NOTE: Still breaks occasionally, and PUPPYLIGHT_NODE might not work in areas that aren't area 1.
|
||||
// #define PUPPYLIGHTS
|
||||
|
||||
// Uses the correct "up" vector for the guLookAtReflect call in geo_process_master_list_sub.
|
||||
// It is sideways in vanilla, and since vanilla's environment map textures are sideways too, they will appear as sideways in-game if this is enabled.
|
||||
// It is sideways in vanilla, and since vanilla's environment map textures are sideways too, those will appear as sideways in-game if this is enabled.
|
||||
// Make sure your custom environment map textures are the correct orientation.
|
||||
// #define FIX_REFLECT_MTX
|
||||
|
||||
// This improves performance a bit, and does not seem to break anything.
|
||||
#define DISABLE_GRAPH_NODE_TYPE_FUNCTIONAL
|
||||
|
||||
// Disables object shadows. You'll probably only want this either as a last resort for performance or if you're making a super stylized hack.
|
||||
// Disables all object shadows. You'll probably only want this either as a last resort for performance or if you're making a super stylized hack.
|
||||
// #define DISABLE_SHADOWS
|
||||
|
||||
// Use old shadow IDs for Fast64 compatibility. This is a temporary fix until Fast64 is updated to use the enum defines.
|
||||
// Uses old shadow IDs for Fast64 compatibility. This is a temporary fix until Fast64 is updated to use the enum defines.
|
||||
// NOTE: When this is enabled, The 49th hardcoded rectangle shadow will act as a regular circular shadow, due to Mario's shadow ID being 99 in vanilla.
|
||||
#define LEGACY_SHADOW_IDS
|
||||
@@ -6,10 +6,9 @@
|
||||
|
||||
// Various interaction related settings, bug fixes or QoL changes
|
||||
|
||||
/**
|
||||
* This bug allows mario to move when initiating a dialog,
|
||||
* just as long as mario doesn't enter an action that can
|
||||
* be interrupted with text
|
||||
* Uncomment this to fix this bug, and frustrate speedrunners
|
||||
/**
|
||||
* This fixes a bug which allows mario to move when initiating
|
||||
* a dialog. just as long as mario doesn't enter an action that
|
||||
* can be interrupted with text.
|
||||
*/
|
||||
// #define BUGFIX_DIALOG_TIME_STOP
|
||||
@@ -6,13 +6,13 @@
|
||||
|
||||
// -- EXIT COURSE SETTINGS --
|
||||
|
||||
// Disable exit course
|
||||
//#define DISABLE_EXIT_COURSE
|
||||
// Disables Exit Course.
|
||||
// #define DISABLE_EXIT_COURSE
|
||||
|
||||
// Decides whether you can exit course while moving (has no effect if you disable exit course)
|
||||
// Decides whether you can exit course while moving (has no effect if you disable Exit Course).
|
||||
#define EXIT_COURSE_WHILE_MOVING
|
||||
|
||||
// Decides which level, area and warp ID the "exit course" option takes you to (has no effect if you disable exit course)
|
||||
// Decides which level, area and warp ID the "Exit Course" option takes you to (has no effect if you disable Exit Course).
|
||||
// Ensure that the warp exists, or else the game will crash.
|
||||
#define EXIT_COURSE_LEVEL LEVEL_CASTLE
|
||||
#define EXIT_COURSE_AREA 0x01
|
||||
|
||||
@@ -7,79 +7,78 @@
|
||||
// Changes Mario's ground turn radius by making it dependent on the analog stick magnitude and speed.
|
||||
// #define VELOCITY_BASED_TURN_SPEED
|
||||
|
||||
// Allows Mario to easily side flip when moving forwards at any speed
|
||||
// Allows Mario to easily side flip when moving forwards at any speed.
|
||||
// #define SIDE_FLIP_AT_LOW_SPEEDS
|
||||
|
||||
// Allows Mario to aim towards a new direction at the end of turning around,
|
||||
// and allows Mario to turn around multiple times in a row
|
||||
// and allows Mario to turn around multiple times in a row.
|
||||
// #define RESET_DIRECTION_WHEN_TURNING_AROUND
|
||||
|
||||
// Improved hanging:
|
||||
// - Doesn't require holding down the A button
|
||||
// - Precise turning control
|
||||
// - Prevents falling from the edges
|
||||
// - Doesn't require holding down the A button.
|
||||
// - Precise turning control.
|
||||
// - Prevents falling from the edges.
|
||||
#define BETTER_HANGING
|
||||
|
||||
// Change the movement speed when hanging from a ceiling (the vanilla value is 4.0f, has no effect if BETTER_HANGING is enabled)
|
||||
// Change the movement speed when hanging from a ceiling (the vanilla value is 4.0f, has no effect if BETTER_HANGING is enabled).
|
||||
#define HANGING_SPEED 12.0f
|
||||
|
||||
// Prevents Mario from falling asleep while idle
|
||||
// Prevents Mario from falling asleep while idle.
|
||||
// #define NO_SLEEP
|
||||
|
||||
// Disables fall damage
|
||||
// Disables fall damage.
|
||||
#define NO_FALL_DAMAGE
|
||||
|
||||
// Disables the scream that mario makes when falling off a great height (this is separate from actual fall damage)
|
||||
//#define NO_FALL_DAMAGE_SOUND
|
||||
// Disables the scream that mario makes when falling off a great height (this is separate from actual fall damage).
|
||||
// #define NO_FALL_DAMAGE_SOUND
|
||||
|
||||
// Fall height for normal fall damage. Vanilla is 1150.0f
|
||||
// Fall height for normal fall damage. Vanilla is 1150.0f.
|
||||
#define FALL_DAMAGE_HEIGHT_SMALL 1150.0f
|
||||
|
||||
// Fall height for double fall damage. Vanilla is 3000.0f
|
||||
// Fall height for double fall damage. Vanilla is 3000.0f.
|
||||
#define FALL_DAMAGE_HEIGHT_LARGE 3000.0f
|
||||
|
||||
// Disables Mario getting stuck in snow and sand when falling
|
||||
// Disables Mario getting stuck in snow and sand when falling.
|
||||
// #define NO_GETTING_BURIED
|
||||
|
||||
// Prevents hands-free holding. (WARNING: Enabling this may make you a total buzzkill)
|
||||
// Prevents hands-free holding.
|
||||
// #define HANDS_FREE_HOLDING_FIX
|
||||
|
||||
// Prevents Mario losing his cap.
|
||||
//#define PREVENT_CAP_LOSS
|
||||
// Prevents Mario from losing his cap.
|
||||
// #define PREVENT_CAP_LOSS
|
||||
|
||||
// Platform displacement 2 also known as momentum patch. Makes Mario keep the momemtum from moving platforms. Doesn't break treadmills anymore!
|
||||
// Enables Platform Displacement 2, also known as momentum patch. Makes Mario keep the momemtum from moving platforms.
|
||||
#define PLATFORM_DISPLACEMENT_2
|
||||
|
||||
// Use Shindou's pole behavior
|
||||
//#define SHINDOU_POLES
|
||||
// Uses Shindou's pole behavior.
|
||||
// #define SHINDOU_POLES
|
||||
|
||||
// If A and Z are pressed on the same frame, Mario will long jump instead of ground pound.
|
||||
// If A and Z are pressed on the same frame while running, Mario will long jump instead of ground pound.
|
||||
#define EASIER_LONG_JUMPS
|
||||
|
||||
// Hold Z while twirling to descend faster
|
||||
// Enables the ability to hold Z while twirling to descend faster.
|
||||
#define Z_TWIRL
|
||||
|
||||
// Disables bonks when ground pounding next to a wall
|
||||
// Disables bonks when ground pounding next to a wall.
|
||||
#define DISABLE_GROUNDPOUND_BONK
|
||||
|
||||
// Allows Mario to jump kick on steep surfaces that are set to be non slippery, instead of being forced to dive
|
||||
// Allows Mario to jump kick on steep surfaces that are set to be non slippery, instead of being forced to dive.
|
||||
#define JUMP_KICK_FIX
|
||||
|
||||
// Allow Mario to grab hangable ceilings from any state
|
||||
// Allows Mario to grab hangable ceilings from any state.
|
||||
#define HANGING_FIX
|
||||
|
||||
// The last frame that will be considered a firsty when wallkicking
|
||||
// The last frame after hitting a wall that will be considered a firsty when wallkicking.
|
||||
#define FIRSTY_LAST_FRAME 1
|
||||
|
||||
// The maximum angle the player can wall kick, in degrees. 0..90. To allow 45 degree wall kicks, you must supply `46` to allow 45 and under.
|
||||
#define WALL_KICK_DEGREES 45
|
||||
|
||||
// This is vanilla behavior, disable to allow ledge grabbing on
|
||||
// any surface angle
|
||||
// This is vanilla behavior, disable it to allow ledge grabbing regardless of floor pitch.
|
||||
// #define LEDGE_GRABS_CHECK_SLOPE_ANGLE
|
||||
|
||||
// Disable BLJs and crush SimpleFlips's dreams
|
||||
//#define DISABLE_BLJ
|
||||
// Disables BLJs and crushes SimpleFlips's dreams.
|
||||
// #define DISABLE_BLJ
|
||||
|
||||
// Re-enable upwarping when entering water. Forces you to only enter water from the top
|
||||
// Re-enables upwarping when entering water. Forces you to only enter water from the top.
|
||||
// #define WATER_PLUNGE_UPWARP
|
||||
@@ -6,16 +6,15 @@
|
||||
|
||||
// -- COIN --
|
||||
|
||||
// The distance from Mario which coin formations spawn coins at.
|
||||
// Vanilla is 2000.0f.
|
||||
// The distance from Mario at which coin formations spawn their coins. Vanilla is 2000.0f.
|
||||
// Set this to o->oDrawingDistance for a more reasonable range at the cost of performance.
|
||||
#define COIN_FORMATION_DISTANCE 2000.0f
|
||||
|
||||
// Moving Coins flicker and disappear when they hit lava instead of being instantly deleted.
|
||||
#define COIN_LAVA_FLICKER
|
||||
|
||||
// Allow for retries on collecting the remaining blue coins from a blue coin switch.
|
||||
//#define BLUE_COIN_SWITCH_RETRY
|
||||
// Allows for retries on collecting the remaining blue coins from a blue coin switch.
|
||||
// #define BLUE_COIN_SWITCH_RETRY
|
||||
|
||||
// -- GOOMBA --
|
||||
|
||||
@@ -23,26 +22,26 @@
|
||||
// #define TINY_GOOMBA_ALWAYS_DROPS_COIN
|
||||
|
||||
// Floombas! These fellas sport custom behaviors (bhvFloomba, bhvFloombaTripletSpawner) and of course the iconic Floomba texture.
|
||||
// Also support macros (macro_floomba, macro_huge_floomba, macro_tiny_floomba, macro_floomba_triplet_spawner, macro_floomba_quintuplet_spawner).
|
||||
// Also supports macros (macro_floomba, macro_huge_floomba, macro_tiny_floomba, macro_floomba_triplet_spawner, macro_floomba_quintuplet_spawner).
|
||||
#define FLOOMBAS
|
||||
|
||||
// -- HOOT --
|
||||
|
||||
// Use intendedYaw to control Hoot instead of raw left and right inputs.
|
||||
// Uses intendedYaw to control Hoot instead of the raw left and right inputs.
|
||||
#define HOOT_YAW_FIX
|
||||
|
||||
// Leaf particles occasionally fall from trees which contain Hoot.
|
||||
// Causes leaf particles to occasionally fall from trees which contain Hoot.
|
||||
#define HOOT_TREE_PARTICLES
|
||||
|
||||
// -- MR I --
|
||||
|
||||
// Uncomment to allow MR I to shoot his particle in any direction
|
||||
// Enables Mr I to shoot his particle in any direction.
|
||||
// #define MR_I_PITCH_SHOOTING
|
||||
|
||||
// -- WATER RING --
|
||||
|
||||
// Fix DDD water rings by checking for interaction rather than normals.
|
||||
// #define FIX_WATER_RINGS
|
||||
// Fix the water rings in DDD by checking for interaction rather than normals.
|
||||
#define FIX_WATER_RINGS
|
||||
|
||||
// -- POWER STAR --
|
||||
|
||||
@@ -56,12 +55,12 @@
|
||||
|
||||
// -- PLATFORM ON TRACK --
|
||||
|
||||
// The speed of a platform on a track can be controlled by standing near the front or back of it
|
||||
//#define CONTROLLABLE_PLATFORM_SPEED
|
||||
// Allows the speed of a platform on a track to be controlled by standing near the front or back of it.
|
||||
// #define CONTROLLABLE_PLATFORM_SPEED
|
||||
|
||||
// -- CHAIN CHOMP --
|
||||
|
||||
// The number of chain balls the Chain Chomp has. Vanilla is 5.
|
||||
// The number of chain balls the Chain Chomp has. Vanilla is 5.
|
||||
#define CHAIN_CHOMP_NUM_SEGMENTS 5
|
||||
|
||||
// -- POKEY --
|
||||
|
||||
@@ -8,14 +8,11 @@
|
||||
// The end quote should be here: "
|
||||
#define INTERNAL_ROM_NAME "HackerSM64 "
|
||||
|
||||
// Support Rumble Pak
|
||||
// Enables Rumble Pak Support.
|
||||
// Currently not recommended, as it may cause random crashes.
|
||||
//#define ENABLE_RUMBLE (1 || VERSION_SH)
|
||||
// #define ENABLE_RUMBLE (1 || VERSION_SH)
|
||||
|
||||
// Clear RAM on boot
|
||||
#define CLEARRAM 1
|
||||
|
||||
// Screen Size Defines
|
||||
// Screen Size Defines.
|
||||
#define SCREEN_WIDTH 320
|
||||
#define SCREEN_HEIGHT 240
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
|
||||
/*****************
|
||||
* config_graphics
|
||||
* config_graphics.h
|
||||
*/
|
||||
|
||||
#ifndef F3DEX_GBI_2
|
||||
@@ -23,25 +23,31 @@
|
||||
#endif // !F3DEX_GBI_SHARED
|
||||
|
||||
#ifdef OBJECTS_REJ
|
||||
// Enable required ucodes.
|
||||
// Enable required ucodes.
|
||||
#define F3DEX2_REJ_GBI
|
||||
#define F3DLX2_REJ_GBI
|
||||
#endif // OBJECTS_REJ
|
||||
|
||||
|
||||
/*****************
|
||||
* config_debug
|
||||
* config_debug.h
|
||||
*/
|
||||
|
||||
#ifdef PUPPYPRINT_DEBUG
|
||||
#undef PUPPYPRINT
|
||||
#define PUPPYPRINT
|
||||
#endif
|
||||
|
||||
#ifdef COMPLETE_SAVE_FILE
|
||||
#ifdef DISABLE_ALL
|
||||
#undef DEBUG_ALL
|
||||
#undef TEST_LEVEL
|
||||
#undef DEBUG_LEVEL_SELECT
|
||||
#undef ENABLE_DEBUG_FREE_MOVE
|
||||
#undef VANILLA_DEBUG
|
||||
#undef VANILLA_STYLE_CUSTOM_DEBUG
|
||||
#undef PUPPYPRINT_DEBUG
|
||||
#undef PUPPYPRINT_DEBUG_CYCLES
|
||||
#undef VISUAL_DEBUG
|
||||
#undef UNLOCK_ALL
|
||||
#define UNLOCK_ALL
|
||||
#endif // COMPLETE_SAVE_FILE
|
||||
#undef COMPLETE_SAVE_FILE
|
||||
#undef DEBUG_FORCE_CRASH_ON_BOOT
|
||||
#undef USE_PROFILER
|
||||
#endif // DISABLE_ALL
|
||||
|
||||
#ifdef DEBUG_ALL
|
||||
#undef DEBUG_LEVEL_SELECT
|
||||
@@ -66,46 +72,43 @@
|
||||
#define COMPLETE_SAVE_FILE
|
||||
#endif // DEBUG_ALL
|
||||
|
||||
#ifdef DISABLE_ALL
|
||||
#undef DEBUG_ALL
|
||||
#undef TEST_LEVEL
|
||||
#undef DEBUG_LEVEL_SELECT
|
||||
#undef ENABLE_DEBUG_FREE_MOVE
|
||||
#undef VANILLA_DEBUG
|
||||
#undef VANILLA_STYLE_CUSTOM_DEBUG
|
||||
#undef PUPPYPRINT_DEBUG
|
||||
#undef PUPPYPRINT_DEBUG_CYCLES
|
||||
#undef VISUAL_DEBUG
|
||||
#ifdef PUPPYPRINT_DEBUG
|
||||
#undef PUPPYPRINT
|
||||
#define PUPPYPRINT
|
||||
#undef USE_PROFILER
|
||||
#define USE_PROFILER
|
||||
#endif // PUPPYPRINT_DEBUG
|
||||
|
||||
#ifdef COMPLETE_SAVE_FILE
|
||||
#undef UNLOCK_ALL
|
||||
#undef COMPLETE_SAVE_FILE
|
||||
#undef DEBUG_FORCE_CRASH_ON_BOOT
|
||||
#endif // DISABLE_ALL
|
||||
#define UNLOCK_ALL
|
||||
#endif // COMPLETE_SAVE_FILE
|
||||
|
||||
|
||||
/*****************
|
||||
* config_camera
|
||||
* config_camera.h
|
||||
*/
|
||||
|
||||
#ifdef FORCED_CAMERA_MODE
|
||||
#undef USE_COURSE_DEFAULT_MODE
|
||||
#define USE_COURSE_DEFAULT_MODE // Forced camera mode overwrites the default mode
|
||||
#endif
|
||||
#define USE_COURSE_DEFAULT_MODE // Forced camera mode overwrites the default mode.
|
||||
#endif // FORCED_CAMERA_MODE
|
||||
|
||||
#ifndef WATER_SURFACE_CAMERA_MODE
|
||||
#define WATER_SURFACE_CAMERA_MODE CAMERA_MODE_WATER_SURFACE
|
||||
#endif
|
||||
#endif // !WATER_SURFACE_CAMERA_MODE
|
||||
|
||||
#ifndef DEEP_WATER_CAMERA_MODE
|
||||
#define DEEP_WATER_CAMERA_MODE CAMERA_MODE_BEHIND_MARIO
|
||||
#endif
|
||||
#endif // !DEEP_WATER_CAMERA_MODE
|
||||
|
||||
#ifndef FLYING_CAMERA_MODE
|
||||
#define FLYING_CAMERA_MODE CAMERA_MODE_BEHIND_MARIO
|
||||
#endif
|
||||
#endif // !FLYING_CAMERA_MODE
|
||||
|
||||
|
||||
/*****************
|
||||
* config_game
|
||||
* config_game.h
|
||||
*/
|
||||
|
||||
#ifdef DISABLE_LIVES
|
||||
@@ -114,11 +117,11 @@
|
||||
|
||||
#ifndef START_LEVEL
|
||||
#define START_LEVEL LEVEL_CASTLE_GROUNDS
|
||||
#endif
|
||||
#endif // !START_LEVEL
|
||||
|
||||
|
||||
/*****************
|
||||
* config_goddard
|
||||
* config_goddard.h
|
||||
*/
|
||||
|
||||
#ifndef KEEP_MARIO_HEAD
|
||||
@@ -128,8 +131,9 @@
|
||||
#define DISABLE_DEMO
|
||||
#endif // !KEEP_MARIO_HEAD
|
||||
|
||||
|
||||
/*****************
|
||||
* config_menu
|
||||
* config_menu.h
|
||||
*/
|
||||
|
||||
#ifdef DISABLE_EXIT_COURSE
|
||||
@@ -141,10 +145,10 @@
|
||||
|
||||
|
||||
/*****************
|
||||
* config_objects
|
||||
* config_objects.h
|
||||
*/
|
||||
|
||||
// Enable floombas if the intro floombas are enabled
|
||||
// Enable floombas if the intro floombas are enabled.
|
||||
#ifdef INTRO_FLOOMBAS
|
||||
#undef FLOOMBAS
|
||||
#define FLOOMBAS
|
||||
@@ -152,7 +156,7 @@
|
||||
|
||||
|
||||
/*****************
|
||||
* config_rom
|
||||
* config_rom.h
|
||||
*/
|
||||
|
||||
#ifndef TARGET_N64
|
||||
|
||||
@@ -7,33 +7,33 @@
|
||||
* World scale value. This allows you to scale down geometry by the given amount, which allows for larger levels
|
||||
* without the distortion you would otherwise get. Larger world scale comes at a cost of precision, which
|
||||
* can increase Z-fighting. Values above 4 should not be necessary.
|
||||
*
|
||||
* Uncomment this out to specifically set it, otherwise world scale will be based off of your extended bounds mode
|
||||
*
|
||||
* Uncomment this out to specifically set it, otherwise world scale will be based off of your extended bounds mode.
|
||||
*/
|
||||
// #define WORLD_SCALE 1
|
||||
|
||||
|
||||
/*
|
||||
0: Regular bounds
|
||||
Same as vanilla sm64, boundaries are (-8192 to 8191)
|
||||
16x16 collision cells.
|
||||
1: 2x extended bounds
|
||||
level boundaries are twice as big (-16384 to 16383)
|
||||
Collision calculations remain as fast as vanilla, at the cost of using more RAM.
|
||||
32x32 collision cells.
|
||||
2: Regular bounds (performance)
|
||||
Same boundaries as vanilla (-8192 to 8191), but with twice the amount of collision cells
|
||||
Trades more RAM usage for faster collision calculations.
|
||||
32x32 collision cells.
|
||||
3: 4x extended bounds
|
||||
level boundaries are 4 times as big (-32768 to 32767)
|
||||
Collision calculations remain as fast as vanilla, at the cost of using far more RAM (16 times vanilla).
|
||||
64x64 collision cells.
|
||||
|
||||
If you see "SURFACE POOL FULL" or "SURFACE NODE POOL FULL" in game, you should increase
|
||||
SURFACE_POOL_SIZE or SURFACE_NODE_POOL_SIZE, respectively, or reduce the amount of
|
||||
collision surfaces in your level.
|
||||
*/
|
||||
/**
|
||||
* 0: Regular bounds
|
||||
* Same as vanilla sm64, boundaries are (-8192 to 8191)
|
||||
* 16x16 collision cells.
|
||||
* 1: 2x extended bounds
|
||||
* level boundaries are twice as big (-16384 to 16383)
|
||||
* Collision calculations remain as fast as vanilla, at the cost of using more RAM.
|
||||
* 32x32 collision cells.
|
||||
* 2: Regular bounds (performance)
|
||||
* Same boundaries as vanilla (-8192 to 8191), but with twice the amount of collision cells
|
||||
* Trades more RAM usage for faster collision calculations.
|
||||
* 32x32 collision cells.
|
||||
* 3: 4x extended bounds
|
||||
* level boundaries are 4 times as big (-32768 to 32767)
|
||||
* Collision calculations remain as fast as vanilla, at the cost of using far more RAM (16 times vanilla).
|
||||
* 64x64 collision cells.
|
||||
*
|
||||
* If you see "SURFACE POOL FULL" or "SURFACE NODE POOL FULL" in game, you should increase
|
||||
* SURFACE_POOL_SIZE or SURFACE_NODE_POOL_SIZE, respectively, or reduce the amount of
|
||||
* collision surfaces in your level.
|
||||
*/
|
||||
|
||||
// Set this to the extended bounds mode you want, then do "make clean".
|
||||
#define EXTENDED_BOUNDS_MODE 1
|
||||
@@ -79,9 +79,9 @@ STATIC_ASSERT(((EXTENDED_BOUNDS_MODE >= 0) && (EXTENDED_BOUNDS_MODE <= 3)), "You
|
||||
// Multiply SURFACE_POOL_SIZE by the average amount of cells the surfaces intersect.
|
||||
#define SURFACE_NODE_POOL_SIZE (SURFACE_POOL_SIZE * 4) // Vanilla: 7000
|
||||
|
||||
// Flags for error messages
|
||||
// Flags for error messages.
|
||||
#define NOT_ENOUGH_ROOM_FOR_SURFACES (1 << 0)
|
||||
#define NOT_ENOUGH_ROOM_FOR_NODES (1 << 1)
|
||||
|
||||
// Use this to convert game units to cell coordinates
|
||||
#define GET_CELL_COORD(p) ((((s32)(p) + LEVEL_BOUNDARY_MAX) / CELL_SIZE) & (NUM_CELLS - 1));
|
||||
// Use this to convert game units to cell coordinates.
|
||||
#define GET_CELL_COORD(p) ((((s32)(p) + LEVEL_BOUNDARY_MAX) / CELL_SIZE) & (NUM_CELLS - 1))
|
||||
@@ -310,6 +310,9 @@ enum GoddardScene {
|
||||
CMD_PTR(romEnd)
|
||||
#endif
|
||||
|
||||
#undef LOAD_MIO0_TEXTURE
|
||||
#define LOAD_MIO0_TEXTURE(a,b,c) LOAD_YAY0_TEXTURE(a,b,c)
|
||||
|
||||
#define CHANGE_AREA_SKYBOX(area, segStart, segEnd) \
|
||||
CMD_BBH(LEVEL_CMD_CHANGE_AREA_SKYBOX, 0x0C, area), \
|
||||
CMD_PTR(segStart), \
|
||||
|
||||
@@ -14,8 +14,8 @@ enum LevelNum {
|
||||
LEVEL_COUNT,
|
||||
LEVEL_MAX = LEVEL_COUNT - 1,
|
||||
LEVEL_MIN = LEVEL_NONE + 1,
|
||||
LEVEL_FILE_SELECT = 100, //! This probably breaks if you have 99+ levels
|
||||
LEVEL_LEVEL_SELECT = (LEVEL_FILE_SELECT + 1)
|
||||
LEVEL_FILE_SELECT = LEVEL_COUNT + 1,
|
||||
LEVEL_LEVEL_SELECT = LEVEL_FILE_SELECT + 1,
|
||||
};
|
||||
|
||||
#undef STUB_LEVEL
|
||||
|
||||
@@ -973,11 +973,7 @@
|
||||
#define /*0x104*/ oSnufitBodyScalePeriod OBJECT_FIELD_S32(0x1F)
|
||||
#define /*0x108*/ oSnufitBodyBaseScale OBJECT_FIELD_S32(0x20)
|
||||
#define /*0x10C*/ oSnufitBullets OBJECT_FIELD_S32(0x21)
|
||||
#define /*0x1AC*/ oSnufitOffsetVec OBJECT_FIELD_S16(0x49, 0) // start pos of s16 vec
|
||||
#define /*0x1AC*/ oSnufitXOffset OBJECT_FIELD_S16(0x49, 0)
|
||||
#define /*0x1AE*/ oSnufitYOffset OBJECT_FIELD_S16(0x49, 1)
|
||||
#define /*0x1B0*/ oSnufitZOffset OBJECT_FIELD_S16(0x4A, 0)
|
||||
#define /*0x1B2*/ oSnufitBodyScale OBJECT_FIELD_S16(0x4A, 1)
|
||||
#define /*0x1AC*/ oSnufitBodyScale OBJECT_FIELD_S16(0x49, 0)
|
||||
|
||||
/* Spindel */
|
||||
#define /*0x0F4*/ oSpindelMoveTimer OBJECT_FIELD_S32(0x1B)
|
||||
@@ -1047,7 +1043,6 @@
|
||||
#define /*0x0F4*/ oTiltingPyramidNormalX OBJECT_FIELD_F32(O_TILTING_PYRAMID_NORMAL_X_INDEX)
|
||||
#define /*0x0F8*/ oTiltingPyramidNormalY OBJECT_FIELD_F32(O_TILTING_PYRAMID_NORMAL_Y_INDEX)
|
||||
#define /*0x0FC*/ oTiltingPyramidNormalZ OBJECT_FIELD_F32(O_TILTING_PYRAMID_NORMAL_Z_INDEX)
|
||||
#define /*0x10C*/ oTiltingPyramidMarioOnPlatform OBJECT_FIELD_S32(0x21)
|
||||
|
||||
/* Toad Message */
|
||||
#define /*0x108*/ oToadMessageDialogId OBJECT_FIELD_U32(0x20)
|
||||
|
||||
+21
-19
@@ -32,28 +32,30 @@
|
||||
|
||||
// Common cos values for degrees, often used for surface Y normals
|
||||
// These are different than coss()
|
||||
#define COS1 0.9998477f
|
||||
#define COS5 0.9961947f
|
||||
#define COS10 0.9848077f
|
||||
#define COS15 0.9659258f
|
||||
#define COS20 0.9396926f
|
||||
#define COS25 0.9063078f // ledge grabs
|
||||
#define COS30 0.8660254f
|
||||
#define COS35 0.85264016f
|
||||
#define COS36 0.8443279f
|
||||
#define COS38 0.7880108f // mario_floor_is_slippery default
|
||||
#define COS40 0.80901699f
|
||||
#define COS45 0.76040596f
|
||||
#define COS50 0.70710678f // SURFACE_FLAG_X_PROJECTION
|
||||
#define COS55 0.64944805f
|
||||
#define COS60 0.58778525f
|
||||
#define COS65 0.52249856f
|
||||
#define COS70 0.4539905f
|
||||
#define COS0 1.0f
|
||||
#define COS1 0.99984770f // mario_floor_is_slippery, mario_floor_is_slope
|
||||
#define COS5 0.99619470f // mario_floor_is_slope
|
||||
#define COS10 0.98480775f // act_butt_slide_air, act_hold_butt_slide_air, mario_floor_is_slippery, mario_floor_is_slope
|
||||
#define COS15 0.96592583f // mario_floor_is_slope
|
||||
#define COS20 0.93969262f // mario_floor_is_slippery, mario_floor_is_slope, mario_floor_is_steep
|
||||
#define COS25 0.90630779f // ledge grabs
|
||||
#define COS30 0.86602540f // should_get_stuck_in_ground, mario_floor_is_steep
|
||||
#define COS35 0.81915204f
|
||||
#define COS36 0.80901699f
|
||||
#define COS38 0.78801075f // mario_floor_is_slippery default
|
||||
#define COS40 0.76604444f
|
||||
#define COS45 0.70710678f // SURFACE_FLAG_X_PROJECTION
|
||||
#define COS50 0.64278761f
|
||||
#define COS55 0.57357644f
|
||||
#define COS60 0.5f
|
||||
#define COS65 0.42261826f
|
||||
#define COS70 0.34202014f
|
||||
#define COS73 0.29237169f // common_landing_cancels, check_common_idle_cancels, check_common_hold_idle_cancels
|
||||
#define COS75 0.38268343f
|
||||
#define COS75 0.25881905f
|
||||
#define COS78 0.20791169f
|
||||
#define COS80 0.17364818f // braking action
|
||||
#define COS85 0.23344536f
|
||||
#define COS85 0.087155743f
|
||||
#define COS90 0.0f
|
||||
|
||||
enum RenderLayers {
|
||||
LAYER_FORCE,
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#ifdef VERSION_EU
|
||||
#include "levels/ending/cake_eu.inc.c"
|
||||
|
||||
#ifndef EU_CUSTOM_CAKE_FIX
|
||||
// 0x07023000 - 0x07023FFF
|
||||
ALIGNED8 static const Texture cake_end_texture_eu_35_thank_you[] = {
|
||||
#include "levels/ending/eu_023000.rgba16.inc.c"
|
||||
@@ -38,6 +39,7 @@ ALIGNED8 static const Texture cake_end_texture_eu_39_fin[] = {
|
||||
ALIGNED8 static const Texture cake_end_texture_eu_40_ende[] = {
|
||||
#include "levels/ending/eu_028000.rgba16.inc.c"
|
||||
};
|
||||
#endif // !EU_CUSTOM_CAKE_FIX
|
||||
|
||||
// 0x07029000 - 0x070296D8
|
||||
const Gfx dl_cake_end_screen[] = {
|
||||
|
||||
+6
-6
@@ -72,11 +72,11 @@ const GeoLayout intro_geo_mario_head_regular[] = {
|
||||
GEO_CLOSE_NODE(),
|
||||
#endif
|
||||
GEO_CLOSE_NODE(),
|
||||
#if defined(VERSION_SH)
|
||||
GEO_ZBUFFER(0),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_ASM(INTRO_CONTEXT_NORMAL, geo_intro_rumble_pak_graphic),
|
||||
GEO_CLOSE_NODE(),
|
||||
#if defined(ENABLE_RUMBLE)
|
||||
GEO_ZBUFFER(0),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_ASM(INTRO_CONTEXT_NORMAL, geo_intro_rumble_pak_graphic),
|
||||
GEO_CLOSE_NODE(),
|
||||
#endif
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_END(),
|
||||
@@ -105,7 +105,7 @@ const GeoLayout intro_geo_mario_head_dizzy[] = {
|
||||
GEO_CLOSE_NODE(),
|
||||
#endif
|
||||
GEO_CLOSE_NODE(),
|
||||
#if defined(VERSION_SH)
|
||||
#if defined(ENABLE_RUMBLE)
|
||||
GEO_ZBUFFER(0),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_ASM(INTRO_CONTEXT_GAME_OVER, geo_intro_rumble_pak_graphic),
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
+10
-16
@@ -343,16 +343,12 @@ f32 adsr_update(struct AdsrState *adsr) {
|
||||
s32 adsr_update(struct AdsrState *adsr) {
|
||||
#endif
|
||||
u8 action = adsr->action;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
u8 state = adsr->state;
|
||||
switch (state) {
|
||||
#else
|
||||
switch (adsr->state) {
|
||||
#endif
|
||||
case ADSR_STATE_DISABLED:
|
||||
return 0;
|
||||
|
||||
case ADSR_STATE_INITIAL: {
|
||||
case ADSR_STATE_INITIAL:
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
adsr->current = adsr->initial;
|
||||
adsr->target = adsr->initial;
|
||||
@@ -361,8 +357,7 @@ s32 adsr_update(struct AdsrState *adsr) {
|
||||
adsr->state = ADSR_STATE_HANG;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// fallthrough
|
||||
// fallthrough
|
||||
|
||||
case ADSR_STATE_START_LOOP:
|
||||
adsr->envIndex = 0;
|
||||
@@ -370,11 +365,12 @@ s32 adsr_update(struct AdsrState *adsr) {
|
||||
adsr->currentHiRes = (adsr->current << 0x10);
|
||||
#endif
|
||||
adsr->state = ADSR_STATE_LOOP;
|
||||
|
||||
#ifdef VERSION_SH
|
||||
// fallthrough
|
||||
restart:
|
||||
#endif
|
||||
// fallthrough
|
||||
|
||||
case ADSR_STATE_LOOP:
|
||||
adsr->delay = BSWAP16(adsr->envelope[adsr->envIndex].delay);
|
||||
switch (adsr->delay) {
|
||||
@@ -399,25 +395,23 @@ s32 adsr_update(struct AdsrState *adsr) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
if (adsr->delay >= 4) {
|
||||
adsr->delay = adsr->delay * gAudioBufferParameters.updatesPerFrame
|
||||
#ifdef VERSION_SH
|
||||
#ifdef VERSION_SH
|
||||
/ gAudioBufferParameters.presetUnk4
|
||||
#endif
|
||||
#endif
|
||||
/ 4;
|
||||
}
|
||||
#if defined(VERSION_SH)
|
||||
#ifdef VERSION_SH
|
||||
if (adsr->delay == 0) {
|
||||
adsr->delay = 1;
|
||||
}
|
||||
#endif
|
||||
adsr->target = (f32) BSWAP16(adsr->envelope[adsr->envIndex].arg) / 32767.0f;
|
||||
#elif defined(VERSION_EU)
|
||||
adsr->target = (f32) BSWAP16(adsr->envelope[adsr->envIndex].arg) / 32767.0;
|
||||
#endif
|
||||
adsr->target = adsr->target * adsr->target;
|
||||
adsr->velocity = (adsr->target - adsr->current) / adsr->delay;
|
||||
#else
|
||||
#else // !(VERSION_EU || VERSION_SH)
|
||||
adsr->target = BSWAP16(adsr->envelope[adsr->envIndex].arg);
|
||||
adsr->velocity = ((adsr->target - adsr->current) << 0x10) / adsr->delay;
|
||||
#endif
|
||||
#endif // !(VERSION_EU || VERSION_SH)
|
||||
adsr->state = ADSR_STATE_FADE;
|
||||
adsr->envIndex++;
|
||||
break;
|
||||
|
||||
@@ -1262,7 +1262,7 @@ static void update_game_sound(void) {
|
||||
#endif
|
||||
} else {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
func_802ad728((x04020000 | ((channelIndex & 0xff) << 8),
|
||||
func_802ad728(0x04020000 | ((channelIndex & 0xff) << 8),
|
||||
get_sound_freq_scale(bank, soundIndex) + ((f32) sSoundMovingSpeed[bank] / 400.0f));
|
||||
#else
|
||||
value = get_sound_freq_scale(bank, soundIndex);
|
||||
@@ -2401,8 +2401,12 @@ void func_803210D4(u16 fadeDuration) {
|
||||
/**
|
||||
* Called from threads: thread5_game_loop
|
||||
*/
|
||||
void play_course_clear(void) {
|
||||
seq_player_play_sequence(SEQ_PLAYER_ENV, SEQ_EVENT_CUTSCENE_COLLECT_STAR, 0);
|
||||
void play_course_clear(s32 isKey) {
|
||||
if (isKey) {
|
||||
seq_player_play_sequence(SEQ_PLAYER_ENV, SEQ_EVENT_CUTSCENE_COLLECT_KEY, 0);
|
||||
} else {
|
||||
seq_player_play_sequence(SEQ_PLAYER_ENV, SEQ_EVENT_CUTSCENE_COLLECT_STAR, 0);
|
||||
}
|
||||
sBackgroundMusicMaxTargetVolume = TARGET_VOLUME_IS_PRESENT_FLAG | 0;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
D_EU_80300558 = 2;
|
||||
|
||||
@@ -59,7 +59,7 @@ u32 get_current_background_music(void);
|
||||
void play_secondary_music(u8 seqId, u8 bgMusicVolume, u8 volume, u16 fadeTimer);
|
||||
void func_80321080(u16 fadeTimer);
|
||||
void func_803210D4(u16 fadeOutTime);
|
||||
void play_course_clear(void);
|
||||
void play_course_clear(s32 isKey);
|
||||
void play_peachs_jingle(void);
|
||||
void play_puzzle_jingle(void);
|
||||
void play_star_fanfare(void);
|
||||
|
||||
+5
-5
@@ -169,7 +169,7 @@ void reset_bank_and_seq_load_status(void) {
|
||||
#ifdef VERSION_SH
|
||||
bzero(&gBankLoadStatus, sizeof(gBankLoadStatus));
|
||||
bzero(&gUnkLoadStatus, sizeof(gUnkLoadStatus));
|
||||
bzero(&gSeqLoadStatus, sizeof(gBankLoadStatus));
|
||||
bzero(&gSeqLoadStatus, sizeof(gSeqLoadStatus));
|
||||
#else
|
||||
bzero(&gBankLoadStatus, sizeof(gBankLoadStatus)); // Setting this array to zero is equivilent to SOUND_LOAD_STATUS_NOT_LOADED
|
||||
bzero(&gSeqLoadStatus, sizeof(gSeqLoadStatus)); // Same dealio
|
||||
@@ -380,7 +380,7 @@ void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg
|
||||
// arg3 = 0, 1 or 2?
|
||||
|
||||
#ifdef VERSION_SH
|
||||
struct SoundMultiPool *arg0;
|
||||
struct SoundMultiPool *arg0 = NULL;
|
||||
#define isSound poolIdx
|
||||
#endif
|
||||
struct TemporaryPool *tp;
|
||||
@@ -758,7 +758,7 @@ void *get_bank_or_seq(s32 poolIdx, s32 arg1, s32 id) {
|
||||
}
|
||||
void *get_bank_or_seq_inner(s32 poolIdx, s32 arg1, s32 bankId) {
|
||||
u32 i;
|
||||
struct SoundMultiPool* loadedPool;
|
||||
struct SoundMultiPool* loadedPool = NULL;
|
||||
struct TemporaryPool* temporary;
|
||||
struct PersistentPool* persistent;
|
||||
|
||||
@@ -931,7 +931,7 @@ void decrease_reverb_gain(void) {
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
s32 audio_shut_down_and_reset_step(void) {
|
||||
s32 i, j;
|
||||
s32 i;
|
||||
|
||||
switch (gAudioResetStatus) {
|
||||
case 5:
|
||||
@@ -1007,7 +1007,7 @@ void init_reverb_eu(void) {
|
||||
gNumSynthesisReverbs = preset->numReverbs;
|
||||
for (j = 0; j < gNumSynthesisReverbs; j++) {
|
||||
reverb = &gSynthesisReverbs[j];
|
||||
reverbSettings = &sReverbSettings[MIN((gAudioResetPresetIdToLoad + j), (sizeof(sReverbSettings) / sizeof(struct ReverbSettingsEU)) - 1)];
|
||||
reverbSettings = &sReverbSettings[MIN((u32)(gAudioResetPresetIdToLoad + j), (sizeof(sReverbSettings) / sizeof(struct ReverbSettingsEU)) - 1)];
|
||||
reverb->windowSize = (reverbSettings->windowSize * 0x40);
|
||||
reverb->downsampleRate = reverbSettings->downsampleRate;
|
||||
reverb->reverbGain = reverbSettings->gain;
|
||||
|
||||
@@ -137,14 +137,8 @@ u8 audioString49[] = "BANK LOAD MISS! FOR %d\n";
|
||||
* Performs an asynchronus (normal priority) DMA copy
|
||||
*/
|
||||
void audio_dma_copy_async(uintptr_t devAddr, void *vAddr, size_t nbytes, OSMesgQueue *queue, OSIoMesg *mesg) {
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
osInvalDCache(vAddr, nbytes);
|
||||
osPiStartDma(mesg, OS_MESG_PRI_NORMAL, OS_READ, devAddr, vAddr, nbytes, queue);
|
||||
#if PUPPYPRINT_DEBUG
|
||||
dmaAudioTime[perfIteration] += (osGetTime() - first);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -152,18 +146,12 @@ void audio_dma_copy_async(uintptr_t devAddr, void *vAddr, size_t nbytes, OSMesgQ
|
||||
* to 0x1000 bytes transfer at once.
|
||||
*/
|
||||
void audio_dma_partial_copy_async(uintptr_t *devAddr, u8 **vAddr, ssize_t *remaining, OSMesgQueue *queue, OSIoMesg *mesg) {
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
ssize_t transfer = MIN(*remaining, 0x1000);
|
||||
*remaining -= transfer;
|
||||
osInvalDCache(*vAddr, transfer);
|
||||
osPiStartDma(mesg, OS_MESG_PRI_NORMAL, OS_READ, *devAddr, *vAddr, transfer, queue);
|
||||
*devAddr += transfer;
|
||||
*vAddr += transfer;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
dmaAudioTime[perfIteration] += (osGetTime() - first);
|
||||
#endif
|
||||
}
|
||||
|
||||
void decrease_sample_dma_ttls() {
|
||||
@@ -208,9 +196,6 @@ void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) {
|
||||
u32 i;
|
||||
u32 dmaIndex;
|
||||
ssize_t bufferPos;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
if (arg2 != 0 || *dmaIndexRef >= sSampleDmaListSize1) {
|
||||
for (i = sSampleDmaListSize1; i < gSampleDmaNumListItems; i++) {
|
||||
@@ -235,9 +220,6 @@ void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) {
|
||||
}
|
||||
dma->ttl = 60;
|
||||
*dmaIndexRef = (u8) i;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
dmaAudioTime[perfIteration] += (osGetTime() - first);
|
||||
#endif
|
||||
#if defined(VERSION_EU)
|
||||
return &dma->buffer[(devAddr - dma->source)];
|
||||
#else
|
||||
@@ -277,14 +259,8 @@ void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) {
|
||||
}
|
||||
dma->ttl = 2;
|
||||
#if defined(VERSION_EU)
|
||||
#if PUPPYPRINT_DEBUG
|
||||
dmaAudioTime[perfIteration] += (osGetTime() - first);
|
||||
#endif
|
||||
return dma->buffer + (devAddr - dma->source);
|
||||
#else
|
||||
#if PUPPYPRINT_DEBUG
|
||||
dmaAudioTime[perfIteration] += (osGetTime() - first);
|
||||
#endif
|
||||
return (devAddr - dma->source) + dma->buffer;
|
||||
#endif
|
||||
}
|
||||
@@ -310,18 +286,12 @@ void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) {
|
||||
osPiStartDma(&gCurrAudioFrameDmaIoMesgBufs[gCurrAudioFrameDmaCount++], OS_MESG_PRI_NORMAL,
|
||||
OS_READ, dmaDevAddr, dma->buffer, transfer, &gCurrAudioFrameDmaQueue);
|
||||
*dmaIndexRef = dmaIndex;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
dmaAudioTime[perfIteration] += (osGetTime() - first);
|
||||
#endif
|
||||
return (devAddr - dmaDevAddr) + dma->buffer;
|
||||
#else
|
||||
gCurrAudioFrameDmaCount++;
|
||||
osPiStartDma(&gCurrAudioFrameDmaIoMesgBufs[gCurrAudioFrameDmaCount - 1], OS_MESG_PRI_NORMAL,
|
||||
OS_READ, dmaDevAddr, dma->buffer, transfer, &gCurrAudioFrameDmaQueue);
|
||||
*dmaIndexRef = dmaIndex;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
dmaAudioTime[perfIteration] += (osGetTime() - first);
|
||||
#endif
|
||||
return dma->buffer + (devAddr - dmaDevAddr);
|
||||
#endif
|
||||
}
|
||||
|
||||
+6
-10
@@ -315,7 +315,7 @@ struct AudioBank *load_banks_immediate(s32 seqId, s32 *outDefaultBank) {
|
||||
u8 bank;
|
||||
s32 offset;
|
||||
s32 i;
|
||||
void *ret;
|
||||
void *ret = NULL;
|
||||
|
||||
offset = ((u16 *)gAlBankSets)[canonicalize_index(0, seqId)];
|
||||
bank = 0xFF;
|
||||
@@ -471,7 +471,6 @@ void load_sequence_internal(s32 player, s32 seqId, UNUSED s32 loadAsync) {
|
||||
u32 s0;
|
||||
s32 count;
|
||||
u8 bank;
|
||||
s32 i;
|
||||
|
||||
seqPlayer = &gSequencePlayers[player];
|
||||
|
||||
@@ -569,7 +568,7 @@ void *func_sh_802f3688(s32 bankId) {
|
||||
patchInfo.baseAddr2 = NULL;
|
||||
}
|
||||
|
||||
ret = func_sh_802f3764(1, bankId, &sp38)
|
||||
ret = func_sh_802f3764(1, bankId, &sp38);
|
||||
|
||||
if (ret != NULL && sp38 == 1) {
|
||||
func_sh_802f5310(bankId, ret, &patchInfo, 0);
|
||||
@@ -796,8 +795,7 @@ void func_sh_802f3c38(uintptr_t devAddr, void *vAddr, size_t nbytes, s32 medium)
|
||||
}
|
||||
}
|
||||
|
||||
void func_sh_802f3d78(uintptr_t devAddr, void *vAddr, size_t nbytes, s32 arg3) {
|
||||
uintptr_t sp1C = devAddr;
|
||||
void func_sh_802f3d78(UNUSED uintptr_t devAddr, void *vAddr, size_t nbytes, UNUSED s32 arg3) {
|
||||
osInvalDCache(vAddr, nbytes);
|
||||
}
|
||||
|
||||
@@ -1168,8 +1166,7 @@ void func_sh_802f4bd8(struct PendingDmaSample *arg0, s32 len) { // len must be s
|
||||
func_sh_802f3dd0(&arg0->ioMesg, 0, 0, arg0->devAddr, arg0->vAddr, len, &arg0->queue, arg0->medium, shindouDebugPrint102);
|
||||
}
|
||||
|
||||
void func_sh_802f4c5c(uintptr_t devAddr, void *vAddr, size_t nbytes, s32 arg3) {
|
||||
uintptr_t sp1C = devAddr;
|
||||
void func_sh_802f4c5c(UNUSED uintptr_t devAddr, void *vAddr, size_t nbytes, UNUSED s32 arg3) {
|
||||
osInvalDCache(vAddr, nbytes);
|
||||
}
|
||||
|
||||
@@ -1319,8 +1316,7 @@ void func_sh_802f50ec(struct PendingDmaAudioBank *arg0, size_t len) {
|
||||
}
|
||||
|
||||
|
||||
void func_sh_802f517c(uintptr_t devAddr, void *vAddr, size_t nbytes, s32 arg3) {
|
||||
uintptr_t sp1C = devAddr;
|
||||
void func_sh_802f517c(UNUSED uintptr_t devAddr, void *vAddr, size_t nbytes, UNUSED s32 arg3) {
|
||||
osInvalDCache(vAddr, nbytes);
|
||||
}
|
||||
|
||||
@@ -1359,7 +1355,7 @@ void patch_sound(struct AudioBankSound *sound, struct AudioBank *memBase, struct
|
||||
}
|
||||
|
||||
void func_sh_802f5310(s32 bankId, struct AudioBank *mem, struct PatchStruct *patchInfo, s32 arg3) {
|
||||
u8 *addr;
|
||||
u8 *addr = NULL;
|
||||
s32 sp4C;
|
||||
struct AudioBankSample *temp_s0;
|
||||
s32 i;
|
||||
|
||||
@@ -448,19 +448,16 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
|
||||
struct Instrument *instrument;
|
||||
struct Drum *drum;
|
||||
s32 temp_a0_5;
|
||||
u16 sp3A = 0;
|
||||
#ifdef VERSION_EU
|
||||
u16 sp3A;
|
||||
s32 sameSound = TRUE;
|
||||
#else
|
||||
u8 sameSound = TRUE;
|
||||
#endif
|
||||
u8 cmd;
|
||||
UNUSED u8 cmdSemitone;
|
||||
#ifndef VERSION_EU
|
||||
u16 sp3A;
|
||||
#endif
|
||||
f32 tuning;
|
||||
s32 vel;
|
||||
s32 vel = 0;
|
||||
UNUSED s32 usedSemitone;
|
||||
f32 freqScale;
|
||||
#ifndef VERSION_EU
|
||||
@@ -1139,6 +1136,7 @@ s32 seq_channel_layer_process_script_part2(struct SequenceChannelLayer *layer) {
|
||||
cmd = m64_read_u8(state) + 0x80;
|
||||
layer->freqScaleMultiplier = unk_sh_data_1[cmd];
|
||||
// missing break :)
|
||||
FALL_THROUGH;
|
||||
|
||||
default:
|
||||
switch (cmd & 0xf0) {
|
||||
@@ -1286,8 +1284,8 @@ s32 seq_channel_layer_process_script_part4(struct SequenceChannelLayer *layer, s
|
||||
|
||||
s32 seq_channel_layer_process_script_part3(struct SequenceChannelLayer *layer, s32 cmd) {
|
||||
struct M64ScriptState *state = &layer->scriptState;
|
||||
u16 sp3A;
|
||||
s32 vel;
|
||||
u16 sp3A = 0;
|
||||
s32 vel = 0;
|
||||
struct SequenceChannel *seqChannel = layer->seqChannel;
|
||||
struct SequencePlayer *seqPlayer = seqChannel->seqPlayer;
|
||||
|
||||
@@ -1653,7 +1651,7 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) {
|
||||
} else {
|
||||
eu_stubbed_printf_1("SUB:ERR:BANK %d NOT CACHED.\n", cmd);
|
||||
}
|
||||
// fallthrough
|
||||
FALL_THROUGH;
|
||||
#endif
|
||||
|
||||
case 0xc1: // chan_setinstr ("set program"?)
|
||||
|
||||
@@ -513,7 +513,7 @@ u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) {
|
||||
u32 *aiBufPtr;
|
||||
u64 *cmd = cmdBuf;
|
||||
s32 chunkLen;
|
||||
s32 nextVolRampTable;
|
||||
s32 nextVolRampTable = 0;
|
||||
|
||||
for (i = gAudioBufferParameters.updatesPerFrame; i > 0; i--) {
|
||||
process_sequences(i - 1);
|
||||
@@ -634,7 +634,7 @@ u64 *synthesis_resample_and_mix_reverb(u64 *cmd, s32 bufLen, s16 reverbIndex, s1
|
||||
aMix(cmd++, 0, 0x7fff, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_LEFT_CH);
|
||||
aMix(cmd++, 0, 0x8000 + gSynthesisReverbs[reverbIndex].reverbGain, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_LEFT_CH);
|
||||
} else {
|
||||
startPad = (item->startPos & 0x7) * 2
|
||||
startPad = (item->startPos & 0x7) * 2;
|
||||
paddedLengthA = AUDIO_ALIGN(startPad + item->lengthA, 4);
|
||||
|
||||
cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_RESAMPLED, (item->startPos - startPad / 2), DEFAULT_LEN_1CH, reverbIndex);
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
aSetBuffer(pkt, 0, 0, c + DMEM_ADDR_WET_RIGHT_CH, d); \
|
||||
aSaveBuffer(pkt, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.ringBuffer.right + (off)));
|
||||
|
||||
#undef ALIGN
|
||||
#define ALIGN(val, amnt) (((val) + (1 << amnt) - 1) & ~((1 << amnt) - 1))
|
||||
|
||||
struct VolumeChange {
|
||||
@@ -62,6 +63,7 @@ struct NoteSubEu *gNoteSubsEu;
|
||||
// just that the reverb structure is chosen from an array with index
|
||||
// Identical in EU.
|
||||
void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex, s32 reverbIndex) {
|
||||
struct ReverbRingBufferItem *item;
|
||||
struct SynthesisReverb *reverb = &gSynthesisReverbs[reverbIndex];
|
||||
s32 srcPos, dstPos;
|
||||
if (reverb->downsampleRate != 1) {
|
||||
@@ -85,7 +87,7 @@ void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex, s32 reverbIndex)
|
||||
}
|
||||
}
|
||||
|
||||
struct ReverbRingBufferItem *item = &reverb->items[reverb->curFrame][updateIndex];
|
||||
item = &reverb->items[reverb->curFrame][updateIndex];
|
||||
s32 nSamples = chunkLen / reverb->downsampleRate;
|
||||
s32 excessiveSamples = (nSamples + reverb->nextRingBufferPos) - reverb->bufSizePerChannel;
|
||||
if (excessiveSamples < 0) {
|
||||
@@ -374,7 +376,7 @@ u64 *synthesis_process_note(s32 noteIndex, struct NoteSubEu *noteSubEu, struct N
|
||||
s32 flags; // sp148, sp11C, t8
|
||||
u16 resamplingRateFixedPoint; // sp5c, sp11A
|
||||
s32 nSamplesToLoad; //s0, Ec
|
||||
s32 sp130; //sp128, sp104
|
||||
s32 sp130 = 0; //sp128, sp104
|
||||
UNUSED s32 tempBufLen;
|
||||
s32 t0;
|
||||
u8 *sampleAddr; // sp120, spF4
|
||||
@@ -394,7 +396,7 @@ u64 *synthesis_process_note(s32 noteIndex, struct NoteSubEu *noteSubEu, struct N
|
||||
s32 nSamplesInThisIteration; // v1_2
|
||||
u32 a3;
|
||||
u8 *v0_2;
|
||||
s32 unk_s6; // sp90
|
||||
s32 unk_s6 = 0; // sp90
|
||||
s32 s5Aligned;
|
||||
s32 sp88;
|
||||
s32 sp84;
|
||||
|
||||
+19
-25
@@ -19,6 +19,7 @@
|
||||
#endif
|
||||
#include "game/puppyprint.h"
|
||||
#include "game/puppylights.h"
|
||||
#include "game/profiling.h"
|
||||
|
||||
// Message IDs
|
||||
enum MessageIDs {
|
||||
@@ -185,10 +186,8 @@ void start_gfx_sptask(void) {
|
||||
if (gActiveSPTask == NULL
|
||||
&& sCurrentDisplaySPTask != NULL
|
||||
&& sCurrentDisplaySPTask->state == SPTASK_STATE_NOT_STARTED) {
|
||||
#if PUPPYPRINT_DEBUG
|
||||
rspDelta = osGetTime();
|
||||
#endif
|
||||
start_sptask(M_GFXTASK);
|
||||
profiler_rsp_started(PROFILER_RSP_GFX);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,15 +219,14 @@ void handle_vblank(void) {
|
||||
} else {
|
||||
pretend_audio_sptask_done();
|
||||
}
|
||||
profiler_rsp_started(PROFILER_RSP_AUDIO);
|
||||
}
|
||||
} else {
|
||||
if (gActiveSPTask == NULL
|
||||
&& sCurrentDisplaySPTask != NULL
|
||||
&& sCurrentDisplaySPTask->state != SPTASK_STATE_FINISHED) {
|
||||
#if PUPPYPRINT_DEBUG
|
||||
rspDelta = osGetTime();
|
||||
#endif
|
||||
start_sptask(M_GFXTASK);
|
||||
profiler_rsp_started(PROFILER_RSP_GFX);
|
||||
}
|
||||
}
|
||||
#if ENABLE_RUMBLE
|
||||
@@ -253,9 +251,9 @@ void handle_sp_complete(void) {
|
||||
// The gfx task completed before we had time to interrupt it.
|
||||
// Mark it finished, just like below.
|
||||
curSPTask->state = SPTASK_STATE_FINISHED;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
profiler_update(rspGenTime, rspDelta);
|
||||
#endif
|
||||
profiler_rsp_completed(PROFILER_RSP_GFX);
|
||||
} else {
|
||||
profiler_rsp_yielded();
|
||||
}
|
||||
|
||||
// Start the audio task, as expected by handle_vblank.
|
||||
@@ -264,12 +262,19 @@ void handle_sp_complete(void) {
|
||||
} else {
|
||||
pretend_audio_sptask_done();
|
||||
}
|
||||
profiler_rsp_started(PROFILER_RSP_AUDIO);
|
||||
} else {
|
||||
curSPTask->state = SPTASK_STATE_FINISHED;
|
||||
if (curSPTask->task.t.type == M_AUDTASK) {
|
||||
profiler_rsp_completed(PROFILER_RSP_AUDIO);
|
||||
// After audio tasks come gfx tasks.
|
||||
if ((sCurrentDisplaySPTask != NULL)
|
||||
&& (sCurrentDisplaySPTask->state != SPTASK_STATE_FINISHED)) {
|
||||
if (sCurrentDisplaySPTask->state == SPTASK_STATE_INTERRUPTED) {
|
||||
profiler_rsp_resumed();
|
||||
} else {
|
||||
profiler_rsp_started(PROFILER_RSP_GFX);
|
||||
}
|
||||
start_sptask(M_GFXTASK);
|
||||
}
|
||||
sCurrentAudioSPTask = NULL;
|
||||
@@ -280,9 +285,7 @@ void handle_sp_complete(void) {
|
||||
// The SP process is done, but there is still a Display Processor notification
|
||||
// that needs to arrive before we can consider the task completely finished and
|
||||
// null out sCurrentDisplaySPTask. That happens in handle_dp_complete.
|
||||
#if PUPPYPRINT_DEBUG
|
||||
profiler_update(rspGenTime, rspDelta);
|
||||
#endif
|
||||
profiler_rsp_completed(PROFILER_RSP_GFX);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -311,8 +314,9 @@ void thread3_main(UNUSED void *arg) {
|
||||
|
||||
#ifdef DEBUG
|
||||
osSyncPrintf("Super Mario 64\n");
|
||||
#if 0 // if your PC username isn't your real name feel free to uncomment
|
||||
osSyncPrintf("Built by: %s\n", __username__);
|
||||
osSyncPrintf("Date : %s\n", __datetime__);
|
||||
#endif
|
||||
osSyncPrintf("Compiler: %s\n", __compiler__);
|
||||
osSyncPrintf("Linker : %s\n", __linker__);
|
||||
#endif
|
||||
@@ -325,9 +329,6 @@ void thread3_main(UNUSED void *arg) {
|
||||
|
||||
while (TRUE) {
|
||||
OSMesg msg;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
osRecvMesg(&gIntrMesgQueue, &msg, OS_MESG_BLOCK);
|
||||
switch ((uintptr_t) msg) {
|
||||
case MESG_VI_VBLANK:
|
||||
@@ -346,9 +347,6 @@ void thread3_main(UNUSED void *arg) {
|
||||
handle_nmi_request();
|
||||
break;
|
||||
}
|
||||
#if PUPPYPRINT_DEBUG
|
||||
profiler_update(taskTime, first);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -478,12 +476,10 @@ void thread1_idle(UNUSED void *arg) {
|
||||
}
|
||||
}
|
||||
|
||||
#if CLEARRAM
|
||||
void ClearRAM(void)
|
||||
{
|
||||
// Clear RAM on boot
|
||||
void ClearRAM(void) {
|
||||
bzero(_mainSegmentEnd, (size_t)osMemSize - (size_t)OS_K0_TO_PHYSICAL(_mainSegmentEnd));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ISVPRINT
|
||||
extern u32 gISVDbgPrnAdrs;
|
||||
@@ -502,9 +498,7 @@ void osInitialize_fakeisv() {
|
||||
#endif
|
||||
|
||||
void main_func(void) {
|
||||
#if CLEARRAM
|
||||
ClearRAM();
|
||||
#endif
|
||||
__osInitialize_common();
|
||||
#ifdef ISVPRINT
|
||||
osInitialize_fakeisv();
|
||||
|
||||
@@ -259,9 +259,6 @@ u32 main_pool_pop_state(void) {
|
||||
*/
|
||||
void dma_read(u8 *dest, u8 *srcStart, u8 *srcEnd) {
|
||||
u32 size = ALIGN16(srcEnd - srcStart);
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
osInvalDCache(dest, size);
|
||||
while (size != 0) {
|
||||
@@ -275,9 +272,6 @@ void dma_read(u8 *dest, u8 *srcStart, u8 *srcEnd) {
|
||||
srcStart += copySize;
|
||||
size -= copySize;
|
||||
}
|
||||
#if PUPPYPRINT_DEBUG
|
||||
dmaTime[perfIteration] += (osGetTime() - first);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -894,25 +894,18 @@ void cur_obj_update(void) {
|
||||
}
|
||||
|
||||
#if SILHOUETTE
|
||||
COND_BIT(( objFlags & OBJ_FLAG_SILHOUETTE ), o->header.gfx.node.flags, GRAPH_RENDER_SILHOUETTE );
|
||||
COND_BIT(( objFlags & OBJ_FLAG_OCCLUDE_SILHOUETTE ), o->header.gfx.node.flags, GRAPH_RENDER_OCCLUDE_SILHOUETTE);
|
||||
COND_BIT((objFlags & OBJ_FLAG_SILHOUETTE ), o->header.gfx.node.flags, GRAPH_RENDER_SILHOUETTE );
|
||||
COND_BIT((objFlags & OBJ_FLAG_OCCLUDE_SILHOUETTE), o->header.gfx.node.flags, GRAPH_RENDER_OCCLUDE_SILHOUETTE);
|
||||
#endif
|
||||
|
||||
#ifdef OBJECTS_REJ
|
||||
s32 objListIndex = OBJ_LIST_PLAYER;
|
||||
|
||||
BehaviorScript *bhvScript = segmented_to_virtual(o->behavior);
|
||||
if ((bhvScript[0] >> 24) == 0) {
|
||||
objListIndex = ((bhvScript[0] >> 16) & 0xFFFF);
|
||||
}
|
||||
|
||||
if (objFlags & OBJ_FLAG_UCODE_SMALL) {
|
||||
if ((objFlags & OBJ_FLAG_SILHOUETTE) || (objFlags & OBJ_FLAG_UCODE_SMALL)) {
|
||||
o->header.gfx.ucode = GRAPH_NODE_UCODE_REJ;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
o->header.gfx.ucode = GRAPH_NODE_UCODE_DEFAULT;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef OBJ_OPACITY_BY_CAM_DIST
|
||||
if (objFlags & OBJ_FLAG_OPACITY_FROM_CAMERA_DIST) {
|
||||
obj_set_opacity_from_cam_dist(o);
|
||||
|
||||
@@ -430,11 +430,15 @@ struct GraphNodeShadow *init_graph_node_shadow(struct AllocOnlyPool *pool,
|
||||
|
||||
if (graphNode != NULL) {
|
||||
#ifdef LEGACY_SHADOW_IDS
|
||||
if (shadowType == 1 || shadowType == 2 || shadowType == 99) {
|
||||
if (shadowType == LEGACY_SHADOW_CIRCLE_9_VERTS
|
||||
|| shadowType == LEGACY_SHADOW_CIRCLE_4_VERTS
|
||||
|| shadowType == LEGACY_SHADOW_CIRCLE_4_VERTS_FLAT_UNUSED
|
||||
|| shadowType == LEGACY_SHADOW_CIRCLE_PLAYER) {
|
||||
shadowType = SHADOW_CIRCLE;
|
||||
} else if (shadowType == 11 || shadowType == 12) {
|
||||
} else if (shadowType == LEGACY_SHADOW_SQUARE_SCALABLE
|
||||
|| shadowType == LEGACY_SHADOW_SQUARE_TOGGLABLE) {
|
||||
shadowType = SHADOW_SQUARE;
|
||||
} else if (shadowType == 10) {
|
||||
} else if (shadowType == LEGACY_SHADOW_SQUARE_PERMANENT) {
|
||||
shadowType = SHADOW_SQUARE_PERMANENT;
|
||||
}
|
||||
#endif
|
||||
|
||||
+7
-13
@@ -100,7 +100,7 @@ void min_max_3f(f32 a, f32 b, f32 c, f32 *min, f32 *max) { min_max_3_func(a, b,
|
||||
void min_max_3i(s32 a, s32 b, s32 c, s32 *min, s32 *max) { min_max_3_func(a, b, c, min, max); }
|
||||
void min_max_3s(s16 a, s16 b, s16 c, s16 *min, s16 *max) { min_max_3_func(a, b, c, min, max); }
|
||||
|
||||
/// Copy vector 'src' to 'dest'
|
||||
/// Perform a bitwise copy from vector 'src' to 'dest'
|
||||
#define vec3_copy_bits(destFmt, dest, srcFmt, src) { \
|
||||
register destFmt x = ((srcFmt *) src)[0]; \
|
||||
register destFmt y = ((srcFmt *) src)[1]; \
|
||||
@@ -255,7 +255,7 @@ void vec3s_prod(Vec3s dest, const Vec3s a, const Vec3s b) { vec3_prod_func(s16,
|
||||
#undef vec3_prod_func
|
||||
|
||||
|
||||
/// Add vector 'a' to 'dest'
|
||||
/// Performs element-wise division of two 3-vectors
|
||||
#define vec3_div_func(fmt, dest, a) { \
|
||||
register fmt x = ((fmt *) a)[0]; \
|
||||
register fmt y = ((fmt *) a)[1]; \
|
||||
@@ -269,7 +269,7 @@ void vec3i_div(Vec3i dest, const Vec3i a) { vec3_div_func(s32, dest, a); }
|
||||
void vec3s_div(Vec3s dest, const Vec3s a) { vec3_div_func(s16, dest, a); }
|
||||
#undef vec3_div_func
|
||||
|
||||
/// Make 'dest' the sum of vectors a and b.
|
||||
/// Make 'dest' the quotient of vectors a and b.
|
||||
#define vec3_quot_func(fmt, dest, a, b) { \
|
||||
register fmt x1 = ((fmt *) a)[0]; \
|
||||
register fmt y1 = ((fmt *) a)[1]; \
|
||||
@@ -1339,8 +1339,8 @@ s32 ray_surface_intersect(Vec3f orig, Vec3f dir, f32 dir_length, struct Surface
|
||||
vec3f_cross(h, dir, e2);
|
||||
// Determine the cos(angle) difference between ray and surface normals.
|
||||
f32 det = vec3f_dot(e1, h);
|
||||
// Check if we're perpendicular from the surface.
|
||||
if ((det > -NEAR_ZERO) && (det < NEAR_ZERO)) return FALSE;
|
||||
// Check if we're perpendicular or pointing away from the surface.
|
||||
if (det < NEAR_ZERO) return FALSE;
|
||||
// Check if we're making contact with the surface.
|
||||
// Make f the inverse of the cos(angle) between ray and surface normals.
|
||||
f32 f = 1.0f / det; // invDet
|
||||
@@ -1377,9 +1377,6 @@ void find_surface_on_ray_list(struct SurfaceNode *list, Vec3f orig, Vec3f dir, f
|
||||
f32 length;
|
||||
Vec3f chk_hit_pos;
|
||||
f32 top, bottom;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
// Get upper and lower bounds of ray
|
||||
if (dir[1] >= 0.0f) {
|
||||
// Ray is upwards.
|
||||
@@ -1403,9 +1400,6 @@ void find_surface_on_ray_list(struct SurfaceNode *list, Vec3f orig, Vec3f dir, f
|
||||
*max_length = length;
|
||||
}
|
||||
}
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime() - first;
|
||||
#endif
|
||||
}
|
||||
|
||||
void find_surface_on_ray_cell(s32 cellX, s32 cellZ, Vec3f orig, Vec3f normalized_dir, f32 dir_length, struct Surface **hit_surface, Vec3f hit_pos, f32 *max_length, s32 flags) {
|
||||
@@ -1512,14 +1506,14 @@ static ALWAYS_INLINE float construct_float(const float f)
|
||||
: "=r"(r)
|
||||
: "K"(upper));
|
||||
} else if ((i & 0xFFFF0000) == 0) {
|
||||
__asm__ ("addiu %0, $0, %1"
|
||||
__asm__ ("ori %0, $0, %1"
|
||||
: "+r"(r)
|
||||
: "K"(lower));
|
||||
} else {
|
||||
__asm__ ("lui %0, %1"
|
||||
: "=r"(r)
|
||||
: "K"(upper));
|
||||
__asm__ ("addiu %0, %0, %1"
|
||||
__asm__ ("ori %0, %0, %1"
|
||||
: "+r"(r)
|
||||
: "K"(lower));
|
||||
}
|
||||
|
||||
@@ -175,16 +175,10 @@ s32 find_wall_collisions(struct WallCollisionData *colData) {
|
||||
s32 numCollisions = 0;
|
||||
s32 x = colData->x;
|
||||
s32 z = colData->z;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
colData->numWalls = 0;
|
||||
|
||||
if (is_outside_level_bounds(x, z)) {
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime() - first;
|
||||
#endif
|
||||
return numCollisions;
|
||||
}
|
||||
|
||||
@@ -207,9 +201,6 @@ s32 find_wall_collisions(struct WallCollisionData *colData) {
|
||||
// Increment the debug tracker.
|
||||
gNumCalls.wall++;
|
||||
#endif
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime() - first;
|
||||
#endif
|
||||
|
||||
return numCollisions;
|
||||
}
|
||||
@@ -326,18 +317,12 @@ static struct Surface *find_ceil_from_list(struct SurfaceNode *surfaceNode, s32
|
||||
f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct Surface **pceil) {
|
||||
f32 height = CELL_HEIGHT_LIMIT;
|
||||
f32 dynamicHeight = CELL_HEIGHT_LIMIT;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
s32 x = posX;
|
||||
s32 y = posY;
|
||||
s32 z = posZ;
|
||||
*pceil = NULL;
|
||||
|
||||
if (is_outside_level_bounds(x, z)) {
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += (osGetTime() - first);
|
||||
#endif
|
||||
return height;
|
||||
}
|
||||
|
||||
@@ -379,9 +364,6 @@ f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct Surface **pceil) {
|
||||
// Increment the debug tracker.
|
||||
gNumCalls.ceil++;
|
||||
#endif
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime() - first;
|
||||
#endif
|
||||
|
||||
return height;
|
||||
}
|
||||
@@ -563,10 +545,6 @@ f32 unused_find_dynamic_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfl
|
||||
* Find the highest floor under a given position and return the height.
|
||||
*/
|
||||
f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) {
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
f32 height = FLOOR_LOWER_LIMIT;
|
||||
f32 dynamicHeight = FLOOR_LOWER_LIMIT;
|
||||
|
||||
@@ -580,9 +558,6 @@ f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) {
|
||||
*pfloor = NULL;
|
||||
|
||||
if (is_outside_level_bounds(x, z)) {
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += (osGetTime() - first);
|
||||
#endif
|
||||
return height;
|
||||
}
|
||||
// Each level is split into cells to limit load, find the appropriate cell.
|
||||
@@ -626,9 +601,6 @@ f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) {
|
||||
#ifdef VANILLA_DEBUG
|
||||
// Increment the debug tracker.
|
||||
gNumCalls.floor++;
|
||||
#endif
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += (osGetTime() - first);
|
||||
#endif
|
||||
return height;
|
||||
}
|
||||
@@ -682,9 +654,6 @@ s32 find_water_level_and_floor(s32 x, s32 y, s32 z, struct Surface **pfloor) {
|
||||
s32 loX, hiX, loZ, hiZ;
|
||||
TerrainData *p = gEnvironmentRegions;
|
||||
struct Surface *floor = NULL;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
s32 waterLevel = find_water_floor(x, y, z, &floor);
|
||||
|
||||
if (p != NULL && waterLevel == FLOOR_LOWER_LIMIT) {
|
||||
@@ -710,9 +679,6 @@ s32 find_water_level_and_floor(s32 x, s32 y, s32 z, struct Surface **pfloor) {
|
||||
*pfloor = floor;
|
||||
}
|
||||
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += (osGetTime() - first);
|
||||
#endif
|
||||
return waterLevel;
|
||||
}
|
||||
|
||||
@@ -724,9 +690,6 @@ s32 find_water_level(s32 x, s32 z) { // TODO: Allow y pos
|
||||
s32 loX, hiX, loZ, hiZ;
|
||||
TerrainData *p = gEnvironmentRegions;
|
||||
struct Surface *floor = NULL;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
s32 waterLevel = find_water_floor(x, ((gCollisionFlags & COLLISION_FLAG_CAMERA) ? gLakituState.pos[1] : gMarioState->pos[1]), z, &floor);
|
||||
|
||||
if ((p != NULL) && (waterLevel == FLOOR_LOWER_LIMIT)) {
|
||||
@@ -750,10 +713,6 @@ s32 find_water_level(s32 x, s32 z) { // TODO: Allow y pos
|
||||
}
|
||||
}
|
||||
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime() - first;
|
||||
#endif
|
||||
|
||||
return waterLevel;
|
||||
}
|
||||
|
||||
@@ -765,9 +724,6 @@ s32 find_poison_gas_level(s32 x, s32 z) {
|
||||
s32 loX, hiX, loZ, hiZ;
|
||||
s32 gasLevel = FLOOR_LOWER_LIMIT;
|
||||
TerrainData *p = gEnvironmentRegions;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
if (p != NULL) {
|
||||
s32 numRegions = *p++;
|
||||
@@ -794,10 +750,6 @@ s32 find_poison_gas_level(s32 x, s32 z) {
|
||||
}
|
||||
}
|
||||
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime() - first;
|
||||
#endif
|
||||
|
||||
return gasLevel;
|
||||
}
|
||||
|
||||
|
||||
@@ -470,9 +470,6 @@ u32 get_area_terrain_size(TerrainData *data) {
|
||||
void load_area_terrain(s32 index, TerrainData *data, RoomData *surfaceRooms, s16 *macroObjects) {
|
||||
s32 terrainLoadType;
|
||||
TerrainData *vertexData = NULL;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
// Initialize the data for this.
|
||||
gEnvironmentRegions = NULL;
|
||||
@@ -519,9 +516,6 @@ void load_area_terrain(s32 index, TerrainData *data, RoomData *surfaceRooms, s16
|
||||
|
||||
gNumStaticSurfaceNodes = gSurfaceNodesAllocated;
|
||||
gNumStaticSurfaces = gSurfacesAllocated;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime() - first;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -646,9 +640,6 @@ static void get_optimal_coll_dist(struct Object *obj) {
|
||||
*/
|
||||
void load_object_collision_model(void) {
|
||||
TerrainData vertexData[600];
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
TerrainData *collisionData = o->collisionData;
|
||||
f32 marioDist = o->oDistanceToMario;
|
||||
@@ -686,7 +677,4 @@ void load_object_collision_model(void) {
|
||||
}
|
||||
}
|
||||
COND_BIT((marioDist < o->oDrawingDistance), o->header.gfx.node.flags, GRAPH_RENDER_ACTIVE);
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime() - first;
|
||||
#endif
|
||||
}
|
||||
+4
-8
@@ -25,6 +25,7 @@
|
||||
#include "puppyprint.h"
|
||||
#include "debug_box.h"
|
||||
#include "engine/colors.h"
|
||||
#include "profiling.h"
|
||||
|
||||
struct SpawnInfo gPlayerSpawnInfos[1];
|
||||
struct GraphNode *gGraphNodePointers[MODEL_ID_COUNT];
|
||||
@@ -375,10 +376,6 @@ void play_transition_after_delay(s16 transType, s16 time, u8 red, u8 green, u8 b
|
||||
}
|
||||
|
||||
void render_game(void) {
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
OSTime colTime = collisionTime[perfIteration];
|
||||
#endif
|
||||
if (gCurrentArea != NULL && !gWarpTransition.pauseRendering) {
|
||||
if (gCurrentArea->graphNode) {
|
||||
geo_process_root(gCurrentArea->graphNode, gViewportOverride, gViewportClip, gFBSetColor);
|
||||
@@ -434,11 +431,10 @@ void render_game(void) {
|
||||
|
||||
gViewportOverride = NULL;
|
||||
gViewportClip = NULL;
|
||||
|
||||
|
||||
profiler_update(PROFILER_TIME_GFX);
|
||||
profiler_print_times();
|
||||
#if PUPPYPRINT_DEBUG
|
||||
profiler_update(graphTime, first);
|
||||
graphTime[perfIteration] -= (collisionTime[perfIteration] - colTime);
|
||||
// graphTime[perfIteration] -= profilerTime[perfIteration]; //! Graph time is inaccurate and wrongly reaches 0 sometimes
|
||||
puppyprint_render_profiler();
|
||||
#endif
|
||||
}
|
||||
@@ -6,18 +6,15 @@ void bhv_celebration_star_init(void) {
|
||||
o->oHomeZ = gMarioObject->header.gfx.pos[2];
|
||||
o->oMoveAngleYaw = gMarioObject->header.gfx.angle[1] + 0x8000;
|
||||
o->oCelebStarDiameterOfRotation = 100;
|
||||
if (gCurrLevelNum == LEVEL_BOWSER_1 || gCurrLevelNum == LEVEL_BOWSER_2) {
|
||||
o->header.gfx.sharedChild = gLoadedGraphNodes[MODEL_BOWSER_KEY];
|
||||
o->oFaceAnglePitch = 0;
|
||||
o->oFaceAnglePitch = 0;
|
||||
if (obj_has_model(gMarioState->interactObj, MODEL_BOWSER_KEY)) {
|
||||
o->oFaceAngleRoll = 0xC000;
|
||||
cur_obj_scale(0.1f);
|
||||
o->oCelebStarIsBowserKey = 1;
|
||||
o->oCelebStarIsBowserKey = TRUE;
|
||||
} else {
|
||||
o->header.gfx.sharedChild = gLoadedGraphNodes[MODEL_STAR];
|
||||
o->oFaceAnglePitch = 0;
|
||||
o->oFaceAngleRoll = 0;
|
||||
cur_obj_scale(0.4f);
|
||||
o->oCelebStarIsBowserKey = 0;
|
||||
o->oCelebStarIsBowserKey = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +39,7 @@ void celeb_star_act_spin_around_mario(void) {
|
||||
|
||||
void celeb_star_act_face_camera(void) {
|
||||
if (o->oTimer < 10) {
|
||||
if (o->oCelebStarIsBowserKey == 0) {
|
||||
if (o->oCelebStarIsBowserKey == FALSE) {
|
||||
cur_obj_scale((f32) o->oTimer / 10.0f);
|
||||
} else {
|
||||
cur_obj_scale((f32) o->oTimer / 30.0f);
|
||||
|
||||
@@ -76,7 +76,7 @@ void bhv_mr_i_iris_loop(void) {
|
||||
obj_build_transform_from_pos_and_angle(o, O_PARENT_RELATIVE_POS_INDEX, O_MOVE_ANGLE_INDEX);
|
||||
obj_translate_local(o, O_POS_INDEX, O_PARENT_RELATIVE_POS_INDEX);
|
||||
o->oFaceAnglePitch = o->oMoveAnglePitch;
|
||||
o->oGraphYOffset = o->header.gfx.scale[1] * 100.0f;
|
||||
o->oGraphYOffset = o->parentObj->oGraphYOffset;
|
||||
}
|
||||
|
||||
if (!o->parentObj->oMrIBlinking) {
|
||||
@@ -128,7 +128,7 @@ void mr_i_body_act_spin_death(void) {
|
||||
cur_obj_become_intangible();
|
||||
spawn_mist_particles();
|
||||
o->oMrIScale = scaleModifier * 0.6f;
|
||||
if (o->oBehParams2ndByte != 0) {
|
||||
if (o->oBehParams2ndByte != MR_I_BP_NORMAL) {
|
||||
o->oPosY += 100.0f;
|
||||
spawn_default_star(1370, 2000.0f, -320.0f);
|
||||
obj_mark_for_deletion(o);
|
||||
|
||||
@@ -38,7 +38,9 @@ Gfx *geo_snufit_move_mask(s32 callContext, struct GraphNode *node, UNUSED Mat4 *
|
||||
if (callContext == GEO_CONTEXT_RENDER) {
|
||||
struct Object *obj = (struct Object *) gCurGraphNodeObject;
|
||||
struct GraphNodeTranslationRotation *transNode = (struct GraphNodeTranslationRotation *) node->next;
|
||||
vec3s_copy(transNode->translation, &obj->oSnufitOffsetVec);
|
||||
transNode->translation[0] = 0;
|
||||
transNode->translation[1] = -32;
|
||||
transNode->translation[2] = obj->oSnufitRecoil + 180;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -147,8 +149,6 @@ void bhv_snufit_loop(void) {
|
||||
o->oPosY = o->oHomeY + 8.0f * coss(4000 * gGlobalTimer);
|
||||
o->oPosZ = o->oHomeZ + 100.0f * sins(o->oSnufitCircularPeriod);
|
||||
|
||||
o->oSnufitYOffset = -0x20;
|
||||
o->oSnufitZOffset = o->oSnufitRecoil + 180;
|
||||
o->oSnufitBodyScale
|
||||
= (s16)(o->oSnufitBodyBaseScale + 666
|
||||
+ o->oSnufitBodyBaseScale * coss(o->oSnufitBodyScalePeriod));
|
||||
|
||||
@@ -8,9 +8,8 @@
|
||||
* Initialize the object's transform matrix with Y being up.
|
||||
*/
|
||||
void bhv_platform_normals_init(void) {
|
||||
Mat4 *transform = &o->transform;
|
||||
vec3f_set(&o->oTiltingPyramidNormalVec, 0.0f, 1.0f, 0.0f);
|
||||
mtxf_align_terrain_normal(*transform, &o->oTiltingPyramidNormalVec, &o->oPosVec, 0);
|
||||
mtxf_align_terrain_normal(o->transform, &o->oTiltingPyramidNormalVec, &o->oPosVec, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -20,24 +19,32 @@ void bhv_platform_normals_init(void) {
|
||||
void bhv_tilting_inverted_pyramid_loop(void) {
|
||||
#ifndef PLATFORM_DISPLACEMENT_2
|
||||
Vec3f posBeforeRotation, posAfterRotation;
|
||||
// Mario's position
|
||||
Vec3f m;
|
||||
Vec3f marioPos, dist;
|
||||
#endif
|
||||
Vec3f targetNormal;
|
||||
Mat4 *transform = &o->transform;
|
||||
s32 marioOnPlatform = (gMarioObject->platform == o);
|
||||
|
||||
if (gMarioObject->platform == o) {
|
||||
vec3_diff(targetNormal, &gMarioObject->oPosVec, &o->oPosVec);
|
||||
if (marioOnPlatform) {
|
||||
#ifndef PLATFORM_DISPLACEMENT_2
|
||||
vec3f_copy(m, gMarioStates[0].pos);
|
||||
linear_mtxf_mul_vec3f(*transform, posBeforeRotation, targetNormal);
|
||||
// Target the normal in Mario's direction
|
||||
vec3_diff(dist, gMarioStates[0].pos, &o->oPosVec);
|
||||
|
||||
// Get Mario's position before the rotation
|
||||
vec3f_copy(marioPos, gMarioStates[0].pos);
|
||||
|
||||
linear_mtxf_mul_vec3f(*transform, posBeforeRotation, dist);
|
||||
targetNormal[0] = dist[0];
|
||||
targetNormal[2] = dist[2];
|
||||
#else // PLATFORM_DISPLACEMENT_2
|
||||
targetNormal[0] = gMarioStates[0].pos[0] - o->oPosX;
|
||||
targetNormal[2] = gMarioStates[0].pos[2] - o->oPosZ;
|
||||
#endif
|
||||
targetNormal[1] = 500.0f;
|
||||
vec3f_normalize(targetNormal);
|
||||
o->oTiltingPyramidMarioOnPlatform = TRUE;
|
||||
} else {
|
||||
// Target normal is directly upwards when Mario is not on the platform.
|
||||
vec3f_set(targetNormal, 0.0f, 1.0f, 0.0f);
|
||||
o->oTiltingPyramidMarioOnPlatform = FALSE;
|
||||
}
|
||||
|
||||
// Approach the normals by 0.01f towards the new goal, then create a transform matrix and orient the object.
|
||||
@@ -45,16 +52,16 @@ void bhv_tilting_inverted_pyramid_loop(void) {
|
||||
approach_f32_symmetric_bool(&o->oTiltingPyramidNormalX, targetNormal[0], 0.01f);
|
||||
approach_f32_symmetric_bool(&o->oTiltingPyramidNormalY, targetNormal[1], 0.01f);
|
||||
approach_f32_symmetric_bool(&o->oTiltingPyramidNormalZ, targetNormal[2], 0.01f);
|
||||
mtxf_align_terrain_normal(*transform, &o->oTiltingPyramidNormalVec, &o->oPosVec, 0);
|
||||
mtxf_align_terrain_normal(*transform, &o->oTiltingPyramidNormalVec, &o->oPosVec, 0x0);
|
||||
|
||||
#ifndef PLATFORM_DISPLACEMENT_2
|
||||
// If Mario is on the platform, adjust his position for the platform tilt.
|
||||
if (o->oTiltingPyramidMarioOnPlatform) {
|
||||
linear_mtxf_mul_vec3f(*transform, posAfterRotation, targetNormal);
|
||||
m[0] += posAfterRotation[0] - posBeforeRotation[0];
|
||||
m[1] += posAfterRotation[1] - posBeforeRotation[1];
|
||||
m[2] += posAfterRotation[2] - posBeforeRotation[2];
|
||||
vec3f_copy(gMarioStates[0].pos, m);
|
||||
if (marioOnPlatform) {
|
||||
linear_mtxf_mul_vec3f(*transform, posAfterRotation, dist);
|
||||
marioPos[0] += posAfterRotation[0] - posBeforeRotation[0];
|
||||
marioPos[1] += posAfterRotation[1] - posBeforeRotation[1];
|
||||
marioPos[2] += posAfterRotation[2] - posBeforeRotation[2];
|
||||
vec3f_copy(gMarioStates[0].pos, marioPos);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
// water_ring.inc.c
|
||||
|
||||
#ifndef FIX_WATER_RINGS
|
||||
f32 water_ring_calc_mario_dist(void) {
|
||||
f32 marioDistX = o->oPosX - gMarioObject->header.gfx.pos[0];
|
||||
f32 marioDistY = o->oPosY - (gMarioObject->header.gfx.pos[1] + 80.0f);
|
||||
f32 marioDistZ = o->oPosZ - gMarioObject->header.gfx.pos[2];
|
||||
f32 marioDistInFront = marioDistX * o->oWaterRingNormalX + marioDistY * o->oWaterRingNormalY
|
||||
+ marioDistZ * o->oWaterRingNormalZ;
|
||||
|
||||
return marioDistInFront;
|
||||
Vec3f marioDist;
|
||||
vec3_diff(marioDist, &o->oPosVec, gMarioObject->header.gfx.pos);
|
||||
marioDist[1] += 80.0f;
|
||||
return vec3_dot(marioDist, &o->oWaterRingNormalVec);
|
||||
}
|
||||
#endif
|
||||
|
||||
void water_ring_init(void) {
|
||||
cur_obj_init_animation(WATER_RING_ANIM_WOBBLE);
|
||||
@@ -16,6 +15,7 @@ void water_ring_init(void) {
|
||||
o->oWaterRingScalePhaseY = (s32)(random_float() * 4096.0f) + 0x1000;
|
||||
o->oWaterRingScalePhaseZ = (s32)(random_float() * 4096.0f) + 0x1000;
|
||||
|
||||
#ifndef FIX_WATER_RINGS
|
||||
//! This normal calculation assumes a facing yaw of 0, which is not the case
|
||||
// for the manta ray rings. It also errs by multiplying the normal X by -1.
|
||||
// This cause the ring's orientation for the purposes of collision to be
|
||||
@@ -32,6 +32,7 @@ void water_ring_init(void) {
|
||||
//
|
||||
// o->oFaceAngleYaw = 0;
|
||||
// o->oFaceAngleRoll *= -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
void bhv_jet_stream_water_ring_init(void) {
|
||||
@@ -42,16 +43,21 @@ void bhv_jet_stream_water_ring_init(void) {
|
||||
}
|
||||
|
||||
void water_ring_check_collection(UNUSED f32 avgScale, struct Object *ringManager) {
|
||||
#ifdef FIX_WATER_RINGS
|
||||
if (o->oInteractStatus & INT_STATUS_INTERACTED) {
|
||||
#else
|
||||
f32 marioDistInFront = water_ring_calc_mario_dist();
|
||||
|
||||
if (!is_point_close_to_object(o, gMarioObject->header.gfx.pos[0],
|
||||
gMarioObject->header.gfx.pos[1] + 80.0f,
|
||||
gMarioObject->header.gfx.pos[2], (avgScale + 0.2f) * 120.0f)) {
|
||||
gMarioObject->header.gfx.pos[1] + 80.0f,
|
||||
gMarioObject->header.gfx.pos[2],
|
||||
(avgScale + 0.2f) * 120.0f)) {
|
||||
o->oWaterRingMarioDistInFront = marioDistInFront;
|
||||
return;
|
||||
}
|
||||
|
||||
if (o->oWaterRingMarioDistInFront * marioDistInFront < 0.0f) {
|
||||
#endif
|
||||
struct Object *ringSpawner = o->parentObj;
|
||||
|
||||
if (ringSpawner) {
|
||||
@@ -73,7 +79,9 @@ void water_ring_check_collection(UNUSED f32 avgScale, struct Object *ringManager
|
||||
o->oAction = WATER_RING_ACT_COLLECTED;
|
||||
}
|
||||
|
||||
#ifndef FIX_WATER_RINGS
|
||||
o->oWaterRingMarioDistInFront = marioDistInFront;
|
||||
#endif
|
||||
}
|
||||
|
||||
void water_ring_set_scale(f32 avgScale) {
|
||||
@@ -154,8 +162,11 @@ void water_ring_spawner_act_inactive(void) {
|
||||
o->oTimer = 0;
|
||||
}
|
||||
|
||||
if ((o->oTimer == 0) || (o->oTimer == 50) || (o->oTimer == 150) || (o->oTimer == 200)
|
||||
|| (o->oTimer == 250)) {
|
||||
if ((o->oTimer == 0)
|
||||
|| (o->oTimer == 50)
|
||||
|| (o->oTimer == 150)
|
||||
|| (o->oTimer == 200)
|
||||
|| (o->oTimer == 250)) {
|
||||
struct Object *waterRing = spawn_object(o, MODEL_WATER_RING, bhvJetStreamWaterRing);
|
||||
waterRing->oWaterRingIndex = o->oWaterRingMgrNextRingIndex;
|
||||
o->oWaterRingMgrNextRingIndex++;
|
||||
@@ -199,7 +210,7 @@ void manta_water_ring_act_not_collected(void) {
|
||||
if (o->oTimer > 150) {
|
||||
o->oOpacity -= 2;
|
||||
if (o->oOpacity < 3) {
|
||||
o->activeFlags = ACTIVE_FLAG_DEACTIVATED;
|
||||
obj_mark_for_deletion(o);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2871,10 +2871,6 @@ void update_lakitu(struct Camera *c) {
|
||||
* Gets controller input, checks for cutscenes, handles mode changes, and moves the camera
|
||||
*/
|
||||
void update_camera(struct Camera *c) {
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
OSTime colTime = collisionTime[perfIteration];
|
||||
#endif
|
||||
gCamera = c;
|
||||
update_camera_hud_status(c);
|
||||
if (c->cutscene == CUTSCENE_NONE
|
||||
@@ -3117,10 +3113,6 @@ void update_camera(struct Camera *c) {
|
||||
}
|
||||
#endif
|
||||
gLakituState.lastFrameAction = sMarioCamState->action;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
profiler_update(cameraTime, first);
|
||||
cameraTime[perfIteration] -= collisionTime[perfIteration]-colTime;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -402,9 +402,6 @@ void thread2_crash_screen(UNUSED void *arg) {
|
||||
osSetEventMesg(OS_EVENT_CPU_BREAK, &gCrashScreen.mesgQueue, (OSMesg) 1);
|
||||
osSetEventMesg(OS_EVENT_FAULT, &gCrashScreen.mesgQueue, (OSMesg) 2);
|
||||
while (TRUE) {
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
if (thread == NULL) {
|
||||
osRecvMesg(&gCrashScreen.mesgQueue, &mesg, 1);
|
||||
thread = get_crashed_thread();
|
||||
@@ -433,9 +430,6 @@ void thread2_crash_screen(UNUSED void *arg) {
|
||||
read_controller_inputs(THREAD_2_CRASH_SCREEN);
|
||||
draw_crash_screen(thread);
|
||||
}
|
||||
#if PUPPYPRINT_DEBUG
|
||||
profiler_update(faultTime, first);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
// This file is a modification of a file from https://github.com/danbolt/n64-jam-1, which was licensed under the MPL-2.0 License
|
||||
// See the original repo for more details.
|
||||
|
||||
#include <ultra64.h>
|
||||
|
||||
#define TEX_ASCII_START '!'
|
||||
#define TAB_WIDTH 16
|
||||
|
||||
#define G_CC_TEXT PRIMITIVE, 0, TEXEL0, 0, 0, 0, 0, TEXEL0
|
||||
|
||||
__asm__(
|
||||
".section \".rodata\", \"a\", @progbits\n"
|
||||
".global fast_font\n"
|
||||
"fast_font:\n"
|
||||
".incbin \"src/game/newfont2_swapped.bin\"\n"
|
||||
".previous\n"
|
||||
);
|
||||
|
||||
extern u8 fast_font[];
|
||||
|
||||
int computeS(unsigned char letter) {
|
||||
int idx = letter;
|
||||
if (letter > 'z') {
|
||||
idx -= (3 + 2 + 3 + 1 + 3);
|
||||
} else if (letter > '^') {
|
||||
idx -= (2 + 3 + 1 + 3);
|
||||
} else if (letter > 'Z') {
|
||||
idx -= (3 + 1 + 3);
|
||||
} else if (letter > '?') {
|
||||
idx -= (1 + 3);
|
||||
} else if (letter > ';') {
|
||||
idx -= (3);
|
||||
}
|
||||
|
||||
return (idx - TEX_ASCII_START) * 8;
|
||||
}
|
||||
|
||||
static const u8 fast_text_font_kerning[] = {
|
||||
/* */ 2, /*!*/ 4, /*"*/ 5, /*#*/ 0, /*$*/ 0, /*%*/ 7, /*&*/ 7, /*'*/ 2, /*(*/ 5, /*)*/ 5, /***/ 0, /*+*/ 7, /*,*/ 3, /*-*/ 7, /*.*/ 3, /*/*/ 7,
|
||||
/*0*/ 7, /*1*/ 7, /*2*/ 7, /*3*/ 7, /*4*/ 7, /*5*/ 7, /*6*/ 7, /*7*/ 7, /*8*/ 7, /*9*/ 7, /*:*/ 3, /*;*/ 3, /*<*/ 0, /*=*/ 0, /*>*/ 0, /*?*/ 7,
|
||||
/*@*/ 0, /*A*/ 7, /*B*/ 7, /*C*/ 7, /*D*/ 7, /*E*/ 7, /*F*/ 7, /*G*/ 7, /*H*/ 7, /*I*/ 6, /*J*/ 5, /*K*/ 7, /*L*/ 7, /*M*/ 7, /*N*/ 7, /*O*/ 7,
|
||||
/*P*/ 7, /*Q*/ 7, /*R*/ 7, /*S*/ 7, /*T*/ 7, /*U*/ 7, /*V*/ 7, /*W*/ 7, /*X*/ 7, /*Y*/ 7, /*Z*/ 7, /*[*/ 0, /*\*/ 0, /*]*/ 0, /*^*/ 6, /*_*/ 0,
|
||||
/*`*/ 0, /*a*/ 6, /*b*/ 6, /*c*/ 6, /*d*/ 6, /*e*/ 6, /*f*/ 6, /*g*/ 6, /*h*/ 6, /*i*/ 2, /*j*/ 6, /*k*/ 5, /*l*/ 3, /*m*/ 6, /*n*/ 6, /*o*/ 6,
|
||||
/*p*/ 6, /*q*/ 6, /*r*/ 6, /*s*/ 6, /*t*/ 6, /*u*/ 6, /*v*/ 6, /*w*/ 6, /*x*/ 6, /*y*/ 6, /*z*/ 6, /*{*/ 0, /*|*/ 0, /*}*/ 0, /*~*/ 7,
|
||||
};
|
||||
|
||||
void drawSmallString_impl(Gfx **dl, int x, int y, const char* string, int r, int g, int b) {
|
||||
int i = 0;
|
||||
int xPos = x;
|
||||
int yPos = y;
|
||||
int s = 0;
|
||||
Gfx *dlHead = *dl;
|
||||
|
||||
gDPLoadTextureBlock_4bS(dlHead++, fast_font, G_IM_FMT_IA, 672, 12, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
gDPSetPrimColor(dlHead++, 0, 0, r, g, b, 255);
|
||||
gDPSetCombineMode(dlHead++, G_CC_TEXT, G_CC_TEXT);
|
||||
gDPPipeSync(dlHead++);
|
||||
|
||||
while (string[i] != '\0') {
|
||||
unsigned int cur_char = string[i];
|
||||
|
||||
if (cur_char == '\n') {
|
||||
xPos = x;
|
||||
yPos += 12;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (cur_char == '\t') {
|
||||
int xDist = xPos - x + 1;
|
||||
int tabCount = (xDist + TAB_WIDTH - 1) / TAB_WIDTH;
|
||||
xPos = tabCount * TAB_WIDTH + x;
|
||||
} else {
|
||||
if (cur_char != ' ') {
|
||||
s = computeS(cur_char);
|
||||
gSPTextureRectangle(dlHead++, (xPos + 0) << 2, (yPos + 0) << 2, (xPos + 8) << 2, (yPos + 12) << 2, 0, s << 5, 0, 1 << 10, 1 << 10);
|
||||
}
|
||||
xPos += fast_text_font_kerning[cur_char - ' '];
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
gDPSetPrimColor(dlHead++, 0, 0, 255, 255, 255, 255);
|
||||
gDPPipeSync(dlHead++);
|
||||
|
||||
*dl = dlHead;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef __FASTTEXT_H__
|
||||
#define __FASTTEXT_H__
|
||||
|
||||
void drawSmallString_impl(Gfx**, int, int, const char*, int, int , int);
|
||||
|
||||
static inline void drawSmallString(Gfx **dl, int x, int y, const char* string) {
|
||||
drawSmallString_impl(dl, x, y, string, 255, 255, 255);
|
||||
}
|
||||
|
||||
static inline void drawSmallStringCol(Gfx **dl, int x, int y, const char* string, int r, int g, int b) {
|
||||
drawSmallString_impl(dl, x, y, string, r, g, b);
|
||||
}
|
||||
|
||||
#endif
|
||||
+25
-29
@@ -1,4 +1,5 @@
|
||||
#include <ultra64.h>
|
||||
#include <PR/os_internal_reg.h>
|
||||
|
||||
#include "sm64.h"
|
||||
#include "gfx_dimensions.h"
|
||||
@@ -29,6 +30,7 @@
|
||||
#include "puppycam2.h"
|
||||
#include "debug_box.h"
|
||||
#include "vc_check.h"
|
||||
#include "profiling.h"
|
||||
|
||||
// First 3 controller slots
|
||||
struct Controller gControllers[3];
|
||||
@@ -44,6 +46,7 @@ OSContStatus gControllerStatuses[4];
|
||||
OSContPad gControllerPads[4];
|
||||
u8 gControllerBits;
|
||||
u8 gIsConsole = TRUE; // Needs to be initialized before audio_reset_session is called
|
||||
u8 gCacheEmulated = TRUE;
|
||||
u8 gBorderHeight;
|
||||
#ifdef VANILLA_STYLE_CUSTOM_DEBUG
|
||||
u8 gCustomDebugMode;
|
||||
@@ -389,6 +392,21 @@ void draw_reset_bars(void) {
|
||||
osRecvMesg(&gGameVblankQueue, &gMainReceivedMesg, OS_MESG_BLOCK);
|
||||
}
|
||||
|
||||
void check_cache_emulation() {
|
||||
// Disable interrupts to ensure that nothing evicts the variable from cache while we're using it.
|
||||
u32 saved = __osDisableInt();
|
||||
// Create a variable with an initial value of 1. This value will remain cached.
|
||||
volatile u8 sCachedValue = 1;
|
||||
// Overwrite the variable directly in RDRAM without going through cache.
|
||||
// This should preserve its value of 1 in dcache if dcache is emulated correctly.
|
||||
*(u8*)(K0_TO_K1(&sCachedValue)) = 0;
|
||||
// Read the variable back from dcache, if it's still 1 then cache is emulated correctly.
|
||||
// If it's zero, then dcache is not emulated correctly.
|
||||
gCacheEmulated = sCachedValue;
|
||||
// Restore interrupts
|
||||
__osRestoreInt(saved);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial settings for the first rendered frame.
|
||||
*/
|
||||
@@ -400,6 +418,7 @@ void render_init(void) {
|
||||
gIsConsole = FALSE;
|
||||
gBorderHeight = BORDER_HEIGHT_EMULATOR;
|
||||
gIsVC = IS_VC();
|
||||
check_cache_emulation();
|
||||
} else {
|
||||
gIsConsole = TRUE;
|
||||
gBorderHeight = BORDER_HEIGHT_CONSOLE;
|
||||
@@ -417,7 +436,8 @@ void render_init(void) {
|
||||
|
||||
// Skip incrementing the initial framebuffer index on emulators so that they display immediately as the Gfx task finishes
|
||||
// VC probably emulates osViSwapBuffer accurately so instant patch breaks VC compatibility
|
||||
if (gIsConsole || gIsVC) { // Read RDP Clock Register, has a value of zero on emulators
|
||||
// Currently, Ares passes the cache emulation test and has issues with single buffering so disable it there as well.
|
||||
if (gIsConsole || gIsVC || gCacheEmulated) {
|
||||
sRenderingFramebuffer++;
|
||||
}
|
||||
gGlobalTimer++;
|
||||
@@ -455,8 +475,8 @@ void display_and_vsync(void) {
|
||||
#ifndef UNLOCK_FPS
|
||||
osRecvMesg(&gGameVblankQueue, &gMainReceivedMesg, OS_MESG_BLOCK);
|
||||
#endif
|
||||
// Skip swapping buffers on emulator so that they display immediately as the Gfx task finishes
|
||||
if (gIsConsole || gIsVC) { // Read RDP Clock Register, has a value of zero on emulators
|
||||
// Skip swapping buffers on inaccurate emulators other than VC so that they display immediately as the Gfx task finishes
|
||||
if (gIsConsole || gIsVC || gCacheEmulated) {
|
||||
if (++sRenderedFramebuffer == 3) {
|
||||
sRenderedFramebuffer = 0;
|
||||
}
|
||||
@@ -729,10 +749,6 @@ void setup_game_memory(void) {
|
||||
* Main game loop thread. Runs forever as long as the game continues.
|
||||
*/
|
||||
void thread5_game_loop(UNUSED void *arg) {
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime lastTime = 0;
|
||||
#endif
|
||||
|
||||
setup_game_memory();
|
||||
#if ENABLE_RUMBLE
|
||||
init_rumble_pak_scheduler_queue();
|
||||
@@ -762,19 +778,12 @@ void thread5_game_loop(UNUSED void *arg) {
|
||||
render_init();
|
||||
|
||||
while (TRUE) {
|
||||
profiler_frame_setup();
|
||||
// If the reset timer is active, run the process to reset the game.
|
||||
if (gResetTimer != 0) {
|
||||
draw_reset_bars();
|
||||
continue;
|
||||
}
|
||||
#if PUPPYPRINT_DEBUG
|
||||
while (TRUE) {
|
||||
lastTime = osGetTime();
|
||||
collisionTime[perfIteration] = 0;
|
||||
// graphTime[perfIteration] = 0;
|
||||
behaviourTime[perfIteration] = 0;
|
||||
dmaTime[perfIteration] = 0;
|
||||
#endif
|
||||
|
||||
// If any controllers are plugged in, start read the data for when
|
||||
// read_controller_inputs is called later.
|
||||
@@ -788,25 +797,12 @@ void thread5_game_loop(UNUSED void *arg) {
|
||||
audio_game_loop_tick();
|
||||
select_gfx_pool();
|
||||
read_controller_inputs(THREAD_5_GAME_LOOP);
|
||||
profiler_update(PROFILER_TIME_CONTROLLERS);
|
||||
addr = level_script_execute(addr);
|
||||
#if !PUPPYPRINT_DEBUG && defined(VISUAL_DEBUG)
|
||||
debug_box_input();
|
||||
#endif
|
||||
#if PUPPYPRINT_DEBUG
|
||||
profiler_update(scriptTime, lastTime);
|
||||
scriptTime[perfIteration] -= profilerTime[perfIteration];
|
||||
scriptTime[perfIteration] -= profilerTime2[perfIteration];
|
||||
if (benchmarkLoop > 0 && benchOption == 0) {
|
||||
benchmarkLoop--;
|
||||
benchMark[benchmarkLoop] = (osGetTime() - lastTime);
|
||||
if (benchmarkLoop == 0) {
|
||||
puppyprint_profiler_finished();
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
puppyprint_profiler_process();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ extern u8 *gGfxPoolEnd;
|
||||
extern struct GfxPool *gGfxPool;
|
||||
extern u8 gControllerBits;
|
||||
extern u8 gIsConsole;
|
||||
extern u8 gCacheEmulated;
|
||||
extern u8 gBorderHeight;
|
||||
#ifdef VANILLA_STYLE_CUSTOM_DEBUG
|
||||
extern u8 gCustomDebugMode;
|
||||
|
||||
+12
-13
@@ -26,11 +26,6 @@
|
||||
* cannon reticle, and the unused keys.
|
||||
**/
|
||||
|
||||
#define HUD_POWER_METER_X 140
|
||||
#define HUD_POWER_METER_EMPHASIZED_Y 166
|
||||
#define HUD_POWER_METER_Y 200
|
||||
#define HUD_POWER_METER_HIDDEN_Y 300
|
||||
|
||||
#ifdef BREATH_METER
|
||||
// #ifdef DISABLE_LIVES
|
||||
// #define HUD_BREATH_METER_X 64
|
||||
@@ -52,6 +47,9 @@ u8 curFrameTimeIndex = 0;
|
||||
|
||||
#include "PR/os_convert.h"
|
||||
|
||||
#ifdef USE_PROFILER
|
||||
float profiler_get_fps();
|
||||
#else
|
||||
// Call once per frame
|
||||
f32 calculate_and_update_fps() {
|
||||
OSTime newTime = osGetTime();
|
||||
@@ -64,9 +62,14 @@ f32 calculate_and_update_fps() {
|
||||
}
|
||||
return ((f32)FRAMETIME_COUNT * 1000000.0f) / (s32)OS_CYCLES_TO_USEC(newTime - oldTime);
|
||||
}
|
||||
#endif
|
||||
|
||||
void print_fps(s32 x, s32 y) {
|
||||
#ifdef USE_PROFILER
|
||||
f32 fps = profiler_get_fps();
|
||||
#else
|
||||
f32 fps = calculate_and_update_fps();
|
||||
#endif
|
||||
char text[14];
|
||||
|
||||
sprintf(text, "FPS %2.2f", fps);
|
||||
@@ -75,7 +78,6 @@ void print_fps(s32 x, s32 y) {
|
||||
#else
|
||||
print_text(x, y, text);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
// ------------ END OF FPS COUNER -----------------
|
||||
@@ -388,7 +390,6 @@ void render_hud_breath_meter(void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#define HUD_TOP_Y 209
|
||||
|
||||
/**
|
||||
* Renders the amount of lives Mario has.
|
||||
@@ -415,13 +416,11 @@ void render_debug_mode(void) {
|
||||
* Renders the amount of coins collected.
|
||||
*/
|
||||
void render_hud_coins(void) {
|
||||
print_text(168, HUD_TOP_Y, "$"); // 'Coin' glyph
|
||||
print_text(184, HUD_TOP_Y, "*"); // 'X' glyph
|
||||
print_text_fmt_int(198, HUD_TOP_Y, "%d", gHudDisplay.coins);
|
||||
print_text(HUD_COINS_X, HUD_TOP_Y, "$"); // 'Coin' glyph
|
||||
print_text((HUD_COINS_X + 16), HUD_TOP_Y, "*"); // 'X' glyph
|
||||
print_text_fmt_int((HUD_COINS_X + 30), HUD_TOP_Y, "%d", gHudDisplay.coins);
|
||||
}
|
||||
|
||||
#define HUD_STARS_X 78
|
||||
|
||||
/**
|
||||
* Renders the amount of stars collected.
|
||||
* Disables "X" glyph when Mario has 100 stars or more.
|
||||
@@ -491,7 +490,7 @@ void set_hud_camera_status(s16 status) {
|
||||
*/
|
||||
void render_hud_camera_status(void) {
|
||||
Texture *(*cameraLUT)[6] = segmented_to_virtual(&main_hud_camera_lut);
|
||||
s32 x = GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(54);
|
||||
s32 x = GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(HUD_CAMERA_X);
|
||||
s32 y = 205;
|
||||
|
||||
if (sCameraHUD.status == CAM_STATUS_NONE) {
|
||||
|
||||
@@ -4,6 +4,18 @@
|
||||
#include <PR/ultratypes.h>
|
||||
#include <PR/gbi.h>
|
||||
|
||||
#define HUD_POWER_METER_X 140
|
||||
#define HUD_POWER_METER_EMPHASIZED_Y 166
|
||||
#define HUD_POWER_METER_Y 200
|
||||
#define HUD_POWER_METER_HIDDEN_Y 300
|
||||
|
||||
#define HUD_TOP_Y 209
|
||||
#define HUD_BOTTOM_Y 19 // Same height as the Lakitu icon
|
||||
|
||||
#define HUD_COINS_X 168
|
||||
#define HUD_STARS_X 78 // This starts counting from the right edge
|
||||
#define HUD_CAMERA_X 54 // This starts counting from the right edge
|
||||
|
||||
enum PowerMeterAnimation {
|
||||
POWER_METER_HIDDEN,
|
||||
POWER_METER_EMPHASIZED,
|
||||
|
||||
@@ -87,7 +87,6 @@ enum DialogBoxType {
|
||||
#define DEFAULT_DIALOG_BOX_ANGLE 90.0f
|
||||
#define DEFAULT_DIALOG_BOX_SCALE 19.0f
|
||||
|
||||
#if defined(VERSION_US) || defined(VERSION_EU)
|
||||
u8 gDialogCharWidths[256] = { // TODO: Is there a way to auto generate this?
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6,
|
||||
6, 6, 5, 6, 6, 5, 8, 8, 6, 6, 6, 6, 6, 5, 6, 6,
|
||||
@@ -118,7 +117,6 @@ u8 gDialogCharWidths[256] = { // TODO: Is there a way to auto generate this?
|
||||
#endif
|
||||
0, 0, 5, 7, 7, 6, 6, 8, 0, 8, 10, 6, 4, 10, 0, 0
|
||||
};
|
||||
#endif
|
||||
|
||||
s8 gDialogBoxState = DIALOG_STATE_OPENING;
|
||||
f32 gDialogBoxOpenTimer = DEFAULT_DIALOG_BOX_ANGLE;
|
||||
@@ -1369,6 +1367,7 @@ void print_peach_letter_message(void) {
|
||||
void **dialogTable;
|
||||
gInGameLanguage = eu_get_language();
|
||||
switch (gInGameLanguage) {
|
||||
default:
|
||||
case LANGUAGE_ENGLISH: dialogTable = segmented_to_virtual(dialog_table_eu_en); break;
|
||||
case LANGUAGE_FRENCH: dialogTable = segmented_to_virtual(dialog_table_eu_fr); break;
|
||||
case LANGUAGE_GERMAN: dialogTable = segmented_to_virtual(dialog_table_eu_de); break;
|
||||
@@ -1388,10 +1387,15 @@ void print_peach_letter_message(void) {
|
||||
gDPSetEnvColor(gDisplayListHead++, 20, 20, 20, gCutsceneMsgFade);
|
||||
|
||||
print_generic_string(STR_X, STR_Y, str);
|
||||
#ifdef VERSION_JP
|
||||
gSPDisplayList(gDisplayListHead++, dl_ia_text_end);
|
||||
gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255);
|
||||
#else
|
||||
gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255);
|
||||
gSPDisplayList(gDisplayListHead++, dl_ia_text_end);
|
||||
gDPSetEnvColor(gDisplayListHead++, 200, 80, 120, gCutsceneMsgFade);
|
||||
gSPDisplayList(gDisplayListHead++, castle_grounds_seg7_us_dl_0700F2E8);
|
||||
#endif
|
||||
|
||||
// at the start/end of message, reset the fade.
|
||||
if (gCutsceneMsgTimer == 0) {
|
||||
@@ -1448,7 +1452,7 @@ void render_hud_cannon_reticle(void) {
|
||||
gSPDisplayList(gDisplayListHead++, dl_draw_triangle);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
// gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
}
|
||||
|
||||
void reset_red_coins_collected(void) {
|
||||
|
||||
@@ -112,11 +112,9 @@ enum DialogSpecialChars {
|
||||
DIALOG_CHAR_I_NO_DIA = 0xEB, // 'i' without diacritic
|
||||
DIALOG_CHAR_DOUBLE_LOW_QUOTE = 0xF0, // German opening quotation mark
|
||||
#endif
|
||||
#if defined(VERSION_US) || defined(VERSION_EU)
|
||||
DIALOG_CHAR_SLASH = 0xD0,
|
||||
DIALOG_CHAR_MULTI_THE = 0xD1, // 'the'
|
||||
DIALOG_CHAR_MULTI_YOU = 0xD2, // 'you'
|
||||
#endif
|
||||
DIALOG_CHAR_PERIOD = 0x6E,
|
||||
DIALOG_CHAR_COMMA = 0x6F,
|
||||
DIALOG_CHAR_COLOR = 0xDF,
|
||||
|
||||
@@ -764,10 +764,14 @@ u32 interact_star_or_key(struct MarioState *m, UNUSED u32 interactType, struct O
|
||||
u32 starIndex;
|
||||
u32 starGrabAction = ACT_STAR_DANCE_EXIT;
|
||||
#ifdef NON_STOP_STARS
|
||||
#ifdef KEYS_EXIT_LEVEL
|
||||
u32 noExit = !obj_has_model(obj, MODEL_BOWSER_KEY);
|
||||
#else
|
||||
u32 noExit = TRUE;
|
||||
#else
|
||||
#endif
|
||||
#else // !NON_STOP_STARS
|
||||
u32 noExit = (obj->oInteractionSubtype & INT_SUBTYPE_NO_EXIT) != 0;
|
||||
#endif
|
||||
#endif // !NON_STOP_STARS
|
||||
u32 grandStar = (obj->oInteractionSubtype & INT_SUBTYPE_GRAND_STAR) != 0;
|
||||
|
||||
if (m->health >= 0x100) {
|
||||
|
||||
@@ -65,6 +65,17 @@ const char *credits06[] = { "2COURSE DIRECTORS", "YOICHI YAMADA", "YASUHISA YAMA
|
||||
const char *credits07[] = { "2COURSE DESIGNERS", "KENTA USUI", "NAOKI MORI" };
|
||||
const char *credits08[] = { "3COURSE DESIGNERS", "YOSHIKI HARUHANA", "MAKOTO MIYANAGA", "KATSUHIKO KANNO" };
|
||||
|
||||
#ifdef VERSION_US
|
||||
const char *credits09[] = { "1SOUND COMPOSER", "KOJI KONDO" };
|
||||
// ...as well as sound effects and sound programmer in order to make room for screen text writer, Mario voice, and Peach voice
|
||||
const char *credits10[] = { "4SOUND EFFECTS", "SOUND PROGRAMMER", "YOJI INAGAKI", "HIDEAKI SHIMIZU" };
|
||||
const char *credits11[] = { "23-D ANIMATORS", "YOSHIAKI KOIZUMI", "SATORU TAKIZAWA" };
|
||||
const char *credits12[] = { "1ADDITIONAL GRAPHICS", "MASANAO ARIMOTO" };
|
||||
const char *credits13[] = { "3TECHNICAL SUPPORT", "TAKAO SAWANO", "HIROHITO YOSHIMOTO", "HIROTO YADA" };
|
||||
const char *credits14[] = { "1TECHNICAL SUPPORT", "SGI N64 PROJECT STAFF" };
|
||||
const char *credits15[] = { "2PROGRESS MANAGEMENT", "KIMIYOSHI FUKUI", "KEIZO KATO" };
|
||||
const char *credits16[] = { "5SCREEN TEXT WRITER", "TRANSLATION", "LESLIE SWAN", "MINA AKINO", "HIRO YAMADA" };
|
||||
#else // VERSION_EU
|
||||
// ...as well as sound composer, sound effects, and sound programmer, and...
|
||||
const char *credits09[] = { "7SOUND COMPOSER", "SOUND EFFECTS", "SOUND PROGRAMMER", "KOJI KONDO", "YOJI INAGAKI", "HIDEAKI SHIMIZU" };
|
||||
// ...3D animators and additional graphics in order to make room for screen text writer(s), Mario voice, and Peach voice
|
||||
@@ -75,6 +86,7 @@ const char *credits13[] = { "2PROGRESS MANAGEMENT", "KIMIYOSHI FUKUI", "KEIZO KA
|
||||
const char *credits14[] = { "5SCREEN TEXT WRITER", "ENGLISH TRANSLATION", "LESLIE SWAN", "MINA AKINO", "HIRO YAMADA" };
|
||||
const char *credits15[] = { "4SCREEN TEXT WRITER", "FRENCH TRANSLATION", "JULIEN BARDAKOFF", "KENJI HARAGUCHI" };
|
||||
const char *credits16[] = { "4SCREEN TEXT WRITER", "GERMAN TRANSLATION", "THOMAS GOERG", "THOMAS SPINDLER" };
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ void play_far_fall_sound(struct MarioState *m) {
|
||||
u32 action = m->action;
|
||||
if (!(action & ACT_FLAG_INVULNERABLE) && action != ACT_TWIRLING && action != ACT_FLYING
|
||||
&& !(m->flags & MARIO_FALL_SOUND_PLAYED)) {
|
||||
if (m->peakHeight - m->pos[1] > 1150.0f) {
|
||||
if (m->peakHeight - m->pos[1] > FALL_DAMAGE_HEIGHT_SMALL) {
|
||||
play_sound(SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject);
|
||||
m->flags |= MARIO_FALL_SOUND_PLAYED;
|
||||
}
|
||||
@@ -63,30 +63,14 @@ s32 check_fall_damage(struct MarioState *m, u32 hardFallAction) {
|
||||
#ifdef NO_FALL_DAMAGE
|
||||
return FALSE;
|
||||
#endif
|
||||
f32 fallHeight;
|
||||
f32 damageHeight;
|
||||
|
||||
fallHeight = m->peakHeight - m->pos[1];
|
||||
f32 fallHeight = m->peakHeight - m->pos[1];
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#if defined(__clang__)
|
||||
#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wtype-limits"
|
||||
#endif
|
||||
|
||||
//! Never true
|
||||
if (m->actionState == ACT_GROUND_POUND) {
|
||||
damageHeight = 600.0f;
|
||||
} else {
|
||||
damageHeight = 1150.0f;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
f32 damageHeight = FALL_DAMAGE_HEIGHT_SMALL;
|
||||
|
||||
if (m->action != ACT_TWIRLING && m->floor->type != SURFACE_BURNING) {
|
||||
if (m->vel[1] < -55.0f) {
|
||||
if (fallHeight > 3000.0f) {
|
||||
if (fallHeight > FALL_DAMAGE_HEIGHT_LARGE) {
|
||||
m->hurtCounter += (m->flags & MARIO_CAP_ON_HEAD) ? 16 : 24;
|
||||
#if ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
@@ -116,11 +100,12 @@ s32 check_kick_or_dive_in_air(struct MarioState *m) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 should_get_stuck_in_ground(struct MarioState *m) {
|
||||
#ifdef NO_GETTING_BURIED
|
||||
s32 should_get_stuck_in_ground(UNUSED struct MarioState *m) {
|
||||
return FALSE;
|
||||
}
|
||||
#else
|
||||
|
||||
s32 should_get_stuck_in_ground(struct MarioState *m) {
|
||||
u32 terrainType = m->area->terrainType & TERRAIN_MASK;
|
||||
struct Surface *floor = m->floor;
|
||||
s32 flags = floor->flags;
|
||||
@@ -134,8 +119,8 @@ s32 should_get_stuck_in_ground(struct MarioState *m) {
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
s32 check_fall_damage_or_get_stuck(struct MarioState *m, u32 hardFallAction) {
|
||||
if (should_get_stuck_in_ground(m)) {
|
||||
|
||||
@@ -582,15 +582,27 @@ s32 act_debug_free_move(struct MarioState *m) {
|
||||
}
|
||||
|
||||
void general_star_dance_handler(struct MarioState *m, s32 isInWater) {
|
||||
struct Object *celebStar = NULL;
|
||||
|
||||
if (m->actionState == ACT_STATE_STAR_DANCE_CUTSCENE) {
|
||||
switch (++m->actionTimer) {
|
||||
case 1:
|
||||
spawn_object(m->marioObj, MODEL_STAR, bhvCelebrationStar);
|
||||
celebStar = spawn_object(m->marioObj, MODEL_STAR, bhvCelebrationStar);
|
||||
#ifdef STAR_DANCE_USES_STARS_MODEL
|
||||
celebStar->header.gfx.sharedChild = m->interactObj->header.gfx.sharedChild;
|
||||
#else
|
||||
if (obj_has_model(m->interactObj, MODEL_BOWSER_KEY)) {
|
||||
obj_set_model(celebStar, MODEL_BOWSER_KEY);
|
||||
}
|
||||
#endif
|
||||
disable_background_sound();
|
||||
//! TODO: Is this check necessary? Both seem to do the exact same thing.
|
||||
if (m->actionArg & 1) {
|
||||
play_course_clear();
|
||||
// No exit
|
||||
play_course_clear(obj_has_model(celebStar, MODEL_BOWSER_KEY));
|
||||
} else {
|
||||
if (gCurrLevelNum == LEVEL_BOWSER_1 || gCurrLevelNum == LEVEL_BOWSER_2) {
|
||||
// Exit
|
||||
if (obj_has_model(celebStar, MODEL_BOWSER_KEY)) {
|
||||
play_music(SEQ_PLAYER_ENV, SEQUENCE_ARGS(15, SEQ_EVENT_CUTSCENE_COLLECT_KEY), 0);
|
||||
} else {
|
||||
play_music(SEQ_PLAYER_ENV, SEQUENCE_ARGS(15, SEQ_EVENT_CUTSCENE_COLLECT_STAR), 0);
|
||||
|
||||
Binary file not shown.
@@ -21,6 +21,7 @@
|
||||
#include "spawn_object.h"
|
||||
#include "puppyprint.h"
|
||||
#include "puppylights.h"
|
||||
#include "profiling.h"
|
||||
|
||||
|
||||
/**
|
||||
@@ -547,7 +548,10 @@ void clear_objects(void) {
|
||||
*/
|
||||
void update_terrain_objects(void) {
|
||||
gObjectCounter = update_objects_in_list(&gObjectLists[OBJ_LIST_SPAWNER]);
|
||||
profiler_update(PROFILER_TIME_SPAWNER);
|
||||
|
||||
gObjectCounter += update_objects_in_list(&gObjectLists[OBJ_LIST_SURFACE]);
|
||||
profiler_update(PROFILER_TIME_DYNAMIC);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -559,7 +563,13 @@ void update_non_terrain_objects(void) {
|
||||
|
||||
s32 i = 2;
|
||||
while ((listIndex = sObjectListUpdateOrder[i]) != -1) {
|
||||
if (listIndex == OBJ_LIST_PLAYER) {
|
||||
profiler_update(PROFILER_TIME_BEHAVIOR_BEFORE_MARIO);
|
||||
}
|
||||
gObjectCounter += update_objects_in_list(&gObjectLists[listIndex]);
|
||||
if (listIndex == OBJ_LIST_PLAYER) {
|
||||
profiler_update(PROFILER_TIME_MARIO);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@@ -606,13 +616,6 @@ UNUSED static u16 unused_get_elapsed_time(u64 *cycleCounts, s32 index) {
|
||||
* and object surface management.
|
||||
*/
|
||||
void update_objects(UNUSED s32 unused) {
|
||||
//s64 cycleCounts[30];
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
OSTime colTime = collisionTime[perfIteration];
|
||||
#endif
|
||||
|
||||
// cycleCounts[0] = get_current_clock();
|
||||
|
||||
gTimeStopState &= ~TIME_STOP_MARIO_OPENED_DOOR;
|
||||
|
||||
@@ -626,11 +629,9 @@ void update_objects(UNUSED s32 unused) {
|
||||
gObjectLists = gObjectListArray;
|
||||
|
||||
// If time stop is not active, unload object surfaces
|
||||
// cycleCounts[1] = get_clock_difference(cycleCounts[0]);
|
||||
clear_dynamic_surfaces();
|
||||
|
||||
// Update spawners and objects with surfaces
|
||||
// cycleCounts[2] = get_clock_difference(cycleCounts[0]);
|
||||
update_terrain_objects();
|
||||
|
||||
// If Mario was touching a moving platform at the end of last frame, apply
|
||||
@@ -640,24 +641,17 @@ void update_objects(UNUSED s32 unused) {
|
||||
apply_mario_platform_displacement();
|
||||
|
||||
// Detect which objects are intersecting
|
||||
// cycleCounts[3] = get_clock_difference(cycleCounts[0]);
|
||||
detect_object_collisions();
|
||||
|
||||
// Update all other objects that haven't been updated yet
|
||||
// cycleCounts[4] = get_clock_difference(cycleCounts[0]);
|
||||
update_non_terrain_objects();
|
||||
|
||||
// Unload any objects that have been deactivated
|
||||
// cycleCounts[5] = get_clock_difference(cycleCounts[0]);
|
||||
unload_deactivated_objects();
|
||||
|
||||
// Check if Mario is on a platform object and save this object
|
||||
// cycleCounts[6] = get_clock_difference(cycleCounts[0]);
|
||||
update_mario_platform();
|
||||
|
||||
// cycleCounts[7] = get_clock_difference(cycleCounts[0]);
|
||||
|
||||
// cycleCounts[0] = 0;
|
||||
try_print_debug_mario_object_info();
|
||||
|
||||
// If time stop was enabled this frame, activate it now so that it will
|
||||
@@ -669,8 +663,6 @@ void update_objects(UNUSED s32 unused) {
|
||||
}
|
||||
|
||||
gPrevFrameObjectCount = gObjectCounter;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
profiler_update(behaviourTime, first);
|
||||
behaviourTime[perfIteration] -= collisionTime[perfIteration] - colTime;
|
||||
#endif
|
||||
|
||||
profiler_update(PROFILER_TIME_BEHAVIOR_AFTER_MARIO);
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
#include <ultra64.h>
|
||||
#include <PR/os_internal_reg.h>
|
||||
#include "game_init.h"
|
||||
|
||||
#include "profiling.h"
|
||||
#include "fasttext.h"
|
||||
|
||||
#ifdef USE_PROFILER
|
||||
|
||||
#define RDP_CYCLE_CONV(x) ((10 * (x)) / 625) // 62.5 million cycles per frame
|
||||
|
||||
typedef struct {
|
||||
u32 counts[PROFILING_BUFFER_SIZE];
|
||||
u32 total;
|
||||
} ProfileTimeData;
|
||||
|
||||
ProfileTimeData all_profiling_data[PROFILER_TIME_COUNT];
|
||||
|
||||
int profile_buffer_index = -1;
|
||||
int rsp_buffer_indices[PROFILER_RSP_COUNT];
|
||||
// Holds either the start time if the task is running, or the amount of time the task has run for so far if yielded
|
||||
u32 rsp_pending_times[PROFILER_RSP_COUNT];
|
||||
u32 prev_start;
|
||||
u32 start;
|
||||
u32 prev_time;
|
||||
u32 audio_start;
|
||||
u32 audio_buffer_index;
|
||||
u32 preempted_time;
|
||||
|
||||
static void buffer_update(ProfileTimeData* data, u32 new, int buffer_index) {
|
||||
u32 old = data->counts[buffer_index];
|
||||
data->total -= old;
|
||||
data->total += new;
|
||||
data->counts[buffer_index] = new;
|
||||
}
|
||||
|
||||
void profiler_update(enum ProfilerTime which) {
|
||||
u32 cur_time = osGetCount();
|
||||
u32 diff;
|
||||
ProfileTimeData* cur_data = &all_profiling_data[which];
|
||||
|
||||
diff = cur_time - prev_time;
|
||||
|
||||
u32 saved = __osDisableInt();
|
||||
u32 cur_preempted_time = preempted_time;
|
||||
preempted_time = 0;
|
||||
__osRestoreInt(saved);
|
||||
if (cur_preempted_time > 0) {
|
||||
diff -= cur_preempted_time;
|
||||
start += cur_preempted_time;
|
||||
}
|
||||
|
||||
buffer_update(cur_data, diff, profile_buffer_index);
|
||||
prev_time = cur_time;
|
||||
}
|
||||
|
||||
void profiler_rsp_started(enum ProfilerRSPTime which) {
|
||||
rsp_pending_times[which] = osGetCount();
|
||||
}
|
||||
|
||||
void profiler_rsp_completed(enum ProfilerRSPTime which) {
|
||||
ProfileTimeData* cur_data = &all_profiling_data[PROFILER_TIME_RSP_GFX + which];
|
||||
int cur_index = rsp_buffer_indices[which];
|
||||
u32 time = osGetCount() - rsp_pending_times[which];
|
||||
rsp_pending_times[which] = 0;
|
||||
|
||||
buffer_update(cur_data, time, cur_index);
|
||||
cur_index++;
|
||||
if (cur_index >= PROFILING_BUFFER_SIZE) {
|
||||
cur_index = 0;
|
||||
}
|
||||
rsp_buffer_indices[which] = cur_index;
|
||||
}
|
||||
|
||||
void profiler_rsp_resumed() {
|
||||
rsp_pending_times[PROFILER_RSP_GFX] = osGetCount() - rsp_pending_times[PROFILER_RSP_GFX];
|
||||
}
|
||||
|
||||
// This ends up being the same math as resumed, so we just use resumed for both
|
||||
// void profiler_rsp_yielded() {
|
||||
// rsp_pending_times[PROFILER_RSP_GFX] = osGetCount() - rsp_pending_times[PROFILER_RSP_GFX];
|
||||
// }
|
||||
|
||||
void profiler_audio_started() {
|
||||
audio_start = osGetCount();
|
||||
}
|
||||
|
||||
void profiler_audio_completed() {
|
||||
ProfileTimeData* cur_data = &all_profiling_data[PROFILER_TIME_AUDIO];
|
||||
u32 time = osGetCount() - audio_start;
|
||||
u32 cur_index = audio_buffer_index;
|
||||
|
||||
preempted_time = time;
|
||||
buffer_update(cur_data, time, cur_index);
|
||||
cur_index++;
|
||||
if (cur_index >= PROFILING_BUFFER_SIZE) {
|
||||
cur_index = 0;
|
||||
}
|
||||
|
||||
audio_buffer_index = cur_index;
|
||||
}
|
||||
|
||||
static void update_fps_timer() {
|
||||
u32 diff = start - prev_start;
|
||||
|
||||
buffer_update(&all_profiling_data[PROFILER_TIME_FPS], diff, profile_buffer_index);
|
||||
prev_start = start;
|
||||
}
|
||||
|
||||
static void update_total_timer() {
|
||||
u32 saved = __osDisableInt();
|
||||
u32 cur_preempted_time = preempted_time;
|
||||
preempted_time = 0;
|
||||
__osRestoreInt(saved);
|
||||
|
||||
prev_time = start + cur_preempted_time;
|
||||
profiler_update(PROFILER_TIME_TOTAL);
|
||||
}
|
||||
|
||||
static void update_rdp_timers() {
|
||||
u32 tmem = IO_READ(DPC_TMEM_REG);
|
||||
u32 cmd = IO_READ(DPC_BUFBUSY_REG);
|
||||
u32 pipe = IO_READ(DPC_PIPEBUSY_REG);
|
||||
|
||||
if (gGlobalTimer > 5) {
|
||||
IO_WRITE(DPC_STATUS_REG, (DPC_CLR_CLOCK_CTR | DPC_CLR_CMD_CTR | DPC_CLR_PIPE_CTR | DPC_CLR_TMEM_CTR));
|
||||
}
|
||||
|
||||
buffer_update(&all_profiling_data[PROFILER_TIME_TMEM], tmem, profile_buffer_index);
|
||||
buffer_update(&all_profiling_data[PROFILER_TIME_CMD], cmd, profile_buffer_index);
|
||||
buffer_update(&all_profiling_data[PROFILER_TIME_PIPE], pipe, profile_buffer_index);
|
||||
}
|
||||
|
||||
#ifdef PUPPYPRINT_DEBUG
|
||||
extern u8 sPPDebugPage;
|
||||
extern u8 fDebug;
|
||||
#endif
|
||||
|
||||
float profiler_get_fps() {
|
||||
return (1000000.0f * PROFILING_BUFFER_SIZE) / (OS_CYCLES_TO_USEC(all_profiling_data[PROFILER_TIME_FPS].total));
|
||||
}
|
||||
|
||||
u32 profiler_get_cpu_cycles() {
|
||||
u32 cpu_normal_time = all_profiling_data[PROFILER_TIME_TOTAL].total / PROFILING_BUFFER_SIZE;
|
||||
u32 cpu_audio_time = all_profiling_data[PROFILER_TIME_AUDIO].total / PROFILING_BUFFER_SIZE;
|
||||
return cpu_normal_time + cpu_audio_time * 2;
|
||||
}
|
||||
|
||||
u32 profiler_get_rsp_cycles() {
|
||||
u32 rsp_graphics_time = all_profiling_data[PROFILER_TIME_RSP_GFX].total / PROFILING_BUFFER_SIZE;
|
||||
u32 rsp_audio_time = all_profiling_data[PROFILER_TIME_RSP_AUDIO].total / PROFILING_BUFFER_SIZE;
|
||||
return rsp_graphics_time + rsp_audio_time;
|
||||
}
|
||||
|
||||
u32 profiler_get_rdp_cycles() {
|
||||
u32 rdp_pipe_cycles = all_profiling_data[PROFILER_TIME_PIPE].total;
|
||||
u32 rdp_tmem_cycles = all_profiling_data[PROFILER_TIME_TMEM].total;
|
||||
u32 rdp_cmd_cycles = all_profiling_data[PROFILER_TIME_CMD].total;
|
||||
|
||||
u32 rdp_max_cycles = MAX(MAX(rdp_pipe_cycles, rdp_tmem_cycles), rdp_cmd_cycles);
|
||||
|
||||
return rdp_max_cycles / PROFILING_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
u32 profiler_get_cpu_microseconds() {
|
||||
u32 cpu_normal_time = OS_CYCLES_TO_USEC(all_profiling_data[PROFILER_TIME_TOTAL].total / PROFILING_BUFFER_SIZE);
|
||||
u32 cpu_audio_time = OS_CYCLES_TO_USEC(all_profiling_data[PROFILER_TIME_AUDIO].total / PROFILING_BUFFER_SIZE);
|
||||
return cpu_normal_time + cpu_audio_time * 2;
|
||||
}
|
||||
|
||||
u32 profiler_get_rsp_microseconds() {
|
||||
u32 rsp_graphics_time = OS_CYCLES_TO_USEC(all_profiling_data[PROFILER_TIME_RSP_GFX].total / PROFILING_BUFFER_SIZE);
|
||||
u32 rsp_audio_time = OS_CYCLES_TO_USEC(all_profiling_data[PROFILER_TIME_RSP_AUDIO].total / PROFILING_BUFFER_SIZE);
|
||||
return rsp_graphics_time + rsp_audio_time;
|
||||
}
|
||||
|
||||
u32 profiler_get_rdp_microseconds() {
|
||||
u32 rdp_pipe_cycles = all_profiling_data[PROFILER_TIME_PIPE].total;
|
||||
u32 rdp_tmem_cycles = all_profiling_data[PROFILER_TIME_TMEM].total;
|
||||
u32 rdp_cmd_cycles = all_profiling_data[PROFILER_TIME_CMD].total;
|
||||
|
||||
u32 rdp_max_cycles = MAX(MAX(rdp_pipe_cycles, rdp_tmem_cycles), rdp_cmd_cycles);
|
||||
|
||||
return RDP_CYCLE_CONV(rdp_max_cycles / PROFILING_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
void profiler_print_times() {
|
||||
u32 microseconds[PROFILER_TIME_COUNT];
|
||||
char text_buffer[196];
|
||||
|
||||
update_fps_timer();
|
||||
update_total_timer();
|
||||
update_rdp_timers();
|
||||
|
||||
#ifndef PUPPYPRINT_DEBUG
|
||||
static u8 show_profiler = 0;
|
||||
if (gPlayer1Controller->buttonPressed & L_TRIG) {
|
||||
show_profiler ^= 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PUPPYPRINT_DEBUG
|
||||
if (fDebug && sPPDebugPage == 0) {
|
||||
#else
|
||||
if (show_profiler) {
|
||||
#endif
|
||||
for (int i = 0; i < PROFILER_TIME_COUNT; i++) {
|
||||
if (i < PROFILER_TIME_TMEM) {
|
||||
microseconds[i] = OS_CYCLES_TO_USEC(all_profiling_data[i].total / PROFILING_BUFFER_SIZE);
|
||||
} else {
|
||||
microseconds[i] = RDP_CYCLE_CONV(all_profiling_data[i].total / PROFILING_BUFFER_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
// audio time is removed from the main thread profiling, so add it back here
|
||||
u32 total_cpu = microseconds[PROFILER_TIME_TOTAL] + microseconds[PROFILER_TIME_AUDIO] * 2;
|
||||
u32 total_rsp = microseconds[PROFILER_TIME_RSP_GFX] + microseconds[PROFILER_TIME_RSP_AUDIO];
|
||||
u32 max_rdp = MAX(MAX(microseconds[PROFILER_TIME_TMEM], microseconds[PROFILER_TIME_CMD]), microseconds[PROFILER_TIME_PIPE]);
|
||||
|
||||
sprintf(text_buffer,
|
||||
"FPS: %5.2f\n"
|
||||
"\n"
|
||||
"CPU\t\t%d (%d%%)\n"
|
||||
" Input\t\t%d\n"
|
||||
" Dynamic\t\t%d\n"
|
||||
" Mario\t\t\t%d\n"
|
||||
" Behavior\t\t%d\n"
|
||||
" Graph\t\t%d\n"
|
||||
" Audio\t\t\t%d\n"
|
||||
"\n"
|
||||
"RDP\t\t%d (%d%%)\n"
|
||||
" Tmem\t\t\t%d\n"
|
||||
" Cmd\t\t\t%d\n"
|
||||
" Pipe\t\t\t%d\n"
|
||||
"\n"
|
||||
"RSP\t\t%d (%d%%)\n"
|
||||
" Gfx\t\t\t%d\n"
|
||||
" Audio\t\t\t%d\n",
|
||||
1000000.0f / microseconds[PROFILER_TIME_FPS],
|
||||
total_cpu, total_cpu / 333,
|
||||
microseconds[PROFILER_TIME_CONTROLLERS],
|
||||
microseconds[PROFILER_TIME_DYNAMIC],
|
||||
microseconds[PROFILER_TIME_MARIO],
|
||||
microseconds[PROFILER_TIME_BEHAVIOR_BEFORE_MARIO] + microseconds[PROFILER_TIME_BEHAVIOR_AFTER_MARIO],
|
||||
microseconds[PROFILER_TIME_GFX],
|
||||
microseconds[PROFILER_TIME_AUDIO] * 2, // audio is 60Hz, so double the average
|
||||
max_rdp, max_rdp / 333,
|
||||
microseconds[PROFILER_TIME_TMEM],
|
||||
microseconds[PROFILER_TIME_CMD],
|
||||
microseconds[PROFILER_TIME_PIPE],
|
||||
total_rsp, total_rsp / 333,
|
||||
microseconds[PROFILER_TIME_RSP_GFX],
|
||||
microseconds[PROFILER_TIME_RSP_AUDIO]
|
||||
);
|
||||
|
||||
Gfx* dlHead = gDisplayListHead;
|
||||
gDPPipeSync(dlHead++);
|
||||
gDPSetCycleType(dlHead++, G_CYC_1CYCLE);
|
||||
gDPSetRenderMode(dlHead++, G_RM_TEX_EDGE, G_RM_TEX_EDGE2);
|
||||
gDPSetTexturePersp(dlHead++, G_TP_NONE);
|
||||
gDPSetTextureFilter(dlHead++, G_TF_POINT);
|
||||
gDPSetTextureLUT(dlHead++, G_TT_NONE);
|
||||
drawSmallStringCol(&dlHead, 10, 10, text_buffer, 255, 255, 255);
|
||||
gDisplayListHead = dlHead;
|
||||
}
|
||||
}
|
||||
|
||||
void profiler_frame_setup() {
|
||||
profile_buffer_index++;
|
||||
preempted_time = 0;
|
||||
|
||||
if (profile_buffer_index >= PROFILING_BUFFER_SIZE) {
|
||||
profile_buffer_index = 0;
|
||||
}
|
||||
|
||||
prev_time = start = osGetCount();
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,61 @@
|
||||
#ifndef __PROFILING_H__
|
||||
#define __PROFILING_H__
|
||||
|
||||
#include <ultra64.h>
|
||||
#include "macros.h"
|
||||
#include "config/config_debug.h"
|
||||
#include "config/config_safeguards.h"
|
||||
|
||||
#define PROFILING_BUFFER_SIZE 64
|
||||
|
||||
enum ProfilerTime {
|
||||
PROFILER_TIME_FPS,
|
||||
PROFILER_TIME_CONTROLLERS,
|
||||
PROFILER_TIME_SPAWNER,
|
||||
PROFILER_TIME_DYNAMIC,
|
||||
PROFILER_TIME_BEHAVIOR_BEFORE_MARIO,
|
||||
PROFILER_TIME_MARIO,
|
||||
PROFILER_TIME_BEHAVIOR_AFTER_MARIO,
|
||||
PROFILER_TIME_GFX,
|
||||
PROFILER_TIME_AUDIO,
|
||||
PROFILER_TIME_TOTAL,
|
||||
PROFILER_TIME_RSP_GFX,
|
||||
PROFILER_TIME_RSP_AUDIO,
|
||||
PROFILER_TIME_TMEM,
|
||||
PROFILER_TIME_PIPE,
|
||||
PROFILER_TIME_CMD,
|
||||
PROFILER_TIME_COUNT,
|
||||
};
|
||||
|
||||
enum ProfilerRSPTime {
|
||||
PROFILER_RSP_GFX,
|
||||
PROFILER_RSP_AUDIO,
|
||||
PROFILER_RSP_COUNT
|
||||
};
|
||||
|
||||
#ifdef USE_PROFILER
|
||||
void profiler_update(enum ProfilerTime which);
|
||||
void profiler_print_times();
|
||||
void profiler_frame_setup();
|
||||
void profiler_rsp_started(enum ProfilerRSPTime which);
|
||||
void profiler_rsp_completed(enum ProfilerRSPTime which);
|
||||
void profiler_rsp_resumed();
|
||||
void profiler_audio_started();
|
||||
void profiler_audio_completed();
|
||||
// See profiling.c to see why profiler_rsp_yielded isn't its own function
|
||||
static ALWAYS_INLINE void profiler_rsp_yielded() {
|
||||
profiler_rsp_resumed();
|
||||
}
|
||||
#else
|
||||
#define profiler_update(which)
|
||||
#define profiler_print_times()
|
||||
#define profiler_frame_setup()
|
||||
#define profiler_rsp_started(which)
|
||||
#define profiler_rsp_completed(which)
|
||||
#define profiler_rsp_resumed()
|
||||
#define profiler_audio_started()
|
||||
#define profiler_audio_completed()
|
||||
#define profiler_rsp_yielded()
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1205,6 +1205,9 @@ static void puppycam_script(void) {
|
||||
|
||||
gPuppyCam.flags &= ~PUPPYCAM_BEHAVIOUR_YAW_ROTATION;
|
||||
}
|
||||
else {
|
||||
gPuppyCam.yaw = atan2s(gPuppyCam.pos[2] - gPuppyCam.focus[2], gPuppyCam.pos[0] - gPuppyCam.focus[0]);
|
||||
}
|
||||
|
||||
if (volume.angles->pitch != PUPPY_NULL) {
|
||||
gPuppyCam.pitchTarget = volume.angles->pitch;
|
||||
|
||||
@@ -34,13 +34,13 @@
|
||||
#include "include/command_macros_base.h"
|
||||
|
||||
#define PUPPYVOLUME(x, y, z, length, height, width, yaw, functionptr, anglesptr, addflags, removeflags, flagpersistance, room, shape, fov) \
|
||||
CMD_BBH(0x3D, 0x24, x), \
|
||||
CMD_BBH(0x3D, 0x28, x), \
|
||||
CMD_HHHHHH(y, z, length, height, width, yaw), \
|
||||
CMD_PTR(functionptr), \
|
||||
CMD_PTR(anglesptr), \
|
||||
CMD_W(addflags), \
|
||||
CMD_W(removeflags), \
|
||||
CMD_BBH(flagpersistance, shape, room) \
|
||||
CMD_BBH(flagpersistance, shape, room), \
|
||||
CMD_BBH(fov, 0x0, 0x0)
|
||||
|
||||
struct gPuppyOptions
|
||||
|
||||
+58
-191
@@ -68,34 +68,9 @@ s32 benchmarkTimer = 0;
|
||||
s32 benchmarkProgramTimer = 0;
|
||||
s8 benchmarkType = 0;
|
||||
// General
|
||||
u32 cpuTime = 0;
|
||||
u32 rspTime = 0;
|
||||
u32 rdpTime = 0;
|
||||
u32 ramTime = 0;
|
||||
u32 loadTime = 0;
|
||||
u32 gLastOSTime = 0;
|
||||
u32 rspDelta = 0;
|
||||
s32 benchMark[NUM_BENCH_ITERATIONS + 2];
|
||||
// CPU
|
||||
u32 collisionTime[NUM_PERF_ITERATIONS + 1];
|
||||
u32 behaviourTime[NUM_PERF_ITERATIONS + 1];
|
||||
u32 scriptTime[NUM_PERF_ITERATIONS + 1];
|
||||
u32 graphTime[NUM_PERF_ITERATIONS + 1];
|
||||
u32 audioTime[NUM_PERF_ITERATIONS + 1];
|
||||
u32 dmaTime[NUM_PERF_ITERATIONS + 1];
|
||||
u32 dmaAudioTime[NUM_PERF_ITERATIONS + 1];
|
||||
u32 faultTime[NUM_PERF_ITERATIONS + 1];
|
||||
u32 taskTime[NUM_PERF_ITERATIONS + 1];
|
||||
u32 profilerTime[NUM_PERF_ITERATIONS + 1];
|
||||
u32 profilerTime2[NUM_PERF_ITERATIONS + 1];
|
||||
u32 cameraTime[NUM_PERF_ITERATIONS + 1];
|
||||
// RSP
|
||||
u32 audioTime[NUM_PERF_ITERATIONS + 1];
|
||||
u32 rspGenTime[NUM_PERF_ITERATIONS + 1];
|
||||
// RDP
|
||||
u32 bufferTime[NUM_PERF_ITERATIONS + 1];
|
||||
u32 tmemTime[NUM_PERF_ITERATIONS + 1];
|
||||
u32 busTime[NUM_PERF_ITERATIONS + 1];
|
||||
// RAM
|
||||
s8 ramViewer = FALSE;
|
||||
s32 ramsizeSegment[NUM_TLB_SEGMENTS + 1] = {
|
||||
@@ -306,6 +281,7 @@ void print_ram_overview(void) {
|
||||
sprintf(textBytes, "RAM: %06X/%06X (%d_)", main_pool_available(), mempool, (s32)(((f32)main_pool_available() / (f32)mempool) * 100));
|
||||
print_small_text(SCREEN_CENTER_X, (SCREEN_HEIGHT - 16), textBytes, PRINT_TEXT_ALIGN_CENTRE, PRINT_ALL, FONT_OUTLINE);
|
||||
|
||||
puppyprint_calculate_ram_usage();
|
||||
print_ram_bar();
|
||||
}
|
||||
|
||||
@@ -477,12 +453,6 @@ extern s16 gVisualSurfaceCount;
|
||||
|
||||
void puppyprint_render_collision(void) {
|
||||
char textBytes[200];
|
||||
#ifdef PUPPYPRINT_DEBUG_CYCLES
|
||||
sprintf(textBytes, "Collision:<COL_99505099> %dc", collisionTime[NUM_PERF_ITERATIONS]);
|
||||
#else
|
||||
sprintf(textBytes, "Collision:<COL_99505099> %dus", collisionTime[NUM_PERF_ITERATIONS]);
|
||||
#endif
|
||||
print_small_text(304, 48, textBytes, PRINT_TEXT_ALIGN_RIGHT, PRINT_ALL, 1);
|
||||
|
||||
sprintf(textBytes, "Pool Size: %X#Node Size: %X#Surfaces Allocated: %d#Nodes Allocated: %d#Current Cell: %d", (SURFACE_NODE_POOL_SIZE * sizeof(struct SurfaceNode)), (SURFACE_POOL_SIZE * sizeof(struct Surface)),
|
||||
gSurfacesAllocated, gSurfaceNodesAllocated, gVisualSurfaceCount);
|
||||
@@ -512,55 +482,47 @@ void puppyprint_render_collision(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
struct CPUBar {
|
||||
u32 *time;
|
||||
ColorRGB colour;
|
||||
const char str[32];
|
||||
};
|
||||
|
||||
extern void print_fps(s32 x, s32 y);
|
||||
|
||||
struct CPUBar cpu_ordering_table[] = {
|
||||
{ collisionTime, COLOR_RGB_RED, { "Collision: <COL_99505099>" }},
|
||||
{ graphTime, COLOR_RGB_BLUE, { "Graph: <COL_50509999>" }},
|
||||
{ behaviourTime, COLOR_RGB_GREEN, { "Behaviour: <COL_50995099>" }},
|
||||
{ audioTime, COLOR_RGB_YELLOW, { "Audio: <COL_99995099>" }},
|
||||
{ cameraTime, COLOR_RGB_CYAN, { "Camera: <COL_50999999>" }},
|
||||
{ dmaTime, COLOR_RGB_MAGENTA, { "DMA: <COL_99509999>" }},
|
||||
};
|
||||
u32 profiler_get_cpu_cycles();
|
||||
u32 profiler_get_rsp_cycles();
|
||||
u32 profiler_get_rdp_cycles();
|
||||
|
||||
#define CPU_TABLE_MAX (sizeof(cpu_ordering_table) / sizeof(struct CPUBar))
|
||||
#define ADDTIMES MAX(((collisionTime[MX] + graphTime[MX] + behaviourTime[MX] + audioTime[MX] + cameraTime[MX] + dmaTime[MX]) / 80), 1)
|
||||
u32 profiler_get_cpu_microseconds();
|
||||
u32 profiler_get_rsp_microseconds();
|
||||
u32 profiler_get_rdp_microseconds();
|
||||
|
||||
void print_basic_profiling(void) {
|
||||
u32 cpuTime;
|
||||
u32 rspTime;
|
||||
u32 rdpTime;
|
||||
char textBytes[90];
|
||||
print_fps(16, 40);
|
||||
print_fps(16, 16);
|
||||
#ifdef PUPPYPRINT_DEBUG_CYCLES
|
||||
cpuTime = profiler_get_cpu_cycles();
|
||||
rspTime = profiler_get_rsp_cycles();
|
||||
rdpTime = profiler_get_rdp_cycles();
|
||||
sprintf(textBytes, "CPU: %dc (%d_)#RSP: %dc (%d_)#RDP: %dc (%d_)",
|
||||
cpuTime, (cpuTime / 15625),
|
||||
rspTime, (rspTime / 15625),
|
||||
rdpTime, (rdpTime / 15625));
|
||||
#else
|
||||
cpuTime = profiler_get_cpu_microseconds();
|
||||
rspTime = profiler_get_rsp_microseconds();
|
||||
rdpTime = profiler_get_rdp_microseconds();
|
||||
sprintf(textBytes, "CPU: %dus (%d_)#RSP: %dus (%d_)#RDP: %dus (%d_)",
|
||||
cpuTime, (cpuTime / 333),
|
||||
rspTime, (rspTime / 333),
|
||||
rdpTime, (rdpTime / 333));
|
||||
#endif
|
||||
print_small_text(16, 52, textBytes, PRINT_TEXT_ALIGN_LEFT, PRINT_ALL, FONT_OUTLINE);
|
||||
print_small_text(16, 28, textBytes, PRINT_TEXT_ALIGN_LEFT, PRINT_ALL, FONT_OUTLINE);
|
||||
}
|
||||
|
||||
void puppyprint_render_standard(void) {
|
||||
s32 perfPercentage[CPU_TABLE_MAX];
|
||||
s32 graphPos;
|
||||
s32 prevGraph;
|
||||
u32 i;
|
||||
s32 viewedNums;
|
||||
char textBytes[80];
|
||||
|
||||
print_basic_profiling();
|
||||
|
||||
sprintf(textBytes, "OBJ: %d/%d", gObjectCounter, OBJECT_POOL_CAPACITY);
|
||||
print_small_text(16, 124, textBytes, PRINT_TEXT_ALIGN_LEFT, PRINT_ALL, FONT_OUTLINE);
|
||||
print_small_text((SCREEN_WIDTH - 16), 16, textBytes, PRINT_TEXT_ALIGN_RIGHT, PRINT_ALL, FONT_OUTLINE);
|
||||
|
||||
#ifndef ENABLE_CREDITS_BENCHMARK
|
||||
// Very little point printing useless info if Mario doesn't even exist.
|
||||
@@ -571,7 +533,7 @@ void puppyprint_render_standard(void) {
|
||||
(s32)(gMarioState->pos[2]),
|
||||
(u16)(gMarioState->faceAngle[1]),
|
||||
(u32)(gMarioState->action & ACT_ID_MASK));
|
||||
print_small_text(16, 140, textBytes, PRINT_TEXT_ALIGN_LEFT, PRINT_ALL, FONT_OUTLINE);
|
||||
print_small_text((SCREEN_WIDTH - 16), 32, textBytes, PRINT_TEXT_ALIGN_RIGHT, PRINT_ALL, FONT_OUTLINE);
|
||||
}
|
||||
// Same for the camera, especially so because this will crash otherwise.
|
||||
if (gCamera) {
|
||||
@@ -584,66 +546,51 @@ void puppyprint_render_standard(void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
// Just to keep screen estate a little friendlier.
|
||||
#define MX NUM_PERF_ITERATIONS
|
||||
for (i = 0; i < CPU_TABLE_MAX; i++) {
|
||||
perfPercentage[i] = MAX((cpu_ordering_table[i].time[MX] / ADDTIMES), 0);
|
||||
}
|
||||
#undef ADDTIMES
|
||||
#undef MX
|
||||
// Old profiler bar code, can be restored one day if desired to work with new profiler
|
||||
// s32 graphPos;
|
||||
// s32 prevGraph;
|
||||
// u32 i;
|
||||
// s32 viewedNums;
|
||||
|
||||
viewedNums = 0;
|
||||
for (i = 0; i < CPU_TABLE_MAX; i++) {
|
||||
s32 num = cpu_ordering_table[i].time[NUM_PERF_ITERATIONS];
|
||||
if (num != 0) {
|
||||
#ifdef PUPPYPRINT_DEBUG_CYCLES
|
||||
sprintf(textBytes, "%s%dc", cpu_ordering_table[i].str, num);
|
||||
#else
|
||||
sprintf(textBytes, "%s%dus", cpu_ordering_table[i].str, num);
|
||||
#endif
|
||||
print_small_text((SCREEN_WIDTH - 16), (40 + (viewedNums * 12)), textBytes, PRINT_TEXT_ALIGN_RIGHT, PRINT_ALL, FONT_OUTLINE);
|
||||
viewedNums++;
|
||||
}
|
||||
}
|
||||
// prepare_blank_box();
|
||||
// viewedNums = 0;
|
||||
|
||||
s32 barY = (28 + (viewedNums * 12)) + 16;
|
||||
prepare_blank_box();
|
||||
viewedNums = 0;
|
||||
// // Render CPU breakdown bar.
|
||||
// for (i = 0; i < CPU_TABLE_MAX; i++) {
|
||||
// if (perfPercentage[i] == 0
|
||||
// && (i != CPU_TABLE_MAX - 1)) {
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// Render CPU breakdown bar.
|
||||
for (i = 0; i < CPU_TABLE_MAX; i++) {
|
||||
if (perfPercentage[i] == 0
|
||||
&& (i != CPU_TABLE_MAX - 1)) {
|
||||
continue;
|
||||
}
|
||||
// if (viewedNums == 0) {
|
||||
// graphPos = ((SCREEN_WIDTH - 96) + perfPercentage[i]);
|
||||
// render_blank_box((SCREEN_WIDTH - 96), barY, graphPos, (barY + 8),
|
||||
// cpu_ordering_table[i].colour[0],
|
||||
// cpu_ordering_table[i].colour[1],
|
||||
// cpu_ordering_table[i].colour[2], 255);
|
||||
// } else if (i == (CPU_TABLE_MAX - 1)) {
|
||||
// graphPos = ((SCREEN_WIDTH - 96) + perfPercentage[i]);
|
||||
// render_blank_box(prevGraph, barY, (SCREEN_WIDTH - 16), (barY + 8),
|
||||
// cpu_ordering_table[i].colour[0],
|
||||
// cpu_ordering_table[i].colour[1],
|
||||
// cpu_ordering_table[i].colour[2], 255);
|
||||
// } else {
|
||||
// graphPos += perfPercentage[i];
|
||||
// render_blank_box(prevGraph, barY, graphPos, (barY + 8),
|
||||
// cpu_ordering_table[i].colour[0],
|
||||
// cpu_ordering_table[i].colour[1],
|
||||
// cpu_ordering_table[i].colour[2], 255);
|
||||
// }
|
||||
|
||||
if (viewedNums == 0) {
|
||||
graphPos = ((SCREEN_WIDTH - 96) + perfPercentage[i]);
|
||||
render_blank_box((SCREEN_WIDTH - 96), barY, graphPos, (barY + 8),
|
||||
cpu_ordering_table[i].colour[0],
|
||||
cpu_ordering_table[i].colour[1],
|
||||
cpu_ordering_table[i].colour[2], 255);
|
||||
} else if (i == (CPU_TABLE_MAX - 1)) {
|
||||
graphPos = ((SCREEN_WIDTH - 96) + perfPercentage[i]);
|
||||
render_blank_box(prevGraph, barY, (SCREEN_WIDTH - 16), (barY + 8),
|
||||
cpu_ordering_table[i].colour[0],
|
||||
cpu_ordering_table[i].colour[1],
|
||||
cpu_ordering_table[i].colour[2], 255);
|
||||
} else {
|
||||
graphPos += perfPercentage[i];
|
||||
render_blank_box(prevGraph, barY, graphPos, (barY + 8),
|
||||
cpu_ordering_table[i].colour[0],
|
||||
cpu_ordering_table[i].colour[1],
|
||||
cpu_ordering_table[i].colour[2], 255);
|
||||
}
|
||||
// viewedNums++;
|
||||
// prevGraph = graphPos;
|
||||
// }
|
||||
|
||||
viewedNums++;
|
||||
prevGraph = graphPos;
|
||||
}
|
||||
|
||||
finish_blank_box();
|
||||
// finish_blank_box();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void puppyprint_render_minimal(void) {
|
||||
print_basic_profiling();
|
||||
}
|
||||
@@ -686,12 +633,10 @@ void render_page_menu(void) {
|
||||
}
|
||||
|
||||
void puppyprint_render_profiler(void) {
|
||||
OSTime first = osGetTime();
|
||||
|
||||
print_set_envcolour(255, 255, 255, 255);
|
||||
|
||||
if (!fDebug) {
|
||||
profiler_update(profilerTime, first);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -700,39 +645,9 @@ void puppyprint_render_profiler(void) {
|
||||
if (sDebugMenu) {
|
||||
render_page_menu();
|
||||
}
|
||||
profiler_update(profilerTime, first);
|
||||
}
|
||||
|
||||
void profiler_update(u32 *time, OSTime time2) {
|
||||
time[perfIteration] = (osGetTime() - time2);
|
||||
}
|
||||
|
||||
void get_average_perf_time(u32 *time, s32 is_rdp) {
|
||||
// This takes all but the last index of the timer array, and creates an average value, which is written to the last index.
|
||||
s32 i = 0;
|
||||
s32 total = 0;
|
||||
for (i = 0; i < NUM_PERF_ITERATIONS; i++) {
|
||||
total += time[i];
|
||||
}
|
||||
|
||||
total /= NUM_PERF_ITERATIONS;
|
||||
total = MAX(total, 0);
|
||||
if (is_rdp)
|
||||
{
|
||||
time[NUM_PERF_ITERATIONS] = RDP_CYCLE_CONV(total);
|
||||
}
|
||||
else
|
||||
{
|
||||
time[NUM_PERF_ITERATIONS] = CYCLE_CONV(total);
|
||||
}
|
||||
}
|
||||
|
||||
void puppyprint_profiler_process(void) {
|
||||
bufferTime[perfIteration] = (IO_READ(DPC_BUFBUSY_REG));
|
||||
tmemTime[perfIteration] = (IO_READ(DPC_TMEM_REG));
|
||||
busTime[perfIteration] = (IO_READ(DPC_PIPEBUSY_REG));
|
||||
OSTime newTime = osGetTime();
|
||||
|
||||
if (fDebug && (gPlayer1Controller->buttonPressed & L_TRIG)) {
|
||||
sDebugMenu ^= TRUE;
|
||||
if (sDebugMenu == FALSE) {
|
||||
@@ -760,54 +675,6 @@ void puppyprint_profiler_process(void) {
|
||||
sDebugOption = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(gGlobalTimer % NUM_PERF_ITERATIONS)) {
|
||||
get_average_perf_time( scriptTime, FALSE);
|
||||
get_average_perf_time( behaviourTime, FALSE);
|
||||
get_average_perf_time( collisionTime, FALSE);
|
||||
get_average_perf_time( graphTime, FALSE);
|
||||
get_average_perf_time( audioTime, FALSE);
|
||||
get_average_perf_time( dmaTime, FALSE);
|
||||
get_average_perf_time( dmaAudioTime, FALSE);
|
||||
get_average_perf_time( faultTime, FALSE);
|
||||
get_average_perf_time( taskTime, FALSE);
|
||||
get_average_perf_time( profilerTime, FALSE);
|
||||
get_average_perf_time( profilerTime2, FALSE);
|
||||
get_average_perf_time( cameraTime, FALSE);
|
||||
|
||||
// Performed twice a frame without fail, so doubled to have a more representative value.
|
||||
audioTime[NUM_PERF_ITERATIONS] *= 2;
|
||||
dmaAudioTime[NUM_PERF_ITERATIONS] *= 2;
|
||||
dmaTime[NUM_PERF_ITERATIONS] += dmaAudioTime[NUM_PERF_ITERATIONS];
|
||||
|
||||
get_average_perf_time(rspGenTime, FALSE);
|
||||
|
||||
get_average_perf_time(bufferTime, TRUE);
|
||||
get_average_perf_time( tmemTime, TRUE);
|
||||
get_average_perf_time( busTime, TRUE);
|
||||
|
||||
rdpTime = bufferTime[NUM_PERF_ITERATIONS];
|
||||
rdpTime = MAX(rdpTime, tmemTime[NUM_PERF_ITERATIONS]);
|
||||
rdpTime = MAX(rdpTime, busTime[NUM_PERF_ITERATIONS]);
|
||||
#if BBPLAYER == 1 // iQue RDP registers need to be halved to be correct.
|
||||
rdpTime /= 2;
|
||||
#endif
|
||||
cpuTime = (scriptTime[NUM_PERF_ITERATIONS]
|
||||
+ taskTime[NUM_PERF_ITERATIONS]
|
||||
+ faultTime[NUM_PERF_ITERATIONS]
|
||||
+ audioTime[NUM_PERF_ITERATIONS]);
|
||||
rspTime = rspGenTime[NUM_PERF_ITERATIONS];
|
||||
puppyprint_calculate_ram_usage();
|
||||
}
|
||||
|
||||
gLastOSTime = newTime;
|
||||
if (gGlobalTimer > 5) {
|
||||
IO_WRITE(DPC_STATUS_REG, (DPC_CLR_CLOCK_CTR | DPC_CLR_CMD_CTR | DPC_CLR_PIPE_CTR | DPC_CLR_TMEM_CTR));
|
||||
}
|
||||
if (perfIteration++ == (NUM_PERF_ITERATIONS - 1)) {
|
||||
perfIteration = 0;
|
||||
}
|
||||
profiler_update(profilerTime2, newTime);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+1
-36
@@ -2,17 +2,9 @@
|
||||
|
||||
#include "segment2.h"
|
||||
|
||||
// This is how many indexes of timers are saved at once. higher creates a smoother average, but naturally uses more RAM. 15's fine.
|
||||
// #define NUM_PERF_ITERATIONS 15
|
||||
#define NUM_PERF_ITERATIONS 16
|
||||
#define NUM_BENCH_ITERATIONS 150
|
||||
#define LOG_BUFFER_SIZE 16
|
||||
|
||||
#ifdef ENABLE_CREDITS_BENCHMARK
|
||||
#undef NUM_PERF_ITERATIONS
|
||||
#define NUM_PERF_ITERATIONS 60
|
||||
#endif
|
||||
|
||||
struct PuppyPrintPage{
|
||||
void (*func)();
|
||||
char name[32];
|
||||
@@ -58,35 +50,8 @@ extern s32 mempool;
|
||||
extern u8 benchOption;
|
||||
|
||||
// General
|
||||
extern u32 cpuTime;
|
||||
extern u32 rspTime;
|
||||
extern u32 rdpTime;
|
||||
extern u32 ramTime;
|
||||
extern u32 loadTime;
|
||||
extern u32 rspDelta;
|
||||
extern s32 benchMark[NUM_BENCH_ITERATIONS + 2];
|
||||
extern s32 benchMark[NUM_BENCH_ITERATIONS + 2];
|
||||
|
||||
// CPU
|
||||
extern u32 collisionTime[NUM_PERF_ITERATIONS + 1];
|
||||
extern u32 behaviourTime[NUM_PERF_ITERATIONS + 1];
|
||||
extern u32 scriptTime[NUM_PERF_ITERATIONS + 1];
|
||||
extern u32 graphTime[NUM_PERF_ITERATIONS + 1];
|
||||
extern u32 audioTime[NUM_PERF_ITERATIONS + 1];
|
||||
extern u32 dmaTime[NUM_PERF_ITERATIONS + 1];
|
||||
extern u32 dmaAudioTime[NUM_PERF_ITERATIONS + 1];
|
||||
extern u32 faultTime[NUM_PERF_ITERATIONS + 1];
|
||||
extern u32 taskTime[NUM_PERF_ITERATIONS + 1];
|
||||
extern u32 cameraTime[NUM_PERF_ITERATIONS + 1];
|
||||
extern u32 profilerTime[NUM_PERF_ITERATIONS + 1];
|
||||
extern u32 profilerTime2[NUM_PERF_ITERATIONS + 1];
|
||||
// RSP
|
||||
extern u32 rspGenTime[NUM_PERF_ITERATIONS + 1];
|
||||
// RDP
|
||||
extern u32 bufferTime[NUM_PERF_ITERATIONS + 1];
|
||||
extern u32 tmemTime[NUM_PERF_ITERATIONS + 1];
|
||||
extern u32 busTime[NUM_PERF_ITERATIONS + 1];
|
||||
|
||||
extern void profiler_update(u32 *time, OSTime time2);
|
||||
extern void puppyprint_profiler_process(void);
|
||||
extern void puppyprint_render_profiler(void);
|
||||
extern void puppyprint_profiler_finished(void);
|
||||
|
||||
@@ -248,7 +248,7 @@ void switch_ucode(s32 ucode) {
|
||||
switch (ucode) {
|
||||
default: // GRAPH_NODE_UCODE_DEFAULT
|
||||
case GRAPH_NODE_UCODE_DEFAULT:
|
||||
gSPLoadUcodeL(gDisplayListHead++, gspF3DZEX2_PosLight_fifo); // F3DZEX2_PosLight
|
||||
gSPLoadUcodeL(gDisplayListHead++, gspF3DZEX2_NoN_PosLight_fifo); // F3DZEX2_PosLight
|
||||
// Reload the necessary RSP settings
|
||||
gSPDisplayList(gDisplayListHead++, init_rsp);
|
||||
break;
|
||||
|
||||
+9
-10
@@ -361,16 +361,6 @@ void save_file_load_all(void) {
|
||||
}
|
||||
|
||||
#ifdef PUPPYCAM
|
||||
void puppycam_check_save(void) {
|
||||
if (gSaveBuffer.menuData.firstBoot != 4
|
||||
|| gSaveBuffer.menuData.saveOptions.sensitivityX < 5
|
||||
|| gSaveBuffer.menuData.saveOptions.sensitivityY < 5) {
|
||||
wipe_main_menu_data();
|
||||
gSaveBuffer.menuData.firstBoot = 4;
|
||||
puppycam_default_config();
|
||||
}
|
||||
}
|
||||
|
||||
void puppycam_get_save(void) {
|
||||
gPuppyCam.options = gSaveBuffer.menuData.saveOptions;
|
||||
|
||||
@@ -394,6 +384,15 @@ void puppycam_set_save(void) {
|
||||
gMainMenuDataModified = TRUE;
|
||||
save_main_menu_data();
|
||||
}
|
||||
|
||||
void puppycam_check_save(void) {
|
||||
if (gSaveBuffer.menuData.firstBoot != 4) {
|
||||
wipe_main_menu_data();
|
||||
gSaveBuffer.menuData.firstBoot = 4;
|
||||
puppycam_default_config();
|
||||
puppycam_set_save();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,6 +12,14 @@
|
||||
*/
|
||||
enum ShadowType {
|
||||
#ifdef LEGACY_SHADOW_IDS
|
||||
LEGACY_SHADOW_CIRCLE_9_VERTS = 0,
|
||||
LEGACY_SHADOW_CIRCLE_4_VERTS = 1,
|
||||
LEGACY_SHADOW_CIRCLE_4_VERTS_FLAT_UNUSED = 2,
|
||||
LEGACY_SHADOW_SQUARE_PERMANENT = 10,
|
||||
LEGACY_SHADOW_SQUARE_SCALABLE = 11,
|
||||
LEGACY_SHADOW_SQUARE_TOGGLABLE = 12,
|
||||
LEGACY_SHADOW_CIRCLE_PLAYER = 99,
|
||||
|
||||
SHADOW_CIRCLE = 5,
|
||||
SHADOW_CIRCLE_PLAYER = SHADOW_CIRCLE,
|
||||
SHADOW_CIRCLE_4_VERTS = SHADOW_CIRCLE,
|
||||
|
||||
+4
-2
@@ -61,7 +61,7 @@ struct Skybox {
|
||||
|
||||
struct Skybox sSkyBoxInfo[2];
|
||||
|
||||
typedef const Texture *const SkyboxTexture[80 * SKYBOX_SIZE];
|
||||
typedef const Texture *const SkyboxTexture[80 * sqr(SKYBOX_SIZE)];
|
||||
|
||||
extern SkyboxTexture bbh_skybox_ptrlist;
|
||||
extern SkyboxTexture bidw_skybox_ptrlist;
|
||||
@@ -290,11 +290,13 @@ Gfx *create_skybox_facing_camera(s8 player, s8 background, f32 fov, Vec3f pos, V
|
||||
s8 colorIndex = 1;
|
||||
|
||||
// If the "Plunder in the Sunken Ship" star in JRB is collected, make the sky darker and slightly green
|
||||
#ifdef ENABLE_VANILLA_LEVEL_SPECIFIC_CHECKS
|
||||
if (background == BACKGROUND_ABOVE_CLOUDS
|
||||
&& !(save_file_get_star_flags(gCurrSaveFileNum - 1, COURSE_NUM_TO_INDEX(COURSE_JRB)) & STAR_FLAG_ACT_1)) {
|
||||
colorIndex = 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//! fov is always set to 90.0f. If this line is removed, then the game crashes because fov is 0 on
|
||||
//! the first frame, which causes a floating point divide by 0
|
||||
fov = 90.0f;
|
||||
|
||||
+8
-31
@@ -15,6 +15,7 @@
|
||||
#include "sound_init.h"
|
||||
#include "rumble_init.h"
|
||||
#include "puppyprint.h"
|
||||
#include "profiling.h"
|
||||
|
||||
#define MUSIC_NONE 0xFFFF
|
||||
|
||||
@@ -341,10 +342,6 @@ void thread4_sound(UNUSED void *arg) {
|
||||
audio_init();
|
||||
sound_init();
|
||||
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime lastTime;
|
||||
#endif
|
||||
|
||||
osCreateMesgQueue(&sSoundMesgQueue, sSoundMesgBuf, ARRAY_COUNT(sSoundMesgBuf));
|
||||
set_vblank_handler(1, &sSoundVblankHandler, &sSoundMesgQueue, (OSMesg) 512);
|
||||
|
||||
@@ -352,34 +349,14 @@ void thread4_sound(UNUSED void *arg) {
|
||||
OSMesg msg;
|
||||
|
||||
osRecvMesg(&sSoundMesgQueue, &msg, OS_MESG_BLOCK);
|
||||
#if PUPPYPRINT_DEBUG
|
||||
while (TRUE) {
|
||||
lastTime = osGetTime();
|
||||
dmaAudioTime[perfIteration] = 0;
|
||||
#endif
|
||||
if (gResetTimer < 25) {
|
||||
struct SPTask *spTask;
|
||||
spTask = create_next_audio_frame_task();
|
||||
if (spTask != NULL) {
|
||||
dispatch_audio_sptask(spTask);
|
||||
}
|
||||
#if PUPPYPRINT_DEBUG
|
||||
profiler_update(audioTime, lastTime);
|
||||
audioTime[perfIteration] -= dmaAudioTime[perfIteration];
|
||||
if (benchmarkLoop > 0 && benchOption == 1) {
|
||||
benchmarkLoop--;
|
||||
benchMark[benchmarkLoop] = osGetTime() - lastTime;
|
||||
if (benchmarkLoop == 0) {
|
||||
puppyprint_profiler_finished();
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
profiler_audio_started();
|
||||
if (gResetTimer < 25) {
|
||||
struct SPTask *spTask;
|
||||
spTask = create_next_audio_frame_task();
|
||||
if (spTask != NULL) {
|
||||
dispatch_audio_sptask(spTask);
|
||||
}
|
||||
#if PUPPYPRINT_DEBUG
|
||||
}
|
||||
#endif
|
||||
profiler_audio_completed();
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
#include "version.h"
|
||||
#include "src/game/version_data.h"
|
||||
|
||||
#if 0 // if your PC username isn't your real name feel free to uncomment
|
||||
char __username__[] = __USERNAME__;
|
||||
char __datetime__[] = __DATETIME__;
|
||||
#endif
|
||||
char __compiler__[] = __COMPILER__;
|
||||
char __linker__[] = __LINKER__;
|
||||
+2
-1
@@ -1,8 +1,9 @@
|
||||
#ifndef VER_H
|
||||
#define VER_H
|
||||
|
||||
#if 0 // if your PC username isn't your real name feel free to uncomment
|
||||
extern char __username__[];
|
||||
extern char __datetime__[];
|
||||
#endif
|
||||
extern char __compiler__[];
|
||||
extern char __linker__[];
|
||||
|
||||
|
||||
+71
-163
@@ -122,7 +122,7 @@ unsigned char textEraseFileButton[] = { TEXT_ERASE_FILE_BUTTON };
|
||||
unsigned char textSoundModes[][8] = { { TEXT_STEREO }, { TEXT_MONO }, { TEXT_HEADSET } };
|
||||
|
||||
#if MULTILANG
|
||||
unsigned char textLanguageSelect[][17] = { { TEXT_LANGUAGE_SELECT }};
|
||||
unsigned char textLanguageSelect[][17] = { { TEXT_LANGUAGE_SELECT } };
|
||||
#endif
|
||||
|
||||
unsigned char textSoundSelect[] = { TEXT_SOUND_SELECT };
|
||||
@@ -463,38 +463,44 @@ static const Vec3s sSaveFileButtonPositions[] = {
|
||||
#define MENU_BUTTON_SCALE 0.11111111f
|
||||
|
||||
/**
|
||||
* Render buttons for the score menu.
|
||||
* Render buttons for the menu.
|
||||
* Also check if the save file exists to render a different Mario button.
|
||||
*/
|
||||
void render_score_menu_buttons(struct Object *scoreButton) {
|
||||
void render_menu_buttons(s32 selectedButtonID) {
|
||||
struct Object *button = sMainMenuButtons[selectedButtonID];
|
||||
// MENU_BUTTON_SCORE -> 7
|
||||
// MENU_BUTTON_COPY -> 14
|
||||
// MENU_BUTTON_ERASE -> 21
|
||||
s32 idx = (selectedButtonID - 3) * 7;
|
||||
|
||||
// File A
|
||||
sMainMenuButtons[MENU_BUTTON_SCORE_FILE_A] = SPAWN_FILE_SELECT_FILE_BUTTON(scoreButton, SAVE_FILE_A);
|
||||
sMainMenuButtons[MENU_BUTTON_SCORE_FILE_A]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
sMainMenuButtons[idx + 0] = SPAWN_FILE_SELECT_FILE_BUTTON(button, SAVE_FILE_A);
|
||||
sMainMenuButtons[idx + 0]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
// File B
|
||||
sMainMenuButtons[MENU_BUTTON_SCORE_FILE_B] = SPAWN_FILE_SELECT_FILE_BUTTON(scoreButton, SAVE_FILE_B);
|
||||
sMainMenuButtons[MENU_BUTTON_SCORE_FILE_B]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
sMainMenuButtons[idx + 1] = SPAWN_FILE_SELECT_FILE_BUTTON(button, SAVE_FILE_B);
|
||||
sMainMenuButtons[idx + 1]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
// File C
|
||||
sMainMenuButtons[MENU_BUTTON_SCORE_FILE_C] = SPAWN_FILE_SELECT_FILE_BUTTON(scoreButton, SAVE_FILE_C);
|
||||
sMainMenuButtons[MENU_BUTTON_SCORE_FILE_C]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
sMainMenuButtons[idx + 2] = SPAWN_FILE_SELECT_FILE_BUTTON(button, SAVE_FILE_C);
|
||||
sMainMenuButtons[idx + 2]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
// File D
|
||||
sMainMenuButtons[MENU_BUTTON_SCORE_FILE_D] = SPAWN_FILE_SELECT_FILE_BUTTON(scoreButton, SAVE_FILE_D);
|
||||
sMainMenuButtons[MENU_BUTTON_SCORE_FILE_D]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
sMainMenuButtons[idx + 3] = SPAWN_FILE_SELECT_FILE_BUTTON(button, SAVE_FILE_D);
|
||||
sMainMenuButtons[idx + 3]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
|
||||
// Return to main menu button
|
||||
sMainMenuButtons[MENU_BUTTON_SCORE_RETURN] =
|
||||
spawn_object_rel_with_rot(scoreButton, MODEL_MAIN_MENU_YELLOW_FILE_BUTTON,
|
||||
sMainMenuButtons[idx + 4] =
|
||||
spawn_object_rel_with_rot(button, MODEL_MAIN_MENU_YELLOW_FILE_BUTTON,
|
||||
bhvMenuButton, 711, -388, -100, 0x0, -0x8000, 0x0);
|
||||
sMainMenuButtons[MENU_BUTTON_SCORE_RETURN]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
sMainMenuButtons[idx + 4]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
// Switch to copy menu button
|
||||
sMainMenuButtons[MENU_BUTTON_SCORE_COPY_FILE] =
|
||||
spawn_object_rel_with_rot(scoreButton, MODEL_MAIN_MENU_BLUE_COPY_BUTTON,
|
||||
sMainMenuButtons[idx + 5] =
|
||||
spawn_object_rel_with_rot(button, selectedButtonID == MENU_BUTTON_SCORE ? MODEL_MAIN_MENU_BLUE_COPY_BUTTON : MODEL_MAIN_MENU_GREEN_SCORE_BUTTON,
|
||||
bhvMenuButton, 0, -388, -100, 0x0, -0x8000, 0x0);
|
||||
sMainMenuButtons[MENU_BUTTON_SCORE_COPY_FILE]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
sMainMenuButtons[idx + 5]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
// Switch to erase menu button
|
||||
sMainMenuButtons[MENU_BUTTON_SCORE_ERASE_FILE] =
|
||||
spawn_object_rel_with_rot(scoreButton, MODEL_MAIN_MENU_RED_ERASE_BUTTON,
|
||||
sMainMenuButtons[idx + 6] =
|
||||
spawn_object_rel_with_rot(button, selectedButtonID == MENU_BUTTON_ERASE ? MODEL_MAIN_MENU_BLUE_COPY_BUTTON : MODEL_MAIN_MENU_RED_ERASE_BUTTON,
|
||||
bhvMenuButton, -711, -388, -100, 0x0, -0x8000, 0x0);
|
||||
sMainMenuButtons[MENU_BUTTON_SCORE_ERASE_FILE]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
sMainMenuButtons[idx + 6]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
}
|
||||
|
||||
#define SCORE_TIMER 31
|
||||
@@ -555,40 +561,6 @@ void check_score_menu_clicked_buttons(struct Object *scoreButton) {
|
||||
|
||||
#undef SCORE_TIMER
|
||||
|
||||
/**
|
||||
* Render buttons for the copy menu.
|
||||
* Also check if the save file exists to render a different Mario button.
|
||||
*/
|
||||
void render_copy_menu_buttons(struct Object *copyButton) {
|
||||
// File A
|
||||
sMainMenuButtons[MENU_BUTTON_COPY_FILE_A] = SPAWN_FILE_SELECT_FILE_BUTTON(copyButton, SAVE_FILE_A);
|
||||
sMainMenuButtons[MENU_BUTTON_COPY_FILE_A]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
// File B
|
||||
sMainMenuButtons[MENU_BUTTON_COPY_FILE_B] = SPAWN_FILE_SELECT_FILE_BUTTON(copyButton, SAVE_FILE_B);
|
||||
sMainMenuButtons[MENU_BUTTON_COPY_FILE_B]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
// File C
|
||||
sMainMenuButtons[MENU_BUTTON_COPY_FILE_C] = SPAWN_FILE_SELECT_FILE_BUTTON(copyButton, SAVE_FILE_C);
|
||||
sMainMenuButtons[MENU_BUTTON_COPY_FILE_C]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
// File D
|
||||
sMainMenuButtons[MENU_BUTTON_COPY_FILE_D] = SPAWN_FILE_SELECT_FILE_BUTTON(copyButton, SAVE_FILE_D);
|
||||
sMainMenuButtons[MENU_BUTTON_COPY_FILE_D]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
// Return to main menu button
|
||||
sMainMenuButtons[MENU_BUTTON_COPY_RETURN] =
|
||||
spawn_object_rel_with_rot(copyButton, MODEL_MAIN_MENU_YELLOW_FILE_BUTTON,
|
||||
bhvMenuButton, 711, -388, -100, 0x0, -0x8000, 0x0);
|
||||
sMainMenuButtons[MENU_BUTTON_COPY_RETURN]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
// Switch to scire menu button
|
||||
sMainMenuButtons[MENU_BUTTON_COPY_CHECK_SCORE] =
|
||||
spawn_object_rel_with_rot(copyButton, MODEL_MAIN_MENU_GREEN_SCORE_BUTTON,
|
||||
bhvMenuButton, 0, -388, -100, 0x0, -0x8000, 0x0);
|
||||
sMainMenuButtons[MENU_BUTTON_COPY_CHECK_SCORE]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
// Switch to erase menu button
|
||||
sMainMenuButtons[MENU_BUTTON_COPY_ERASE_FILE] =
|
||||
spawn_object_rel_with_rot(copyButton, MODEL_MAIN_MENU_RED_ERASE_BUTTON,
|
||||
bhvMenuButton, -711, -388, -100, 0x0, -0x8000, 0x0);
|
||||
sMainMenuButtons[MENU_BUTTON_COPY_ERASE_FILE]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
}
|
||||
|
||||
#define BUZZ_TIMER 21
|
||||
|
||||
/**
|
||||
@@ -709,40 +681,6 @@ void check_copy_menu_clicked_buttons(struct Object *copyButton) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render buttons for the erase menu.
|
||||
* Also check if the save file exists to render a different Mario button.
|
||||
*/
|
||||
void render_erase_menu_buttons(struct Object *eraseButton) {
|
||||
// File A
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE_FILE_A] = SPAWN_FILE_SELECT_FILE_BUTTON(eraseButton, SAVE_FILE_A);
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE_FILE_A]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
// File B
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE_FILE_B] = SPAWN_FILE_SELECT_FILE_BUTTON(eraseButton, SAVE_FILE_B);
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE_FILE_B]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
// File C
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE_FILE_C] = SPAWN_FILE_SELECT_FILE_BUTTON(eraseButton, SAVE_FILE_C);
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE_FILE_C]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
// File D
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE_FILE_D] = SPAWN_FILE_SELECT_FILE_BUTTON(eraseButton, SAVE_FILE_D);
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE_FILE_D]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
// Return to main menu button
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE_RETURN] =
|
||||
spawn_object_rel_with_rot(eraseButton, MODEL_MAIN_MENU_YELLOW_FILE_BUTTON,
|
||||
bhvMenuButton, 711, -388, -100, 0x0, -0x8000, 0x0);
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE_RETURN]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
// Switch to score menu button
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE_CHECK_SCORE] =
|
||||
spawn_object_rel_with_rot(eraseButton, MODEL_MAIN_MENU_GREEN_SCORE_BUTTON,
|
||||
bhvMenuButton, 0, -388, -100, 0x0, -0x8000, 0x0);
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE_CHECK_SCORE]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
// Switch to copy menu button
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE_COPY_FILE] =
|
||||
spawn_object_rel_with_rot(eraseButton, MODEL_MAIN_MENU_BLUE_COPY_BUTTON,
|
||||
bhvMenuButton, -711, -388, -100, 0x0, -0x8000, 0x0);
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE_COPY_FILE]->oMenuButtonScale = MENU_BUTTON_SCALE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Erase Menu phase actions that handles what to do when a file button is clicked.
|
||||
*/
|
||||
@@ -1029,7 +967,7 @@ void load_menu_from_submenu(s16 prevMenuButtonID, s16 selectedButtonID, struct O
|
||||
sSelectedButtonID = selectedButtonID;
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
sMainMenuButtons[selectedButtonID]->oMenuButtonState = MENU_BUTTON_STATE_GROWING;
|
||||
render_score_menu_buttons(sMainMenuButtons[selectedButtonID]);
|
||||
render_menu_buttons(selectedButtonID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1114,89 +1052,59 @@ void bhv_menu_button_manager_init(void) {
|
||||
* Also play a sound and/or render buttons depending of the button ID selected.
|
||||
*/
|
||||
void check_main_menu_clicked_buttons(void) {
|
||||
// Sound mode menu is handled separately because the button ID for it
|
||||
// is not grouped with the IDs of the other submenus.
|
||||
if (check_clicked_button(sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oPosX,
|
||||
sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oPosY, 200.0f)) {
|
||||
sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oMenuButtonState = MENU_BUTTON_STATE_GROWING;
|
||||
sSelectedButtonID = MENU_BUTTON_SOUND_MODE;
|
||||
} else {
|
||||
// Main Menu buttons
|
||||
s8 buttonID;
|
||||
// Configure Main Menu button group
|
||||
for (buttonID = MENU_BUTTON_MAIN_MIN; buttonID < MENU_BUTTON_MAIN_MAX; buttonID++) {
|
||||
s16 buttonX = sMainMenuButtons[buttonID]->oPosX;
|
||||
s16 buttonY = sMainMenuButtons[buttonID]->oPosY;
|
||||
// Sound mode menu is handled separately because the button ID for it
|
||||
// is not grouped with the IDs of the other submenus.
|
||||
if (check_clicked_button(sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oPosX,
|
||||
sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oPosY, 200.0f)) {
|
||||
sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oMenuButtonState = MENU_BUTTON_STATE_GROWING;
|
||||
sSelectedButtonID = MENU_BUTTON_SOUND_MODE;
|
||||
} else {
|
||||
// Main Menu buttons
|
||||
s8 buttonID;
|
||||
// Configure Main Menu button group
|
||||
for (buttonID = MENU_BUTTON_MAIN_MIN; buttonID < MENU_BUTTON_MAIN_MAX; buttonID++) {
|
||||
s16 buttonX = sMainMenuButtons[buttonID]->oPosX;
|
||||
s16 buttonY = sMainMenuButtons[buttonID]->oPosY;
|
||||
|
||||
if (check_clicked_button(buttonX, buttonY, 200.0f)) {
|
||||
// If menu button clicked, select it
|
||||
sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_GROWING;
|
||||
sSelectedButtonID = buttonID;
|
||||
break;
|
||||
}
|
||||
if (check_clicked_button(buttonX, buttonY, 200.0f)) {
|
||||
// If menu button clicked, select it
|
||||
sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_GROWING;
|
||||
sSelectedButtonID = buttonID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Play sound of the save file clicked
|
||||
switch (sSelectedButtonID) {
|
||||
case MENU_BUTTON_PLAY_FILE_A:
|
||||
play_sound(SAVE_FILE_SOUND, gGlobalSoundSource);
|
||||
// Play sound of the save file clicked
|
||||
switch (sSelectedButtonID) {
|
||||
case MENU_BUTTON_PLAY_FILE_A:
|
||||
case MENU_BUTTON_PLAY_FILE_B:
|
||||
case MENU_BUTTON_PLAY_FILE_C:
|
||||
case MENU_BUTTON_PLAY_FILE_D:
|
||||
play_sound(SAVE_FILE_SOUND, gGlobalSoundSource);
|
||||
#if ENABLE_RUMBLE
|
||||
queue_rumble_data(60, 70);
|
||||
queue_rumble_decay(1);
|
||||
queue_rumble_data(60, 70);
|
||||
queue_rumble_decay(1);
|
||||
#endif
|
||||
break;
|
||||
case MENU_BUTTON_PLAY_FILE_B:
|
||||
play_sound(SAVE_FILE_SOUND, gGlobalSoundSource);
|
||||
break;
|
||||
// Play sound of the button clicked and render buttons of that menu.
|
||||
case MENU_BUTTON_SCORE:
|
||||
case MENU_BUTTON_COPY:
|
||||
case MENU_BUTTON_ERASE:
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
#if ENABLE_RUMBLE
|
||||
queue_rumble_data(60, 70);
|
||||
queue_rumble_decay(1);
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
break;
|
||||
case MENU_BUTTON_PLAY_FILE_C:
|
||||
play_sound(SAVE_FILE_SOUND, gGlobalSoundSource);
|
||||
render_menu_buttons(sSelectedButtonID);
|
||||
break;
|
||||
case MENU_BUTTON_SOUND_MODE:
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
#if ENABLE_RUMBLE
|
||||
queue_rumble_data(60, 70);
|
||||
queue_rumble_decay(1);
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
break;
|
||||
case MENU_BUTTON_PLAY_FILE_D:
|
||||
play_sound(SAVE_FILE_SOUND, gGlobalSoundSource);
|
||||
#if ENABLE_RUMBLE
|
||||
queue_rumble_data(60, 70);
|
||||
queue_rumble_decay(1);
|
||||
#endif
|
||||
break;
|
||||
// Play sound of the button clicked and render buttons of that menu.
|
||||
case MENU_BUTTON_SCORE:
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
#if ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
render_score_menu_buttons(sMainMenuButtons[MENU_BUTTON_SCORE]);
|
||||
break;
|
||||
case MENU_BUTTON_COPY:
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
#if ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
render_copy_menu_buttons(sMainMenuButtons[MENU_BUTTON_COPY]);
|
||||
break;
|
||||
case MENU_BUTTON_ERASE:
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
#if ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
render_erase_menu_buttons(sMainMenuButtons[MENU_BUTTON_ERASE]);
|
||||
break;
|
||||
case MENU_BUTTON_SOUND_MODE:
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
#if ENABLE_RUMBLE
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
render_sound_mode_menu_buttons(sMainMenuButtons[MENU_BUTTON_SOUND_MODE]);
|
||||
break;
|
||||
}
|
||||
render_sound_mode_menu_buttons(sMainMenuButtons[MENU_BUTTON_SOUND_MODE]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#undef SAVE_FILE_SOUND
|
||||
@@ -1880,7 +1788,7 @@ void print_sound_mode_menu_strings(void) {
|
||||
|
||||
print_hud_lut_string(HUD_LUT_DIFF, SOUND_HUD_X, 32, LANGUAGE_ARRAY(textSoundSelect));
|
||||
#if MULTILANG
|
||||
print_hud_lut_string(HUD_LUT_DIFF, 47, 101, LANGUAGE_ARRAY(textLanguageSelect));
|
||||
print_hud_lut_string(HUD_LUT_DIFF, 47, 101, LANGUAGE_ARRAY(textLanguageSelect[0]));
|
||||
#endif
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end);
|
||||
|
||||
@@ -313,6 +313,7 @@ void print_act_selector_strings(void) {
|
||||
|
||||
#if MULTILANG
|
||||
switch (language) {
|
||||
default:
|
||||
case LANGUAGE_ENGLISH:
|
||||
actNameTbl = segmented_to_virtual(act_name_table_eu_en);
|
||||
levelNameTbl = segmented_to_virtual(course_name_table_eu_en);
|
||||
|
||||
@@ -8243,7 +8243,7 @@ File *File::open(const char *path, File::AccessMode mode)
|
||||
flags = O_RDONLY;
|
||||
else if (mode == WriteAccess)
|
||||
flags = O_CREAT | O_WRONLY | O_TRUNC;
|
||||
#if defined(WIN32) || defined(__CYGWIN__)
|
||||
#if defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
|
||||
flags |= O_BINARY;
|
||||
#endif
|
||||
int fd = ::open(path, flags, 0666);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
echo "#ifndef VER_DATA_H"
|
||||
echo "#define VER_DATA_H"
|
||||
echo "#define __USERNAME__ \"`whoami`@`hostname`\""
|
||||
echo "#define __DATETIME__ \"`date`\""
|
||||
echo "#define __COMPILER__ \"$1gcc version `$1gcc -dumpfullversion`\""
|
||||
echo "#define __LINKER__ \"$1ld: `$1ld -v`\""
|
||||
echo "#endif"
|
||||
Reference in new issue
Block a user