Users browsing this thread: 2 Guest(s)
Excluding Weapons from Use With Genji Glove

#21
Posts: 3,966
Threads: 279
Thanks Received: 234
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(08-24-2018, 06:23 PM)PowerPanda Wrote: So, I scrolled up in the code to where it stores the item class for the list item to $F6, then added another 8-byte chunk that stored the value for the "Dual Wield" flag to $F7. Once I had that value safely stored away, I was able to change the accumulator to the equipped item, do all the normal checks, and then check the dual wield flag of the equipped item against $F7.

Glad you got it working! A small piece of info; when you need some RAM to store values temporary, because you need X or Y for looping or need to come back later to some values, each module use Direct Page offsets as scratchpad RAM. Menu use $E0-$EF, bank $C0 use $10-$40, battle module is another range, and so on.. That saved my life many time when coding; if a scatchpad offset is not used in current function or the ones when you return from the RTS, it is often safe to use.
  Find
Quote  
[-] The following 2 users say Thank You to madsiur for this post:
  • PowerPanda (08-25-2018), Robo Jesus (05-20-2019)

#22
Posts: 208
Threads: 3
Thanks Received: 0
Thanks Given: 8
Joined: May 2013
Reputation: 0
Status
None
There's a small mistake at the end:

Code:
   C3/9ACF:    38          SEC            allow item
   C3/9AD0:    60          RTS            end
   C3/9ACF:    18          SEC            deny item
   C3/9AD0:    60          RTS            end

Should be:

   C3/9ACF:    38          SEC            allow item
   C3/9AD0:    60          RTS            end
   C3/9AD1:    18          CLC            deny item
   C3/9AD2:    60          RTS            end

I just recently implemented your code in my hack, I'll see how it goes. Thank you for doing this!

Edit: Already found a bug within the first minute of testing Tongue
I haven't used the flag in FF3usME yet, I'm just testing the new code with a save game to see how it goes with non dual-wield weapons.

Equipping a weapon blocks me from equipping a shield and vice versa.

Edit2: Well, it doesn't work at all! I'm just being locked from equipping a second weapon or shield. Since I'm loading a savegame, characters that have a weapon + shield already equipped can't even swap to another weapon or shield (they are listed in gray) unless you remove them first, but then you're locked at only 1 weapon or shield at a time, not both. The same thing happens whatever the weapon setup.

The flag in FF3usME doesn't seems to do anything, even Genji Glove effect doesn't work anymore (Gauntlet still does work tho). I checked my code for mistakes but haven't found any, it's implemented exactly like you coded (including the small correction I made at the end), there's no conflicts with other patches either.



  Find
Quote  

#23
Posts: 614
Threads: 49
Thanks Received: 0
Thanks Given: 4
Joined: Feb 2017
Reputation: 25
Status
None
Warrax, thank you for testing it out. I had forgotten to update the byte counts on several of BEQs in my documentation. So the hex was wrong, but as far as I could tell, the asm was correct. I have updated the code on that post.

Note that this is far from done. I'm working on the logic of the Optimum command, trying to get it to all fit in line (probably not possible, but I'm trying). The "re-equip during combat" is not well-documented in the disassemblies, and remains a mystery to me. I estimate I still have a minimum of 2 weeks on this.


Projects:
FFVI: Divergent Paths (Completed) - a complete storyline and gameplay hack of FF6 that adds Leo as a playable character
  Find
Quote  

#24
Posts: 208
Threads: 3
Thanks Received: 0
Thanks Given: 8
Joined: May 2013
Reputation: 0
Status
None
It's working now, yes! one more thing off my todo list.

(08-25-2018, 09:40 PM)PowerPanda Wrote: Note that this is far from done. I'm working on the logic of the Optimum command, trying to get it to all fit in line (probably not possible, but I'm trying). The "re-equip during combat" is not well-documented in the disassemblies, and remains a mystery to me. I estimate I still have a minimum of 2 weeks on this.

It's all good, you did the most important part in my opinion!



  Find
Quote  

#25
Posts: 614
Threads: 49
Thanks Received: 0
Thanks Given: 4
Joined: Feb 2017
Reputation: 25
Status
None
I'm coming back to this after a long-ish break from hacking. Basically, 6 months ago, I spent about 10 hours re-writing the optimize sequence, and when I couldn't get it to work, decided to take a break. 6-months later, it's time to get back on this one.  Laugh

My question is in loading the accumulator. Any time the sequence is not targeting the R hand, the accumulator is loaded. Here are examples:
Code:
Fork: Put a shield in L-Hand
C3/9737:    A901        LDA #$01       ; Target: L-Hand
C3/9739:    854B        STA $4B        ; Set body part

Fork: Put a weapon in L-Hand
C3/9751:    A901        LDA #$01       ; Target: L-Hand
C3/9753:    854B        STA $4B        ; Set body part

Fork: Optimize helmet
C3/976B:    A902        LDA #$02       ; Target: Head
C3/976D:    854B        STA $4B        ; Set body part

Fork: Optimize armor
C3/9780:    A903        LDA #$03       ; Target: Torso
C3/9782:    854B        STA $4B        ; Set body part

In my code, I have a fail-over built into the Genji Glove equipment. If it equips a Genji Glove enabled weapon to the character's R-hand, then finds that there is no other weapon in the inventory that can be dual-wielded, it unequips the first weapon and forces you into a R-hand weapon L-hand shield configuration.

Since the L-hand has already been saved to $4B, I'm assuming I have to re-specify that we're now looking at the R-hand. Would I do that by adding this code in? Or will it screw things up to LDA #$00? (Sorry if it's a basic question. I'm... a little rusty.)
Code:
A9 00     LDA #$00  ; Target: R-Hand
85 4B     STA $4B   ; Set Body Part


Projects:
FFVI: Divergent Paths (Completed) - a complete storyline and gameplay hack of FF6 that adds Leo as a playable character
  Find
Quote  

#26
Posts: 208
Threads: 3
Thanks Received: 0
Thanks Given: 8
Joined: May 2013
Reputation: 0
Status
None
I'm surprised your question hasn't been answered yet so here's a small bump. Other than the issue with the optimize function with R-Hand, I think this small hack is ready for release at least as a patch ready for download. I've been using it since you released your code back in last August and it's been working wonderfully since then. Cheer!

I've been building my list of patches that I use in my hack and was wondering what the name of this patch would be, did you found a name for this yet?



  Find
Quote  

#27
Posts: 3,966
Threads: 279
Thanks Received: 234
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
@PowerPanda: If you look at $C39702 or $C3971A compared to like $C39737, STZ $4B ($00) seems to be the good value for R-Hand in comparison to $01 for L-Hand. I hope this answer your question, besides I have never modified or studied the optimize code.
  Find
Quote  
[-] The following 1 user says Thank You to madsiur for this post:
  • PowerPanda (03-07-2019)

#28
Posts: 614
Threads: 49
Thanks Received: 0
Thanks Given: 4
Joined: Feb 2017
Reputation: 25
Status
None
Hello world. I got the optimize sequence working. The code is not at all optimized, nor located in the correct spot of the rom to ensure compatibility, but IT'S WORKING.

Next steps:
* I want to improve the optimize sequence so that if it can't use the gauntlet/genji glove it will move you to a 1-handed weapon. I have an idea of how to do this, but haven't tested it yet.
* I have to somehow port my equip menu hack over to changing weapons in battle. Not looking forward to that.

EDIT: Code tested for equipping a shield if you can't actually use the gauntlet/genji glove. There's one small bug (if you have 1 genji glove-enabled weapon, but not a second, it won't equip a shield), but that should be fairly easy to fix too.


Projects:
FFVI: Divergent Paths (Completed) - a complete storyline and gameplay hack of FF6 that adds Leo as a playable character
  Find
Quote  

#29
Posts: 614
Threads: 49
Thanks Received: 0
Thanks Given: 4
Joined: Feb 2017
Reputation: 25
Status
None
Is anyone willing to help me with this hack? My last work on it was in May 2019, and to be honest, my frustration with this was what caused me to take a long break from hacking. I have everything working except the in-battle re-equip. I cannot find the section of code that checks your inventory for compatible weapons and highlights them in yellow. If anyone can find this for me, I think I'll be able to finish this hack.


Projects:
FFVI: Divergent Paths (Completed) - a complete storyline and gameplay hack of FF6 that adds Leo as a playable character
  Find
Quote  

#30
Posts: 200
Threads: 1
Thanks Received: 10
Thanks Given: 0
Joined: Oct 2015
Reputation: 18
Status
None
Quote  
[-] The following 1 user says Thank You to assassin for this post:
  • PowerPanda (01-05-2021)



Forum Jump:

Users browsing this thread: 2 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite