You've already forked HackerSM64
mirror of
https://github.com/HackerN64/HackerSM64.git
synced 2026-01-21 10:35:32 -08:00
Compare commits
47 Commits
develop/2.
...
v2.0.9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6d83b3291 | ||
|
|
9717d89fb8 | ||
|
|
38e9b08695 | ||
|
|
312496d769 | ||
|
|
d68233a1c0 | ||
|
|
7ef2077353 | ||
|
|
a15db3c56b | ||
|
|
e87dfa74d8 | ||
|
|
e3e1aa02ac | ||
|
|
d3d2bb9247 | ||
|
|
dc1a824ce9 | ||
|
|
efd4e3f9dc | ||
|
|
b1146308a7 | ||
|
|
b8e22f2fbd | ||
|
|
1a71619f47 | ||
|
|
7d6579971a | ||
|
|
a549e1a95a | ||
|
|
83fea6d310 | ||
|
|
8698cc0f89 | ||
|
|
62d6ee135f | ||
|
|
3d330e0b84 | ||
|
|
1691e48326 | ||
|
|
e5af0e8ca5 | ||
|
|
cf570b4406 | ||
|
|
1012fb7957 | ||
|
|
aa1a48afeb | ||
|
|
5e1258e806 | ||
|
|
c938bbf407 | ||
|
|
a1ab7c51f0 | ||
|
|
4cfbc656a9 | ||
|
|
fe6aee22e1 | ||
|
|
ad3aa42eff | ||
|
|
031cc24fa6 | ||
|
|
8d06db06e1 | ||
|
|
642a85fec6 | ||
|
|
3092929822 | ||
|
|
51f8ccfbb0 | ||
|
|
2118234f9b | ||
|
|
ac0299e5b5 | ||
|
|
f98d43c9de | ||
|
|
bf8ea238e5 | ||
|
|
b3cb639e6e | ||
|
|
12595397cd | ||
|
|
65eb5a755f | ||
|
|
eaf9d3e4f9 | ||
|
|
3f0143ec0f | ||
|
|
ad91c636ad |
2126
.gitignore
vendored
2126
.gitignore
vendored
File diff suppressed because it is too large
Load Diff
2
.vscode/c_cpp_properties.json
vendored
2
.vscode/c_cpp_properties.json
vendored
@@ -33,7 +33,7 @@
|
||||
"compilerPath": "/usr/bin/mips-linux-gnu-gcc",
|
||||
"cStandard": "gnu17",
|
||||
"cppStandard": "gnu++14",
|
||||
"intelliSenseMode": "linux-gcc-x64"
|
||||
"intelliSenseMode": "linux-gcc-x86"
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# These owners will be the default owners for everything in the repo.
|
||||
* @Reonu
|
||||
* @thecozies
|
||||
* @Mr-Wiseguy
|
||||
* @gheskett
|
||||
|
||||
# Order is important. The last matching pattern has the most precedence.
|
||||
# So if a pull request only touches javascript files, only these owners
|
||||
|
||||
29
Makefile
29
Makefile
@@ -135,10 +135,14 @@ LINK_LIBRARIES = $(foreach i,$(LIBRARIES),-l$(i))
|
||||
|
||||
# Default non-gcc opt flags
|
||||
DEFAULT_OPT_FLAGS = -Ofast
|
||||
# Note: -fno-associative-math is used here to suppress warnings, ideally we would enable this as an optimization but
|
||||
# this conflicts with -ftrapping-math apparently.
|
||||
# TODO: Figure out how to allow -fassociative-math to be enabled
|
||||
SAFETY_OPT_FLAGS = -ftrapping-math -fno-associative-math
|
||||
|
||||
# Main opt flags
|
||||
GCC_MAIN_OPT_FLAGS = \
|
||||
-Ofast \
|
||||
$(DEFAULT_OPT_FLAGS) $(SAFETY_OPT_FLAGS) \
|
||||
--param case-values-threshold=20 \
|
||||
--param max-completely-peeled-insns=10 \
|
||||
--param max-unrolled-insns=10 \
|
||||
@@ -149,7 +153,7 @@ GCC_MAIN_OPT_FLAGS = \
|
||||
|
||||
# Surface Collision
|
||||
GCC_COLLISION_OPT_FLAGS = \
|
||||
-Ofast \
|
||||
$(DEFAULT_OPT_FLAGS) $(SAFETY_OPT_FLAGS) \
|
||||
--param case-values-threshold=20 \
|
||||
--param max-completely-peeled-insns=100 \
|
||||
--param max-unrolled-insns=100 \
|
||||
@@ -162,7 +166,7 @@ GCC_COLLISION_OPT_FLAGS = \
|
||||
|
||||
# Math Util
|
||||
GCC_MATH_UTIL_OPT_FLAGS = \
|
||||
-Ofast \
|
||||
$(DEFAULT_OPT_FLAGS) $(SAFETY_OPT_FLAGS) \
|
||||
-fno-unroll-loops \
|
||||
-fno-peel-loops \
|
||||
--param case-values-threshold=20 \
|
||||
@@ -174,7 +178,7 @@ GCC_MATH_UTIL_OPT_FLAGS = \
|
||||
|
||||
# Rendering graph node
|
||||
GCC_GRAPH_NODE_OPT_FLAGS = \
|
||||
-Ofast \
|
||||
$(DEFAULT_OPT_FLAGS) $(SAFETY_OPT_FLAGS) \
|
||||
--param case-values-threshold=20 \
|
||||
--param max-completely-peeled-insns=100 \
|
||||
--param max-unrolled-insns=100 \
|
||||
@@ -630,7 +634,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)
|
||||
@@ -688,9 +693,11 @@ $(BUILD_DIR)/%.ci4.inc.c: %.ci4.png
|
||||
$(BUILD_DIR)/%.elf: $(BUILD_DIR)/%.o
|
||||
$(call print,Linking ELF file:,$<,$@)
|
||||
$(V)$(LD) -e 0 -Ttext=$(SEGMENT_ADDRESS) -Map $@.map -o $@ $<
|
||||
# Override for leveldata.elf, which otherwise matches the above pattern
|
||||
# Override for leveldata.elf, which otherwise matches the above pattern.
|
||||
# Has to be a static pattern rule for make-4.4 and above to trigger the second
|
||||
# expansion.
|
||||
.SECONDEXPANSION:
|
||||
$(BUILD_DIR)/levels/%/leveldata.elf: $(BUILD_DIR)/levels/%/leveldata.o $(BUILD_DIR)/bin/$$(TEXTURE_BIN).elf
|
||||
$(LEVEL_ELF_FILES): $(BUILD_DIR)/levels/%/leveldata.elf: $(BUILD_DIR)/levels/%/leveldata.o $(BUILD_DIR)/bin/$$(TEXTURE_BIN).elf
|
||||
$(call print,Linking ELF file:,$<,$@)
|
||||
$(V)$(LD) -e 0 -Ttext=$(SEGMENT_ADDRESS) -Map $@.map --just-symbols=$(BUILD_DIR)/bin/$(TEXTURE_BIN).elf -o $@ $<
|
||||
|
||||
@@ -869,8 +876,16 @@ $(ELF): $(BUILD_DIR)/sm64_prelim.elf $(BUILD_DIR)/asm/debug/map.o $(O_FILES) $(Y
|
||||
$(V)$(LD) --gc-sections -L $(BUILD_DIR) -T undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -T goddard.txt -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(addprefix -R ,$(SEG_FILES)) -o $@ $(O_FILES) -L$(LIBS_DIR) -l$(ULTRALIB) -Llib $(LINK_LIBRARIES) -u sprintf -u osMapTLB -Llib/gcclib/$(LIBGCCDIR) -lgcc -lrtc
|
||||
|
||||
# Build ROM
|
||||
ifeq (n,$(findstring n,$(firstword -$(MAKEFLAGS))))
|
||||
# run with -n / --dry-run
|
||||
$(ROM):
|
||||
@$(PRINT) "$(BLUE)DRY RUNS ARE DISABLED$(NO_COL)\n"
|
||||
else
|
||||
# not running with -n / --dry-run
|
||||
$(ROM): $(ELF)
|
||||
$(call print,Building ROM:,$<,$@)
|
||||
endif
|
||||
|
||||
ifeq ($(CONSOLE),n64)
|
||||
$(V)$(OBJCOPY) --pad-to=0x101000 --gap-fill=0xFF $< $@ -O binary
|
||||
else ifeq ($(CONSOLE),bb)
|
||||
|
||||
@@ -39,6 +39,8 @@ ACTOR_GROUPS := \
|
||||
|
||||
LEVEL_FILES := $(addsuffix leveldata,$(LEVEL_DIRS))
|
||||
|
||||
LEVEL_ELF_FILES := $(foreach level_dir,$(LEVEL_DIRS),$(BUILD_DIR)/levels/$(level_dir)leveldata.elf)
|
||||
|
||||
SEG_FILES := \
|
||||
$(SEGMENTS:%=$(BUILD_DIR)/bin/%.elf) \
|
||||
$(ACTOR_GROUPS:%=$(BUILD_DIR)/actors/%.elf) \
|
||||
|
||||
@@ -14,7 +14,7 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin
|
||||
- **ArcticJaguar725**: Most audio configuration and layout changes, colored ia4 text, floombas, various bugfixes, and more
|
||||
- **CowQuack**: Adjustable skybox sizes, area-specific skybox function
|
||||
- **thecozies**: Water surface types, general maintenance, and time
|
||||
- **MrComit**: General use object defines, JUMP_KICK_FIX, LEDGE_GRABS_CHECK_SLOPE_ANGLE
|
||||
- **MrComit**: General use object defines, JUMP_KICK_FIX
|
||||
- **aglab2**: Bugfixes (particularly puppycam), refactor stuff
|
||||
- **someone2639**: math.s and crash screen disam, stack trace, map packing, shiftable segments 2, S2DEX engine
|
||||
- **Arthurtilly**: Platform Displacement 2
|
||||
@@ -34,7 +34,7 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin
|
||||
Thanks to Frame#5375 and AloXado320 for also helping with silhouette stuff
|
||||
|
||||
**Lighting Engine by Wiseguy**
|
||||
- Lighting Engine is available on a separate branch ([base/lighting-engine-wip](https://github.com/Reonu/HackerSM64/tree/base/lighting-engine-wip)). Instructions on how to use it are in the readme of that branch.
|
||||
- Lighting Engine is available on a separate branch ([base/lighting-engine](https://github.com/Reonu/HackerSM64/tree/base/lighting-engine)). Instructions on how to use it are in the readme of that branch.
|
||||
- Alternatively, the main repo has `Puppylights` available, which is a more lightweight, but limited lighting library intended to be used to modify existing light properties. You can look at `puppylights.c` to find out how to use it.
|
||||
|
||||
**Puppycam**
|
||||
@@ -61,7 +61,6 @@ Thanks to Frame#5375 and AloXado320 for also helping with silhouette stuff
|
||||
- Toggle to disable fall damage and the fall damage sound *
|
||||
- Nonstop stars *
|
||||
- Removed course-specific camera processing *
|
||||
- You can increase the number of frames that you have to perform a firsty *
|
||||
- Ability to set Mario's movement speed when hanging from a ceiling *
|
||||
- Tighter hanging controls (Mario will face the direction of the analog stick directly while hanging from a ceiling) *
|
||||
- reonucam3: custom camera by Reonu. This is included as a .patch file in the enhancements folder, you need to apply it if you want this camera.
|
||||
|
||||
@@ -1 +1 @@
|
||||
v2.0.1
|
||||
v2.0.9
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
// 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.
|
||||
|
||||
@@ -68,14 +68,11 @@
|
||||
// Allows Mario to grab hangable ceilings from any state.
|
||||
#define HANGING_FIX
|
||||
|
||||
// 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 it to allow ledge grabbing regardless of floor pitch.
|
||||
// #define LEDGE_GRABS_CHECK_SLOPE_ANGLE
|
||||
// Makes Mario unable to ledge grab steep slopes to prevent false ledge grabs.
|
||||
#define DONT_LEDGE_GRAB_STEEP_SLOPES
|
||||
|
||||
// Disables BLJs and crushes SimpleFlips's dreams.
|
||||
// #define DISABLE_BLJ
|
||||
|
||||
@@ -40,9 +40,8 @@
|
||||
|
||||
// -- WATER RING --
|
||||
|
||||
// Fix DDD water rings by checking for interaction rather than normals.
|
||||
//! NOT IMPLEMENTED
|
||||
// #define FIX_WATER_RINGS
|
||||
// Fix the water rings in DDD by checking for interaction rather than normals.
|
||||
#define FIX_WATER_RINGS
|
||||
|
||||
// -- POWER STAR --
|
||||
|
||||
|
||||
@@ -33,15 +33,21 @@
|
||||
* config_debug.h
|
||||
*/
|
||||
|
||||
#ifdef PUPPYPRINT_DEBUG
|
||||
#undef PUPPYPRINT
|
||||
#define PUPPYPRINT
|
||||
#endif // PUPPYPRINT_DEBUG
|
||||
|
||||
#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,20 +72,17 @@
|
||||
#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
|
||||
|
||||
|
||||
/*****************
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
/*---------------------------------------------------------------------
|
||||
Copyright (C) 1997, 1998 Nintendo.
|
||||
|
||||
File rtc.h
|
||||
Coded by Shigeo Kimura. Oct 14, 1997.
|
||||
Modified by Koji Mitsunari. Jan 22, 2001.
|
||||
Comments Real Time Clock Library
|
||||
---------------------------------------------------------------------*/
|
||||
#ifndef _rtc_h_
|
||||
#define _rtc_h_
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Macro & constant definitions
|
||||
*-----------------------------------------------------------------------*/
|
||||
/* Controller type */
|
||||
#define CONT_TYPE_RTC 0x1000 /* from os.h */
|
||||
#define RTC_WAIT 300
|
||||
|
||||
/* RTC status signed 32bits */
|
||||
#define RTC_NG_NOTHING 0x8000
|
||||
#define RTC_NG_WRITE 0x0100
|
||||
#define RTC_NG_ADDR 0x0200
|
||||
#define RTC_STATUS_BUSY 0x0080
|
||||
#define RTC_STATUS_DDOWN 0x0002
|
||||
#define RTC_STATUS_BDOWN 0x0001
|
||||
|
||||
/* RTC Error Code */
|
||||
#define CONT_ERR_RTC_BUSY 16
|
||||
#define CONT_ERR_RTC_BDOWN 17
|
||||
#define CONT_ERR_RTC_DDOWN 18
|
||||
#define CONT_ERR_RTC_BDDOWN 19
|
||||
|
||||
/* RTC bit status */
|
||||
#define RTC_EALM 0x80
|
||||
#define RTC_ALM 0x20
|
||||
#define RTC_WPB1 0x02
|
||||
#define RTC_WPB0 0x01
|
||||
#define RTC_MOD 0x04
|
||||
#define RTC_CHLD 0x02
|
||||
#define RTC_ADJ 0x01
|
||||
|
||||
#define RTC_ADDR_FLAG 0
|
||||
#define RTC_ADDR_RAM 1
|
||||
#define RTC_ADDR_TIME 2
|
||||
|
||||
typedef struct{
|
||||
u8 sec; /* second 0-59 */
|
||||
u8 min; /* minute 0-59 */
|
||||
u8 hour; /* hour 0-23 */
|
||||
u8 day; /* day 1-31 */
|
||||
u8 week; /* week 0-6(sun,mon,..,sat) */
|
||||
u8 month; /* month 1-12 */
|
||||
u16 year; /* year 1901-2099 */
|
||||
} OSRTCTime;
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* externs
|
||||
*-----------------------------------------------------------------------*/
|
||||
|
||||
extern s32 osRTCInit( OSMesgQueue *mq);
|
||||
extern s32 osRTCReadData( OSMesgQueue *mq, u8 *);
|
||||
extern s32 osRTCWriteData( OSMesgQueue *mq, u8 *);
|
||||
extern s32 osRTCGetTime( OSMesgQueue *mq, OSRTCTime *);
|
||||
extern s32 osRTCSetTime( OSMesgQueue *mq, OSRTCTime *);
|
||||
extern u32 osRTCGetIntervalTime(OSRTCTime *, OSRTCTime *);
|
||||
extern s32 osRTCGetLaterTime(OSMesgQueue *mq, u32, OSRTCTime *);
|
||||
extern s32 osRTCSetAlarm( OSMesgQueue *mq, u8, u8);
|
||||
extern s32 osRTCGetAlarmStat(OSMesgQueue *mq, u8 *, u8 *, int *);
|
||||
extern s32 osRTCProbe( OSMesgQueue *mq);
|
||||
|
||||
#endif /* _rtc_h_ */
|
||||
@@ -244,7 +244,7 @@ enum SurfaceTypes {
|
||||
|
||||
enum SurfaceClass {
|
||||
SURFACE_CLASS_DEFAULT,
|
||||
SURFACE_CLASS_VERY_SLIPPERY = 0x0013,
|
||||
SURFACE_CLASS_VERY_SLIPPERY,
|
||||
SURFACE_CLASS_SLIPPERY,
|
||||
SURFACE_CLASS_NOT_SLIPPERY
|
||||
};
|
||||
|
||||
@@ -98,12 +98,6 @@ typedef s8 ObjAction8;
|
||||
typedef s32 ObjAction32;
|
||||
typedef s16 ColFlags;
|
||||
|
||||
// -- Angle --
|
||||
typedef s16 Angle;
|
||||
typedef u16 UAngle;
|
||||
typedef s32 Angle32;
|
||||
typedef Angle Vec3a[3];
|
||||
|
||||
// -- Collision --
|
||||
typedef ROOM_DATA_TYPE RoomData;
|
||||
typedef COLLISION_DATA_TYPE Collision; // Collision is by default an s16, but it's best to have it match the type of COLLISION_DATA_TYPE
|
||||
@@ -489,10 +483,10 @@ struct MarioState {
|
||||
Vec3f prevPos;
|
||||
f32 lateralSpeed;
|
||||
f32 moveSpeed;
|
||||
Angle movePitch;
|
||||
Angle moveYaw;
|
||||
Angle ceilYaw;
|
||||
Angle wallYaw;
|
||||
s16 movePitch;
|
||||
s16 moveYaw;
|
||||
s16 ceilYaw;
|
||||
s16 wallYaw;
|
||||
// -- HackerSM64 MarioState fields end --
|
||||
};
|
||||
|
||||
|
||||
@@ -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[] = {
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
@@ -274,7 +274,7 @@ void sound_alloc_pool_init(struct SoundAllocPool *pool, void *memAddr, u32 size)
|
||||
#ifdef VERSION_SH
|
||||
pool->size = size - ((uintptr_t) memAddr & 0xf);
|
||||
#else
|
||||
pool->size = size;
|
||||
pool->size = ALIGN16(size);
|
||||
#endif
|
||||
pool->numAllocatedEntries = 0;
|
||||
}
|
||||
@@ -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;
|
||||
@@ -408,6 +408,8 @@ void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg
|
||||
u32 leftAvail, rightAvail;
|
||||
#endif
|
||||
|
||||
size = ALIGN16(size);
|
||||
|
||||
#ifdef VERSION_SH
|
||||
switch (poolIdx) {
|
||||
case 0:
|
||||
@@ -656,7 +658,7 @@ void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg
|
||||
#if defined(VERSION_SH)
|
||||
tp->entries[1].ptr = (u8 *) ((uintptr_t) (pool->start + pool->size - size) & ~0x0f);
|
||||
#else
|
||||
tp->entries[1].ptr = pool->start + pool->size - size - 0x10;
|
||||
tp->entries[1].ptr = pool->start + pool->size - size;
|
||||
#endif
|
||||
tp->entries[1].id = id;
|
||||
tp->entries[1].size = size;
|
||||
@@ -758,7 +760,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 +933,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:
|
||||
@@ -967,22 +969,6 @@ s32 audio_shut_down_and_reset_step(void) {
|
||||
}
|
||||
return (gAudioResetStatus < 3);
|
||||
}
|
||||
#else
|
||||
/**
|
||||
* Waits until a specified number of audio frames have been created
|
||||
*/
|
||||
void wait_for_audio_frames(s32 frames) {
|
||||
// VC emulator stubs this function because busy loops are not supported
|
||||
// Technically we can put infinite loop that _looks_ like -O0 for emu but this is cleaner
|
||||
//if (gIsVC) {
|
||||
return;
|
||||
//}
|
||||
gAudioFrameCount = 0;
|
||||
// Sound thread will update gAudioFrameCount
|
||||
while (gAudioFrameCount < frames) {
|
||||
// spin
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
u8 sAudioFirstBoot = 0;
|
||||
@@ -1007,7 +993,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;
|
||||
@@ -1167,22 +1153,33 @@ void init_reverb_us(s32 presetId) {
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
void audio_reset_session(struct AudioSessionSettings *preset, s32 presetId) {
|
||||
if (sAudioFirstBoot) {
|
||||
bzero(&gAiBuffers[0][0], (AIBUFFER_LEN * NUMAIBUFFERS));
|
||||
persistent_pool_clear(&gSeqLoadedPool.persistent);
|
||||
persistent_pool_clear(&gBankLoadedPool.persistent);
|
||||
temporary_pool_clear( &gSeqLoadedPool.temporary);
|
||||
temporary_pool_clear( &gBankLoadedPool.temporary);
|
||||
reset_bank_and_seq_load_status();
|
||||
if (gAudioLoadLock != AUDIO_LOCK_UNINITIALIZED) {
|
||||
gAudioLoadLock = AUDIO_LOCK_LOADING;
|
||||
|
||||
init_reverb_us(presetId);
|
||||
bzero(&gAiBuffers[0][0], (AIBUFFER_LEN * NUMAIBUFFERS));
|
||||
gAudioFrameCount = 0;
|
||||
if (!gIsVC) {
|
||||
while (gAudioFrameCount < 1) {
|
||||
// spin
|
||||
if (!gIsVC) {
|
||||
gAudioFrameCount = 0;
|
||||
while (gAudioFrameCount < 1) {
|
||||
// spin
|
||||
}
|
||||
}
|
||||
|
||||
for (s32 i = 0; i < gMaxSimultaneousNotes; i++) {
|
||||
gNotes[i].enabled = FALSE;
|
||||
}
|
||||
|
||||
persistent_pool_clear(&gSeqLoadedPool.persistent);
|
||||
persistent_pool_clear(&gBankLoadedPool.persistent);
|
||||
temporary_pool_clear( &gSeqLoadedPool.temporary);
|
||||
temporary_pool_clear( &gBankLoadedPool.temporary);
|
||||
reset_bank_and_seq_load_status();
|
||||
|
||||
init_reverb_us(presetId);
|
||||
bzero(&gAiBuffers[0][0], (AIBUFFER_LEN * NUMAIBUFFERS));
|
||||
|
||||
if (gAudioLoadLock != AUDIO_LOCK_UNINITIALIZED) {
|
||||
gAudioLoadLock = AUDIO_LOCK_NOT_LOADING;
|
||||
}
|
||||
}
|
||||
bzero(&gAiBuffers[0][0], (AIBUFFER_LEN * NUMAIBUFFERS));
|
||||
return;
|
||||
}
|
||||
#else
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user