Enable/Disable Auto-optimize
#1
There are actually two parts to this question:

1. Can I stop certain items from being equipped through the "Optimum" option in the equip screen?  For example, if a cursed object gives a defense of 100, can I make it so it will not auto-equip with the optimum feature?

2. I created a new set of beefed up Genji Gloves specifically for Leo/Cyan (not called Genji Gloves), but I need to make it so this item takes the player to the Equip screen when they equip the relic (just like the Gauntlet and Genji Glove).  Can I do this? The item in question uses a new relic slot and does not replace the old Genji Gloves or Gauntlet (hence the reason it does not take the player to the equip screen as it should).

Edit: I found a few threads in which people tried this, but the answers weren't very clear. If it might break something to do these things, I might just scrap the idea and skip this.
Reply
#2
I made a thread about this about a year ago in case that thread didn't appear in your search result. Most information should be there.

https://www.ff6hacking.com/forums/thread-3546.html

Items must be converted from decimal (as listed in FF3usME) to hex.
Changing the list is quite easy to do. Starting at ED82E4, there's currently 10 items and there's apparently room for 16 total.

Reply
#3
(09-19-2018, 09:53 PM)Warrax Wrote: I made a thread about this about a year ago in case that thread didn't appear in your search result. Most information should be there.

https://www.ff6hacking.com/forums/thread-3546.html

Items must be converted from decimal (as listed in FF3usME) to hex.
Changing the list is quite easy to do. Starting at ED82E4, there's currently 10 items and there's apparently room for 16 total.

Wasn't there a warning in that thread about using the remaining 6 slots?  something about how the game uses those slots for something else?  I actually did read that thread before posting this one, but it seemed like there was a question mark over the solution!
Reply
#4
For question #1, Warrax has linked the right thread. Add your items to the $ED82E4 list. Just make sure to adjust the loop like assassin suggested which is right now for 10 items, the CPX #$000A at $C39834 and $C39860. If you got more than 16 items you would even relocate that list and just change the CMP $ED82E4,X at $C3982D and $C39859. I think that is all there would be to it.

For question #2, you'd need to relocate this code and add entries to the middle fork, the one who compare old and new relics. There would also be a JSR to change at $C39EF8. The more elegant way would be to relocate the code at end of bank $C3 where you have free space.

Code:
Determine whether to trigger Reequip in Relic menu
C3/9F5C:    20F293      JSR $93F2      ; Define Y...
C3/9F5F:    B92300      LDA $0023,Y    ; Relic 1
C3/9F62:    C5B0        CMP $B0        ; Unchanged?
C3/9F64:    D009        BNE $9F6F      ; Branch if not
C3/9F66:    B92400      LDA $0024,Y    ; Relic 2
C3/9F69:    C5B1        CMP $B1        ; Unchanged?
C3/9F6B:    D002        BNE $9F6F      ; Branch if not
C3/9F6D:    803A        BRA $9FA9      ; Reequip: No

Fork: Compare old and new relics
C3/9F6F:    A5B0        LDA $B0        ; Old relic 1
C3/9F71:    C9D1        CMP #$D1       ; Genji Glove?
C3/9F73:    F037        BEQ $9FAC      ; Trigger if so
C3/9F75:    C9D0        CMP #$D0       ; Gauntlet?
C3/9F77:    F033        BEQ $9FAC      ; Trigger if so
C3/9F79:    C9DA        CMP #$DA       ; Merit Award?
C3/9F7B:    F02F        BEQ $9FAC      ; Trigger if so
C3/9F7D:    A5B1        LDA $B1        ; Old relic 2
C3/9F7F:    C9D1        CMP #$D1       ; Genji Glove?
C3/9F81:    F029        BEQ $9FAC      ; Trigger if so
C3/9F83:    C9D0        CMP #$D0       ; Gauntlet?
C3/9F85:    F025        BEQ $9FAC      ; Trigger if so
C3/9F87:    C9DA        CMP #$DA       ; Merit Award?
C3/9F89:    F021        BEQ $9FAC      ; Trigger if so
C3/9F8B:    B92300      LDA $0023,Y    ; Relic 1
C3/9F8E:    C9D1        CMP #$D1       ; Genji Glove?
C3/9F90:    F01A        BEQ $9FAC      ; Trigger if so
C3/9F92:    C9D0        CMP #$D0       ; Gauntlet?
C3/9F94:    F016        BEQ $9FAC      ; Trigger if so
C3/9F96:    C9DA        CMP #$DA       ; Merit Award?
C3/9F98:    F012        BEQ $9FAC      ; Trigger if so
C3/9F9A:    B92400      LDA $0024,Y    ; Relic 2
C3/9F9D:    C9D1        CMP #$D1       ; Genji Glove?
C3/9F9F:    F00B        BEQ $9FAC      ; Trigger if so
C3/9FA1:    C9D0        CMP #$D0       ; Gauntlet?
C3/9FA3:    F007        BEQ $9FAC      ; Trigger if so
C3/9FA5:    C9DA        CMP #$DA       ; Merit Award?
C3/9FA7:    F003        BEQ $9FAC      ; Trigger if so
C3/9FA9:    6499        STZ $99        ; Reequip: No
C3/9FAB:    60          RTS

Fork: Set to open Equip menu
C3/9FAC:    A901        LDA #$01       ; Reequip: Yes
C3/9FAE:    8599        STA $99        ; Set indicator
C3/9FB0:    60          RTS
Reply
#5
(09-19-2018, 11:03 PM)madsiur Wrote: For question #1, Warrax has linked the right thread. Add your items to the $ED82E4 list. Just make sure to adjust the loop like assassin suggested which is right now for 10 items, the CPX #$000A at $C39834 and $C39860. If you got more than 16 items you would even relocate that list and just change the CMP $ED82E4,X  at $C3982D and $C39859. I think that is all there would be to it.

For question #2, you'd need to relocate this code and add entries to the middle fork, the one who compare old and new relics. There would also be a JSR to change at $C39EF8. The more elegant way would be to relocate the code at end of bank $C3 where you have free space.

Code:
Determine whether to trigger Reequip in Relic menu
C3/9F5C:    20F293      JSR $93F2      ; Define Y...
C3/9F5F:    B92300      LDA $0023,Y    ; Relic 1
C3/9F62:    C5B0        CMP $B0        ; Unchanged?
C3/9F64:    D009        BNE $9F6F      ; Branch if not
C3/9F66:    B92400      LDA $0024,Y    ; Relic 2
C3/9F69:    C5B1        CMP $B1        ; Unchanged?
C3/9F6B:    D002        BNE $9F6F      ; Branch if not
C3/9F6D:    803A        BRA $9FA9      ; Reequip: No

Fork: Compare old and new relics
C3/9F6F:    A5B0        LDA $B0        ; Old relic 1
C3/9F71:    C9D1        CMP #$D1       ; Genji Glove?
C3/9F73:    F037        BEQ $9FAC      ; Trigger if so
C3/9F75:    C9D0        CMP #$D0       ; Gauntlet?
C3/9F77:    F033        BEQ $9FAC      ; Trigger if so
C3/9F79:    C9DA        CMP #$DA       ; Merit Award?
C3/9F7B:    F02F        BEQ $9FAC      ; Trigger if so
C3/9F7D:    A5B1        LDA $B1        ; Old relic 2
C3/9F7F:    C9D1        CMP #$D1       ; Genji Glove?
C3/9F81:    F029        BEQ $9FAC      ; Trigger if so
C3/9F83:    C9D0        CMP #$D0       ; Gauntlet?
C3/9F85:    F025        BEQ $9FAC      ; Trigger if so
C3/9F87:    C9DA        CMP #$DA       ; Merit Award?
C3/9F89:    F021        BEQ $9FAC      ; Trigger if so
C3/9F8B:    B92300      LDA $0023,Y    ; Relic 1
C3/9F8E:    C9D1        CMP #$D1       ; Genji Glove?
C3/9F90:    F01A        BEQ $9FAC      ; Trigger if so
C3/9F92:    C9D0        CMP #$D0       ; Gauntlet?
C3/9F94:    F016        BEQ $9FAC      ; Trigger if so
C3/9F96:    C9DA        CMP #$DA       ; Merit Award?
C3/9F98:    F012        BEQ $9FAC      ; Trigger if so
C3/9F9A:    B92400      LDA $0024,Y    ; Relic 2
C3/9F9D:    C9D1        CMP #$D1       ; Genji Glove?
C3/9F9F:    F00B        BEQ $9FAC      ; Trigger if so
C3/9FA1:    C9D0        CMP #$D0       ; Gauntlet?
C3/9FA3:    F007        BEQ $9FAC      ; Trigger if so
C3/9FA5:    C9DA        CMP #$DA       ; Merit Award?
C3/9FA7:    F003        BEQ $9FAC      ; Trigger if so
C3/9FA9:    6499        STZ $99        ; Reequip: No
C3/9FAB:    60          RTS

Fork: Set to open Equip menu
C3/9FAC:    A901        LDA #$01       ; Reequip: Yes
C3/9FAE:    8599        STA $99        ; Set indicator
C3/9FB0:    60          RTS

For question #1, you lost me at "adjust the loop" (I also read Assassin's post and it didn't help). It took me 40 minutes just to find and add my items to the end of $ED82E4 using a decimal to hex converter (for the right ID numbers).  LOL.  I only added two items to the list.  Can you tell me exactly what code to change to make the game recognize 12 items instead of 10?  I am guessing this is the loop you are referring to at $C39834 and $C39860, but I don't know what to modify. It all looks like another language to me!

I haven't tackled #2 yet, but it looks like I might break something attempting it.  I might just get rid of my beefed up glove and replace it with something else!
Reply
#6
(09-19-2018, 11:28 PM)Lightning Wrote: Can you tell me exactly what code to change to make the game recognize 12 items instead of 10?  I am guessing this is the loop you are referring to at  $C39834 and $C39860, but I don't know what to modify.

You need to modify the two CPX #$000A (E0 0A 00) to CPX #$000C (E0 0C 00). If you would check the $C3 disassembly when you work on things like this it would greatly help you..
Reply
#7
(09-20-2018, 08:55 AM)madsiur Wrote:
(09-19-2018, 11:28 PM)Lightning Wrote: Can you tell me exactly what code to change to make the game recognize 12 items instead of 10?  I am guessing this is the loop you are referring to at  $C39834 and $C39860, but I don't know what to modify.

You need to modify the two CPX #$000A (E0 0A 00) to CPX #$000C (E0 0C 00). If you would check the $C3 disassembly when you work on things like this it would greatly help you..

I figured it out now, thanks!  When it comes to coding, I usually need my hand held. Lol.  If it wasn't for FF3usME and FF3SE, my mod would not exist.  My strong points are graphics, sound effects, game play, and story writing.  I basically suck at code!
Reply
#8
Well I did this in about 10min, you can test it. You only need to change the 4 CMPs with the dirk ID (00) to your good item ID. Note that you might need to change the org $C3F091 if that free space is used by other patches, check your ROM first.

Code:
hirom

org $C39EF8
jsr free_space

org $C3F091
free_space:
jsr $93F2         ; define y...
lda $0023,y       ; relic 1
cmp $B0           ; unchanged?
bne lbl_9F6F      ; branch if not
lda $0024,y       ; relic 2
cmp $B1           ; unchanged?
bne lbl_9F6F      ; branch if not
bra lbl_9FAC      ; reequip: no

;fork: compare old and new relics
lbl_9F6F:
lda $B0           ; old relic 1
cmp #$00          ; dirk for now, change to your item ID
beq lbl_9FAC      ; trigger if so
cmp #$D1          ; genji glove?
beq lbl_9FAC      ; trigger if so
cmp #$D0          ; gauntlet?
beq lbl_9FAC      ; trigger if so
cmp #$DA          ; merit award?
beq lbl_9FAC      ; trigger if so
lda $B1           ; old relic 2
cmp #$00          ; dirk for now, change to your item ID
beq lbl_9FAC      ; trigger if so
cmp #$D1          ; genji glove?
beq lbl_9FAC      ; trigger if so
cmp #$D0          ; gauntlet?
beq lbl_9FAC      ; trigger if so
cmp #$DA          ; merit award?
beq lbl_9FAC      ; trigger if so
lda $0023,y       ; relic 1
cmp #$00          ; dirk for now, change to your item ID
beq lbl_9FAC      ; trigger if so
cmp #$D1          ; genji glove?
beq lbl_9FAC      ; trigger if so
cmp #$D0          ; gauntlet?
beq lbl_9FAC      ; trigger if so
cmp #$DA          ; merit awarD?
beq lbl_9FAC      ; trigger if so
lda $0024,y       ; relic 2
cmp #$00          ; dirk for now, change to your item ID
beq lbl_9FAC      ; trigger if so
cmp #$D1          ; genji glove?
beq lbl_9FAC      ; trigger if so
cmp #$D0          ; gauntlet?
beq lbl_9FAC      ; trigger if so
cmp #$DA          ; merit awarD?
beq lbl_9FAC      ; trigger if so
lbl_9FA9:
stz $99           ; reequip: no
rts

;fork: set to open equip menu
lbl_9FAC:
lda #$01          ; reequip: yes
sta $99           ; set indicator
rts
Reply
#9
iirc, if you are expanding the list of Optimum-incompatible items, you need to make sure that no single category (e.g. Helmets) has more than 8 such items, or be ready to expand an earlier loop.

from my post in the linked thread: "the way the game is written, it relies on fallback FFs in the generated Item list to use should Optimum run out of options."  this list of FFs is just a token 9 entries (which matches the # of rows on an equip screen).  however, if your character-compatible list has a bunch of Optimum-incompatible items in it, it overflows the backup list.  if the game has success when scanning for an Optimum candidate, you're alright, but if not, the game will load from uninitialized gibberish for its fallback.

see C3/9C2A.
Reply
#10
(09-21-2018, 11:10 AM)assassin Wrote: iirc, if you are expanding the list of Optimum-incompatible items, you need to make sure that no single category (e.g. Helmets) has more than 8 such items, or be ready to expand an earlier loop.

from my post in the linked thread: "the way the game is written, it relies on fallback FFs in the generated Item list to use should Optimum run out of options."  this list of FFs is just a token 9 entries (which matches the # of rows on an equip screen).  however, if your character-compatible list has a bunch of Optimum-incompatible items in it, it overflows the backup list.  if the game has success when scanning for an Optimum candidate, you're alright, but if not, the game will load from uninitialized gibberish for its fallback.

see C3/9C2A.

So, if I sell all my normal equipment and just hold on to all the Imp gear, cursed equipment, the Ultima Weapon and my two new items I excluded from the optimum list, the game might glitch out when I press the optimum option?  Am I understanding you right?

Edit: Ah, I think I understand now. So, I guess I should be ok if there are the following items in my mod not compatible with Optimum: 4 swords, 1 spear, 1 rod, 2 shields, 2 helmets, and 2 armors - because none of these categories exceed 8, right?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Item Auto Status, & etc doofenH 15 10,095 04-25-2022, 06:36 PM
Last Post: HatZen08
  Disable magic while still allowing Esper equip boxedj 1 2,441 04-24-2020, 04:21 PM
Last Post: C-Dude
  Disable Jump command if character has Dark status seibaby 5 5,835 12-09-2016, 05:23 PM
Last Post: SSJ Rick
  Is Auto-Battle possible? cdizzle 12 13,282 05-15-2015, 07:12 PM
Last Post: dn
  Disabling Auto-Optimize/Remove on Genji Glove/Gauntlet Riketz 8 11,402 12-23-2012, 09:59 PM
Last Post: Riketz

Forum Jump:


Users browsing this thread: 1 Guest(s)