282 Commits

Author SHA1 Message Date
Léo Lam
dcb583cd41 Use a release folder structure that is less error prone for users
...especially users who don't follow instructions very carefully.

Closes #138
v1.5.9-1
2022-01-02 23:35:00 +01:00
Léo Lam
e099fcc09a Fix swapping arrows while targeting
Fixes #184.

Note that MM3D does not let you switch from one magic arrow type to
another; that is not a Project Restoration bug and we currently make
no attempt to fix that.
v1.5.9
2022-01-02 15:04:57 +01:00
Léo Lam
0930f3f761 Fix unsafe player access in UpdatePadState
We should *not* access the global context or the player actor manually
in UpdatePadState because neither are guaranteed to still exist in
memory when that function is called.

Fixes random crashes if ZR is held during a transition (transitions
usually involve destructing the current game state and then
reinitialising again -- the global context may be reallocated at a
different location). Closes #146.
2022-01-02 13:02:15 +01:00
Léo Lam
f462a567f8 Fix missing action usability checks for quick transform
Fixes #185
2022-01-02 11:52:32 +01:00
Léo Lam
514b56e462 Fix build issue 2022-01-02 02:15:46 +01:00
Léo Lam
ae766327e2 game: Fix types for some player fields 2022-01-02 00:54:22 +01:00
Léo Lam
c36b3b5bad Fix softlock when hitting owl statue after playing ocarina
Clearing the player's pending cutscene ID is normally done by z_player
before it calls the talk function, but we *must* do it manually before
talking to the owl statue because we are calling the talk function
directly without going through z_player.

Failure to clear the pending cutscene ID can have catastrophic results
because the owl actor triggers a cutscene; we get a nasty deadlock if
the player code also attempts to trigger a cutscene.

The easiest way to trigger this issue was to play the ocarina and then
immediately strike an inactive owl statue.

Fixes #167
2022-01-02 00:53:26 +01:00
Léo Lam
e978976da6 Silence -Winvalid-offsetof warnings
We don't care about those
2021-08-11 01:55:25 +02:00
Léo Lam
16674e7528 Merge pull request #194 from Bsquo/master
Use console sound setting patch added.
2021-08-06 16:23:33 +02:00
Bsquo
8b4e408ad5 Use console sound setting patch added. 2021-08-06 15:19:11 +01:00
Léo Lam
27c58bb162 Merge pull request #190 from PhlexPlexico/offsetof-fix
OffsetOf Fixes
2021-08-04 20:21:35 +02:00
PhlexPlexico
c73fa85739 Remove rst::Util::OffsetOf as latest builds no longer compile.
Warnings everywhere! But it builds at least.
2021-08-04 11:50:24 -06:00
PhlexPlexico
c28f699dd7 Implement ISG (#188)
I saw this feature being asked for by a few people. Since it shouldn't directly interfere with gameplay, unless specifically activated (pickup item while shielding and swinging). I've checked both on patched and non-patched versions of the game to see if this implementation works, and they both had the same expected behaviour (8 slashes with kokiri sword to kill Gibdos). It appears that this implementation should not impact any regular game play.
2021-07-20 15:58:44 +02:00
PhlexPlexico
2da76667b1 Update Common Data (#187) 2021-07-08 21:09:01 +02:00
Léo Lam
b8e5674352 game: Update player struct to add PlayerUtils 2021-03-13 23:22:18 +01:00
Léo Lam
20619081b7 game: Add memory allocator structures 2021-03-13 22:57:08 +01:00
PhlexPlexico
db14fcb5fb Update more structs in player.h and common_data.h (#176)
* Update common_data.h and main.cpp

Some more decomp'd things like the RespawnData.

Increased assert size due to the fact that sub13s[8]  contains respawn data.

Created RespawnData struct.

Found some BitFields that indicate counters for items.

Found bitfiled for sword and shield.

Include enums for sword and shield.

* Keep naming convention.

* Remove extra value in sub13s.

Update raw to u32.

Collect Register didn't change in main?

* Remove old BitField.

* Update inventory registers.

* Include more common_data changes.

Include player changes.
2021-03-04 21:04:24 +01:00
PhlexPlexico
5018d631df Update common_data.h and main.cpp (#174)
* Update common_data.h and main.cpp

Some more decomp'd things like the RespawnData.

Increased assert size due to the fact that sub13s[8]  contains respawn data.

Created RespawnData struct.

Found some BitFields that indicate counters for items.

Found bitfiled for sword and shield.

Include enums for sword and shield.

* Keep naming convention.

* Remove extra value in sub13s.

Update raw to u32.

Collect Register didn't change in main?

* Remove old BitField.
2021-02-25 00:00:23 +01:00
Léo Lam
eca4eb3559 Merge pull request #173 from PhlexPlexico/master
Update field definitions in player.h and actor.h
2021-02-19 20:46:54 +01:00
PhlexPlexico
1cc6a38539 Update boss lines to ztarget_pos 2021-02-19 13:08:52 -06:00
user.email
ea03fa22e7 New field definitions in player.h and actor.h.
Some have a few explanations as to what they really mean as well.
2021-02-19 09:05:47 -06:00
Léo Lam
fbd85ca960 game: Fix GlobalContext pause flag definition 2020-05-09 23:42:46 +02:00
Léo Lam
25fb7b3e8e Remove more extern "C" 2020-05-09 18:11:45 +02:00
Léo Lam
9ccf060f29 rst: Move custom message logic out of game/ 2020-05-09 17:47:39 +02:00
Léo Lam
b19745922e rst: Move custom camera logic out of game/ 2020-05-09 17:43:41 +02:00
Léo Lam
b3b57dacc0 build: Export compile commands
For IDEs
2020-05-09 17:20:46 +02:00
Léo Lam
181ecbf6e8 Split hooks
Makes it easier to find hooks and maintain the hook list
2020-05-09 16:00:20 +02:00
Léo Lam
84f3a4818d Remove version utilities
rst only targets v100 now that patches are provided to downgrade all
other versions to v100
2020-05-09 15:44:16 +02:00
Léo Lam
2e7bfe43d5 Remove unneeded function trampolines or wrappers 2020-05-09 15:22:29 +02:00
Léo Lam
47eddca926 Disable darkness effect when spawning elegy statue
The spawning cutscene is always skipped now, so it doesn't make much
sense to keep the darkness effect.
2020-05-05 19:31:15 +02:00
Léo Lam
5972af26fb Tweak Stone Tower block speed and cutscene
Now that it is impossible to step off floor switches too early and
accidentally trigger block cutscenes in Stone Tower, the block speed
can be slightly decreased (but let's still make it faster than the
default speed).

Also add a slight delay before the block starts moving to make the
cutscene less dizzying. (Thanks to Locke from Zelda Dungeon for
the idea!)
2020-05-05 00:01:05 +02:00
Léo Lam
adeaf1e86f actors: Add ObjStoneTowerBlock 2020-05-04 23:35:57 +02:00
Léo Lam
91149f5dfa Tweak the elegy statue spawning state to improve usability
* Spawn the statue as soon as possible.
* Give control to the player only after the statue is at the right
  position to help prevent floor switches from resetting.

This replaces the previous "elegy statue cutscene skip" patch.
2020-04-30 18:07:00 +02:00
Léo Lam
d82730564b actors: Add ObjElegyStatue 2020-04-30 01:36:31 +02:00
Léo Lam
522626f267 game: Update actor struct 2020-04-30 01:36:31 +02:00
Léo Lam
cd70322380 Reimplement PlayerStateSpawningElegyStatue
Unused for now.
2020-04-29 18:48:59 +02:00
Léo Lam
ac45fa5124 game/ui: Fix CheckCurrentScreen check
This changes ui::CheckCurrentScreen to also check that the screen is
not closing, which fixes a softlock in the Bomber's Notebook if
the map is opened while the screen is closing.

Closes #129
v1.5.8
2020-04-25 13:39:49 +02:00
Léo Lam
fe301d4efb Fix a possible softlock after Gyorg's inhale attack
This forces the FreezeLink flag to be cleared after an inhale attack
has ended because a very rare bug causes Link to be frozen after
the attack, even though a state handler change is already supposed
to clear the flag.
v1.5.7
2020-04-25 00:15:14 +02:00
Léo Lam
81ff5807d8 Fix a softlock when inhaled by Gyorg and dying simultaneously
Fixes a possible softlock when dying while being inhaled by Gyorg.

Prior to this fix, the game would softlock because that sequence of
actions causes Link to exit the "held (by Gyorg or Majora's whips)"
state and eventually enter (and stay in) the frozen state after
the fairy revival cutscene.
2020-04-25 00:15:14 +02:00
Léo Lam
83a5f8f0a5 game: Update structs and enums 2020-04-25 00:15:14 +02:00
Léo Lam
ea6188fc69 game/ui: Update MessageWindow 2020-04-07 12:12:24 +02:00
Léo Lam
f3f5ad6017 Fix the "has ocarina" check for the D-Pad
Turns out Grezzo doesn't set the icon to 0xFF (None) if the player
doesn't have the ocarina as I remembered... Instead they are simply
hiding the icon widget.

But there is a much better way of checking whether the player has
the ocarina: just check the inventory...
v1.5.6-1
2020-04-05 22:04:29 +02:00
Léo Lam
a72bdd8536 Skip the Elegy of Emptiness statue spawn cutscene
Natural followup to 71ab8eb.

Fixes #123
v1.5.6
2020-04-05 16:18:45 +02:00
Léo Lam
714d724df9 game/ui: Allow using custom min/max with AddOpacity 2020-04-05 11:37:33 +02:00
Léo Lam
be4c268ff3 game: Re-implement simplified, approximative CanUseItem
Calling the global context "update usable buttons" function to
determine whether an item is usable is unsafe because of side effects
and might result in item usability being updated too often
(which patches the Restricted Items glitch).
2020-04-04 22:28:37 +02:00
Léo Lam
7ec3e6ed12 game: Add scene enum 2020-04-04 17:08:35 +02:00
Léo Lam
5bb58b4ec8 game/ui: Update PlayHud 2020-04-03 17:04:37 +02:00
Léo Lam
3daab0d7ae Allow activating schedule menu buttons with physical buttons
Issue #63
2020-04-03 16:15:05 +02:00
Léo Lam
4dc194dc0b game/ui: Add ScheduleScreen header 2020-04-03 15:10:34 +02:00
Léo Lam
af36e6e1a5 game/ui: Add touch handler stuff 2020-04-03 15:10:34 +02:00