Users browsing this thread: 1 Guest(s)
ASM hack: improved Gale Hairpin; please help

#11
Posts: 281
Threads: 18
Thanks Received: 13
Thanks Given: 8
Joined: Mar 2014
Reputation: 8
Status
None
Nice work Synchysi! That's a clean way of doing it. As it is it conflicts with Lenophis' Unhardcoded Tintinabar, but of course it could easily be changed to make use of one of the unused (?) bits in special byte 2 or 4.

It still bugs me that I don't understand entirely why bit 0 of special byte 1 can't be reused. That whole byte is initialized to $11D6 from item properties stored in another bank and most of those properties are single-character. The way I understand it is the $11xx bytes are temporarily initialized from item data, then those are used and reused to initialize in-battle character properties in a set of variables that ARE indexed by character ID. I thought it would be possible to insert code right where $3C44,X is initialized to lift one bit from $11D6. It's a mystery to me right now.

Other party-wide item effects are handled in another byte entirely, the one called "Item effects." next to the permanent status bytes in FF3usME (the one that contains Sprint Shoes, Charm Bangle and Moogle Charm). There are a number of undocumented bits in there that, if unused, would be perfect for handling Back Guard and Gale Hairpin (and Lenophis' party-wide Unhardcoded Tintinabar). Thus freeing up two bits for added item effects. I think you used one of the item bits for something in BNW, didn't you?
  Find
Quote  

#12
Posts: 290
Threads: 3
Thanks Received: 40
Thanks Given: 1
Joined: Apr 2012
Reputation: 9
Status
None
Nah, we only used free bits under Special 3 and 4.

Anyway, I actually got it working with a modified version of your initial code. I don't know why you were having an issue with the branch, but it's working fine for me.

Code:
org $C228E7
JSR $xxxx

org $C2xxxx
STA $3C44,X
LDA $11D6
LSR
BCC Exit
LDA #$0004
ORA $3C44,X
STA $3C44,X

Exit:
RTS

That'll set your bit in $3C44, so we need to test it later on.

Code:
org $C225F7
JSR $yyyy

org $C2yyyy
STA $3219,Y
LDA $3C44,Y
BIT #$04
BEQ Exit
LDA #$FF
STA $3219,Y

Exit:
RTS

I tested this out a few times and it seemed to work well, though more thorough testing is probably warranted.


GET A SILK BAG FROM THE GRAVEYARD DUCK TO LIVE LONGER.

Brave New World
  Find
Quote  
[-] The following 1 user says Thank You to Synchysi for this post:
  • seibaby (03-10-2014)



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite