kabili207 / zora-sharp

A decoder for the password system used in the Legend of Zelda Oracle of Ages and Oracle of Seasons games.
GNU Lesser General Public License v3.0
48 stars 22 forks source link

Memory Secret Load #16

Closed alexbramham closed 2 years ago

alexbramham commented 3 years ago

Hello, thanks for following my repo. I noticed in your MemorySecret.cs load function you loop through all 4 combinations to find a match (and commented "it's ugly but it works"). I believe IsReturnSecret should always be true for a 1 bit immediately after the memory ID, as decodedSecret[24] in your code. The TargetGame can then be deduced from that and the following bit. I found that the target game could be either Seasons or Ages depending on which game was started. The other pair are the hero secret, so in my own code I xor against the initial game in the sequence of 4 to derive the memory event names in the GUI.

I've done some work on conversion code here, which you might be able to adapt and hopefully our secrets should match.

https://bitbucket.org/alexbramham/zelda-oracles-api/src/master/src/main/kotlin/zelda/oracles/parser/MemorySecretParser.kt

If you have a moment, could you try the Java editor I put together? There's a download link here, only tested on Mac but should display with icons on the tabs and automatically repopulate the secrets when one is entered on the furthest tab or values changed in the first one. I've tested a lot of secret combinations and had success with them so far. (There were quite a few mistakes in the old Java implementation I hacked together). Do you have any suggestions? Thanks!

https://bitbucket.org/alexbramham/zelda-oracles-api/downloads/zelda-oracles.jar

kabili207 commented 3 years ago

I found @Catobat's fork in which he found the same thing, so I went and merged that in. I'll have a look over your stuff and see if there's anything I can suggest or take inspiration from.

alexbramham commented 3 years ago

Nice. The main difference in the data model I went with was a struct for the set of variables common to all game secrets across a sequence (normal -> linked -> hero -> hero linked), which I called Adventure. Each Game Secret is then one of those and the two flags indicating which position in the sequence (linked, hero). The GUI screen then only needs to know about the Adventure values and the 4 Game Secrets are derived from that into each of the tabs alongside the matching Memory Secrets. It made refreshing the icons and labels on each of the tabs more concise too.

If you try the link again, I added some tooltips and icons for the reward items of each memory secret. The secrets are monospaced font now, a bit easier to read and separates them from the other screen text nicer.

Catobat commented 3 years ago

I found @Catobat's fork in which he found the same thing, so I went and merged that in. I'll have a look over your stuff and see if there's anything I can suggest or take inspiration from.

Glad you found that, that was always intended as a pull request. Must have forgotten about it, oops.