Users browsing this thread: 2 Guest(s)
Command Edit Upgrade patch [WIP] Alpha Patch Available

#11
Posts: 676
Threads: 44
Thanks Received: 26
Thanks Given: 21
Joined: Jan 2015
Reputation: 11
Status
Zombie
If that's the case, would it be practical to temporarly remove the portrait entirely while that window is open or have another part of the menu "slide" over or up to block the portrait, leaving the command window free to cover or not cover whatever.

Granted, any of that depends entirely on being able to manipulate the window/menus at all, just a thought.

As for bits saved, I thought all of those bits for rare items saved because being used in JP, same with the bits for Bushido names, unused but still saved. I wouldn't put to much faith in me on that fact though. Either way, my point on the topic, I know there are some patches/mods/fixes (the really highspeed fancy stuff) that repurpose those save locations. Actually, just about everything I've seen that required something new to be saved jumped on those bits first. Not saying you shouldn't use any of them, but if you start expanding beyond the normal rare items might need to do some research for compatibility issues.

I could be mistaken, and I can't remember what I read that used that data. Might have been a patch to allow Umaro to use green cherry farts as an attack, or it could have been a major fix. So don't let it slow you down, but keeping it in mind might not hurt.


The only true wisdom is knowing you know nothing.
  Find
Quote  

#12
Posts: 96
Threads: 3
Thanks Received: 2
Thanks Given: 3
Joined: Dec 2011
Reputation: 1
Status
None
@HatZen
I applied the changes you posted earlier so I could see for myself.
I see exactly what you meant and I looked at the C3 disassembly and found some info about it there as well.


I'm wondering if the "That Damned Yellow Streak" patch will at least partially alleviate the situation for all the other characters?
I'll have to try it out.

As for the lower limit, I think the simplest solution would be make the text box always be the maximum length either by changing the code that controls the height of the box or padding the list with empty spaces.

So far I haven't run into any patches that mentioned these particular S/RAM bytes, but I will keep it in mind for sure.
Either way I'm eventually going to have to delve into their use definitively.

EDIT: I just verified that the "That Damn Yellow Streak" patch does partially solve the issue with the portraits as I thought it would after reading the description of how it fixes the problem on Gogo's command change menu. So now the only problem is fixing the minimum length issue.

And I also thought of another issue that exists with the original code.
Morph is not ever added to Gogo's selection of commands.
So for the simplest iteration of this patch, there would have to be a limitation added that prevents Terra from swapping out her Morph command in much the same way as Mimic was originally locked out.
  Find
Quote  

#13
Posts: 676
Threads: 44
Thanks Received: 26
Thanks Given: 21
Joined: Jan 2015
Reputation: 11
Status
Zombie
Nice to know "That Damn Yellow Streak" fix, fixes more than just the damn yellow streak.

The patch/mod I remembered using SRAM is "Egger's Expanded Palettes" patch. It uses some SRAM "not used by any of the three saves" to save the calculated palette data in order to save time and not re-calculate battle palette data at the start of every battle.

Granted it's not an everyday patch, and I couldn't find a direct reference to what exact SRAM is used other than "not used by any of the three saves".

Was doing some reading and figured I would look it up to make sure I wasn't completely nuts.


The only true wisdom is knowing you know nothing.
  Find
Quote  

#14
Posts: 96
Threads: 3
Thanks Received: 2
Thanks Given: 3
Joined: Dec 2011
Reputation: 1
Status
None
Cool. Thanks for the info. I'll see if I can find any more info.
But at least it's not an everyday patch as you say.

Progress on my idea so far...
I just finished optimizing the "Sustain the status screen" routine.
All I did was eliminated some redundant code, adjust all the short jumps/branches, and moved everything up.
I got an extra 12 bytes of free space for my trouble.

Here's the adjusted code (headered):
Code:
DP $26 is #$0C - sustain the status screen
        C3/21F5: 20390F JSR $0F39
        C3/21F8: A508   LDA $08
        C3/21FA: 8910   BIT #$10
        C3/21FC: F014   BEQ $2212
        C3/21FE: A528   LDA $28
        C3/2200: 8579   STA $79
Loop1:  C3/2202: 7B     TDC
        C3/2203: A528   LDA $28
        C3/2205: 1A     INC
        C3/2206: 2903   AND #$03
        C3/2208: 8528   STA $28
        C3/220A: AA     TAX
        C3/220B: B569   LDA $69,X
        C3/220D: 30F3   BMI $2202 (Loop1)
        C3/220F: 4C2922 JMP $2229 (Skip1)

Branch1:C3/2212: A508   LDA $08
        C3/2214: 8920   BIT #$20
        C3/2216: F020   BEQ $2238 (Skip2)
        C3/2218: A528   LDA $28
        C3/221A: 8579   STA $79
Loop2:  C3/221C: 7B     TDC
        C3/221D: A528   LDA $28
        C3/221F: 3A     DEC A
        C3/2220: 2903   AND #$03
        C3/2222: 8528   STA $28
        C3/2224: AA     TAX
        C3/2225: B569   LDA $69,X
        C3/2227: 30F3   BMI $221C (Loop2)
Skip1:  C3/2229: A528   LDA $28
        C3/222B: C579   CMP $79
        C3/222D: F003   BEQ $2232 (Skip3)
        C3/222F: 20A30E JSR $0EA3
Skip3:  C3/2232: 205D1C JSR $1C5D
        C3/2235: 4C835D JMP $5D83

Skip2:  C3/2238: A509   LDA $09
        C3/223A: 8980   BIT #$80
        C3/223C: F00A   BEQ $2254 (go to Gogo's command change routine)
        C3/223E: 20A90E JSR $0EA9
        C3/2241: A904   LDA #$04
        C3/2243: 8527   STA $27
        C3/2245: 6426   STZ $26
        C3/2247: 60     RTS

        C3/2248: FFFFFF    Free Space
        C3/224B: FFFFFF
        C3/224E: FFFFFF
        C3/2251: FFFFFF

Next step is going to be to go in depth into the actual command change code.
One thing though...
What does this "DP $26 is #$0C - sustain the status screen" mean exactly?
Is it that the RAM address $26 was set to #$0C prior to the start of this routine?
  Find
Quote  

#15
Posts: 110
Threads: 4
Thanks Received: 4
Thanks Given: 1
Joined: Jan 2012
Reputation: 4
Status
None
Yes. That's referencing the menu backbone where everything starts.
  Find
Quote  

#16
Posts: 96
Threads: 3
Thanks Received: 2
Thanks Given: 3
Joined: Dec 2011
Reputation: 1
Status
None
Thanks.

Looking through Traducciones Magno's FF6_Bank_$C3 rellocatable source code document I found the routine that generates the command list.
I'm sure the key to making the text box always be the full length of the screen will be here. (C3/5DC1 - C3/5ED6 BTW.)
I'm going to go through that routine later and hopefully I'll be able to crack this b*t*h.
  Find
Quote  

#17
Posts: 149
Threads: 21
Thanks Received: 40
Thanks Given: 3
Joined: Dec 2013
Reputation: 9
Status
Auto-life
The original code checks the table at CF/FE00 to discovery if a specific command can be added to the command list. Even if the command should be added to the list, it will not be included unless it is correctly set in the CF/FE00 table. FF3 multi editor, version 6.7, can edit this table in the 'battle' tab, 'battle commands' sub-tab. You can also kill the check at C3/5E58 and force any command to be included.
Code:
C3/5E52 BF 00 FE CF     LDA $CFFE00,X   command setup
C3/5E56 29 01           AND #$01        is the command available in Gogo's command selection?
C3/5E58 F0 06           BEQ $5E60       skip command inclusion if not

The 'mimic' command is hard-coded by its command ID. Its check must be killed at C3/5E4C or it will never be included by the original code.
Code:
C3/5E4A C9 12           CMP #$12        is it the 'mimic' command?
C3/5E4C F0 12           BEQ $5E60       skip command inclusion if yes

About the windows size, the code calculates it and stores it at $7EAA90 e $7EAA94. You can skip the code calculation and force a specific setup for the windows size. The following code sets the command selection window as the size of the status window:
Code:
header
hirom

;-------------------------------------------------------------------------------
; change window size for command selection
;-------------------------------------------------------------------------------
org     $C35E82
        LDA #$18        ;windows size
        JMP $5E91       ;continue normal code
warnpc  $C35E91
  Find
Quote  

#18
Posts: 96
Threads: 3
Thanks Received: 2
Thanks Given: 3
Joined: Dec 2011
Reputation: 1
Status
None
Awesome, HatZen! Thanks!

Theoretically, I can use the 4 bytes at C3/5E4A to jump to custom code that skips specific commands except on specific characters.
So I could do something like...
Is character Terra?
If not equal... check for Gogo.
Is command Morph?
If equal... skip command.
Is character Gogo?
If equal... go to RTS.
Is command Mimic?
If equal... skip command.
RTS

In this way only Terra would have Morph on her list, and only Gogo would have Mimic.
Everyone else will otherwise have access to all of the same commands as Gogo does.

In the mean time, before I try to implement this idea, I'm going to add the window size edit to my test ROM... BRB...

OK. The code you posted for the menu size worked like a charm.
Plus it creates 9 bytes of free space.
So now I need to add in the exceptions for Morph and Mimic.

Besides that I also want to do something about the guest characters.
I noticed that I can give Vicks and Wedge the Magic command at the beginning of the game and that causes some small issues. Namely, if either of them has Magic added to their command list it shows up as a blank because they have no spells learned, but on the Skills screen it makes their Magic menu light up and if you go in it shows a bunch of spells that are partially learned. Contextually that makes no sense in the story, so I'd rather just prevent them from using this feature at all.

If I'm not mistaken what I can do is change the bytes that previously prevented everyone but Gogo from using command edit to instead block everyone above Gogo.

Edit:
OK I did it. I changed the check for Gogo to instead check for Umaro or above. So now Only the main cast minus Umaro can use Command Edit.

Code:
header
hirom

;-------------------------------------------------------------------------------
;allow all characters before Umaro to replace commands
;-------------------------------------------------------------------------------

org     $C3225E
        CMP #$0D
        BCS $22B3

;-------------------------------------------------------------------------------
;show finger pointer on status screen for characters below Umaro
;-------------------------------------------------------------------------------

org     $C31C67
        CMP #$0D
        BCS $1C78


EDIT:
I noticed something else that is going to be an issue.
If a command is not currently on any character's battle menu, that command is lost.
For example, At the beginning of the game when Terra is the only party member, if I replace her Magic command with any other one and exit the status screen and return then the Magic command is gone from the list. So, it seems that every time you enter the status screen the list of available commands is rebuilt based on what commands each party member currently has instead of the ones they start the game with.

Also, the command in the lowest possible place on the list doesn't seem to get it's text loaded.
  Find
Quote  

#19
Posts: 149
Threads: 21
Thanks Received: 40
Thanks Given: 3
Joined: Dec 2013
Reputation: 9
Status
Auto-life
In the original code, it scans all the characters commands to determinate the list of commands for Gogo. If you didn't changed it, it will be a issue because any alteration to any character will affect the command list. You should use a fixed set of commands for the characters. The original construction of the commands list based on the other characters commands won't work because now all characters can change commands. The 'extra mimic slot' patch uses a fixed set of commands, if you need a reference.

In battle, the magitek status is a special case. When a character has a magitek status, like Terra in the start of the game, the available commands for the characters is rebuild. Many commands are erased and only a few are allowed to be used. You can try the 'antimagic field' hack to use a fixed set of commands when a character has magitek status.

The list has a maximum number of commands. The new windows size actually holds an empty slot and the bottom item of the list can't be used. The game engine can only hold 15 commands but there is place to 16. I choose this size to make the status screen and the command selection screen the same size. You can change the size of the command selection one item less, if the extra unusable slot is undesired.
  Find
Quote  

#20
Posts: 96
Threads: 3
Thanks Received: 2
Thanks Given: 3
Joined: Dec 2011
Reputation: 1
Status
None
The MagiTek status doesn't seem to be at the core of the issue.
I played farther into the game and when I had only Locke and the moogles in the party, the same thing happens if I remove steal and no one else has it equipped; it disappears just the same. Also, I noticed that Mog's Dance does not show up on the list at all. I'm guessing that at this point in the game Mog is not treated as a permanent party member so his commands are not scanned at all. So I'm going to have to lock out Mog from using command edit at this point in the game.
So it seems like the table itself is always rebuilt when you enter the status menu regardless of MagiTek status.

If I'm understanding the code and my observations, what is happening is that the game scans the commands currently held by the permanent party members and checks against the table at CF/FE00 to determine whether a given command should be added to the list. In order to make this properly functional I would have to make it scan each character's starting commands from the default data instead to avoid this issue entirely. Does that sound like an accurate assessment?

When you say the engine can only hold 15 commands, you mean the text for them, right?
Is that because of limited memory space for text?
  Find
Quote  



Forum Jump:

Users browsing this thread: 2 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite