From 3e9557f36314179fbdda1454e2b0b2c4a2be8655 Mon Sep 17 00:00:00 2001 From: Reonu Date: Sat, 24 Jul 2021 16:26:27 +0100 Subject: [PATCH 1/5] Added puppycam disclaimer to readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index cca36162..39d9c874 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,9 @@ This repo needs gcc in order to be able to build it. To install it, run `sudo ap 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`): +**About Puppycam** +- Puppycam is avaiable **on a dedicated branch**. If you want puppycam in your hack, clone the `puppycamera2` branch instead of `master`. + **Collision:** - Slope fix and exposed ceilings fix - No false ledgegrabs fix * From 626a2ea594d5954b1785f5e25777ad8c805bf849 Mon Sep 17 00:00:00 2001 From: Reonu Date: Sat, 24 Jul 2021 16:30:09 +0100 Subject: [PATCH 2/5] epic typo :) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 39d9c874..bffd8935 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This repo needs gcc in order to be able to build it. To install it, run `sudo ap 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`): **About Puppycam** -- Puppycam is avaiable **on a dedicated branch**. If you want puppycam in your hack, clone the `puppycamera2` branch instead of `master`. +- Puppycam is available **on a dedicated branch**. If you want puppycam in your hack, clone the `puppycamera2` branch instead of `master`. **Collision:** - Slope fix and exposed ceilings fix From 75b0d960bedcd2df14361e85a4e1c180fc0b0c84 Mon Sep 17 00:00:00 2001 From: Reonu Date: Sun, 25 Jul 2021 14:01:49 +0100 Subject: [PATCH 3/5] Added test level feature --- README.md | 5 +++-- include/config.h | 8 +++++++- levels/entry.c | 12 ++++++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cca36162..0c0aeecd 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,6 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin - Platform Displacement 2 by Arthurtilly * - Water Surface Type patch by thecozies - Rounded corners by FramePerfection, merged by Cheezepin -- reonucam3: custom camera by me. This is included as a .patch file in the enhancements folder, you need to apply it if you want this camera. - This video shows a rundown of the features: https://youtu.be/TQNkznX9Z3k **Common Hack Changes:** - Better extended boundaries by anonymous_moose @@ -31,6 +29,8 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin - You can increase the number of frames that you have to perform a firsty * - Ability to set Mario's movement speed when hanging from a ceiling * - Tighter hanging controls (mario will face the direction of the analog stick directly while hanging from a ceiling) * +- reonucam3: custom camera by me. This is included as a .patch file in the enhancements folder, you need to apply it if you want this camera. + This video shows a rundown of the features: https://youtu.be/TQNkznX9Z3k **Hacker QOL:** - Global, non-level based, star IDs (off by default) * @@ -48,6 +48,7 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin - The internal ROM name is now set with a define in `config.h` to make it simpler - There is a `gIsConsole` variable that is 1 when running on console and 0 when running on emulator. This way you can wrap your code in a console check. - Expanded audio heap allows for a larger concurrent note count and the importing of more m64 sequences and sound banks (By ArcticJaguar725) * +- You can set a test level in config.h in order to boot straight into it, so you can quickly test the level you're working on. * **Other Bugfixes:** - Castle music fix (Fixes the castle music sometimes triggering after getting a dialog) * diff --git a/include/config.h b/include/config.h index db9c20ee..a3ba6a1e 100644 --- a/include/config.h +++ b/include/config.h @@ -54,6 +54,12 @@ // -- ultrasm64-extbounds specific settings -- +// TEST LEVEL +// Uncomment this define and set a test level in order to boot straight into said level. +// This allows you to quickly test the level you're working on. +// If you want the game to boot normally, just comment out the define again. +//#define TEST_LEVEL LEVEL_BOB + // COMMON HACK CHANGES // Internal ROM name. NEEDS TO BE **EXACTLY** 20 CHARACTERS. Can't be 19 characters, can't be 21 characters. You can fill it with spaces. // The end quote should be here: " @@ -79,7 +85,7 @@ // Number of coins to spawn the "100 coin" star. If you remove the define altogether, then there won't be a 100 coin star at all. #define X_COIN_STAR 100 // Platform displacement 2 also known as momentum patch. Makes Mario keep the momemtum from moving platforms. Breaks treadmills. -#define PLATFORM_DISPLACEMENT_2 +//#define PLATFORM_DISPLACEMENT_2 // Stars don't kick you out of the level // #define NON_STOP_STARS // Uncomment this if you want global star IDs (useful for creating an open world hack ala MVC) diff --git a/levels/entry.c b/levels/entry.c index 17c773ed..a7bc8209 100644 --- a/levels/entry.c +++ b/levels/entry.c @@ -7,11 +7,19 @@ #include "make_const_nonconst.h" +#include "config.h" + +extern const LevelScript level_main_scripts_entry[]; const LevelScript level_script_entry[] = { INIT_LEVEL(), SLEEP(/*frames*/ 2), BLACKOUT(/*active*/ FALSE), - SET_REG(/*value*/ 0), + #ifdef TEST_LEVEL + SET_REG(TEST_LEVEL), + EXECUTE(/*seg*/ 0x15, _scriptsSegmentRomStart, _scriptsSegmentRomEnd, level_main_scripts_entry), + #else + SET_REG(0), EXECUTE(/*seg*/ 0x14, /*script*/ _introSegmentRomStart, /*scriptEnd*/ _introSegmentRomEnd, /*entry*/ level_intro_splash_screen), + #endif JUMP(/*target*/ level_script_entry), -}; +}; \ No newline at end of file From 3ef45889109c0c707a3903782d5782b2d4039d78 Mon Sep 17 00:00:00 2001 From: Reonu Date: Sun, 25 Jul 2021 15:45:23 +0100 Subject: [PATCH 4/5] cleaned up widescreen code, organised config file --- include/config.h | 20 ++++++++++---------- src/game/ingame_menu.c | 8 ++++---- src/game/rendering_graph_node.c | 16 ++++------------ src/menu/star_select.c | 11 ++++------- 4 files changed, 22 insertions(+), 33 deletions(-) diff --git a/include/config.h b/include/config.h index a3ba6a1e..ec683d95 100644 --- a/include/config.h +++ b/include/config.h @@ -98,21 +98,13 @@ #define IA8_COINS // Enables "parallel lakitu camera" or "aglab cam" which lets you move the camera smoothly with the dpad #define PARALLEL_LAKITU_CAM +// Allows Mario to ledgegrab sloped floors +#define NO_FALSE_LEDGEGRABS // HACKER QOL -// Enable widescreen (16:9) support -#define WIDE -// When this option is enabled, LODs will ONLY work on console. -// When this option is disabled, LODs will work regardless of whether console or emulator is used. -// Regardless of whether this setting is enabled or not, you can use gIsConsole to wrap your own code in a console check. -#define AUTO_LOD // Increase the maximum pole length (it will treat bparam1 and bparam2 as a single value) #define LONGER_POLES -// Disable AA (Recommended: it changes nothing on emulator, and it makes console run better) -#define DISABLE_AA -// Allows Mario to ledgegrab sloped floors -#define NO_FALSE_LEDGEGRABS // Number of possible unique model ID's (keep it higher than 256) #define MODEL_ID_COUNT 256 // Increase audio heap size to allow for more concurrent notes to be played and for more custom sequences/banks to be imported (does nothing with EU and SH versions) @@ -147,10 +139,18 @@ #define EXIT_COURSE_NODE 0x1F // OTHER ENHANCEMENTS +// Enable widescreen (16:9) support +#define WIDE // Skybox size modifier, changing this will add support for larger skybox images. NOTE: Vanilla skyboxes may break if you change this option. Be sure to rescale them accordingly. // Whenever you change this, make sure to run "make -C tools clean" to rebuild the skybox tool (alternatively go into skyconv.c and change the file in any way (like adding/deleting a space) to specifically rebuild that tool). // When increasing this, you should probably also increase the GFX pool size. (the GFX_POOL_SIZE define in src/game/game_init.h) #define SKYBOX_SIZE 1 +// When this option is enabled, LODs will ONLY work on console. +// When this option is disabled, LODs will work regardless of whether console or emulator is used. +// Regardless of whether this setting is enabled or not, you can use gIsConsole to wrap your own code in a console check. +#define AUTO_LOD +// Disable AA (Recommended: it changes nothing on emulator, and it makes console run better) +#define DISABLE_AA // If you want to change the extended boundaries mode, go to engine/extended_bounds.h and change EXTENDED_BOUNDS_MODE diff --git a/src/game/ingame_menu.c b/src/game/ingame_menu.c index 9cd458a8..b57e1a7b 100644 --- a/src/game/ingame_menu.c +++ b/src/game/ingame_menu.c @@ -1423,6 +1423,10 @@ void render_widescreen_setting(void) { print_generic_string(10, 200, textWideInfo2); } gSPDisplayList(gDisplayListHead++, dl_ia_text_end); + if (gPlayer1Controller->buttonPressed & L_TRIG){ + gWidescreen ^= 1; + save_file_set_widescreen_mode(gWidescreen); + } } #endif @@ -1779,10 +1783,6 @@ s16 render_pause_courses_and_castle(void) { } #ifdef WIDE render_widescreen_setting(); - if (gPlayer1Controller->buttonPressed & L_TRIG){ - gWidescreen ^= 1; - save_file_set_widescreen_mode(gWidescreen); - } #endif if (gDialogTextAlpha < 250) { gDialogTextAlpha += 25; diff --git a/src/game/rendering_graph_node.c b/src/game/rendering_graph_node.c index 3886a0de..1a42958f 100644 --- a/src/game/rendering_graph_node.c +++ b/src/game/rendering_graph_node.c @@ -15,8 +15,6 @@ #include "config.h" -#define WIDESCREEN - /** * This file contains the code that processes the scene graph for rendering. * The scene graph is responsible for drawing everything except the HUD / text boxes. @@ -297,14 +295,9 @@ static void geo_process_perspective(struct GraphNodePerspective *node) { u16 perspNorm; Mtx *mtx = alloc_display_list(sizeof(*mtx)); #ifdef WIDE - if (gWidescreen){ - if (gCurrLevelNum == 0x01) { - aspect = 1.33333f; - } else { - aspect = 1.775f; - } - } - else{ + if (gWidescreen && (gCurrLevelNum != 0x01)){ + aspect = 1.775f; + } else { aspect = 1.33333f; } #else @@ -836,11 +829,10 @@ static s32 obj_is_in_view(struct GraphNodeObject *node, Mat4 matrix) { // the amount of units between the center of the screen and the horizontal edge // given the distance from the object to the camera. -#ifdef WIDESCREEN // This multiplication should really be performed on 4:3 as well, // but the issue will be more apparent on widescreen. + // HackerSM64: This multiplication is done regardless of aspect ratio to fix object pop-in on the edges of the screen (which happens at 4:3 too) hScreenEdge *= GFX_DIMENSIONS_ASPECT_RATIO; -#endif if (geo != NULL && geo->type == GRAPH_NODE_TYPE_CULLING_RADIUS) { cullingRadius = diff --git a/src/menu/star_select.c b/src/menu/star_select.c index af55ae76..8bfacca7 100644 --- a/src/menu/star_select.c +++ b/src/menu/star_select.c @@ -53,8 +53,7 @@ static s8 sSelectableStarIndex = 0; // Act Selector menu timer that keeps counting until you choose an act. static s32 sActSelectorMenuTimer = 0; -#ifdef WIDE -#endif + /** * Act Selector Star Type Loop Action * Defines a select type for a star in the act selector. @@ -95,11 +94,10 @@ void render_100_coin_star(u8 stars) { if (stars & (1 << 6)) { // If the 100 coin star has been collected, create a new star selector next to the coin score. #ifdef WIDE - if (gWidescreen){ + if (gWidescreen) { sStarSelectorModels[6] = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_STAR, bhvActSelectorStarType, ((370*4.0f)/3), 24, -300, 0, 0, 0); - } - else{ + } else { sStarSelectorModels[6] = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_STAR, bhvActSelectorStarType, 370, 24, -300, 0, 0, 0); } @@ -169,8 +167,7 @@ void bhv_act_selector_init(void) { (((75 + sVisibleStars * -75 + i * 152)*4.0f)/3), 248, -300, 0, 0, 0); sStarSelectorModels[i]->oStarSelectorSize = 1.0f; } - } - else { + } else { for (i = 0; i < sVisibleStars; i++) { sStarSelectorModels[i] = spawn_object_abs_with_rot(gCurrentObject, 0, selectorModelIDs[i], bhvActSelectorStarType, From 0d21a79d8e1973f0f430613a92e9bce9ba57d438 Mon Sep 17 00:00:00 2001 From: Reonu Date: Sun, 25 Jul 2021 15:46:11 +0100 Subject: [PATCH 5/5] fixed oopsie when organising the config file --- include/config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/config.h b/include/config.h index ec683d95..66c99565 100644 --- a/include/config.h +++ b/include/config.h @@ -94,8 +94,6 @@ //#define SKIP_TITLE_SCREEN // Uncomment this if you want to keep the mario head and not skip it //#define KEEP_MARIO_HEAD -// Makes the coins ia8 64x64 instead of ia16 32x32. Uses new ia8 textures so that vanilla coins look better. -#define IA8_COINS // Enables "parallel lakitu camera" or "aglab cam" which lets you move the camera smoothly with the dpad #define PARALLEL_LAKITU_CAM // Allows Mario to ledgegrab sloped floors @@ -151,6 +149,8 @@ #define AUTO_LOD // Disable AA (Recommended: it changes nothing on emulator, and it makes console run better) #define DISABLE_AA +// Makes the coins ia8 64x64 instead of ia16 32x32. Uses new ia8 textures so that vanilla coins look better. +#define IA8_COINS // If you want to change the extended boundaries mode, go to engine/extended_bounds.h and change EXTENDED_BOUNDS_MODE