You've already forked HackerSM64
mirror of
https://github.com/HackerN64/HackerSM64.git
synced 2026-01-21 10:35:32 -08:00
Compare commits
2 Commits
v2.0.9
...
develop/2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e113978834 | ||
|
|
37632f3954 |
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-x86"
|
||||
"intelliSenseMode": "linux-gcc-x64"
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# These owners will be the default owners for everything in the repo.
|
||||
* @Reonu
|
||||
* @thecozies
|
||||
* @gheskett
|
||||
* @Mr-Wiseguy
|
||||
|
||||
# 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,14 +135,10 @@ 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 = \
|
||||
$(DEFAULT_OPT_FLAGS) $(SAFETY_OPT_FLAGS) \
|
||||
-Ofast \
|
||||
--param case-values-threshold=20 \
|
||||
--param max-completely-peeled-insns=10 \
|
||||
--param max-unrolled-insns=10 \
|
||||
@@ -153,7 +149,7 @@ GCC_MAIN_OPT_FLAGS = \
|
||||
|
||||
# Surface Collision
|
||||
GCC_COLLISION_OPT_FLAGS = \
|
||||
$(DEFAULT_OPT_FLAGS) $(SAFETY_OPT_FLAGS) \
|
||||
-Ofast \
|
||||
--param case-values-threshold=20 \
|
||||
--param max-completely-peeled-insns=100 \
|
||||
--param max-unrolled-insns=100 \
|
||||
@@ -166,7 +162,7 @@ GCC_COLLISION_OPT_FLAGS = \
|
||||
|
||||
# Math Util
|
||||
GCC_MATH_UTIL_OPT_FLAGS = \
|
||||
$(DEFAULT_OPT_FLAGS) $(SAFETY_OPT_FLAGS) \
|
||||
-Ofast \
|
||||
-fno-unroll-loops \
|
||||
-fno-peel-loops \
|
||||
--param case-values-threshold=20 \
|
||||
@@ -178,7 +174,7 @@ GCC_MATH_UTIL_OPT_FLAGS = \
|
||||
|
||||
# Rendering graph node
|
||||
GCC_GRAPH_NODE_OPT_FLAGS = \
|
||||
$(DEFAULT_OPT_FLAGS) $(SAFETY_OPT_FLAGS) \
|
||||
-Ofast \
|
||||
--param case-values-threshold=20 \
|
||||
--param max-completely-peeled-insns=100 \
|
||||
--param max-unrolled-insns=100 \
|
||||
@@ -634,8 +630,7 @@ $(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/heap.o: OPT_FLAGS := -Os -fno-jump-tables
|
||||
$(BUILD_DIR)/src/audio/synthesis.o: OPT_FLAGS := -Os -fno-jump-tables
|
||||
$(BUILD_DIR)/src/audio/*.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)
|
||||
@@ -693,11 +688,9 @@ $(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.
|
||||
# Has to be a static pattern rule for make-4.4 and above to trigger the second
|
||||
# expansion.
|
||||
# Override for leveldata.elf, which otherwise matches the above pattern
|
||||
.SECONDEXPANSION:
|
||||
$(LEVEL_ELF_FILES): $(BUILD_DIR)/levels/%/leveldata.elf: $(BUILD_DIR)/levels/%/leveldata.o $(BUILD_DIR)/bin/$$(TEXTURE_BIN).elf
|
||||
$(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 $@ $<
|
||||
|
||||
@@ -876,16 +869,8 @@ $(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,8 +39,6 @@ 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
|
||||
- **MrComit**: General use object defines, JUMP_KICK_FIX, LEDGE_GRABS_CHECK_SLOPE_ANGLE
|
||||
- **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
|
||||
@@ -29,12 +29,11 @@ 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
|
||||
|
||||
**Lighting Engine by Wiseguy**
|
||||
- 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.
|
||||
- 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.
|
||||
- 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,6 +60,7 @@ 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.9
|
||||
v2.0.1
|
||||
|
||||
@@ -10,10 +10,6 @@
|
||||
// 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.
|
||||
|
||||
@@ -57,6 +57,11 @@
|
||||
// Use 64x64 quarter shadow textures (Vanilla are 16x16).
|
||||
#define HD_SHADOWS
|
||||
|
||||
// Stretches shadows to fit the terrain instead of rotating them to align with it.
|
||||
// This makes them maintain a constant horizontal size.
|
||||
// Performs better than regular shadows.
|
||||
// #define SHEAR_SHADOWS
|
||||
|
||||
// Makes certain objects (mainly trees) transparent when the camera gets close.
|
||||
// #define OBJ_OPACITY_BY_CAM_DIST
|
||||
|
||||
|
||||
@@ -68,11 +68,14 @@
|
||||
// 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
|
||||
|
||||
// Makes Mario unable to ledge grab steep slopes to prevent false ledge grabs.
|
||||
#define DONT_LEDGE_GRAB_STEEP_SLOPES
|
||||
// This is vanilla behavior, disable it to allow ledge grabbing regardless of floor pitch.
|
||||
// #define LEDGE_GRABS_CHECK_SLOPE_ANGLE
|
||||
|
||||
// Disables BLJs and crushes SimpleFlips's dreams.
|
||||
// #define DISABLE_BLJ
|
||||
|
||||
@@ -40,8 +40,9 @@
|
||||
|
||||
// -- WATER RING --
|
||||
|
||||
// Fix the water rings in DDD by checking for interaction rather than normals.
|
||||
#define FIX_WATER_RINGS
|
||||
// Fix DDD water rings by checking for interaction rather than normals.
|
||||
//! NOT IMPLEMENTED
|
||||
// #define FIX_WATER_RINGS
|
||||
|
||||
// -- POWER STAR --
|
||||
|
||||
|
||||
@@ -33,21 +33,15 @@
|
||||
* config_debug.h
|
||||
*/
|
||||
|
||||
#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
|
||||
#endif // PUPPYPRINT_DEBUG
|
||||
|
||||
#ifdef COMPLETE_SAVE_FILE
|
||||
#undef UNLOCK_ALL
|
||||
#undef COMPLETE_SAVE_FILE
|
||||
#undef DEBUG_FORCE_CRASH_ON_BOOT
|
||||
#undef USE_PROFILER
|
||||
#endif // DISABLE_ALL
|
||||
#define UNLOCK_ALL
|
||||
#endif // COMPLETE_SAVE_FILE
|
||||
|
||||
#ifdef DEBUG_ALL
|
||||
#undef DEBUG_LEVEL_SELECT
|
||||
@@ -72,17 +66,20 @@
|
||||
#define COMPLETE_SAVE_FILE
|
||||
#endif // DEBUG_ALL
|
||||
|
||||
#ifdef PUPPYPRINT_DEBUG
|
||||
#undef PUPPYPRINT
|
||||
#define PUPPYPRINT
|
||||
#undef USE_PROFILER
|
||||
#define USE_PROFILER
|
||||
#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
|
||||
#endif // DISABLE_ALL
|
||||
|
||||
|
||||
/*****************
|
||||
|
||||
@@ -310,9 +310,6 @@ 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), \
|
||||
|
||||
@@ -973,7 +973,11 @@
|
||||
#define /*0x104*/ oSnufitBodyScalePeriod OBJECT_FIELD_S32(0x1F)
|
||||
#define /*0x108*/ oSnufitBodyBaseScale OBJECT_FIELD_S32(0x20)
|
||||
#define /*0x10C*/ oSnufitBullets OBJECT_FIELD_S32(0x21)
|
||||
#define /*0x1AC*/ oSnufitBodyScale OBJECT_FIELD_S16(0x49, 0)
|
||||
#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)
|
||||
|
||||
/* Spindel */
|
||||
#define /*0x0F4*/ oSpindelMoveTimer OBJECT_FIELD_S32(0x1B)
|
||||
@@ -1043,6 +1047,7 @@
|
||||
#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)
|
||||
|
||||
71
include/rtc.h
Executable file
71
include/rtc.h
Executable file
@@ -0,0 +1,71 @@
|
||||
/*---------------------------------------------------------------------
|
||||
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,
|
||||
SURFACE_CLASS_VERY_SLIPPERY = 0x0013,
|
||||
SURFACE_CLASS_SLIPPERY,
|
||||
SURFACE_CLASS_NOT_SLIPPERY
|
||||
};
|
||||
|
||||
@@ -98,6 +98,12 @@ 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
|
||||
@@ -483,10 +489,10 @@ struct MarioState {
|
||||
Vec3f prevPos;
|
||||
f32 lateralSpeed;
|
||||
f32 moveSpeed;
|
||||
s16 movePitch;
|
||||
s16 moveYaw;
|
||||
s16 ceilYaw;
|
||||
s16 wallYaw;
|
||||
Angle movePitch;
|
||||
Angle moveYaw;
|
||||
Angle ceilYaw;
|
||||
Angle wallYaw;
|
||||
// -- HackerSM64 MarioState fields end --
|
||||
};
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#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"
|
||||
@@ -39,7 +38,6 @@ 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(ENABLE_RUMBLE)
|
||||
GEO_ZBUFFER(0),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_ASM(INTRO_CONTEXT_NORMAL, geo_intro_rumble_pak_graphic),
|
||||
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(),
|
||||
#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(ENABLE_RUMBLE)
|
||||
#if defined(VERSION_SH)
|
||||
GEO_ZBUFFER(0),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_ASM(INTRO_CONTEXT_GAME_OVER, geo_intro_rumble_pak_graphic),
|
||||
|
||||
@@ -343,12 +343,16 @@ 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;
|
||||
@@ -357,7 +361,8 @@ s32 adsr_update(struct AdsrState *adsr) {
|
||||
adsr->state = ADSR_STATE_HANG;
|
||||
break;
|
||||
}
|
||||
// fallthrough
|
||||
}
|
||||
// fallthrough
|
||||
|
||||
case ADSR_STATE_START_LOOP:
|
||||
adsr->envIndex = 0;
|
||||
@@ -365,12 +370,11 @@ 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) {
|
||||
@@ -395,23 +399,25 @@ 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;
|
||||
}
|
||||
#ifdef VERSION_SH
|
||||
#if defined(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 // !(VERSION_EU || VERSION_SH)
|
||||
#else
|
||||
adsr->target = BSWAP16(adsr->envelope[adsr->envIndex].arg);
|
||||
adsr->velocity = ((adsr->target - adsr->current) << 0x10) / adsr->delay;
|
||||
#endif // !(VERSION_EU || VERSION_SH)
|
||||
#endif
|
||||
adsr->state = ADSR_STATE_FADE;
|
||||
adsr->envIndex++;
|
||||
break;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user