## News:

11 March 2016 - Forum Rules

## Zelda 2 - Palace Pointers

Started by matal3a0, February 05, 2016, 08:43:25 AM

#### matal3a0

Hi!
I'm working on an cross-platform overworld-editor for Zelda 2. Currently I am able to edit the map and locations of caves, towns etc.
But when it comes to editing the locations of the palaces, I'm stuck on the part with the pointers which put a mountain-tile in place of the palace, when the palace has been cleared.

479F - Palace 1 (value 0x18)
47A1 - Palace 2 (value 0x76)
47A3 - Palace 3 (value 0xEA)

For example: The table refers to adress 0x479F  as the offset for Palace 1. I can successfully edit this and move the palace a little bit, so that the offset matches the new location.
But when it comes to the second and third palace, the offset isn't enough. I've tried calculating with the surrounding values, but to no avail..

From my calculations, I would need
Palace 2 0x174
Palace 3 0x2e6
Which is bigger than one byte can contain..

Has anybody worked with this, any ideas?
I've tried looking at http://www.bwass.org/romhack/zelda2/zelda2bank1.txt but I'm unable to interpret the code..

#### Trax

Your reasoning is correct, but your only mistake is that you are trying to make your calculation based on only one of the 2 bytes that compose the pointers. Here's the exact documentation:

478F: Pointer table for Palaces offsets in Saved RAM (4 * 2 = 8 bytes)

187C -> 7C18   Palace 1
767D -> 7D76   Palace 2
EA7E -> 7EEA   Palace 3
A67D -> 7DA6   Palace 4 (in Death Mountain)

If you do the subtraction with the base offset 7C00, you get:

7C18 - 7C00 = 18
7D76 - 7C00 = 176
7EEA - 7C00 = 2EA
7DA6 - 7C00 = 1A6

If you add these values to their respective base offset of the Overworld map data (West Hyrule or Death Mountain), you fall on the value 02 every time. By the way, I'm the author of the documentation you got this information from, so I can pretty much answer any question on its contents...

#### dACE

Just want to show my support for a Zelda2 editor!

Hopefully this project will expand over time and include dungeons and towns as well?

/dACE

#### matal3a0

Thank you very much Trax for the clarification, this will probably solve my issues.

And thanks dACE for the support. Time will tell how much further this will go. But a "full featured" overworld editor is the first goal.
I'm writing in Python, and this is my first real program in Python, so development is rather slow. And as I learn more, I go back and rewrite some portions.

I'll make everything available on this the Utilities-page when it's ready for some sort of release. In the mean time you can have a look at github https://github.com/matal3a0/Zelda2MapEdit

Thanks again, I'll probably be back with more questions

#### GTM604

#4
Just wondering how this is coming along as im very interested in Zelda 2 editing tools being created. Hope you haven't giving up on this project.

#### matal3a0

It's moving forward