» Tutorials » Fancy Knowledge #6 - Inserting The Ruins Of Alph Puzzle

Fancy Knowledge #6 - Inserting The Ruins Of Alph Puzzle

Some people will surely remember my christmas present 2008 which was a standalone ROM in which you could solve the puzzlegame that you all know from GSC. While it was nice to have this minigame in a seperate ROM, I was wondering if it would be possible to integrate it in a working hack? The answer: Yes, it is. But it took me quite a long time and I nearly would had given up if I hadn't been pushed back to work by some awesome people.

First, you need the executable with removed ROM header. You can get it here:

Next thing to do is to look for 16.204 free bytes in the ROM. It's very important that the adress where you want to insert the binary ends with 0000 (that means the adress has to be a multiple of 65536). For example you could use the offset $EC0000.

Once you found your desired location, replace all the occurences of the bytestring "0x4D 0x58" by the first two bytes of the pointer to your location. For me, I had to replace all "0x4D 0x58"s by "0xEC 0x08"s (Because the pointer to $EC0000 is 0x08EC0000). The bytestring "0x4D 0x58" appears 29 times in the binary. (Note: I definitely DON'T want you to replace every single 0x4D or 0x58 byte okay? Just the combination of 0x4D followed by 0x58)

If you have come so far, you can just call the main()-function by using

executeasm (location+0x0BA9)

in a normal script. I would use executeasm 0x08EC0BA9

Okay, now let's care about the LASTRESULT support. If you're using Fire Red US, then we're fine and we don't need to change anything. Otherwise you need to know the offset of LASTRESULT and replace the pointer at $DE8.
LASTRESULT controls which of the 4 puzzles will be shown. Set vat 0x800D to 00, 01, 02 or 03 in front of the ASM call to get them all. Afterwards the script execution will go on and LASTRESULT will hold 0x01 if the puzzle was solved or 0x00 if the player pressed B to return to the main game.

The graphics are compressed with LZ so use unLZ if you wish to change them. The first important data you might want to change is the "win situation" which is located at $3E98. There are 6 columns and 5 rows to place the tiles so we got 30 fields which are defined by 30 bytes. 0 means "this field has to be empty in case of win" and any other means tile nr (bytevalue) has to be placed right here for winning".

ROM:08EC3E98 unk_8EC3E98     DCB    0
ROM:08EC3E99                 DCB    0
ROM:08EC3E9A                 DCB    0
ROM:08EC3E9B                 DCB    0
ROM:08EC3E9C                 DCB    0
ROM:08EC3E9D                 DCB    0
ROM:08EC3E9E                 DCB    0
ROM:08EC3E9F                 DCB    1
ROM:08EC3EA0                 DCB    2
ROM:08EC3EA1                 DCB    3
ROM:08EC3EA2                 DCB    4
ROM:08EC3EA3                 DCB    0
ROM:08EC3EA4                 DCB    0
ROM:08EC3EA5                 DCB    5
ROM:08EC3EA6                 DCB    6
ROM:08EC3EA7                 DCB    7
ROM:08EC3EA8                 DCB    8
ROM:08EC3EA9                 DCB    0
ROM:08EC3EAA                 DCB    0
ROM:08EC3EAB                 DCB    9
ROM:08EC3EAC                 DCB  0xA
ROM:08EC3EAD                 DCB  0xB
ROM:08EC3EAE                 DCB  0xC
ROM:08EC3EAF                 DCB    0
ROM:08EC3EB0                 DCB    0
ROM:08EC3EB1                 DCB  0xD
ROM:08EC3EB2                 DCB  0xE
ROM:08EC3EB3                 DCB  0xF
ROM:08EC3EB4                 DCB 0x10
ROM:08EC3EB5                 DCB    0

Alternatively, sorted by columns and rows:

00 00 00 00 00 00
00 01 02 03 04 00
00 05 06 07 08 00
00 09 0A 0B 0C 00
00 0D 0E 0F 10 00

The following 4 configurations are the start situation of the tiles. You can mess around with them as you like it but you should at least place every tile number once. (otherwise your puzzle can not be solved...)
They are located at $3EB6, $3ED4, $3EF2 and $3F10 for puzzles 0, 1, 2 and 3.

If you're having trouble when you try to resume the main game edit the RAM pointers 0x203C000, 0x203D000 0x203E000 and 0x203F000 (search for them in the binary) and let them point to an unused RAM area.

"Pokémon" ist ein eingetragenes Warenzeichen der Firma Nintendo
"Action Replay" ist ein eingetragenes Warenzeichen von Datel Interact.
© by Mastermind_X
© 2006 - 2008