Well, I haven't worked on the editor today except for warp saving fixes, but I have found quite a few pieces of data.
For starts, let me introduce a new feature, patching. Basically, the editor will have a menu with categories of patches and things to add or remove. This is to basically decrease the knowledge needed to remove some of the annoying things that would kill hacking. Most of these patches (all so far) just change one byte. There will be no way to revert them back to normal.
So far, patching includes removing the random forest maps (That annoying game) and all possibilities of it. There is also one to change the map the gate to the Maku Tree is (However I will go on further about this). There will be many map patches, such as changing the animal and volcano town maps, but right now there are only two.
In other news, I've cracked how the Gale Seed Warping works. Actually, it's extremely efficient and just screams "HACK ME!". There are three straight-forward bytes per spot (Although the third one seems kind of useless), and room for about 3 or 4 extra warps at the end of the data (I've tested this and we can easily add or remove them).
The only thing I worry about is area editing, such as editing what makes the minimap say Cresent Island is Cresent Island, and there's a Scent Seed Tree there. I've found other unimportant things, such as the cursor offset, sprite, and palette, but I doubt anyone would care to edit those.
Back on the topic of patches, I want to get into the map changing, or what they're really called, map scripts (Like how the Maku Gate stays forever removed after being opened. This is, of course done by a flag somewhere in the 0xC000 bank, but I mean the other part of it). The way they're done is kind of similar to how interaction script locations are calculated. The CPO (Common pointer operation, which is where you have a base address, add the map group * 2, and calculate the pointer there) is done to address 0x124A7. The date here is in pairs of two. The game reads the first byte as the map. If the byte matches the map you're going in to (Like 48 if you're heading up from the Ring Shop), the next byte (Always read but only matters if the Z flag is set) is a reference to the next procedure (I'm going to call these scripts from now on).
The new script is calculated by taking the script reference byte and multiplying it by 2, adding it to 0x012437, and calculating the pointer there using bank 4.
For example purposes, the generated script address takes us to 0x12673. The only thing done here is a global flag check. The flag it checks is bit 2 of 0xC6D2, which is set if the Maku Gate has been opened. If you're wondering, here's how to find the address of the flag and the bit number. Basically, the upper 5 bits are the value to be added to the memory address and the lower 3 are the value added to 0x0000F8 to be read as the bit AND value.
Calculating Address Flag and Bit Number [C# Syntax]
byte value = 0x12; //This is the one used in the Maku Gate check
byte b = (byte)(((value & 0xF8) >> 3)); //0x2
int memoryAddress = 0xC6D0 + b; //C6D2
b = (byte)(value & 0x07); //2 byte
bit = ROMData[0xF8 + b]; //ROMData being the file buffer
Calculating Address Flag and Bit Checking Value [C# Syntax]
byte value;
int dMemoryAddress = 0xC6D2; //Let's make this as easy as possible
byte dBit = 0x2; //The bit to check
byte b = (byte)(dMemoryAddress - 0xC6D0);
byte final = (byte)((b << 3));
Not too bad, but they probably could've saved more space using two bytes instead of one and not performing the procedure. But anyway, that's how those map-specific entry events work. Pretty handy-dandy if you ask me, and it only makes hacking these games better. See you tomorrow!
Subscribe to:
Post Comments (Atom)
Another thing you migh want to take a look at is at 1232E. There are pointers to special data for all 7 regions(yes all 7 are used). It leads to special data that will take a spot on a map and change it to a specific tile if the flag conditions are met. For example, in level 3 in the room before the boss, there are two pushable blocks. One of them is only operable once the two Moldorms have been dispatched and makes a key fall. A lesser known block is to the left, and is pushable from the side with the boss door. Pushing it will make a specific interaction trigger and set the room flag to 80. Then this special data looks up that flag and makes two tiles appear, so the block won't need to be pushed again.
ReplyDeleteFurthermore, location CCDD in ram is related to the switchhook. When you hook onto an object, 01 is put in ram. When you do the switching over, it becomes 02. How it relates to doors is that if you place a pot or other object where a door is supposed to close(like for a toggle switch), and you switchhook into that spot, the door will close and you will get hurt and send you to where you entered the room(like a pit). If you spawn on the same tile, you just get pushed and hurt instead.
ReplyDeleteMany thanks for the map tile setting. I found the procedure for it and it's just a matter of time before I find out some stuff about it. I honestly can't wait to see the hacks you make (If you do make any), because it's like you know every piece of data in the ROM and everything I'm finding I'm sure you've found out ages ago.
ReplyDeleteSo that's the reason I couldn't find anything about CCDD, because I did such slim testing. Thanks though, although I doubt it will be of any use to me.