Primary Zelda Hacking
April 21, 2014, 09:44:06 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: The website has switched hosts and now has the domain zeldahacking.net!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Calculating the ASM Address of a Type 2 (And Possibly Others) Interactions  (Read 663 times)
Lin
ZOLE Creator
Administrator
Hero Member
*****
Offline Offline

Posts: 580



View Profile
« 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
« Last Edit: October 18, 2010, 04:12:57 AM by Lin » Logged
Gamma 31
Jr. Member
**
Offline Offline

Posts: 98


View Profile
« Reply #1 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.
Logged
Lin
ZOLE Creator
Administrator
Hero Member
*****
Offline Offline

Posts: 580



View Profile
« Reply #2 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.
Logged
Invertfreak
Newcomer
*
Offline Offline

Posts: 21


View Profile
« Reply #3 on: November 27, 2010, 12:15:26 AM »

So is 3B8B hexadecimal?
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!