øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1940.msg20855e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index58f5.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1940.15e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index58f5.html.zxÅg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈð2gŠOKtext/htmlISO-8859-1gzip0|ÖgŠÿÿÿÿÿÿÿÿTue, 10 Mar 2020 03:42:19 GMT0ó°° ®0®P®€§²ð®Äg^ÿÿÿÿÿÿÿÿ~9gŠ Chillyfeez's Mods, hacks, research notes, etc.

Author Topic: Chillyfeez's Mods, hacks, research notes, etc.  (Read 17630 times)

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #15 on: June 06, 2014, 03:11:42 PM »
 No...
AND #$FF00. The idea is to create a ratio, using the lower byte as the fraction. The formula would make, for instance, a level 50 monster that meets a level 99 party level up to 98.

Here's that example (all in hex)
(APL) 63 * 100 = 6300 [this will be achieved by loading the byte before APL and performing AND #$FF00 - it's a few bytes quicker than 8 ASLs]
 :edit: I'm writing it now... no ASLs are quicker because APL is already in the lower byte of A
6300 / (Monster level) 32 = (ratio) 1FA
1FA * 32 = (adjusted monster level) 62

It's absolutely nothing like my original formula. It's much simpler, and hopefully better. If I end up with monster stats that are way too high, I can try slashing the ratio before applying it to non-level stats.

I guess the same formula could be applied to weaken higher-level monsters, but I'm not sure I want to do that...

 :edit: Gotta break to make dinner. Seems to be working so far. I'm debugging as I go, so the coding is slow, but no crashes so far...
« Last Edit: June 06, 2014, 05:08:38 PM by chillyfeez »

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #16 on: June 06, 2014, 07:02:54 PM »
or you can do: AND #$00FF , XBA.  if you know the top half of A was already zero (e.g. a TDC right before the loading of APL), then just the XBA is needed.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #17 on: June 06, 2014, 07:12:09 PM »
Ah... Was not aware of that op. Good to know.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #18 on: June 07, 2014, 05:13:30 PM »
Well, I got the new formula up and running, but it may need an adjustment...
High level Imps become godlike death bringers, because their level starts off so low.
I have a couple of ideas for solving this:
Possibility 1) cut the ratio in half before applying to attack and defense multipliers
Possibility 2) skip modifying multipliers altogether
Possibility 3) raise the starting level of low level monsters (I don't think a monster's level really does anything anyway), thus naturally lowering the level up ratio (this would be the easiest fix, but would also impact the universality of the patch...)

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #19 on: June 08, 2014, 05:40:03 AM »
Hmm, how "death bringer" are these high level imps? Recall that FFVIII also had this "issue" as well. I think an interesting way to combat this might be able to assign different Item Drop Tables depending on the level of said foe. Level 1-20 Imp has the chance to drop the normal Cure1, Cure2, Tent, Imp whereas Level 20-50 can drop Cure3, Cabin, Imp, Sleep Sword, Imp 50-100 could drop Cure3, Imp, Elixir, Silver Apple, that sort of dealing. That way it would be worth the player's time to fight them at higher's level.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #20 on: June 08, 2014, 10:10:46 AM »
Him, that's an interesting route to take...
I think, though, that I've figured out a good plan. I'll hopefully have an updated patch up later today (or else tomorrow for sure) and will explain it then.

Now that I think about it, I could still work in the item change portion in addition... Maybe won't do that all at once, though.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #21 on: June 09, 2014, 10:20:15 AM »
OK, here's the re-worked Monster Level Adjusting patch.

The new process (In English)
1) Determine APL (true APL this time)
2) Multiply APL by 2/3 to determine Modified APL
3) Modified APL * 100(hex) / Monster's Level = Adjustment Ratio
4) Adjust Monster level according to Adjustment Ratio (skip if boss)
5) Adjust Attack Multiplier according to Adjustment Ratio (skip if boss)
6) Adjust Attack Base according to Adjustment Ratio (skip if boss)
7) Adjust Physical Defense Multiplier according to Adjustment Ratio
8) Adjust Physical Defense Base according to Adjustment Ratio
9) Adjust Magic Defense Multiplier according to Adjustment Ratio
10) Adjust Magic Defense Base according to Adjustment Ratio
11) Adjust Speed according to Adjustment Ratio
12) Adjust Current HP and Max HP according to Adjustment Ratio (skip if boss)

Here's a commented disassembly (comments are simplified, as many operations are the same as before):
Code: [Select]
$03/90F5 5C 60 DE 01 JMP $01DE60      ;Jump to custom code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

$01/DE60 9D 24 20    STA $2024,x[$7E:22A4]   
$01/DE63 8E 80 22    STX $2280  [$7E:2280]   
$01/DE66 8C 90 22    STY $2290  [$7E:2290]   
$01/DE69 C2 20       REP #$20               
$01/DE6B 7B          TDC                     
$01/DE6C AA          TAX                     
$01/DE6D A8          TAY                     
$01/DE6E AD 02 20    LDA $2002  [$7E:2002]   
$01/DE71 29 FF 00    AND #$00FF             
$01/DE74 F0 02       BEQ $02    [$DE78]     
$01/DE76 AA          TAX                     
$01/DE77 C8          INY                     
$01/DE78 AD 82 20    LDA $2082  [$7E:2082]   
$01/DE7B 29 FF 00    AND #$00FF             
$01/DE7E F0 09       BEQ $09    [$DE89]     
$01/DE80 85 A9       STA $A9    [$00:00A9]   
$01/DE82 8A          TXA                     
$01/DE83 18          CLC                     
$01/DE84 6D A9 00    ADC $00A9  [$7E:00A9]   
$01/DE87 AA          TAX                     
$01/DE88 C8          INY                     
$01/DE89 AD 02 21    LDA $2102  [$7E:2102]   
$01/DE8C 29 FF 00    AND #$00FF             
$01/DE8F F0 09       BEQ $09    [$DE9A]     
$01/DE91 85 A9       STA $A9    [$00:00A9]   
$01/DE93 8A          TXA                     
$01/DE94 18          CLC                     
$01/DE95 6D A9 00    ADC $00A9  [$7E:00A9]   
$01/DE98 AA          TAX                     
$01/DE99 C8          INY                     
$01/DE9A AD 82 21    LDA $2182  [$7E:2182]   
$01/DE9D 29 FF 00    AND #$00FF             
$01/DEA0 F0 09       BEQ $09    [$DEAB]     
$01/DEA2 85 A9       STA $A9    [$00:00A9]   
$01/DEA4 8A          TXA                     
$01/DEA5 18          CLC                     
$01/DEA6 6D A9 00    ADC $00A9  [$7E:00A9]   
$01/DEA9 AA          TAX                     
$01/DEAA C8          INY                     
$01/DEAB AD 02 22    LDA $2202  [$7E:2202]   
$01/DEAE 29 FF 00    AND #$00FF             
$01/DEB1 F0 09       BEQ $09    [$DEBC]     
$01/DEB3 85 A9       STA $A9    [$00:00A9]   
$01/DEB5 8A          TXA                     
$01/DEB6 18          CLC                     
$01/DEB7 6D A9 00    ADC $00A9  [$7E:00A9]   
$01/DEBA AA          TAX                     
$01/DEBB C8          INY                     
$01/DEBC 8A          TXA                     
$01/DEBD BB          TYX                     
$01/DEBE 20 00 E1    JSR $E100  [$01:E100]   ;Determine APL, by adding all party members' levels and dividing by the amount of party members (01/E100 is the division function)
$01/DEC1 A2 03 00    LDX #$0003             
$01/DEC4 20 00 E1    JSR $E100  [$01:E100]   
$01/DEC7 0A          ASL A                   ;Multiply APL by 2/3 to obtain Adjusted APL
$01/DEC8 48          PHA                     
$01/DEC9 AC 80 22    LDY $2280  [$7E:2280]   
$01/DECC 68          PLA                     
$01/DECD 0A          ASL A                   
$01/DECE 0A          ASL A                   
$01/DECF 0A          ASL A                   
$01/DED0 0A          ASL A                   
$01/DED1 0A          ASL A                   
$01/DED2 0A          ASL A                   
$01/DED3 0A          ASL A                   
$01/DED4 0A          ASL A                   
$01/DED5 BE 02 20    LDX $2002,y[$7E:2282]   
$01/DED8 20 00 E1    JSR $E100  [$01:E100]   ;Determine Adjustment Ratio using the formula: Adj-APL * 100(h) / Monst-Lvl
$01/DEDB 48          PHA                     
$01/DEDC 7B          TDC                     
$01/DEDD E2 20       SEP #$20               
$01/DEDF B9 70 20    LDA $2070,y[$7E:22F0]   
$01/DEE2 30 52       BMI $52    [$DF36]      ;Skip Level, Attack Multiplier and Attack Base adjustments if monster is a Boss
$01/DEE4 C2 20       REP #$20               
$01/DEE6 68          PLA                     
$01/DEE7 BE 02 20    LDX $2002,y[$7E:2282]   
$01/DEEA 86 E8       STX $E8    [$00:00E8]   
$01/DEEC 48          PHA                     
$01/DEED 20 70 E1    JSR $E170  [$01:E170]   
$01/DEF0 E2 20       SEP #$20               
$01/DEF2 99 02 20    STA $2002,y[$7E:2282]   
$01/DEF5 99 70 20    STA $2070,y[$7E:22F0]   
$01/DEF8 69 0A       ADC #$0A               
$01/DEFA 99 2F 20    STA $202F,y[$7E:22AF]   ;Adjust Level (and Level+Boss Bit, and Level+0A) according to Adjustment Ratio
$01/DEFD C2 20       REP #$20               
$01/DEFF B9 1B 20    LDA $201B,y[$7E:229B]   
$01/DF02 29 FF 00    AND #$00FF             
$01/DF05 85 E8       STA $E8    [$00:00E8]   
$01/DF07 68          PLA                     
$01/DF08 48          PHA                     
$01/DF09 20 70 E1    JSR $E170  [$01:E170]   
$01/DF0C C9 0E 00    CMP #$000E             
$01/DF0F 90 03       BCC $03    [$DF14]     
$01/DF11 A9 0D 00    LDA #$000D             
$01/DF14 E2 20       SEP #$20               
$01/DF16 99 1B 20    STA $201B,y[$7E:229B]   ;Adjust Attack Multiplier according to Adjustment Ratio (Max value 0E)
$01/DF19 EA          NOP                     
$01/DF1A C2 20       REP #$20               
$01/DF1C B9 1D 20    LDA $201D,y[$7E:229D]   
$01/DF1F 29 FF 00    AND #$00FF             
$01/DF22 85 E8       STA $E8    [$00:00E8]   
$01/DF24 68          PLA                     
$01/DF25 48          PHA                     
$01/DF26 20 70 E1    JSR $E170  [$01:E170]   
$01/DF29 C9 AF 00    CMP #$00AF             
$01/DF2C 90 03       BCC $03    [$DF31]     
$01/DF2E A9 AE 00    LDA #$00AE             
$01/DF31 E2 20       SEP #$20               
$01/DF33 99 1D 20    STA $201D,y[$7E:229D]   ;Adjust Attack Base according to Adjustment Ratio (Max value AE)
$01/DF36 C2 20       REP #$20               
$01/DF38 B9 28 20    LDA $2028,y[$7E:22A8]   
$01/DF3B 29 FF 00    AND #$00FF             
$01/DF3E 85 E8       STA $E8    [$00:00E8]   
$01/DF40 68          PLA                     
$01/DF41 48          PHA                     
$01/DF42 EA          NOP                     
$01/DF43 20 70 E1    JSR $E170  [$01:E170]   
$01/DF46 C9 00 01    CMP #$0100             
$01/DF49 90 03       BCC $03    [$DF4E]     
$01/DF4B A9 FF 00    LDA #$00FF             
$01/DF4E E2 20       SEP #$20               
$01/DF50 99 28 20    STA $2028,y[$7E:22A8]   ;Adjust P-Defense Multiplier according to Adjustment Ratio
$01/DF53 C2 20       REP #$20               
$01/DF55 B9 2A 20    LDA $202A,y[$7E:22AA]   
$01/DF58 29 FF 00    AND #$00FF             
$01/DF5B 85 E8       STA $E8    [$00:00E8]   
$01/DF5D 68          PLA                     
$01/DF5E 48          PHA                     
$01/DF5F 20 70 E1    JSR $E170  [$01:E170]   
$01/DF62 C9 00 01    CMP #$0100             
$01/DF65 90 03       BCC $03    [$DF6A]     
$01/DF67 A9 FF 00    LDA #$00FF             
$01/DF6A E2 20       SEP #$20               
$01/DF6C 99 2A 20    STA $202A,y[$7E:22AA]   ;Adjust P-Defense Base according to Adjustment Ratio
$01/DF6F C2 20       REP #$20               
$01/DF71 B9 22 20    LDA $2022,y[$7E:22A2]   
$01/DF74 29 FF 00    AND #$00FF             
$01/DF77 85 E8       STA $E8    [$00:00E8]   
$01/DF79 68          PLA                     
$01/DF7A 48          PHA                     
$01/DF7B 20 70 E1    JSR $E170  [$01:E170]   
$01/DF7E C9 00 01    CMP #$0100             
$01/DF81 90 03       BCC $03    [$DF86]     
$01/DF83 A9 FF 00    LDA #$00FF             
$01/DF86 E2 20       SEP #$20               
$01/DF88 99 22 20    STA $2022,y[$7E:22A2]   ;Adjust M-Defense Multiplier according to Adjustment Ratio
$01/DF8B EA          NOP                     
$01/DF8C C2 20       REP #$20               
$01/DF8E B9 24 20    LDA $2024,y[$7E:22A4]   
$01/DF91 29 FF 00    AND #$00FF             
$01/DF94 85 E8       STA $E8    [$00:00E8]   
$01/DF96 68          PLA                     
$01/DF97 48          PHA                     
$01/DF98 20 70 E1    JSR $E170  [$01:E170]   
$01/DF9B C9 00 01    CMP #$0100             
$01/DF9E 90 03       BCC $03    [$DFA3]     
$01/DFA0 A9 FF 00    LDA #$00FF             
$01/DFA3 E2 20       SEP #$20               
$01/DFA5 99 24 20    STA $2024,y[$7E:22A4]   ;Adjust M-Defense Base according to Adjustment Ratio
$01/DFA8 C2 20       REP #$20               
$01/DFAA B9 15 20    LDA $2015,y[$7E:2295]   
$01/DFAD 29 FF 00    AND #$00FF             
$01/DFB0 85 E8       STA $E8    [$00:00E8]   
$01/DFB2 68          PLA                     
$01/DFB3 48          PHA                     
$01/DFB4 20 70 E1    JSR $E170  [$01:E170]   
$01/DFB7 C9 00 01    CMP #$0100             
$01/DFBA 90 03       BCC $03    [$DFBF]     
$01/DFBC A9 FF 00    LDA #$00FF             
$01/DFBF E2 20       SEP #$20               
$01/DFC1 99 15 20    STA $2015,y[$7E:2295]   ;Adjust Agility according to Adjustment Ratio
$01/DFC4 C2 20       REP #$20               
$01/DFC6 BB          TYX                     
$01/DFC7 BD 6F 20    LDA $206F,x[$7E:22EF]   
$01/DFCA 30 36       BMI $36    [$E002]      ;Skip HP/Max Adjustment if Monster is a Boss
$01/DFCC 9E 09 20    STZ $2009,x[$7E:2289]   
$01/DFCF B9 07 20    LDA $2007,y[$7E:2287]   
$01/DFD2 AA          TAX                     
$01/DFD3 29 FF 00    AND #$00FF             
$01/DFD6 85 E8       STA $E8    [$00:00E8]   
$01/DFD8 68          PLA                     
$01/DFD9 48          PHA                     
$01/DFDA 20 70 E1    JSR $E170  [$01:E170]   
$01/DFDD 99 07 20    STA $2007,y[$7E:2287]   
$01/DFE0 8A          TXA                     
$01/DFE1 29 00 FF    AND #$FF00             
$01/DFE4 EB          XBA                     
$01/DFE5 85 E8       STA $E8    [$00:00E8]   
$01/DFE7 68          PLA                     
$01/DFE8 20 70 E1    JSR $E170  [$01:E170]   
$01/DFEB 18          CLC                     
$01/DFEC 79 08 20    ADC $2008,y[$7E:2288]   
$01/DFEF C9 00 01    CMP #$0100             
$01/DFF2 90 03       BCC $03    [$DFF7]     
$01/DFF4 A9 FF 00    LDA #$00FF             
$01/DFF7 99 08 20    STA $2008,y[$7E:2288]   
$01/DFFA B9 07 20    LDA $2007,y[$7E:2287]   
$01/DFFD 99 09 20    STA $2009,y[$7E:2289]   ;Adjust Current HP and Max HP according to Adjustment Ratio
$01/E000 80 01       BRA $01    [$E003]     
$01/E002 68          PLA                     
$01/E003 7B          TDC                     
$01/E004 AA          TAX                     
$01/E005 A8          TAY                     
$01/E006 AE 80 22    LDX $2280  [$7E:2280]   
$01/E009 AC 90 22    LDY $2290  [$7E:2290]   
$01/E00C 9C 80 22    STZ $2280  [$7E:2280]   
$01/E00F 9C 90 22    STZ $2290  [$7E:2290]   
$01/E012 E2 20       SEP #$20                ;Clean/Restore Registers
$01/E014 AD A5 28    LDA $28A5  [$7E:28A5]   
$01/E017 5C FB 90 03 JMP $0390FB[$03:90FB]   ;Back to our regularly scheduled program

This will patch cleanly.

High level Imps will still be tough, but not nearly the Death Bringers they were in the working stages.

Aso, normally higher-level monsters will level down if the ratio calls for it... I figured, what the hell, might as well. You'll level up soon enough fighting weak flamedogs and blacklizzes anyway...

I think I'm done with this patch for now.

 :edit:
The link to this patch was broken. Unfortunately, I do not have a backup of the patch at this time. I will remake one at some point. Sorry.
« Last Edit: February 17, 2015, 10:27:45 AM by chillyfeez »

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #22 on: June 22, 2014, 12:49:58 AM »
So I've been researching joypad input...

For those of you reading who actually know a thing or two about programming, the way I talk about this may expose my novice a bit. But my ideas and ambitions for what I plan to do with this knowledge are topnotch.

So, from what I've read on the subject, SNES's joypad registers are $4200 (determines if the pad is active), $4212 (determines if the pad is ready to transmit data) and $4218-4219 (a,x,l,r,1,1,1,1 - b,y,s,t,u,d,r,l buttons. Those 1s represent data that simply identify the joypad to the SNES as an actual joypad (and not a mouse or a super scope)

Anyway, this on its own is not particularly useful. If you open ffiv in Geiger's and watch the $4200 block of RAM, you won't see anything interesting. Apparently, part of the initialization at the beginning of a SNES game involves pointing to a place in RAM where controller input will be copied in (essentially) real time. So, by setting a breakpoint to read $4218 at the very start of running the ROM, I was able to find where FFIV copies controller input: $0108-0109.
Go ahead and see for yourself. Open your ffiv ROM in Geiger's and view 7E:0108-0109 in RAM. Watch what happens there when you push (and also hold down) some buttons.

Yay!

I haven't had a whole lot of time to actually do anything with this, but here's what I want to try (in ascending order of difficulty)

1. Implement a "hold B to run" function on the field, a la FFV

2. Revamp the Limit Break in my hack so that the break is truly random (instead of being determined by the lowest two bits of your HP) but the execution is controlled by the player (giving you the option to not execute)

3. Implement a "press X to switch to the next ready character" function in battle, a la ffvii - ix (and possibly others?)

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #23 on: June 22, 2014, 05:34:31 AM »
Would definitely love to see 1 and 3 as independent patches!
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #24 on: June 22, 2014, 08:19:13 AM »
I actually think 3 will end up being easier than 2 now... Or at least, I have an idea how I might make it work and if it does work it'll be pretty simple.

I'm 99% sure that Press B to Run will be super simple and ready by the end of the day.

And yes, I definitely will post patches to share them with the world!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #25 on: June 22, 2014, 01:08:35 PM »
OK, well, it ended up being "Press L to toggle running" instead of "Press B to run."
some issues came up with pressing B and a direction button simultaneously, that I could only solve by making it impossible to start or stop running while moving (which necessitated a toggle instead of being able to just hold the button).

As a little bonus, this patch allows you to press L to toggle "slow flying" while in an airship or The Whale, thus solving the difficulty involved in landing near Toroia.

The patch is below. Here's the disassembly of the changes I made:
Code: [Select]
$00/80C2 20 59 FF    JSR $FF59 ;Jump to custom
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$00/FF59 AD 0C 01    LDA $010C  [$00:010C]    ;7E:010C logs whether a button at 7E:0108 is being held down. It is 18 by default, and counts down as a button is held (jumps back to 03 when it gets to zero)
$00/FF5C C9 18       CMP #$18               
$00/FF5E D0 39       BNE $39    [$FF99]      ;Skip the process if any button at 0108 (including L) is being held (this will avoid multiple toggles on a single button push)
$00/FF60 AD 08 01    LDA $0108  [$00:0108]   
$00/FF63 29 20       AND #$20                ;Check if L is being pushed at all
$00/FF65 F0 32       BEQ $32    [$FF99]      ;If not, skip the process
$00/FF67 AD 09 01    LDA $0109  [$00:0109]   
$00/FF6A 29 0F       AND #$0F                ;Check if any d-pad button is being pressed or held
$00/FF6C D0 2B       BNE $2B    [$FF99]      ;If so, skip the process
$00/FF6E AD 04 17    LDA $1704  [$00:1704]   
$00/FF71 D0 0F       BNE $0F    [$FF82]      ;If NOT on foot, skip to the vehicle portion
$00/FF73 AD AC 06    LDA $06AC  [$00:06AC]    ;If on foot, observe current speed setting
$00/FF76 D0 05       BNE $05    [$FF7D]     
$00/FF78 EE AC 06    INC $06AC  [$00:06AC]    ;If Zero, increase to 01
$00/FF7B 80 03       BRA $03    [$FF80]      ;And skip to the end
$00/FF7D 9C AC 06    STZ $06AC  [$00:06AC]    ;If not zero, set to zero
$00/FF80 80 17       BRA $17    [$FF99]      ;And skip to the end
$00/FF82 C9 04       CMP #$04               
$00/FF84 90 13       BCC $13    [$FF99]     
$00/FF86 C9 07       CMP #$07                ;Check if current vehicle is Enterprise, Falcon or Whale
$00/FF88 B0 0F       BCS $0F    [$FF99]      ;If not, Skip the process
$00/FF8A AD AC 06    LDA $06AC  [$00:06AC]    ;If so, observe current speed setting
$00/FF8D D0 07       BNE $07    [$FF96]     
$00/FF8F A9 03       LDA #$03               
$00/FF91 8D AC 06    STA $06AC  [$00:06AC]    ;If speed is Zero, change to 03
$00/FF94 80 03       BRA $03    [$FF99]      ;And skip to the end
$00/FF96 9C AC 06    STZ $06AC  [$00:06AC]    ;If speed is not zero, set to zero
$00/FF99 AD 00 17    LDA $1700  [$00:1700]    ;(the command that was replaced at $00/80c2)
$00/FF9C 60          RTS
« Last Edit: February 17, 2015, 10:29:45 AM by chillyfeez »

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #26 on: June 22, 2014, 04:26:15 PM »
Turn Deferring with X turned out to be the super easy one, as a matter of fact!
Major assist to Grimoire LD for his Auto-Hide research here, which was essential to making this one possible.

So this works almost exactly like pressing Triangle during battle in FFIV, VIII and XI (can you defer in VI with X? I don't remember).

The only thing is, if another character or monster is taking an action at the time, you have to wait until that action is over to defer, but you CAN hold X so that the turn is deferred as soon as possible.

Patch is below.

Code: [Select]
$03/A400 5C D0 BB 04 JMP $04BBD0[$04:BBD0]    ;Jump to custom
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$04/BBD0 AD 08 01    LDA $0108  [$7E:0108]   
$04/BBD3 29 40       AND #$40                ;Check if X is being pressed or held
$04/BBD5 F0 14       BEQ $14    [$BBEB]      ;If not, skip this process
$04/BBD7 AE 30 35    LDX $3530  [$7E:3530]    ;Load current character's wait time pointer into X
$04/BBDA 9E 08 2A    STZ $2A08,x[$7E:2B35]    ;Store zero in upper byte of character's wait time
$04/BBDD 9E 09 2A    STZ $2A09,x[$7E:2B36]    ;Store zero ("waiting for next turn") in character's wait/ready status byte
$04/BBE0 A9 00       LDA #$00               
$04/BBE2 9D 07 2A    STA $2A07,x[$7E:2B34]    ;store zero in character's wait time (I originally stored a 1 here because I doubted zero would work, but it does, and it was just easier to keep it this way)
$04/BBE5 A6 A6       LDX $A6    [$00:00A6]    ;load character's stats slot into X
$04/BBE7 5C 39 A4 03 JMP $03A439[$03:A439]    ;Jump to Menu erasing routine (the one used for Edward's auto-hide)
$04/BBEB A6 A6       LDX $A6    [$00:00A6]    ;(this is where we jump to if X is not being pressed)
$04/BBED BD 00 20    LDA $2000,x[$7E:212D]    ;reapeat skipped actions at $03/A400
$04/BBF0 5C 05 A4 03 JMP $03A405[$03:A405]    ;back to our regularly scheduled programming
« Last Edit: February 17, 2015, 10:30:44 AM by chillyfeez »

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #27 on: June 23, 2014, 06:12:32 PM »
Awesome!

Although getting into a battle or changing maps resets the dashing to walking... is that the intended behaviour?
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #28 on: June 23, 2014, 07:53:03 PM »
No, that's not intentional, but I am aware of it. Oddly enough, it doesn't happen when you exit a location map to the world map.
There must be a STZ $06AC somewhere in the map loading routine. I can probably find and erase it...

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #29 on: June 24, 2014, 11:18:28 AM »
In keeping with my recent kick of non-direct gameplay mods, I've been working this morning on a mod that changes the "Stereo/Mono" option into a "Display Max HP/Display Wait Time (in battle)" option.

I've got the functional part of the coding done, just need to do some purely cosmetic cleanup before I can put this one out.
It's a little weird looking, since wait time is rarely ever more than 10 seconds, but there is space for four digit numbers (because normally Max HP is in that space), but on the whole this is a cool little thing.

I have to get ready for work now, and I don't know if I'll get to the finishing touches for a couple of days, so sorry if this is just a teaser.