News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

Keeping gates open

Started by Boostguardian, April 24, 2013, 06:19:39 AM

Previous topic - Next topic

Boostguardian

Hello community!

I've been doing a little bit more work on my hack and decided to try and implement a technique I recall being used successfully in Redesign (although it's been a while since I played it).

In the hack I seem to recall gates (red/green/blue etc.) staying open even when you left the room you had opened them in, which allowed you to set up 'long cuts' that were shortened as you progressed through the game. I did a fairly thorough search for the past day or so across this forum and the wiki/main site and found mention of how this was done in the 'Hyper Metroid' development thread, but the advice was on the vague side and I didn't really understand it.

The only reply to this same question stated that you need to use the 'opened door bit array' and use the bits that are set when the gate opens and closes. I'm guessing that this array is stored somewhere in the banks and can be filled in using a hex editor and pointed to using the high and low values of the gate PLM, but I'm unsure of where these banks are located and how to store/input the data telling the game that the gate is opened/closed.

There is always the chance that I've completely misunderstood this reply I read and I could be way off, but any solutions or pointers (hah!) in the right direction would be great.

Thanks in advance to any helpers, everyone was very helpful last time I had a query  :grin:!

Metaquarius

Did you know that asking for Redesign stuff is illegal ? :heheh:

Zhs2

#2
IIRC this has something to do with a bit being saved into SRAM, which the gate checks upon reloading to see whether or not it should be open. As for setting it up, this may require a few routines added to the gates themselves because I'm not sure if the regular gates have save-checking routines. Apologies that I can't be more helpful than generalizing it, since we don't seem to have a document on the subject.

Quote from: Metaquarius
Did you know that asking for Redesign stuff is illegal ? :heheh:
Maybe if you wanted to steal the graphics or hack the hack, but even then at best everybody'd just be mad at you.

Boostguardian

I can understand the 'don't ask for redesign' thing, seems like a lot of hacks try to rip it off nowadays (can't really blame them - it was pretty amazing).

Thanks for the advice Zhs2, I'll see if I can dig up some info on working with SRAM (so far I've mostly just been doing basic hex editing so far - most ASM I simply borrowed from the available resources.

If anyone knows about the 'open door bit array' that would also help, as it might allow me to experiment with it a bit.

Crashtour99

Quote from: Zhs2 on April 24, 2013, 05:29:28 PM
IIRC this has something to do with a bit being saved into SRAM, which the gate checks upon reloading to see whether or not it should be open. As for setting it up, this may require a few routines added to the gates themselves because I'm not sure if the regular gates have save-checking routines. Apologies that I can't be more helpful than generalizing it, since we don't seem to have a document on the subject.
Basically this.  Upon room loading the PLM will check bits in the "open door bit array" (based on PLM index) which determines if the gate should be open or closed (like door PLMs will check the same array to determine if a door cap should spawn or not).  You could just as easily have it check event bits or something else.  The open door bit array is basically a block of space in RAM, so there is no editing via Hex (unless you use a debugger like Geigers). 

This isn't in the vanilla ROM, so it's custom code.  If you plan on implementing this I suggest tackling simpler stuff in learning ASM first.

Quote
Quote from: Metaquarius
Did you know that asking for Redesign stuff is illegal ? :heheh:
Maybe if you wanted to steal the graphics or hack then hack, but even then at best everybody'd just be mad at you.
Well, Drew and Kej have said in the past that if you can understand it well enough to create it on your own then you're free to use it.  However just plucking it out of a Redesign ROM is generally frowned upon.  I asked Drew beforehand when I put shinespark recharging on slopes in my hack.  I already had a basic understanding of how to do it, but I glanced at the code from Redesign and Super Zero Mission just to check if I missed anything important (which I did coincidentally lol).  It mainly depends on how much effort you're willing to put forth in your own hacking and coding I think.  Stealing?  No bueno.  Learning from others code?  Unoriginal, but still ok.   :wink:

Boostguardian

OK, looks like I've got some reading to do! Thanks for the help guys  :^_^: