Primary Zelda Hacking

Oracles Hacking => Tutorials => Topic started by: Lin on October 18, 2010, 04:01:28 AM



Title: Calculating the ASM Address of a Type 2 (And Possibly Others) Interactions
Post by: Lin on October 18, 2010, 04:01:28 AM
Well, this has been bugging me for a while: the fact that I didn't know how to get the real ASM addresses of type 2 interactions, so nothing could be discovered. So, I took a few minutes to debug and came up with this.

Take first byte (a). For example, 6B in the 6B0F ID for the interaction on the bridge trigger. Then, do this for the bank:
if (a < 3E) bank = 08
if (a < 67) bank = 09
if (a < 98) bank = 0A
if (a < DC) bank = 0B
else bank = 0C
PointerAddress = 3B8B + (a * 2)
Calculate the pointer at the pointer address (bank 0 obviously) and use the bank you got above to get the final address.

There you have it. Now, if only someone other than Jigglysaint and I knew Z80 ASM...

~Lin


Title: Re: Calculating the ASM Address of a Type 2 (And Possibly Others) Interactions
Post by: Gamma 31 on October 19, 2010, 02:58:39 AM
 OK, so I think I understand what you're saying a bit. Does the asterisk mean to multiply? So you would do A times 2 plus 3B8B equals the pointer address?

 What exactly is 3B8B? How do you add the result of (a * 2) to it? Sorry if I'm supposed to ask this in the Help area. Coding is always fascinating to me, and I want to learn about this.


Title: Re: Calculating the ASM Address of a Type 2 (And Possibly Others) Interactions
Post by: Lin on October 19, 2010, 04:57:54 AM
3B8B is an address, which is basically the index of a byte. So for example, 3B8B would be the 3B8Bth byte, because there is a byte at the address 0. Yes, the asterisk means to multiply. The pointer address means you will get the address of a pointer to another address. It's all complicated if you don't know the basics of ROM hacking.


Title: Re: Calculating the ASM Address of a Type 2 (And Possibly Others) Interactions
Post by: Invertfreak on November 27, 2010, 12:15:26 AM
So is 3B8B hexadecimal?