Apologies in advance for a bit of a long post here.
Quite a long time ago I was playing around with the glasses glitch with the intent of doing a speedrun -- I thought that I could jump to the end of the game using the inventory overflow. Much to my surprise, I succeeded! It was really a stroke of pure luck that I found this by pure experimentation, without tools, and before I gave up. However, the lack of tools made me unable to reproduce it, so I abandoned it for a while.
SGDQ pushed me to get into TASing for the first time, and after a week and a half or so of work, I'm happy to present a working example of this skip. I've uploaded the movie
here, and I made an encode
here.
Forgive the disgustingly unoptimized menus/everything throughout.
Essentially what I do is set address 04E5 (page 2, slot 3 of EI) to value $D2, by taking the horseshoe and nothing else from the lab. By USE-ing $D2 from the wraith room, it jumps straight to the end event where you defeat the behemoth. Just as Randil predicted, it's an improvement about understanding the unknown codes in EI better and how the game handles them.
I haven't taken a lot of time to really understand why this works, but my suspicion is that it works like so:
- USE routine does a calculation that directly involves the item and room values to figure out what address to jump to for the resulting actions (by "directly involved" I mean that the value is explicitly used, such as in a jump table, rather than an explicit case-by-case check).
- By giving the routine calculating the address a value different than any expected item, the resulting address jumps into random memory. (As noted by Randil before, jumping to random memory is pretty unstable and usually useless. For most values, this ends in graphical glitchs, hangs/freezes, opening text repeatedly, infinite chains of events that don't end, etc. I assume this is because it jumps into data display routines without commands to check/end/return.)
- In this case, $D2 from the wraith room is the exact (or near-exact) value needed
to successfully jump to the ending trigger in memory.
After looking through HHS' dumps (which are extremely helpful, thank you for those), it seems like the address that triggers the ending is A90E, though skipping to A909, A90B, or somewhere in that range may result in the ending event as well.
This movie is meant to just be a proof of concept -- after taking the time to read this thread and watch the current submission, I see that my menus are incredibly lacking! I was completely unaware you could do default actions with no action selected, move the cursor diagonally, or wrap the cursor to the top from the bottom. I also had no idea some rooms didn't decrease the torch counters -- I had those values watched but didn't pay much attention to them. The book room in particular is important! Many thanks to everyone who helped in this thread and Randil for his previous TASes. Had no idea this game was getting so much love!
I hope to re-do and submit this movie using the previously found optimizations/tricks and potentially input, but I think there's the possibility of an even faster setup here -- some value to use to jump from the library area would be ideal. After redoing the movie, next step for me would probably be looking at the action subroutines in depth. All comments and any possible improvements are very welcome!