Editing base bomb & arrow capacity (LTTP)

Go down

Editing base bomb & arrow capacity (LTTP) Empty Editing base bomb & arrow capacity (LTTP)

Post by slartifer on Thu 31 Aug 2017 - 20:02

Hi all,

An idea I've been playing around with, as part of a hack, is to prevent the use of bombs until they are unlocked by "finding" them. The simplest way to do this seems to be to set base bomb capacity to 0 (rather than 10) and then having a capacity upgrade as an item (as is done in the Randomizer -- that part's easy enough).

I'm wondering if anyone has mucked around with this, and can point me to the right part of the code. Presumably the cap is only checked when Link procures up a bomb refill, so this could be a simple edit.

Thanks in advance if anyone can point me to the right place!

slartifer
Bee
Bee

Since : 2017-08-31

Back to top Go down

Editing base bomb & arrow capacity (LTTP) Empty Re: Editing base bomb & arrow capacity (LTTP)

Post by slartifer on Thu 31 Aug 2017 - 20:37

So, I answered my own question, but maybe this will be useful info for someone else. This was very easy. The bomb capacity upgrade number (0 through 7, internally) is actually a pointer to a simple table of maximum capacity values.

In the Japanese ROM I'm using it starts at 0x6DB48. (The similar arrow table is at 0x6DB58.) But you can also find it the same way I did, by just searching for possible bomb capacity values in sequence (0A0F1419...)

slartifer
Bee
Bee

Since : 2017-08-31

Back to top Go down

Editing base bomb & arrow capacity (LTTP) Empty Re: Editing base bomb & arrow capacity (LTTP)

Post by Schicksal88 on Sat 9 Sep 2017 - 2:46

Did you make it work?
I'am kinda stuck right now. My plan was to set the "0x28" chestitem into a item that increases your max bombs instead of your current bombs.

But I can't find the address of the code that gets executed after the game checked if it is "0x28" to hook my own code into it.

The only things I could figure out are:

7E/F343: current bomb amount in ram

7E/F370: current bomb "upgrade" value, gets incremented by 1 to read the next value as maximum bombs at 0x6DB48

7E/02D8 = ram address with chestitemID that gets read after you open a chest

Schicksal88
Bee
Bee

Since : 2015-07-22

Back to top Go down

The author of this message was banned from the forum - See the message

Editing base bomb & arrow capacity (LTTP) Empty Re: Editing base bomb & arrow capacity (LTTP)

Post by slartifer on Sat 9 Sep 2017 - 8:56

One other thing I ran into, to be aware of: if you change the base bomb (or arrow) capacity to be 0, the game will respect this in certain instances (like if you try to buy bombs from a shop), but bombs/arrows that appear as enemy drops or under pots will add to your current quantity as if there is no limit.

Presumably this could be fixed with an ASM modification. I looked at the part of the code that handles it and, frankly, there was too much spaghetti for me at least to wade through Very Happy

slartifer
Bee
Bee

Since : 2017-08-31

Back to top Go down

Editing base bomb & arrow capacity (LTTP) Empty Re: Editing base bomb & arrow capacity (LTTP)

Post by Schicksal88 on Tue 12 Sep 2017 - 1:43

Okay thanks for the reply you two. I hoped that somewhere is a simple
if chestitem == 00, jump to 0x___,
if chestitem == 01 jump to 0x____
and so on.
I had something like LDA 7E/D208, CMP 0x28, BEQ 0x____ in mind, couldn't find anything like that.

Writing the code for one specific chest item would have been possible, but understanding the entire routine and changing it to my likings is a little bit too much especially because the game is jumping around like crazy just to increase your bombs by 1. Smile

Anyway, thanks for the info.

Schicksal88
Bee
Bee

Since : 2015-07-22

Back to top Go down

The author of this message was banned from the forum - See the message

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum