Code cleanup

This commit is contained in:
Arceveti committed 2021-09-23 13:37:03 -07:00
1 parent 8ad773a7eb
commit 9b59eb0256
163 files changed
+1806 -2251

No files matched your search

+19 -19
View File
@@ -264,12 +264,12 @@ Refresh #7
38.) Fix BBH texture (#908)
Refresh #6
1.) Make tools work on MinGW (#804)
2.) Document mario_misc (#628)
3.) add patch_libmalloc.py script to work around compiler crashes (#811)
4.) Label the coffins file. (#829)
5.) Convert enhancements into patches (#827)
6.) Document Tweester.inc.c (#840)
1.) Make tools work on MinGW (#804)
2.) Document mario_misc (#628)
3.) add patch_libmalloc.py script to work around compiler crashes (#811)
4.) Label the coffins file. (#829)
5.) Convert enhancements into patches (#827)
6.) Document Tweester.inc.c (#840)
7.) EU OK and cleanup EU (#782)
Refresh #5
@@ -300,21 +300,21 @@ Refresh #4
10.) Very minor white space fixes in Mario.c (#752)
11.) Renamed GRAVITY to OBJ_PHYSICS (#755)
12.) Use defined macros instead of literal values for interactions in behavior_data.c (#754)
13.) iQue Player console detection + full support (#756)
14.) Fix Goddard Mario head for little endian etc. (#757)
13.) iQue Player console detection + full support (#756)
14.) Fix Goddard Mario head for little endian etc. (#757)
15.) Small bits of audio doc (#749)
16.) Update diff script (#750)
17.) Nicer format for course/dialog text, enum for dialog IDs (#753)
16.) Update diff script (#750)
17.) Nicer format for course/dialog text, enum for dialog IDs (#753)
18.) first-diff: store most recent mtime during check (#759)
19.) Use Lights1 struct for light values (#760)
20.) Detect mips64-elf in diff.py (#761)
21.) Name display lists in gd renderer.c (#764)
22.) Document a variety of PU type crashes. (#765)
23.) Label object_behaviors. (#716)
24.) Update swoop.inc.c (#767)
25.) Label tilting_pyramid.inc.c (#768)
26.) Label red_coin.inc.c (#770)
27.) Use more level defines (#758)
20.) Detect mips64-elf in diff.py (#761)
21.) Name display lists in gd renderer.c (#764)
22.) Document a variety of PU type crashes. (#765)
23.) Label object_behaviors. (#716)
24.) Update swoop.inc.c (#767)
25.) Label tilting_pyramid.inc.c (#768)
26.) Label red_coin.inc.c (#770)
27.) Use more level defines (#758)
28.) Named Mario actions 6, 7, and 8 and noted causes of hands-free holding glitch (#769)
Refresh #3
@@ -360,7 +360,7 @@ Changes from Refresh #1:
6.) Merge ucode.bin and ucode_unk.bin
7.) 64-bit fixes
8.) [AUDIO] Match func_80316928
9.) Documented bug in Tuxie's mother's code
9.) Documented bug in Tuxie's mother's code
10.) [AUDIO] Slightly closer matching for process_level_music_dynamics
11.) Name channel scripts in sequence 0
12.) Nicer error message when sha1sum doesn't match
+5 -5
View File
@@ -192,7 +192,7 @@ endif
# UNF - whether to use UNFLoader flashcart library
# 1 - includes code in ROM
# 0 - does not
# 0 - does not
UNF ?= 0
$(eval $(call validate-option,UNF,0 1))
ifeq ($(UNF),1)
@@ -204,7 +204,7 @@ endif
# ISVPRINT - whether to fake IS-Viewer presence,
# allowing for usage of CEN64 (and possibly Project64) to print messages to terminal.
# 1 - includes code in ROM
# 0 - does not
# 0 - does not
ISVPRINT ?= 0
$(eval $(call validate-option,ISVPRINT,0 1))
ifeq ($(ISVPRINT),1)
@@ -222,7 +222,7 @@ endif
# HVQM - whether to use HVQM fmv library
# 1 - includes code in ROM
# 0 - does not
# 0 - does not
HVQM ?= 0
$(eval $(call validate-option,HVQM,0 1))
ifeq ($(HVQM),1)
@@ -232,7 +232,7 @@ endif
# GODDARD - whether to use libgoddard (Mario Head)
# 1 - includes code in ROM
# 0 - does not
# 0 - does not
GODDARD ?= 0
$(eval $(call validate-option,GODDARD,0 1))
ifeq ($(GODDARD),1)
@@ -476,7 +476,7 @@ else
endif
ENDIAN_BITWIDTH := $(BUILD_DIR)/endian-and-bitwidth
EMULATOR = ~/Downloads/mupen64plus/mupen64plus-gui
EMU_FLAGS =
EMU_FLAGS =
LOADER = loader64
LOADER_FLAGS = -vwf
SHA1SUM = sha1sum
+1 -1
View File
@@ -152,7 +152,7 @@ $(BUILD_DIR)/levels/%/leveldata.elf: SEGMENT_ADDRESS := 0x07000000
# TODO: Generate these rules from the level configs?
define level_rules =
define level_rules =
$(1)_SEG7_FILES := $$(patsubst %.png,%.inc.c,$$(wildcard levels/$(1)/*.png))
$$(BUILD_DIR)/levels/$(1)/leveldata.o: $$(addprefix $$(BUILD_DIR)/,$$($(1)_SEG7_FILES))
$$(BUILD_DIR)/levels/$(1)/leveldata.elf: TEXTURE_BIN := $(2)
+9 -9
View File
@@ -7,7 +7,7 @@ This repo needs BOTH an US ROM and a JP ROM in order to build. Place baserom.us.
This repo needs gcc in order to be able to build it. To install it, run `sudo apt install gcc-mips-linux-gnu`
This is a fork of the ultrasm64 repo by CrashOveride which includes the following commonly used patches (patches marked with `*` are toggleable in `config.h`):
This is a fork of the ultrasm64 repo by CrashOveride which includes the following commonly used patches (patches marked with `*` are toggleable in `config.h`):
**Lighting Engine by Wiseguy**
- Lighting Engine is available on a separate branch `(lighting-engine)`. Instructions on how to use it are in the readme of that branch.
@@ -18,9 +18,9 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin
**Collision:**
- Slope fix and exposed ceilings fix
- No false ledgegrabs fix *
- Jump kick fix *
- 46 degree wallkicks *
- No false ledgegrabs fix *
- Jump kick fix *
- 46 degree wallkicks *
- Pole fix
- Possibility of disabling BLJs *
- Hanging fix (mario can grab hangable ceilings from any state, instead of only jump or double jump) *
@@ -51,12 +51,12 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin
- Automatic console/emulator detection. If emulator is detected, LODs are disabled. *
- Ability to configure whether there's a 100 coin star at all and how many coins are required to spawn it *
- Ability to easily change the warp that EXIT COURSE takes you to via config.h, or disable it entirely. *
- 16 bit model IDs by someone2639. This means you can have up to 65536 models (lol). You can set the maximum number of model IDs in `config.h`.
- 16 bit model IDs by someone2639. This means you can have up to 65536 models (lol). You can set the maximum number of model IDs in `config.h`.
- Apply_patch.sh improved
- Removed the ifdef hell in `file_select.c` and `ingame_menu.c`
- Added Blake's custom function for object model stuff: `obj_set_model` and `obj_has_model`
- Added function to get the model ID from an object: `obj_get_model_id` (by Arceveti)
- The "far" variable is now u16, allowing you to increase the farclip (the max distance at which geometry is rendered). However, when increasing the farclip, make sure to increase the nearclip by the same ratio, or rendering will break on console and LLE plugins.
- The "far" variable is now u16, allowing you to increase the farclip (the max distance at which geometry is rendered). However, when increasing the farclip, make sure to increase the nearclip by the same ratio, or rendering will break on console and LLE plugins.
- Many general use defines for object struct members, meant for use in custom object behaviors. Check `object_fields.h` for more info on this. (By MrComit)
- Included `actors/group0.c` in `behavior_data.c`
- The internal ROM name is now set with a define in `config.h` to make it simpler
@@ -91,7 +91,7 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin
- You can set the black border size to different values for console and emulator. It's set to 0 by default for both. *
- This repo supports 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. See `audio/synthesis.c` for more configuration info. (By ArcticJaguar725) *
- Fazana's "puppyprint" text engine. *
- Use `print_small_text` to print normal text. The two last params are aligment and how many characters to print (-1 means PRINT_ALL).
- Use `print_small_text` to print normal text. The two last params are aligment and how many characters to print (-1 means PRINT_ALL).
- Use `render_multi_image` to draw large texture rectangles consisting of multiple images on the screen.
- More info in `puppyprint.c`
- Wiseguy's Farcall TLB mapping allows to store executable code inside uncompressed segments, that can be loaded and ran as needed, instead of it having to be loaded at all times. See `farcall.h` in the include folder for instructions and details.
@@ -119,7 +119,7 @@ Requirements are the same as regular SM64, however a GCC MIPS cross compiler is
BinPNG (the CI texture converter) requires some python3 dependencies. Use pip to install them.
``pip install pypng bitstring``
``pip install pypng bitstring``
## UNFLoader support
@@ -142,7 +142,7 @@ To target iQue, run make with the ``CONSOLE=bb`` argument.
## Compression
The repo also supports RNC (Rob Northen Compression). RNC has two methods.
The repo also supports RNC (Rob Northen Compression). RNC has two methods.
Method 1 is designed to compress as small as possible, while method 2 is designed so that decompression is as fast as possible.
+92 -92
View File
@@ -2,97 +2,97 @@
const s16 dBowserFlamesOrientationValues[] = {
// posX, posY, posZ, rotY, rotX
0, 280, 80, 0x00E9, 0x1A96,
0, 278, 83, 0x00EC, 0x1C7F,
0, 273, 92, 0x00F9, 0x20BF,
0, 268, 102, 0x010F, 0x2519,
0, 263, 109, 0x011D, 0x2751,
0, 263, 110, 0x011C, 0x2714,
0, 265, 106, 0x0112, 0x2601,
0, 268, 102, 0x0109, 0x24C0,
0, 271, 96, 0x00FF, 0x2358,
0, 274, 90, 0x00F7, 0x21CB,
0, 277, 84, 0x00EE, 0x201C,
0, 280, 78, 0x00E7, 0x1E4E,
0, 284, 71, 0x00DF, 0x1C64,
0, 288, 63, 0x00D9, 0x1A61,
0, 291, 56, 0x00D3, 0x184B,
0, 295, 48, 0x00CF, 0x1622,
0, 298, 40, 0x00CA, 0x13E9,
0, 301, 32, 0x00C7, 0x11A5,
0, 304, 23, 0x00C4, 0x0F59,
0, 308, 15, 0x00C1, 0x0D08,
0, 311, 7, 0x00C0, 0x0AB5,
0, 313, 0, 0x00C0, 0x0863,
0, 315, -8, 0x00BF, 0x0615,
0, 317, -15, 0x00CE, 0x03A3,
0, 319, -22, 0x00F8, 0x00ED,
0, 320, -29, 0x0131, 0xFFFF,
0, 322, -36, 0x0172, 0xFFFF,
0, 322, -40, 0x01B5, 0xFFFF,
0, 323, -45, 0x01ED, 0xFFFF,
0, 323, -48, 0x0213, 0xFFFF,
0, 323, -51, 0x0219, 0xFFFF,
0, 323, -52, 0x01F2, 0xFFFF,
0, 323, -51, 0x018F, 0xFFFF,
0, 323, -49, 0x00E5, 0xFFFF,
0, 322, -45, 0xFFFF, 0xFFFF,
0, 320, -35, 0xFFFF, 0xFFFF,
0, 317, -23, 0xFFFF, 0xFFFF,
0, 312, -7, 0xFFFF, 0xFFFF,
0, 306, 11, 0xFFFF, 0xFFFF,
0, 299, 31, 0xFFFF, 0xFFFF,
0, 288, 51, 0xFFFF, 0xFFFF,
0, 278, 70, 0xFFFF, 0xFFFF,
0, 267, 89, 0xFFFF, 0xFFFF,
0, 256, 106, 0xFFFF, 0x023A,
0, 244, 120, 0xFFFF, 0x04AA,
0, 236, 132, 0xFFFF, 0x069F,
0, 229, 139, 0xFFFF, 0x0803,
0, 224, 144, 0xFFFF, 0x08C0,
0, 222, 147, 0xFFFF, 0x0928,
0, 221, 148, 0xFFFF, 0x099D,
0, 221, 149, 0xFFFF, 0x0A16,
0, 221, 150, 0xFFFF, 0x0A8D,
0, 221, 150, 0xFFFF, 0x0AF6,
0, 222, 150, 0xFFFF, 0x0B4A,
0, 222, 150, 0xFFFF, 0x0B84,
0, 222, 149, 0x020A, 0x0BA0,
0, 223, 149, 0x0524, 0x0B9E,
0, 225, 148, 0x07EC, 0x0B84,
0, 226, 147, 0x0A3F, 0x0B57,
0, 227, 145, 0x0BFB, 0x0B1F,
0, 228, 144, 0x0D00, 0x0AE5,
0, 230, 142, 0x0D6F, 0x0AA0,
0, 232, 140, 0x0D8B, 0x0A48,
0, 233, 138, 0x0D5D, 0x09DE,
0, 236, 136, 0x0CED, 0x096A,
0, 238, 134, 0x0C49, 0x08EA,
0, 239, 132, 0x0B76, 0x0863,
0, 241, 130, 0x0A80, 0x07D9,
0, 244, 128, 0x0970, 0x074E,
0, 246, 125, 0x084E, 0x06C7,
0, 248, 122, 0x0723, 0x0649,
0, 251, 120, 0x05F8, 0x05D7,
0, 253, 117, 0x04D6, 0x0579,
0, 254, 114, 0x03C3, 0x0532,
0, 256, 111, 0x02C9, 0x0509,
0, 259, 108, 0x01F0, 0x0504,
0, 261, 105, 0x0141, 0x0525,
0, 262, 103, 0x00C3, 0x0572,
0, 264, 100, 0x006E, 0x0619,
0, 267, 97, 0x0032, 0x0734,
0, 268, 95, 0x000C, 0x08AF,
0, 269, 93, 0xFFFF, 0x0A74,
0, 272, 90, 0xFFFF, 0x0C70,
0, 273, 88, 0xFFFF, 0x0E8E,
0, 274, 86, 0x0014, 0x10B6,
0, 275, 84, 0x0032, 0x12DA,
0, 277, 82, 0x0056, 0x14E1,
0, 277, 82, 0x007E, 0x16B9,
0, 278, 80, 0x00A4, 0x184B,
0, 278, 80, 0x00C6, 0x1983,
0, 279, 80, 0x00DF, 0x1A4D,
0, 280, 80, 0x00E9, 0x1A96,
0, 280, 80, 0x00E9, 0x1A96,
0, 278, 83, 0x00EC, 0x1C7F,
0, 273, 92, 0x00F9, 0x20BF,
0, 268, 102, 0x010F, 0x2519,
0, 263, 109, 0x011D, 0x2751,
0, 263, 110, 0x011C, 0x2714,
0, 265, 106, 0x0112, 0x2601,
0, 268, 102, 0x0109, 0x24C0,
0, 271, 96, 0x00FF, 0x2358,
0, 274, 90, 0x00F7, 0x21CB,
0, 277, 84, 0x00EE, 0x201C,
0, 280, 78, 0x00E7, 0x1E4E,
0, 284, 71, 0x00DF, 0x1C64,
0, 288, 63, 0x00D9, 0x1A61,
0, 291, 56, 0x00D3, 0x184B,
0, 295, 48, 0x00CF, 0x1622,
0, 298, 40, 0x00CA, 0x13E9,
0, 301, 32, 0x00C7, 0x11A5,
0, 304, 23, 0x00C4, 0x0F59,
0, 308, 15, 0x00C1, 0x0D08,
0, 311, 7, 0x00C0, 0x0AB5,
0, 313, 0, 0x00C0, 0x0863,
0, 315, -8, 0x00BF, 0x0615,
0, 317, -15, 0x00CE, 0x03A3,
0, 319, -22, 0x00F8, 0x00ED,
0, 320, -29, 0x0131, 0xFFFF,
0, 322, -36, 0x0172, 0xFFFF,
0, 322, -40, 0x01B5, 0xFFFF,
0, 323, -45, 0x01ED, 0xFFFF,
0, 323, -48, 0x0213, 0xFFFF,
0, 323, -51, 0x0219, 0xFFFF,
0, 323, -52, 0x01F2, 0xFFFF,
0, 323, -51, 0x018F, 0xFFFF,
0, 323, -49, 0x00E5, 0xFFFF,
0, 322, -45, 0xFFFF, 0xFFFF,
0, 320, -35, 0xFFFF, 0xFFFF,
0, 317, -23, 0xFFFF, 0xFFFF,
0, 312, -7, 0xFFFF, 0xFFFF,
0, 306, 11, 0xFFFF, 0xFFFF,
0, 299, 31, 0xFFFF, 0xFFFF,
0, 288, 51, 0xFFFF, 0xFFFF,
0, 278, 70, 0xFFFF, 0xFFFF,
0, 267, 89, 0xFFFF, 0xFFFF,
0, 256, 106, 0xFFFF, 0x023A,
0, 244, 120, 0xFFFF, 0x04AA,
0, 236, 132, 0xFFFF, 0x069F,
0, 229, 139, 0xFFFF, 0x0803,
0, 224, 144, 0xFFFF, 0x08C0,
0, 222, 147, 0xFFFF, 0x0928,
0, 221, 148, 0xFFFF, 0x099D,
0, 221, 149, 0xFFFF, 0x0A16,
0, 221, 150, 0xFFFF, 0x0A8D,
0, 221, 150, 0xFFFF, 0x0AF6,
0, 222, 150, 0xFFFF, 0x0B4A,
0, 222, 150, 0xFFFF, 0x0B84,
0, 222, 149, 0x020A, 0x0BA0,
0, 223, 149, 0x0524, 0x0B9E,
0, 225, 148, 0x07EC, 0x0B84,
0, 226, 147, 0x0A3F, 0x0B57,
0, 227, 145, 0x0BFB, 0x0B1F,
0, 228, 144, 0x0D00, 0x0AE5,
0, 230, 142, 0x0D6F, 0x0AA0,
0, 232, 140, 0x0D8B, 0x0A48,
0, 233, 138, 0x0D5D, 0x09DE,
0, 236, 136, 0x0CED, 0x096A,
0, 238, 134, 0x0C49, 0x08EA,
0, 239, 132, 0x0B76, 0x0863,
0, 241, 130, 0x0A80, 0x07D9,
0, 244, 128, 0x0970, 0x074E,
0, 246, 125, 0x084E, 0x06C7,
0, 248, 122, 0x0723, 0x0649,
0, 251, 120, 0x05F8, 0x05D7,
0, 253, 117, 0x04D6, 0x0579,
0, 254, 114, 0x03C3, 0x0532,
0, 256, 111, 0x02C9, 0x0509,
0, 259, 108, 0x01F0, 0x0504,
0, 261, 105, 0x0141, 0x0525,
0, 262, 103, 0x00C3, 0x0572,
0, 264, 100, 0x006E, 0x0619,
0, 267, 97, 0x0032, 0x0734,
0, 268, 95, 0x000C, 0x08AF,
0, 269, 93, 0xFFFF, 0x0A74,
0, 272, 90, 0xFFFF, 0x0C70,
0, 273, 88, 0xFFFF, 0x0E8E,
0, 274, 86, 0x0014, 0x10B6,
0, 275, 84, 0x0032, 0x12DA,
0, 277, 82, 0x0056, 0x14E1,
0, 277, 82, 0x007E, 0x16B9,
0, 278, 80, 0x00A4, 0x184B,
0, 278, 80, 0x00C6, 0x1983,
0, 279, 80, 0x00DF, 0x1A4D,
0, 280, 80, 0x00E9, 0x1A96,
0, 0, 0, 0x0000, 0x0000,
};
+1 -1
View File
@@ -106,7 +106,7 @@ const Gfx coin_seg3_dl_03007780[] = {
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
gsDPSetTile(G_IM_FMT_IA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD),
gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC),
#endif
#endif
gsSPEndDisplayList(),
};
+4 -4
View File
@@ -20,11 +20,11 @@
{
"table": [
{"demofile":"bitdw", "ifdef":["VERSION_US", "VERSION_SH"]},
/* Whomp's Fortress has the wrong size.
The original entries probably manually input the sizes. */
{"demofile":"wf", "extraSize":368},
{"demofile":"ccm"},
{"demofile":"bbh"},
{"demofile":"jrb"},
@@ -38,12 +38,12 @@
{"name":"jrb"},
{"name":"wf"},
{"name":"pss"},
/* Might be an unused demo, but it doesn't define a header,
so it can't be normally called. Speculation: "blooper" take for CCM.
Mario runs into the sign and aligns himself as if it were a mistake. */
{"name":"unused"},
{"name":"bitdw", "ifdef":["VERSION_US", "VERSION_SH"]}
]
}
+2 -2
View File
@@ -8,10 +8,10 @@ To apply a patch, run `tools/apply_patch.sh [patch]` where `[patch]` is the name
to the source code.
Likewise, to undo the changes from a patch you applied, run
`tools/revert_patch.sh` with the name of the .patch file you wish to undo.
`tools/revert_patch.sh` with the name of the .patch file you wish to undo.
To create your own enhancement patch, switch to the `master` Git
branch, make your changes to the code (but do not commit), then run `tools/create_patch.sh`. Your changes will be stored in the .patch file you specify.
branch, make your changes to the code (but do not commit), then run `tools/create_patch.sh`. Your changes will be stored in the .patch file you specify.
The following enhancements are included in this directory:
+2 -2
View File
@@ -163,7 +163,7 @@ index c3b97993..c552a485 100644
+++ b/lib/asm/__osExceptionPreamble.s
@@ -11,8 +11,8 @@
#endif
glabel __osExceptionPreamble
- lui $k0, %hi(__osException)
- addiu $k0, %lo(__osException)
@@ -171,7 +171,7 @@ index c3b97993..c552a485 100644
+ addiu $k0, %lo(__crash_handler_entry)
jr $k0
nop
diff --git a/sm64.ld b/sm64.ld
index 7d9b5b4a..c7bb81b9 100755
--- a/sm64.ld
+3 -3
View File
@@ -7,17 +7,17 @@ index af9d0156..c68a7f6e 100644
#include "level_table.h"
#include "dialog_ids.h"
+#include "debug_box.h"
struct SpawnInfo gPlayerSpawnInfos[1];
struct GraphNode *gGraphNodePointers[0x100];
@@ -363,6 +364,8 @@ void render_game(void) {
if (gCurrentArea != NULL && !gWarpTransition.pauseRendering) {
geo_process_root(gCurrentArea->unk04, D_8032CE74, D_8032CE78, gFBSetColor);
+ render_debug_boxes();
+
gSPViewport(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&D_8032CF00));
gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, BORDER_HEIGHT, SCREEN_WIDTH,
diff --git a/src/game/debug_box.c b/src/game/debug_box.c
new file mode 100644
+1 -1
View File
@@ -5,7 +5,7 @@ index b961ca52..531231cf 100644
@@ -82,6 +82,47 @@ struct DemoInput gRecordedDemoInput = { 0 };
// Display
// ----------------------------------------------------------------------------------------------------
+// SDK states that 1 cycle takes about 21.33 nanoseconds
+#define SECONDS_PER_CYCLE 0.00000002133f
+
+2 -2
View File
@@ -5,7 +5,7 @@ index b633468..da65e01 100644
@@ -300,7 +300,10 @@ void rendering_init(void) {
end_master_display_list();
send_display_list(&gGfxPool->spTask);
- frameBufferIndex++;
+ // Skip incrementing the initial framebuffer index on emulators so that they display immediately as the Gfx task finishes
+ if ((*(volatile u32 *)0xA4100010) != 0) { // Read RDP Clock Register, has a value of zero on emulators
@@ -13,7 +13,7 @@ index b633468..da65e01 100644
+ }
gGlobalTimer++;
}
@@ -326,11 +329,14 @@ void display_and_vsync(void) {
osViSwapBuffer((void *) PHYSICAL_TO_VIRTUAL(gPhysicalFrameBuffers[sCurrFBNum]));
profiler_log_thread5_time(THREAD5_END);
+18 -18
View File
@@ -75,12 +75,12 @@ index d550b846..bbaf2bcc 100644
@@ -1,4 +1,5 @@
#include "libultra_internal.h"
+#include <PR/console_type.h>
// TODO: merge with osEepromWrite
typedef struct {
@@ -13,11 +14,23 @@ s32 osEepromProbe(OSMesgQueue *mq) {
unkStruct sp18;
__osSiGetAccess();
- status = __osEepStatus(mq, &sp18);
- if (status == 0 && (sp18.unk00 & 0x8000) != 0) {
@@ -114,9 +114,9 @@ index ea784b2c..116dae2d 100644
@@ -1,4 +1,5 @@
#include "libultra_internal.h"
+#include <PR/console_type.h>
extern u8 _osLastSentSiCmd;
@@ -42,33 +43,44 @@ s32 osEepromRead(OSMesgQueue *mq, u8 address, u8 *buffer) {
return -1;
}
@@ -126,7 +126,7 @@ index ea784b2c..116dae2d 100644
+ if (gConsoleType == CONSOLE_N64) {
+ sp34 = __osEepStatus(mq, &sp28);
+ if (sp34 != 0 || sp28.unk00 != 0x8000) {
- return 8;
- }
- while (sp28.unk02 & 0x80) {
@@ -195,46 +195,46 @@ index 1a86477b..a94f8721 100644
#include "libultra_internal.h"
#include "osContInternal.h"
+#include <PR/console_type.h>
#ifndef AVOID_UB
ALIGNED8 u32 D_80365E00[15];
@@ -52,36 +53,47 @@ s32 osEepromWrite(OSMesgQueue *mq, u8 address, u8 *buffer) {
}
__osSiGetAccess();
- sp34 = __osEepStatus(mq, &sp1c);
+ if (gConsoleType == CONSOLE_N64) {
+ sp34 = __osEepStatus(mq, &sp1c);
- if (sp34 != 0 || sp1c.unk00 != 0x8000) {
- return 8;
- }
+ if (sp34 != 0 || sp1c.unk00 != 0x8000) {
+ return 8;
+ }
- while (sp1c.unk02 & 0x80) {
- __osEepStatus(mq, &sp1c);
- }
+ while (sp1c.unk02 & 0x80) {
+ __osEepStatus(mq, &sp1c);
+ }
- __osPackEepWriteData(address, buffer);
+ __osPackEepWriteData(address, buffer);
- sp34 = __osSiRawStartDma(OS_WRITE, &D_80365E00);
- osRecvMesg(mq, NULL, OS_MESG_BLOCK);
+ sp34 = __osSiRawStartDma(OS_WRITE, &D_80365E00);
+ osRecvMesg(mq, NULL, OS_MESG_BLOCK);
- for (sp30 = 0; sp30 < 0x10; sp30++) {
- (D_80365E00)[sp30] = 255;
- }
+ for (sp30 = 0; sp30 < 0x10; sp30++) {
+ (D_80365E00)[sp30] = 255;
+ }
- D_80365E3C = 0;
- sp34 = __osSiRawStartDma(OS_READ, D_80365E00);
- _osLastSentSiCmd = 5;
@@ -243,7 +243,7 @@ index 1a86477b..a94f8721 100644
+ sp34 = __osSiRawStartDma(OS_READ, D_80365E00);
+ _osLastSentSiCmd = 5;
+ osRecvMesg(mq, NULL, OS_MESG_BLOCK);
- for (sp30 = 0; sp30 < 4; sp30++) {
- sp2c++;
- }
@@ -256,7 +256,7 @@ index 1a86477b..a94f8721 100644
+ } else if (gConsoleType == CONSOLE_IQUE) {
+ u8 *__osBbEepromAddress = * (u8**) 0x8000035C;
+ s32 i;
- sp20 = *(unkStruct2 *) sp2c;
- sp34 = (sp20.unk01 & 0xc0) >> 4;
+ for (i = 0; i < 8; i++) {
@@ -277,9 +277,9 @@ index ba73024b..6deaf407 100644
#include "hardware.h"
#include <macros.h>
+#include <PR/console_type.h>
#define PIF_ADDR_START (void *) 0x1FC007FC
@@ -51,6 +52,7 @@ void osInitialize(void) {
UNUSED u32 eu_sp30;
#endif
@@ -309,4 +309,4 @@ index 7d9b5b4a..be853a3b 100755
+ BUILD_DIR/libultra.a:skGetId.o(.text)
BUILD_DIR/lib/rsp.o(.text);
#endif
+10 -10
View File
@@ -25,7 +25,7 @@ index e5d59d8b5..75cd43a09 100644
-#endif
+ Mat4 temp;
+ register s32 i, j;
+
+
+ for( i = 0; i < 4; i++ ) {
+ for( j = 0; j < 3; j++ ) {
+ temp[i][j] = src[i][j] / WORLD_SCALE;
@@ -35,19 +35,19 @@ index e5d59d8b5..75cd43a09 100644
+
+ guMtxF2L( temp, dest );
}
/**
diff --git a/src/engine/math_util.h b/src/engine/math_util.h
index cb37d52d1..0826a8407 100644
--- a/src/engine/math_util.h
+++ b/src/engine/math_util.h
@@ -5,6 +5,14 @@
#include "types.h"
+/* Scales the world down by this factor, increasing how far you can render on
+ * console in exchange for a slight loss in precision.
+ *
+ *
+ * For double extended boundary hacks, a value of 1.5f or 2.0f is good.
+ * For quadruple extended bounds, use 3.f or 4.f
+ */
@@ -63,11 +63,11 @@ index 58238e83f..150cff68b 100644
@@ -249,7 +249,7 @@ static void geo_process_perspective(struct GraphNodePerspective *node) {
f32 aspect = (f32) gCurGraphNodeRoot->width / (f32) gCurGraphNodeRoot->height;
#endif
- guPerspective(mtx, &perspNorm, node->fov, aspect, node->near, node->far, 1.0f);
+ guPerspective(mtx, &perspNorm, node->fov, aspect, node->near / WORLD_SCALE, node->far / WORLD_SCALE, 1.0f);
gSPPerspNormalize(gDisplayListHead++, perspNorm);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(mtx), G_MTX_PROJECTION | G_MTX_LOAD | G_MTX_NOPUSH);
@@ -267,17 +267,8 @@ static void geo_process_perspective(struct GraphNodePerspective *node) {
* range of this node.
@@ -92,7 +92,7 @@ index 58238e83f..150cff68b 100644
@@ -304,6 +295,17 @@ static void geo_process_switch(struct GraphNodeSwitchCase *node) {
}
}
+static void make_roll_matrix(Mtx *mtx, s16 angle) {
+ Mat4 temp;
+
@@ -113,6 +113,6 @@ index 58238e83f..150cff68b 100644
}
- mtxf_rotate_xy(rollMtx, node->rollScreen);
+ make_roll_matrix(rollMtx, node->rollScreen);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(rollMtx), G_MTX_PROJECTION | G_MTX_MUL | G_MTX_NOPUSH);
+17 -17
View File
@@ -7,17 +7,17 @@ index f50b7622..124c7ec6 100644
$(BUILD_DIR)/src/menu/star_select.o: $(BUILD_DIR)/include/text_strings.h
$(BUILD_DIR)/src/game/ingame_menu.o: $(BUILD_DIR)/include/text_strings.h
+$(BUILD_DIR)/src/boot/mem_error_screen.o: $(BUILD_DIR)/include/text_strings.h
#==============================================================================#
diff --git a/include/segments.h b/include/segments.h
index a97d6ee8..186c968e 100644
--- a/include/segments.h
+++ b/include/segments.h
@@ -3,6 +3,9 @@
#include "config.h"
+/* Use expansion pack RAM */
+#define USE_EXT_RAM 1
+
@@ -31,14 +31,14 @@ index 749179b1..2f6f7a3c 100644
@@ -25,6 +25,11 @@
#define TEXT_PAUSE _("PAUSE") // Pause text, Castle Courses
#define TEXT_HUD_CONGRATULATIONS _("CONGRATULATIONS") // Course Complete Text, Bowser Courses
+// Memory Expansion Error Screen
+#define TEXT_CONSOLE_8MB _("If you're using an N64 console, then you will need to buy an\nExpansion Pak to play this ROM hack.")
+#define TEXT_PJ64 _("If you are using PJ64 1.6, go to:\nOptions > Settings > Rom Settings Tab > Memory Size\nthen select 8 MB from the drop-down box.")
+#define TEXT_PJ64_2 _("If you are using PJ64 2.X, go to:\nOptions > Settings > Config: > Memory Size, select 8 MB")
+
#if defined(VERSION_JP) || defined(VERSION_SH)
/**
diff --git a/levels/entry.c b/levels/entry.c
index 17c773ed..677a5ae9 100644
@@ -62,9 +62,9 @@ index 30a87806..6bf7b79a 100644
--- a/levels/intro/geo.c
+++ b/levels/intro/geo.c
@@ -15,6 +15,24 @@
#include "levels/intro/header.h"
+const GeoLayout intro_geo_error_screen[] = {
+ GEO_NODE_SCREEN_AREA(0, SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH/2, SCREEN_HEIGHT/2),
+ GEO_OPEN_NODE(),
@@ -93,7 +93,7 @@ index 99277e86..04797cd7 100644
@@ -26,4 +26,8 @@ extern const LevelScript script_intro_L3[];
extern const LevelScript script_intro_L4[];
extern const LevelScript script_intro_L5[];
+extern const GeoLayout intro_geo_error_screen[];
+extern const LevelScript level_intro_entry_error_screen[];
+extern Gfx *geo18_display_error_message(u32 run, UNUSED struct GraphNode *sp44, UNUSED u32 sp48);
@@ -106,7 +106,7 @@ index 04b8fc4c..ca9058c4 100644
@@ -18,6 +18,21 @@
#include "make_const_nonconst.h"
#include "levels/intro/header.h"
+const LevelScript level_intro_entry_error_screen[] = {
+ INIT_LEVEL(),
+ FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd),
@@ -131,12 +131,12 @@ index d41a91c8..7d047236 100644
+++ b/src/engine/level_script.h
@@ -6,6 +6,7 @@
struct LevelCommand;
extern u8 level_script_entry[];
+extern u8 level_script_entry_error_screen[];
struct LevelCommand *level_script_execute(struct LevelCommand *cmd);
diff --git a/src/boot/main.c b/src/boot/main.c
index 1a9d9e7e..f4f7a9e5 100644
--- a/src/boot/main.c
@@ -146,13 +146,13 @@ index 1a9d9e7e..f4f7a9e5 100644
#include "game/main.h"
#include "game/rumble_init.h"
+#include "mem_error_screen.h"
// Message IDs
#define MESG_SP_COMPLETE 100
@@ -131,6 +132,10 @@ void alloc_pool(void) {
void *start = (void *) SEG_POOL_START;
void *end = (void *) SEG_POOL_END;
+ // Detect memory size
+ if (does_pool_end_lie_out_of_bounds(end))
+ end = (void *)SEG_POOL_END_4MB;
@@ -163,14 +163,14 @@ index 1a9d9e7e..f4f7a9e5 100644
@@ -336,7 +341,10 @@ void thread3_main(UNUSED void *arg) {
create_thread(&gSoundThread, 4, thread4_sound, NULL, gThread4Stack + 0x2000, 20);
osStartThread(&gSoundThread);
- create_thread(&gGameLoopThread, 5, thread5_game_loop, NULL, gThread5Stack + 0x2000, 10);
+ if (!gNotEnoughMemory)
+ create_thread(&gGameLoopThread, 5, thread5_game_loop, NULL, gThread5Stack + 0x2000, 10);
+ else
+ create_thread(&gGameLoopThread, 5, thread5_mem_error_message_loop, NULL, gThread5Stack + 0x2000, 10);
osStartThread(&gGameLoopThread);
while (TRUE) {
diff --git a/src/boot/mem_error_screen.c b/src/boot/mem_error_screen.c
new file mode 100644
+41 -41
View File
@@ -11,7 +11,7 @@ index 0000000..6bf33a8
+@@ -972,6 +972,8 @@ s32 bowser_check_fallen_off_stage(void) // bowser off stage?
+ return 0;
+ }
+
+
++struct PlatformDisplacementInfo sBowserDisplacementInfo;
++
+ void (*sBowserActions[])(void) = { bowser_act_default, bowser_act_thrown_dropped, bowser_act_jump_onto_stage, bowser_act_dance,
@@ -37,7 +37,7 @@ index 0000000..6bf33a8
+- set_mario_pos(mx, my, mz);
++ //set_mario_pos(mx, my, mz);
+ }
+
+
+ o->header.gfx.throwMatrix = transform;
+diff --git a/src/game/platform_displacement.c b/src/game/platform_displacement.c
+index 29a741c..d1bb016 100644
@@ -48,13 +48,13 @@ index 0000000..6bf33a8
+ #include "platform_displacement.h"
+ #include "types.h"
++#include "sm64.h"
+
+
+ u16 D_8032FEC0 = 0;
+
+
+@@ -84,96 +85,139 @@ void set_mario_pos(f32 x, f32 y, f32 z) {
+ gMarioStates[0].pos[2] = z;
+ }
+
+
+-/**
+- * Apply one frame of platform rotation to Mario or an object using the given
+- * platform. If isMario is 0, use gCurrentObject.
@@ -92,13 +92,13 @@ index 0000000..6bf33a8
+- z += platform->oVelZ;
++static struct PlatformDisplacementInfo sMarioDisplacementInfo;
++static Vec3f sMarioAmountDisplaced;
+
+
+- if (rotation[0] != 0 || rotation[1] != 0 || rotation[2] != 0) {
+- unused1 = rotation[0];
+- unused2 = rotation[2];
+- unused3 = platform->oFaceAngleYaw;
++extern s32 gGlobalTimer;
+
+
+- if (isMario) {
+- gMarioStates[0].faceAngle[1] += rotation[1];
+- }
@@ -131,7 +131,7 @@ index 0000000..6bf33a8
++ dst[2] = src[2] * scale[2];
++ }
++}
+
+
+- rotation[0] = platform->oFaceAnglePitch;
+- rotation[1] = platform->oFaceAngleYaw;
+- rotation[2] = platform->oFaceAngleRoll;
@@ -202,19 +202,19 @@ index 0000000..6bf33a8
++ displaceInfo->prevPlatform = platform;
++ displaceInfo->prevTimer = gGlobalTimer;
++}
+
+
+- mtxf_rotate_zxy_and_translate(displaceMatrix, currentObjectOffset, rotation);
+- linear_mtxf_mul_vec3f(displaceMatrix, newObjectOffset, relativeOffset);
++// Doesn't change in the code, set this to FALSE if you don't want inertia
++u8 gDoInertia = TRUE;
+
+
+- x = platformPosX + newObjectOffset[0];
+- y = platformPosY + newObjectOffset[1];
+- z = platformPosZ + newObjectOffset[2];
+- }
++static u8 sShouldApplyInertia = FALSE;
++static u8 sInertiaFirstFrame = FALSE;
+
+
+- if (isMario) {
+- set_mario_pos(x, y, z);
+- } else {
@@ -244,14 +244,14 @@ index 0000000..6bf33a8
++ sShouldApplyInertia = FALSE;
++ }
+ }
+
+
+ /**
+- * If Mario's platform is not null, apply platform displacement.
++ * Apply platform displacement or inertia if required.
+ */
+ void apply_mario_platform_displacement(void) {
+ struct Object *platform;
+
+
+ platform = gMarioPlatform;
+- if (!(gTimeStopState & TIME_STOP_ACTIVE) && gMarioObject != NULL && platform != NULL) {
+- apply_platform_displacement(1, platform);
@@ -266,15 +266,15 @@ index 0000000..6bf33a8
++ }
+ }
+ }
+
+
+diff --git a/src/game/platform_displacement.h b/src/game/platform_displacement.h
+index 556192b..3609e2d 100644
+--- a/src/game/platform_displacement.h
++++ b/src/game/platform_displacement.h
+@@ -5,10 +5,19 @@
+
+
+ #include "types.h"
+
+
++struct PlatformDisplacementInfo {
++ Vec3f prevPos;
++ Vec3f prevTransformedPos;
@@ -299,7 +299,7 @@ index 97cba2a..410e612 100644
@@ -972,6 +972,8 @@ s32 bowser_check_fallen_off_stage(void) // bowser off stage?
return 0;
}
+struct PlatformDisplacementInfo sBowserDisplacementInfo;
+
void (*sBowserActions[])(void) = { bowser_act_default, bowser_act_thrown_dropped, bowser_act_jump_onto_stage, bowser_act_dance,
@@ -1938,7 +1938,7 @@ index ebce64f..29136e9 100644
- set_mario_pos(mx, my, mz);
+ //set_mario_pos(mx, my, mz);
}
o->header.gfx.throwMatrix = transform;
diff --git a/src/game/platform_displacement.c b/src/game/platform_displacement.c
index 9153bc4..1e8cd86 100644
@@ -1949,13 +1949,13 @@ index 9153bc4..1e8cd86 100644
#include "platform_displacement.h"
#include "types.h"
+#include "sm64.h"
u16 D_8032FEC0 = 0;
@@ -84,98 +85,144 @@ void set_mario_pos(f32 x, f32 y, f32 z) {
gMarioStates[0].pos[2] = z;
}
-/**
- * Apply one frame of platform rotation to Mario or an object using the given
- * platform. If isMario is false, use gCurrentObject.
@@ -1998,12 +1998,12 @@ index 9153bc4..1e8cd86 100644
- unused3 = platform->oFaceAngleYaw;
+static struct PlatformDisplacementInfo sMarioDisplacementInfo;
+static Vec3f sMarioAmountDisplaced;
- if (isMario) {
- gMarioStates[0].faceAngle[1] += rotation[1];
- }
+extern s32 gGlobalTimer;
- platformPosX = platform->oPosX;
- platformPosY = platform->oPosY;
- platformPosZ = platform->oPosZ;
@@ -2032,7 +2032,7 @@ index 9153bc4..1e8cd86 100644
+ dst[2] = src[2] * scale[2];
+ }
+}
- rotation[0] = platform->oFaceAnglePitch;
- rotation[1] = platform->oFaceAngleYaw;
- rotation[2] = platform->oFaceAngleRoll;
@@ -2103,19 +2103,19 @@ index 9153bc4..1e8cd86 100644
+ displaceInfo->prevPlatform = platform;
+ displaceInfo->prevTimer = gGlobalTimer;
+}
- mtxf_rotate_zxy_and_translate(displaceMatrix, currentObjectOffset, rotation);
- linear_mtxf_mul_vec3f(displaceMatrix, newObjectOffset, relativeOffset);
+// Doesn't change in the code, set this to FALSE if you don't want inertia
+u8 gDoInertia = TRUE;
- x = platformPosX + newObjectOffset[0];
- y = platformPosY + newObjectOffset[1];
- z = platformPosZ + newObjectOffset[2];
- }
+static u8 sShouldApplyInertia = FALSE;
+static u8 sInertiaFirstFrame = FALSE;
- if (isMario) {
- set_mario_pos(x, y, z);
- } else {
@@ -2145,7 +2145,7 @@ index 9153bc4..1e8cd86 100644
+ sShouldApplyInertia = FALSE;
+ }
}
/**
- * If Mario's platform is not null, apply platform displacement.
+ * Apply platform displacement or inertia if required.
@@ -2169,7 +2169,7 @@ index 9153bc4..1e8cd86 100644
+ }
}
}
+
+
#ifndef VERSION_JP
@@ -2378,7 +2378,7 @@ index 0000000..ff20eca
+@@ -85,96 +86,139 @@ void set_mario_pos(f32 x, f32 y, f32 z) {
+ gMarioStates[0].pos[2] = z;
+ }
+
+
+-/**
+- * Apply one frame of platform rotation to Mario or an object using the given
+- * platform. If isMario is 0, use gCurrentObject.
@@ -2416,13 +2416,13 @@ index 0000000..ff20eca
+- z += platform->oVelZ;
++static struct PlatformDisplacementInfo sMarioDisplacementInfo;
++static Vec3f sMarioAmountDisplaced;
+
+
+- if (rotation[0] != 0 || rotation[1] != 0 || rotation[2] != 0) {
+- unused1 = rotation[0];
+- unused2 = rotation[2];
+- unused3 = platform->oFaceAngleYaw;
++extern s32 gGlobalTimer;
+
+
+- if (isMario) {
+- gMarioStates[0].faceAngle[1] += rotation[1];
+- }
@@ -2455,7 +2455,7 @@ index 0000000..ff20eca
++ dst[2] = src[2] * scale[2];
++ }
++}
+
+
+- rotation[0] = platform->oFaceAnglePitch;
+- rotation[1] = platform->oFaceAngleYaw;
+- rotation[2] = platform->oFaceAngleRoll;
@@ -2526,19 +2526,19 @@ index 0000000..ff20eca
++ displaceInfo->prevPlatform = platform;
++ displaceInfo->prevTimer = gGlobalTimer;
++}
+
+
+- mtxf_rotate_zxy_and_translate(displaceMatrix, currentObjectOffset, rotation);
+- linear_mtxf_mul_vec3f(displaceMatrix, newObjectOffset, relativeOffset);
++// Doesn't change in the code, set this to FALSE if you don't want inertia
++u8 gDoInertia = TRUE;
+
+
+- x = platformPosX + newObjectOffset[0];
+- y = platformPosY + newObjectOffset[1];
+- z = platformPosZ + newObjectOffset[2];
+- }
++static u8 sShouldApplyInertia = FALSE;
++static u8 sInertiaFirstFrame = FALSE;
+
+
+- if (isMario) {
+- set_mario_pos(x, y, z);
+- } else {
@@ -2568,14 +2568,14 @@ index 0000000..ff20eca
++ sShouldApplyInertia = FALSE;
++ }
+ }
+
+
+ /**
+- * If Mario's platform is not null, apply platform displacement.
++ * Apply platform displacement or inertia if required.
+ */
+ void apply_mario_platform_displacement(void) {
+ struct Object *platform;
+
+
+ platform = gMarioPlatform;
+- if (!(gTimeStopState & TIME_STOP_ACTIVE) && gMarioObject != NULL && platform != NULL) {
+- apply_platform_displacement(1, platform);
@@ -2590,15 +2590,15 @@ index 0000000..ff20eca
++ }
+ }
+ }
+
+
diff --git a/src/game/platform_displacement.h b/src/game/platform_displacement.h
index 556192b..3609e2d 100644
--- a/src/game/platform_displacement.h
+++ b/src/game/platform_displacement.h
@@ -5,10 +5,19 @@
#include "types.h"
+struct PlatformDisplacementInfo {
+ Vec3f prevPos;
+ Vec3f prevTransformedPos;
+3 -3
View File
@@ -13,7 +13,7 @@ index b961ca52..adfde049 100644
@@ -386,6 +387,45 @@ void display_and_vsync(void) {
// Controls
// ----------------------------------------------------------------------------------------------------
+/*
+ * This enhancement allows you to record gameplay demos for the mario head screen.
+ *
@@ -59,7 +59,7 @@ index b961ca52..adfde049 100644
@@ -420,6 +460,118 @@ UNUSED static void record_demo(void) {
gRecordedDemoInput.timer++;
}
+void record_new_demo_input(void) {
+ if (gRecordedDemoInput.timer == 1 && gRecordedDemoInputCopy.timer > 0) {
+ gRecordedInputs[gNumOfRecordedInputs].timer = gRecordedDemoInputCopy.timer;
@@ -181,5 +181,5 @@ index b961ca52..adfde049 100644
read_controller_inputs();
+ recordingDemo();
addr = level_script_execute(addr);
display_and_vsync();
+43 -43
View File
@@ -5,7 +5,7 @@ index 711d4562..f1c83171 100644
@@ -93,6 +93,12 @@
#define TEXT_HUD_WIDE_INFO _("PLEASE CONFIGURE YOUR DISPLAY OR YOUR EMULATOR TO\nSTRETCH THE IMAGE TO 16:9")
#endif
+#define TEXT_CAM_INFO_SLOWEST _("CAM SPEED: SLOWEST")
+#define TEXT_CAM_INFO_SLOW _("CAM SPEED: SLOW")
+#define TEXT_CAM_INFO_MEDIUM _("CAM SPEED: MEDIUM")
@@ -13,7 +13,7 @@ index 711d4562..f1c83171 100644
+#define TEXT_CAM_INFO_FASTEST _("CAM SPEED: FASTEST")
+
#if defined(VERSION_JP) || defined(VERSION_SH)
/**
diff --git a/src/game/camera.c b/src/game/camera.c
index 25b27983..2ff11930 100644
@@ -30,7 +30,7 @@ index 25b27983..2ff11930 100644
@@ -107,6 +108,7 @@ s16 sCreditsPlayer2Yaw;
*/
u8 sFramesPaused;
+
extern struct CameraFOVStatus sFOVState;
extern struct TransitionInfo sModeTransition;
@@ -56,7 +56,7 @@ index 25b27983..2ff11930 100644
f32 baseOff = 125.f;
f32 camCeilHeight = find_ceil(c->pos[0], gLakituState.goalPos[1] - 50.f, c->pos[2], &surface);
+ f32 approachRate = 20.0f;
if (sMarioCamState->action & ACT_FLAG_HANGING) {
marioCeilHeight = sMarioGeometry.currCeilHeight;
@@ -790,7 +795,8 @@ void set_camera_height(struct Camera *c, f32 goalHeight) {
@@ -76,7 +76,7 @@ index 25b27983..2ff11930 100644
- f32 yOff = 125.f;
+ f32 yOff;
f32 baseDist = 1000.f;
+ if (gMarioState->action & ACT_FLAG_SWIMMING) {
+ yOff = -125.f;
+ } else {
@@ -99,7 +99,7 @@ index 25b27983..2ff11930 100644
@@ -1170,6 +1192,28 @@ void mode_radial_camera(struct Camera *c) {
pan_ahead_of_player(c);
}
+// Returns the camera speed based on the user's camera speed setting
+f32 set_camera_speed(void) {
+ switch(gCameraSpeed) {
@@ -131,9 +131,9 @@ index 25b27983..2ff11930 100644
s16 oldAreaYaw = sAreaYaw;
+ // Get the camera speed based on the user's setting
+ f32 cameraSpeed = set_camera_speed();
radial_camera_input(c);
- if (gPlayer1Controller->buttonPressed & R_CBUTTONS) {
- s8DirModeYawOffset += DEGREES(45);
- play_sound_cbutton_side();
@@ -193,7 +193,7 @@ index 25b27983..2ff11930 100644
+ s8DirModeBaseYaw = (s8DirModeBaseYaw + 0x1000) & 0xE000; // Lock the camera to the nearest 45deg axis
}
-#endif
lakitu_zoom(400.f, 0x900);
c->nextYaw = update_8_directions_camera(c, c->focus, pos);
+ set_camera_height(c, pos[1]);
@@ -202,7 +202,7 @@ index 25b27983..2ff11930 100644
sAreaYawChange = sAreaYaw - oldAreaYaw;
- set_camera_height(c, pos[1]);
}
+
/**
* Updates the camera in outward radial mode.
@@ -212,14 +212,14 @@ index 25b27983..2ff11930 100644
gLakituState.goalPos[2], &ceil);
s16 yawDir;
-
+
+
handle_c_button_movement(c);
vec3f_get_dist_and_angle(sMarioCamState->pos, c->pos, &dist, &pitch, &yaw);
@@ -3036,6 +3097,8 @@ void update_lakitu(struct Camera *c) {
void update_camera(struct Camera *c) {
UNUSED u8 unused[24];
+ extern s16 s8DirModeBaseYaw;
+
gCamera = c;
@@ -241,7 +241,7 @@ index 25b27983..2ff11930 100644
- play_sound_if_cam_switched_to_lakitu_or_mario();
+ //play_sound_if_cam_switched_to_lakitu_or_mario();
}
// Initialize the camera
@@ -3356,7 +3418,6 @@ void init_camera(struct Camera *c) {
struct Surface *floor = 0;
@@ -253,26 +253,26 @@ index 25b27983..2ff11930 100644
gPrevLevel = gCurrLevelArea / 16;
@@ -4901,15 +4962,15 @@ void play_camera_buzz_if_c_sideways(void) {
}
void play_sound_cbutton_up(void) {
- play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
+ //play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gGlobalSoundSource);
+ //play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gGlobalSoundSource);
}
void play_sound_cbutton_down(void) {
- play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gGlobalSoundSource);
+ //play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gGlobalSoundSource);
}
void play_sound_cbutton_side(void) {
- play_sound(SOUND_MENU_CAMERA_TURN, gGlobalSoundSource);
+ //play_sound(SOUND_MENU_CAMERA_TURN, gGlobalSoundSource);
}
void play_sound_button_change_blocked(void) {
@@ -5013,7 +5074,7 @@ void radial_camera_input(struct Camera *c) {
}
// Zoom in / enter C-Up
- if (gPlayer1Controller->buttonPressed & U_CBUTTONS) {
+ if (((gPlayer1Controller->buttonPressed & U_CBUTTONS) || (gPlayer2Controller->rawStickY > 40)) && (stickReset) && !(gPlayer1Controller->buttonDown & R_TRIG)) {
@@ -281,7 +281,7 @@ index 25b27983..2ff11930 100644
play_sound_cbutton_up();
@@ -5023,7 +5084,7 @@ void radial_camera_input(struct Camera *c) {
}
// Zoom out
- if (gPlayer1Controller->buttonPressed & D_CBUTTONS) {
+ if ((gPlayer1Controller->buttonPressed & D_CBUTTONS) || (gPlayer2Controller->rawStickY < -40)) {
@@ -291,7 +291,7 @@ index 25b27983..2ff11930 100644
@@ -5035,6 +5096,12 @@ void radial_camera_input(struct Camera *c) {
}
}
+ if ((gPlayer2Controller->rawStickY > 40) || (gPlayer2Controller->rawStickY < -40)) {
+ stickReset = 0;
+ } else {
@@ -327,7 +327,7 @@ index 317e33bf..6687016d 100644
s8 gEepromProbe;
#endif
@@ -739,6 +744,7 @@ void thread5_game_loop(UNUSED void *arg) {
play_music(SEQ_PLAYER_SFX, SEQUENCE_ARGS(0, SEQ_SOUND_PLAYER), 0);
set_sound_mode(save_file_get_sound_mode());
+ gCameraSpeed = (save_file_get_camera_speed());
@@ -356,7 +356,7 @@ index 6cbfd8e1..01dd4de8 100644
@@ -59,6 +59,12 @@ void *languageTable[][3] =
#endif
};
+u8 textCamInfoSlowest[] = { TEXT_CAM_INFO_SLOWEST };
+u8 textCamInfoSlow[] = { TEXT_CAM_INFO_SLOW };
+u8 textCamInfoMedium[] = { TEXT_CAM_INFO_MEDIUM };
@@ -365,11 +365,11 @@ index 6cbfd8e1..01dd4de8 100644
+
extern u8 gLastCompletedCourseNum;
extern u8 gLastCompletedStarNum;
@@ -1504,6 +1510,45 @@ void reset_red_coins_collected(void) {
gRedCoinsCollected = 0;
}
+void render_camera_speed_setting(void) {
+ gSPDisplayList(gDisplayListHead++, dl_ia_text_begin);
+ gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, gDialogTextAlpha);
@@ -391,7 +391,7 @@ index 6cbfd8e1..01dd4de8 100644
+ break;
+ }
+ gSPDisplayList(gDisplayListHead++, dl_ia_text_end);
+
+
+ if (gPlayer1Controller->buttonPressed & R_JPAD) {
+ if (gCameraSpeed < 4) {
+ gCameraSpeed += 1;
@@ -406,7 +406,7 @@ index 6cbfd8e1..01dd4de8 100644
+ gCameraSpeed = 4;
+ }
+ save_file_set_camera_speed(gCameraSpeed);
+ }
+ }
+}
+
void change_dialog_camera_angle(void) {
@@ -445,7 +445,7 @@ index 31e97bce..29b5e9c4 100644
+ if ((heightBelowWater > 800.0f) && (camPreset != CAMERA_MODE_BEHIND_MARIO)) {
+ set_camera_mode(m->area->camera, CAMERA_MODE_BEHIND_MARIO, 1);
+ }
- if ((m->action & ACT_GROUP_MASK) == ACT_GROUP_SUBMERGED) {
- heightBelowWater = (f32)(m->waterLevel - 80) - m->pos[1];
- camPreset = m->area->camera->mode;
@@ -465,7 +465,7 @@ index 31e97bce..29b5e9c4 100644
+ if ((heightBelowWater < 400.0f) && (camPreset != CAMERA_MODE_WATER_SURFACE)) {
+ set_camera_mode(m->area->camera, CAMERA_MODE_WATER_SURFACE, 1);
+ }
- // As long as Mario isn't drowning or at the top
- // of the water with his head out, spawn bubbles.
- if (!(m->action & ACT_FLAG_INTANGIBLE)) {
@@ -488,7 +488,7 @@ index 31e97bce..29b5e9c4 100644
+ gWaterCamOverride ^= 1;
}
}
diff --git a/src/game/mario_actions_airborne.c b/src/game/mario_actions_airborne.c
index ce6467ef..c7e998c1 100644
--- a/src/game/mario_actions_airborne.c
@@ -496,7 +496,7 @@ index ce6467ef..c7e998c1 100644
@@ -1736,6 +1736,10 @@ s32 act_shot_from_cannon(struct MarioState *m) {
s32 act_flying(struct MarioState *m) {
s16 startPitch = m->faceAngle[0];
+ if (gPlayer1Controller->buttonPressed & R_TRIG) {
+ gFlyingCamOverride ^= 1;
+ }
@@ -507,33 +507,33 @@ index ce6467ef..c7e998c1 100644
@@ -1750,8 +1754,10 @@ s32 act_flying(struct MarioState *m) {
return set_mario_action(m, ACT_FREEFALL, 0);
}
- if (m->area->camera->mode != CAMERA_MODE_BEHIND_MARIO) {
+ if (!gFlyingCamOverride) {
set_camera_mode(m->area->camera, CAMERA_MODE_BEHIND_MARIO, 1);
+ } else {
+ set_camera_mode(m->area->camera, CAMERA_MODE_8_DIRECTIONS, 1);
}
if (m->actionState == 0) {
@@ -1933,7 +1939,7 @@ s32 act_flying_triple_jump(struct MarioState *m) {
}
if (m->vel[1] < 4.0f) {
- if (m->area->camera->mode != CAMERA_MODE_BEHIND_MARIO) {
+ if ((m->area->camera->mode != CAMERA_MODE_BEHIND_MARIO) && (!gFlyingCamOverride)) {
set_camera_mode(m->area->camera, CAMERA_MODE_BEHIND_MARIO, 1);
}
@@ -1944,7 +1950,7 @@ s32 act_flying_triple_jump(struct MarioState *m) {
set_mario_action(m, ACT_FLYING, 1);
}
- if (m->actionTimer++ == 10 && m->area->camera->mode != CAMERA_MODE_BEHIND_MARIO) {
+ if (m->actionTimer++ == 10 && m->area->camera->mode != CAMERA_MODE_BEHIND_MARIO && (!gFlyingCamOverride)) {
set_camera_mode(m->area->camera, CAMERA_MODE_BEHIND_MARIO, 1);
}
diff --git a/src/game/save_file.c b/src/game/save_file.c
index bcdcdbaf..3f0b8ca1 100644
--- a/src/game/save_file.c
@@ -541,7 +541,7 @@ index bcdcdbaf..3f0b8ca1 100644
@@ -673,6 +673,12 @@ u8 save_file_get_widescreen_mode(void) {
return gSaveBuffer.menuData[0].wideMode;
}
+void save_file_set_camera_speed(u8 speed) {
+ gSaveBuffer.menuData[0].cameraSpeedSetting = speed;
+ gMainMenuDataModified = TRUE;
@@ -550,11 +550,11 @@ index bcdcdbaf..3f0b8ca1 100644
+
void save_file_set_widescreen_mode(u8 mode) {
gSaveBuffer.menuData[0].wideMode = mode;
@@ -685,6 +691,10 @@ u16 save_file_get_sound_mode(void) {
return gSaveBuffer.menuData[0].soundMode;
}
+u8 save_file_get_camera_speed(void) {
+ return gSaveBuffer.menuData[0].cameraSpeedSetting;
+}
@@ -571,7 +571,7 @@ index 64cf0c63..085ec1d9 100644
u8 wideMode: 1;
#endif
+ u8 cameraSpeedSetting: 3;
#ifdef VERSION_EU
u8 language: 2;
@@ -178,6 +179,8 @@ u16 save_file_get_sound_mode(void);
@@ -581,5 +581,5 @@ index 64cf0c63..085ec1d9 100644
+u8 save_file_get_camera_speed(void);
+void save_file_set_camera_speed(u8 speed);
void save_file_move_cap_to_default_location(void);
void disable_warp_checkpoint(void);
+44 -44
View File
@@ -17,9 +17,9 @@ index 0000000..d7f27ad
++#define TEXT_HUD_CURRENT_RATIO_169 _("CURRENT ASPECT RATIO: 16:9. PRESS L TO SWITCH TO 4:3")
++#define TEXT_HUD_WIDE_INFO _("PLEASE CONFIGURE YOUR DISPLAY OR YOUR EMULATOR TO")
++#define TEXT_HUD_WIDE_INFO2 _("STRETCH THE IMAGE TO 16:9")
+
+
+ #if defined(VERSION_JP) || defined(VERSION_SH)
+
+
+diff --git a/src/game/ingame_menu.c b/src/game/ingame_menu.c
+index 8190f88..deb69f5 100644
+--- a/src/game/ingame_menu.c
@@ -33,7 +33,7 @@ index 0000000..d7f27ad
++u8 textWideInfo[] = { TEXT_HUD_WIDE_INFO };
++u8 textWideInfo2[] = { TEXT_HUD_WIDE_INFO2 };
++extern u8 widescreen = 0;
+
+
+ extern u8 gLastCompletedCourseNum;
+ extern u8 gLastCompletedStarNum;
+@@ -2266,6 +2271,14 @@ void render_pause_my_score_coins(void) {
@@ -49,7 +49,7 @@ index 0000000..d7f27ad
++ print_generic_string(10, 180, textWideInfo2);
++ }
+ #endif
+
+
+ actName = segmented_to_virtual(actNameTbl[(gCurrCourseNum - 1) * 6 + gDialogCourseActNum - 1]);
+@@ -2557,10 +2570,25 @@ void render_pause_castle_main_strings(s16 x, s16 y) {
+ }
@@ -63,7 +63,7 @@ index 0000000..d7f27ad
++ widescreen = 0;
++ }
++ }
+
+
+ gSPDisplayList(gDisplayListHead++, dl_ia_text_begin);
+ gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, gDialogTextAlpha);
+-
@@ -90,7 +90,7 @@ index 0000000..d7f27ad
++ widescreen = 0;
++ }
++ }
+
+
+ if (gMarioStates[0].action & ACT_FLAG_PAUSE_EXIT) {
+ render_pause_course_options(99, 93, &gDialogLineNum, 15);
+diff --git a/src/game/rendering_graph_node.c b/src/game/rendering_graph_node.c
@@ -102,7 +102,7 @@ index 0000000..d7f27ad
+ #include "shadow.h"
+ #include "sm64.h"
++#define WIDESCREEN
+
+
+ /**
+ * This file contains the code that processes the scene graph for rendering.
+@@ -235,6 +236,7 @@ static void geo_process_ortho_projection(struct GraphNodeOrthoProjection *node)
@@ -126,7 +126,7 @@ index 0000000..d7f27ad
++ aspect = 1.33333f;
++ }
+ #endif
+
+
+ guPerspective(mtx, &perspNorm, node->fov, aspect, node->near, node->far, 1.0f);
+diff --git a/src/menu/file_select.c b/src/menu/file_select.c
+index c894797..dc759f7 100644
@@ -150,7 +150,7 @@ index 0000000..d7f27ad
+--- a/src/menu/star_select.c
++++ b/src/menu/star_select.c
+@@ -52,7 +52,7 @@ static s8 sSelectableStarIndex = 0;
+
+
+ // Act Selector menu timer that keeps counting until you choose an act.
+ static s32 sActSelectorMenuTimer = 0;
+-
@@ -178,7 +178,7 @@ index 0000000..d7f27ad
+ }
+@@ -147,11 +154,21 @@ void bhv_act_selector_init(void) {
+ }
+
+
+ // Render star selector objects
+- for (i = 0; i < sVisibleStars; i++) {
+- sStarSelectorModels[i] =
@@ -201,7 +201,7 @@ index 0000000..d7f27ad
++ sStarSelectorModels[i]->oStarSelectorSize = 1.0f;
++ }
+ }
+
+
+ render_100_coin_star(stars);
diff --git a/enhancements/widescreenv2_ultrasm64.patch b/enhancements/widescreenv2_ultrasm64.patch
new file mode 100644
@@ -221,9 +221,9 @@ index 0000000..667e6e2
++#define TEXT_HUD_CURRENT_RATIO_169 _("CURRENT ASPECT RATIO: 16:9. PRESS L TO SWITCH TO 4:3")
++#define TEXT_HUD_WIDE_INFO _("PLEASE CONFIGURE YOUR DISPLAY OR YOUR EMULATOR TO")
++#define TEXT_HUD_WIDE_INFO2 _("STRETCH THE IMAGE TO 16:9")
+
+
+ #if defined(VERSION_JP) || defined(VERSION_SH)
+
+
+diff --git a/src/game/ingame_menu.c b/src/game/ingame_menu.c
+index 9344738..37bc1d1 100644
+--- a/src/game/ingame_menu.c
@@ -237,13 +237,13 @@ index 0000000..667e6e2
++u8 textWideInfo[] = { TEXT_HUD_WIDE_INFO };
++u8 textWideInfo2[] = { TEXT_HUD_WIDE_INFO2 };
++extern s32 widescreen = 0;
+
+
+ extern u8 gLastCompletedCourseNum;
+ extern u8 gLastCompletedStarNum;
+@@ -1672,6 +1677,7 @@ s8 gDialogCourseActNum = 1;
+ #define DIAG_VAL2 240 // JP & US
+ #endif
+
+
++
+ void render_dialog_entries(void) {
+ #ifdef VERSION_EU
@@ -256,7 +256,7 @@ index 0000000..667e6e2
++ //play_dialog_sound(gDialogID);
+ play_sound(SOUND_MENU_MESSAGE_APPEAR, gGlobalSoundSource);
+ }
+
+
+@@ -2199,6 +2205,7 @@ void render_pause_my_score_coins(void) {
+ #else
+ u8 textCourse[] = { TEXT_COURSE };
@@ -277,12 +277,12 @@ index 0000000..667e6e2
++ print_generic_string(10, 200, textWideInfo);
++ print_generic_string(10, 180, textWideInfo2);
++ }
++
++
+ #endif
+
+
++
+ actName = segmented_to_virtual(actNameTbl[(gCurrCourseNum - 1) * 6 + gDialogCourseActNum - 1]);
+
+
+ if (starFlags & (1 << (gDialogCourseActNum - 1))) {
+@@ -2557,10 +2574,25 @@ void render_pause_castle_main_strings(s16 x, s16 y) {
+ }
@@ -299,7 +299,7 @@ index 0000000..667e6e2
++ }
+ gSPDisplayList(gDisplayListHead++, dl_ia_text_begin);
+ gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, gDialogTextAlpha);
+
+
++ if (widescreen == 0) {
++ print_generic_string(10, 20, textCurrRatio43);
++ }
@@ -336,7 +336,7 @@ index 0000000..667e6e2
+ #include "shadow.h"
+ #include "sm64.h"
++#define WIDESCREEN
+
+
+ /**
+ * This file contains the code that processes the scene graph for rendering.
+@@ -235,6 +236,8 @@ static void geo_process_ortho_projection(struct GraphNodeOrthoProjection *node)
@@ -361,7 +361,7 @@ index 0000000..667e6e2
++ aspect = 1.33333f;
++ }
+ #endif
+
+
+ guPerspective(mtx, &perspNorm, node->fov, aspect, node->near, node->far, 1.0f);
+diff --git a/src/menu/file_select.c b/src/menu/file_select.c
+index 9437dcc..6ba1845 100644
@@ -385,11 +385,11 @@ index 0000000..667e6e2
+--- a/src/menu/star_select.c
++++ b/src/menu/star_select.c
+@@ -52,6 +52,7 @@ static s8 sSelectableStarIndex = 0;
+
+
+ // Act Selector menu timer that keeps counting until you choose an act.
+ static s32 sActSelectorMenuTimer = 0;
++extern s32 widescreen;
+
+
+ /**
+ * Act Selector Star Type Loop Action
+@@ -92,8 +93,14 @@ void bhv_act_selector_star_type_loop(void) {
@@ -411,7 +411,7 @@ index 0000000..667e6e2
+ }
+@@ -147,11 +154,21 @@ void bhv_act_selector_init(void) {
+ }
+
+
+ // Render star selector objects
+- for (i = 0; i < sVisibleStars; i++) {
+- sStarSelectorModels[i] =
@@ -434,7 +434,7 @@ index 0000000..667e6e2
++ sStarSelectorModels[i]->oStarSelectorSize = 1.0f;
++ }
+ }
+
+
+ render_100_coin_star(stars);
diff --git a/include/config.h b/include/config.h
index 211a086..d1eb721 100644
@@ -464,9 +464,9 @@ index 749179b..3b23b41 100644
+#define TEXT_HUD_CURRENT_RATIO_169 _("CURRENT ASPECT RATIO: 16:9. PRESS L TO SWITCH TO 4:3")
+#define TEXT_HUD_WIDE_INFO _("PLEASE CONFIGURE YOUR DISPLAY OR YOUR EMULATOR TO")
+#define TEXT_HUD_WIDE_INFO2 _("STRETCH THE IMAGE TO 16:9")
#if defined(VERSION_JP) || defined(VERSION_SH)
diff --git a/levels/castle_grounds/script.c b/levels/castle_grounds/script.c
index 626bece..b8191ea 100644
--- a/levels/castle_grounds/script.c
@@ -492,7 +492,7 @@ index 8190f88..e4d0f32 100644
+u8 textWideInfo[] = { TEXT_HUD_WIDE_INFO };
+u8 textWideInfo2[] = { TEXT_HUD_WIDE_INFO2 };
+u8 widescreen = 1;
extern u8 gLastCompletedCourseNum;
extern u8 gLastCompletedStarNum;
@@ -2266,6 +2271,24 @@ void render_pause_my_score_coins(void) {
@@ -505,7 +505,7 @@ index 8190f88..e4d0f32 100644
+ } else {
+ print_generic_string(10, 20, textCurrRatio43);
+ }
+
+
+ }
+ else {
+ if (COURSE_IS_MAIN_COURSE(gCurrCourseNum)) {
@@ -513,12 +513,12 @@ index 8190f88..e4d0f32 100644
+ } else {
+ print_generic_string(10, 20, textCurrRatio169);
+ }
+
+
+ print_generic_string(10, 200, textWideInfo);
+ print_generic_string(10, 180, textWideInfo2);
+ }
#endif
actName = segmented_to_virtual(actNameTbl[(gCurrCourseNum - 1) * 6 + gDialogCourseActNum - 1]);
@@ -2557,10 +2580,25 @@ void render_pause_castle_main_strings(s16 x, s16 y) {
}
@@ -532,7 +532,7 @@ index 8190f88..e4d0f32 100644
+ widescreen = 0;
+ }
+ }
gSPDisplayList(gDisplayListHead++, dl_ia_text_begin);
gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, gDialogTextAlpha);
-
@@ -559,7 +559,7 @@ index 8190f88..e4d0f32 100644
+ widescreen = 0;
+ }
+ }
if (gMarioStates[0].action & ACT_FLAG_PAUSE_EXIT) {
render_pause_course_options(99, 93, &gDialogLineNum, 15);
diff --git a/src/game/level_update.c b/src/game/level_update.c
@@ -567,14 +567,14 @@ index 4ecb902..b2d6e53 100644
--- a/src/game/level_update.c
+++ b/src/game/level_update.c
@@ -1247,6 +1247,10 @@ s32 lvl_init_or_update(s16 initOrUpdate, UNUSED s32 unused) {
return result;
}
+extern u8 widescreen;
+void lvl_set_widescreen(void) {
+ widescreen = 1;
+}
s32 lvl_init_from_save_file(UNUSED s16 arg0, s32 levelNum) {
#ifdef VERSION_EU
diff --git a/src/game/level_update.h b/src/game/level_update.h
@@ -586,7 +586,7 @@ index 521b4ef..58d4e75 100644
s32 lvl_play_the_end_screen_sound(UNUSED s16 arg0, UNUSED s32 arg1);
void basic_update(UNUSED s16 *arg);
+void lvl_set_widescreen(void);
#endif // LEVEL_UPDATE_H
diff --git a/src/game/rendering_graph_node.c b/src/game/rendering_graph_node.c
index 58238e8..09a6c87 100644
@@ -597,7 +597,7 @@ index 58238e8..09a6c87 100644
#include "shadow.h"
#include "sm64.h"
+#define WIDESCREEN
/**
* This file contains the code that processes the scene graph for rendering.
@@ -39,6 +40,7 @@
@@ -605,7 +605,7 @@ index 58238e8..09a6c87 100644
Mat4 gMatStack[32];
Mtx *gMatStackFixed[32];
+f32 aspect;
/**
* Animation nodes have state in global variables, so this struct captures
@@ -235,6 +237,7 @@ static void geo_process_ortho_projection(struct GraphNodeOrthoProjection *node)
@@ -628,7 +628,7 @@ index 58238e8..09a6c87 100644
+ aspect = 1.33333f;
+ }
#endif
guPerspective(mtx, &perspNorm, node->fov, aspect, node->near, node->far, 1.0f);
@@ -755,7 +763,7 @@ static s32 obj_is_in_view(struct GraphNodeObject *node, Mat4 matrix) {
// ! @bug The aspect ratio is not accounted for. When the fov value is 45,
@@ -636,7 +636,7 @@ index 58238e8..09a6c87 100644
// visibly pop in or out at the edge of the screen.
- halfFov = (gCurGraphNodeCamFrustum->fov / 2.0f + 1.0f) * 32768.0f / 180.0f + 0.5f;
+ halfFov = ((gCurGraphNodeCamFrustum->fov*aspect) / 2.0f + 1.0f) * 32768.0f / 180.0f + 0.5f;
hScreenEdge = -matrix[3][2] * sins(halfFov) / coss(halfFov);
// -matrix[3][2] is the depth, which gets multiplied by tan(halfFov) to get
diff --git a/src/menu/file_select.c b/src/menu/file_select.c
@@ -661,7 +661,7 @@ index 025dbf2..4840898 100644
--- a/src/menu/star_select.c
+++ b/src/menu/star_select.c
@@ -52,7 +52,7 @@ static s8 sSelectableStarIndex = 0;
// Act Selector menu timer that keeps counting until you choose an act.
static s32 sActSelectorMenuTimer = 0;
-
@@ -689,7 +689,7 @@ index 025dbf2..4840898 100644
}
@@ -147,11 +154,21 @@ void bhv_act_selector_init(void) {
}
// Render star selector objects
- for (i = 0; i < sVisibleStars; i++) {
- sStarSelectorModels[i] =
@@ -712,5 +712,5 @@ index 025dbf2..4840898 100644
+ sStarSelectorModels[i]->oStarSelectorSize = 1.0f;
+ }
}
render_100_coin_star(stars);
+12 -12
View File
@@ -17,9 +17,9 @@ index 0ea6be6..bba0a94 100644
--- a/levels/ending/leveldata.c
+++ b/levels/ending/leveldata.c
@@ -250,389 +250,63 @@ const Gfx dl_cake_end_screen_eu_070297D8[] = {
#include "levels/ending/cake.inc.c"
-// 0x07025800 - 0x07025840
-static const Vtx cake_end_vertex_07025800[] = {
- {{{ 0, 220, -1}, 0, { 0, 608}, {0xff, 0xff, 0xff, 0xff}}},
@@ -460,7 +460,7 @@ index 0ea6be6..bba0a94 100644
+ CAKE_RECT((row) * NUM_CAKE_TEXTURES_X + 2),\
+ CAKE_RECT((row) * NUM_CAKE_TEXTURES_X + 3),\
+ CAKE_RECT((row) * NUM_CAKE_TEXTURES_X + 4)
// 0x07026400 - 0x07027350
const Gfx dl_cake_end_screen[] = {
@@ -640,198 +314,27 @@ const Gfx dl_cake_end_screen[] = {
@@ -659,7 +659,7 @@ index 0ea6be6..bba0a94 100644
- gsDPLoadTextureBlock(cake_end_texture_47, G_IM_FMT_RGBA, G_IM_SIZ_16b, 80, 20, 0, G_TX_CLAMP, G_TX_CLAMP, 7, 6, G_TX_NOLOD, G_TX_NOLOD),
- gsSPVertex(cake_end_vertex_070263C0, 4, 0),
- gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0),
+
+
+ gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b_LOAD_BLOCK, 0, 0,
+ G_TX_LOADTILE, 0,
+ G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD,
@@ -680,7 +680,7 @@ index 0ea6be6..bba0a94 100644
+ CAKE_ROW(5),
+ CAKE_ROW(6),
+ CAKE_ROW(7),
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
diff --git a/tools/skyconv.c b/tools/skyconv.c
@@ -699,23 +699,23 @@ index b515373..1fdf027 100644
[CakeEU] = {
{320, 224, 64, 32, 5, 7, false, false},
@@ -62,7 +62,7 @@ typedef struct {
static const TableDimension TABLE_DIMENSIONS[ImageType_MAX] = {
[Skybox] = {8, 10},
- [Cake] = {4, 12},
+ [Cake] = {5, 8},
[CakeEU] = {5, 7},
};
@@ -104,15 +104,26 @@ static void split_tile(int col, int row, rgba *image, bool expanded) {
int tileWidth = props.tileWidth;
int tileHeight = props.tileHeight;
int imageWidth = props.imageWidth;
+ int imageHeight = props.imageHeight;
int numCols = props.numCols;
int expandedWidth = IMAGE_PROPERTIES[type][true].tileWidth;
+ rgba black = {0, 0, 0, 0};
+
for (int y = 0; y < tileHeight; y++) {
@@ -731,13 +731,13 @@ index b515373..1fdf027 100644
+ {
+ tiles[row * numCols + col].px[y * expandedWidth + x] = black;
+ }
+
+
}
}
}
@@ -339,11 +350,12 @@ static void write_cake_c() {
}
int numTiles = TABLE_DIMENSIONS[type].cols * TABLE_DIMENSIONS[type].rows;
+ fprintf(cFile, "ALIGNED8 static const u8 cake_end_texture_%sdata[] = {\n", euSuffx);
for (int i = 0; i < numTiles; ++i) {
@@ -749,4 +749,4 @@ index b515373..1fdf027 100644
+ fputs("};\n\n", cFile);
fclose(cFile);
}
+3 -3
View File
@@ -223,9 +223,9 @@
#define CHANGE_AREA_SKYBOX(area, segStart, segEnd) \
CMD_BBH(0x3E, 0x0C, area), \
CMD_PTR(segStart), \
CMD_PTR(segEnd)
CMD_PTR(segEnd)
#define INIT_LEVEL() \
CMD_BBH(0x1B, 0x04, 0x0000)
+1 -1
View File
@@ -2,7 +2,7 @@
#define TEXT_MENU_STRINGS_H
// These strings use a different table defined in menu_hud_lut
// Unlike text_strings.h.in, the charmap is different and
// Unlike text_strings.h.in, the charmap is different and
// uses char values from charmap_menu.txt
/**
+1 -1
View File
@@ -574,7 +574,7 @@ static const Lights1 inside_castle_seg7_lights_07022528 = gdSPDefLights1(
// No gdSPDefLights1 macro defined because of odd different light value (0xff and 0xfa)
static const Lights1 inside_castle_seg7_lights_07022540 = {
{{ {0x40, 0x40, 0x80}, 0, {0x40, 0x40, 0x80}, 0} },
{{{ {0x64, 0x64, 0xff}, 0, {0x64, 0x64, 0xfa}, 0, {0x28, 0x28, 0x28},0} }}
{{{ {0x64, 0x64, 0xff}, 0, {0x64, 0x64, 0xfa}, 0, {0x28, 0x28, 0x28},0} }}
};
// 0x07022558 - 0x07022598
+1 -1
View File
@@ -319,7 +319,7 @@ const Gfx dl_cake_end_screen[] = {
gsDPSetCombineMode(G_CC_DECALRGB, G_CC_DECALRGB),
gsDPSetRenderMode(G_RM_AA_OPA_SURF, G_RM_AA_OPA_SURF2),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b_LOAD_BLOCK, 0, 0,
G_TX_LOADTILE, 0,
G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD,
+1 -1
View File
@@ -10,7 +10,7 @@ static const Lights1 hmc_seg7_lights_070241B8 = gdSPDefLights1(
// No gdSPDefLights1 macro defined because of odd different light value (0xff and 0xfa)
static const Lights1 hmc_seg7_lights_070241D0 = {
{{ {0x40, 0x40, 0x80}, 0, {0x40, 0x40, 0x80}, 0} },
{{{ {0x64, 0x64, 0xff}, 0, {0x64, 0x64, 0xfa}, 0, {0x28, 0x28, 0x28},0} }}
{{{ {0x64, 0x64, 0xff}, 0, {0x64, 0x64, 0xfa}, 0, {0x28, 0x28, 0x28},0} }}
};
// Appears to lock 4 of the sides when shimmering and in use. Unused.
+2 -2
View File
@@ -174,7 +174,7 @@ SECTIONS
*/libgcc.a:*.o(.text);
*/libz.a:*.o(.text);
*/libhvqm2.a:*.o(.text);
BUILD_DIR/lib/rsp.o(.text);
BUILD_DIR/lib/rsp.o(.text);
lib/PR/hvqm/hvqm2sp1.o(.text);
_mainSegmentTextEnd = .;
@@ -500,7 +500,7 @@ SECTIONS
KEEP(BUILD_DIR/sound/sound_data.o(.data));
}
END_SEG(assets)
#ifdef HVQM
#ifdef HVQM
BEGIN_SEG(capcom, __romPos) SUBALIGN(2)
{
KEEP(BUILD_DIR/data/capcom.o(.data));
+2 -2
View File
@@ -89,7 +89,7 @@ chan_dyncall
.poll_023589:
chan_delay1
chan_ioreadval 0
chan_bltz .skip_023589 // if we have a signal:
chan_bltz .skip_023589 // if we have a signal:
chan_beqz .force_stop_023589 // told to stop
chan_jump .start_playing_023589 // told to play something else
.skip_023589:
@@ -2696,7 +2696,7 @@ layer_jump .layer_C4E
chan_setinstr 0
chan_setlayer 0, .layer_FA2_eu
chan_end
.layer_FA2_eu:
layer_delay 0x5
layer_end
-11
View File
@@ -780,13 +780,9 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI
}
#else
u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateIndex) {
UNUSED s32 pad1[1];
s16 ra;
s16 t4;
UNUSED s32 pad[2];
struct ReverbRingBufferItem *v1;
UNUSED s32 pad2[1];
s16 temp;
v1 = &gSynthesisReverb.items[gSynthesisReverb.curFrame][updateIndex];
@@ -800,7 +796,6 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI
if (v1->lengthB != 0) {
// Ring buffer wrapped
aSetLoadBufferPair(cmd++, v1->lengthA, 0);
temp = 0;
}
// Use the reverb sound as initial sound for this audio update
@@ -814,18 +809,12 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI
/*out*/ DMEM_ADDR_WET_LEFT_CH);
} else {
// Same as above but upsample the previously downsampled samples used for reverb first
temp = 0; //! jesus christ
t4 = (v1->startPos & 7) * 2;
ra = AUDIO_ALIGN(v1->lengthA + t4, 4);
aSetLoadBufferPair(cmd++, 0, v1->startPos - t4 / 2);
if (v1->lengthB != 0) {
// Ring buffer wrapped
aSetLoadBufferPair(cmd++, ra, 0);
//! We need an empty statement (even an empty ';') here to make the function match (because IDO).
//! However, copt removes extraneous statements and dead code. So we need to trick copt
//! into thinking 'temp' could be undefined, and luckily the compiler optimizes out the
//! useless assignment.
ra = ra + temp;
}
aSetBuffer(cmd++, 0, t4 + DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_LEFT_CH, bufLen << 1);
aResample(cmd++, gSynthesisReverb.resampleFlags, (u16) gSynthesisReverb.resampleRate, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.resampleStateLeft));
+13 -13
View File
@@ -496,27 +496,27 @@ void get_audio_frequency(void)
void thread1_idle(UNUSED void *arg) {
osCreateViManager(OS_PRIORITY_VIMGR);
switch ( osTvType ) {
case OS_TV_NTSC:
// NTSC
switch ( osTvType ) {
case OS_TV_NTSC:
// NTSC
//osViSetMode(&osViModeTable[OS_VI_NTSC_LAN1]);
VI = osViModeTable[OS_VI_NTSC_LAN1];
gConfig.tvType = MODE_NTSC;
break;
case OS_TV_MPAL:
// MPAL
break;
case OS_TV_MPAL:
// MPAL
//osViSetMode(&osViModeTable[OS_VI_MPAL_LAN1]);
VI = osViModeTable[OS_VI_NTSC_LAN1];
gConfig.tvType = MODE_MPAL;
break;
case OS_TV_PAL:
// PAL
//osViSetMode(&osViModeTable[OS_VI_PAL_LAN1]);
break;
case OS_TV_PAL:
// PAL
//osViSetMode(&osViModeTable[OS_VI_PAL_LAN1]);
VI = osViModeTable[OS_VI_NTSC_LAN1];
gConfig.tvType = MODE_PAL;
break;
}
get_audio_frequency();
break;
}
get_audio_frequency();
change_vi(&VI, SCREEN_WIDTH, SCREEN_HEIGHT);
osViSetMode(&VI);
osViBlack(TRUE);
+2 -2
View File
@@ -416,7 +416,7 @@ void *load_segment_decompress(s32 segment, u8 *srcStart, u8 *srcEnd) {
dest = main_pool_alloc(*size, MEMORY_POOL_LEFT);
#endif
if (dest != NULL) {
osSyncPrintf("start decompress\n");
osSyncPrintf("start decompress\n");
#ifdef GZIP
expand_gzip(compressed, dest, compSize, (u32)size);
#elif RNC1
@@ -428,7 +428,7 @@ void *load_segment_decompress(s32 segment, u8 *srcStart, u8 *srcEnd) {
#elif MIO0
decompress(compressed, dest);
#endif
osSyncPrintf("end decompress\n");
osSyncPrintf("end decompress\n");
set_segment_base_addr(segment, dest);
main_pool_free(compressed);
} else {
+5 -5
View File
@@ -1,10 +1,10 @@
/*
/*
* N64-HVQM2 library Sample program
*
*
* FILE : adpcmbuf.c
*
*
* Copyright (C) 1998,1999 NINTENDO Co.,Ltd.
*
*
*/
/* 1999-02-22 */
@@ -16,7 +16,7 @@
/*
* Buffer for audio records (ADPCM data) read from the HVQM2 data.
* (Note) Please locate at a 16byte aligned address with the spec file.
* (Note) Please locate at a 16byte aligned address with the spec file.
*/
ALIGNED16 u8 adpcmbuf[AUDIO_RECORD_SIZE_MAX];
+5 -5
View File
@@ -1,10 +1,10 @@
/*
/*
* N64-HVQM2 library Sample program
*
*
* FILE : hvqbuf.c
*
*
* Copyright (C) 1998,1999 NINTENDO Co.,Ltd.
*
*
*/
/* 1999-02-22 */
@@ -15,7 +15,7 @@
#include <hvqm/hvqm.h>
/*
* Buffer for video records (HVQM2 compressed data) read from
* Buffer for video records (HVQM2 compressed data) read from
* the HVQM2 data.
* (Note) Please locate at a 16byte aligned address with the spec file.
*/
+4 -4
View File
@@ -1,10 +1,10 @@
/*
/*
* N64-HVQM2 library Sample program
*
*
* FILE : hvqmwork.c
*
*
* Copyright (C) 1998,1999 NINTENDO Co.,Ltd.
*
*
*/
/* 1999-02-12 */
+2 -4
View File
@@ -784,8 +784,6 @@ static s32 bhv_cmd_scale(void) {
// Command 0x30: Sets various parameters that the object uses for calculating physics.
// Usage: SET_OBJ_PHYSICS(wallHitboxRadius, gravity, bounciness, dragStrength, friction, buoyancy, unused1, unused2)
static s32 bhv_cmd_set_obj_physics(void) {
UNUSED f32 unused1, unused2;
gCurrentObject->oWallHitboxRadius = BHV_CMD_GET_1ST_S16(1);
gCurrentObject->oGravity = BHV_CMD_GET_2ND_S16(1) / 100.0f;
gCurrentObject->oBounciness = BHV_CMD_GET_1ST_S16(2) / 100.0f;
@@ -793,8 +791,8 @@ static s32 bhv_cmd_set_obj_physics(void) {
gCurrentObject->oFriction = BHV_CMD_GET_1ST_S16(3) / 100.0f;
gCurrentObject->oBuoyancy = BHV_CMD_GET_2ND_S16(3) / 100.0f;
unused1 = BHV_CMD_GET_1ST_S16(4) / 100.0f;
unused2 = BHV_CMD_GET_2ND_S16(4) / 100.0f;
UNUSED f32 unused1 = BHV_CMD_GET_1ST_S16(4) / 100.0f;
UNUSED f32 unused2 = BHV_CMD_GET_2ND_S16(4) / 100.0f;
gCurBhvCommand += 5;
return BHV_PROC_CONTINUE;
+2 -16
View File
@@ -498,23 +498,9 @@ static void load_environmental_regions(TerrainData **data) {
gEnvironmentRegions = *data;
numRegions = *(*data)++;
if (numRegions > 20) {
}
for (i = 0; i < numRegions; i++) {
UNUSED TerrainData val, loX, loZ, hiX, hiZ;
TerrainData height;
val = *(*data)++;
loX = *(*data)++;
hiX = *(*data)++;
loZ = *(*data)++;
hiZ = *(*data)++;
height = *(*data)++;
gEnvironmentLevels[i] = height;
*data += 5;
gEnvironmentLevels[i] = *(*data)++;
}
}
-3
View File
@@ -27,9 +27,6 @@ enum
typedef struct SurfaceNode SpatialPartitionCell[4];
// Needed for bs bss reordering memes.
extern s32 unused8038BE90;
extern SpatialPartitionCell gStaticSurfacePartition[NUM_CELLS][NUM_CELLS];
extern SpatialPartitionCell gDynamicSurfacePartition[NUM_CELLS][NUM_CELLS];
extern struct SurfaceNode *sSurfaceNodePool;
-1
View File
@@ -63,7 +63,6 @@ void _Ldtob(printf_struct *args, u8 type) {
u8 drop;
s32 n2;
/* */
UNUSED u8 unused[0x4];
ptr = buff;
val = args->value.f64;
if (args->precision < 0) {
@@ -61,8 +61,6 @@ void bhv_activated_back_and_forth_platform_init(void) {
* Activated back-and-forth platform update function.
*/
void bhv_activated_back_and_forth_platform_update(void) {
UNUSED s32 unused[3];
// oVelY is used for vertical platforms' movement and also for
// horizontal platforms' dipping up/down when Mario gets on/off them
if (gMarioObject->platform == o) {
@@ -8,8 +8,6 @@
* Update function for bhvBbhTiltingTrapPlatform.
*/
void bhv_bbh_tilting_trap_platform_loop(void) {
UNUSED s32 unused;
// US (and probably later) versions use oAction for the
// if statement, while immediately setting it over here.
// This was done so that Mario leaving or getting on the platform
@@ -12,6 +12,5 @@
* Update function for bhvBetaFishSplashSpawner.
*/
void bhv_beta_fish_splash_spawner_loop(void) {
UNUSED u8 pad[12];
UNUSED f32 water_level = find_water_level(o->oPosX, o->oPosZ);
// UNUSED f32 water_level = find_water_level(o->oPosX, o->oPosZ);
}
-1
View File
@@ -52,7 +52,6 @@ static void bird_act_inactive(void) {
* and the parent spawner bird if it's a spawned bird.
*/
static void bird_act_fly(void) {
UNUSED s32 unused;
f32 distance;
// Compute forward velocity and vertical velocity from oBirdSpeed and pitch
+17 -17
View File
@@ -12,13 +12,13 @@ void bhv_blue_fish_movement_loop(void) {
// Initial dive phase after spawning
case BLUE_FISH_ACT_DIVE:
cur_obj_init_animation_with_accel_and_sound(0, 1.0f);
// Assigns random values to variables that help determine natural motion.
if (o->oTimer == 0) {
o->oBlueFishRandomAngle = random_sign() << 11;
o->oBlueFishRandomVel = random_float() * 2;
o->oBlueFishRandomTime = (s32)(random_float() * 30) & 0xFE;
// Adjusts pitch velocity or sets to zero dependant on outcome of randomSwitch.
randomSwitch = random_float() * 5;
if (randomSwitch < 2.0f) {
@@ -27,20 +27,20 @@ void bhv_blue_fish_movement_loop(void) {
o->oAngleVelPitch = 0;
}
}
// Set forward velocity and progress oAction to BLUE_FISH_ACT_TURN.
o->oForwardVel = o->oBlueFishRandomVel + 3.0f;
if (o->oTimer >= o->oBlueFishRandomTime + 60) {
o->oAction++;
}
// Set pitch velocity
if (o->oTimer < (o->oBlueFishRandomTime + 60) / 2) {
o->oFaceAnglePitch += o->oAngleVelPitch;
} else {
o->oFaceAnglePitch -= o->oAngleVelPitch;
}
// Calculate new Y velocity
o->oVelY = -sins(o->oFaceAnglePitch) * o->oForwardVel;
break;
@@ -51,39 +51,39 @@ void bhv_blue_fish_movement_loop(void) {
if (o->oTimer == 15) {
o->oAction++;
}
break;
break;
// Animates and adjusts pitch to an upward direction.
case BLUE_FISH_ACT_ASCEND:
cur_obj_init_animation_with_accel_and_sound(0, 1.0f);
// Progresses oAction to BLUE_FISH_ACT_TURN_BACK after elapsed time.
// Progresses oAction to BLUE_FISH_ACT_TURN_BACK after elapsed time.
if (o->oTimer >= o->oBlueFishRandomTime + 60) {
o->oAction++;
}
// Adjusts pitch angle. Direction relies on time not passed.
if (o->oTimer < (o->oBlueFishRandomTime + 60) / 2) {
o->oFaceAnglePitch -= o->oAngleVelPitch;
} else {
o->oFaceAnglePitch += o->oAngleVelPitch;
}
break;
break;
// Animates and turns fish around
case BLUE_FISH_ACT_TURN_BACK:
cur_obj_init_animation_with_accel_and_sound(0, 2.0f);
o->oMoveAngleYaw = (s32)(o->oBlueFishRandomAngle + o->oMoveAngleYaw);
// Sets the fish back to the BLUE_FISH_ACT_DIVE phase.
if (o->oTimer == 15) {
o->oAction = BLUE_FISH_ACT_DIVE;
}
break;
}
// Calculates Y velocity and calls physics engine.
o->oVelY = -sins(o->oFaceAnglePitch) * o->oForwardVel;
cur_obj_move_using_fvel_and_gravity();
// Deletes object if the parent has oAction set to BLUE_FISH_ACT_DUPLICATE.
if (o->parentObj->oAction == BLUE_FISH_ACT_DUPLICATE) {
obj_mark_for_deletion(o);
@@ -100,25 +100,25 @@ void bhv_tank_fish_group_loop(void) {
switch (o->oAction) {
case BLUE_FISH_ACT_SPAWN:
if (gMarioCurrentRoom == 15 || gMarioCurrentRoom == 7) {
// spawns fifteen fish and moves them within 200.0f
for (i = 0; i < 15; i++) {
fish = spawn_object_relative(0, 300, 0, -200, o, MODEL_FISH, bhvBlueFish);
obj_translate_xyz_random(fish, 200.0f);
}
// Proceed to BLUE_FISH_ACT_ROOM phase.
o->oAction++;
}
break;
// Sets next oAction phase if Mario is not in rooms fifteen and seven.
case BLUE_FISH_ACT_ROOM:
if (gMarioCurrentRoom != 15 && gMarioCurrentRoom != 7) {
o->oAction++;
}
break;
// Sets oAction to the BLUE_FISH_ACT_SPAWN phase.
case BLUE_FISH_ACT_DUPLICATE:
o->oAction = BLUE_FISH_ACT_SPAWN;
-2
View File
@@ -25,8 +25,6 @@ static struct ObjectHitbox sBooCageHitbox = {
* Update function for bhvBooCage.
*/
void bhv_boo_cage_loop(void) {
UNUSED s32 unused;
obj_set_hitbox(o, &sBooCageHitbox);
switch (o->oAction) {
+5 -13
View File
@@ -428,7 +428,7 @@ void bowser_set_act_big_jump(void) {
void bowser_bits_actions(void) {
switch (o->oBowserIsReacting) {
case FALSE:
// oBowserBitsJustJump never changes value,
// oBowserBitsJustJump never changes value,
// so its always FALSE, maybe a debug define
if (o->oBowserBitsJustJump == FALSE) {
bowser_bits_action_list();
@@ -726,7 +726,6 @@ void bowser_short_second_hop(void) {
* Makes Bowser do a big jump
*/
void bowser_act_big_jump(void) {
UNUSED s32 unused;
if (o->oSubAction == 0) {
// Set jump animation
if (bowser_set_anim_jump()) {
@@ -982,7 +981,6 @@ s32 bowser_check_hit_mine(void) {
* Bowser's thrown act that gets called after Mario releases him
*/
void bowser_act_thrown(void) {
UNUSED s32 unused;
// Keep Bowser's timer at 0 unless he lands
if (o->oTimer < 2)
o->oBowserTimer = 0;
@@ -1026,7 +1024,6 @@ void bowser_set_goal_invisible(void) {
*/
void bowser_act_jump_onto_stage(void) {
s32 onDynamicFloor;
UNUSED s32 unused;
struct Surface *floor = o->oFloor;
// Set dynamic floor check (Object platforms)
@@ -1286,7 +1283,6 @@ s32 bowser_dead_default_stage_ending(void) {
* Returns TRUE once done
*/
s32 bowser_dead_final_stage_ending(void) {
UNUSED s32 unused;
s32 ret = FALSE;
s32 dialogID;
if (o->oBowserTimer < 2) {
@@ -1383,11 +1379,11 @@ struct BowserTiltPlatformInfo {
// 0 = Don't move
// 1 = Move angle behind Bowser
// -1 = Move angle in front of Bowser
s16 flag;
s16 flag;
// Sets platform's tilt angle speed (pattern: positive then negative)
s16 angSpeed;
s16 angSpeed;
// Sets how much time the platform can tilt, increases each move
s16 time;
s16 time;
};
/**
@@ -1414,9 +1410,7 @@ struct BowserTiltPlatformInfo sBowsertiltPlatformData[] = {
void bowser_act_tilt_lava_platform(void) {
// Set platform object
struct Object *platform = cur_obj_nearest_object_with_behavior(bhvTiltingBowserLavaPlatform);
UNUSED s16 angle = o->oBowserAngleToCentre + 0x8000;
s16 angSpeed;
UNUSED s32 unused;
s32 i;
s32 isNotTilting;
// If there's not platform, return to default action
@@ -1875,14 +1869,12 @@ void bowser_open_eye_switch(struct Object *obj, struct GraphNodeSwitchCase *swit
* direction otherwise.
*/
Gfx *geo_switch_bowser_eyes(s32 callContext, struct GraphNode *node, UNUSED Mat4 *mtx) {
UNUSED s16 eyeShut;
UNUSED s32 unused;
struct Object *obj = (struct Object *) gCurGraphNodeObject;
struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *) node;
if (callContext == GEO_CONTEXT_RENDER) {
if (gCurGraphNodeHeldObject != NULL)
obj = gCurGraphNodeHeldObject->objNode;
switch (eyeShut = obj->oBowserEyesShut) {
switch (obj->oBowserEyesShut) {
case FALSE: // eyes open, handle eye looking direction
bowser_open_eye_switch(obj, switchCase);
break;
@@ -27,7 +27,6 @@ void falling_bowser_plat_act_start(void) {
}
void falling_bowser_plat_act_check(void) {
UNUSED s32 unused;
struct Object *bowser = o->oBitsPlatformBowser;
if (bowser->platform == o) {
if (bowser->oAction == BOWSER_ACT_BIG_JUMP && bowser->oBowserStatus & BOWSER_STATUS_BIG_JUMP) {
+1 -4
View File
@@ -116,8 +116,6 @@ void bhv_flame_moving_forward_growing_init(void) {
}
void bhv_flame_moving_forward_growing_loop(void) {
UNUSED s32 unused;
UNUSED struct Object *flame;
obj_set_hitbox(o, &sGrowingBowserFlameHitbox);
o->oFlameScale = o->oFlameScale + 0.5;
cur_obj_scale(o->oFlameScale);
@@ -131,7 +129,7 @@ void bhv_flame_moving_forward_growing_loop(void) {
}
if (o->oPosY < o->oFloorHeight) {
o->oPosY = o->oFloorHeight;
flame = spawn_object(o, MODEL_RED_FLAME, bhvFlameBowser);
spawn_object(o, MODEL_RED_FLAME, bhvFlameBowser);
obj_mark_for_deletion(o);
}
}
@@ -152,7 +150,6 @@ void bhv_flame_floating_landing_init(void) {
f32 sFlameFloatingYLimit[] = { -8.0f, -6.0f, -3.0f };
void bhv_flame_floating_landing_loop(void) {
UNUSED s32 unused;
cur_obj_update_floor_and_walls();
cur_obj_move_standard(78);
bowser_flame_move();
+2 -4
View File
@@ -29,9 +29,7 @@ static void camera_lakitu_intro_act_trigger_cutscene(void) {
//! These bounds are slightly smaller than the actual bridge bounds, allowing
// the RTA speedrunning method of lakitu skip
if (gMarioObject->oPosX > -544.0f && gMarioObject->oPosX < 545.0f && gMarioObject->oPosY > 800.0f
&& gMarioObject->oPosZ > -2000.0f && gMarioObject->oPosZ < -177.0f
&& gMarioObject->oPosZ < -177.0f) // always double check your conditions
{
&& gMarioObject->oPosZ > -2000.0f && gMarioObject->oPosZ < -177.0f) {
if (set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_START) {
o->oAction = CAMERA_LAKITU_INTRO_ACT_SPAWN_CLOUD;
}
@@ -115,7 +113,7 @@ static void camera_lakitu_intro_act_show_dialog(void) {
}
}
}
} else if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
} else if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, DIALOG_034)) {
o->oCameraLakituFinishedDialog = TRUE;
}
-2
View File
@@ -86,7 +86,6 @@ void opened_cannon_act_5(void) {
}
void opened_cannon_act_1(void) {
UNUSED s32 unused;
cur_obj_become_intangible();
cur_obj_disable_rendering();
o->oCannonIsActive = 0;
@@ -98,7 +97,6 @@ void opened_cannon_act_2(void) {
}
void opened_cannon_act_3(void) {
UNUSED s32 unused;
if (o->oTimer > 3)
o->oAction = 0;
}
+2 -2
View File
@@ -39,9 +39,9 @@ void cap_switch_act_2(void) {
}
} else {
//! Neither of these flags are defined in this function so they do nothing.
// On an extra note, there's a specific check for this cutscene and
// On an extra note, there's a specific check for this cutscene and
// there's no dialog defined since the cutscene itself calls the dialog.
response = cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_FRONT,
response = cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_FRONT,
(DIALOG_FLAG_TEXT_RESPONSE | DIALOG_FLAG_UNK_CAPSWITCH), CUTSCENE_CAP_SWITCH_PRESS, 0);
if (response)
o->oAction = 3;
@@ -54,7 +54,6 @@ void bhv_castle_floor_trap_rotate(void) {
}
void bhv_castle_floor_trap_loop(void) {
UNUSED s32 unused[3];
switch (o->oAction) {
case 0:
bhv_castle_floor_trap_open_detect();
+1 -1
View File
@@ -256,7 +256,7 @@ static void chain_chomp_released_trigger_cutscene(void) {
//! Can delay this if we get into a cutscene-unfriendly action after the
// last post ground pound and before this
if (set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_SPEAK
if (set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_SPEAK
&& (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) && cutscene_object(CUTSCENE_STAR_SPAWN, o) == 1) {
o->oChainChompReleaseStatus = CHAIN_CHOMP_RELEASED_LUNGE_AROUND;
o->oTimer = 0;
-6
View File
@@ -6,12 +6,6 @@ struct UnusedChuckyaData {
f32 unk8;
};
struct UnusedChuckyaData sUnusedChuckyaData[] = { { 2, 0.f, 1.f },
{ 2, 10.f, 1.f },
{ 2, 20.f, 1.f },
{ 2, 20.f, 1.f },
{ 8, 10.f, 1.f }};
void common_anchor_mario_behavior(f32 forwardVel, f32 yVel, s32 flag) {
switch (o->parentObj->oCommonAnchorAction) {
case 0:
@@ -24,7 +24,6 @@ void bhv_punch_tiny_triangle_loop(void) {
void bhv_punch_tiny_triangle_init(void) {
s32 i;
UNUSED s32 unused;
struct Object *triangle;
for (i = 0; i < 6; i++) {
triangle = spawn_object(o, MODEL_DIRT_ANIMATION, bhvPunchTinyTriangle);
@@ -50,7 +49,6 @@ void bhv_wall_tiny_star_particle_loop(void) {
void bhv_tiny_star_particles_init(void) {
s32 i;
UNUSED s32 unused;
struct Object *particle;
for (i = 0; i < 7; i++) {
particle = spawn_object(o, MODEL_CARTOON_STAR, bhvWallTinyStarParticle);
+1 -1
View File
@@ -45,7 +45,7 @@ void play_warp_door_open_noise(void) {
void bhv_door_loop(void) {
s32 index = 0;
while (sDoorActions[index].flag != (u32)~0) {
if (cur_obj_clear_interact_status_flag(sDoorActions[index].flag)) {
set_door_camera_event();
+1 -3
View File
@@ -68,7 +68,7 @@ void dorrie_act_lower_head(void) {
if (o->oTimer > 150) {
dorrie_begin_head_raise(FALSE);
} else if (gMarioObject->platform == o) {
if (o->oDorrieForwardDistToMario > 830.0f
if (o->oDorrieForwardDistToMario > 830.0f
&& set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_START) {
dorrie_begin_head_raise(TRUE);
} else if (o->oDorrieForwardDistToMario > 320.0f) {
@@ -112,8 +112,6 @@ void dorrie_act_raise_head(void) {
void bhv_dorrie_update(void) {
f32 boundsShift;
UNUSED s32 unused1;
UNUSED s32 unused2;
f32 maxOffsetY;
if (!(o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM)) {
+6 -6
View File
@@ -1,11 +1,11 @@
// elevator.c.inc
static s16 sElevatorHeights[] = { -51, 0, 0,
-461, 0, 0,
-512, 0, 0,
-2611, 0, 0,
-2360, 0, 0,
214, 0, 0,
static s16 sElevatorHeights[] = { -51, 0, 0,
-461, 0, 0,
-512, 0, 0,
-2611, 0, 0,
-2360, 0, 0,
214, 0, 0,
-50, 1945, 1 };
void elevator_starting_shake(void) {
-1
View File
@@ -86,7 +86,6 @@ void exclamation_box_act_2(void) {
}
void exclamation_box_act_3(void) {
UNUSED s32 unused;
cur_obj_move_using_fvel_and_gravity();
if (o->oVelY < 0.0f) {
o->oVelY = 0.0f;
+4 -6
View File
@@ -84,7 +84,7 @@ void bhv_fish_spawner_loop(void) {
static void fish_vertical_roam(s32 speed) {
f32 parentY = o->parentObj->oPosY;
// If the stage is Secret Aquarium, the fish can
// If the stage is Secret Aquarium, the fish can
// travel as far vertically as they wish.
if (gCurrLevelNum == LEVEL_SA) {
if (500.0f < absf(o->oPosY - o->oFishGoalY)) {
@@ -125,7 +125,7 @@ static void fish_act_roam(void) {
}
o->oFishGoalY = gMarioObject->oPosY + o->oFishHeightOffset;
// Rotate the fish towards Mario.
cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
@@ -201,7 +201,7 @@ static void fish_act_flee(void) {
} else {
fish_vertical_roam(4);
}
// Don't let the fish leave the water vertically.
} else {
o->oPosY = o->oFishWaterLevel - 50.0f;
@@ -234,9 +234,7 @@ static void (*sFishActions[])(void) = {
/**
* Main loop for fish
*/
void bhv_fish_loop(void)
{
UNUSED s32 unused[4];
void bhv_fish_loop(void) {
cur_obj_scale(1.0f);
// oFishWaterLevel tracks if a fish has roamed out of water.
-1
View File
@@ -38,7 +38,6 @@ void bhv_flamethrower_loop(void) {
f32 flameVel;
s32 flameTimeRemaining;
s32 model;
UNUSED u8 pad[8];
if (o->oAction == 0) {
if (gCurrLevelNum != LEVEL_BBH || gMarioOnMerryGoRound == TRUE)
if (o->oDistanceToMario < 2000.0f)
-2
View File
@@ -67,9 +67,7 @@ static u8 sGoombaAttackHandlers[][6] = {
* Update function for goomba triplet spawner.
*/
void bhv_goomba_triplet_spawner_update(void) {
UNUSED s32 unused1;
s16 goombaFlag;
UNUSED s16 unused2;
s32 angle;
s32 dAngle;
s16 dx;
-1
View File
@@ -41,7 +41,6 @@ void heave_ho_act_1(void) {
}
void heave_ho_act_2(void) {
UNUSED s32 unused;
s16 angleVel;
if (1000.0f < cur_obj_lateral_dist_from_mario_to_home())
o->oAngleToMario = cur_obj_angle_to_home();
+1 -1
View File
@@ -232,7 +232,7 @@ void bhv_hoot_loop(void) {
case HOOT_AVAIL_WANTS_TO_TALK:
hoot_awake_loop();
if (set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_SPEAK
if (set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_SPEAK
&& cutscene_object_with_dialog(CUTSCENE_DIALOG, o, DIALOG_044)) {
set_mario_npc_dialog(MARIO_DIALOG_STOP);
-3
View File
@@ -24,11 +24,9 @@ void intro_lakitu_set_offset_from_camera(struct Object *o, Vec3f offset) {
}
void intro_lakitu_set_focus(struct Object *o, Vec3f newFocus) {
UNUSED Vec3f unusedVec3f;
Vec3f origin;
f32 dist;
s16 pitch, yaw;
UNUSED u32 unused;
// newFocus is an offset from lakitu's origin, not a point in the world.
vec3f_set(origin, 0.f, 0.f, 0.f);
@@ -59,7 +57,6 @@ s32 intro_lakitu_set_pos_and_focus(struct Object *o, struct CutsceneSplinePoint
void bhv_intro_lakitu_loop(void) {
Vec3f offset, fromPoint, toPoint;
UNUSED u32 pad[4];
switch (gCurrentObject->oAction) {
case 0:
+2 -2
View File
@@ -171,7 +171,7 @@ void king_bobomb_act_6(void) {
void king_bobomb_act_7(void) {
cur_obj_init_animation_with_sound(2);
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
DIALOG_FLAG_TEXT_DEFAULT, CUTSCENE_DIALOG, DIALOG_116)) {
create_sound_spawner(SOUND_OBJ_KING_WHOMP_DEATH);
cur_obj_hide();
@@ -264,7 +264,7 @@ void king_bobomb_act_5(void) { // bobomb returns home
o->oSubAction++;
break;
case 4:
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, DIALOG_128))
o->oAction = 2;
break;
-2
View File
@@ -319,8 +319,6 @@ void obj_set_speed_to_zero(void) {
}
void bhv_klepto_update(void) {
UNUSED s32 unused;
cur_obj_update_floor_and_walls();
o->oKleptoDistanceToTarget = cur_obj_lateral_dist_to_home();
+1 -3
View File
@@ -519,8 +519,6 @@ static void koopa_the_quick_act_show_init_text(void) {
sKoopaTheQuickProperties[o->oKoopaTheQuickRaceIndex].initText);
if (response == DIALOG_RESPONSE_YES) {
UNUSED s32 unused;
gMarioShotFromCannon = FALSE;
o->oAction = KOOPA_THE_QUICK_ACT_RACE;
o->oForwardVel = 0.0f;
@@ -731,7 +729,7 @@ static void koopa_the_quick_act_after_race(void) {
o->oFlags &= ~OBJ_FLAG_ACTIVE_FROM_AFAR;
}
} else if (o->parentObj->oKoopaRaceEndpointDialog > 0) {
s32 dialogResponse = cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
s32 dialogResponse = cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, o->parentObj->oKoopaRaceEndpointDialog);
if (dialogResponse != 0) {
o->parentObj->oKoopaRaceEndpointDialog = DIALOG_NONE;
-1
View File
@@ -13,7 +13,6 @@ struct ObjectHitbox sKoopaShellHitbox = {
};
void koopa_shell_spawn_water_drop(void) {
UNUSED s32 unused;
struct Object *drop;
spawn_object(o, MODEL_WAVE_TRAIL, bhvObjectWaveTrail);
if (gMarioStates[0].forwardVel > 10.0f) {
@@ -15,7 +15,6 @@ void hexagonal_ring_spawn_flames(void) {
}
void bhv_lll_rotating_hexagonal_ring_loop(void) {
UNUSED s32 unused;
o->oCollisionDistance = 4000.0f;
o->oDrawingDistance = 8000.0f;
switch (o->oAction) {
+1 -1
View File
@@ -7,7 +7,7 @@ void bhv_volcano_flames_loop(void) {
o->oPosZ += o->oVelZ;
cur_obj_move_y(-4.0f, -0.7f, 2.0f);
if (o->oMoveFlags & (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_AT_WATER_SURFACE
if (o->oMoveFlags & (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_AT_WATER_SURFACE
| OBJ_MOVE_UNDERWATER_OFF_GROUND))
obj_mark_for_deletion(o);
}
+9 -9
View File
@@ -5,15 +5,15 @@
* These rings contain a significant bug that is documented in water_ring.inc.c
*/
static Trajectory sMantaRayTraj[] = {
TRAJECTORY_POS(0, /*pos*/ -4500, -1380, -40),
TRAJECTORY_POS(1, /*pos*/ -4120, -2240, 740),
TRAJECTORY_POS(2, /*pos*/ -3280, -3080, 1040),
TRAJECTORY_POS(3, /*pos*/ -2240, -3320, 720),
TRAJECTORY_POS(4, /*pos*/ -1840, -3140, -280),
TRAJECTORY_POS(5, /*pos*/ -2320, -2480, -1100),
TRAJECTORY_POS(6, /*pos*/ -3220, -1600, -1360),
TRAJECTORY_POS(7, /*pos*/ -4180, -1020, -1040),
static Trajectory sMantaRayTraj[] = {
TRAJECTORY_POS(0, /*pos*/ -4500, -1380, -40),
TRAJECTORY_POS(1, /*pos*/ -4120, -2240, 740),
TRAJECTORY_POS(2, /*pos*/ -3280, -3080, 1040),
TRAJECTORY_POS(3, /*pos*/ -2240, -3320, 720),
TRAJECTORY_POS(4, /*pos*/ -1840, -3140, -280),
TRAJECTORY_POS(5, /*pos*/ -2320, -2480, -1100),
TRAJECTORY_POS(6, /*pos*/ -3220, -1600, -1360),
TRAJECTORY_POS(7, /*pos*/ -4180, -1020, -1040),
TRAJECTORY_END(),
};
-1
View File
@@ -24,7 +24,6 @@ s32 check_if_moving_over_floor(f32 maxDist, f32 offset) {
}
void bhv_pushable_loop(void) {
UNUSED s16 unused;
s16 angleToMario;
obj_set_hitbox(o, &sMetalBoxHitbox);
o->oForwardVel = 0.0f;
-1
View File
@@ -33,7 +33,6 @@ void bhv_piranha_plant_bubble_loop(void) {
s32 frame = parent->header.gfx.animInfo.animFrame;
// TODO: rename lastFrame if it is inaccurate
s32 lastFrame = parent->header.gfx.animInfo.curAnim->loopEnd - 2;
s32 UNUSED unused;
f32 doneShrinkingFrame; // the first frame after shrinking is done
f32 beginGrowingFrame; // the frame just before growing begins
-1
View File
@@ -7,7 +7,6 @@
*/
void bhv_purple_switch_loop(void) {
UNUSED s32 unused;
switch (o->oAction) {
/**
* Set the switch's model and scale. If Mario is standing near the
+1 -1
View File
@@ -143,7 +143,7 @@ static void racing_penguin_act_show_final_text(void) {
o->oForwardVel = 4.0f;
}
} else if (o->oRacingPenguinFinalTextbox > 0) {
if ((textResult = cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
if ((textResult = cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, o->oRacingPenguinFinalTextbox))) {
o->oRacingPenguinFinalTextbox = -1;
o->oTimer = 0;
-1
View File
@@ -24,7 +24,6 @@ s32 update_angle_from_move_flags(s32 *angle) {
}
void bhv_scuttlebug_loop(void) {
UNUSED s32 unused;
f32 animSpeed;
cur_obj_update_floor_and_walls();
if (o->oSubAction != 0
-1
View File
@@ -39,7 +39,6 @@ void bhv_seesaw_platform_update(void) {
if (gMarioObject->platform == o) {
// Rotate toward mario
f32 rotation = o->oDistanceToMario * coss(o->oAngleToMario - o->oMoveAngleYaw);
UNUSED s32 unused;
// Deceleration is faster than acceleration
if (o->oSeesawPlatformPitchVel * rotation < 0) {
+5 -6
View File
@@ -1,29 +1,28 @@
// sl_snowman_wind.c.inc
void bhv_sl_snowman_wind_loop(void) {
UNUSED s32 unusedVar = 0;
s16 marioAngleFromWindSource;
Vec3f tempPos;
if (o->oTimer == 0)
o->oSLSnowmanWindOriginalYaw = o->oMoveAngleYaw;
// Waiting for Mario to approach.
if (o->oSubAction == SL_SNOWMAN_WIND_ACT_IDLE) {
o->oDistanceToMario = 0;
// Check if Mario is within 1000 units of the center of the bridge, and ready to speak.
vec3f_copy_2(tempPos, &o->oPosX);
obj_set_pos(o, 1100, 3328, 1164); // Position is in the middle of the ice bridge
if (cur_obj_can_mario_activate_textbox(1000.0f, 30.0f, 0x7FFF))
o->oSubAction++;
vec3f_copy_2(&o->oPosX, tempPos);
// Mario has come close, begin dialog.
} else if (o->oSubAction == SL_SNOWMAN_WIND_ACT_TALKING) {
if (cur_obj_update_dialog(MARIO_DIALOG_LOOK_UP, DIALOG_FLAG_TEXT_DEFAULT, DIALOG_153, 0))
o->oSubAction++;
// Blowing, spawn wind particles (SL_SNOWMAN_WIND_ACT_BLOWING)
} else if (o->oDistanceToMario < 1500.0f && absf(gMarioObject->oPosY - o->oHomeY) < 500.0f) {
// Point towards Mario, but only within 0x1500 angle units of the original angle.
+15 -15
View File
@@ -22,11 +22,11 @@ static s32 sl_walking_penguin_turn(void) {
// Stay still and use walking animation for the turn.
o->oForwardVel = 0.0f;
cur_obj_init_animation_with_accel_and_sound(PENGUIN_ANIM_WALK, 1.0f);
// Turn around.
o->oAngleVelYaw = 0x400;
o->oMoveAngleYaw += o->oAngleVelYaw;
if (o->oTimer == 31)
return TRUE; // Finished turning
else
@@ -36,10 +36,10 @@ static s32 sl_walking_penguin_turn(void) {
void bhv_sl_walking_penguin_loop(void) {
f32 adjustedXPos, adjustedZPos;
f32 perpendicularOffset = 100.0f;
o->oAngleVelYaw = 0;
cur_obj_update_floor_and_walls();
switch (o->oAction) {
// Walk erratically across the ice bridge using preset steps.
case SL_WALKING_PENGUIN_ACT_MOVING_FORWARDS:
@@ -48,7 +48,7 @@ void bhv_sl_walking_penguin_loop(void) {
o->oSLWalkingPenguinCurStep = 0;
o->oSLWalkingPenguinCurStepTimer = 0;
}
if (o->oSLWalkingPenguinCurStepTimer < sSLWalkingPenguinErraticSteps[o->oSLWalkingPenguinCurStep].stepLength)
o->oSLWalkingPenguinCurStepTimer++;
else {
@@ -59,57 +59,57 @@ void bhv_sl_walking_penguin_loop(void) {
// Reached the end of the list, go back to the start
o->oSLWalkingPenguinCurStep = 0;
}
if (o->oPosX < 300.0f)
o->oAction++; // If reached the end of the bridge, turn around and head back.
else {
// Move and animate the penguin
o->oForwardVel = sSLWalkingPenguinErraticSteps[o->oSLWalkingPenguinCurStep].speed;
cur_obj_init_animation_with_accel_and_sound(
sSLWalkingPenguinErraticSteps[o->oSLWalkingPenguinCurStep].anim,
sSLWalkingPenguinErraticSteps[o->oSLWalkingPenguinCurStep].animSpeed
);
}
break;
// At the end, turn around and prepare to head back across the bridge.
case SL_WALKING_PENGUIN_ACT_TURNING_BACK:
if (sl_walking_penguin_turn())
o->oAction++; // Finished turning
break;
// Walk back across the bridge at a constant speed.
case SL_WALKING_PENGUIN_ACT_RETURNING:
// Move and animate the penguin
o->oForwardVel = 12.0f;
cur_obj_init_animation_with_accel_and_sound(PENGUIN_ANIM_WALK, 2.0f);
if (o->oPosX > 1700.0f)
o->oAction++; // If reached the start of the bridge, turn around.
break;
// At the start, turn around and prepare to walk erratically across the bridge.
case SL_WALKING_PENGUIN_ACT_TURNING_FORWARDS:
if (sl_walking_penguin_turn())
o->oAction = SL_WALKING_PENGUIN_ACT_MOVING_FORWARDS; // Finished turning
break;
}
cur_obj_move_standard(-78);
if (!cur_obj_hide_if_mario_far_away_y(1000.0f))
play_penguin_walking_sound(PENGUIN_WALK_BIG);
// Adjust the position to get a point better lined up with the visual model, for stopping the wind.
// The new point is 60 units behind the penguin and 100 units perpedicularly, away from the snowman.
adjustedXPos = o->oPosX + sins(0xDBB0) * 60.0f; // 0xDBB0 = -51 degrees, the angle the penguin is facing
adjustedZPos = o->oPosZ + coss(0xDBB0) * 60.0f;
adjustedXPos += perpendicularOffset * sins(0x1BB0); // 0x1BB0 = 39 degrees, perpendicular to the penguin
adjustedZPos += perpendicularOffset * coss(0x1BB0);
o->oSLWalkingPenguinWindCollisionXPos = adjustedXPos;
o->oSLWalkingPenguinWindCollisionZPos = adjustedZPos;
print_debug_bottom_up("x %d", o->oPosX);
print_debug_bottom_up("z %d", o->oPosZ);
}
+4 -4
View File
@@ -30,7 +30,7 @@ struct ObjectHitbox sSnufitBulletHitbox = {
};
/**
* This geo function shifts snufit's mask when it shrinks down,
* This geo function shifts snufit's mask when it shrinks down,
* since the parts move independently.
*/
Gfx *geo_snufit_move_mask(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c) {
@@ -77,7 +77,7 @@ void snufit_act_idle(void) {
// if the game would not have already crashed.
marioDist = (s32)(o->oDistanceToMario / 10.0f);
if (o->oTimer > marioDist && o->oDistanceToMario < 800.0f) {
// Controls an alternating scaling factor in a cos.
o->oSnufitBodyScalePeriod
= approach_s16_symmetric(o->oSnufitBodyScalePeriod, 0, 1500);
@@ -121,7 +121,7 @@ void bhv_snufit_loop(void) {
// Only update if Mario is in the current room.
if (!(o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM)) {
o->oDeathSound = SOUND_OBJ_SNUFIT_SKEETER_DEATH;
// Face Mario if he is within range.
if (o->oDistanceToMario < 800.0f) {
obj_turn_pitch_toward_mario(120.0f, 2000);
@@ -198,7 +198,7 @@ void bhv_snufit_balls_loop(void) {
o->oGravity = -4.0f;
cur_obj_become_intangible();
} else if (o->oAction == 1
} else if (o->oAction == 1
|| (o->oMoveFlags & (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_HIT_WALL))) {
// The Snufit shot Mario and has fulfilled its lonely existance.
//! The above check could theoretically be avoided by finding a geometric
-1
View File
@@ -8,7 +8,6 @@ void star_door_update_pos(void) {
}
void bhv_star_door_loop(void) {
UNUSED u8 pad[4];
struct Object *doorObj;
doorObj = cur_obj_nearest_object_with_behavior(bhvStarDoor);
switch (o->oAction) {
@@ -16,24 +16,24 @@ void bhv_strong_wind_particle_loop(void) {
struct Object *penguinObj;
f32 distanceFromPenguin;
f32 penguinXDist, penguinZDist;
obj_set_hitbox(o, &sStrongWindParticleHitbox);
if (o->oTimer == 0) {
o->oStrongWindParticlePenguinObj = cur_obj_nearest_object_with_behavior(bhvSLWalkingPenguin);
obj_translate_xyz_random(o, 100.0f);
o->oForwardVel = coss(o->oMoveAnglePitch) * 100.0f;
o->oVelY = sins(o->oMoveAnglePitch) * -100.0f;
o->oMoveAngleYaw += random_f32_around_zero(o->oBehParams2ndByte * 500); // Wind spread
o->oOpacity = 100;
}
cur_obj_move_using_fvel_and_gravity();
if (o->oTimer > 15) // Deactivate after 15 frames
obj_mark_for_deletion(o);
// If collided with the SL walking penguin, deactivate.
penguinObj = o->oStrongWindParticlePenguinObj;
if (penguinObj != NULL) {
@@ -79,9 +79,7 @@ void bhv_tilting_inverted_pyramid_loop(void) {
f32 mz;
s32 marioOnPlatform = FALSE;
UNUSED s32 unused;
Mat4 *transform = &o->transform;
UNUSED s32 unused2[7];
if (gMarioObject->platform == o) {
get_mario_pos(&mx, &my, &mz);
@@ -95,7 +93,7 @@ void bhv_tilting_inverted_pyramid_loop(void) {
dy = 500.0f;
dz = gMarioObject->oPosZ - o->oPosZ;
d = sqrtf(dx * dx + dy * dy + dz * dz);
//! Always true since dy = 500, making d >= 500.
if (d != 0.0f) {
// Normalizing
@@ -120,7 +118,7 @@ void bhv_tilting_inverted_pyramid_loop(void) {
o->oTiltingPyramidMarioOnPlatform = FALSE;
}
// Approach the normals by 0.01f towards the new goal, then create a transform matrix and orient the object.
// Approach the normals by 0.01f towards the new goal, then create a transform matrix and orient the object.
// Outside of the other conditionals since it needs to tilt regardless of whether Mario is on.
o->oTiltingPyramidNormalX = approach_by_increment(dx, o->oTiltingPyramidNormalX, 0.01f);
o->oTiltingPyramidNormalY = approach_by_increment(dy, o->oTiltingPyramidNormalY, 0.01f);
-1
View File
@@ -69,7 +69,6 @@ void spawn_and_init_wf_platforms(s16 a, const BehaviorScript *bhv) {
}
void spawn_wf_platform_group(void) {
UNUSED s32 unused = 8;
o->oPlatformSpawnerWFTowerPlatformNum = 0;
o->oPlatformSpawnerWFTowerYawOffset = 0;
o->oPlatformSpawnerWFTowerDYaw = 0x2000;
-2
View File
@@ -37,10 +37,8 @@ void bhv_snow_leaf_particle_spawn_init(void) {
#ifdef TREE_PARTICLE_FIX
struct Object *nearestTree = NULL;
#endif
UNUSED s32 unused;
s32 isSnow;
f32 scale;
UNUSED s32 unused2;
gMarioObject->oActiveParticleFlags &= ~0x2000;
#ifdef TREE_PARTICLE_FIX
nearestTree = cur_obj_nearest_object_with_behavior(bhvTree);
+2 -2
View File
@@ -52,7 +52,7 @@ void tuxies_mother_act_1(void) {
dialogID = DIALOG_058;
else
dialogID = DIALOG_059;
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, dialogID)) {
if (dialogID == DIALOG_058)
o->oSubAction = 1;
@@ -115,7 +115,7 @@ void tuxies_mother_act_0(void) {
o->oSubAction++;
break;
case 1:
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, DIALOG_057))
o->oSubAction++;
break;
+4 -4
View File
@@ -25,11 +25,11 @@ void tweester_scale_and_move(f32 preScale) {
s16 dYaw = 0x2C00;
f32 scale = preScale * 0.4;
o->header.gfx.scale[0]
o->header.gfx.scale[0]
= (( coss(o->oTweesterScaleTimer) + 1.0) * 0.5 * 0.3 + 1.0) * scale;
o->header.gfx.scale[1]
o->header.gfx.scale[1]
= ((-coss(o->oTweesterScaleTimer) + 1.0) * 0.5 * 0.5 + 0.5) * scale;
o->header.gfx.scale[2]
o->header.gfx.scale[2]
= (( coss(o->oTweesterScaleTimer) + 1.0) * 0.5 * 0.3 + 1.0) * scale;
o->oTweesterScaleTimer += 0x200;
@@ -125,7 +125,7 @@ void tweester_act_hide(void) {
void (*sTweesterActions[])(void) = { tweester_act_idle, tweester_act_chase, tweester_act_hide };
/**
* Loop behavior for Tweester.
* Loop behavior for Tweester.
* Loads the hitbox and calls its relevant action.
*/
void bhv_tweester_loop(void) {
+2 -4
View File
@@ -174,8 +174,6 @@ void ukiki_act_idle(void) {
* Only used for the cap ukiki.
*/
void ukiki_act_return_home(void) {
UNUSED s32 unused;
cur_obj_init_animation_with_sound(UKIKI_ANIM_RUN);
o->oMoveAngleYaw = cur_obj_angle_to_home();
o->oForwardVel = 10.0f;
@@ -383,7 +381,7 @@ void ukiki_act_go_to_cage(void) {
case UKIKI_SUB_ACT_CAGE_TALK_TO_MARIO:
cur_obj_init_animation_with_sound(UKIKI_ANIM_HANDSTAND);
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_DOWN,
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_DOWN,
DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, DIALOG_080)) {
o->oSubAction++;
}
@@ -578,7 +576,7 @@ void cap_ukiki_held_loop(void) {
break;
case UKIKI_TEXT_HAS_CAP:
if (cur_obj_update_dialog(MARIO_DIALOG_LOOK_UP,
if (cur_obj_update_dialog(MARIO_DIALOG_LOOK_UP,
(DIALOG_FLAG_TEXT_DEFAULT | DIALOG_FLAG_TIME_STOP_ENABLED), DIALOG_101, 0)) {
mario_retrieve_cap();
set_mario_npc_dialog(MARIO_DIALOG_STOP);
@@ -57,7 +57,6 @@ void bhv_water_splash_spawn_droplets(void) {
}
void bhv_water_droplet_loop(void) {
UNUSED u32 unusedVar;
f32 waterLevel = find_water_level(o->oPosX, o->oPosZ);
if (o->oTimer == 0) {
+2 -2
View File
@@ -28,7 +28,7 @@ void whomp_init(void) {
cur_obj_set_pos_to_home();
o->oHealth = 3;
}
} else if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
} else if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, DIALOG_114))
o->oAction = 2;
} else if (o->oDistanceToMario < 500.0f)
@@ -216,7 +216,7 @@ void whomp_on_ground_general(void) {
void whomp_die(void) {
if (o->oBehParams2ndByte != 0) {
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
DIALOG_FLAG_TEXT_DEFAULT, CUTSCENE_DIALOG, DIALOG_115)) {
obj_set_angle(o, 0, 0, 0);
cur_obj_hide();
+1 -1
View File
@@ -299,7 +299,7 @@ static void wiggler_act_jumped_on(void) {
// defeated) or go back to walking
if (o->header.gfx.scale[1] >= 4.0f) {
if (o->oTimer > 30) {
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
DIALOG_FLAG_NONE, CUTSCENE_DIALOG, attackText[o->oHealth - 2])) {
// Because we don't want the wiggler to disappear after being
// defeated, we leave its health at 1
+14 -188
View File
@@ -122,17 +122,12 @@ extern f32 sHandheldShakeInc;
extern s16 sHandheldShakePitch;
extern s16 sHandheldShakeYaw;
extern s16 sHandheldShakeRoll;
extern u32 unused8033B30C;
extern u32 unused8033B310;
extern s16 sSelectionFlags;
extern s16 unused8033B316;
extern s16 s2ndRotateFlags;
extern s16 unused8033B31A;
extern s16 sCameraSoundFlags;
extern u16 sCButtonsPressed;
extern s16 sCutsceneDialogID;
extern struct LakituState gLakituState;
extern s16 unused8033B3E8;
extern s16 sAreaYaw;
extern s16 sAreaYawChange;
extern s16 sLakituDist;
@@ -161,7 +156,6 @@ extern struct CutsceneSplinePoint sCurCreditsSplinePos[32];
extern struct CutsceneSplinePoint sCurCreditsSplineFocus[32];
extern s16 sCutsceneSplineSegment;
extern f32 sCutsceneSplineSegmentProgress;
extern s16 unused8033B6E8;
extern s16 sCutsceneShot;
extern s16 gCutsceneTimer;
extern struct CutsceneVariable sCutsceneVars[10];
@@ -204,7 +198,6 @@ f32 sCutsceneSplineSegmentProgress;
* The current segment of the CutsceneSplinePoint[] being used.
*/
s16 sCutsceneSplineSegment;
s16 unused8033B6E8;
// Shaky Hand-held Camera effect variables
struct HandheldShakePoint sHandheldShakeSpline[4];
@@ -225,9 +218,6 @@ u32 gCutsceneObjSpawn;
*/
s32 gObjCutsceneDone;
u32 unused8033B30C;
u32 unused8033B310;
/**
* Determines which R-Trigger mode is selected in the pause menu.
*/
@@ -237,7 +227,6 @@ s16 sSelectionFlags;
* Flags that determine what movements the camera should start / do this frame.
*/
s16 gCameraMovementFlags;
s16 unused8033B316;
/**
* Flags that change how modes operate and how Lakitu moves.
@@ -250,7 +239,6 @@ s16 sStatusFlags;
* determine whether to rotate all the way, or just to 60 degrees.
*/
s16 s2ndRotateFlags;
s16 unused8033B31A;
/**
* Flags that control buzzes and sounds that play, mostly for C-button input.
*/
@@ -271,10 +259,7 @@ s16 sCutsceneShot;
* The current frame of the cutscene shot.
*/
s16 gCutsceneTimer;
s16 unused8033B3E8;
#if defined(VERSION_EU) || defined(VERSION_SH)
s16 unused8033B3E82;
#endif
/**
* The angle of the direction vector from the area's center to Mario's position.
*/
@@ -389,12 +374,8 @@ struct CameraStoredInfo sCameraStoreCUp;
struct CameraStoredInfo sCameraStoreCutscene;
// first iteration of data
u32 unused8032CFC0 = 0;
struct Object *gCutsceneFocus = NULL;
u32 unused8032CFC8 = 0;
u32 unused8032CFCC = 0;
/**
* The information of a second focus camera used by some objects
*/
@@ -407,9 +388,6 @@ s16 sYawSpeed = 0x400;
s32 gCurrLevelArea = 0;
u32 gPrevLevel = 0;
f32 unused8032CFE0 = 1000.0f;
f32 unused8032CFE4 = 800.0f;
u32 unused8032CFE8 = 0;
f32 gCameraZoomDist = 800.0f;
/**
@@ -439,7 +417,6 @@ u8 sFramesSinceCutsceneEnded = 0;
u8 sCutsceneDialogResponse = DIALOG_RESPONSE_NONE;
struct PlayerCameraState *sMarioCamState = &gPlayerCameraState[0];
struct PlayerCameraState *sLuigiCamState = &gPlayerCameraState[1];
u32 unused8032D008 = 0;
Vec3f sFixedModeBasePosition = { 646.0f, 143.0f, -1513.0f };
Vec3f sUnusedModeBasePosition_2 = { 646.0f, 143.0f, -1513.0f };
Vec3f sUnusedModeBasePosition_3 = { 646.0f, 143.0f, -1513.0f };
@@ -723,12 +700,8 @@ void focus_on_mario(Vec3f focus, Vec3f pos, f32 posYOff, f32 focYOff, f32 dist,
static UNUSED void set_pos_to_mario(Vec3f foc, Vec3f pos, f32 yOff, f32 focYOff, f32 dist, s16 pitch, s16 yaw) {
Vec3f marioPos;
f32 posDist;
f32 focDist;
s16 posPitch;
s16 posYaw;
s16 focPitch;
s16 focYaw;
vec3f_copy(marioPos, sMarioCamState->pos);
marioPos[1] += yOff;
@@ -899,11 +872,8 @@ s32 update_radial_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
f32 cenDistZ = sMarioCamState->pos[2] - c->areaCenZ;
s16 camYaw = atan2s(cenDistZ, cenDistX) + sModeOffsetYaw;
s16 pitch = look_down_slopes(camYaw);
UNUSED f32 unused1;
f32 posY;
f32 focusY;
UNUSED f32 unused2;
UNUSED f32 unused3;
f32 yOff = 125.f;
f32 baseDist = 1000.f;
@@ -919,15 +889,10 @@ s32 update_radial_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
* Update the camera during 8 directional mode
*/
s32 update_8_directions_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
UNUSED f32 cenDistX = sMarioCamState->pos[0] - c->areaCenX;
UNUSED f32 cenDistZ = sMarioCamState->pos[2] - c->areaCenZ;
s16 camYaw = s8DirModeBaseYaw + s8DirModeYawOffset;
s16 pitch = look_down_slopes(camYaw);
f32 posY;
f32 focusY;
UNUSED f32 unused1;
UNUSED f32 unused2;
UNUSED f32 unused3;
f32 yOff = 125.f;
f32 baseDist = 1000.f;
@@ -953,11 +918,8 @@ void radial_camera_move(struct Camera *c) {
s16 rotateSpeed = 0x1000;
s16 avoidYaw;
s32 avoidStatus;
UNUSED s16 unused1 = 0;
UNUSED s32 unused2 = 0;
f32 areaDistX = sMarioCamState->pos[0] - c->areaCenX;
f32 areaDistZ = sMarioCamState->pos[2] - c->areaCenZ;
UNUSED s32 filler;
// How much the camera's yaw changed
s16 yawOffset = calculate_yaw(sMarioCamState->pos, c->pos) - atan2s(areaDistZ, areaDistX);
@@ -1139,9 +1101,7 @@ void update_yaw_and_dist_from_c_up(UNUSED struct Camera *c) {
*/
void mode_radial_camera(struct Camera *c) {
Vec3f pos;
UNUSED u8 unused1[8];
s16 oldAreaYaw = sAreaYaw;
UNUSED u8 unused2[4];
if (gCameraMovementFlags & CAM_MOVING_INTO_MODE) {
update_yaw_and_dist_from_c_up(c);
@@ -1270,34 +1230,21 @@ s32 update_parallel_tracking_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
Vec3f focOffset;
s16 pathPitch;
s16 pathYaw;
UNUSED u8 filler[4];
f32 distThresh;
f32 zoom;
f32 camParDist;
UNUSED u8 filler2[8];
f32 pathLength;
UNUSED u8 filler3[8];
UNUSED f32 unusedScale = 0.5f;
f32 parScale = 0.5f;
f32 marioFloorDist;
Vec3f marioPos;
UNUSED u8 filler4[12];
UNUSED Vec3f unused4;
Vec3s pathAngle;
// Variables for changing to the next/prev path in the list
Vec3f oldPos;
Vec3f prevPathPos;
Vec3f nextPathPos;
f32 distToNext;
f32 distToPrev;
s16 prevPitch;
s16 nextPitch;
s16 prevYaw;
s16 nextYaw;
unused4[0] = 0.f;
unused4[1] = 0.f;
unused4[2] = 0.f;
f32 distToNext, distToPrev;
s16 prevPitch, nextPitch;
s16 prevYaw, nextYaw;
// Store camera pos, for changing between paths
vec3f_copy(oldPos, pos);
@@ -1456,14 +1403,12 @@ s32 update_fixed_camera(struct Camera *c, Vec3f focus, UNUSED Vec3f pos) {
f32 ceilHeight;
f32 heightOffset;
f32 distCamToFocus;
UNUSED u8 filler2[8];
f32 scaleToMario = 0.5f;
s16 pitch;
s16 yaw;
Vec3s faceAngle;
struct Surface *ceiling;
Vec3f basePos;
UNUSED u8 filler[12];
play_camera_buzz_if_c_sideways();
@@ -1543,21 +1488,16 @@ s32 update_fixed_camera(struct Camera *c, Vec3f focus, UNUSED Vec3f pos) {
*/
s32 update_boss_fight_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
struct Object *o;
UNUSED u8 filler2[12];
f32 focusDistance;
UNUSED u8 filler3[4];
// Floor normal values
f32 nx;
f32 ny;
f32 nz;
/// Floor originOffset
f32 oo;
UNUSED u8 filler4[4];
UNUSED s16 unused;
s16 yaw;
s16 heldState;
struct Surface *floor;
UNUSED u8 filler[20];
Vec3f secondFocus;
Vec3f holdFocOffset = { 0.f, -150.f, -125.f };
@@ -1668,10 +1608,6 @@ s32 update_boss_fight_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
return yaw;
}
// 2nd iteration of data
s16 unused8032D0A8[] = { 14, 1, 2, 4 };
s16 unused8032D0B0[] = { 16, 9, 17, 0 };
/**
* Maps cutscene to numbers in [0,4]. Used in determine_dance_cutscene() with sDanceCutsceneIndexTable.
*
@@ -1746,8 +1682,6 @@ void mode_parallel_tracking_camera(struct Camera *c) {
* Fixed camera mode, the camera rotates around a point and looks and zooms toward Mario.
*/
void mode_fixed_camera(struct Camera *c) {
UNUSED u8 unused[8];
if (gCurrLevelNum == LEVEL_BBH) {
set_fov_function(CAM_FOV_BBH);
} else {
@@ -1765,9 +1699,7 @@ void mode_fixed_camera(struct Camera *c) {
* The C-Buttons rotate the camera 90 degrees left/right and 67.5 degrees up/down.
*/
s32 update_behind_mario_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
UNUSED u8 unused2[12];
f32 dist;
UNUSED u8 unused3[4];
s16 absPitch;
s16 pitch;
s16 yaw;
@@ -1776,7 +1708,6 @@ s32 update_behind_mario_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
s16 goalYawOff = 0;
s16 yawSpeed;
s16 pitchInc = 32;
UNUSED u8 unused[12];
f32 maxDist = 800.f;
f32 focYOff = 125.f;
@@ -1792,10 +1723,6 @@ s32 update_behind_mario_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
// Focus on Mario
vec3f_copy(focus, sMarioCamState->pos);
c->focus[1] += focYOff;
//! @bug unnecessary
dist = calc_abs_dist(focus, pos);
//! @bug unnecessary
pitch = calculate_pitch(focus, pos);
vec3f_get_dist_and_angle(focus, pos, &dist, &pitch, &yaw);
if (dist > maxDist) {
dist = maxDist;
@@ -1915,7 +1842,7 @@ s32 mode_behind_mario(struct Camera *c) {
struct Surface *floor;
Vec3f newPos;
//! @bug oldPos is unused, see resolve_geometry_collisions
Vec3f oldPos;
UNUSED Vec3f oldPos;
f32 waterHeight;
f32 floorHeight;
f32 distCamToFocus;
@@ -1972,7 +1899,6 @@ s16 update_slide_camera(struct Camera *c) {
f32 pitchScale;
s16 camPitch;
s16 camYaw;
UNUSED struct MarioState *marioState = &gMarioStates[0];
s16 goalPitch = 0x1555;
s16 goalYaw = sMarioCamState->faceAngle[1] + DEGREES(180);
@@ -2072,7 +1998,6 @@ s32 update_mario_camera(UNUSED struct Camera *c, Vec3f focus, Vec3f pos) {
s16 update_default_camera(struct Camera *c) {
Vec3f tempPos;
Vec3f cPos;
UNUSED u8 unused1[12];
struct Surface *marioFloor;
struct Surface *cFloor;
struct Surface *tempFloor;
@@ -2080,11 +2005,9 @@ s16 update_default_camera(struct Camera *c) {
f32 camFloorHeight;
f32 tempFloorHeight;
f32 marioFloorHeight;
UNUSED u8 unused2[4];
f32 dist;
f32 zoomDist;
f32 waterHeight;
f32 gasHeight;
f32 waterHeight, gasHeight;
s16 avoidYaw;
s16 pitch;
s16 yaw;
@@ -2092,10 +2015,8 @@ s16 update_default_camera(struct Camera *c) {
f32 posHeight;
f32 focHeight;
f32 distFromWater;
s16 tempPitch;
s16 tempYaw;
s16 tempPitch, tempYaw;
f32 xzDist;
UNUSED u8 unused4[4];
s16 nextYawVel;
s16 yawVel = 0;
f32 scale;
@@ -2422,7 +2343,6 @@ void mode_mario_camera(struct Camera *c) {
* Rotates the camera around the spiral staircase.
*/
s32 update_spiral_stairs_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
UNUSED s16 unused1;
/// The returned yaw
s16 camYaw;
// unused
@@ -2433,7 +2353,6 @@ s32 update_spiral_stairs_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
s16 posPitch;
/// The camera's yaw around the stairs
s16 posYaw;
UNUSED s32 unused2;
Vec3f cPos;
Vec3f checkPos;
struct Surface *floor;
@@ -2738,8 +2657,6 @@ void move_into_c_up(struct Camera *c) {
* The main update function for C-Up mode
*/
s32 mode_c_up_camera(struct Camera *c) {
UNUSED u8 unused[12];
// Play a sound when entering C-Up mode
if (!(sCameraSoundFlags & CAM_SOUND_C_UP_PLAYED)) {
play_sound_cbutton_up();
@@ -2796,8 +2713,6 @@ s32 update_in_cannon(UNUSED struct Camera *c, Vec3f focus, Vec3f pos) {
* sCannonYOffset is used to make the camera rotate down when Mario has just entered the cannon
*/
void mode_cannon_camera(struct Camera *c) {
UNUSED u8 unused[24];
sLakituPitch = 0;
gCameraMovementFlags &= ~CAM_MOVING_INTO_MODE;
c->nextYaw = update_in_cannon(c, c->focus, c->pos);
@@ -2921,10 +2836,8 @@ void update_lakitu(struct Camera *c) {
struct Surface *floor = NULL;
Vec3f newPos;
Vec3f newFoc;
UNUSED Vec3f unusedVec3f;
f32 distToFloor;
s16 newYaw;
UNUSED u8 unused1[8];
if (gCameraMovementFlags & CAM_MOVE_PAUSE_SCREEN) {
} else {
@@ -3023,8 +2936,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) {
UNUSED u8 unused[24];
gCamera = c;
update_camera_hud_status(c);
if (c->cutscene == 0 &&
@@ -3269,11 +3180,6 @@ void update_camera(struct Camera *c) {
* Reset all the camera variables to their arcane defaults
*/
void reset_camera(struct Camera *c) {
UNUSED s32 unused = 0;
UNUSED u8 unused1[16];
UNUSED struct LinearTransitionPoint *start = &sModeInfo.transitionStart;
UNUSED struct LinearTransitionPoint *end = &sModeInfo.transitionEnd;
gCamera = c;
gCameraMovementFlags = 0;
s2ndRotateFlags = 0;
@@ -3283,19 +3189,13 @@ void reset_camera(struct Camera *c) {
gCutsceneObjSpawn = 0;
gObjCutsceneDone = FALSE;
gCutsceneFocus = NULL;
unused8032CFC8 = 0;
unused8032CFCC = 0;
gSecondCameraFocus = NULL;
sCButtonsPressed = 0;
vec3f_copy(sModeTransition.marioPos, sMarioCamState->pos);
sModeTransition.framesLeft = 0;
unused8032CFCC = -1;
unused8032CFC8 = -1;
gCameraMovementFlags = 0;
gCameraMovementFlags |= CAM_MOVE_INIT_CAMERA;
unused8033B316 = 0;
sStatusFlags = 0;
unused8033B31A = 0;
sCameraSoundFlags = 0;
sCUpCameraPitch = 0;
sModeOffsetYaw = 0;
@@ -3337,8 +3237,6 @@ void reset_camera(struct Camera *c) {
sFOVState.shakePhase = 0;
sObjectCutscene = 0;
gRecentCutscene = 0;
unused8033B30C = 0;
unused8033B310 = 0;
}
void init_camera(struct Camera *c) {
@@ -3377,7 +3275,6 @@ void init_camera(struct Camera *c) {
}
sCutsceneSplineSegment = 0;
sCutsceneSplineSegmentProgress = 0.f;
unused8033B6E8 = 0;
sHandheldShakeInc = 0.f;
sHandheldShakeTimer = 0.f;
sHandheldShakeMag = 0;
@@ -3521,11 +3418,9 @@ void init_camera(struct Camera *c) {
* modulo-4's the result, because each 8-bit mask only has 4 area bits for each level
*/
void zoom_out_if_paused_and_outside(struct GraphNodeCamera *camera) {
UNUSED u8 unused1[8];
UNUSED f32 dist;
UNUSED s16 pitch;
s16 yaw;
UNUSED u8 unused2[4];
s32 areaMaskIndex = gCurrLevelArea / 32;
s32 areaBit = 1 << (((gCurrLevelArea & 0x10) / 4) + (((gCurrLevelArea & 0xF) - 1) & 3));
@@ -3582,9 +3477,6 @@ void create_camera(struct GraphNodeCamera *gc, struct AllocOnlyPool *pool) {
* Copy Lakitu's pos and foc into `gc`
*/
void update_graph_node_camera(struct GraphNodeCamera *gc) {
UNUSED u8 unused[8];
UNUSED struct Camera *c = gc->config.camera;
gc->rollScreen = gLakituState.roll;
vec3f_copy(gc->pos, gLakituState.pos);
vec3f_copy(gc->focus, gLakituState.focus);
@@ -3593,8 +3485,6 @@ void update_graph_node_camera(struct GraphNodeCamera *gc) {
Gfx *geo_camera_main(s32 callContext, struct GraphNode *g, void *context) {
struct GraphNodeCamera *gc = (struct GraphNodeCamera *) g;
UNUSED Mat4 *unusedMat = context;
switch (callContext) {
case GEO_CONTEXT_CREATE:
create_camera(gc, context);
@@ -3845,7 +3735,6 @@ void shake_camera_handheld(Vec3f pos, Vec3f focus) {
f32 dist;
s16 pitch;
s16 yaw;
UNUSED u8 unused[8];
if (sHandheldShakeMag == 0) {
vec3f_set(shakeOffset, 0.f, 0.f, 0.f);
@@ -4282,7 +4171,6 @@ f32 camera_approach_f32_symmetric(f32 current, f32 target, f32 increment) {
*/
void random_vec3s(Vec3s dst, s16 xRange, s16 yRange, s16 zRange) {
f32 randomFloat;
UNUSED u8 unused[4];
f32 tempXRange;
f32 tempYRange;
f32 tempZRange;
@@ -4377,12 +4265,7 @@ s32 clamp_positions_and_find_yaw(Vec3f pos, Vec3f origin, f32 xMax, f32 xMin, f3
* developers just add 180 degrees to the result.
*/
s32 calc_avoid_yaw(s16 yawFromMario, s16 wallYaw) {
s16 yawDiff;
UNUSED u8 unused[34]; // Debug print buffer? ;)
UNUSED s32 unused1 = 0;
UNUSED s32 unused2 = 0;
yawDiff = wallYaw - yawFromMario + DEGREES(90);
s16 yawDiff = wallYaw - yawFromMario + DEGREES(90);
if (yawDiff < 0) {
// Deflect to the right
@@ -4416,7 +4299,6 @@ s32 is_surf_within_bounding_box(struct Surface *surf, f32 xMax, f32 yMax, f32 zM
f32 dx;
f32 dy;
f32 dz;
UNUSED u8 unused[4];
s32 i;
s32 j;
// result
@@ -4494,7 +4376,6 @@ s32 is_range_behind_surface(Vec3f from, Vec3f to, struct Surface *surf, s16 rang
s32 behindSurface = TRUE;
s32 leftBehind = 0;
s32 rightBehind = 0;
UNUSED u8 unused[20];
f32 checkDist;
s16 checkPitch;
s16 checkYaw;
@@ -4763,8 +4644,6 @@ void shake_camera_yaw(Vec3f pos, Vec3f focus) {
* Apply a rotational shake to the camera by adjusting its roll
*/
void shake_camera_roll(s16 *roll) {
UNUSED u8 unused[8];
if (gLakituState.shakeMagnitude[2] != 0) {
increment_shake_offset(&gLakituState.shakeRollPhase, gLakituState.shakeRollVel);
*roll += gLakituState.shakeMagnitude[2] * sins(gLakituState.shakeRollPhase);
@@ -4999,7 +4878,6 @@ void radial_camera_input(struct Camera *c) {
*/
s32 trigger_cutscene_dialog(s32 trigger) {
s32 result = 0;
UNUSED struct Camera *c = gCamera;
if (trigger == 1) {
start_object_cutscene_without_focus(CUTSCENE_READ_MESSAGE);
@@ -5153,9 +5031,7 @@ u8 open_door_cutscene(u8 pullResult, u8 pushResult) {
* @return the cutscene that should start, 0 if none
*/
u8 get_cutscene_from_mario_status(struct Camera *c) {
UNUSED u8 unused1[4];
u8 cutscene = c->cutscene;
UNUSED u8 unused2[12];
if (cutscene == 0) {
// A cutscene started by an object, if any, will start if nothing else happened
@@ -5342,7 +5218,6 @@ void stub_camera_4(UNUSED s32 a, UNUSED s32 b, UNUSED s32 c, UNUSED s32 d) {
*/
void set_focus_rel_mario(struct Camera *c, f32 leftRight, f32 yOff, f32 forwBack, s16 yawOff) {
s16 yaw;
UNUSED u16 unused;
f32 focFloorYOff;
calc_y_to_curr_floor(&focFloorYOff, 1.f, 200.f, &focFloorYOff, 0.9f, 200.f);
@@ -6754,24 +6629,18 @@ void resolve_geometry_collisions(Vec3f pos, UNUSED Vec3f lastGood) {
* @return 3 if a wall is covering Mario, 1 if a wall is only near the camera.
*/
s32 rotate_camera_around_walls(struct Camera *c, Vec3f cPos, s16 *avoidYaw, s16 yawRange) {
UNUSED f32 unused1;
struct WallCollisionData colData;
struct Surface *wall;
UNUSED Vec3f unused2;
f32 dummyDist, checkDist;
UNUSED f32 unused3;
f32 coarseRadius;
f32 fineRadius;
s16 wallYaw, horWallNorm;
UNUSED s16 unused4;
s16 dummyPitch;
// The yaw of the vector from Mario to the camera.
s16 yawFromMario;
UNUSED s16 unused5;
s32 status = 0;
/// The current iteration. The algorithm takes 8 equal steps from Mario back to the camera.
s32 step = 0;
UNUSED s32 unused6;
vec3f_get_dist_and_angle(sMarioCamState->pos, cPos, &dummyDist, &dummyPitch, &yawFromMario);
sStatusFlags &= ~CAM_FLAG_CAM_NEAR_WALL;
@@ -6974,8 +6843,7 @@ void stop_cutscene_and_retrieve_stored_info(struct Camera *c) {
vec3f_copy(c->pos, sCameraStoreCutscene.pos);
}
void cap_switch_save(s16 dummy) {
UNUSED s16 unused = dummy;
void cap_switch_save(UNUSED s16 param) {
save_file_do_save(gCurrSaveFileNum - 1);
}
@@ -6989,7 +6857,6 @@ void init_spline_point(struct CutsceneSplinePoint *splinePoint, s8 index, u8 spe
void copy_spline_segment(struct CutsceneSplinePoint dst[], struct CutsceneSplinePoint src[]) {
s32 j = 0;
s32 i = 0;
UNUSED s32 pad[2];
init_spline_point(&dst[i], src[j].index, src[j].speed, src[j].point);
i += 1;
@@ -6998,7 +6865,7 @@ void copy_spline_segment(struct CutsceneSplinePoint dst[], struct CutsceneSpline
init_spline_point(&dst[i], src[j].index, src[j].speed, src[j].point);
i += 1;
j += 1;
} while ((src[j].index != -1) && (src[j].index != -1)); //! same comparison performed twice
} while (src[j].index != -1);
} while (j > 16);
// Create the end of the spline by duplicating the last point
@@ -7784,8 +7651,6 @@ void star_dance_bound_yaw(struct Camera *c, s16 absYaw, s16 yawMax) {
* Store the camera's focus in cvar9.
*/
void cutscene_dance_closeup_start(struct Camera *c) {
UNUSED s32 pad[2];
if ((gLastCompletedStarNum == 4) && (gCurrCourseNum == COURSE_JRB)) {
star_dance_bound_yaw(c, 0x0, 0x4000);
}
@@ -8221,10 +8086,7 @@ void cutscene_star_spawn_store_info(struct Camera *c) {
* Focus on the top of the star.
*/
void cutscene_star_spawn_focus_star(struct Camera *c) {
UNUSED f32 hMul;
Vec3f starPos;
UNUSED f32 vMul;
if (gCutsceneFocus != NULL) {
object_pos_to_vec3f(starPos, gCutsceneFocus);
starPos[1] += gCutsceneFocus->hitboxHeight;
@@ -8430,7 +8292,6 @@ void cutscene_red_coin_star_end(struct Camera *c) {
* @param rotYaw constant yaw offset to add to the camera's focus
*/
void cutscene_goto_cvar_pos(struct Camera *c, f32 goalDist, s16 goalPitch, s16 rotPitch, s16 rotYaw) {
UNUSED f32 unused1;
f32 nextDist;
s16 nextPitch, nextYaw;
// The next 2 polar coord points are only used in CUTSCENE_PREPARE_CANNON
@@ -8438,7 +8299,6 @@ void cutscene_goto_cvar_pos(struct Camera *c, f32 goalDist, s16 goalPitch, s16 r
s16 cannonPitch, cannonYaw;
f32 curDist;
s16 curPitch, curYaw;
UNUSED f64 unused2;
vec3f_get_dist_and_angle(sCutsceneVars[3].point, c->pos, &nextDist, &nextPitch, &nextYaw);
// If over 8000 units away from the cannon, just teleport there
if ((nextDist > 8000.f) && (c->cutscene == CUTSCENE_PREPARE_CANNON)) {
@@ -8698,12 +8558,8 @@ void cutscene_suffocation_fly_away(UNUSED struct Camera *c) {
* Keep Lakitu above the gas level.
*/
void cutscene_suffocation_stay_above_gas(struct Camera *c) {
UNUSED f32 unused1;
f32 gasLevel;
UNUSED f32 unused2;
cutscene_goto_cvar_pos(c, 400.f, 0x2800, 0x200, 0);
gasLevel = find_poison_gas_level(sMarioCamState->pos[0], sMarioCamState->pos[2]);
f32 gasLevel = find_poison_gas_level(sMarioCamState->pos[0], sMarioCamState->pos[2]);
if (gasLevel != FLOOR_LOWER_LIMIT) {
if ((gasLevel += 130.f) > c->pos[1]) {
@@ -8750,8 +8606,6 @@ void cutscene_enter_pool_start(struct Camera *c) {
}
void cutscene_enter_pool_loop(struct Camera *c) {
UNUSED u32 pad[2];
cutscene_goto_cvar_pos(c, 1200.f, 0x2000, 0x200, 0);
}
@@ -8835,8 +8689,6 @@ void cutscene_pyramid_top_explode_cam_shake(UNUSED struct Camera *c) {
* Warp back to the old position, and start a heavy camera shake.
*/
void cutscene_pyramid_top_explode_warp_back(struct Camera *c) {
UNUSED u32 pad[2];
vec3f_copy(c->pos, sCutsceneVars[4].point);
vec3f_copy(c->focus, sCutsceneVars[5].point);
set_environmental_camera_shake(SHAKE_ENV_BOWSER_JUMP);
@@ -8905,11 +8757,8 @@ UNUSED static void unused_cutscene_goto_cvar(struct Camera *c) {
* cvar9.angle[1] is the yaw between Mario and the gCutsceneFocus
*/
void cutscene_dialog_start(struct Camera *c) {
UNUSED f32 unused1;
UNUSED s16 unused2;
s16 yaw;
cutscene_soften_music(c);
set_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_DIALOG);
@@ -9063,8 +8912,6 @@ UNUSED static void unused_cam_to_mario(struct Camera *c) {
* Cutscene that plays when Mario is reading a message (a sign or message on the wall)
*/
void cutscene_read_message(struct Camera *c) {
UNUSED u32 pad[2];
cutscene_event(cutscene_read_message_start, c, 0, 0);
sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT;
@@ -9130,9 +8977,7 @@ void cutscene_exit_succ_start(UNUSED struct Camera *c) {
* Set the camera pos depending on which level Mario exited.
*/
void cutscene_non_painting_set_cam_pos(struct Camera *c) {
UNUSED u32 unused1;
struct Surface *floor;
UNUSED Vec3f unused2;
switch (gPrevLevel) {
case LEVEL_HMC:
@@ -9314,12 +9159,8 @@ void cutscene_non_painting_death(struct Camera *c) {
* because cvar1 rotates until is reaches 0, so it's important that it's a multiple of 0x100.
*/
void cutscene_cap_switch_press_start(struct Camera *c) {
UNUSED s16 unused1;
s16 yaw;
UNUSED u32 pad[2];
store_info_star(c);
yaw = calculate_yaw(sMarioCamState->pos, c->pos);
s16 yaw = calculate_yaw(sMarioCamState->pos, c->pos);
sCutsceneVars[3].angle[1] = 0x1200;
// Basically the amount of rotation to get from behind Mario to in front of Mario
sCutsceneVars[1].angle[1] = (yaw - (sMarioCamState->faceAngle[1] + sCutsceneVars[3].angle[1])) & 0xFF00;
@@ -9332,9 +9173,6 @@ void cutscene_cap_switch_press_start(struct Camera *c) {
void cutscene_cap_switch_press_rotate_around_mario(struct Camera *c) {
f32 dist;
s16 pitch, yaw;
UNUSED s16 unusedYaw = sMarioCamState->faceAngle[1] + 0x1000;
UNUSED s16 unused;
UNUSED s32 cvar1Yaw = sCutsceneVars[1].angle[1];
vec3f_get_dist_and_angle(sMarioCamState->pos, c->pos, &dist, &pitch, &yaw);
@@ -9625,8 +9463,6 @@ void cutscene_intro_peach_fly_to_pipe(struct Camera *c) {
* Lakitu flies around the warp pipe, then Mario jumps out.
*/
void cutscene_intro_peach_mario_appears(struct Camera *c) {
UNUSED u32 pad[2];
sMarioCamState->cameraEvent = 0;
cutscene_event(cutscene_intro_peach_reset_spline, c, 0, 0);
cutscene_event(cutscene_intro_peach_follow_pipe_spline, c, 0, -1);
@@ -9936,9 +9772,8 @@ void cutscene_sliding_doors_fly_back_up(UNUSED struct Camera *c) {
*/
void cutscene_sliding_doors_follow_mario(struct Camera *c) {
Vec3f pos;
UNUSED u32 pad[5];
vec3f_copy(pos, c->pos);
// Update cvar1 with Mario's position (the y value doesn't change)
sCutsceneVars[1].point[0] = sMarioCamState->pos[0];
sCutsceneVars[1].point[2] = sMarioCamState->pos[2];
@@ -9962,8 +9797,6 @@ void cutscene_sliding_doors_follow_mario(struct Camera *c) {
* Note: the star door unlocking event is not a cutscene, it's handled by Mario separately.
*/
void cutscene_sliding_doors_open(struct Camera *c) {
UNUSED u32 pad[2];
reset_pan_distance(c);
cutscene_event(cutscene_sliding_doors_open_start, c, 0, 8);
cutscene_event(cutscene_sliding_doors_open_set_cvars, c, 8, 8);
@@ -10184,7 +10017,6 @@ void cutscene_enter_cannon_end(struct Camera *c) {
*/
void cutscene_enter_cannon_raise(struct Camera *c) {
struct Object *o;
UNUSED u32 pad[2];
f32 floorHeight;
struct Surface *floor;
Vec3f cannonFocus;
@@ -10332,8 +10164,6 @@ void cutscene_door_end(struct Camera *c) {
* Used for entering a room that uses a specific camera mode, like the castle lobby or BBH
*/
void cutscene_door_mode(struct Camera *c) {
UNUSED u32 pad[2];
reset_pan_distance(c);
camera_course_processing(c);
@@ -11141,13 +10971,9 @@ struct CutsceneSplinePoint sCcmOutsideCreditsSplineFocus[] = {
* the duration they want the flag to be active.
*/
void play_cutscene(struct Camera *c) {
UNUSED u32 pad[3];
UNUSED s16 unusedYawFocToMario;
s16 cutsceneDuration;
u8 oldCutscene;
u8 oldCutscene = c->cutscene;
unusedYawFocToMario = sAreaYaw;
oldCutscene = c->cutscene;
sStatusFlags &= ~CAM_FLAG_SMOOTH_MOVEMENT;
gCameraMovementFlags &= ~CAM_MOVING_INTO_MODE;
+1 -42
View File
@@ -162,7 +162,6 @@ void print_debug_top_down_normal(const char *str, s32 number) {
}
}
#ifndef VERSION_EU
void print_mapinfo(void) {
struct Surface *pfloor;
f32 bgY;
@@ -180,10 +179,7 @@ void print_mapinfo(void) {
print_debug_top_down_normal("mapinfo", 0);
print_debug_top_down_mapinfo("area %x", area);
print_debug_top_down_mapinfo("wx %d", gCurrentObject->oPosX);
//! Fat finger: programmer hit tab instead of space. Japanese
// thumb shift keyboards had the tab key next to the spacebar,
// so this was likely the reason.
print_debug_top_down_mapinfo("wy\t %d", gCurrentObject->oPosY);
print_debug_top_down_mapinfo("wy %d", gCurrentObject->oPosY);
print_debug_top_down_mapinfo("wz %d", gCurrentObject->oPosZ);
print_debug_top_down_mapinfo("bgY %d", bgY);
print_debug_top_down_mapinfo("angY %d", angY);
@@ -199,41 +195,6 @@ void print_mapinfo(void) {
print_debug_top_down_mapinfo("water %d", water);
}
}
#else
void print_mapinfo(void) {
// EU mostly stubbed this function out.
struct Surface *pfloor;
UNUSED f32 bgY;
UNUSED f32 water;
UNUSED s32 area;
// s32 angY;
//
// angY = gCurrentObject->oMoveAngleYaw / 182.044000;
// area = ((s32)gCurrentObject->oPosX + 0x2000) / 1024
// + ((s32)gCurrentObject->oPosZ + 0x2000) / 1024 * 16;
//
bgY = find_floor(gCurrentObject->oPosX, gCurrentObject->oPosY, gCurrentObject->oPosZ, &pfloor);
water = find_water_level(gCurrentObject->oPosX, gCurrentObject->oPosZ);
print_debug_top_down_normal("mapinfo", 0);
// print_debug_top_down_mapinfo("area %x", area);
// print_debug_top_down_mapinfo("wx %d", gCurrentObject->oPosX);
// print_debug_top_down_mapinfo("wy\t %d", gCurrentObject->oPosY);
// print_debug_top_down_mapinfo("wz %d", gCurrentObject->oPosZ);
// print_debug_top_down_mapinfo("bgY %d", bgY);
// print_debug_top_down_mapinfo("angY %d", angY);
//
// if(pfloor) // not null
//{
// print_debug_top_down_mapinfo("bgcode %d", pfloor->type);
// print_debug_top_down_mapinfo("bgstatus %d", pfloor->flags);
// print_debug_top_down_mapinfo("bgarea %d", pfloor->room);
//}
//
// if(gCurrentObject->oPosY < water)
// print_debug_top_down_mapinfo("water %d", water);
}
#endif
void print_checkinfo(void) {
print_debug_top_down_normal("checkinfo", 0);
@@ -506,8 +467,6 @@ void try_print_debug_mario_level_info(void) {
* [5][7] (b7 in the string array) to 1 to enable debug spawn.
*/
void try_do_mario_debug_object_spawn(void) {
UNUSED s32 unused;
if (sDebugPage == DEBUG_PAGE_STAGEINFO && gDebugInfo[DEBUG_PAGE_ENEMYINFO][7] == 1) {
if (gPlayer1Controller->buttonPressed & R_JPAD) {
spawn_object_relative(0, 0, 100, 200, gCurrentObject, MODEL_KOOPA_SHELL, bhvKoopaShell);
-3
View File
@@ -75,7 +75,6 @@ struct DmaHandlerList gDemoInputsBuf;
// fillers
UNUSED static u8 sfillerGameInit[0x90];
UNUSED static s32 sUnusedGameInitValue = 0;
// General timer that runs as the game starts
u32 gGlobalTimer = 0;
@@ -481,8 +480,6 @@ UNUSED static void record_demo(void) {
* Take the updated controller struct and calculate the new x, y, and distance floats.
*/
void adjust_analog_stick(struct Controller *controller) {
UNUSED u8 pad[8];
// Reset the controller's x and y floats.
controller->stickX = 0;
controller->stickY = 0;
-8
View File
@@ -72,12 +72,6 @@ struct PowerMeterHUD {
f32 unused;
};
struct UnusedHUDStruct {
u32 unused1;
u16 unused2;
u16 unused3;
};
struct CameraHUD {
s16 status;
};
@@ -98,8 +92,6 @@ static struct PowerMeterHUD sPowerMeterHUD = {
// when the power meter is hidden.
s32 sPowerMeterVisibleTimer = 0;
UNUSED static struct UnusedHUDStruct sUnusedHUDValues = { 0x00, 0x0A, 0x00 };
static struct CameraHUD sCameraHUD = { CAM_STATUS_NONE };
/**
+1 -7
View File
@@ -656,7 +656,6 @@ void print_hud_my_score_stars(s8 fileNum, s8 courseNum, s16 x, s16 y) {
u8 strStarCount[4];
s16 starCount;
u8 textSymStar[] = { GLYPH_STAR, GLYPH_SPACE };
UNUSED u16 unused;
u8 textSymX[] = { GLYPH_MULTIPLY, GLYPH_SPACE };
starCount = save_file_get_course_star_count(fileNum, courseNum);
@@ -753,8 +752,6 @@ void reset_dialog_render_state(void) {
#define Y_VAL2 5.0f
void render_dialog_box_type(struct DialogEntry *dialog, s8 linesPerBox) {
UNUSED s32 unused;
create_dl_translation_matrix(MENU_MTX_NOPUSH, dialog->leftOffset, dialog->width, 0);
switch (gDialogBoxType) {
@@ -890,10 +887,7 @@ u32 ensure_nonnegative(s16 value) {
return value;
}
void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 lowerBound)
{
UNUSED s32 pad[2];
void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 lowerBound) {
u8 strChar;
s16 colorLoop;
+2 -6
View File
@@ -1242,8 +1242,6 @@ u32 interact_clam_or_bubba(struct MarioState *m, UNUSED u32 interactType, struct
}
u32 interact_bully(struct MarioState *m, UNUSED u32 interactType, struct Object *o) {
UNUSED u32 unused;
u32 interaction;
if (m->flags & MARIO_METAL_CAP) {
interaction = INT_FAST_ATTACK_OR_SHELL;
@@ -1337,8 +1335,6 @@ u32 interact_mr_blizzard(struct MarioState *m, UNUSED u32 interactType, struct O
}
u32 interact_hit_from_below(struct MarioState *m, UNUSED u32 interactType, struct Object *o) {
UNUSED u32 unused;
u32 interaction;
if (m->flags & MARIO_METAL_CAP) {
interaction = INT_FAST_ATTACK_OR_SHELL;
@@ -1775,8 +1771,8 @@ void check_kick_or_punch_wall(struct MarioState *m) {
detector.x = m->pos[0] + 50.0f * sins(m->faceAngle[1]);
detector.z = m->pos[2] + 50.0f * coss(m->faceAngle[1]);
detector.y = m->pos[1];
detector.offsetY = 80.0f;
detector.radius = 5.0f;
detector.offsetY = 80.0f;
detector.radius = 5.0f;
if (find_wall_collisions(&detector) > 0) {
if (m->action != ACT_MOVE_PUNCHING || m->forwardVel >= 0.0f) {
-6
View File
@@ -177,17 +177,11 @@ s16 sDelayedWarpOp;
s16 sDelayedWarpTimer;
s16 sSourceWarpNodeId;
s32 sDelayedWarpArg;
#if defined(VERSION_EU) || defined(VERSION_SH)
s16 unusedEULevelUpdateBss1;
#endif
s8 sTimerRunning;
s8 gNeverEnteredCastle;
struct MarioState *gMarioState = &gMarioStates[0];
u8 unused1[4] = { 0 };
s8 sWarpCheckpointActive = FALSE;
u8 unused3[4];
u8 unused4[2];
u16 level_control_timer(s32 timerOp) {
switch (timerOp) {
-2
View File
@@ -68,7 +68,6 @@ extern struct MarioState *gMarioState;
extern s16 sCurrPlayMode;
extern s16 sTransitionTimer;
extern void (*sTransitionUpdate)(s16 *);
extern u8 unused3[4];
extern void load_language_text(void);
struct WarpDest {
@@ -86,7 +85,6 @@ extern s16 sDelayedWarpOp;
extern s16 sDelayedWarpTimer;
extern s16 sSourceWarpNodeId;
extern s32 sDelayedWarpArg;
extern u8 unused4[2];
extern s8 sTimerRunning;
struct HudDisplay {
-4
View File
@@ -171,8 +171,6 @@ void spawn_macro_objects(s32 areaIndex, s16 *macroObjList) {
}
void spawn_macro_objects_hardcoded(s32 areaIndex, s16 *macroObjList) {
UNUSED u8 pad[8];
// This version of macroObjList has the preset and Y-Rotation separated,
// and lacks behavior params. Might be an early version of the macro object list?
s16 macroObjX;
@@ -181,8 +179,6 @@ void spawn_macro_objects_hardcoded(s32 areaIndex, s16 *macroObjList) {
s16 macroObjPreset;
s16 macroObjRY; // Y Rotation
UNUSED u8 pad2[10];
gMacroObjectDefaultParent.header.gfx.areaIndex = areaIndex;
gMacroObjectDefaultParent.header.gfx.activeAreaIndex = areaIndex;
-2
View File
@@ -340,8 +340,6 @@ void update_flying_pitch(struct MarioState *m) {
}
void update_flying(struct MarioState *m) {
UNUSED u32 unused;
update_flying_pitch(m);
update_flying_yaw(m);
Loaded 100 of 163 files, more files were not shown because too many files have changed in this diff. Show more