News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Zelda 2 - Palace Pointers  (Read 1396 times)

matal3a0

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Zelda 2 - Palace Pointers
« on: February 05, 2016, 08:43:25 am »
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.
I found lots of great information on http://datacrystal.romhacking.net/wiki/Zelda_II:_The_Adventure_of_Link:ROM_map

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

  • Sr. Member
  • ****
  • Posts: 493
    • View Profile
    • Trax ROM Hacking
Re: Zelda 2 - Palace Pointers
« Reply #1 on: February 07, 2016, 01:46:16 pm »
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

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
Re: Zelda 2 - Palace Pointers
« Reply #2 on: February 07, 2016, 01:58:30 pm »
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

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: Zelda 2 - Palace Pointers
« Reply #3 on: February 07, 2016, 03:08:23 pm »
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 ;)

itemdrop

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: Zelda 2 - Palace Pointers
« Reply #4 on: May 14, 2016, 01:45:53 pm »
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.
« Last Edit: May 14, 2016, 02:03:20 pm by itemdrop »

matal3a0

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: Zelda 2 - Palace Pointers
« Reply #5 on: May 15, 2016, 03:11:43 am »
It's moving forward :)
You can follow the thread under Personal Projects
http://www.romhacking.net/forum/index.php/topic,21273.0.html