You've already forked HackerSM64
mirror of
https://github.com/HackerN64/HackerSM64.git
synced 2026-01-21 10:35:32 -08:00
Code cleanup
This commit is contained in:
38
CHANGES
38
CHANGES
@@ -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
|
||||
|
||||
10
Makefile
10
Makefile
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
18
README.md
18
README.md
@@ -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.
|
||||
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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(),
|
||||
};
|
||||
|
||||
|
||||
@@ -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"]}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
+
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user