Compare commits

..

95 Commits

Author SHA1 Message Date
Gregory Heskett
cadcdf4d55 Make G_PM_NPRIMITIVE a world default for fast64 exports 2025-11-06 02:36:14 -05:00
Gregory Heskett
6987bd6d1c Fix puppyprint ram size reporting (#910)
Fixes a crash on 3.0 that was introduced by segment reallocations and some hardcoding on Puppyprint's end. Also reworks the ram size reporting to make slightly more sense.
2025-11-06 02:30:32 -05:00
Matt Pharoah
68ea64189a Add support for realtime clock (#889) 2025-06-20 08:05:35 -04:00
bicyclesoda
1e5a6f6d45 make skyboxes easier to define (#869) 2025-02-20 13:31:00 -05:00
Fazana
338591eb1e Small and quick optimisations to vanilla text printing (#864)
* uncringe text a bit

* realised I can just rid of this too lol

* fixing another mistake

* Revert "realised I can just rid of this too lol"

This reverts commit d2c13b7ad4.
2025-02-13 22:24:38 -05:00
someone2639
8ed0d64a2d Fix incorrectly labeled JP vanilla dialog (#865)
* Fix incorrectly labeled JP vanilla dialog

lol

* the other one too

---------

Co-authored-by: someone2639 <someone2639@gmail.com>
2025-02-12 22:38:13 -05:00
Denis Kopyrin
ccb1419adb Split vanillla object from levels allowing pruning vanilla assets on fast64 imports and managing vanilla objects independently of levels (#796)
* Move level script to bank 0x1A

* Decouple vanilla objects in a separate bank

* Rollback group level scripts move, fixed nits

* Move actors_vanilla to actors/vanilla_actors

* Make EU translation segment last, remove vanilla objects segments copypaste

* Added LOAD_VANILLA_OBJECTS segment id stub
2025-01-29 20:58:46 -05:00
Matt Pharoah
8c268ce97f Merge pull request #852 from HackerN64/mpharoah/libpl2
Update to libpl2
2025-01-06 11:28:25 -05:00
Matt Pharoah
c08d70bc19 Update to libpl2 2025-01-04 20:48:41 -05:00
Gregory Heskett
749057b47b Bugfix: missing pipe sync before changing dialog envcolor (#836)
This has been observed to be an issue on console
2024-11-11 01:32:11 -05:00
Gregory Heskett
f40a69ab8c Merge branch 'master' into develop/3.0.0 2024-09-04 23:28:32 -04:00
Reonu
3f1f7f41be Add Arthurtilly to the CODEOWNERS file (#821)
* Add Arthurtilly to the CODEOWNERS file

* Update CODEOWNERS file to list each global owner on the same line

This should (allegedly) fix the issues of only the last entry being treated as an owner for reviews.

* Remove thecozies from CODEOWNERS file :(

---------

Co-authored-by: Gregory Heskett <gheskett@gmail.com>
2024-09-04 23:24:02 -04:00
Denis Kopyrin
bf70500b4d Merge pull request #825 from Lilaa3/fast64-repo-settings
Add Fast64 repo settings file (fast64.json)
2024-09-05 07:51:25 +08:00
Lila
27fedee76f Update fast64.json 2024-09-04 10:38:21 +01:00
Lila
a918785a92 Aglab requested change 2024-08-25 19:26:57 +01:00
Lila
10720ea056 Fall back on fast64 default draw layers 2024-08-24 13:05:36 +01:00
Lila
8dc47095e2 Add repo settings file
Allows fast64 to know a repo's ideal settings as soon as decomp path is picked.
Settings are the default except for:
Matstack is on
Microcode is set to EX2
Force Extended RAM is off because hackersm64 already has it enabled by default
Refresh is set to Refresh 13
2024-08-19 15:44:53 +01:00
Gregory Heskett
797bb63f1a Merge branch 'master' into develop/3.0.0 2024-07-03 23:51:06 -04:00
Gregory Heskett
9ef945296b HackerSM64 Release: v2.3.0
Merge pull request #815 from HackerN64/develop/2.3.0
2024-07-03 23:05:21 -04:00
Gregory Heskett
e1c00d4bef HackerSM64 v2.3.0 2024-07-03 22:50:27 -04:00
Reonu
aacf2c5e6d Add more audio banks and add some occasional mappings for audio macros (#777)
* Add more audio banks and add some occasional mappings for audio macros

* Remove config define for extra sound banks

---------

Co-authored-by: gheskett <gheskett@gmail.com>
2024-07-03 22:50:27 -04:00
Gregory Heskett
4500ffb579 Bugfix: assemble_sound.py build corruption issues (#813) 2024-07-03 22:50:27 -04:00
Gregory Heskett
a6782e6912 Fix seg faulting issue with MinGW build system, most likely caused by use of execl (#812) 2024-07-03 22:50:27 -04:00
Denis Kopyrin
750ba10cb1 Fixed audiofile warnings properly (#814)
* Revert "Fixed audiofile warnings (#811)"

This reverts commit 500507509b.

* Fixed audiofile warnings properly
2024-07-03 22:50:01 -04:00
Denis Kopyrin
500507509b Fixed audiofile warnings (#811) 2024-07-01 21:53:54 -04:00
Gregory Heskett
7381e35db4 Bugfix: Surfaces not able to be placed at the beginning of a partition (#805)
* Bugfix: Surfaces not able to be placed at the beginning of a partition

* Replace clear_spacial_partition calls with a bzero
2024-07-01 21:48:26 -04:00
Gregory Heskett
6a3e7e7a87 Bugfix: Missed purging of debug box flags that no longer exist in Puppycam (#804) 2024-07-01 21:47:38 -04:00
Gregory Heskett
9adb8c6de8 EASIER_LONG_JUMPS: only long jump with A+Z while running (#801)
Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>
2024-07-01 21:47:15 -04:00
Gregory Heskett
03ba81b5e3 Improve DEATH_ON_EXIT_COURSE define (#808) 2024-07-01 21:46:46 -04:00
Gregory Heskett
98b6231216 Pressing L in debug fly mode heals Mario (#809) 2024-07-01 21:46:12 -04:00
Denis Kopyrin
252a900b91 Added support for windows MinGW build (#800) 2024-07-01 21:45:36 -04:00
Denis Kopyrin
92822c6412 fixlights: added support for ripgrep (#802) 2024-07-01 21:44:54 -04:00
1ted59
0221d4ddf0 Fix spawned coins not being collectible until after the peak of their arc (#806)
If a spawned coin lands on the same frame it hits the peak of its arc, it will never have vertical speed < 0, so it will never be collectible.

Making this also set the coin to tangible if it has 0 speed fixes this issue.
2024-06-14 16:16:10 -04:00
Gregory Heskett
dcd58b2aad Restart music upon set_background_music() call if BETTER_REVERB preset changes (#797) 2024-06-01 10:55:58 -04:00
Denis Kopyrin
7ffa9a3bd7 Fixed fixlights.py compile error on python 3.12 (#798)
* Fixed fixlights.py compile error on python 3.12

* Fixed assemble_sound.py compile error on python 3.12
2024-05-22 13:48:24 -04:00
lolbinarycat
dbba4871e1 Add mips64-none-elf- to automatically detected prefixes (#799)
Co-authored-by: binarycat <binarycat@envs.net>
2024-05-18 02:11:10 -04:00
Gregory Heskett
520a6f3aed Bugfix: Blue coin duplication (#787)
Blue coins can be collected more than once if collected on the final frame of the switch timer when BLUE_COIN_SWITCH_RETRY is enabled. Fixing this on its own isn't enough though, as the blue coin switch also doesn't check for whether that coin was collected when it resets.
2024-05-03 01:54:43 -04:00
bicyclesoda
4d260f6885 Use G_TF_POINT on 3D billboard numbers (#791)
This matches the HUD filtering and just looks better IMO.
2024-04-30 23:19:20 -04:00
Gregory Heskett
aedae64e8b Remove destination warp node requirement (#788)
Also add assertions for common warp crashes and remove the hardcoded get_mario_spawn_type table size
2024-04-30 23:10:58 -04:00
bicyclesoda
f3e1496d29 Change test emulator from mupen64plus to parallel-launcher (#790)
* mupen64plus -> parallel-launcher

* Add WSL support

* Update Makefile

make it work
2024-04-29 16:42:13 -07:00
arthurtilly
0005bbbd6a Save up to 130KB of RAM at literally zero cost (#786) 2024-04-21 20:40:47 -04:00
Gregory Heskett
e494069b0a Add support for a user-defined config_local.h file (#785)
This allows hack collaborators to toggle debug features such as TEST_LEVEL without the need of pushing it up and negatively impacting other hack contributors. This is also useful for general HackerSM54 development, since it may be desirable to have PUPPYPRINT_DEBUG enabled by default or to not have to worry about pushing config defines up to a development branch that risk getting merged later on.

To use, simply create a new config_local.h file and place it in the config folder. Add #pragma once to the top of the file and add all the defines you wish! If you wish for something to be undefined when it's enabled by default, simply use #undef as opposed to a commented out #define. Use a combination of #undef and #define if you wish to change an existing value of a define. This local configuration will be completely ignored if DISABLE_ALL is being used in config_debug.h.

Regarding HackerSM64 Development: All feature developers are still responsible for making sure their features work in all scenarios regardless of whatever they have toggled in this file by default. This config file may be convenient but it is not an excuse to not properly test your changes!
2024-04-21 20:38:07 -04:00
arthurtilly
f852ff4359 Platform Displacement 2.1 (#776) 2024-04-22 09:14:12 +12:00
Gregory Heskett
2ae3426957 Change compression type to yay0 and ignore .inc.c files in most directories (#784)
rnc1 has noticeably slower load times in vanilla than yay0 does. gzip and mio0 are pretty useless and can be yeeted from the repo, but that's not part of this PR's scope.
2024-04-21 17:13:47 -04:00
Reonu
ca937d23ee Label unlabelled audio func (func_80321080 to stop_secondary_music) (#782) 2024-04-15 01:59:54 +01:00
Reonu
e32b0ea960 fix fast64 exports due to macro objects removal (#780)
Fast64 exports dummy macro object data even if you don't use macro objects in your level. This change allows HackerSM64 to compile even with Fast64 doing cringe.
2024-04-11 15:29:13 +01:00
arthurtilly
219f4683f7 ASCII/UTF-8 Text and Full Multilang Support (#775)
Co-authored-by: Axollyon <20480418+Axollyon@users.noreply.github.com>
Co-authored-by: Reonu <danileon95@gmail.com>
Co-authored-by: Arceveti <arceveti@gmail.com>
Co-authored-by: Gregory Heskett <gheskett@gmail.com>
2024-03-18 21:22:04 +00:00
Matt Pharoah
7353db562c Merge pull request #774 from mpharoah/mpharoah/update-libpl
Update libpl
2024-03-06 17:28:42 -05:00
Matt Pharoah
82e0fdf391 Update libpl 2024-03-06 09:10:09 -05:00
Gregory Heskett
14140887dd Merge pull request #773 from HackerN64/merge-2.2.0-into-3.0.0
Merge 2.2.0 into 3.0.0
2024-03-02 11:07:12 -05:00
Gregory Heskett
d29a552813 Merge branch 'master' into merge-2.2.0-into-3.0.0 2024-03-02 10:43:33 -05:00
Gregory Heskett
3e5d14e650 Merge pull request #772 from HackerN64/develop/2.2.0
Release: HackerSM64 2.2.0
2024-03-02 08:16:09 -05:00
Gregory Heskett
197d8074e3 Vanilla bugfix: obj_init_animation referencing o instead of obj 2024-03-01 17:47:05 -05:00
Gregory Heskett
c5d9f535ee HackerSM64 v2.2.0 2024-03-01 17:03:30 -05:00
Gregory Heskett
8257f77c57 A few various Puppyprint bugfixes (#770) 2024-03-01 17:00:46 -05:00
arthurtilly
78747e9836 Toggle the default status of a few defines to avoid confusing new people (#740)
* define toggles

* disable blue preview
2024-02-29 19:03:43 -05:00
arthurtilly
c96118bcd8 Fix objects using throwmatrix having incorrect rotation when paused (#769)
* throwmatrix fix

* ok fixed it and removed some cringe matching

* happy bitch
2024-02-29 19:03:08 -05:00
Gregory Heskett
4c8233fe6a Fix automatic libpl cloning (#771) 2024-02-27 10:29:47 -05:00
Gregory Heskett
524e35c974 Add -falign-functions=32 to makefile flags (#745)
Seemingly provides minor performance benefit and should more importantly reduce perf lotto substantially (hopefully)
2024-02-22 00:38:19 -05:00
Matt Pharoah
fc5ffa7438 Update libpl (#767)
* Update libpl

* Update libpl again

* would you believe its another libpl update
2024-02-16 12:45:29 -05:00
arthurtilly
d07e6383f6 Fixed bugs relating to objects dying in lava (#766)
• Changed the generic object death function to now also check that an object has landed and is over lava before killing it. Previously it would die instantly if it was above lava which resulted in objects randomly dying above lava

• Also changed the same function to kill a non-buoyant and killable object (e.g. goombas) right when it touches water. Previously it would slowly sink to the bottom and then instantly die upon touching the floor underwater which is strange.

• Changed where lava checks are done so they are done in the same place as other object flag checks. This avoids bugs where e.g. objects die when touching the edge of a platform that is over lava, because the ground flags are updated, then the object's floor is updated to be over the lava, and then the lava move flags are updated causing the object to think it is over lava and touching ground at the same time (making it die)

• Fixed the coin flicker define for regular non-bully coins because apparently it just never worked and no-one noticed? Only the coins that come from bullies worked with this define and I guess people only ever tested coins in lava with bullies. I rewrote the coin behavior to be a little closer to the bully one. I think in the future the two types of moving coins could easily be merged into one object, they don't act visibly different at all.

Tested the PR with a lot of goombas being dropped into lava/water and also this stuff is in Mario Builder so I've been testing it there too. Feel free to test more.
2024-02-09 21:07:31 -05:00
Gregory Heskett
1de4b9144b Fix floating point crash with pitch bend table + various audio optimizations (#746)
* Move audio TTLs to improve dcache

Saves over 100us even when audio is idle

* Improve additional audio runtime by reducing some unnecessary float math

* Pause channel/layer processing on sfx channels when idle

* Fix possible floating point UB/crash with gPitchBendFrequencyScale
2024-02-04 02:29:38 -05:00
YoshiMilkman
88c2cdb0a0 Fix wall sidling with negative speed (#762) 2024-02-02 22:52:10 -05:00
Gregory Heskett
3a5a2f14dd Missed a comma 2024-02-02 22:27:48 -05:00
Gregory Heskett
b9ba17a4d6 Add libpl submodule (#753)
* Add libpl submodule

* Clone libpl submodule automatically while building (if enabled)
2024-02-02 22:08:34 -05:00
Gregory Heskett
4af18b6fc9 Merge pull request #758 from HackerN64/master
Merge HackerSM64 2.1.3 release into 3.0.0
2024-01-31 01:23:26 -05:00
Gregory Heskett
5064fcfb69 Merge pull request #757 from HackerN64/master
Merge HackerSM64 2.1.3 release into 2.2.0
2024-01-31 01:23:18 -05:00
Gregory Heskett
05bbe16e29 HackerSM64 Release: 2.1.3
* Preserve vanilla reverb downsampling behavior whenever BETTER_REVERB isn't in use (#727)

* Disable unrelated buttons controlling S&Q menu and pausing (#728)

* Update Dockerfile to Ubuntu 22.04 as 18.04 is EOL (#731)

* Update Dockerfile to Ubuntu 22.04 as 18.04 is EOL

* Dockerfile: Use modern syntax for mounting

* Add gcc-mips-linux-gnu to dockerfile

* Add DEBUG_ASSERTIONS define and enable it by default (#730)

* Add relevant model ID asserts to level script load commands (#722)

Co-authored-by: someone2639 <someone2639@gmail.com>

* Define changes for transitions, two bug fixes (#739)

* Fixed one or two bugs, cleaned up a few things, put every non vanilla styled change into POLISHED_TRANSITIONS

And renamed set_and_reset_transition_fade_timer

* Undid the renaming of set_and_reset_transition_fade_timer as suggested

* Fix silhouette occlusion layers rendering twice (#748)

* Fix Boo's Accelerating Upwards During Textbox (Vanilla Bug) (#742)

* Add assert for beginning geo layout command (#738)

* geo layout assert

* new idea

* Change assert message, add crash screen newline support, and change debug safeguards

* Fix weird text on Project64 GLideN64 (#715)

* Update version to 2.1.3 (#754)

* Fix rumble Issues (#756)

* Missed important use of thread6 stack define

* Fix build issues with rumble

---------

Co-authored-by: Gregory Heskett <gheskett@gmail.com>
Co-authored-by: Denis Kopyrin <aglab3@gmail.com>
Co-authored-by: MisterSheeple <27652712+MisterSheeple@users.noreply.github.com>
Co-authored-by: someone2639 <someone2639@users.noreply.github.com>
Co-authored-by: someone2639 <someone2639@gmail.com>
Co-authored-by: Lilaa3 <87947656+Lilaa3@users.noreply.github.com>
Co-authored-by: Arceveti <73617174+Arceveti@users.noreply.github.com>
Co-authored-by: 1ted59 <24933689+1ted59@users.noreply.github.com>
Co-authored-by: arthurtilly <32559225+arthurtilly@users.noreply.github.com>
Co-authored-by: iProgramInCpp <iprogramincpp@gmail.com>
2024-01-27 12:45:43 -05:00
Gregory Heskett
9cf3753d6e Update version to 2.1.3 (#754) 2024-01-27 12:39:03 -05:00
Gregory Heskett
325ee7c5ec Fix rumble Issues (#756)
* Missed important use of thread6 stack define

* Fix build issues with rumble
2024-01-27 12:39:03 -05:00
DNVIC
bf924a8ec3 Added a define for slope fix (#749)
* implemented a form of slope fix

* fixed the slope fix to not allow for hyper cheese

* implemented gheskett's suggestions

* Added space between comment and define

Co-authored-by: Gregory Heskett <gheskett@gmail.com>

---------

Co-authored-by: dnvic <business@dnvic.com>
Co-authored-by: Gregory Heskett <gheskett@gmail.com>
2024-01-21 14:11:32 -05:00
iProgramInCpp
c39b289441 * Fix weird text on Project64 GLideN64 (#715)
Included in the PR will be a list of comparisons.

This does two things:
1. Restores the `dl_ia_text_tex_settings` from the original Super Mario 64. Not sure why this was changed.
2. Changes the S coordinate of two vertices from `vertex_ia8_char` from 480 to 512. This is an error from the original game.
2024-01-21 13:42:50 -05:00
arthurtilly
5ba00edf20 Add assert for beginning geo layout command (#738)
* geo layout assert

* new idea

* Change assert message, add crash screen newline support, and change debug safeguards

---------

Co-authored-by: Gregory Heskett <gheskett@gmail.com>
2024-01-21 13:38:00 -05:00
1ted59
15a81037ef Fix Boo's Accelerating Upwards During Textbox (Vanilla Bug) (#742)
If a `Go On A Ghost Hunt` Boo is killed while it has a gravity of -1 (at the bottom of its oscillation), and does not hit a wall, it will keep the same negative gravity and continue moving until the textbox is closed. Boo Y speed isn't capped in this scenario, so the constant -1 gravity leads to the boo moving upwards at an increasing rate.

This leads to issues in `boo_act_4`. The distance eventually increases to a point where the boo object is too far to be returned in `cur_obj_nearest_object_with_behavior`. 

This can have 2 buggy effects:

- the wrong dialog box being brought up if the textbox is delayed (easiest to do by hanging on a ledge).
- the puzzle solved jingle being played incorrectly if you wait in the textbox long enough

This doesn't actually cause issues with King Boo, it just brings up the wrong text box. King Boo spawning is unaffected by this bug.

The fix is to stop the boo after the death animation has finished playing, stopping the boo from accelerating upwards. I don't believe this to cause any other issues (the boo is already dead after all!)

Thanks to Kyman for finding this bug.
2024-01-20 13:07:45 -05:00
Arceveti
b2707990f2 Fix silhouette occlusion layers rendering twice (#748) 2024-01-01 18:44:41 -05:00
Gregory Heskett
1d7a690361 Optimize BETTER_REVERB lightweight by an additional ~20% CPU, while also cutting memory requirements for it by ~30% (#744) 2023-12-30 23:22:05 -05:00
Lilaa3
08f0e3efa4 Define changes for transitions, two bug fixes (#739)
* Fixed one or two bugs, cleaned up a few things, put every non vanilla styled change into POLISHED_TRANSITIONS

And renamed set_and_reset_transition_fade_timer

* Undid the renaming of set_and_reset_transition_fade_timer as suggested
2023-12-29 18:32:19 -05:00
arthurtilly
6148582f5e remove puppylights (#736) 2023-12-16 23:26:31 -05:00
Gregory Heskett
913cda93b8 Audio cleanup checkpoint: Large portion of synthesis.c taken care of + occasional audio optimizations (#710) 2023-12-15 23:57:19 -05:00
someone2639
d7c840b8f1 Cache master displaylist on "hot" code paths (#724)
* add displaylist macros

* implement displaylist macro in memory.c

* API update

* implement displaylist macro on all 'hot' code paths

* Remove the macro entirely

* rename tmpDL

* remove the other two macros

* catch the last 2 missing statements

---------

Co-authored-by: someone2639 <someone2639@gmail.com>
2023-12-15 23:56:40 -05:00
arthurtilly
b73d8dd178 Math util cleanup (#566)
* math util cleanup

* clean up min/max 3 and also distance and angle functions

* improve pipelining and make macros safe

* macros safer and cleaned approaches

* fix build

* made sure puppycam builds (and fixed unused var warnings)

* added 32 bit mins and maxs
2023-12-15 23:44:06 -05:00
arthurtilly
9fc928ed70 Remove OBJECTS_REJ and clean up core render func (By Fazana) (#735)
* crowd pleaser

* Fix debug boxes

* fix comments

* renamed temp graphics head to be consistent

---------

Co-authored-by: Fazana <52551480+FazanaJ@users.noreply.github.com>
2023-12-15 08:48:32 -05:00
someone2639
76dae5e8dd Add file select skip define (#723)
* add config define to skip file select

* implement file select skip

* Add more coverage to the skip file select tweak

---------

Co-authored-by: someone2639 <someone2639@gmail.com>
2023-12-14 23:27:50 -05:00
someone2639
7df16608a7 Add relevant model ID asserts to level script load commands (#722)
Co-authored-by: someone2639 <someone2639@gmail.com>
2023-12-14 23:26:43 -05:00
arthurtilly
1646702393 shorten call_native command (#733) 2023-12-14 23:24:35 -05:00
arthurtilly
dcfcf50a80 wall fix (#734) 2023-12-14 23:24:03 -05:00
Gregory Heskett
4f2c48c733 Add DEBUG_ASSERTIONS define and enable it by default (#730) 2023-12-11 01:58:30 -05:00
MisterSheeple
72f8ea130f Update Dockerfile to Ubuntu 22.04 as 18.04 is EOL (#731)
* Update Dockerfile to Ubuntu 22.04 as 18.04 is EOL

* Dockerfile: Use modern syntax for mounting

* Add gcc-mips-linux-gnu to dockerfile
2023-12-10 22:40:34 -05:00
Denis Kopyrin
36c98b6cd1 Disable unrelated buttons controlling S&Q menu and pausing (#728) 2023-12-10 02:28:08 -05:00
arthurtilly
db2a739b8a Remove macro objects and free up bparam3 (#558)
* BoB, WF, JRB, CCM

* HMC and LLL

* SSL

* DDD to RR

* bowser courses

* overworld

* all stages done

* remove macro object code

* fix bparam3 and respawn info

* rename script_func_locals to be unique

* Remove level_misc_macros

* formatting changes :)

* added some enums for respawn info

---------

Co-authored-by: Arceveti <arceveti@gmail.com>
2023-11-28 15:36:33 -05:00
Gregory Heskett
78cc957d31 Preserve vanilla reverb downsampling behavior whenever BETTER_REVERB isn't in use (#727) 2023-10-31 18:23:15 -04:00
thecozies
7de18d10fc Merge pull request #714 from HackerN64/develop/2.1.2
Release: v2.1.2
2023-09-27 16:54:38 -05:00
Gregory Heskett
01c3f20c6f v2.1.2 2023-09-27 11:13:53 -05:00
thecozies
38f25d2b83 rename flips src dir (#711) 2023-09-27 11:55:14 -04:00
someone2639
48bea33052 spawn lakitu at the origin (#712)
Co-authored-by: someone2639 <someone2639@gmail.com>
2023-09-27 11:54:00 -04:00
1175 changed files with 18785 additions and 19415 deletions

138
.gitignore vendored
View File

@@ -528,21 +528,26 @@ assets/demos/pss.bin
assets/demos/unused.bin
assets/demos/wf.bin
levels/bbh/0.rgba16.png
actors/vanilla_actors/bbh/0.rgba16.png
levels/bbh/1.rgba16.png
levels/bbh/2.rgba16.png
levels/bbh/3.rgba16.png
levels/bbh/4.rgba16.png
levels/bbh/5.rgba16.png
levels/bbh/6.rgba16.png
actors/vanilla_actors/bbh/4.rgba16.png
actors/vanilla_actors/bbh/5.rgba16.png
actors/vanilla_actors/bbh/6.rgba16.png
actors/vanilla_actors/bitdw/0.rgba16.png
levels/bitdw/0.rgba16.png
levels/bitdw/1.rgba16.png
levels/bitdw/2.rgba16.png
levels/bitdw/3.rgba16.png
actors/vanilla_actors/bitfs/0.rgba16.png
levels/bitfs/0.rgba16.png
actors/vanilla_actors/bitfs/1.rgba16.png
levels/bitfs/1.rgba16.png
levels/bitfs/2.rgba16.png
levels/bits/0.rgba16.png
levels/bits/1.rgba16.png
actors/vanilla_actors/bits/2.rgba16.png
levels/bits/2.rgba16.png
levels/bob/0.rgba16.png
levels/bob/1.rgba16.png
@@ -559,9 +564,9 @@ levels/bowser_3/2.rgba16.png
levels/castle_grounds/0.rgba16.png
levels/castle_grounds/1.rgba16.png
levels/castle_grounds/2.rgba16.png
levels/castle_grounds/3.rgba16.png
levels/castle_grounds/4.rgba16.png
levels/castle_grounds/5.ia8.png
actors/vanilla_actors/castle_grounds/3.rgba16.png
actors/vanilla_actors/castle_grounds/4.rgba16.png
actors/vanilla_actors/castle_grounds/5.ia8.png
levels/castle_inside/1.rgba16.png
levels/castle_inside/10.rgba16.png
levels/castle_inside/11.rgba16.png
@@ -599,22 +604,25 @@ levels/castle_inside/38.rgba16.png
levels/castle_inside/39.rgba16.png
levels/castle_inside/4.rgba16.png
levels/castle_inside/40.rgba16.png
levels/castle_inside/5.rgba16.png
levels/castle_inside/6.rgba16.png
levels/castle_inside/7.rgba16.png
actors/vanilla_actors/castle_inside/5.rgba16.png
actors/vanilla_actors/castle_inside/6.rgba16.png
actors/vanilla_actors/castle_inside/7.rgba16.png
levels/castle_inside/8.rgba16.png
levels/castle_inside/9.rgba16.png
actors/vanilla_actors/castle_inside/castle_light.ia16.png
levels/castle_inside/castle_light.ia16.png
levels/ccm/0.rgba16.png
levels/ccm/1.rgba16.png
actors/vanilla_actors/ccm/1.rgba16.png
levels/ccm/10.rgba16.png
levels/ccm/11.rgba16.png
levels/ccm/12.rgba16.png
actors/vanilla_actors/ccm/12.rgba16.png
levels/ccm/2.rgba16.png
levels/ccm/3.rgba16.png
actors/vanilla_actors/ccm/2.rgba16.png
actors/vanilla_actors/ccm/3.rgba16.png
levels/ccm/4.rgba16.png
levels/ccm/5.rgba16.png
levels/ccm/6.rgba16.png
actors/vanilla_actors/ccm/5.rgba16.png
actors/vanilla_actors/ccm/6.rgba16.png
levels/ccm/7.rgba16.png
levels/ccm/8.ia16.png
levels/ccm/9.ia16.png
@@ -623,11 +631,12 @@ levels/cotmc/1.rgba16.png
levels/cotmc/2.rgba16.png
levels/cotmc/3.rgba16.png
levels/cotmc/4.rgba16.png
levels/ddd/0.rgba16.png
actors/vanilla_actors/ddd/0.rgba16.png
levels/ddd/1.rgba16.png
levels/ddd/2.rgba16.png
actors/vanilla_actors/ddd/2.rgba16.png
levels/ddd/3.rgba16.png
levels/ddd/4.rgba16.png
actors/vanilla_actors/ddd/4.rgba16.png
levels/ending/cake.png
levels/ending/cake_eu.png
levels/ending/eu_023000.rgba16.png
@@ -639,10 +648,10 @@ levels/ending/eu_028000.rgba16.png
levels/hmc/0.rgba16.png
levels/hmc/1.rgba16.png
levels/hmc/2.rgba16.png
levels/hmc/3.rgba16.png
levels/hmc/4.rgba16.png
levels/hmc/5.rgba16.png
levels/hmc/6.rgba16.png
actors/vanilla_actors/hmc/3.rgba16.png
actors/vanilla_actors/hmc/4.rgba16.png
actors/vanilla_actors/hmc/5.rgba16.png
actors/vanilla_actors/hmc/6.rgba16.png
levels/hmc/7.rgba16.png
levels/intro/0.rgba16.png
levels/intro/1.rgba16.png
@@ -653,40 +662,41 @@ levels/intro/3_sh_tm.rgba16.png
levels/intro/3_tm.rgba16.png
levels/jrb/0.rgba16.png
levels/jrb/1.rgba16.png
levels/jrb/2.rgba16.png
levels/jrb/3.rgba16.png
levels/lll/0.rgba16.png
levels/lll/1.rgba16.png
levels/lll/10.rgba16.png
levels/lll/11.rgba16.png
levels/lll/12.rgba16.png
levels/lll/13.rgba16.png
levels/lll/14.rgba16.png
levels/lll/15.rgba16.png
levels/lll/16.rgba16.png
levels/lll/17.rgba16.png
levels/lll/18.rgba16.png
levels/lll/19.rgba16.png
levels/lll/2.rgba16.png
levels/lll/20.rgba16.png
levels/lll/21.rgba16.png
levels/lll/22.rgba16.png
levels/lll/23.rgba16.png
levels/lll/24.rgba16.png
levels/lll/25.rgba16.png
actors/vanilla_actors/jrb/2.rgba16.png
actors/vanilla_actors/jrb/3.rgba16.png
actors/vanilla_actors/lll/0.rgba16.png
actors/vanilla_actors/lll/1.rgba16.png
actors/vanilla_actors/lll/10.rgba16.png
actors/vanilla_actors/lll/11.rgba16.png
actors/vanilla_actors/lll/12.rgba16.png
actors/vanilla_actors/lll/13.rgba16.png
actors/vanilla_actors/lll/14.rgba16.png
actors/vanilla_actors/lll/15.rgba16.png
actors/vanilla_actors/lll/16.rgba16.png
actors/vanilla_actors/lll/17.rgba16.png
actors/vanilla_actors/lll/18.rgba16.png
actors/vanilla_actors/lll/19.rgba16.png
actors/vanilla_actors/lll/2.rgba16.png
actors/vanilla_actors/lll/20.rgba16.png
actors/vanilla_actors/lll/21.rgba16.png
actors/vanilla_actors/lll/22.rgba16.png
actors/vanilla_actors/lll/23.rgba16.png
actors/vanilla_actors/lll/24.rgba16.png
actors/vanilla_actors/lll/25.rgba16.png
levels/lll/26.rgba16.png
levels/lll/27.ia16.png
levels/lll/28.rgba16.png
levels/lll/29.rgba16.png
actors/vanilla_actors/lll/29.rgba16.png
levels/lll/3.rgba16.png
levels/lll/30.rgba16.png
levels/lll/31.rgba16.png
levels/lll/32.rgba16.png
levels/lll/4.rgba16.png
levels/lll/5.rgba16.png
levels/lll/6.rgba16.png
actors/vanilla_actors/lll/6.rgba16.png
levels/lll/7.rgba16.png
levels/lll/8.rgba16.png
actors/vanilla_actors/lll/8.rgba16.png
levels/lll/9.rgba16.png
levels/menu/main_menu_seg7.00018.rgba16.png
levels/menu/main_menu_seg7.00818.rgba16.png
@@ -921,59 +931,64 @@ levels/menu/main_menu_seg7_us.0B800.ia8.png
levels/pss/0.rgba16.png
levels/pss/1.ia16.png
levels/pss/2.rgba16.png
levels/rr/1.rgba16.png
actors/vanilla_actors/rr/1.rgba16.png
levels/rr/2.rgba16.png
levels/rr/quarter_flying_carpet.rgba16.png
actors/vanilla_actors/rr/quarter_flying_carpet.rgba16.png
levels/sl/0.rgba16.png
levels/sl/1.rgba16.png
levels/sl/2.rgba16.png
actors/vanilla_actors/sl/2.rgba16.png
levels/sl/3.rgba16.png
levels/sl/4.rgba16.png
levels/ssl/0.rgba16.png
levels/ssl/1.ia16.png
levels/ssl/10.rgba16.png
levels/ssl/11.rgba16.png
actors/vanilla_actors/ssl/10.rgba16.png
actors/vanilla_actors/ssl/11.rgba16.png
levels/ssl/2.rgba16.png
levels/ssl/3.rgba16.png
levels/ssl/4.rgba16.png
levels/ssl/5.rgba16.png
levels/ssl/6.rgba16.png
actors/vanilla_actors/ssl/5.rgba16.png
actors/vanilla_actors/ssl/6.rgba16.png
levels/ssl/7.rgba16.png
levels/ssl/8.rgba16.png
levels/ssl/9.rgba16.png
actors/vanilla_actors/ssl/8.rgba16.png
actors/vanilla_actors/ssl/9.rgba16.png
levels/thi/0.rgba16.png
levels/thi/1.rgba16.png
actors/vanilla_actors/thi/1.rgba16.png
levels/totwc/0.rgba16.png
levels/totwc/1.rgba16.png
levels/totwc/2.rgba16.png
levels/totwc/3.ia16.png
levels/ttc/0.rgba16.png
actors/vanilla_actors/ttc/0.rgba16.png
actors/vanilla_actors/ttc/1.rgba16.png
levels/ttc/1.rgba16.png
levels/ttc/2.rgba16.png
levels/ttm/0.ia16.png
levels/ttm/1.rgba16.png
levels/ttm/2.rgba16.png
levels/ttm/3.rgba16.png
levels/ttm/4.rgba16.png
actors/vanilla_actors/ttm/4.rgba16.png
levels/ttm/5.rgba16.png
levels/ttm/6.rgba16.png
levels/ttm/7.rgba16.png
levels/ttm/8.rgba16.png
actors/vanilla_actors/ttm/8.rgba16.png
levels/vcutm/0.rgba16.png
levels/vcutm/1.rgba16.png
levels/vcutm/2.rgba16.png
actors/vanilla_actors/vcutm/2.rgba16.png
levels/vcutm/3.rgba16.png
levels/wdw/0.rgba16.png
levels/wdw/1.rgba16.png
levels/wdw/2.rgba16.png
levels/wdw/3.rgba16.png
actors/vanilla_actors/wdw/1.rgba16.png
actors/vanilla_actors/wdw/2.rgba16.png
actors/vanilla_actors/wdw/3.rgba16.png
levels/wdw/4.rgba16.png
actors/vanilla_actors/wf/0.rgba16.png
levels/wf/0.rgba16.png
levels/wf/1.rgba16.png
actors/vanilla_actors/wf/2.rgba16.png
levels/wf/2.rgba16.png
levels/wf/3.rgba16.png
levels/wf/4.rgba16.png
levels/wf/5.ia8.png
actors/vanilla_actors/wf/3.rgba16.png
actors/vanilla_actors/wf/4.rgba16.png
actors/vanilla_actors/wf/5.ia8.png
levels/wmotr/0.rgba16.png
levels/wmotr/1.rgba16.png
levels/wmotr/2.rgba16.png
@@ -2149,3 +2164,6 @@ lib/libs2d_engine.a
# :Zone_Identifier files
*Zone.Identifier
# user-specific config file
include/config/config_local.h

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "lib/libpl2"]
path = lib/libpl2
url = https://gitlab.com/parallel-launcher/libpl2.git

View File

@@ -26,7 +26,8 @@
"VERSION_US=1",
"F3DEX_GBI_2=1",
"F3DZEX_NON_GBI_2=1",
"F3DEX_GBI_SHARED=1"
"F3DEX_GBI_SHARED=1",
"LIBPL=1"
],
"compilerPath": "/usr/bin/mips-linux-gnu-gcc",
"cStandard": "gnu17",

View File

@@ -2,9 +2,7 @@
# Each line is a file pattern followed by one or more owners.
# These owners will be the default owners for everything in the repo.
* @Reonu
* @thecozies
* @gheskett
* @Reonu @gheskett @arthurtilly
# Order is important. The last matching pattern has the most precedence.
# So if a pull request only touches javascript files, only these owners

View File

@@ -1,17 +1,18 @@
FROM ubuntu:18.04 as build
FROM ubuntu:22.04 as build
RUN apt-get update && \
apt-get install -y \
binutils-mips-linux-gnu \
bsdmainutils \
bsdextrautils \
build-essential \
gcc-mips-linux-gnu \
libcapstone-dev \
pkgconf \
python3
RUN mkdir /sm64
WORKDIR /sm64
ENV PATH="/sm64/tools:${PATH}"
RUN mkdir /hackersm64
WORKDIR /hackersm64
ENV PATH="/hackersm64/tools:${PATH}"
CMD echo 'usage: docker run --rm --mount type=bind,source="$(pwd)",destination=/sm64 sm64 make VERSION=us -j4\n' \
'see https://github.com/n64decomp/sm64/blob/master/README.md for advanced usage'
CMD echo 'Usage: docker run --rm -v ${PWD}:/hackersm64 hackersm64 make VERSION=us -j4\n' \
'See https://github.com/HackerN64/HackerSM64/blob/master/README.md for more information'

110
Makefile
View File

@@ -135,7 +135,7 @@ endif
#==============================================================================#
# Default non-gcc opt flags
DEFAULT_OPT_FLAGS = -Ofast
DEFAULT_OPT_FLAGS = -Ofast -falign-functions=32
# Note: -fno-associative-math is used here to suppress warnings, ideally we would enable this as an optimization but
# this conflicts with -ftrapping-math apparently.
# TODO: Figure out how to allow -fassociative-math to be enabled
@@ -253,11 +253,23 @@ ifeq ($(HVQM),1)
SRC_DIRS += src/hvqm
endif
# LIBPL - whether to include libpl library for interfacing with Parallel Launcher
# (library will be pulled into repo after building with this enabled for the first time)
# 1 - includes code in ROM
# 0 - does not
LIBPL ?= 0
LIBPL_DIR := lib/libpl2
$(eval $(call validate-option,LIBPL,0 1))
ifeq ($(LIBPL),1)
DEFINES += LIBPL=1
SRC_DIRS += $(LIBPL_DIR)
endif
BUILD_DIR_BASE := build
# BUILD_DIR is the location where all build artifacts are placed
BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)_$(CONSOLE)
COMPRESS ?= rnc1
COMPRESS ?= yay0
$(eval $(call validate-option,COMPRESS,mio0 yay0 gzip rnc1 rnc2 uncomp))
ifeq ($(COMPRESS),gzip)
DEFINES += GZIP=1
@@ -335,6 +347,18 @@ ifeq ($(filter clean distclean print-%,$(MAKECMDGOALS)),)
ifeq ($(DUMMY),FAIL)
$(error Failed to build tools)
endif
# Clone any needed submodules
ifeq ($(LIBPL),1)
ifeq ($(wildcard $(LIBPL_DIR)/*.h),)
$(info Cloning libpl2 submodule...)
DUMMY != git submodule update --init $(LIBPL_DIR) > /dev/null || echo FAIL
ifeq ($(DUMMY),FAIL)
$(error Failed to clone libpl2 submodule)
endif
endif
endif
$(info Building ROM...)
endif
@@ -356,9 +380,10 @@ SOUND_BIN_DIR := $(BUILD_DIR)/sound
TEXTURE_DIR := textures
ACTOR_DIR := actors
LEVEL_DIRS := $(patsubst levels/%,%,$(dir $(wildcard levels/*/header.h)))
VNL_ACTRS_DIRS := $(patsubst actors/vanilla_actors/%,%,$(dir $(wildcard actors/vanilla_actors/*/header.h)))
# Directories containing source files
SRC_DIRS += src src/boot src/game src/engine src/audio src/menu src/buffers actors levels bin data assets asm lib sound
SRC_DIRS += src src/boot src/game src/engine src/audio src/menu src/buffers lib/librtc actors levels bin data assets asm lib sound
LIBZ_SRC_DIRS := src/libz
GODDARD_SRC_DIRS := src/goddard src/goddard/dynlists
BIN_DIRS := bin bin/$(VERSION)
@@ -368,13 +393,17 @@ include Makefile.split
# Source code files
LEVEL_C_FILES := $(wildcard levels/*/leveldata.c) $(wildcard levels/*/script.c) $(wildcard levels/*/geo.c)
C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c)) $(LEVEL_C_FILES)
VNL_ACTRS_C_FILES := $(wildcard actors/vanilla_actors/*/data.c) $(wildcard actors/vanilla_actors/*/geo.c)
C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c)) $(LEVEL_C_FILES) $(VNL_ACTRS_C_FILES)
CPP_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.cpp))
LIBZ_C_FILES := $(foreach dir,$(LIBZ_SRC_DIRS),$(wildcard $(dir)/*.c))
GODDARD_C_FILES := $(foreach dir,$(GODDARD_SRC_DIRS),$(wildcard $(dir)/*.c))
S_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.s))
GENERATED_C_FILES := $(BUILD_DIR)/assets/mario_anim_data.c $(BUILD_DIR)/assets/demo_data.c
# Ignore all .inc.c files
C_FILES := $(filter-out %.inc.c,$(C_FILES))
# Sound files
SOUND_BANK_FILES := $(wildcard sound/sound_banks/*.json)
SOUND_SAMPLE_DIRS := $(wildcard sound/samples/*)
@@ -417,6 +446,8 @@ else ifneq ($(call find-command,mips-linux-gnu-ld),)
CROSS := mips-linux-gnu-
else ifneq ($(call find-command,mips64-linux-gnu-ld),)
CROSS := mips64-linux-gnu-
else ifneq ($(call find-command,mips64-none-elf-ld),)
CROSS := mips64-none-elf-
else ifneq ($(call find-command,mips-ld),)
CROSS := mips-
else
@@ -477,15 +508,15 @@ DEF_INC_CFLAGS := $(foreach i,$(INCLUDE_DIRS),-I$(i)) $(C_DEFINES)
# C compiler options
CFLAGS = -G 0 $(OPT_FLAGS) $(TARGET_CFLAGS) $(MIPSISET) $(DEF_INC_CFLAGS)
ifeq ($(COMPILER),gcc)
CFLAGS += -mno-shared -march=vr4300 -mfix4300 -mabi=32 -mhard-float -mdivide-breaks -fno-stack-protector -fno-common -fno-zero-initialized-in-bss -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra
CFLAGS += -mno-shared -march=vr4300 -mfix4300 -mabi=32 -mhard-float -mdivide-breaks -fno-stack-protector -fno-common -fno-zero-initialized-in-bss -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra -Wno-trigraphs
CFLAGS += -Wno-missing-braces
else ifeq ($(COMPILER),clang)
CFLAGS += -mfpxx -target mips -mabi=32 -G 0 -mhard-float -fomit-frame-pointer -fno-stack-protector -fno-common -I include -I src/ -I $(BUILD_DIR)/include -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra
CFLAGS += -mfpxx -target mips -mabi=32 -G 0 -mhard-float -fomit-frame-pointer -fno-stack-protector -fno-common -I include -I src/ -I $(BUILD_DIR)/include -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra -Wno-trigraphs
CFLAGS += -Wno-missing-braces
else
CFLAGS += -non_shared -Wab,-r4300_mul -Xcpluscomm -Xfullwarn -signed -32
endif
ASMFLAGS = -G 0 $(OPT_FLAGS) $(TARGET_CFLAGS) -mips3 $(DEF_INC_CFLAGS) -mno-shared -march=vr4300 -mfix4300 -mabi=32 -mhard-float -mdivide-breaks -fno-stack-protector -fno-common -fno-zero-initialized-in-bss -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra
ASMFLAGS = -G 0 $(OPT_FLAGS) $(TARGET_CFLAGS) -mips3 $(DEF_INC_CFLAGS) -mno-shared -march=vr4300 -mfix4300 -mabi=32 -mhard-float -mdivide-breaks -fno-stack-protector -fno-common -fno-zero-initialized-in-bss -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra -Wno-trigraphs
ASFLAGS := -march=vr4300 -mabi=32 $(foreach i,$(INCLUDE_DIRS),-I$(i)) $(foreach d,$(DEFINES),--defsym $(d))
RSPASMFLAGS := $(foreach d,$(DEFINES),-definelabel $(subst =, ,$(d)))
@@ -506,7 +537,6 @@ N64CKSUM := $(TOOLS_DIR)/n64cksum
N64GRAPHICS := $(TOOLS_DIR)/n64graphics
N64GRAPHICS_CI := $(TOOLS_DIR)/n64graphics_ci
BINPNG := $(TOOLS_DIR)/BinPNG.py
TEXTCONV := $(TOOLS_DIR)/textconv
AIFF_EXTRACT_CODEBOOK := $(TOOLS_DIR)/aiff_extract_codebook
VADPCM_ENC := $(TOOLS_DIR)/vadpcm_enc
EXTRACT_DATA_FOR_MIO := $(TOOLS_DIR)/extract_data_for_mio
@@ -524,7 +554,13 @@ ifneq (,$(call find-command,armips))
else
RSPASM := $(TOOLS_DIR)/armips
endif
EMULATOR = mupen64plus
ifneq (,$(call find-command,wslview))
EMULATOR = "/mnt/c/Program Files (x86)/parallel-launcher/parallel-launcher.exe"
else
EMULATOR = parallel-launcher
endif
EMU_FLAGS =
ifneq (,$(call find-command,wslview))
@@ -547,7 +583,7 @@ endif
# For non-IDO, use objcopy instead of extract_data_for_mio
ifneq ($(COMPILER),ido)
EXTRACT_DATA_FOR_MIO := $(OBJCOPY) -O binary --only-section=.data
EXTRACT_DATA_FOR_MIO := $(OBJCOPY) -O binary --only-section=.data --only-section=.rodata
endif
# Common build print status function
@@ -622,29 +658,6 @@ $(BUILD_DIR)/src/libz/%.o: OPT_FLAGS := -Os
$(BUILD_DIR)/src/libz/%.o: CFLAGS += -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-pointer-sign
endif
ifeq ($(VERSION),eu)
TEXT_DIRS := text/de text/us text/fr
# EU encoded text inserted into individual segment 0x19 files,
# and course data also duplicated in leveldata.c
$(BUILD_DIR)/bin/eu/translation_en.o: $(BUILD_DIR)/text/us/define_text.inc.c
$(BUILD_DIR)/bin/eu/translation_de.o: $(BUILD_DIR)/text/de/define_text.inc.c
$(BUILD_DIR)/bin/eu/translation_fr.o: $(BUILD_DIR)/text/fr/define_text.inc.c
$(BUILD_DIR)/levels/menu/leveldata.o: $(BUILD_DIR)/include/text_strings.h
$(BUILD_DIR)/levels/menu/leveldata.o: $(BUILD_DIR)/text/us/define_courses.inc.c
$(BUILD_DIR)/levels/menu/leveldata.o: $(BUILD_DIR)/text/de/define_courses.inc.c
$(BUILD_DIR)/levels/menu/leveldata.o: $(BUILD_DIR)/text/fr/define_courses.inc.c
else
ifeq ($(VERSION),sh)
TEXT_DIRS := text/jp
$(BUILD_DIR)/bin/segment2.o: $(BUILD_DIR)/text/jp/define_text.inc.c
else
TEXT_DIRS := text/$(VERSION)
# non-EU encoded text inserted into segment 0x02
$(BUILD_DIR)/bin/segment2.o: $(BUILD_DIR)/text/$(VERSION)/define_text.inc.c
endif
endif
$(BUILD_DIR)/src/usb/usb.o: OPT_FLAGS := -O0
$(BUILD_DIR)/src/usb/usb.o: CFLAGS += -Wno-unused-variable -Wno-sign-compare -Wno-unused-function
$(BUILD_DIR)/src/usb/debug.o: OPT_FLAGS := -O0
@@ -662,17 +675,11 @@ $(BUILD_DIR)/src/game/rendering_graph_node.o: OPT_FLAGS := $(GRAPH_NODE_OPT_FLAG
# $(info MATH_UTIL_OPT_FLAGS: $(MATH_UTIL_OPT_FLAGS))
# $(info GRAPH_NODE_OPT_FLAGS: $(GRAPH_NODE_OPT_FLAGS))
ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) asm/debug $(GODDARD_SRC_DIRS) $(LIBZ_SRC_DIRS) $(ULTRA_BIN_DIRS) $(BIN_DIRS) $(TEXTURE_DIRS) $(TEXT_DIRS) $(SOUND_SAMPLE_DIRS) $(addprefix levels/,$(LEVEL_DIRS)) rsp include) $(YAY0_DIR) $(addprefix $(YAY0_DIR)/,$(VERSION)) $(SOUND_BIN_DIR) $(SOUND_BIN_DIR)/sequences/$(VERSION)
ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) asm/debug $(GODDARD_SRC_DIRS) $(LIBZ_SRC_DIRS) $(ULTRA_BIN_DIRS) $(BIN_DIRS) $(TEXTURE_DIRS) $(SOUND_SAMPLE_DIRS) $(addprefix levels/,$(LEVEL_DIRS)) $(addprefix actors/vanilla_actors/,$(VNL_ACTRS_DIRS)) rsp include) $(YAY0_DIR) $(addprefix $(YAY0_DIR)/,$(VERSION)) $(SOUND_BIN_DIR) $(SOUND_BIN_DIR)/sequences/$(VERSION)
# Make sure build directory exists before compiling anything
DUMMY != mkdir -p $(ALL_DIRS)
$(BUILD_DIR)/include/text_strings.h: $(BUILD_DIR)/include/text_menu_strings.h
$(BUILD_DIR)/src/menu/file_select.o: $(BUILD_DIR)/include/text_strings.h
$(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/game/puppycam2.o: $(BUILD_DIR)/include/text_strings.h
#==============================================================================#
@@ -717,6 +724,11 @@ $(LEVEL_ELF_FILES): $(BUILD_DIR)/levels/%/leveldata.elf: $(BUILD_DIR)/levels/%/l
$(call print,Linking ELF file:,$<,$@)
$(V)$(LD) -e 0 -Ttext=$(SEGMENT_ADDRESS) -Map $@.map --just-symbols=$(BUILD_DIR)/bin/$(TEXTURE_BIN).elf -o $@ $<
.SECONDEXPANSION:
$(VANILLA_ACTORS_ELF_FILES): $(BUILD_DIR)/actors/vanilla_actors/%/data.elf: $(BUILD_DIR)/actors/vanilla_actors/%/data.o $(BUILD_DIR)/bin/$$(TEXTURE_BIN).elf
$(call print,Linking ELF file:,$<,$@)
$(V)$(LD) -e 0 -Ttext=$(SEGMENT_ADDRESS) -Map $@.map --just-symbols=$(BUILD_DIR)/bin/$(TEXTURE_BIN).elf -o $@ $<
$(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf
$(call print,Extracting compressible data from:,$<,$@)
$(V)$(EXTRACT_DATA_FOR_MIO) $< $@
@@ -745,7 +757,7 @@ endif
$(BUILD_DIR)/%.table: %.aiff
$(call print,Extracting codebook:,$<,$@)
$(V)$(AIFF_EXTRACT_CODEBOOK) $< >$@
$(V)$(AIFF_EXTRACT_CODEBOOK) $< $@
$(BUILD_DIR)/%.aifc: $(BUILD_DIR)/%.table %.aiff
$(call print,Encoding ADPCM:,$(word 2,$^),$@)
@@ -799,20 +811,6 @@ $(BUILD_DIR)/assets/demo_data.c: assets/demo_data.json $(wildcard assets/demos/*
@$(PRINT) "$(GREEN)Generating demo data $(NO_COL)\n"
$(V)$(PYTHON) $(TOOLS_DIR)/demo_data_converter.py assets/demo_data.json $(DEF_INC_CFLAGS) > $@
# Encode in-game text strings
$(BUILD_DIR)/include/text_strings.h: include/text_strings.h.in
$(call print,Encoding:,$<,$@)
$(V)$(TEXTCONV) charmap.txt $< $@
$(BUILD_DIR)/include/text_menu_strings.h: include/text_menu_strings.h.in
$(call print,Encoding:,$<,$@)
$(V)$(TEXTCONV) charmap_menu.txt $< $@
$(BUILD_DIR)/text/%/define_courses.inc.c: text/define_courses.inc.c text/%/courses.h
@$(PRINT) "$(GREEN)Preprocessing: $(BLUE)$@ $(NO_COL)\n"
$(V)$(CPP) $(CPPFLAGS) $< -o - -I text/$*/ | $(TEXTCONV) charmap.txt - $@
$(BUILD_DIR)/text/%/define_text.inc.c: text/define_text.inc.c text/%/courses.h text/%/dialogs.h
@$(PRINT) "$(GREEN)Preprocessing: $(BLUE)$@ $(NO_COL)\n"
$(V)$(CPP) $(CPPFLAGS) $< -o - -I text/$*/ | $(TEXTCONV) charmap.txt - $@
# Level headers
$(BUILD_DIR)/include/level_headers.h: levels/level_headers.h.in
$(call print,Preprocessing level headers:,$<,$@)
@@ -889,7 +887,7 @@ $(BUILD_DIR)/asm/debug/map.o: asm/debug/map.s $(BUILD_DIR)/sm64_prelim.elf
# Link SM64 ELF file
$(ELF): $(BUILD_DIR)/sm64_prelim.elf $(BUILD_DIR)/asm/debug/map.o $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/$(LD_SCRIPT) $(BUILD_DIR)/libz.a $(BUILD_DIR)/libgoddard.a
@$(PRINT) "$(GREEN)Linking ELF file: $(BLUE)$@ $(NO_COL)\n"
$(V)$(LD) --gc-sections -L $(BUILD_DIR) -T $(BUILD_DIR)/$(LD_SCRIPT) -T goddard.txt -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(addprefix -R ,$(SEG_FILES)) -o $@ $(O_FILES) -L$(LIBS_DIR) -l$(ULTRALIB) -Llib $(LINK_LIBRARIES) -u sprintf -u osMapTLB -Llib/gcclib/$(LIBGCCDIR) -lgcc -lrtc
$(V)$(LD) --gc-sections -L $(BUILD_DIR) -T $(BUILD_DIR)/$(LD_SCRIPT) -T goddard.txt -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(addprefix -R ,$(SEG_FILES)) -o $@ $(O_FILES) -L$(LIBS_DIR) -l$(ULTRALIB) -Llib $(LINK_LIBRARIES) -u sprintf -u osMapTLB -Llib/gcclib/$(LIBGCCDIR) -lgcc
# Build ROM
ifeq (n,$(findstring n,$(firstword -$(MAKEFLAGS))))

View File

@@ -41,15 +41,21 @@ LEVEL_FILES := $(addsuffix leveldata,$(LEVEL_DIRS))
LEVEL_ELF_FILES := $(foreach level_dir,$(LEVEL_DIRS),$(BUILD_DIR)/levels/$(level_dir)leveldata.elf)
VANILLA_ACTORS_FILES := $(addsuffix data,$(VNL_ACTRS_DIRS))
VANILLA_ACTORS_ELF_FILES := $(foreach level_dir,$(VNL_ACTRS_DIRS),$(BUILD_DIR)/actors/vanilla_actors/$(level_dir)data.elf)
SEG_FILES := \
$(SEGMENTS:%=$(BUILD_DIR)/bin/%.elf) \
$(ACTOR_GROUPS:%=$(BUILD_DIR)/actors/%.elf) \
$(LEVEL_FILES:%=$(BUILD_DIR)/levels/%.elf)
$(LEVEL_FILES:%=$(BUILD_DIR)/levels/%.elf) \
$(VANILLA_ACTORS_FILES:%=$(BUILD_DIR)/actors/vanilla_actors/%.elf)
YAY0_FILES := \
$(SEGMENTS:%=$(BUILD_DIR)/bin/%.szp) \
$(ACTOR_GROUPS:%=$(BUILD_DIR)/actors/%.szp) \
$(LEVEL_FILES:%=$(BUILD_DIR)/levels/%.szp)
$(LEVEL_FILES:%=$(BUILD_DIR)/levels/%.szp) \
$(VANILLA_ACTORS_FILES:%=$(BUILD_DIR)/actors/vanilla_actors/%.szp)
YAY0_OBJ_FILES := $(YAY0_FILES:.szp=.szp.o)
@@ -243,9 +249,11 @@ $(BUILD_DIR)/bin/machine.elf: SEGMENT_ADDRESS := 0x09000000
$(BUILD_DIR)/bin/mountain.elf: SEGMENT_ADDRESS := 0x09000000
$(BUILD_DIR)/bin/grass.elf: SEGMENT_ADDRESS := 0x09000000
# EU segment 19 translations
$(BUILD_DIR)/bin/eu/translation_de.elf: SEGMENT_ADDRESS := 0x19000000
$(BUILD_DIR)/bin/eu/translation_en.elf: SEGMENT_ADDRESS := 0x19000000
$(BUILD_DIR)/bin/eu/translation_fr.elf: SEGMENT_ADDRESS := 0x19000000
$(BUILD_DIR)/bin/translation_de.elf: SEGMENT_ADDRESS := 0x1B000000
$(BUILD_DIR)/bin/translation_en.elf: SEGMENT_ADDRESS := 0x1B000000
$(BUILD_DIR)/bin/translation_fr.elf: SEGMENT_ADDRESS := 0x1B000000
$(BUILD_DIR)/bin/translation_jp.elf: SEGMENT_ADDRESS := 0x1B000000
$(BUILD_DIR)/bin/translation_es.elf: SEGMENT_ADDRESS := 0x1B000000
# --------------------------------------
# Skybox Rules
@@ -270,3 +278,36 @@ IPL3_RAW_FILES := $(addprefix $(BUILD_DIR)/,$(patsubst %.png,%,$(IP
CRASH_TEXTURE_FILES := $(wildcard $(TEXTURE_DIR)/crash_custom/*.png)
CRASH_TEXTURE_C_FILES := $(addprefix $(BUILD_DIR)/,$(patsubst %.png,%.inc.c,$(CRASH_TEXTURE_FILES)))
# --------------------------------------
# Vanilla Objects Rules
# --------------------------------------
define vanilla_objects_rules =
VANILLA_ACTORS_$(1)_TEXTURE_FILES := $$(patsubst %.png,%.inc.c,$$(wildcard actors/vanilla_actors/$(1)/*.png))
$$(BUILD_DIR)/actors/vanilla_actors/$(1)/data.o: $$(addprefix $$(BUILD_DIR)/,$$(VANILLA_ACTORS_$(1)_TEXTURE_FILES))
$$(BUILD_DIR)/actors/vanilla_actors/$(1)/data.elf: SEGMENT_ADDRESS := 0x0e000000
$$(BUILD_DIR)/actors/vanilla_actors/$(1)/data.elf: TEXTURE_BIN := $(2)
endef
$(eval $(call vanilla_objects_rules,bob,generic))
$(eval $(call vanilla_objects_rules,wf,grass))
$(eval $(call vanilla_objects_rules,jrb,water))
$(eval $(call vanilla_objects_rules,ccm,snow))
$(eval $(call vanilla_objects_rules,bbh,spooky))
$(eval $(call vanilla_objects_rules,hmc,cave))
$(eval $(call vanilla_objects_rules,lll,fire))
$(eval $(call vanilla_objects_rules,ssl,generic))
$(eval $(call vanilla_objects_rules,ddd,water))
$(eval $(call vanilla_objects_rules,sl,snow))
$(eval $(call vanilla_objects_rules,wdw,grass))
$(eval $(call vanilla_objects_rules,ttm,mountain))
$(eval $(call vanilla_objects_rules,thi,grass))
$(eval $(call vanilla_objects_rules,ttc,machine))
$(eval $(call vanilla_objects_rules,rr,sky))
$(eval $(call vanilla_objects_rules,bitdw,sky))
$(eval $(call vanilla_objects_rules,bitfs,sky))
$(eval $(call vanilla_objects_rules,bits,sky))
$(eval $(call vanilla_objects_rules,vcutm,outside))
$(eval $(call vanilla_objects_rules,castle_inside,inside))
$(eval $(call vanilla_objects_rules,castle_grounds,outside))

View File

@@ -17,9 +17,9 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin
- **MrComit**: General use object defines, JUMP_KICK_FIX
- **aglab2**: Bugfixes (particularly puppycam), refactor stuff
- **someone2639**: math.s and crash screen disam, stack trace, map packing, shiftable segments 2, S2DEX engine
- **Arthurtilly**: Platform Displacement 2
- **Arthurtilly**: ASCII / UTF-8 support, Multilang, Platform Displacement 2
- **Fazana**: PuppyLib, ucode swapping, audio load time optimisations (with Arctic), general hacker qol improvements, visual debug
- **Reonu**: Starting the project/repo, widescreen, reonucam, various defines for hacker QoL
- **Reonu**: Starting the project + widescreen, reonucam, various defines for hacker QoL, and a custom Spanish (Spain) translation of the game.
- **JoshDuMan**: Decomp guy, general assistance
- **Arceveti**: Silhouette, shadow optimisation, better hanging, breath meter, 4 controller support
- **axollyon**: Console testing, bugfixes, idea-guying, and had a hand in silhouettes
@@ -36,7 +36,6 @@ Thanks to Frame#5375 and AloXado320 for also helping with silhouette stuff
**Lighting Engine by Wiseguy**
- Lighting Engine is available on a separate branch ([base/lighting-engine](https://github.com/Reonu/HackerSM64/tree/base/lighting-engine)). Instructions on how to use it are in the readme of that branch.
- Alternatively, the main repo has `Puppylights` available, which is a more lightweight, but limited lighting library intended to be used to modify existing light properties. You can look at `puppylights.c` to find out how to use it.
**Puppycam**
- Puppycam is available on the master branch now, you can toggle it in `config/config_camera.h`. *
@@ -88,9 +87,9 @@ Thanks to Frame#5375 and AloXado320 for also helping with silhouette stuff
- You can set a test level in `config/config_debug.h` in order to boot straight into it, so you can quickly test the level you're working on. *
- Allow all surfaces in the game to have a `force` parameter. Activating this doesn't REQUIRE you to set `force` for every surface: If you don't set, it will default to 0x0000 rather than crashing. Increases RAM usage of collision. *
- The clown font includes the entire English alphabet.
- Colored ia4 text support. Format: `"@XXXXXXXX[YOUR TEXT]@--------"` (By ArcticJaguar725)
- Example Text: `"@FF0000FFRED @00FF00FFGREEN @0000FFFFBLUE @FFFFFF00INVISIBLE @--------NORMAL"`
- NOTE: It is not mandatory to reset the text color with `"@--------"`, but text will need to be recolored each time it scrolls in a dialog box, or the custom color will reset.
- Colored ia4 text support. Format: `"@XXXXXX[YOUR TEXT]@--------"` (By Arthurtilly)
- Example Text: `"@FF0000RED @00FF00GREEN @0000FFBLUE @FFFFFFWHITE"`
- NOTE: Text will need to be recolored each time it scrolls in a dialog box, or the custom color will reset. The text will use gDialogTextAlpha as the alpha value when changing the color.
- Toggle visiblity of collision surfaces and object hitboxes with Visual Surface Debug. `config/config_debug.h` has VISUAL_DEBUG which can be turned on to enable this feature.
- Workaround for infinite death loops caused by using the wrong warp type for death warps. Mario's HP will be restored when being warped to any warp if (and only if) he was warped while dead. *

View File

@@ -1 +1 @@
v2.1.1
v2.3.0

View File

@@ -105,4 +105,7 @@ extern const struct Animation *const unagi_seg5_anims_05012824[];
extern const Gfx whirlpool_seg5_dl_05013B58[];
extern const Gfx whirlpool_seg5_dl_05013CB8[];
extern const Trajectory jrb_seg7_trajectory_unagi_1[];
extern const Trajectory jrb_seg7_trajectory_unagi_2[];
#endif

View File

@@ -11,3 +11,30 @@
#include "manta/geo.inc.c"
#include "sushi/geo.inc.c"
#include "unagi/geo.inc.c"
#include "surface_terrains.h"
// 0x0700D20C - 0x0700D23E
const Trajectory jrb_seg7_trajectory_unagi_1[] = {
TRAJECTORY_POS(0, /*pos*/ 5300, -3800, 1200),
TRAJECTORY_POS(1, /*pos*/ 3700, -3600, 1700),
TRAJECTORY_POS(2, /*pos*/ 3400, -3400, 3500),
TRAJECTORY_POS(3, /*pos*/ 3900, -3600, 4400),
TRAJECTORY_POS(4, /*pos*/ 5300, -3800, 4400),
TRAJECTORY_POS(5, /*pos*/ 6200, -4000, 2700),
TRAJECTORY_END(),
};
// 0x0700D240 - 0x0700D28A
const Trajectory jrb_seg7_trajectory_unagi_2[] = {
TRAJECTORY_POS(0, /*pos*/ 5381, 0, 2758),
TRAJECTORY_POS(1, /*pos*/ 5803, -3130, 3036),
TRAJECTORY_POS(2, /*pos*/ 4876, -3045, 2706),
TRAJECTORY_POS(3, /*pos*/ 4313, -3246, 2736),
TRAJECTORY_POS(4, /*pos*/ 3792, -3413, 3668),
TRAJECTORY_POS(5, /*pos*/ 4971, -3130, 3688),
TRAJECTORY_POS(6, /*pos*/ 5392, -3130, 3326),
TRAJECTORY_POS(7, /*pos*/ 6341, -3130, 2450),
TRAJECTORY_POS(8, /*pos*/ 9431, -3130, 1400),
TRAJECTORY_END(),
};

View File

@@ -0,0 +1,27 @@
#include <ultra64.h>
#include "sm64.h"
#include "surface_terrains.h"
#include "moving_texture_macros.h"
#include "surface_terrains.h"
#include "textures.h"
#include "dialog_ids.h"
#include "make_const_nonconst.h"
#include "actors/vanilla_actors/bbh/texture.inc.c"
#include "actors/vanilla_actors/bbh/staircase_step/model.inc.c"
#include "actors/vanilla_actors/bbh/tilting_trap_platform/model.inc.c"
#include "actors/vanilla_actors/bbh/tumbling_platform_far/model.inc.c"
#include "actors/vanilla_actors/bbh/tumbling_platform_near/model.inc.c"
#include "actors/vanilla_actors/bbh/moving_bookshelf/model.inc.c"
#include "actors/vanilla_actors/bbh/mesh_elevator/model.inc.c"
#include "actors/vanilla_actors/bbh/merry_go_round/model.inc.c"
#include "actors/vanilla_actors/bbh/coffin/model.inc.c"
#include "actors/vanilla_actors/bbh/staircase_step/collision.inc.c"
#include "actors/vanilla_actors/bbh/tilting_trap_platform/collision.inc.c"
#include "actors/vanilla_actors/bbh/tumbling_platform_near/collision.inc.c"
#include "actors/vanilla_actors/bbh/moving_bookshelf/collision.inc.c"
#include "actors/vanilla_actors/bbh/mesh_elevator/collision.inc.c"
#include "actors/vanilla_actors/bbh/merry_go_round/collision.inc.c"
#include "actors/vanilla_actors/bbh/coffin/collision.inc.c"

View File

@@ -0,0 +1,37 @@
#include <ultra64.h>
#include "sm64.h"
#include "geo_commands.h"
#include "game/level_geo.h"
#include "game/geo_misc.h"
#include "game/camera.h"
#include "game/moving_texture.h"
#include "game/screen_transition.h"
#include "game/paintings.h"
#include "make_const_nonconst.h"
#include "actors/vanilla_actors/bbh/header.h"
#include "actors/vanilla_actors/bbh/staircase_step/geo.inc.c"
#include "actors/vanilla_actors/bbh/tilting_trap_platform/geo.inc.c"
#include "actors/vanilla_actors/bbh/tumbling_platform_far/geo.inc.c"
#include "actors/vanilla_actors/bbh/tumbling_platform_near/geo.inc.c"
#include "actors/vanilla_actors/bbh/moving_bookshelf/geo.inc.c"
#include "actors/vanilla_actors/bbh/mesh_elevator/geo.inc.c"
#include "actors/vanilla_actors/bbh/merry_go_round/geo.inc.c"
#include "actors/vanilla_actors/bbh/coffin/geo.inc.c"
#include "level_commands.h"
const LevelScript script_func_vo_bbh[] = {
LOAD_MODEL_FROM_GEO(MODEL_BBH_STAIRCASE_STEP, geo_bbh_0005B0),
LOAD_MODEL_FROM_GEO(MODEL_BBH_TILTING_FLOOR_PLATFORM, geo_bbh_0005C8),
LOAD_MODEL_FROM_GEO(MODEL_BBH_TUMBLING_PLATFORM, geo_bbh_0005E0),
LOAD_MODEL_FROM_GEO(MODEL_BBH_TUMBLING_PLATFORM_PART, geo_bbh_0005F8),
LOAD_MODEL_FROM_GEO(MODEL_BBH_MOVING_BOOKSHELF, geo_bbh_000610),
LOAD_MODEL_FROM_GEO(MODEL_BBH_MESH_ELEVATOR, geo_bbh_000628),
LOAD_MODEL_FROM_GEO(MODEL_BBH_MERRY_GO_ROUND, geo_bbh_000640),
LOAD_MODEL_FROM_GEO(MODEL_BBH_WOODEN_TOMB, geo_bbh_000658),
RETURN(),
};

View File

@@ -0,0 +1,29 @@
#pragma once
#include "types.h"
extern const GeoLayout geo_bbh_0005B0[];
extern const GeoLayout geo_bbh_0005C8[];
extern const GeoLayout geo_bbh_0005E0[];
extern const GeoLayout geo_bbh_0005F8[];
extern const GeoLayout geo_bbh_000610[];
extern const GeoLayout geo_bbh_000628[];
extern const GeoLayout geo_bbh_000640[];
extern const GeoLayout geo_bbh_000658[];
extern const Gfx bbh_seg7_dl_0701F2E8[];
extern const Gfx bbh_seg7_dl_0701F5F8[];
extern const Gfx bbh_seg7_dl_0701F7E8[];
extern const Gfx bbh_seg7_dl_0701FAB0[];
extern const Gfx bbh_seg7_dl_0701FD28[];
extern const Gfx bbh_seg7_dl_0701FFE8[];
extern const Gfx bbh_seg7_dl_070202F0[];
extern const Gfx bbh_seg7_dl_070206F0[];
extern const Collision bbh_seg7_collision_staircase_step[];
extern const Collision bbh_seg7_collision_tilt_floor_platform[];
extern const Collision bbh_seg7_collision_07026B1C[];
extern const Collision bbh_seg7_collision_haunted_bookshelf[];
extern const Collision bbh_seg7_collision_mesh_elevator[];
extern const Collision bbh_seg7_collision_merry_go_round[];
extern const Collision bbh_seg7_collision_coffin[];

Some files were not shown because too many files have changed in this diff Show More