Compare commits

..

90 Commits

Author SHA1 Message Date
thecozies
8614e40add WIP sound test debug menu 2023-06-28 08:23:23 -05:00
Gregory Heskett
d1b4afd1d2 Add Puppyprint debug page for trying out different BETTER_REVERB presets and configurations
Also fix a missing Puppyprint enum that was causing issues
2023-06-27 02:59:22 -09:00
Gregory Heskett
4887bf0503 Add SET_ECHO level script command + minor BETTER_REVERB refactoring 2023-06-26 20:24:53 -09:00
someone2639
e2cf2d5119 IPL3 documentation; undefined_syms.txt finally deleted (#545)
* yeet undefined_syms; IPL3 documentation; theoretical addition of checksum skip and initial DMA length/location change

* another comment about how to set dma len

* comment is now correct in ultratypes

* do the rename

* remove insinuations that ipl3 can be modified

---------

Co-authored-by: someone2639 <someone2639@gmail.com>
2023-06-26 12:35:52 -05:00
someone2639
1eba347c07 replace abs with c macro; replace round with asm extern function (#647)
Co-authored-by: someone2639 <someone2639@gmail.com>
2023-06-25 23:57:21 -04:00
someone2639
13b8339560 pack including static symbols using 'nm' (#646)
Co-authored-by: someone2639 <someone2639@gmail.com>
2023-06-25 23:56:43 -04:00
someone2639
823101164d import new flips + flags (#645)
Co-authored-by: someone2639 <someone2639@gmail.com>
2023-06-25 23:12:04 -04:00
Lilaa3
16e55ad952 Culling improvements + GRAPH_RENDER_INVISIBLE check change (#590)
* Culling improvements + earlier GRAPH_RENDER_INVISIBLE check

GRAPH_RENDER_INVISIBLE is now checked during geo_process_object before any uncessesary transformation is applied to
the object, translation is still calculated for sound even if the object is invisible.
Half fov is now computed during geo_process_perspective.
Vertical culling has been added (only when bellow the screen to prevent shadow´s being culled).
Emulators have basically infinite culling aspect ratio to prevent early culling with widescreen viewport hacks.
Default culling radius is now a define.
This was written by both me and Kaze Emanuar, he provided the suggestion to use absf and informed me of
integer division being remarkably slow (although it´s only used once during geo_process_perspective).

* Badly placed new line (major fix)

* integer

Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>

* parenthesis

doesn´t affect order of operation, just for code quality

Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>

* uncessary whitespace

Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>

---------

Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>
2023-06-23 10:06:24 -05:00
Gregory Heskett
73fad6195d Bugfix: fix profiler freeze (hopefully) (#640) 2023-06-20 20:24:20 -05:00
someone2639
8240262c07 Update S2DEX Text Engine to latest version; fix build issues (#532)
Now its just part of HackerSM64 entirely, and HackerSM64 will be the source of all changes (as long as said changes can reasonably apply to homebrew games)
2023-06-17 16:51:03 -04:00
Reonu
fffebd1065 add death on exit course define (#564)
if the define is enabled, exiting course is the same as dying (warps to failure warp node)
2023-06-16 20:57:33 -04:00
Gregory Heskett
7f08d3d963 Revert floor sorting optimizations (#639)
They cause some weird collision bugs, and are thus not worth keeping until properly investigated.
2023-06-13 12:57:33 -04:00
Fazana
5764ae0ece Puppy Camera for 2.1 (#554) 2023-06-09 11:13:57 -04:00
CowQuack
4c9a91c2be Improved the extended inst names and added missing (#634)
* Improved the extended inst names and added missing

* Added percussion loop and renamed cowbell
2023-06-07 15:56:56 -04:00
Gregory Heskett
8f6fde697f Disable Stereo Headset Effects and stub out all known code references via define (#633)
* Disable stereoheadseteffects and stub out all known code references via define

By effect this also completely removes Headset sound options from the game config, as it serves no purpose whatsoever compared to stereo.
Because it's stubbed out everywhere rather than only the necessary locations to prevent it, this should boost audio runtime slightly for everything, not just the stuff that actively used it.

* Rename DISABLE_HEADSET_STEREO_EFFECTS to ENABLE_HEADSET_STEREO_EFFECTS

* Reorganize and reduce audio Note struct

* Add performance to define description

* Rename ENABLE_HEADSET_STEREO_EFFECTS to ENABLE_STEREO_HEADSET_EFFECTS
2023-06-07 13:58:59 -04:00
CowQuack
0c7f44a51a Merge pull request #629 from HackerN64/develop/2.1.0-red-coin-count-increase
Develop/2.1.0 red coin count increase
2023-06-07 12:42:09 -04:00
CowQuack
91af40e72a Update src/game/behaviors/red_coin.inc.c
Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>
2023-06-07 12:26:27 -04:00
CowQuack
7cdb0764a5 le comment
Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>
2023-06-07 12:24:20 -04:00
Fazana
57f7338e6a Change puppyprint log function calls to defines (#632) 2023-06-07 07:58:22 -04:00
Gregory Heskett
42cf450ba8 Increase size/configurability of volume ramping tables (#623)
Vanilla's ramping table sounds absolutely horrendous, most noticeably when it comes to slow volume fade-ins/outs. By default, precision has been increased by 4x vanilla US, which overall has an insignificant impact on performance. This is still half as precise as EU's volume ramping table, that's about the point where additional memory and performance aspects are impacted more significantly.
2023-06-07 06:46:25 -04:00
Gregory Heskett
50b023ef21 Allow envelopes with delay values of 0 on init (#625)
This allows sounds to start instantly without any fade-in. Using new soundbanks with delay values of 0 will not compile with base decomp, but old decomp-compliant soundbanks will work with this commit.
2023-06-07 06:46:12 -04:00
mineqwerty
3fc7b50488 Readme red coin star clarity 2023-06-05 19:33:04 -04:00
mineqwerty
d1c56b60a3 fixed spawning bug with level red coin stars 2023-06-05 18:28:13 -04:00
CowQuack
dde6e7da1a condition that forces level reload on exit course (#630)
* condition that forces level reload on exit course

* Changed exit course to use a specific warp flag
2023-06-05 17:26:28 -05:00
Gregory Heskett
81c0a8ae61 Improve BETTER_REVERB runtime by about 15-20% overall (#619)
Refactored everything to be more memory efficient and execute fewer function calls than prior

Also accidentally discovered a significant bug with the audio modes always being forced to stereo so this is definitely 2.1 scope lmao
2023-06-05 17:09:03 -05:00
Arceveti
580fd45079 Use FillRectangle for shade_screen (#611) 2023-06-05 17:06:37 -05:00
thecozies
351f6f8961 added make_patch and flips (#628) 2023-06-05 17:02:58 -05:00
thecozies
aabad79e46 removed denorm col tri in wdw (#631) 2023-06-05 17:54:03 -04:00
mineqwerty
ea818c2ec0 added support for multi area red coin stars in bp2 2023-06-05 16:37:39 -04:00
mineqwerty
daf53f85aa fixed nitpicks and dialog trigger number 2023-06-05 10:59:44 -04:00
mineqwerty
c4441e8ee6 forgot to cap red coins in the menu 2023-06-04 22:34:16 -04:00
mineqwerty
af53a42b0b pause screen red coins 2023-06-04 22:29:37 -04:00
mineqwerty
0d14f6bb58 revert testing changes 2023-06-04 21:21:45 -04:00
mineqwerty
f80acbbefc testing changes 2023-06-04 21:20:39 -04:00
mineqwerty
62772067d5 added support for up to 99 red coins in an area 2023-06-04 21:19:51 -04:00
Gregory Heskett
e9054a6b6b Bugfix: Enabling silhouettes with OBJECTS_REJ disabled does not compile (#627) 2023-05-12 02:47:25 -04:00
thecozies
34b97c9249 v2.0.9 2023-05-11 09:13:42 -04:00
thecozies
23e01e712b copied new unf usb lib 2023-05-11 09:13:42 -04:00
thecozies
a34c2f4cb0 Aligned gfx buffers to 32 2023-05-11 09:13:42 -04:00
Gregory Heskett
f795173176 Start samples at full velocity when using envelopes that start with a delay of 1 (#576)
* Start samples at full velocity when using envelopes that start with a delay of 1

This can help eliminate sample artifacting that happens during a transition between a sudden fade-in into normal volume. It's not completely eliminated due to some processing weirdness, but it's a massive improvement.

* Fix vanilla issue causing misalignment when samples are initialized and played back with low attack values

NOW the artifacting is actually gone for real

* Improve artifacting bugfix

The first solution would've honestly been satisfactory, but this one seems to be slightly more accurate while actually removing code rather than adding it
2023-05-05 18:10:26 -04:00
Gregory Heskett
93b5832d8c Bugfix: Klepto holding transparent star doesn't spawn star (#622) 2023-04-20 20:40:25 -05:00
Gregory Heskett
6317475853 Bugfix (Kind of): Fix incorrect comments for the sound IDs defined in sounds.h (#609)
Not ultra important for decomp but otherwise makes binary hacking a massive pain when referencing sounds here
2023-04-19 17:03:49 -04:00
Gregory Heskett
7348ba8976 Clear all references to every object's oFloor each frame when using with dynamic collision (#616) 2023-04-19 17:00:26 -04:00
Arceveti
18d8c51e3d Prevent transition looping fix (#608) 2023-03-21 12:25:19 -04:00
Arceveti
51fb2d9e93 Make only shells from boxes despawn + cleanup exclamation_box.inc.c (#604)
Fixes #583 and cleans up exclamation_box.inc.c so that it doesn't loop through the entire contents list
2023-03-17 12:07:04 -04:00
Arceveti
171f377412 Fix rooms and doors (#601)
* Fix rooms and doors

* Update object_helpers.c

* Update object_list_processor.h

* Update object_list_processor.c

* Fix formatting

* Revert a formatting

* Clean up geo_switch_area

* Clean up geo_switch_area (more)

* Move TransitionRoomData struct

* Revert star door collision check optimization

* Move load_object_collision_model and bhv_door_rendering_loop back out of star_door.inc.c

* Combine metal door model IDs

* Revert metal door sound fixes
2023-03-17 12:05:57 -04:00
Arceveti
f7bdca7533 Fix end cake screen crash & flickering (#606) 2023-03-17 12:03:58 -04:00
Gregory Heskett
851ba192f6 Add lightweight configuration settings to BETTER_REVERB (#602)
* Add light configuration settings to BETTER_REVERB

This can reduce runtime demand down to ~75% of the standard demand, at the cost of the configurability of generally more advanced parameters

* Reformat the BETTER_REVERB preset entries to be easier to look at

* :peterVOID:

* haha lol formatting change definitely related to reverb yes this isn't unwarranted at all lmao hehe hoho
2023-03-15 10:52:05 -04:00
thecozies
c09103d456 Invert skip room proc obj (#605)
* Invert functionality of obj room proc to be opt-in

* Fixed comment for enabling profiler
2023-03-15 10:49:07 -04:00
Fazana
17498e081d 2.1.0 Puppyprint Changes (#362)
* Puppyprint text size

* Update puppyprint.c

* Revert broken render_multi_image changes

* revert multi image tweak

parallel momento

* Update puppyprint debug colors to work with new hexadecimal system

* Puppyprint color reversion to currEnv + some bugfixes

* Remove a pointless color array

* Add forgotten comment

* i can type yes definitely

* Fix some puppyprint formatting edge cases

* Missed one last puppyprint edge case

* Additional strLen check

* Variable length fix + command ignoring strlen

* type changes

* Update puppyprint.c

* Box clamping

* Revamped profiling, fixed right alignment

* Update puppycam2.c

* Deferred printing

* Update puppyprint.c

* Fixed negatives being stupid

* Puppyprint Memory view rework

* Update level_script.c

* tweaks

* Fix new line spacing with different scales

also small bit of optimisation

* Spacing fixes

* Lightweight text option

* puppyprint debug now using light text where applicable

* Update puppyprint.c

* Update puppyprint.c

* level select menu

* merge profilers into one WIP

* Fully ascii compliant

* Finishing touches hopefully

* Update puppyprint.c

* new font

* vanilla font

* o

* Update hud.c

* last kerning fixes

* Requested changes

* requested changes

* fix the j

* requested changes

* change ur clothes

* Update surface_collision.c

* requested changes

* Update puppyprint.h

* Update camera.c

* .

* Update puppyprint.c

* Update puppyprint.c

* Update puppyprint.c

* fix J

* font

* font system rework

* ia4 outline font

* pain

* fix deferred printing

* fix format change

* Add audio profiling to Puppyprint Debug

* Optimize audio profiling substantially

* Minor audio optimizations

* requested changes

* oops accidentally commited 6 lmfao

* Update game_init.c

* Update puppyprint.c

* Update puppyprint.c

* Improve Puppyprint deferred prints

This is safer, more readable, and more runtime efficient all in the same package

* change return type

* fix building with profiler only

* Update profiling.c

* fix upscaled texture rectangles from multi image

---------

Co-authored-by: gheskett <gheskett@gmail.com>
2023-03-12 12:29:08 -04:00
Fazana
f85b0c6946 I think github are gonna give me badges for all these PR's (#597)
* Update game_init.c

* fuck you nintendo fuck you nintendo fuck you nintendo fuck you nintendo fuck you nintendo fuck you nintendo

* Update segment2.c

* Update model.inc.c
2023-03-10 10:20:55 -05:00
Fazana
a3eaccedd4 Frustratio funny fix part 3 (#596)
* Update game_init.c

* fuck you nintendo fuck you nintendo fuck you nintendo fuck you nintendo fuck you nintendo fuck you nintendo

* Update segment2.c
2023-03-10 10:04:01 -05:00
Fazana
ef38abb1c0 Frustratio funny fix 2 (#593)
* Update game_init.c

* fuck you nintendo fuck you nintendo fuck you nintendo fuck you nintendo fuck you nintendo fuck you nintendo
2023-03-09 22:39:26 -05:00
Fazana
c76c5824e3 Update game_init.c (#592) 2023-03-08 14:34:43 +00:00
Gregory Heskett
81e1cb38da Bugfix: Fix reference to missing function (#589) 2023-03-07 00:32:19 -05:00
someone2639
8d8812ab1b Fix builds on Make 4.4 (#588)
* Fix builds on Make 4.4

* oops

---------

Co-authored-by: someone2639 <someone2639@gmail.com>
2023-03-06 23:19:15 -05:00
Gregory Heskett
4c67e48456 Add define for wiping save data if existing save data from vanilla or another hack exists (#579) 2023-03-06 20:53:08 -05:00
axollyon
be753ae220 Small improvements to object loading within rooms (#580)
* Small improvements to object loading within rooms
* Only check if Mario is in the same room as the object once
* Implement object render distance within rooms (from thecozies)

* Remove sLevelsWithRooms (also from thecozies)
Honestly surprised this wasn't already in Hacker

* Remove comment for sLevelsWithRooms in config_game

* Make compatible with the painting objects PR
Move room detection to get_room_at_pos (from Arceveti)

* address enum comment
2023-03-06 20:49:39 -05:00
Arceveti
337dac828f Update macros.h + allow ALIGN macros to be used anywhere (#574)
* Update macros.h + allow ALIGN macros to be used anywhere

* Fix wrong alignment in synthesis_sh.c

* Revert bitmask in VIRTUAL_TO_PHYSICAL macro
2023-01-31 15:50:19 -05:00
Gregory Heskett
1fadb78632 Prevent UB that can happen when using more than 64 total soundbanks (#575) 2023-01-29 14:29:39 -05:00
Gregory Heskett
52a7aedaf4 Replace debug libultra builds with their ido counterparts (#572)
* Replace debug libultra builds with their ido counterparts

This is necessary because GameCube controllers apparently rely on the IDO build, also the release build is IDO anyway

* Remove fallthrough warnings from usb/debug.c

* remove need for debug libultra with unf and use lib define in ld

Co-authored-by: thecozies <collinpferguson@gmail.com>
2023-01-26 09:03:07 -06:00
Gregory Heskett
7fdb5af8fd Add support for preset options to be used with BETTER_REVERB (#508)
* Bugfix: BETTER_REVERB starts before buffers are ready

* Add support for preset options to be used with BETTER_REVERB

* Some BETTER_REVERB cleanup

* The funny whoops

* Address suggested level script change

* Bugfix: useReverb crashes when disabled

* Allow window size override for vanilla-esque BETTER_REVERB presets

* Remove unnecessary downsampling limit check

* Fix up a few things + some slight reformatting

* Add light documentation to the BETTER_REVERB parameters

* Adjust BETTER_REVERB preset types to make more sense

* Reset BETTER_REVERB data buffer to be unallocated when not in use

* Properly disable BETTER_REVERB when disabling all reverb processing

* Remove an unnecessary BETTER_REVERB ifdef

* Remove D_80332108

* Revise BETTER_REVERB config description
2023-01-24 09:22:49 -05:00
Gregory Heskett
d702f188c6 Bugfix: Stack sizes moved to main.h (#573)
Crash screen does not enjoy importing buffers/buffers.h
2023-01-24 09:19:53 -05:00
Fazana
35dffd9b4e Random epic tweaks (#568)
* various tweaks to tackle redundancy

* Update collision.inc.c

* inline the function

* fix surface denorms

* oops forgot to remove a comment that I just proved false lol

* stack asserts

* Update main.c

* Update main.c

* fix bug plural s

* Update main.c

* comment
2023-01-24 02:13:49 +00:00
Gregory Heskett
dc71aef024 Vibrato optimizations (#530)
Optimize vibrato to even exceed vanilla's implementation, all without restricting usability from the current implementation. This should save up to about 1ms of audio runtime.
2023-01-20 17:45:53 -05:00
Gregory Heskett
65d29dc337 Increase max number of concurrent layers and channels (#527)
At worst, this eats up a few KB of memory. Runtime difference should be negligible when the extra data is not being used.
2023-01-20 10:31:30 -05:00
Reonu
683ac0b2bf Added (emu-only) RCVI hack. (#425)
* Added emu-only RCVI hack

* newline moment

* Changed the value to *20

hi arthur

* RCVI hack compiler warning

* Revise BETTER_REVERB comments to better reflect RCVI hack's existence

* Fix potentially confusing comment

* More BETTER_REVERB typos :peterVOID:

* Address requested PR changes for RCVI Hack

Co-authored-by: gheskett <gheskett@gmail.com>
2023-01-20 09:36:19 -05:00
arthurtilly
818da65ae6 Fix huge stack allocation in surface loading functions (#569) 2023-01-20 01:06:06 -05:00
Arceveti
7551748a35 Remove GRAPH_NODE_TYPE_FUNCTIONAL define & restore functionality using an alternative method. (#557)
Fixes Mirror Mario and similar things.
2023-01-20 00:59:18 -05:00
someone2639
9bec16d2f0 rendering_graph_node layer table updated with gcc extensions for legibility (#467)
* rendering_graph_node layer table updated with gcc extensions for legibility

* side effect removed

Co-authored-by: someone2639 <someone2639@gmail.com>
2022-12-13 15:55:31 -05:00
Arceveti
8043823cce Merge master/2.0.8 into 2.1.0 (#551)
* Imminent fixes for bugs found on master branch (#512)

* The vanilla level checks define for Yoshi is inverted, causing him to require 120 stars when it is off and appear at 0 stars when it's on

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

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

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

*  Removed the ledge grab changes that fix QSLGs and change the false ledgegrab define since Arceveti wanted to in his PR

* Update version to 2.0.4 (#515)

* HackerSM64 2.0.5 (#517)

* Bugfix: race condition with accessing cleared audio memory pools

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

* Vscode fixes (#516)

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

* Fix some surface shadowing (#531)

* Delete rtc.h

* Remove `wait_for_audio_frames()`

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

* Update VERSION.txt (#534)

* HackerSM64 2.0.6 (#539)

* revert random_u16 to be a u16 (#538)

* Added safety gcc math flags (#537)

* removed useless compilation flags that could cause performance loss

Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>
Co-authored-by: thecozies <collinpferguson@gmail.com>

* Update VERSION.txt

HackerSM64 2.0.6

* Add GCC opt flag to suppress warnings

* v2.0.7

* 2.0.8 (fix more compiler warnings) (#543)

* fix Waddress in mario_step.c

* fix Winfinite-recursion in unused dynlist_proc function

* in fact remove the offending function entirely

* fix warnings in RNC decompress functions

* update version

* fix version in VERSION.txt

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

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

Co-authored-by: arthurtilly <32559225+arthurtilly@users.noreply.github.com>
Co-authored-by: axollyon <20480418+axollyon@users.noreply.github.com>
Co-authored-by: Gregory Heskett <gheskett@gmail.com>
Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>
Co-authored-by: JoshDuMan <40190173+JoshDuMan@users.noreply.github.com>
Co-authored-by: thecozies <collinpferguson@gmail.com>
Co-authored-by: Reonu <danileon95@gmail.com>
Co-authored-by: someone2639 <someone2639@users.noreply.github.com>
Co-authored-by: someone2639 <someone2639@gmail.com>
2022-12-12 14:40:55 -05:00
Arceveti
f04a3ab624 Make JRB mist and DDD objects act-specific. (#393)
* Add JRB_ACT_SPECIFIC_MIST and DDD_ACT_SPECIFIC_OBJECTS

* Disable the act-specific defines by default

* Make act-specific objects/mist non-optional

* Update JRB mist comment

* Act-specific whirlpools + fix act 6 objects

* Initialize gCurrActNum + revert formatting change

* Use -1 for ALL_ACTS

* Revert ALL_ACTS line
2022-12-10 15:25:53 -05:00
Gregory Heskett
d028d6ea7d Bugfix: Save & Quit crashes game (#548) 2022-12-08 10:41:50 -05:00
Reonu
22b3c9ba08 Fix 100 coin stars spawning inside ceilings + being able to spawn multiple 100 coin stars (#541)
* Going below 100 coins and getting 100 coins again will no longer result in multiple 100 coin stars spawning

* 100 coin stars can no longer clip into ceilings

* Renamed set_home_to_mario to spawned_star_set_target_above_mario since it's a more descriptive name of what it does
2022-12-06 18:44:16 +01:00
Arceveti
1098ea95ea Merge master/2.0.5 into 2.1.0 (#536)
* Imminent fixes for bugs found on master branch (#512)

* The vanilla level checks define for Yoshi is inverted, causing him to require 120 stars when it is off and appear at 0 stars when it's on

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

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

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

*  Removed the ledge grab changes that fix QSLGs and change the false ledgegrab define since Arceveti wanted to in his PR

* Update version to 2.0.4 (#515)

* HackerSM64 2.0.5 (#517)

* Bugfix: race condition with accessing cleared audio memory pools

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

* Vscode fixes (#516)

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

* Fix some surface shadowing (#531)

* Delete rtc.h

* Remove `wait_for_audio_frames()`

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

* Update VERSION.txt (#534)

Co-authored-by: arthurtilly <32559225+arthurtilly@users.noreply.github.com>
Co-authored-by: axollyon <20480418+axollyon@users.noreply.github.com>
Co-authored-by: Gregory Heskett <gheskett@gmail.com>
Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>
Co-authored-by: JoshDuMan <40190173+JoshDuMan@users.noreply.github.com>
2022-11-28 15:06:34 -05:00
Reonu
86841a3385 Add super slippery surface type (#422)
* Added super slippery surface·

* fix requested changes

* add comment for forcing mario to belly slide

* hi arthur

* society

* adress nitpick

Co-authored-by: aglab2 <aglab3@gmail.com>
2022-11-08 17:08:45 +01:00
Gregory Heskett
12b91fe73c Disable DISABLE_ALL (#528)
Because literally who is gonna make a hack without ever using any debug features?
2022-11-03 08:54:04 +01:00
Gregory Heskett
a42bd9bc2e Implemented native Gamecube controller support and corresponding emulator hint in ROM header (#505)
* Implemented native Gamecube controller support and corresponding emulator hint in ROM header

* Added X and Y buttons to VALID_BUTTONS in sm64.h

* Added workaround in controller type detection for mupen bug

* read GC controllers from port 2

* L to Z logic for GC controller uses a threshold

* Changed threshold for L trig to around 33%

Changed threshold based on feedback

* Added gGamecubeControllerPort

* fixed wrong check

* Bugfix: Game crashes when less than 2 controllers are connected

* Suppress compiler warnings

* Bugfix: button swapping still takes place on non-GC controllers

* Wrap port 2 stuff in console check

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

* GC console check

* Funny emulator crash moment

* block comment moment

* Added centering for the gamecube controller, support reset command (#511)

* Added centering for the gamecube controller, support reset command

* Use struct 'ControllerCenters' for 'gGamecubeControllerCenters'

* Store gamecube controller centers per controller

* Clamp GC controller stick values to s8

* the

formatting changes

Co-authored-by: Mr-Wiseguy <mrwiseguyromhacking@gmail.com>
Co-authored-by: Reonu <danileon95@gmail.com>
Co-authored-by: Denis Kopyrin <aglab3@gmail.com>
2022-11-03 08:52:19 +01:00
Reonu
a784c180a8 Wrap boulder room check under vanilla specific level checks (#521) 2022-11-03 00:36:59 +01:00
Gregory Heskett
987f76190f Bugfix: RCP has gone loud because SOMEONE didn't look at their compiler output (#526) 2022-11-03 12:35:04 +13:00
Reonu
088dbbdd2b Make warp surfaces use the force parameter if set (#525) 2022-11-03 00:25:24 +01:00
arthurtilly
ab94fd7f63 Make objects not run their code if the room they are in isn't loaded. (#502) 2022-11-03 11:35:47 +13:00
Gregory Heskett
d7d0364682 Add define to disable pitch shifting of Mario sound effects (#522)
* Add define to disable pitch shifting of Mario sound effects

* Point new voice sequence macros to existing ones

* Remove pitch shifting sequence macros from peach sounds
2022-11-02 17:24:39 -05:00
Reonu
38d3c82860 Merge pull request #469 from someone2639/rcp_hung
add scheduler entry for when RCP locks up (addresses #344)
2022-11-02 20:14:48 +01:00
Denis Kopyrin
a7a637eb10 Disable cache emulation checks for VC (#509)
* Disable cache emulation checks for VC

* Get rid of unnecessary gIsVC initialization
2022-10-19 20:57:53 -05:00
Gregory Heskett
fc6a6055d9 Bugfix: WF stationary platforms given static collision despite being able to delete themselves (#510)
Resulted in a memory leak and stale object referencing that impacted Mario's positioning
2022-10-19 12:38:58 -04:00
Gregory Heskett
6291c77a18 Convert oBehParams to be unsigned, and fix GLOBAL_STAR_IDS to support more than 128 stars (#503) 2022-10-04 22:56:10 -05:00
Gregory Heskett
68f09d34ea Bugfix: Reset mario's room when switching areas (#504)
Mario's room sometimes is not reset when warping between different areas, generally when warping from one area with rooms to another without them. This can cause things like doors to not render properly.
2022-10-03 18:06:53 -05:00
someone2639
4ae3a431bc Use the error macro for rcp hang 2022-09-21 20:36:39 -04:00
someone2639
93fd414035 add scheduler entry for when RCP locks up 2022-07-26 20:56:17 -04:00
199 changed files with 23439 additions and 4661 deletions

View File

@@ -31,7 +31,7 @@
"compilerPath": "/usr/bin/mips-linux-gnu-gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++14",
"intelliSenseMode": "linux-gcc-x64"
"intelliSenseMode": "linux-gcc-x86"
}
],
"version": 4

View File

@@ -124,16 +124,26 @@ endif
TEXT_ENGINE := none
$(eval $(call validate-option,TEXT_ENGINE,none s2dex_text_engine))
ifeq ($(TEXT_ENGINE), s2dex_text_engine)
DEFINES += S2DEX_GBI_2=1 S2DEX_TEXT_ENGINE=1
SRC_DIRS += src/s2d_engine
endif
# add more text engines here
#==============================================================================#
# Optimization flags #
#==============================================================================#
# Default non-gcc opt flags
DEFAULT_OPT_FLAGS = -Ofast
# Note: -fno-associative-math is used here to suppress warnings, ideally we would enable this as an optimization but
# this conflicts with -ftrapping-math apparently.
# TODO: Figure out how to allow -fassociative-math to be enabled
SAFETY_OPT_FLAGS = -ftrapping-math -fno-associative-math
# Main opt flags
GCC_MAIN_OPT_FLAGS = \
-Ofast \
$(DEFAULT_OPT_FLAGS) $(SAFETY_OPT_FLAGS) \
--param case-values-threshold=20 \
--param max-completely-peeled-insns=10 \
--param max-unrolled-insns=10 \
@@ -144,7 +154,7 @@ GCC_MAIN_OPT_FLAGS = \
# Surface Collision
GCC_COLLISION_OPT_FLAGS = \
-Ofast \
$(DEFAULT_OPT_FLAGS) $(SAFETY_OPT_FLAGS) \
--param case-values-threshold=20 \
--param max-completely-peeled-insns=100 \
--param max-unrolled-insns=100 \
@@ -157,7 +167,7 @@ GCC_COLLISION_OPT_FLAGS = \
# Math Util
GCC_MATH_UTIL_OPT_FLAGS = \
-Ofast \
$(DEFAULT_OPT_FLAGS) $(SAFETY_OPT_FLAGS) \
-fno-unroll-loops \
-fno-peel-loops \
--param case-values-threshold=20 \
@@ -169,7 +179,7 @@ GCC_MATH_UTIL_OPT_FLAGS = \
# Rendering graph node
GCC_GRAPH_NODE_OPT_FLAGS = \
-Ofast \
$(DEFAULT_OPT_FLAGS) $(SAFETY_OPT_FLAGS) \
--param case-values-threshold=20 \
--param max-completely-peeled-insns=100 \
--param max-unrolled-insns=100 \
@@ -209,7 +219,6 @@ endif
ifeq ($(UNF),1)
DEFINES += UNF=1
SRC_DIRS += src/usb
USE_DEBUG := 1
endif
# ISVPRINT - whether to fake IS-Viewer presence,
@@ -225,10 +234,13 @@ endif
ifeq ($(USE_DEBUG),1)
ULTRALIB := ultra_d
DEFINES += DEBUG=1
DEFINES += DEBUG=1 OVERWRITE_OSPRINT=1
else ifeq ($(UNF),1)
ULTRALIB := ultra
DEFINES += _FINALROM=1 NDEBUG=1 OVERWRITE_OSPRINT=1
else
ULTRALIB := ultra_rom
DEFINES += _FINALROM=1 NDEBUG=1
DEFINES += _FINALROM=1 NDEBUG=1 OVERWRITE_OSPRINT=0
endif
# HVQM - whether to use HVQM fmv library
@@ -409,14 +421,6 @@ endif
LIBRARIES := nustd hvqm2 z goddard
# Text engine
ifeq ($(TEXT_ENGINE), s2dex_text_engine)
DEFINES += S2DEX_GBI_2=1 S2DEX_TEXT_ENGINE=1
LIBRARIES += s2d_engine
DUMMY != $(MAKE) -C src/s2d_engine COPY_DIR=$(shell pwd)/lib/ CROSS=$(CROSS)
endif
# add more text engines here
LINK_LIBRARIES = $(foreach i,$(LIBRARIES),-l$(i))
export LD_LIBRARY_PATH=./tools
@@ -496,6 +500,7 @@ VADPCM_ENC := $(TOOLS_DIR)/vadpcm_enc
EXTRACT_DATA_FOR_MIO := $(TOOLS_DIR)/extract_data_for_mio
SKYCONV := $(TOOLS_DIR)/skyconv
FIXLIGHTS_PY := $(TOOLS_DIR)/fixlights.py
FLIPS := $(TOOLS_DIR)/flips
ifeq ($(GZIPVER),std)
GZIP := gzip
else
@@ -553,7 +558,6 @@ all: $(ROM)
clean:
$(RM) -r $(BUILD_DIR_BASE)
make -C src/s2d_engine clean
distclean: clean
$(PYTHON) extract_assets.py --clean
@@ -581,8 +585,11 @@ unf: $(ROM) $(LOADER)
libultra: $(BUILD_DIR)/libultra.a
patch: $(ROM)
$(FLIPS) --create --bps ./baserom.$(VERSION).z64 $(ROM) $(BUILD_DIR)/$(TARGET_STRING).bps
# Extra object file dependencies
$(BUILD_DIR)/asm/boot.o: $(IPL3_RAW_FILES)
$(BUILD_DIR)/asm/ipl3.o: $(IPL3_RAW_FILES)
$(BUILD_DIR)/src/game/crash_screen.o: $(CRASH_TEXTURE_C_FILES)
$(BUILD_DIR)/src/game/version.o: $(BUILD_DIR)/src/game/version_data.h
$(BUILD_DIR)/lib/aspMain.o: $(BUILD_DIR)/rsp/audio.bin
@@ -687,9 +694,11 @@ $(BUILD_DIR)/%.ci4.inc.c: %.ci4.png
$(BUILD_DIR)/%.elf: $(BUILD_DIR)/%.o
$(call print,Linking ELF file:,$<,$@)
$(V)$(LD) -e 0 -Ttext=$(SEGMENT_ADDRESS) -Map $@.map -o $@ $<
# Override for leveldata.elf, which otherwise matches the above pattern
# Override for leveldata.elf, which otherwise matches the above pattern.
# Has to be a static pattern rule for make-4.4 and above to trigger the second
# expansion.
.SECONDEXPANSION:
$(BUILD_DIR)/levels/%/leveldata.elf: $(BUILD_DIR)/levels/%/leveldata.o $(BUILD_DIR)/bin/$$(TEXTURE_BIN).elf
$(LEVEL_ELF_FILES): $(BUILD_DIR)/levels/%/leveldata.elf: $(BUILD_DIR)/levels/%/leveldata.o $(BUILD_DIR)/bin/$$(TEXTURE_BIN).elf
$(call print,Linking ELF file:,$<,$@)
$(V)$(LD) -e 0 -Ttext=$(SEGMENT_ADDRESS) -Map $@.map --just-symbols=$(BUILD_DIR)/bin/$(TEXTURE_BIN).elf -o $@ $<
@@ -837,7 +846,7 @@ $(BUILD_DIR)/rsp/%.bin $(BUILD_DIR)/rsp/%_data.bin: rsp/%.s
# Run linker script through the C preprocessor
$(BUILD_DIR)/$(LD_SCRIPT): $(LD_SCRIPT) $(BUILD_DIR)/goddard.txt
$(call print,Preprocessing linker script:,$<,$@)
$(V)$(CPP) $(CPPFLAGS) -DBUILD_DIR=$(BUILD_DIR) $(DEBUG_MAP_STACKTRACE_FLAG) -MMD -MP -MT $@ -MF $@.d -o $@ $<
$(V)$(CPP) $(CPPFLAGS) -DBUILD_DIR=$(BUILD_DIR) -DULTRALIB=lib$(ULTRALIB) $(DEBUG_MAP_STACKTRACE_FLAG) -MMD -MP -MT $@ -MF $@.d -o $@ $<
# Link libgoddard
$(BUILD_DIR)/libgoddard.a: $(GODDARD_O_FILES)
@@ -852,11 +861,11 @@ $(BUILD_DIR)/libz.a: $(LIBZ_O_FILES)
# SS2: Goddard rules to get size
$(BUILD_DIR)/sm64_prelim.ld: sm64.ld $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/libgoddard.a $(BUILD_DIR)/libz.a
$(call print,Preprocessing preliminary linker script:,$<,$@)
$(V)$(CPP) $(CPPFLAGS) -DPRELIMINARY=1 -DBUILD_DIR=$(BUILD_DIR) -MMD -MP -MT $@ -MF $@.d -o $@ $<
$(V)$(CPP) $(CPPFLAGS) -DPRELIMINARY=1 -DBUILD_DIR=$(BUILD_DIR) -DULTRALIB=lib$(ULTRALIB) -MMD -MP -MT $@ -MF $@.d -o $@ $<
$(BUILD_DIR)/sm64_prelim.elf: $(BUILD_DIR)/sm64_prelim.ld
@$(PRINT) "$(GREEN)Linking Preliminary ELF file: $(BLUE)$@ $(NO_COL)\n"
$(V)$(LD) --gc-sections -L $(BUILD_DIR) -T undefined_syms.txt -T $< -Map $(BUILD_DIR)/sm64_prelim.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
$(V)$(LD) --gc-sections -L $(BUILD_DIR) -T $< -Map $(BUILD_DIR)/sm64_prelim.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_DIR)/goddard.txt: $(BUILD_DIR)/sm64_prelim.elf
$(call print,Getting Goddard size...)
@@ -864,17 +873,25 @@ $(BUILD_DIR)/goddard.txt: $(BUILD_DIR)/sm64_prelim.elf
$(BUILD_DIR)/asm/debug/map.o: asm/debug/map.s $(BUILD_DIR)/sm64_prelim.elf
$(call print,Assembling:,$<,$@)
$(V)python3 tools/mapPacker.py $(BUILD_DIR)/sm64_prelim.map $(BUILD_DIR)/bin/addr.bin $(BUILD_DIR)/bin/name.bin
$(V)python3 tools/mapPacker.py $(BUILD_DIR)/sm64_prelim.elf $(BUILD_DIR)/bin/addr.bin $(BUILD_DIR)/bin/name.bin
$(V)$(CROSS)gcc -c $(ASMFLAGS) $(foreach i,$(INCLUDE_DIRS),-Wa,-I$(i)) -x assembler-with-cpp -MMD -MF $(BUILD_DIR)/$*.d -o $@ $<
# 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) undefined_syms.txt $(BUILD_DIR)/libz.a $(BUILD_DIR)/libgoddard.a
$(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 undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -T goddard.txt -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(addprefix -R ,$(SEG_FILES)) -o $@ $(O_FILES) -L$(LIBS_DIR) -l$(ULTRALIB) -Llib $(LINK_LIBRARIES) -u sprintf -u osMapTLB -Llib/gcclib/$(LIBGCCDIR) -lgcc -lrtc
$(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
# Build ROM
ifeq (n,$(findstring n,$(firstword -$(MAKEFLAGS))))
# run with -n / --dry-run
$(ROM):
@$(PRINT) "$(BLUE)DRY RUNS ARE DISABLED$(NO_COL)\n"
else
# not running with -n / --dry-run
$(ROM): $(ELF)
$(call print,Building ROM:,$<,$@)
endif
ifeq ($(CONSOLE),n64)
$(V)$(OBJCOPY) --pad-to=0x101000 --gap-fill=0xFF $< $@ -O binary
else ifeq ($(CONSOLE),bb)

View File

@@ -39,6 +39,8 @@ ACTOR_GROUPS := \
LEVEL_FILES := $(addsuffix leveldata,$(LEVEL_DIRS))
LEVEL_ELF_FILES := $(foreach level_dir,$(LEVEL_DIRS),$(BUILD_DIR)/levels/$(level_dir)leveldata.elf)
SEG_FILES := \
$(SEGMENTS:%=$(BUILD_DIR)/bin/%.elf) \
$(ACTOR_GROUPS:%=$(BUILD_DIR)/actors/%.elf) \

View File

@@ -14,7 +14,7 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin
- **ArcticJaguar725**: Most audio configuration and layout changes, colored ia4 text, floombas, various bugfixes, and more
- **CowQuack**: Adjustable skybox sizes, area-specific skybox function
- **thecozies**: Water surface types, general maintenance, and time
- **MrComit**: General use object defines, JUMP_KICK_FIX, LEDGE_GRABS_CHECK_SLOPE_ANGLE
- **MrComit**: General use object defines, JUMP_KICK_FIX
- **aglab2**: Bugfixes (particularly puppycam), refactor stuff
- **someone2639**: math.s and crash screen disam, stack trace, map packing, shiftable segments 2, S2DEX engine
- **Arthurtilly**: Platform Displacement 2
@@ -61,7 +61,6 @@ Thanks to Frame#5375 and AloXado320 for also helping with silhouette stuff
- Toggle to disable fall damage and the fall damage sound *
- Nonstop stars *
- Removed course-specific camera processing *
- You can increase the number of frames that you have to perform a firsty *
- Ability to set Mario's movement speed when hanging from a ceiling *
- Tighter hanging controls (Mario will face the direction of the analog stick directly while hanging from a ceiling) *
- reonucam3: custom camera by Reonu. This is included as a .patch file in the enhancements folder, you need to apply it if you want this camera.
@@ -122,7 +121,7 @@ Thanks to Frame#5375 and AloXado320 for also helping with silhouette stuff
- 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.
- Red Coin Stars now support up to 99 red coins! In addition, multi-area red coin missions can now be created by setting the 2nd behavior paramater of the red coin star to the number of reds required for the star to spawn.
# UltraSM64
- This repo contains a full decompilation of Super Mario 64 (J), (U), (E), and (SH).

View File

@@ -1 +1 @@
v2.0.3
v2.0.9

View File

@@ -27,6 +27,6 @@
#include "sparkle_animation/model.inc.c"
#ifdef S2DEX_TEXT_ENGINE
#include "src/s2d_engine/config.h"
#include "src/s2d_engine/s2d_config.h"
#include FONT_C_FILE
#endif

View File

@@ -4,24 +4,39 @@
.set gp=64
#include "macros.inc"
#undef _LANGUAGE_C
#include <PR/rcp.h>
#define PHYS_TO_CART(addr) ((addr) | 0xB0000000)
.set CART_ENTRYPOINT, 0x00000008
.set CART_CHECKSUM0, 0x00000010
.set CART_CHECKSUM1, 0x00000014
// initial DMEM state
.set SP_DMEM_UNK0, 0x040004C0
.set SP_DMEM_UNK1, 0x04000774
// Used for documentation; changing these can and will break your ROM!
.set INITIAL_DMA_LEN, 0x00100000
.set INITIAL_DMA_ROMPOS, 0x1000
// 0xA0000000-0xBFFFFFFF: KSEG1 direct map non-cache mirror of 0x00000000
// 0xA4000000-0xA4000FFF: RSP DMEM
// 0xA4000000-0xA400003F: ROM header
.section .text, "ax"
// 0xA4000040-0xA4000B6F: IPL3
// IPL3 entry point jumped to from IPL2
glabel ipl3_entry // 0xA4000040
mtc0 $zero, $13
mtc0 $zero, $9
mtc0 $zero, $11
lui $t0, %hi(RI_MODE_REG)
addiu $t0, %lo(RI_MODE_REG)
lw $t1, 0xc($t0)
.ent ipl3_entry
mtc0 $zero, C0_CAUSE
mtc0 $zero, C0_COUNT
mtc0 $zero, C0_COMPARE
lui $t0, %hi(PHYS_TO_K1(RI_BASE_REG))
addiu $t0, %lo(PHYS_TO_K1(RI_BASE_REG))
lw $t1, %lo(RI_SELECT_REG)($t0)
bnez $t1, .LA4000410
nop
addiu $sp, $sp, -0x18
@@ -30,24 +45,24 @@ glabel ipl3_entry // 0xA4000040
sw $s5, 8($sp)
sw $s6, 0xc($sp)
sw $s7, 0x10($sp)
lui $t0, %hi(RI_MODE_REG)
addiu $t0, %lo(RI_MODE_REG)
lui $t2, (0xa3f80000 >> 16)
lui $t3, (0xa3f00000 >> 16)
lui $t4, %hi(MI_MODE_REG)
addiu $t4, %lo(MI_MODE_REG)
lui $t0, %hi(PHYS_TO_K1(RI_BASE_REG))
addiu $t0, %lo(PHYS_TO_K1(RI_BASE_REG))
lui $t2, %hi(PHYS_TO_K1(RDRAM_BASE_REG + 0x80000))
lui $t3, %hi(PHYS_TO_K1(RDRAM_BASE_REG))
lui $t4, %hi(PHYS_TO_K1(MI_BASE_REG))
addiu $t4, %lo(PHYS_TO_K1(MI_BASE_REG))
ori $t1, $zero, 64
sw $t1, 4($t0)
sw $t1, %lo(MI_VERSION_REG)($t0)
li $s1, 8000
.LA400009C:
nop
addi $s1, $s1, -1
bnez $s1, .LA400009C
nop
sw $zero, 8($t0)
ori $t1, $zero, 20
sw $t1, 0xc($t0)
sw $zero, ($t0)
sw $zero, %lo(RI_CURRENT_LOAD_REG)($t0)
ori $t1, $zero, 0x14
sw $t1, %lo(RI_SELECT_REG)($t0)
sw $zero, %lo(RI_MODE_REG)($t0)
li $s1, 4
.LA40000C0:
nop
@@ -55,34 +70,34 @@ glabel ipl3_entry // 0xA4000040
bnez $s1, .LA40000C0
nop
ori $t1, $zero, 14
sw $t1, ($t0)
sw $t1, %lo(RI_MODE_REG)($t0)
li $s1, 32
.LA40000DC:
addi $s1, $s1, -1
bnez $s1, .LA40000DC
ori $t1, $zero, 271
sw $t1, ($t4)
ori $t1, $zero, (MI_SET_INIT | 0xF)
sw $t1, %lo(MI_MODE_REG)($t4)
lui $t1, (0x18082838 >> 16)
ori $t1, (0x18082838 & 0xFFFF)
sw $t1, 0x8($t2)
sw $zero, 0x14($t2)
sw $t1, %lo(RDRAM_DELAY_REG)($t2)
sw $zero, %lo(RDRAM_REF_ROW_REG)($t2)
lui $t1, 0x8000
sw $t1, 0x4($t2)
sw $t1, %lo(RDRAM_DEVICE_ID_REG)($t2)
move $t5, $zero
move $t6, $zero
lui $t7, (0xA3F00000 >> 16)
lui $t7, %hi(PHYS_TO_K1(RDRAM_BASE_REG))
move $t8, $zero
lui $t9, (0xA3F00000 >> 16)
lui $t9, %hi(PHYS_TO_K1(RDRAM_BASE_REG))
lui $s6, (0xA0000000 >> 16)
move $s7, $zero
lui $a2, (0xA3F00000 >> 16)
lui $a2, %hi(PHYS_TO_K1(RDRAM_BASE_REG))
lui $a3, (0xA0000000 >> 16)
move $s2, $zero
lui $s4, (0xA0000000 >> 16)
addiu $sp, $sp, -0x48
move $fp, $sp
lui $s0, %hi(MI_VERSION_REG)
lw $s0, %lo(MI_VERSION_REG)($s0)
lui $s0, %hi(PHYS_TO_K1(MI_VERSION_REG))
lw $s0, %lo(PHYS_TO_K1(MI_VERSION_REG))($s0)
lui $s1, (0x01010101 >> 16)
addiu $s1, (0x01010101 & 0xFFFF)
bne $s0, $s1, .LA4000160
@@ -103,14 +118,14 @@ glabel ipl3_entry // 0xA4000040
nop
sw $v0, ($sp)
li $t1, 8192
sw $t1, ($t4)
lw $t3, ($t7)
sw $t1, %lo(MI_MODE_REG)($t4)
lw $t3, %lo(RDRAM_CONFIG_REG)($t7)
lui $t0, 0xf0ff
and $t3, $t3, $t0
sw $t3, 4($sp)
addi $sp, $sp, 8
li $t1, 4096
sw $t1, ($t4)
sw $t1, %lo(MI_MODE_REG)($t4)
lui $t0, 0xb019
bne $t3, $t0, .LA40001E0
nop
@@ -130,11 +145,11 @@ glabel ipl3_entry // 0xA4000040
add $s4, $s4, $t0
.LA40001E8:
li $t0, 8192
sw $t0, ($t4)
lw $t1, 0x24($t7)
lw $k0, ($t7)
sw $t0, %lo(MI_MODE_REG)($t4)
lw $t1, %lo(RDRAM_DEVICE_MANUF_REG)($t7)
lw $k0, %lo(RDRAM_CONFIG_REG)($t7)
li $t0, 4096
sw $t0, ($t4)
sw $t0, %lo(MI_MODE_REG)($t4)
andi $t1, $t1, 0xffff
li $t0, 1280
bne $t1, $t0, .LA4000230
@@ -162,9 +177,9 @@ glabel ipl3_entry // 0xA4000040
nop
.LA400025C:
li $t0, 0xc4000000
sw $t0, 0xc($t2)
sw $t0, %lo(RDRAM_MODE_REG)($t2)
li $t0, 0x80000000
sw $t0, 0x4($t2)
sw $t0, %lo(RDRAM_DEVICE_ID_REG)($t2)
move $sp, $fp
move $v1, $zero
.LA4000274:
@@ -232,7 +247,7 @@ glabel ipl3_entry // 0xA4000040
slt $t0, $v1, $t5
bnez $t0, .LA4000274
nop
lui $t2, %hi(RI_REFRESH_REG)
lui $t2, %hi(PHYS_TO_K1(RI_BASE_REG))
sll $s2, $s2, 0x13
lui $t1, (0x00063634 >> 16)
ori $t1, (0x00063634 & 0xFFFF)
@@ -253,8 +268,8 @@ glabel ipl3_entry // 0xA4000040
lw $s6, 0xc($sp)
lw $s7, 0x10($sp)
addiu $sp, $sp, 0x18
lui $t0, %hi(EXCEPTION_TLB_MISS)
addiu $t0, $t0, %lo(EXCEPTION_TLB_MISS)
lui $t0, %hi(UT_VEC)
addiu $t0, $t0, %lo(UT_VEC)
addiu $t1, $t0, 0x4000
addiu $t1, $t1, -0x20
mtc0 $zero, $28
@@ -264,8 +279,8 @@ glabel ipl3_entry // 0xA4000040
sltu $at, $t0, $t1
bnez $at, .LA40003D8
addiu $t0, $t0, 0x20
lui $t0, %hi(EXCEPTION_TLB_MISS)
addiu $t0, %lo(EXCEPTION_TLB_MISS)
lui $t0, %hi(UT_VEC)
addiu $t0, %lo(UT_VEC)
addiu $t1, $t0, 0x2000
addiu $t1, $t1, -0x10
.LA40003F8:
@@ -276,8 +291,8 @@ glabel ipl3_entry // 0xA4000040
b .LA4000458
nop
.LA4000410:
lui $t0, %hi(EXCEPTION_TLB_MISS)
addiu $t0, %lo(EXCEPTION_TLB_MISS)
lui $t0, %hi(UT_VEC)
addiu $t0, %lo(UT_VEC)
addiu $t1, $t0, 0x4000
addiu $t1, $t1, -0x20
mtc0 $zero, $28
@@ -287,8 +302,8 @@ glabel ipl3_entry // 0xA4000040
sltu $at, $t0, $t1
bnez $at, .LA4000428
addiu $t0, $t0, 0x20
lui $t0, %hi(EXCEPTION_TLB_MISS)
addiu $t0, %lo(EXCEPTION_TLB_MISS)
lui $t0, %hi(UT_VEC)
addiu $t0, %lo(UT_VEC)
addiu $t1, $t0, 0x2000
addiu $t1, $t1, -0x10
.LA4000448:
@@ -297,16 +312,16 @@ glabel ipl3_entry // 0xA4000040
bnez $at, .LA4000448
addiu $t0, $t0, 0x10
.LA4000458:
lui $t2, %hi(SP_DMEM)
addiu $t2, $t2, %lo(SP_DMEM)
lui $t2, %hi(PHYS_TO_K1(SP_DMEM_START))
addiu $t2, $t2, %lo(PHYS_TO_K1(SP_DMEM_START))
lui $t3, 0xfff0
lui $t1, 0x0010
and $t2, $t2, $t3
lui $t0, %hi(SP_DMEM_UNK0)
lui $t0, %hi(PHYS_TO_K1(SP_DMEM_UNK0))
addiu $t1, -1
lui $t3, %hi(SP_DMEM_UNK1)
addiu $t0, %lo(SP_DMEM_UNK0)
addiu $t3, %lo(SP_DMEM_UNK1)
lui $t3, %hi(PHYS_TO_K1(SP_DMEM_UNK1))
addiu $t0, %lo(PHYS_TO_K1(SP_DMEM_UNK0))
addiu $t3, %lo(PHYS_TO_K1(SP_DMEM_UNK1))
and $t0, $t0, $t1
and $t3, $t3, $t1
lui $t1, 0xa000
@@ -320,32 +335,32 @@ glabel ipl3_entry // 0xA4000040
addiu $t1, $t1, 4
bnez $at, .LA4000498
sw $t5, -4($t1)
lui $t4, %hi(EXCEPTION_TLB_MISS)
addiu $t4, %lo(EXCEPTION_TLB_MISS)
lui $t4, %hi(UT_VEC)
addiu $t4, %lo(UT_VEC)
jr $t4
nop
lui $t3, %hi(D_B0000008)
lw $t1, %lo(D_B0000008)($t3)
lui $t3, %hi(PHYS_TO_CART(CART_ENTRYPOINT))
lw $t1, %lo(PHYS_TO_CART(CART_ENTRYPOINT))($t3)
lui $t2, (0x1FFFFFFF >> 16)
ori $t2, (0x1FFFFFFF & 0xFFFF)
lui $at, %hi(PI_DRAM_ADDR_REG)
lui $at, %hi(PHYS_TO_K1(PI_DRAM_ADDR_REG))
and $t1, $t1, $t2
sw $t1, %lo(PI_DRAM_ADDR_REG)($at)
lui $t0, %hi(PI_STATUS_REG)
sw $t1, %lo(PHYS_TO_K1(PI_DRAM_ADDR_REG))($at)
lui $t0, %hi(PHYS_TO_K1(PI_STATUS_REG))
.LA40004D0:
lw $t0, %lo(PI_STATUS_REG)($t0)
andi $t0, $t0, 2
lw $t0, %lo(PHYS_TO_K1(PI_STATUS_REG))($t0)
andi $t0, $t0, PI_STATUS_IO_BUSY
bnezl $t0, .LA40004D0
lui $t0, %hi(PI_STATUS_REG)
li $t0, 0x1000
lui $t0, %hi(PHYS_TO_K1(PI_STATUS_REG))
li $t0, INITIAL_DMA_ROMPOS
add $t0, $t0, $t3
and $t0, $t0, $t2
lui $at, %hi(PI_CART_ADDR_REG)
sw $t0, %lo(PI_CART_ADDR_REG)($at)
lui $t2, 0x0010
addiu $t2, 0xFFFF
lui $at, %hi(PI_WR_LEN_REG)
sw $t2, %lo(PI_WR_LEN_REG)($at)
lui $at, %hi(PHYS_TO_K1(PI_CART_ADDR_REG))
sw $t0, %lo(PHYS_TO_K1(PI_CART_ADDR_REG))($at)
li $t2, INITIAL_DMA_LEN
addiu $t2, -1
lui $at, %hi(PHYS_TO_K1(PI_WR_LEN_REG))
sw $t2, %lo(PHYS_TO_K1(PI_WR_LEN_REG))($at)
.LA4000514:
nop
@@ -376,13 +391,13 @@ glabel ipl3_entry // 0xA4000040
nop
nop
nop
lui $t3, %hi(PI_STATUS_REG)
lw $t3, %lo(PI_STATUS_REG)($t3)
lui $t3, %hi(PHYS_TO_K1(PI_STATUS_REG))
lw $t3, %lo(PHYS_TO_K1(PI_STATUS_REG))($t3)
andi $t3, $t3, 0x1
bnez $t3, .LA4000514
nop
lui $t3, %hi(D_B0000008)
lw $a0, %lo(D_B0000008)($t3)
lui $t3, %hi(PHYS_TO_CART(CART_ENTRYPOINT))
lw $a0, %lo(PHYS_TO_CART(CART_ENTRYPOINT))($t3)
move $a1, $s6
lui $at, (0x5D588B65 >> 16)
ori $at, (0x5D588B65 & 0xFFFF)
@@ -436,52 +451,54 @@ glabel ipl3_entry // 0xA4000040
xor $a3, $t6, $t3
xor $t8, $s0, $a2
xor $s0, $t8, $t4
lui $t3, %hi(D_B0000010)
lw $t0, %lo(D_B0000010)($t3)
// verifies checksum
lui $t3, %hi(PHYS_TO_CART(CART_CHECKSUM0))
lw $t0, %lo(PHYS_TO_CART(CART_CHECKSUM0))($t3)
bne $a3, $t0, halt
nop
lw $t0, %lo(D_B0000014)($t3)
lw $t0, %lo(PHYS_TO_CART(CART_CHECKSUM1))($t3)
bne $s0, $t0, halt
nop
bal func_A4000690
nop
// In a permanent loop that cannot be exited.
halt:
bal halt
nop
func_A4000690:
lui $t1, %hi(SP_PC)
lw $t1, %lo(SP_PC)($t1)
lui $t1, %hi(PHYS_TO_K1(SP_PC_REG))
lw $t1, %lo(PHYS_TO_K1(SP_PC_REG))($t1)
lw $s0, 0x14($sp)
lw $ra, 0x1c($sp)
beqz $t1, .LA40006BC
addiu $sp, $sp, 0x20
li $t2, 65
lui $at, %hi(SP_STATUS_REG)
sw $t2, %lo(SP_STATUS_REG)($at)
lui $at, %hi(SP_PC)
sw $zero, %lo(SP_PC)($at)
lui $at, %hi(PHYS_TO_K1(SP_STATUS_REG))
sw $t2, %lo(PHYS_TO_K1(SP_STATUS_REG))($at)
lui $at, %hi(PHYS_TO_K1(SP_PC_REG))
sw $zero, %lo(PHYS_TO_K1(SP_PC_REG))($at)
.LA40006BC:
lui $t3, (0x00AAAAAE >> 16)
ori $t3, (0x00AAAAAE & 0xFFFF)
lui $at, %hi(SP_STATUS_REG)
sw $t3, %lo(SP_STATUS_REG)($at)
lui $at, %hi(MI_INTR_MASK_REG)
lui $at, %hi(PHYS_TO_K1(SP_STATUS_REG))
sw $t3, %lo(PHYS_TO_K1(SP_STATUS_REG))($at)
lui $at, %hi(PHYS_TO_K1(MI_INTR_MASK_REG))
li $t0, 1365
sw $t0, %lo(MI_INTR_MASK_REG)($at)
lui $at, %hi(SI_STATUS_REG)
sw $zero, %lo(SI_STATUS_REG)($at)
lui $at, %hi(AI_STATUS_REG)
sw $zero, %lo(AI_STATUS_REG)($at)
lui $at, %hi(MI_MODE_REG)
sw $t0, %lo(PHYS_TO_K1(MI_INTR_MASK_REG))($at)
lui $at, %hi(PHYS_TO_K1(SI_STATUS_REG))
sw $zero, %lo(PHYS_TO_K1(SI_STATUS_REG))($at)
lui $at, %hi(PHYS_TO_K1(AI_STATUS_REG))
sw $zero, %lo(PHYS_TO_K1(AI_STATUS_REG))($at)
lui $at, %hi(PHYS_TO_K1(MI_BASE_REG))
li $t1, 2048
sw $t1, %lo(MI_MODE_REG)($at)
sw $t1, %lo(PHYS_TO_K1(MI_BASE_REG))($at)
li $t1, 2
lui $at, %hi(PI_STATUS_REG)
lui $at, %hi(PHYS_TO_K1(PI_STATUS_REG))
lui $t0, (0xA0000300 >> 16)
ori $t0, (0xA0000300 & 0xFFFF)
sw $t1, %lo(PI_STATUS_REG)($at)
sw $t1, %lo(PHYS_TO_K1(PI_STATUS_REG))($at)
sw $s7, 0x14($t0)
sw $s5, 0xc($t0)
sw $s3, 0x4($t0)
@@ -495,22 +512,22 @@ func_A4000690:
addiu $t1, $t1, 0
.LA4000730:
sw $t1, 0x8($t0)
lui $t0, %hi(SP_DMEM)
addiu $t0, %lo(SP_DMEM)
lui $t0, %hi(PHYS_TO_K1(SP_DMEM_START))
addiu $t0, %lo(PHYS_TO_K1(SP_DMEM_START))
addi $t1, $t0, 0x1000
.LA4000740:
addiu $t0, $t0, 4
bne $t0, $t1, .LA4000740
sw $zero, -4($t0)
lui $t0, %hi(SP_IMEM)
addiu $t0, %lo(SP_IMEM)
lui $t0, %hi(PHYS_TO_K1(SP_IMEM_START))
addiu $t0, %lo(PHYS_TO_K1(SP_IMEM_START))
addi $t1, $t0, 0x1000
.LA4000758:
addiu $t0, $t0, 4
bne $t0, $t1, .LA4000758
sw $zero, -4($t0)
lui $t3, %hi(D_B0000008)
lw $t1, %lo(D_B0000008)($t3)
lui $t3, %hi(PHYS_TO_CART(CART_ENTRYPOINT))
lw $t1, %lo(PHYS_TO_CART(CART_ENTRYPOINT))($t3)
jr $t1
nop
nop
@@ -747,8 +764,8 @@ func_A4000A40:
li $k1, 1
bne $a1, $k1, .LA4000AC0
sw $t7, ($s5)
lui $k0, %hi(MI_MODE_REG)
sw $zero, %lo(MI_MODE_REG)($k0)
lui $k0, %hi(PHYS_TO_K1(MI_BASE_REG))
sw $zero, %lo(PHYS_TO_K1(MI_BASE_REG))($k0)
.LA4000AC0:
lw $ra, 0x1c($sp)
addiu $sp, $sp, 0x28
@@ -759,12 +776,12 @@ func_A4000AD0:
addiu $sp, $sp, -0x28
sw $ra, 0x1c($sp)
li $k0, 0x2000
lui $k1, %hi(MI_MODE_REG)
sw $k0, %lo(MI_MODE_REG)($k1)
lui $k1, %hi(PHYS_TO_K1(MI_BASE_REG))
sw $k0, %lo(PHYS_TO_K1(MI_BASE_REG))($k1)
move $fp, $zero
lw $fp, ($s5)
li $k0, 0x1000
sw $k0, %lo(MI_MODE_REG)($k1)
sw $k0, %lo(PHYS_TO_K1(MI_BASE_REG))($k1)
li $k1, 0x40
and $k1, $k1, $fp
srl $k1, $k1, 6
@@ -797,6 +814,8 @@ func_A4000AD0:
nop
nop
.end ipl3_entry
// 0xA4000B70-0xA4000FFF: IPL3 Font
glabel ipl3_font
.incbin "textures/ipl3_raw/ipl3_font_00.ia1"

View File

@@ -15,9 +15,14 @@
.word 0x00000000 /* Unknown */
.word 0x00000000 /* Unknown */
.ascii INTERNAL_ROM_NAME /* Internal ROM name */
#if defined(USE_GAMECUBE_CONTROLLER)
/* Advanced homebrew ROM header bytes: https://n64brew.dev/wiki/ROM_Header#Advanced_Homebrew_ROM_Header */
.word 0x82000000
#else
.word 0x00000000 /* Unknown */
#endif
.word 0x0000004E /* Cartridge */
#if defined(EEP4K)
#if defined(EEP4K) && !defined(USE_GAMECUBE_CONTROLLER)
.ascii "SM" /* Cartridge ID */
#else
.ascii "ED" /* Cartridge ID */

10
asm/round.s Normal file
View File

@@ -0,0 +1,10 @@
.include "macros.inc"
.section .text
.set noreorder
.set abi_arg0, $f12
glabel roundf
round.w.s $f0, abi_arg0
jr $ra
mfc1 $v0, $f0

View File

@@ -5,40 +5,152 @@
#include "macros.h"
#include "types.h"
#include "game/ingame_menu.h"
#include "game/puppyprint.h"
#include "make_const_nonconst.h"
// SM64 (US/JP/EU/SH) Segment 02
#ifdef PUPPYPRINT
ALIGNED8 static const Texture small_font_1[] = {
ALIGNED8 static const Texture small_font_default[] = {
#include "textures/segment2/custom_text.i4.inc.c"
};
ALIGNED8 static const Texture small_font_2[] = {
#include "textures/segment2/custom_text2.i4.inc.c"
ALIGNED8 static const Texture small_font_outline[] = {
#include "textures/segment2/custom_text2.ia4.inc.c"
};
ALIGNED8 static const Texture small_font_plain[] = {
#include "textures/segment2/custom_text3.i4.inc.c"
};
ALIGNED8 static const Texture small_font_vanilla[] = {
#include "textures/segment2/custom_text4.i4.inc.c"
};
const Texture *const puppyprint_font_lut[2] = {
small_font_1, small_font_2
const u8 small_font_kerning_default[] = {
/*!*/ 4, /*"*/ 5, /*#*/ 0, /*$*/ 0, /*%*/ 8, /*&*/ 8, /*'*/ 2, /*(*/ 5, /*)*/ 5, /***/ 0, /*+*/ 8, /*,*/ 3, /*-*/ 8, /*.*/ 3, /*/*/ 8, /*0*/ 6,
/*1*/ 5, /*2*/ 7, /*3*/ 7, /*4*/ 7, /*5*/ 7, /*6*/ 8, /*7*/ 7, /*8*/ 7, /*9*/ 6, /*:*/ 3, /*;*/ 3, /*<*/ 0, /*=*/ 0, /*>*/ 0, /*?*/ 6, /*@*/ 0,
/*A*/ 7, /*B*/ 7, /*C*/ 7, /*D*/ 7, /*E*/ 6, /*F*/ 5, /*G*/ 8, /*H*/ 6, /*I*/ 6, /*J*/ 5, /*K*/ 7, /*L*/ 6, /*M*/ 7, /*N*/ 7, /*O*/ 7, /*P*/ 6,
/*Q*/ 8, /*R*/ 6, /*S*/ 7, /*T*/ 7, /*U*/ 7, /*V*/ 7, /*W*/ 8, /*X*/ 7, /*Y*/ 7, /*Z*/ 7, /*[*/ 0, /*\\*/ 0, /*]*/ 0, /*^*/ 8, /*_*/ 0, /*`*/ 0,
/*a*/ 7, /*b*/ 7, /*c*/ 6, /*d*/ 7, /*e*/ 7, /*f*/ 7, /*g*/ 7, /*h*/ 7, /*i*/ 3, /*j*/ 5, /*k*/ 8, /*l*/ 4, /*m*/ 7, /*n*/ 7, /*o*/ 7, /*p*/ 7,
/*q*/ 7, /*r*/ 6, /*s*/ 6, /*t*/ 6, /*u*/ 6, /*v*/ 7, /*w*/ 8, /*x*/ 6, /*y*/ 8, /*z*/ 7, /*~*/ 8,
};
static const u8 small_font_kerning_1[80] = {
/*0*/ 6, /*1*/ 5, /*2*/ 7, /*3*/ 7, /*4*/ 7, /*5*/ 7, /*6*/ 8, /*7*/ 7, /*8*/ 7, /*9*/ 6, /*-*/ 8, /*+*/ 8, /*(*/ 5, /*)*/ 5, /*!*/ 4, /*?*/ 6,
/*A*/ 7, /*B*/ 7, /*C*/ 7, /*D*/ 7, /*E*/ 6, /*F*/ 5, /*G*/ 8, /*H*/ 6, /*I*/ 6, /*J*/ 5, /*K*/ 7, /*L*/ 6, /*M*/ 7, /*N*/ 7, /*O*/ 7, /*P*/ 6,
/*Q*/ 8, /*R*/ 6, /*S*/ 7, /*T*/ 7, /*U*/ 7, /*V*/ 7, /*W*/ 8, /*X*/ 7, /*Y*/ 7, /*Z*/ 7, /*"*/ 5, /*'*/ 2, /*:*/ 3, /*;*/ 3, /*.*/ 3, /*,*/ 3,
/*a*/ 7, /*b*/ 7, /*c*/ 6, /*d*/ 7, /*e*/ 7, /*f*/ 7, /*g*/ 7, /*h*/ 7, /*i*/ 3, /*j*/ 5, /*k*/ 8, /*l*/ 4, /*m*/ 7, /*n*/ 7, /*o*/ 7, /*p*/ 7,
/*q*/ 7, /*r*/ 6, /*s*/ 6, /*t*/ 6, /*u*/ 6, /*v*/ 7, /*w*/ 8, /*x*/ 6, /*y*/ 8, /*z*/ 7, /*~*/ 8, /*¨*/ 7, /*^*/ 8, /*/*/ 8, /*%*/ 8, /*&*/ 8,
const u16 small_font_offsets_default[] = {
/*!*/ 0, /*"*/ 8, /*#*/ 16, /*$*/ 24, /*%*/ 32, /*&*/ 40, /*'*/ 48, /*(*/ 56, /*)*/ 64, /***/ 72, /*+*/ 80, /*,*/ 88, /*-*/ 96, /*.*/ 104, /*/*/ 112,
/*0*/ 120, /*1*/ 128, /*2*/ 136, /*3*/ 144, /*4*/ 152, /*5*/ 160, /*6*/ 168, /*7*/ 176, /*8*/ 184, /*9*/ 192, /*:*/ 200, /*;*/ 208, /*<*/ 216, /*=*/ 216,
/*>*/ 0, /*?*/ 216, /*@*/ 0, /*A*/ 224, /*B*/ 232, /*C*/ 240, /*D*/ 248, /*E*/ 256, /*F*/ 264, /*G*/ 272, /*H*/ 280, /*I*/ 288, /*J*/ 296, /*K*/ 304,
/*L*/ 312, /*M*/ 320, /*N*/ 328, /*O*/ 336, /*P*/ 344, /*Q*/ 352, /*R*/ 360, /*S*/ 368, /*T*/ 376, /*U*/ 384, /*V*/ 392, /*W*/ 400, /*X*/ 408, /*Y*/ 416,
/*Z*/ 424, /*[*/ 432, /*\*/ 432, /*]*/ 432, /*^*/ 432, /*_*/ 440, /*`*/ 440, /*a*/ 440, /*b*/ 448, /*c*/ 456, /*d*/ 464, /*e*/ 472, /*f*/ 480, /*g*/ 488,
/*h*/ 496, /*i*/ 504, /*j*/ 512, /*k*/ 520, /*l*/ 528, /*m*/ 536, /*n*/ 544, /*o*/ 552, /*p*/ 560, /*q*/ 568, /*r*/ 576, /*s*/ 584, /*t*/ 592, /*u*/ 600,
/*v*/ 608, /*w*/ 616, /*x*/ 624, /*y*/ 632, /*z*/ 640, /*{*/ 648, /*|*/ 648, /*}*/ 648, /*~*/ 648, /*:)*/ 656
};
static const u8 small_font_kerning_2[80] = {
/*0*/ 6, /*1*/ 6, /*2*/ 6, /*3*/ 6, /*4*/ 6, /*5*/ 6, /*6*/ 6, /*7*/ 6, /*8*/ 6, /*9*/ 6, /*-*/ 6, /*+*/ 6, /*(*/ 3, /*)*/ 3, /*!*/ 4, /*?*/ 5,
/*A*/ 6, /*B*/ 6, /*C*/ 6, /*D*/ 6, /*E*/ 6, /*F*/ 6, /*G*/ 6, /*H*/ 6, /*I*/ 6, /*J*/ 6, /*K*/ 6, /*L*/ 6, /*M*/ 6, /*N*/ 6, /*O*/ 6, /*P*/ 6,
/*Q*/ 6, /*R*/ 6, /*S*/ 6, /*T*/ 6, /*U*/ 6, /*V*/ 6, /*W*/ 6, /*X*/ 6, /*Y*/ 6, /*Z*/ 6, /*"*/ 4, /*'*/ 1, /*:*/ 2, /*;*/ 2, /*.*/ 2, /*,*/ 2,
/*a*/ 5, /*b*/ 5, /*c*/ 5, /*d*/ 5, /*e*/ 5, /*f*/ 5, /*g*/ 5, /*h*/ 5, /*i*/ 1, /*j*/ 5, /*k*/ 5, /*l*/ 3, /*m*/ 5, /*n*/ 5, /*o*/ 5, /*p*/ 5,
/*q*/ 5, /*r*/ 5, /*s*/ 5, /*t*/ 5, /*u*/ 5, /*v*/ 5, /*w*/ 5, /*x*/ 5, /*y*/ 5, /*z*/ 5, /*~*/ 6, /*¨*/ 5, /*^*/ 6, /*/*/ 5, /*%*/ 5, /*&*/ 6,
static const u8 small_font_kerning_outline[] = {
/*!*/ 3, /*"*/ 4, /*#*/ 0, /*$*/ 0, /*%*/ 6, /*&*/ 6, /*'*/ 2, /*(*/ 4, /*)*/ 4, /***/ 0, /*+*/ 6, /*,*/ 2, /*-*/ 6, /*.*/ 2, /*/*/ 6, /*0*/ 6,
/*1*/ 6, /*2*/ 6, /*3*/ 6, /*4*/ 6, /*5*/ 6, /*6*/ 6, /*7*/ 6, /*8*/ 6, /*9*/ 6, /*:*/ 2, /*;*/ 2, /*<*/ 0, /*=*/ 0, /*>*/ 0, /*?*/ 6, /*@*/ 0,
/*A*/ 6, /*B*/ 6, /*C*/ 6, /*D*/ 6, /*E*/ 6, /*F*/ 6, /*G*/ 6, /*H*/ 6, /*I*/ 5, /*J*/ 7, /*K*/ 6, /*L*/ 6, /*M*/ 6, /*N*/ 6, /*O*/ 6, /*P*/ 6,
/*Q*/ 6, /*R*/ 6, /*S*/ 6, /*T*/ 6, /*U*/ 6, /*V*/ 6, /*W*/ 6, /*X*/ 6, /*Y*/ 6, /*Z*/ 6, /*[*/ 0, /*\\*/ 0, /*]*/ 0, /*^*/ 7, /*_*/ 0, /*`*/ 0,
/*a*/ 5, /*b*/ 5, /*c*/ 5, /*d*/ 5, /*e*/ 5, /*f*/ 5, /*g*/ 5, /*h*/ 5, /*i*/ 2, /*j*/ 6, /*k*/ 4, /*l*/ 2, /*m*/ 5, /*n*/ 5, /*o*/ 5, /*p*/ 5,
/*q*/ 5, /*r*/ 5, /*s*/ 5, /*t*/ 5, /*u*/ 5, /*v*/ 5, /*w*/ 5, /*x*/ 5, /*y*/ 5, /*z*/ 5, /*~*/ 6,
};
const u8 *const puppyprint_kerning_lut[2][80] = {
small_font_kerning_1, small_font_kerning_2
const u16 small_font_offsets_outline[] = {
/*!*/ 0, /*"*/ 8, /*#*/ 16, /*$*/ 24, /*%*/ 32, /*&*/ 40, /*'*/ 48, /*(*/ 56, /*)*/ 64, /***/ 72, /*+*/ 80, /*,*/ 88, /*-*/ 96, /*.*/ 104, /*/*/ 112,
/*0*/ 120, /*1*/ 128, /*2*/ 136, /*3*/ 144, /*4*/ 152, /*5*/ 160, /*6*/ 168, /*7*/ 176, /*8*/ 184, /*9*/ 192, /*:*/ 200, /*;*/ 208, /*<*/ 216, /*=*/ 216,
/*>*/ 0, /*?*/ 216, /*@*/ 0, /*A*/ 224, /*B*/ 232, /*C*/ 240, /*D*/ 248, /*E*/ 256, /*F*/ 264, /*G*/ 272, /*H*/ 280, /*I*/ 288, /*J*/ 296, /*K*/ 304,
/*L*/ 312, /*M*/ 320, /*N*/ 328, /*O*/ 336, /*P*/ 344, /*Q*/ 352, /*R*/ 360, /*S*/ 368, /*T*/ 376, /*U*/ 384, /*V*/ 392, /*W*/ 400, /*X*/ 408, /*Y*/ 416,
/*Z*/ 424, /*[*/ 432, /*\*/ 432, /*]*/ 432, /*^*/ 432, /*_*/ 440, /*`*/ 440, /*a*/ 440, /*b*/ 448, /*c*/ 456, /*d*/ 464, /*e*/ 472, /*f*/ 480, /*g*/ 488,
/*h*/ 496, /*i*/ 504, /*j*/ 512, /*k*/ 520, /*l*/ 528, /*m*/ 536, /*n*/ 544, /*o*/ 552, /*p*/ 560, /*q*/ 568, /*r*/ 576, /*s*/ 584, /*t*/ 592, /*u*/ 600,
/*v*/ 608, /*w*/ 616, /*x*/ 624, /*y*/ 632, /*z*/ 640, /*{*/ 648, /*|*/ 648, /*}*/ 648, /*~*/ 648, /*:)*/ 656
};
static const u8 small_font_kerning_plain[] = {
/*!*/ 5, /*"*/ 4, /*#*/ 0, /*$*/ 0, /*%*/ 6, /*&*/ 7, /*'*/ 2, /*(*/ 4, /*)*/ 4, /***/ 0, /*+*/ 6, /*,*/ 2, /*-*/ 6, /*.*/ 2, /*/*/ 6, /*0*/ 6,
/*1*/ 5, /*2*/ 5, /*3*/ 5, /*4*/ 5, /*5*/ 5, /*6*/ 5, /*7*/ 5, /*8*/ 5, /*9*/ 5, /*:*/ 3, /*;*/ 3, /*<*/ 0, /*=*/ 0, /*>*/ 0, /*?*/ 6, /*@*/ 0,
/*A*/ 6, /*B*/ 6, /*C*/ 6, /*D*/ 6, /*E*/ 6, /*F*/ 6, /*G*/ 6, /*H*/ 6, /*I*/ 4, /*J*/ 6, /*K*/ 6, /*L*/ 6, /*M*/ 7, /*N*/ 7, /*O*/ 6, /*P*/ 6,
/*Q*/ 6, /*R*/ 6, /*S*/ 6, /*T*/ 6, /*U*/ 6, /*V*/ 6, /*W*/ 7, /*X*/ 6, /*Y*/ 6, /*Z*/ 6, /*[*/ 0, /*\\*/ 0, /*]*/ 0, /*^*/ 7, /*_*/ 0, /*`*/ 0,
/*a*/ 6, /*b*/ 6, /*c*/ 6, /*d*/ 6, /*e*/ 6, /*f*/ 6, /*g*/ 6, /*h*/ 6, /*i*/ 3, /*j*/ 4, /*k*/ 6, /*l*/ 5, /*m*/ 7, /*n*/ 6, /*o*/ 6, /*p*/ 6,
/*q*/ 6, /*r*/ 6, /*s*/ 6, /*t*/ 6, /*u*/ 6, /*v*/ 6, /*w*/ 7, /*x*/ 6, /*y*/ 6, /*z*/ 6, /*~*/ 7,
};
const u16 small_font_offsets_plain[] = {
/*!*/ 0, /*"*/ 8, /*#*/ 16, /*$*/ 24, /*%*/ 32, /*&*/ 40, /*'*/ 48, /*(*/ 56, /*)*/ 64, /***/ 72, /*+*/ 80, /*,*/ 88, /*-*/ 96, /*.*/ 104, /*/*/ 112,
/*0*/ 120, /*1*/ 128, /*2*/ 136, /*3*/ 144, /*4*/ 152, /*5*/ 160, /*6*/ 168, /*7*/ 176, /*8*/ 184, /*9*/ 192, /*:*/ 200, /*;*/ 208, /*<*/ 216, /*=*/ 216,
/*>*/ 0, /*?*/ 216, /*@*/ 0, /*A*/ 224, /*B*/ 232, /*C*/ 240, /*D*/ 248, /*E*/ 256, /*F*/ 264, /*G*/ 272, /*H*/ 280, /*I*/ 288, /*J*/ 296, /*K*/ 304,
/*L*/ 312, /*M*/ 320, /*N*/ 328, /*O*/ 336, /*P*/ 344, /*Q*/ 352, /*R*/ 360, /*S*/ 368, /*T*/ 376, /*U*/ 384, /*V*/ 392, /*W*/ 400, /*X*/ 408, /*Y*/ 416,
/*Z*/ 424, /*[*/ 432, /*\*/ 432, /*]*/ 432, /*^*/ 432, /*_*/ 440, /*`*/ 440, /*a*/ 440, /*b*/ 448, /*c*/ 456, /*d*/ 464, /*e*/ 472, /*f*/ 480, /*g*/ 488,
/*h*/ 496, /*i*/ 504, /*j*/ 512, /*k*/ 520, /*l*/ 528, /*m*/ 536, /*n*/ 544, /*o*/ 552, /*p*/ 560, /*q*/ 568, /*r*/ 576, /*s*/ 584, /*t*/ 592, /*u*/ 600,
/*v*/ 608, /*w*/ 616, /*x*/ 624, /*y*/ 632, /*z*/ 640, /*{*/ 648, /*|*/ 648, /*}*/ 648, /*~*/ 648, /*:)*/ 656
};
static const u8 small_font_kerning_vanilla[] = {
/*!*/ 4, /*"*/ 4, /*#*/ 0, /*$*/ 0, /*%*/ 6, /*&*/ 7, /*'*/ 3, /*(*/ 4, /*)*/ 4, /***/ 0, /*+*/ 6, /*,*/ 2, /*-*/ 4, /*.*/ 3, /*/*/ 4, /*0*/ 5,
/*1*/ 5, /*2*/ 6, /*3*/ 6, /*4*/ 6, /*5*/ 6, /*6*/ 6, /*7*/ 6, /*8*/ 6, /*9*/ 6, /*:*/ 4, /*;*/ 4, /*<*/ 0, /*=*/ 0, /*>*/ 0, /*?*/ 5, /*@*/ 0,
/*A*/ 5, /*B*/ 5, /*C*/ 5, /*D*/ 5, /*E*/ 5, /*F*/ 5, /*G*/ 5, /*H*/ 5, /*I*/ 3, /*J*/ 5, /*K*/ 5, /*L*/ 5, /*M*/ 7, /*N*/ 7, /*O*/ 6, /*P*/ 5,
/*Q*/ 6, /*R*/ 5, /*S*/ 5, /*T*/ 5, /*U*/ 5, /*V*/ 5, /*W*/ 7, /*X*/ 6, /*Y*/ 5, /*Z*/ 5, /*[*/ 0, /*\\*/ 0, /*]*/ 0, /*^*/ 7, /*_*/ 0, /*`*/ 0,
/*a*/ 5, /*b*/ 4, /*c*/ 4, /*d*/ 4, /*e*/ 4, /*f*/ 5, /*g*/ 5, /*h*/ 4, /*i*/ 3, /*j*/ 4, /*k*/ 3, /*l*/ 2, /*m*/ 6, /*n*/ 4, /*o*/ 4, /*p*/ 4,
/*q*/ 5, /*r*/ 4, /*s*/ 4, /*t*/ 4, /*u*/ 4, /*v*/ 4, /*w*/ 7, /*x*/ 5, /*y*/ 4, /*z*/ 5, /*~*/ 6,
};
const u16 small_font_offsets_vanilla[] = {
/*!*/ 0, /*"*/ 8, /*#*/ 16, /*$*/ 24, /*%*/ 32, /*&*/ 40, /*'*/ 48, /*(*/ 56, /*)*/ 64, /***/ 72, /*+*/ 80, /*,*/ 88, /*-*/ 96, /*.*/ 104, /*/*/ 112,
/*0*/ 120, /*1*/ 128, /*2*/ 136, /*3*/ 144, /*4*/ 152, /*5*/ 160, /*6*/ 168, /*7*/ 176, /*8*/ 184, /*9*/ 192, /*:*/ 200, /*;*/ 208, /*<*/ 216, /*=*/ 216,
/*>*/ 0, /*?*/ 216, /*@*/ 0, /*A*/ 224, /*B*/ 232, /*C*/ 240, /*D*/ 248, /*E*/ 256, /*F*/ 264, /*G*/ 272, /*H*/ 280, /*I*/ 288, /*J*/ 296, /*K*/ 304,
/*L*/ 312, /*M*/ 320, /*N*/ 328, /*O*/ 336, /*P*/ 344, /*Q*/ 352, /*R*/ 360, /*S*/ 368, /*T*/ 376, /*U*/ 384, /*V*/ 392, /*W*/ 400, /*X*/ 408, /*Y*/ 416,
/*Z*/ 424, /*[*/ 432, /*\*/ 432, /*]*/ 432, /*^*/ 432, /*_*/ 440, /*`*/ 440, /*a*/ 440, /*b*/ 448, /*c*/ 456, /*d*/ 464, /*e*/ 472, /*f*/ 480, /*g*/ 488,
/*h*/ 496, /*i*/ 504, /*j*/ 512, /*k*/ 520, /*l*/ 528, /*m*/ 536, /*n*/ 544, /*o*/ 552, /*p*/ 560, /*q*/ 568, /*r*/ 576, /*s*/ 584, /*t*/ 592, /*u*/ 600,
/*v*/ 608, /*w*/ 616, /*x*/ 624, /*y*/ 632, /*z*/ 640, /*{*/ 648, /*|*/ 648, /*}*/ 648, /*~*/ 648, /*:)*/ 656
};
const struct PPTextFont sPPFont_default = {
small_font_default,
small_font_kerning_default,
small_font_offsets_default,
NULL,
G_IM_FMT_I, G_IM_SIZ_4b,
672, 12,
8, 12
};
const struct PPTextFont sPPFont_outline = {
small_font_outline,
small_font_kerning_outline,
small_font_offsets_outline,
NULL,
G_IM_FMT_IA, G_IM_SIZ_4b,
672, 12,
8, 12
};
const struct PPTextFont sPPFont_plain = {
small_font_plain,
small_font_kerning_plain,
small_font_offsets_plain,
NULL,
G_IM_FMT_I, G_IM_SIZ_4b,
672, 12,
8, 12
};
const struct PPTextFont sPPFont_vanilla = {
small_font_vanilla,
small_font_kerning_vanilla,
small_font_offsets_vanilla,
NULL,
G_IM_FMT_I, G_IM_SIZ_4b,
672, 12,
8, 12
};
const struct PPTextFont *const gPuppyPrintFontTable[] = {
&sPPFont_default, &sPPFont_outline, &sPPFont_plain, &sPPFont_vanilla
};
const Texture *const puppyprint_font_lut[] = {
small_font_default, small_font_outline, small_font_plain, small_font_vanilla
};
const u8 *const puppyprint_kerning_lut[][95] = {
small_font_kerning_default, small_font_kerning_outline, small_font_kerning_plain, small_font_kerning_vanilla
};
#endif
@@ -2216,6 +2328,23 @@ const Gfx dl_rgba16_text_end[] = {
gsSPEndDisplayList(),
};
const Gfx dl_shade_screen_begin[] = {
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_CLD_SURF, G_RM_CLD_SURF2),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetPrimColor(0, 0, 0, 0, 0, 127),
gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PRIMITIVE),
gsSPEndDisplayList(),
};
const Gfx dl_shade_screen_end[] = {
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),
gsDPSetPrimColor(0, 0, 255, 255, 255, 255),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsSPEndDisplayList(),
};
// 0x0200EDA8 - 0x0200EDE8
static const Vtx vertex_text_bg_box[] = {
{{{ 0, -80, 0}, 0, { 0, 0}, {0xff, 0xff, 0xff, 0xff}}},
@@ -2753,6 +2882,7 @@ const Gfx dl_waterbox_rgba16_begin[] = {
gsDPSetCombineMode(G_CC_MODULATERGBA, G_CC_MODULATERGBA),
gsSPClearGeometryMode(G_LIGHTING | G_CULL_BACK),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsSPClipRatio(FRUSTRATIO_1),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, (G_TX_WRAP | G_TX_NOMIRROR), 5, G_TX_NOLOD, (G_TX_WRAP | G_TX_NOMIRROR), 5, G_TX_NOLOD),
gsDPSetTileSize(0, 0, 0, ((32 - 1) << G_TEXTURE_IMAGE_FRAC), ((32 - 1) << G_TEXTURE_IMAGE_FRAC)),
@@ -2765,6 +2895,7 @@ const Gfx dl_waterbox_ia16_begin[] = {
gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA),
gsSPClearGeometryMode(G_LIGHTING | G_CULL_BACK),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsSPClipRatio(FRUSTRATIO_1),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_IA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, (G_TX_WRAP | G_TX_NOMIRROR), 5, G_TX_NOLOD, (G_TX_WRAP | G_TX_NOMIRROR), 5, G_TX_NOLOD),
gsDPSetTileSize(0, 0, 0, ((32 - 1) << G_TEXTURE_IMAGE_FRAC), ((32 - 1) << G_TEXTURE_IMAGE_FRAC)),
@@ -2774,6 +2905,7 @@ const Gfx dl_waterbox_ia16_begin[] = {
// 0x02014810 - 0x02014838
const Gfx dl_waterbox_end[] = {
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsSPClipRatio(FRUSTRATIO_2),
gsDPPipeSync(),
gsSPSetGeometryMode(G_LIGHTING | G_CULL_BACK),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),

View File

@@ -403,8 +403,8 @@ const BehaviorScript bhvStarDoor[] = {
SET_INT(oIntangibleTimer, 0),
BEGIN_LOOP(),
CALL_NATIVE(bhv_star_door_loop),
CALL_NATIVE(bhv_door_rendering_loop),
CALL_NATIVE(load_object_collision_model),
CALL_NATIVE(bhv_door_rendering_loop),
END_LOOP(),
};
@@ -1679,9 +1679,9 @@ const BehaviorScript bhvWfSolidTowerPlatform[] = {
BEGIN(OBJ_LIST_SURFACE),
OR_INT(oFlags, (OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
LOAD_COLLISION_DATA(wf_seg7_collision_platform),
CALL_NATIVE(load_object_static_model),
BEGIN_LOOP(),
CALL_NATIVE(bhv_wf_solid_tower_platform_loop),
CALL_NATIVE(load_object_collision_model),
END_LOOP(),
};
@@ -2626,6 +2626,7 @@ const BehaviorScript bhvExclamationBox[] = {
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
SET_FLOAT(oCollisionDistance, 300),
SET_HOME(),
CALL_NATIVE(bhv_init_room),
BEGIN_LOOP(),
CALL_NATIVE(bhv_exclamation_box_loop),
END_LOOP(),
@@ -3772,6 +3773,7 @@ const BehaviorScript bhvMessagePanel[] = {
DROP_TO_FLOOR(),
SET_HITBOX(/*Radius*/ 150, /*Height*/ 80),
SET_INT(oWoodenPostTotalMarioAngle, 0),
CALL_NATIVE(bhv_init_room),
CALL_NATIVE(load_object_static_model),
BEGIN_LOOP(),
SET_INT(oIntangibleTimer, 0),
@@ -4579,6 +4581,7 @@ const BehaviorScript bhvRedCoin[] = {
const BehaviorScript bhvBowserCourseRedCoinStar[] = {
BEGIN(OBJ_LIST_LEVEL),
OR_INT(oFlags, (OBJ_FLAG_PERSISTENT_RESPAWN | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
CALL_NATIVE(bhv_bowser_course_red_coin_star_init),
BEGIN_LOOP(),
CALL_NATIVE(bhv_bowser_course_red_coin_star_loop),
END_LOOP(),
@@ -4860,7 +4863,6 @@ const BehaviorScript bhvOrangeNumber[] = {
BEGIN(OBJ_LIST_LEVEL),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
BILLBOARD(),
SET_HOME(),
CALL_NATIVE(bhv_orange_number_init),
BEGIN_LOOP(),
CALL_NATIVE(bhv_orange_number_loop),
@@ -5600,6 +5602,7 @@ const BehaviorScript bhvActivatedBackAndForthPlatform[] = {
const BehaviorScript bhvRecoveryHeart[] = {
BEGIN(OBJ_LIST_LEVEL),
OR_INT(oFlags, (OBJ_FLAG_COMPUTE_ANGLE_TO_MARIO | OBJ_FLAG_COMPUTE_DIST_TO_MARIO | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
CALL_NATIVE(bhv_init_room),
BEGIN_LOOP(),
CALL_NATIVE(bhv_recovery_heart_loop),
END_LOOP(),

View File

@@ -0,0 +1,29 @@
#include "game/puppycam2.h"
///This is the bit that defines where the angles happen. They're basically environment boxes that dictate camera behaviour.
///Permaswap is a boolean that simply determines wether or not when the camera changes at this point it stays changed. 0 means it resets when you leave, and 1 means it stays changed.
///The camera position fields accept "32767" as an ignore flag.
///The script supports anything that does not take an argument. It's reccomended to keep the scripts in puppycam_scripts.inc.c for the sake of cleanliness.
///If you do not wish to use a script in the angle, then just leave the field as 0.
// #define PUPPYCAM_SAMPLES
struct newcam_hardpos newcam_fixedcam[] =
{
#ifdef PUPPYCAM_SAMPLES
// Example Scripts
{/*Level ID*/ 16,/*Area ID*/ 1,/*Permaswap*/ 0,/*Mode*/ NC_MODE_FIXED_NOMOVE,/*Script*/ 0, //Standard params.
/*X begin*/ -540,/*Y begin*/ 800,/*Z begin*/ -3500, //Where the activation box begins
/*X end*/ 540,/*Y end*/ 2000,/*Z end*/ -1500, //Where the activation box ends.
/*Cam X*/ 0,/*Cam Y*/ 1500,/*Cam Z*/ -1000, //The position the camera gets placed for NC_MODE_FIXED and NC_MODE_FIXED_NOMOVE
/*Look X*/ 0,/*Look Y*/ 800,/*Look Z*/ -2500}, //The position the camera looks at for NC_MODE_FIXED_NOMOVE
///Another example angle. This activates a script that slowly rotates the camera around the area.
{/*Level ID*/ 16,/*Area ID*/ 1,/*Permaswap*/ 0,/*Mode*/ NC_MODE_NOROTATE,/*Script*/ 0, //Standard params.
/*X begin*/ 5716,/*Y begin*/ 400,/*Z begin*/ -859, //Where the activation box begins
/*X end*/ 6908,/*Y end*/ 1000,/*Z end*/ 62, //Where the activation box ends.
/*Cam X*/ 32767,/*Cam Y*/ 32767,/*Cam Z*/ 32767, //The position the camera gets placed for NC_MODE_FIXED and NC_MODE_FIXED_NOMOVE
/*Look X*/ 32767,/*Look Y*/ 32767,/*Look Z*/ 32767}, //The position the camera looks at for NC_MODE_FIXED_NOMOVE
#endif
};

View File

@@ -14,6 +14,22 @@
*/
// #define JP_RED_COIN_SOUND
/**
* In vanilla, Mario's sounds are pitch shifted in real time in order to maintain a sense of consistency. This can be annoying when replacing Mario's sounds.
* This define will disable this behavior, making sound replacements easier to manage. Use of this is not recommended unless you're actually replacing Mario's sounds.
* When toggling this define, you will need to run `make clean` for it to apply.
*/
// #define DISABLE_MARIO_PITCH_SHIFTING
/**
* Enables the additional spacial processing that takes place with sound effects in vanilla.
* SM64's implementation of this isn't the best, which causes some sounds like the waterfall in castle grounds to sound more unpleasant than necessary.
* This is not the same thing as enabling stereo audio, but it does represent the sole differences between the Stereo and Headset sound options.
* Because of this, the Headset sound option will also not appear in the file select menu with this disabled.
* Leaving this disabled may also be slightly beneficial for CPU performance.
*/
// #define ENABLE_STEREO_HEADSET_EFFECTS
/**
* Increase audio heap size to allow for larger/more custom sequences/banks/sfx to be imported without causing issues (not supported for SH).
* Note that this is REQUIRED in order to use the extended 0C audio bank. Do not disable this if you're planning on using it.
@@ -31,6 +47,6 @@
/**
* Uses a 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.
* Reverb parameters can be configured in audio/synthesis.c to meet desired aesthetic/performance needs. Currently US/JP only. Hurts emulator and console performance.
* Reverb presets can be configured in audio/data.c to meet desired aesthetic/performance needs. More detailed usage info can also be found on the HackerSM64 Wiki page.
*/
// #define BETTER_REVERB

View File

@@ -17,6 +17,7 @@
/**
* Allows all surfaces types to have force, (doesn't require setting force, just allows it to be optional).
* Also allows you to pass a warp node to warp floors (SURFACE_WARP, SURFACE_DEATH_PLANE, SURFACE_VERTICAL_WIND) via the second byte of the force parameter.
*/
#define ALL_SURFACES_HAVE_FORCE

View File

@@ -12,11 +12,11 @@
/**
* Disables all debug options (except PUPPYPRINT).
*/
#define DISABLE_ALL
// #define DISABLE_ALL
/**
* Enables a comprehensive standalone profiler. Automatically enabled by PUPPYPRINT_DEBUG.
* If not using PUPPYPRINT_DEBUG, press L to toggle the profiler.
* If not using PUPPYPRINT_DEBUG, press L + D-Pad Up to toggle the profiler.
*/
#define USE_PROFILER
@@ -41,7 +41,7 @@
/**
* Enables a custom, enhanced performance profiler. (Enables PUPPYPRINT by default in config_safeguards).
*/
// #define PUPPYPRINT_DEBUG 1
// #define PUPPYPRINT_DEBUG
/**
* Uses cycles instead of microseconds in Puppyprint debug output.

View File

@@ -6,7 +6,6 @@
/**
* Enables some mechanics that change behavior depending on hardcoded level numbers.
* You may also need to change sLevelsWithRooms in object_helpers.c.
* TODO: separate this into separate defines, behavior params, or make these mechanics otherwise dynamic.
*/
// #define ENABLE_VANILLA_LEVEL_SPECIFIC_CHECKS

View File

@@ -123,11 +123,6 @@
*/
// #define FIX_REFLECT_MTX
/**
* This improves performance a bit, and does not seem to break anything.
*/
#define DISABLE_GRAPH_NODE_TYPE_FUNCTIONAL
/**
* Disables all object shadows. You'll probably only want this either as a last resort for performance or if you're making a super stylized hack.
*/
@@ -138,3 +133,20 @@
* NOTE: When this is enabled, The 49th hardcoded rectangle shadow will act as a regular circular shadow, due to Mario's shadow ID being 99 in vanilla.
*/
#define LEGACY_SHADOW_IDS
/**
* Limits the horizontal fov on emulator like on console. May break viewport widescreen hacks.
*/
//#define HORIZONTAL_CULLING_ON_EMULATOR
/**
* Makes objects bellow the screen be culled.
*/
#define VERTICAL_CULLING
/**
* If the first command of an object´s geolayout is not GEO_CULLING_RADIUS, DEFAULT_CULLING_RADIUS
* will be used instead.
*/
#define DEFAULT_CULLING_RADIUS 300

View File

@@ -17,7 +17,13 @@
#define EXIT_COURSE_WHILE_MOVING
/**
* Decides which level, area and warp ID the "Exit Course" option takes you to (has no effect if you disable Exit Course).
* Decides whether to treat exiting course as if the player had died.
* If enabled, the player will get warped to the failure warp node when selecting EXIT COURSE. (Has no effect if you disable Exit Course)
*/
// #define DEATH_ON_EXIT_COURSE
/**
* Decides which level, area and warp ID the "Exit Course" option takes you to (has no effect if you disable Exit Course or enable DEATH_ON_EXIT_COURSE).
* Ensure that the warp exists, or else the game will crash.
*/
#define EXIT_COURSE_LEVEL LEVEL_CASTLE

View File

@@ -108,20 +108,15 @@
*/
#define HANGING_FIX
/**
* The last frame after hitting a wall that will be considered a firsty when wallkicking.
*/
#define FIRSTY_LAST_FRAME 1
/**
* The maximum angle the player can wall kick, in degrees. 0..90. To allow 45 degree wall kicks, you must supply `46` to allow 45 and under.
*/
#define WALL_KICK_DEGREES 45
/**
* This is vanilla behavior, disable it to allow ledge grabbing regardless of floor pitch.
* Makes Mario unable to ledge grab steep slopes to prevent false ledge grabs.
*/
// #define LEDGE_GRABS_CHECK_SLOPE_ANGLE
#define DONT_LEDGE_GRAB_STEEP_SLOPES
/**
* Disables BLJs and crushes SimpleFlips's dreams.

View File

@@ -28,3 +28,21 @@
*/
#define BORDER_HEIGHT_CONSOLE 0
#define BORDER_HEIGHT_EMULATOR 0
/**
* Force the game to delete any existing save data originating from a different hack. This requires INTERNAL_ROM_NAME to be unique to work properly.
* It is recommended to enable this if any significant changes to the save file are made that could cause issues with this or other hacks.
* NOTE: Using save editors with this define will likely just end up wiping your save, since SM64 specific save editors most likely use hardcoded save magic.
*/
// #define UNIQUE_SAVE_DATA
/**
* Informs supported emulators to default to gamecube controller inputs.
*/
// #define USE_GAMECUBE_CONTROLLER
/**
* RCVI hack. Increases performance on emulator, and does nothing on console.
* Might break on some emulators. Use at your own risk, and don't use it unless you actually need the extra performance.
*/
// #define RCVI_HACK

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