FF6 Hacking
Pony Fantasy VI Remake - Printable Version

+- FF6 Hacking (https://www.ff6hacking.com/forums)
+-- Forum: Discussion Forums (https://www.ff6hacking.com/forums/forum-5.html)
+--- Forum: Dragons' Den (https://www.ff6hacking.com/forums/forum-13.html)
+--- Thread: Pony Fantasy VI Remake (/thread-3106.html)



RE: Pony Fantasy VI Remake - DrakeyC - 05-10-2016

That is definitely not a fix; changing those bytes to what you had makes the game crash.

Changing just the two bytes at 0D20 makes the damage normal, which is workable in lieu of a damage reduction. I guess it helps prevent Morph from being overpowered too, now that Terra can do it multiple times a battle. I'll take it.

So, just the battle event to figure out.


RE: Pony Fantasy VI Remake - seibaby - 05-10-2016

(05-10-2016, 04:09 PM)DrakeyC Wrote: That is definitely not a fix; changing those bytes to what you had makes the game crash.

Changing just the two bytes at 0D20 makes the damage normal, which is workable in lieu of a damage reduction. I guess it helps prevent Morph from being overpowered too, now that Terra can do it multiple times a battle. I'll take it.

So, just the battle event to figure out.

The code I posted is from vanilla. Have you applied any patches that changes the damage modification that might change the offsets of those calculations? You said the ROR $F1 was in the same place so that seems unlikely. What did you change exactly to make it crash? I'm thinking maybe you changed the F0 04 into a F0 80?  That would cause a crash. (you should change the F0, not the 04).

Anyway, NOPing the LSR $F0 and ROR $F1 works to disable the damage modification from Morph, too. Damage is two bytes long ($F0 and $F1) so you can't just change the last instruction (that'll only halve the portion of damage that is less than 256), you need to NOP the two bytes at 0D1E as well.


RE: Pony Fantasy VI Remake - DrakeyC - 05-10-2016

I copied the code as you posted it. Beyond that I have no idea what the asm shorthand you're using means. I'll try to EA the stuff I think you said, though.

EDIT - EA'd C2/0D1E to C2/0D21. Seems to work to reduce physical damage only. So, cool. From my understanding that's a more reliable fix than mine?


RE: Pony Fantasy VI Remake - seibaby - 05-10-2016

(05-10-2016, 10:15 PM)DrakeyC Wrote: I copied the code as you posted it. Beyond that I have no idea what the asm shorthand you're using means. I'll try to EA the stuff I think you said, though.

EDIT - EA'd C2/0D1E to C2/0D21. Seems to work to reduce physical damage only. So, cool. From my understanding that's a more reliable fix than mine?

You wrote EA to C2/0D1E through C2/0D21, and now Morph halves physical damage taken? And you DIDN'T write EA to C2/0D15 - C2/0D16?
The behaviour in vanilla is "halve magical damage only". NOPing the part of the code that actually does the halving should disable all damage reduction from Morph, magical or otherwise.

Then it seems likely that you've applied a patch that makes changes to damage modification, and it just so happened that what you changed fixed what you wanted to fix.  Maybe. I don't know what HatZen changed in his old patch, so you'd best ask him what this change might entail. It's possible that you didn't fix it completely. Try it on both big damage numbers and small and see.

If HatZen's old patch changed this code, and the new patch doesn't, then patching the new patch over the old will leave stuff in from the old patch. That's just how IPS files work, they only transfer things that are different between the original and modified file.

You seem satisfied with the changes though so I won't dig deeper into this. Though if you later find that you're having problems related to damage modification, you'd best ask HatZen about it. His new patch doesn't have his old source files so I can't tell what the old patch changed and what the code looks like.


Here's the full damage modification function from vanilla. You can compare your ROM with this and see which addresses are different, if any.

Code:
[color=#000000]Damage modification (Randomness, Row, Self Damage, and more)

C2/0C9E: 08           PHP
C2/0C9F: C2 20        REP #$20
C2/0CA1: AD B0 11     LDA $11B0      (Maximum Damage)
C2/0CA4: 85 F0        STA $F0
C2/0CA6: E2 20        SEP #$20       (Set 8-bit Accumulator)
C2/0CA8: AD 14 34     LDA $3414
C2/0CAB: D0 03        BNE $0CB0
C2/0CAD: 4C 3B 0D     JMP $0D3B      (Exit if $3414 = 0)
C2/0CB0: 20 5A 4B     JSR $4B5A      (Random number 0 to 255)
C2/0CB3: 09 E0        ORA #$E0       (Set bits 7,6,5; bits 0,1,2,3,4 are random)
C2/0CB5: 85 E8        STA $E8        (Random number [224..255])
C2/0CB7: 20 3D 0D     JSR $0D3D      (Damage randomness)
C2/0CBA: 18           CLC
C2/0CBB: AD A3 11     LDA $11A3
C2/0CBE: 30 04        BMI $0CC4      (Branch if Concern MP)
C2/0CC0: AD A2 11     LDA $11A2
C2/0CC3: 4A           LSR            (isolate magical vs. physical property)
C2/0CC4: AD A2 11     LDA $11A2
C2/0CC7: 89 20        BIT #$20
C2/0CC9: D0 57        BNE $0D22      (Branch if ignores defense)
C2/0CCB: 08           PHP            (save Carry flag, which equals
                                     (physical attack) AND NOT(Concern MP) )
C2/0CCC: B9 B9 3B     LDA $3BB9,Y    (Magic Defense)
C2/0CCF: 90 03        BCC $0CD4      (Branch if concern MP or Magical damage)
C2/0CD1: B9 B8 3B     LDA $3BB8,Y    (Defense)
C2/0CD4: 1A           INC
C2/0CD5: F0 10        BEQ $0CE7      (Branch if = 255)
C2/0CD7: EB           XBA
C2/0CD8: AD 82 3A     LDA $3A82
C2/0CDB: 2D 83 3A     AND $3A83
C2/0CDE: 30 03        BMI $0CE3      (If Blocked by Golem or Dog, defense = 192)
C2/0CE0: A9 C1        LDA #$C1
C2/0CE2: EB           XBA
C2/0CE3: EB           XBA
C2/0CE4: 3A           DEC
C2/0CE5: 49 FF        EOR #$FF
C2/0CE7: 85 E8        STA $E8        (= 255 - Defense)
C2/0CE9: 20 3D 0D     JSR $0D3D      (Multiply damage by (255 - Defense) / 256 ,
                                     then add 1)
C2/0CEC: A3 01        LDA $01,S
C2/0CEE: 4A           LSR
C2/0CEF: B9 F8 3E     LDA $3EF8,Y    (Status byte 3)
C2/0CF2: B0 01        BCS $0CF5      (Branch if physical attack without Concerns MP)
C2/0CF4: 0A           ASL
C2/0CF5: 0A           ASL
C2/0CF6: 10 07        BPL $0CFF      (Branch if no Safe / Shell on target)
C2/0CF8: A9 AA        LDA #$AA
C2/0CFA: 85 E8        STA $E8
C2/0CFC: 20 3D 0D     JSR $0D3D      (Multiply damage by 170 / 256 , then add 1)
C2/0CFF: 28           PLP
C2/0D00: 90 15        BCC $0D17      (Skip row check if magical attack or Concern MP)
C2/0D02: B9 A1 3A     LDA $3AA1,Y
C2/0D05: 89 02        BIT #$02
C2/0D07: F0 04        BEQ $0D0D      (Branch if target not defending)
C2/0D09: 46 F1        LSR $F1
C2/0D0B: 66 F0        ROR $F0        (Cut damage in half)
C2/0D0D: 89 20        BIT #$20       (Check row)
C2/0D0F: F0 11        BEQ $0D22      (Branch if target in front row)
C2/0D11: 46 F1        LSR $F1
C2/0D13: 66 F0        ROR $F0        (Cut damage in half)
C2/0D15: 80 0B        BRA $0D22      (Skip morph if physical attack)
C2/0D17: B9 F9 3E     LDA $3EF9,Y
C2/0D1A: 89 08        BIT #$08
C2/0D1C: F0 04        BEQ $0D22      (Branch if target not morphed)
C2/0D1E: 46 F1        LSR $F1
C2/0D20: 66 F0        ROR $F0        (Cut damage in half)
C2/0D22: C2 20        REP #$20       (Set 16-bit Accumulator)
C2/0D24: AD A4 11     LDA $11A4
C2/0D27: 4A           LSR
C2/0D28: B0 0A        BCS $0D34      (Branch if heal; heal skips self damage theory)
C2/0D2A: C0 08        CPY #$08
C2/0D2C: B0 06        BCS $0D34      (Branch if target is a monster)
C2/0D2E: E0 08        CPX #$08
C2/0D30: B0 02        BCS $0D34      (Branch if attacker is monster)
C2/0D32: 46 F0        LSR $F0        (Cut damage in half if party attacks party)
C2/0D34: A5 F0        LDA $F0    
C2/0D36: 20 0B 37     JSR $370B      (Increment damage using $BC)
C2/0D39: 85 F0        STA $F0
C2/0D3B: 28           PLP
C2/0D3C: 60           RTS



RE: Pony Fantasy VI Remake - DrakeyC - 05-11-2016

I did, he provided this.

Code:
--- Double damage ---------------------|-------------------------------
Adress: C2/0D00 to C2/0D21
Double received damage if morphed

C2/0D00    90 11        BCC $0D13    Skip if magical attack

**/****    Defense command
            
C2/0D02    B9 A1 3A    LDA $3AA1,Y
C2/0D05    89 02        BIT #$02
C2/0D07    F0 03        BEQ $0D0C    skip if not defending
            
C2/0D09    20 43 5E    JSR $5E43    cut damage in half

**/****    Back row

C2/0D0C    89 20        BIT #$20
C2/0D0E    F0 03        BEQ $0D13    skip if front row

C2/0D10    20 43 5E    JSR $5E43    cut damage in half
            
**/****    Morph

C2/0D13    B9 F9 3E    LDA $3EF9,Y
C2/0D16    89 08        BIT #$08
C2/0D18    F0 08        BEQ $0D22    skip if not morph
    
C2/0D1A    A5 F1        LDA $F1
C2/0D1C    30 04        BMI $0D22    skip if it will overflow
            
C2/0D1E    06 F0        ASL $F0
C2/0D20    26 F1        ROL $F1        double damage

Replacing all of that with the code from vanilla FF6, unedited, still had double damage happening.

If we can figure it out, cool, it'd be nice to have the option if feedback from playtesters would want the damage reduction back. But for now, I'll take a halfway solution of normal damage over the error of increased damage.

EDIT - Yeah, my damage stuff is all the same up to C2/0D00.


RE: Pony Fantasy VI Remake - seibaby - 05-11-2016

I see. It looks like his code rearranges the damage modification checks a bit, which is maybe why changing some stuff isn't working.

You can restore this whole routine to what it is in vanilla pretty easily. Do you know how to use xkas? Copy this whole thing into notepad, save it as e.g. vanilla-damage-modification.asm, then open up a command prompt in that folder and type in this:

Code:
xkas vanilla-damage-modification.asm yourromfilename.smc

NOTE: make sure your ROM is headered. If not, comment out the "header" line (add a semicolon in front of it).

Code:
hirom
header         ;comment this line out if your ROM has no header

org $C20C9E
PHP
REP #$20
LDA $11B0      ;(Maximum Damage)
STA $F0        ;
SEP #$20       ;(Set 8-bit Accumulator)
LDA $3414      ;
BNE $0CB0      ;
JMP $0D3B      ;(Exit if $3414 = 0)
JSR $4B5A      ;(Random number 0 to 255)
ORA #$E0       ;(Set bits 7,6,5; bits 0,1,2,3,4 are random)
STA $E8        ;(Random number [224..255])
JSR $0D3D      ;(Damage randomness)
CLC            ;
LDA $11A3      ;
BMI $0CC4      ;(Branch if Concern MP)
LDA $11A2      ;
LSR            ;(isolate magical vs. physical property)
LDA $11A2      ;
BIT #$20       ;
BNE $0D22      ;(Branch if ignores defense)
PHP            ;(save Carry flag, which equals
              ; (physical attack) AND NOT(Concern MP) )
LDA $3BB9,Y    ;(Magic Defense)
BCC $0CD4      ;(Branch if concern MP or Magical damage)
LDA $3BB8,Y    ;(Defense)
INC            ;
BEQ $0CE7      ;(Branch if = 255)
XBA            ;
LDA $3A82      ;
AND $3A83      ;
BMI $0CE3      ;(If Blocked by Golem or Dog, defense = 192)
LDA #$C1       ;
XBA            ;
XBA            ;
DEC            ;
EOR #$FF       ;
STA $E8        ;(= 255 - Defense)
JSR $0D3D      ;(Multiply damage by (255 - Defense) / 256 ,
              ; then add 1)
LDA $01,S      ;
LSR            ;
LDA $3EF8,Y    ;(Status byte 3)
BCS $0CF5      ;(Branch if physical attack without Concerns MP)
ASL            ;
ASL            ;
BPL $0CFF      ;(Branch if no Safe / Shell on target)
LDA #$AA       ;
STA $E8        ;
JSR $0D3D      ;(Multiply damage by 170 / 256 , then add 1)
PLP            ;
BCC $0D17      ;(Skip row check if magical attack or Concern MP)
LDA $3AA1,Y    ;
BIT #$02       ;
BEQ $0D0D      ;(Branch if target not defending)
LSR $F1        ;
ROR $F0        ;(Cut damage in half)
BIT #$20       ;(Check row)
BEQ $0D22      ;(Branch if target in front row)
LSR $F1        ;
ROR $F0        ;(Cut damage in half)
BRA $0D22      ;(Skip morph if physical attack)
LDA $3EF9,Y    ;
BIT #$08       ;
BEQ $0D22      ;(Branch if target not morphed)
LSR $F1        ;
ROR $F0        ;(Cut damage in half)
REP #$20       ;(Set 16-bit Accumulator)
LDA $11A4      ;
LSR            ;
BCS $0D34      ;(Branch if heal; heal skips self damage theory)
CPY #$08       ;
BCS $0D34      ;(Branch if target is a monster)
CPX #$08       ;
BCS $0D34      ;(Branch if attacker is monster)
LSR $F0        ;(Cut damage in half if party attacks party)
LDA $F0        ;
JSR $370B      ;(Increment damage using $BC)
STA $F0
PLP
RTS



RE: Pony Fantasy VI Remake - DrakeyC - 05-11-2016

Seems to work for physical damage, not magical. Dunno if that's by design?


RE: Pony Fantasy VI Remake - DrakeyC - 05-13-2016

An event snag. I'm editing the Ancient Castle intro event, and my sorcerer's new sprite is on Palette 6. This unfortunately means when he is tinted yellow (the other sprites are not) and when he petrifies Odin and Odin goes greyscale, the sorcerer does too. Not sure what to do to stop that. My Odin sprite, for now, is on Palette 2. Here's the code to tint the screen and petrify Odin.

Code:
CC/1CA9: B0    Execute the following commands until $B1 6 times
CC/1CAB: 50        Tint screen (cumulative) with color $9F
CC/1CAD: B1        End block of repeating commands
CC/1CAE: B0    Execute the following commands until $B1 1 times
CC/1CB0: 50        Tint screen (cumulative) with color $3B
CC/1CB2: 50        Tint screen (cumulative) with color $87
CC/1CB4: B1        End block of repeating commands
CC/1CB5: B0    Execute the following commands until $B1 8 times
CC/1CB7: 50        Tint screen (cumulative) with color $87
CC/1CB9: B1        End block of repeating commands
CC/1CBA: 58    Shake screen ($F5):
               (Intensity: 1))
               (Permanance and ???: 1))
               (Layer 1 affected)
               (Layer 2 affected)
               (Layer 3 affected)
               (Sprite layer affected)
CC/1CBC: 60    Change background layer $0E to palette $15

Code:
CC/1E16: 61    Colorize color range [$E0, $E1] to color $07
CC/1E1A: 91    Pause for 15 units
CC/1E1B: F4    Play sound effect 9
CC/1E1D: 61    Colorize color range [$E2, $E3] to color $07
CC/1E21: 91    Pause for 15 units
CC/1E22: F4    Play sound effect 9
CC/1E24: 61    Colorize color range [$E4, $E5] to color $07
CC/1E28: 91    Pause for 15 units
CC/1E29: F4    Play sound effect 9
CC/1E2B: 61    Colorize color range [$E6, $E7] to color $07
CC/1E2F: 91    Pause for 15 units
CC/1E30: F4    Play sound effect 9
CC/1E32: 61    Colorize color range [$E8, $E9] to color $07
CC/1E36: 91    Pause for 15 units
CC/1E37: F4    Play sound effect 9
CC/1E39: 61    Colorize color range [$EA, $EB] to color $07
CC/1E3D: 91    Pause for 15 units
CC/1E3E: F4    Play sound effect 9
CC/1E40: 61    Colorize color range [$EC, $ED] to color $07
CC/1E44: 91    Pause for 15 units
CC/1E45: F4    Play sound effect 9
CC/1E47: 61    Colorize color range [$EE, $EF] to color $07



RE: Pony Fantasy VI Remake - Gi Nattak - 05-13-2016

You're gonna hafta just make Odin palette 7, and change all those colorize color range commands to F instead of E, so like [$E0, $E1] would become [$F0, $F1] E tells it to color in palette 6 objects, F is for palette 7. So this way it would color palette 7 Odin and not your palette 6 character.

Remember to change this to $0F as well as this is what colors Odin to his correct palette:
CC/1CBC: 60 Change background layer $0E to palette $15


RE: Pony Fantasy VI Remake - DrakeyC - 05-13-2016

A partial success; my Palette 6 character is all greyscale from appearing, now. Odin petrifies okay though.

For future reference, Odin *has* to be Palette 7? Can't put him on Palette 5 and make it D0, D1? For now Odin is just a placeholder sprite but if there's restrictions I'll let Rydel know.