Compare commits

...

47 Commits

Author SHA1 Message Date
Gregory Heskett
b6d83b3291 Merge pull request #624 from HackerN64/v2.0.9
Release/2.0.9
2023-05-10 19:24:01 -04:00
thecozies
9717d89fb8 v2.0.9 2023-05-09 17:19:16 -04:00
someone2639
38e9b08695 Fix builds on Make 4.4 (#588)
* Fix builds on Make 4.4

* oops

---------

Co-authored-by: someone2639 <someone2639@gmail.com>
2023-05-09 17:19:16 -04:00
thecozies
312496d769 copied new unf usb lib 2023-05-05 11:18:42 -05:00
thecozies
d68233a1c0 Aligned gfx buffers to 32 2023-05-05 11:16:57 -05:00
someone2639
7ef2077353 2.0.8 (fix more compiler warnings) (#543)
* fix Waddress in mario_step.c

* fix Winfinite-recursion in unused dynlist_proc function

* in fact remove the offending function entirely

* fix warnings in RNC decompress functions

* update version

* fix version in VERSION.txt

premature on my part, will update it to 2.0.10 next time

Co-authored-by: someone2639 <someone2639@gmail.com>
2022-12-06 21:41:55 +01:00
Reonu
a15db3c56b 2.0.7 (fix compiler warnings) (#542)
2.0.7
2022-12-05 16:28:01 +01:00
thecozies
e87dfa74d8 v2.0.7 2022-12-05 08:39:28 -06:00
thecozies
e3e1aa02ac Add GCC opt flag to suppress warnings 2022-12-05 08:38:41 -06:00
axollyon
d3d2bb9247 Update VERSION.txt
HackerSM64 2.0.6
2022-12-04 11:50:20 +01:00
Gregory Heskett
dc1a824ce9 HackerSM64 2.0.6 (#539)
* revert random_u16 to be a u16 (#538)

* Added safety gcc math flags (#537)

* removed useless compilation flags that could cause performance loss

Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>
Co-authored-by: thecozies <collinpferguson@gmail.com>
2022-12-04 23:05:59 +13:00
axollyon
efd4e3f9dc Update VERSION.txt (#534) 2022-11-24 02:46:09 +01:00
Gregory Heskett
b1146308a7 HackerSM64 2.0.5 (#517)
* Bugfix: race condition with accessing cleared audio memory pools

* Bugfix: skyboxes access tiles out of range when looking straight down (#518)

* Vscode fixes (#516)

* Revert s32 angles and remove Angle typedef usage (#529)

* Fix some surface shadowing (#531)

* Delete rtc.h

* Remove `wait_for_audio_frames()`

Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>
Co-authored-by: Arceveti <73617174+Arceveti@users.noreply.github.com>
Co-authored-by: JoshDuMan <40190173+JoshDuMan@users.noreply.github.com>
2022-11-24 09:57:44 +13:00
axollyon
b8e22f2fbd Update version to 2.0.4 (#515) 2022-10-27 01:17:08 -04:00
arthurtilly
1a71619f47 Imminent fixes for bugs found on master branch (#512)
* The vanilla level checks define for Yoshi is inverted, causing him to require 120 stars when it is off and appear at 0 stars when it's on

*  The downwarp fix results in Mario levitating in midair when grabbing Bowser midair. While downwarps should still be fixed, the change should be reverted immediately until a better fix is made.

*  Some checks of Mario's floor class were using the wrong defines, which can lead to unexpected behavior in the event anyone wants to reorder surface types. By default the SURFACE_CLASS_SLIPPERY and SURFACE_SLIPPERY defines have the same value, which is why this mistake is hard to notice.

*  The firsty frames define was implemented poorly, not allowing for vanilla firsty behavior no matter what the values were set to. This has been reverted, while avoiding the UB in the original vanilla code.

*  Removed the ledge grab changes that fix QSLGs and change the false ledgegrab define since Arceveti wanted to in his PR
2022-10-26 19:12:29 +13:00
Gregory Heskett
7d6579971a Remove Wiseguy from codeowners file :( (#490)
* Remove Wiseguy from codeowners file :(
* Add ArcticJaguar725 as the primary CODEWOWNER for the moment
2022-09-21 09:10:06 -05:00
thecozies
a549e1a95a Merge pull request #454 from HackerN64/develop/2.0.3
HackerSM64 2.0.3 Release: Audio Crash
2022-07-19 11:44:14 -05:00
thecozies
83fea6d310 v2.0.3 2022-07-19 11:35:48 -05:00
gheskett
8698cc0f89 Bugfix: patch_audio_bank crash (hopefully) resolved for good 2022-07-15 00:25:18 -04:00
Mr-Wiseguy
62d6ee135f HackerSM64 2.0.2 release 2022-06-28 09:43:19 -04:00
thecozies
3d330e0b84 Merge pull request #387 from HackerN64/develop/2.0.1
HackerSM64 2.0.2 Release
2022-06-28 08:40:54 -05:00
Arceveti
1691e48326 Fix inverted tilting pyramids when platform displacement 2 is disabled (#397) 2022-06-28 09:30:49 -04:00
Reonu
e5af0e8ca5 Add :Zone_Identifier files to gitignore (#428) 2022-06-28 09:28:54 -04:00
Mr-Wiseguy
cf570b4406 Added dcache coherency emulation test that disables instant input if passed (fixes Ares) (#427) 2022-06-28 12:57:14 +01:00
Reonu
1012fb7957 Add extra hud defines (#409)
* Added extra HUD defines

* moved the defines to hud.h
2022-06-27 22:17:44 -04:00
Reonu
aa1a48afeb Fix shindou audio bzero size (#426) 2022-06-27 22:15:47 -04:00
Mr-Wiseguy
5e1258e806 Merge branch 'master' into develop/2.0.1 2022-06-17 01:11:34 -04:00
Arceveti
c938bbf407 Add missing check for 9 vert shadows in LEGACY_SHADOW_IDS ifdef (#406)
* Add missing check for 9 vert shadows in LEGACY_SHADOW_IDS ifdef

* Add legacy shadow ids to ShadowType enum
2022-06-09 15:52:10 +01:00
KazeEmanuar
a1ab7c51f0 Made raycasts not hit backfaces
* Update name of lighting engine branch in readme
2022-06-09 10:04:58 -04:00
Arceveti
4cfbc656a9 Re-implement FALL_DAMAGE_HEIGHT_SMALL usage in play_far_fall_sound (#407) 2022-05-19 17:12:28 -04:00
Arceveti
fe6aee22e1 Remove redundant snufit offset vector (fixes gcc11 compiler warning) (#395) 2022-05-02 15:36:59 -04:00
Arceveti
ad3aa42eff Fix construct_float by changing addiu to ori (#394) 2022-05-02 14:56:04 -04:00
Mr-Wiseguy
031cc24fa6 New profiler (#390)
* Implemented new lightweight CPU/RDP profiler

* Integrated new profiler into puppyprint debug and improved profiler visuals, removed existing puppyprint profiling code
2022-05-01 00:42:58 -04:00
thecozies
8d06db06e1 Added specific extracted assets to gitignore (#386)
* Added specific extracted assets to gitignore

* Add .orig files to gitignore

Co-authored-by: Arceveti <73617174+Arceveti@users.noreply.github.com>

Co-authored-by: Arceveti <73617174+Arceveti@users.noreply.github.com>
2022-04-28 17:50:27 +03:00
Arceveti
642a85fec6 Fix build warnings & errors when building non-US versions (#305)
* Fix build warnings & errors when building non-US versions

* Revert ADSR_STATE_LOOP change in adsr_update in effects.c + add fallthrough comments + clean up ifdefs

* null initialization for loadedPool in heap.c

* Better placement of null initialization of arg0 in alloc_bank_or_seq
2022-04-15 12:46:17 -04:00
Reonu
3092929822 Tie JRB dark skybox with ENABLE_VANILLA_LEVEL_SPECIFIC_CHECKS (#378)
The JRB skybox is darkened if you haven't collected JRB's first star. This behaviour should be under `ENABLE_VANILLA_LEVEL_SPECIFIC_CHECKS`
2022-04-14 18:53:11 -04:00
CrashOveride95
51f8ccfbb0 Comment out username printing during debug builds because people use their real names on their computers
I still wanna give people the option so
2022-04-10 17:37:14 -04:00
CrashOveride95
2118234f9b Remove datetime from version.c to make debug builds reproducible 2022-04-10 17:37:14 -04:00
Gregory Heskett
ac0299e5b5 Bugfix: 2x+ skyboxes given insufficient memory space (#372) 2022-03-30 18:41:22 -04:00
Fazana
f98d43c9de Puppycamera hotfixes (#367)
* fixed some embarassing typos
2022-03-27 03:20:28 -04:00
someone2639
bf8ea238e5 Fix some bad comment descriptions in math_util (#328) 2022-03-25 13:23:34 -04:00
Mr-Wiseguy
b3cb639e6e Fixed makefile issue causing audio files to be compiled with different flags the first time they're built (#318) 2022-03-18 14:15:08 -04:00
Arceveti
12595397cd Fix OBJECTS_REJ build error & warning + silhouette incompatibility (#324)
* Fix OBJECTS_REJ build error & warning

* Fix Mario rendering
2022-03-18 11:03:39 -07:00
Arceveti
65eb5a755f Reimplement 'FIX_WATER_RINGS' (#325)
* Reimplement 'FIX_WATER_RINGS'
2022-03-18 11:02:38 -07:00
Gregory Heskett
eaf9d3e4f9 Merge pull request #352 from gheskett/develop/mingw-custom-audio-fix
Fix custom audio files not compiling under MinGW (in case it ever matters)
2022-03-18 12:47:54 -05:00
gheskett
3f0143ec0f Fix custom audio files not compiling under MinGW (in case it ever matters) 2022-03-13 18:57:17 -04:00
Reonu
ad91c636ad Update name of lighting engine branch in readme
sorry for pushing to master :(((((((((((((
2022-01-22 11:11:51 +02:00
86 changed files with 3920 additions and 1888 deletions

2126
.gitignore vendored

File diff suppressed because it is too large Load Diff

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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) \

View File

@@ -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.

View File

@@ -1 +1 @@
v2.0.1
v2.0.9

View File

@@ -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.

View File

@@ -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

View File

@@ -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 --

View File

@@ -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
/*****************

View 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)

View File

@@ -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_ */

View File

@@ -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
};

View File

@@ -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 --
};

View File

@@ -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[] = {

View File

@@ -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),

View File

@@ -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;

View File

@@ -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);

View File

@@ -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