øAslickproductions.org/forum/index.php?PHPSESSID=ijifg99cphd3cdqlogqmclvmj6&topic=1850.msg19099e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index566f.htmlslickproductions.org/forum/index.php?topic=1850.15e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index566f.html.zxȼh^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ ¡µ OKtext/htmlISO-8859-1gzip0|ÖÿÿÿÿÿÿÿÿWed, 11 Mar 2020 10:42:41 GMT0ó°° ®0®P®€§²ð®ȼh^ÿÿÿÿÿÿÿÿXF Changing details of Dark Wave

Author Topic: Changing details of Dark Wave  (Read 6831 times)

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Changing details of Dark Wave
« Reply #15 on: September 02, 2013, 06:04:11 PM »
I haven't taken a good look, but in theory it should be around the Dark Wave specialty sections of RAM, likely close to the HP decrease routine. I'm not sure what the data looks like in pure hex, but seeing it on a monster should give me some idea.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Changing details of Dark Wave
« Reply #16 on: September 02, 2013, 08:42:30 PM »
Alright, I think I found what we're looking for, but it's another unfortunate piece of news...

In RAM....

0x03848E - A9 80 - LDA 80 - This appears to be the "Creature Type check" byte. It's not actually a 1, but a low number from 1-9 it appears. It seems to be separated into bits. 8X = HP Damage (Changing that gets Really weird, really fast), 0 = Undead byte apparently, since it seems to be bit 0 according to Yousei's old notes. Now the problem is that changing this byte to other things may not cause the desired result. It's a very good possibility that this 80 is used for other things and possibly many other things as seeing when its changed in specific manners attacking monsters will die on the spot.

In this case the smart thing to do would be to take the JMP to 038489 (JSR 8489) and somehow reroute it to another LDA 80 (or what have you) that will return using the same measures. But I somewhat doubt that could be done without writing custom code unfortunately and finding spare space for it because  I believe this 80 is just matching it against the monster's type and deciding damage from there.

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Changing details of Dark Wave
« Reply #17 on: September 02, 2013, 09:36:20 PM »
More code would be helpful for figuring out what it's actually doing with that value. (and you're still calling SNES addressing RAM :tongue:)

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Changing details of Dark Wave
« Reply #18 on: September 02, 2013, 10:07:07 PM »
Heh, old habits die hard I suppose...

Now the around that area is pretty messy, but I'll grab it and see if you can't figure something out... starting from what I think is the relevant portion... though a warning, it is very long.

Code: [Select]
$03/E76F 85 CA STA $CA    [$00:00CA] A:0000 X:0000 Y:0000 P:envMxdiZc
$03/E771 A5 C7 LDA $C7    [$00:00C7] A:0000 X:0000 Y:0000 P:envMxdiZc
$03/E773 AA TAX A:0006 X:0000 Y:0000 P:envMxdizc
$03/E774 BD 40 35 LDA $3540,x[$7E:3546] A:0006 X:0006 Y:0000 P:envMxdizc
$03/E777 D0 68 BNE $68    [$E7E1] A:0000 X:0006 Y:0000 P:envMxdiZc
$03/E779 A5 C7 LDA $C7    [$00:00C7] A:0000 X:0006 Y:0000 P:envMxdiZc
$03/E77B 20 89 84 JSR $8489  [$03:8489] A:0006 X:0006 Y:0000 P:envMxdizc

$03/8489 8D 2F 35 STA $352F  [$7E:352F] A:0006 X:0006 Y:0000 P:envMxdizc
$03/848C 85 DF STA $DF    [$00:00DF] A:0006 X:0006 Y:0000 P:envMxdizc
$03/848E A9 80 LDA #$80 A:0006 X:0006 Y:0000 P:envMxdizc - (Looks to be where the game grabs the 80 for Dark Wave)
$03/8490 85 E1 STA $E1    [$00:00E1] A:0080 X:0006 Y:0000 P:eNvMxdizc
$03/8492 20 E0 83 JSR $83E0  [$03:83E0] A:0080 X:0006 Y:0000 P:eNvMxdizc

$03/83E0 64 E0 STZ $E0    [$00:00E0] A:0080 X:0006 Y:0000 P:eNvMxdizc
$03/83E2 64 E2 STZ $E2    [$00:00E2] A:0080 X:0006 Y:0000 P:eNvMxdizc
$03/83E4 C2 20 REP #$20 A:0080 X:0006 Y:0000 P:eNvMxdizc
$03/83E6 A2 10 00 LDX #$0010 A:0080 X:0006 Y:0000 P:eNvmxdizc
$03/83E9 64 E3 STZ $E3    [$00:00E3] A:0080 X:0010 Y:0000 P:envmxdizc
$03/83EB 9C 4D 39 STZ $394D  [$7E:394D] A:0080 X:0010 Y:0000 P:envmxdizc
$03/83EE 66 E1 ROR $E1    [$00:00E1] A:0080 X:0010 Y:0000 P:envmxdizc
$03/83F0 90 09 BCC $09    [$83FB] A:0080 X:0010 Y:0000 P:envmxdizc
$03/83FB 6E 4D 39 ROR $394D  [$7E:394D] A:0080 X:0010 Y:0000 P:envmxdizc
$03/83FE 66 E3 ROR $E3    [$00:00E3] A:0080 X:0010 Y:0000 P:envmxdiZc
$03/8400 CA DEX A:0080 X:0010 Y:0000 P:envmxdiZc
$03/8401 D0 EB BNE $EB    [$83EE] A:0080 X:000F Y:0000 P:envmxdizc
$03/83EE 66 E1 ROR $E1    [$00:00E1] A:0080 X:000F Y:0000 P:envmxdizc
$03/83F0 90 09 BCC $09    [$83FB] A:0080 X:000F Y:0000 P:envmxdizc
(Data decrementing, skipping...)

$03/8403 7B TDC A:0006 X:0000 Y:0000 P:envmxdiZc
$03/8404 E2 20 SEP #$20 A:0000 X:0000 Y:0000 P:envmxdiZc
$03/8406 60 RTS A:0000 X:0000 Y:0000 P:envMxdiZc
-------------------
$03/8495 A6 E3 LDX $E3    [$00:00E3] A:0000 X:0000 Y:0000 P:envMxdiZc
$03/8497 86 A6 STX $A6    [$00:00A6] A:0000 X:0300 Y:0000 P:envMxdizc
$03/8499 AD 2F 35 LDA $352F  [$7E:352F] A:0000 X:0300 Y:0000 P:envMxdizc
$03/849C 85 DF STA $DF    [$00:00DF] A:0006 X:0300 Y:0000 P:envMxdizc
$03/849E A9 15 LDA #$15 A:0006 X:0300 Y:0000 P:envMxdizc
$03/84A0 85 E1 STA $E1    [$00:00E1] A:0015 X:0300 Y:0000 P:envMxdizc
$03/84A2 20 E0 83 JSR $83E0  [$03:83E0] A:0015 X:0300 Y:0000 P:envMxdizc

$03/83E0 64 E0 STZ $E0    [$00:00E0] A:0015 X:0300 Y:0000 P:envMxdizc
$03/83E2 64 E2 STZ $E2    [$00:00E2] A:0015 X:0300 Y:0000 P:envMxdizc
$03/83E4 C2 20 REP #$20 A:0015 X:0300 Y:0000 P:envMxdizc
$03/83E6 A2 10 00 LDX #$0010 A:0015 X:0300 Y:0000 P:envmxdizc
$03/83E9 64 E3 STZ $E3    [$00:00E3] A:0015 X:0010 Y:0000 P:envmxdizc
$03/83EB 9C 4D 39 STZ $394D  [$7E:394D] A:0015 X:0010 Y:0000 P:envmxdizc
$03/83EE 66 E1 ROR $E1    [$00:00E1] A:0015 X:0010 Y:0000 P:envmxdizc
$03/83F0 90 09 BCC $09    [$83FB] A:0015 X:0010 Y:0000 P:envmxdizC
$03/83F2 18 CLC A:0015 X:0010 Y:0000 P:envmxdizC
$03/83F3 A5 DF LDA $DF    [$00:00DF] A:0015 X:0010 Y:0000 P:envmxdizc
$03/83F5 6D 4D 39 ADC $394D  [$7E:394D] A:0006 X:0010 Y:0000 P:envmxdizc
(As above, it loops a timer or something... skipping)
---------------------

$03/8401 D0 EB BNE $EB    [$83EE] A:0007 X:0000 Y:0000 P:envmxdiZc
$03/8403 7B TDC A:0007 X:0000 Y:0000 P:envmxdiZc
$03/8404 E2 20 SEP #$20 A:0000 X:0000 Y:0000 P:envmxdiZc
$03/8406 60 RTS A:0000 X:0000 Y:0000 P:envMxdiZc
$03/84A5 A6 E3 LDX $E3    [$00:00E3] A:0000 X:0000 Y:0000 P:envMxdiZc
$03/84A7 8E 30 35 STX $3530  [$7E:3530] A:0000 X:007E Y:0000 P:envMxdizc
$03/84AA AD 2F 35 LDA $352F  [$7E:352F] A:0000 X:007E Y:0000 P:envMxdizc
$03/84AD 85 DF STA $DF    [$00:00DF] A:0006 X:007E Y:0000 P:envMxdizc
$03/84AF A9 37 LDA #$37 A:0006 X:007E Y:0000 P:envMxdizc
$03/84B1 85 E1 STA $E1    [$00:00E1] A:0037 X:007E Y:0000 P:envMxdizc
$03/84B3 20 E0 83 JSR $83E0  [$03:83E0] A:0037 X:007E Y:0000 P:envMxdizc

(Repeat of Data we've seen before it's jumping to the exact same place)

$03/84B6 A6 E3 LDX $E3    [$00:00E3] A:0000 X:0000 Y:0000 P:envMxdiZc
$03/84B8 8E 32 35 STX $3532  [$7E:3532] A:0000 X:014A Y:0000 P:envMxdizc
$03/84BB AD 2F 35 LDA $352F  [$7E:352F] A:0000 X:014A Y:0000 P:envMxdizc
$03/84BE 85 DF STA $DF    [$00:00DF] A:0006 X:014A Y:0000 P:envMxdizc
$03/84C0 A9 1C LDA #$1C A:0006 X:014A Y:0000 P:envMxdizc
$03/84C2 85 E1 STA $E1    [$00:00E1] A:001C X:014A Y:0000 P:envMxdizc
$03/84C4 20 E0 83 JSR $83E0  [$03:83E0] A:001C X:014A Y:0000 P:envMxdizc

(As above)

$03/84C7 A6 E3 LDX $E3    [$00:00E3] A:0000 X:0000 Y:0000 P:envMxdiZc
$03/84C9 8E 34 35 STX $3534  [$7E:3534] A:0000 X:00A8 Y:0000 P:envMxdizc
$03/84CC AD 2F 35 LDA $352F  [$7E:352F] A:0000 X:00A8 Y:0000 P:envMxdizc
$03/84CF AA TAX A:0006 X:00A8 Y:0000 P:envMxdizc
$03/84D0 8E 3D 39 STX $393D  [$7E:393D] A:0006 X:0006 Y:0000 P:envMxdizc
$03/84D3 A2 20 01 LDX #$0120 A:0006 X:0006 Y:0000 P:envMxdizc
$03/84D6 8E 3F 39 STX $393F  [$7E:393F] A:0006 X:0120 Y:0000 P:envMxdizc
$03/84D9 20 B9 83 JSR $83B9  [$03:83B9] A:0006 X:0120 Y:0000 P:envMxdizc

$03/83B9 C2 20 REP #$20 A:0006 X:0120 Y:0000 P:envMxdizc
$03/83BB A2 10 00 LDX #$0010 A:0006 X:0120 Y:0000 P:envmxdizc
$03/83BE 9C 41 39 STZ $3941  [$7E:3941] A:0006 X:0010 Y:0000 P:envmxdizc
$03/83C1 9C 43 39 STZ $3943  [$7E:3943] A:0006 X:0010 Y:0000 P:envmxdizc
$03/83C4 6E 3F 39 ROR $393F  [$7E:393F] A:0006 X:0010 Y:0000 P:envmxdizc
$03/83C7 90 0A BCC $0A    [$83D3] A:0006 X:0010 Y:0000 P:envmxdizc
$03/83D3 6E 43 39 ROR $3943  [$7E:3943] A:0006 X:0010 Y:0000 P:envmxdizc
$03/83D6 6E 41 39 ROR $3941  [$7E:3941] A:0006 X:0010 Y:0000 P:envmxdiZc
$03/83D9 CA DEX A:0006 X:0010 Y:0000 P:envmxdiZc
$03/83DA D0 E8 BNE $E8    [$83C4] A:0006 X:000F Y:0000 P:envmxdizc
$03/83C4 6E 3F 39 ROR $393F  [$7E:393F] A:0006 X:000F Y:0000 P:envmxdizc
$03/83C7 90 0A BCC $0A    [$83D3] A:0006 X:000F Y:0000 P:envmxdizc
(Repeated data, ignored...)

$03/83DC 7B TDC A:0006 X:0000 Y:0000 P:envmxdiZc
$03/83DD E2 20 SEP #$20 A:0000 X:0000 Y:0000 P:envmxdiZc
$03/83DF 60 RTS A:0000 X:0000 Y:0000 P:envMxdiZc

$03/84DC AE 41 39 LDX $3941  [$7E:3941] A:0000 X:0000 Y:0000 P:envMxdiZc
$03/84DF 8E 36 35 STX $3536  [$7E:3536] A:0000 X:06C0 Y:0000 P:envMxdizc
$03/84E2 60 RTS A:0000 X:06C0 Y:0000 P:envMxdizc

$03/E77E A6 A6 LDX $A6    [$00:00A6] A:0000 X:06C0 Y:0000 P:envMxdizc - (Back into the main subroutine)

$03/E780 BD 03 20 LDA $2003,x[$7E:2303] A:0000 X:0300 Y:0000 P:envMxdizc
$03/E783 29 C0 AND #$C0 A:0000 X:0300 Y:0000 P:envMxdiZc
$03/E785 D0 5A BNE $5A    [$E7E1] A:0000 X:0300 Y:0000 P:envMxdiZc
$03/E787 BD 05 20 LDA $2005,x[$7E:2305] A:0000 X:0300 Y:0000 P:envMxdiZc - (Looking at Monster's status?)

$03/E78A 29 02 AND #$02 A:0000 X:0300 Y:0000 P:envMxdiZc
$03/E78C D0 53 BNE $53    [$E7E1] A:0000 X:0300 Y:0000 P:envMxdiZc
$03/E78E BD 06 20 LDA $2006,x[$7E:2306] A:0000 X:0300 Y:0000 P:envMxdiZc - (Looking at third byte of Monster status?)

$03/E791 30 4E BMI $4E    [$E7E1] A:0000 X:0300 Y:0000 P:envMxdiZc
$03/E793 BD 40 20 LDA $2040,x[$7E:2340] A:0000 X:0300 Y:0000 P:envMxdiZc - (Look at Monster's Creature Type)

$03/E796 29 48 AND #$48 A:0080 X:0300 Y:0000 P:eNvMxdizc
$03/E798 D0 47 BNE $47    [$E7E1] A:0000 X:0300 Y:0000 P:envMxdiZc
$03/E79A A5 C1 LDA $C1    [$00:00C1] A:0000 X:0300 Y:0000 P:envMxdiZc
$03/E79C F0 0D BEQ $0D    [$E7AB] A:0001 X:0300 Y:0000 P:envMxdizc
$03/E79E BD 40 20 LDA $2040,x[$7E:2340] A:0001 X:0300 Y:0000 P:envMxdizc
$03/E7A1 10 08 BPL $08    [$E7AB] A:0080 X:0300 Y:0000 P:eNvMxdizc
$03/E7A3 46 CA LSR $CA    [$00:00CA] A:0080 X:0300 Y:0000 P:eNvMxdizc
$03/E7A5 66 C9 ROR $C9    [$00:00C9] A:0080 X:0300 Y:0000 P:envMxdiZc
$03/E7A7 46 CA LSR $CA    [$00:00CA] A:0080 X:0300 Y:0000 P:envMxdizC
$03/E7AB A5 C1 LDA $C1    [$00:00C1] A:0080 X:0300 Y:0000 P:envMxdizc
$03/E7AD D0 20 BNE $20    [$E7CF] A:0001 X:0300 Y:0000 P:envMxdizc
$03/E7CF A6 C9 LDX $C9    [$00:00C9] A:0001 X:0300 Y:0000 P:envMxdizc
$03/E7D1 F0 F7 BEQ $F7    [$E7CA] A:0001 X:0006 Y:0000 P:envMxdizc
$03/E7D3 A5 C7 LDA $C7    [$00:00C7] A:0001 X:0006 Y:0000 P:envMxdizc
$03/E7D5 0A ASL A A:0006 X:0006 Y:0000 P:envMxdizc
$03/E7D6 AA TAX A:000C X:0006 Y:0000 P:envMxdizc
$03/E7D7 A5 C9 LDA $C9    [$00:00C9] A:000C X:000C Y:0000 P:envMxdizc
$03/E7D9 9D D4 34 STA $34D4,x[$7E:34E0] A:0006 X:000C Y:0000 P:envMxdizc

$03/E7DC A5 CA LDA $CA    [$00:00CA] A:0006 X:000C Y:0000 P:envMxdizc
$03/E7DE 9D D5 34 STA $34D5,x[$7E:34E1] A:0000 X:000C Y:0000 P:envMxdiZc
$03/E7E1 E6 C7 INC $C7    [$00:00C7] A:0000 X:000C Y:0000 P:envMxdiZc
$03/E7E3 A5 C7 LDA $C7    [$00:00C7] A:0000 X:000C Y:0000 P:envMxdizc
$03/E7E5 C5 C3 CMP $C3    [$00:00C3] A:0007 X:000C Y:0000 P:envMxdizc
$03/E7E7 F0 03 BEQ $03    [$E7EC] A:0007 X:000C Y:0000 P:eNvMxdizc
$03/E7E9 4C 5B E7 JMP $E75B  [$03:E75B] A:0007 X:000C Y:0000 P:eNvMxdizc
$03/E75B 7B TDC A:0007 X:000C Y:0000 P:eNvMxdizc
$03/E75C AA TAX A:0000 X:000C Y:0000 P:envMxdiZc
$03/E75D A5 C5 LDA $C5    [$00:00C5] A:0000 X:0000 Y:0000 P:envMxdiZc
$03/E75F 20 79 83 JSR $8379  [$03:8379] A:000F X:0000 Y:0000 P:envMxdizc

And I think by this point we have left the proper subroutine... I could be wrong though.

I saw only one addition of 80 throughout that entire thing and it's in a spot that seems to be accessed by a lot of battle matters. 80 looks to be the Undead byte if the Zombie's Monster data is anything to go off of.

And here's the thing that really gets me... if I try to change the Creature Look up type as shown above nothing appears to happen, but if I change the 80 to something else (that doesn't make the game go strange) then Dark Wave's Zombie resistance is gone. I am really quite confused by this. I found this by placing a breakpoint on the Monster's creature type and to see what accessed it.
« Last Edit: September 02, 2013, 10:27:24 PM by Grimoire LD »

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Changing details of Dark Wave
« Reply #19 on: September 06, 2013, 02:26:34 AM »
Alright, so by replacing both instance of 7E2040 to say... 7E1400 that should disable the Zombie Check... (I embarrassingly can still not find a way to change the type it resists)

In HiRom/LoRom at...

03E793 - BD 40 20 - LDA from 2040 - Creature Type Byte
03E79E - BD 40 20 - LDA from 2040 - Creature Type Byte

In ROM at...

01E993 - BD 40 20 - LDA from 2040 - Creature Type Byte
01E99E - BD 40 20 - LDA from 2040 - Creature Type Byte

Change these both to BD 00 14 and the Zombie check should be disabled.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Changing details of Dark Wave
« Reply #20 on: September 08, 2013, 08:40:20 PM »
Looking at my previous code I've decided to test things in a more empirical fashion and stumbled, completely by accident, upon the damage reduction routine for Zombie Types, but this two byte null also had the unexpected effect of making Zombies Weak to Dark Wave. As in they were dealt full weapon damage as if each one had been hit by Cecil's normal attack.

In LoRom/HiRom...

03E7A3 - 46 CA (LSR 0xCA) - Logical Shift Right the Value in CA. (Appears to be Zombie's damage reduction formula, unique to the normal Dark Wave damage formula.)

Nor curiously two bytes away there is another 46 CA which I thought was used for the general enemy being hit by Dark Wave but it doesn't appear to do anything.

03E7A1 is skipped by normal monsters and jumps t 03E7AB

Oh! Now I understand...

03E7A1 is a Branch if Plus to E7AB! 0080 (Zombie) is the Only Creature type that falls into a Negative Counter at 80. (-127)! And that's how the game looks at it. Though I cannot think of any easy way to change that now that I Truly understand how the game looks at the 80 and compares it. I'll take a look at my available instructions to use.


chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Changing details of Dark Wave
« Reply #21 on: September 08, 2013, 09:39:37 PM »
Could you just change the BCS to E7AB (or is it a BCC) to a non-conditional JMP to E7AB (which would, essentially, just logically make the check for Zombie type irrelevant)?

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Changing details of Dark Wave
« Reply #22 on: September 08, 2013, 09:48:14 PM »
Yes, you could Very easily do that. It might be a little safer actually since I'm not really sure what 1400 uses.

However I would love to switch the type it resists (or is super effective) against. Something like a straight CMP 04 to make Reptiles (in The After Years the creature type is referred to as Demon, I can see either being applicable in some respects, they're definitely not Insects as FF4A tries to claim) resistant or weak to Dark Wave (or if we can ever find the graphic and palette for it, "Light Wave" if someone wants to make it super effective against Zombie/Demon types)

But that BPL 08 (Branch-if-plus to E7AB) is a very small command doesn't lend itself to changing the stuff around it very well. I would ideally have it CMP and Break if otherwise...

But your idea to use a BCS should work fine. A BCC might allow a success to get through somehow.

 :edit:
Alright! I figured it out completely now! With this new bit of coding you can have any enemy type weak to Dark Wave!

I must Note though it is Only making them weak to Dark Wave. The reasoning is because one of the new instructions erased the main "resist" check that divides the damage, therefore delivering normal damage, so while it will still only have Zombies resist it you can say, have Dragons or Demon/Reptiles weak to it. But because it is looking for a specific value in a byte you cannot have multi-type foes (like D. Bone Dragon/Zombie) be weak to it.

Dark Wave - Make Enemy Type XX weak to it in LoRom/HiRom

Creature Types in Hex -

00 - None
01 - Dragon
02 - Robot
04 - Reptile
08 - Spirit
10 - Giant
20 - Sime
40 - Mage
80 - Zombie

Code: [Select]
0x03E793 - BD  40 20 (LDA 2040) - Unsure of what it does, but change this if you are changing the value below.

0x03E79E - BD 40 20 (LDA 2040) - Loads Creature Type. The more ambitious hacker might want to change this to have it look at another value. Say that you want it to instead Load an Elemental Weakness check you would change it to BD2020 for Weakness.

0x03E7A1 - C9 XX  (CMP XX) - Compare Creature Type
0x03E7A3 - D0 06 (BNE 06) - If it is not the same value as above, Jump 9 Bytes (6+3?) to skip this routine.

ROM at...

Code: [Select]
0x1E993 - BD  40 20 (LDA 2040) - Unsure of what it does, but change this if you are changing the value below.

0x1E99E - BD 40 20 (LDA 2040) - Loads Creature Type. The more ambitious hacker might want to change this to have it look at another value. Say that you want it to instead Load an Elemental Weakness check you would change it to BD2020 for Weakness, or if you want it to look at a specific Status Ailment, (a use for Poison maybe?) then you would change it to BD0420 and have C9 look for 01.

0x1E9A1 - C9 XX  (CMP XX) - Compare Creature Type
0x1E9A3 - D0 06 (BNE 06) - If it is not the same value as above, Jump 9 Bytes (6+3?) to skip this routine.

What this does is get rid of the LSR CA which was decrementing the damage and allows the chosen type to play out as full weapon damage.




« Last Edit: September 08, 2013, 11:36:37 PM by Grimoire LD »

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Changing details of Dark Wave
« Reply #23 on: October 07, 2013, 10:50:56 AM »
You wanted information on Dark Wave? You got it! (Repost from my main thread as it is pertinent to what was requested)

Dark Wave Routine -
Code: [Select]
$03/E9E9 A5 CD LDA $CD    [$00:00CD] A:0003 X:000A Y:0000 P:envMxdizc - Load User's ID.
$03/E9EB 30 26 BMI $26    [$EA13] A:0000 X:000A Y:0000 P:envMxdiZc - Is it Minus? (Enemy Cecil) If so, branch to 03EA13.
$03/E9ED C2 20 REP #$20 A:0000 X:000A Y:0000 P:envMxdiZc - Reset Processor Status
$03/E9EF A6 A6 LDX $A6    [$00:00A6] A:0000 X:000A Y:0000 P:envmxdiZc - Load User's Slot.
$03/E9F1 BD 09 20 LDA $2009,x[$7E:2009] A:0000 X:0000 Y:0000 P:envmxdiZc - Load User's Max HP.
$03/E9F4 20 85 84 JSR $8485  [$03:8485] A:00C8 X:0000 Y:0000 P:envmxdizc - Jump to Subroutine
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
$03/8485 4A LSR A A:00C8 X:0000 Y:0000 P:envmxdizc - /2 A.
$03/8486 4A LSR A A:0064 X:0000 Y:0000 P:envmxdizc - /2 A.
$03/8487 4A LSR A A:0032 X:0000 Y:0000 P:envmxdizc - /2 A.
$03/8488 60 RTS A:0019 X:0000 Y:0000 P:envmxdizc - Return
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$03/E9F7 85 A9 STA $A9    [$00:00A9] A:0019 X:0000 Y:0000 P:envmxdizc - Store A in A9. (Amount of HP to subtract)
$03/E9F9 38 SEC A:0019 X:0000 Y:0000 P:envmxdizc - Set Carry Flag.
$03/E9FA BD 07 20 LDA $2007,x[$7E:2007] A:0019 X:0000 Y:0000 P:envmxdizC - Load User's Current HP.
$03/E9FD E5 A9 SBC $A9    [$00:00A9] A:002C X:0000 Y:0000 P:envmxdizC - Reduce A by the value in A9 (1/8th of Max HP)
$03/E9FF 9D 07 20 STA $2007,x[$7E:2007] A:0013 X:0000 Y:0000 P:envmxdizC - Store A in User's Current HP.
$03/EA02 B0 0C BCS $0C    [$EA10] A:0013 X:0000 Y:0000 P:envmxdizC - If greater than 00 branch to 03EA10.
---------------------------------------------------------------------------------------------------------------------------------------
$03/EA04 A9 00 00 LDA #$0000 A:FFFA X:0000 Y:0000 P:eNvmxdizc - Load 0000 into A.
$03/EA07 9D 07 20 STA $2007,x[$7E:2007] A:0000 X:0000 Y:0000 P:envmxdiZc - Store A in User's Current HP.
$03/EA0A A9 80 00 LDA #$0080 A:0000 X:0000 Y:0000 P:envmxdiZc - Load 0080 into A. (Death)
$03/EA0D 9D 03 20 STA $2003,x[$7E:2003] A:0080 X:0000 Y:0000 P:envmxdizc - Store A in 7E2003.
------------------------------------------------------------------------------------------------------------------------------------------
$03/EA10 7B TDC A:0013 X:0000 Y:0000 P:envmxdizC - Transfer Direct Page
$03/EA11 E2 20 SEP #$20 A:0000 X:0000 Y:0000 P:envmxdiZC - Set Processor Status.
$03/EA13 A9 01 LDA #$01 A:0000 X:0000 Y:0000 P:envMxdiZC - Load 01 into A.
$03/EA15 85 C1 STA $C1    [$00:00C1] A:0001 X:0000 Y:0000 P:envMxdizC - Store A in C1 (Used in the Kick Routine)
$03/EA17 4C B9 E6 JMP $E6B9  [$03:E6B9] A:0001 X:0000 Y:0000 P:envMxdizC - Jump to Routine (Most of Kick Routine)

Well that was quite a bit simpler this time around, everything was easily deciphered.

First, I've decided to make Dark Wave's death penalty more substantial...


$03/EA04   A9 00 00   LDA #$0000   A:FFF8   X:0000   Y:0000   P:eNvmxdizc - Load 0000 into A.
$03/EA07   9D 07 20   STA $2007,x[$7E:2007]   A:0000   X:0000   Y:0000   P:envmxdiZc - Store A in User's HP.
$03/EA0A   A9 80 00   LDA #$0080   A:0000   X:0000   Y:0000   P:envmxdiZc - Load 0080 into A.
$03/EA0D   9D 40 20   STA $2040,x[$7E:2040]   A:0080   X:0000   Y:0000   P:envmxdizc - Store A in User's Creature Type (Undead)


I'm going to go out on a limb and say this is what it May have originally been, or at least planned. Because setting the HP to 0 automatically will kill the user regardless, making the Death Application superfluous. This will prevent the player from being able to revive Cecil if he killed himself with Dark Wave, as it applied the Undead-type to him.

Furthermore the jump to Kick is basically reading the entirely of the Kick Routine, meaning that you could Easily set it to the Fight Routine and have Dark Wave hit only a single target, now unfortunately, it would then only act like a normal attack without modifying the Fight Routine or Dark Wave Routine itself to compensate the new addition to it.

For instance, say you want to make Dark Wave more like Darkness in FFIV:DS, an attack that hits one enemy for Double Damage, but takes HP.

You would change...

$03/EA10   7B    TDC   A:0013   X:0000   Y:0000   P:envmxdizC - Transfer Direct Page
$03/EA11   E2 20   SEP #$20   A:0000   X:0000   Y:0000   P:envmxdiZC - Set Processor Status.
$03/EA13   A9 01   LDA #$01   A:0000   X:0000   Y:0000   P:envMxdiZC - Load 01 into A.
$03/EA15   85 C1   STA $C1    [$00:00C1]   A:0001   X:0000   Y:0000   P:envMxdizC - Store A in C1 (Used in the Kick Routine)
$03/EA17   4C B9 E6   JMP $E6B9  [$03:E6B9]   A:0001   X:0000   Y:0000   P:envMxdizC - Jump to Routine (Most of Kick Routine)

To this...

$03/EA10   E2 20   SEP #$20   A:0039   X:0000   Y:0000   P:envmxdizC - Set Processor Status (in order to have it read only one byte rather than two)
$03/EA12   A9 04   LDA #$04   A:0039   X:0000   Y:0000   P:envMxdizC - Load 04 into A. (x2 Power)
$03/EA14   8D FE 38   STA $38FE  [$7E:38FE]   A:0004   X:0000   Y:0000   P:envMxdizC - Store A in Damage Altering Field.
$03/EA17   4C 99 C4   JMP $C499  [$03:C499]   A:0004   X:0000   Y:0000   P:envMxdizC - Jump to Fight Routine.

As long as the enemy itself has no weakness or resistance to the Elemental or Creature Type Attack, then Dark Wave will carry through as a normal attack at x2 Damage. Otherwise those variables will nullify it and replace it with an ordinary one.

Or if you want to make Dark Wave cast a Spell at 1/8th of your HP you would instead...

$03/EA10   E2 20   SEP #$20   A:0039   X:0000   Y:0000   P:envmxdizC - Set Processor Status (in order to have it read only one byte rather than two)
$03/EA12   A9 A2   LDA #$A2   A:0039   X:0000   Y:0000   P:envMxdizC - Load A2 into A. (Emission)
$03/EA14   8D D2 26   STA $26D2  [$7E:26D2]   A:00A2   X:0000   Y:0000   P:envMxdizC - Store A in Next Action to take.
$03/EA17   4C 3E CD   JMP $CD3E  [$03:CD3E]   A:00A2   X:0000   Y:0000   P:envMxdizC - Jump to Spell Routine.

But it is not that simple. The Magic Call seems to put the Caster stats above all else and will put that in initial stats at the end of the routine, meaning that if you want Dark Wave to cast a spell that hurts Cecil 1/8 HP you would also bear this in mind and change an earlier part of the routine...

Change this...

$03/E9FA   BD 07 20   LDA $2007,x[$7E:2007]   A:0019   X:0000   Y:0000   P:envmxdizC - Load User's Current HP.
$03/E9FD   E5 A9   SBC $A9    [$00:00A9]   A:002C   X:0000   Y:0000   P:envmxdizC - Reduce A by the value in A9 (1/8th of Max HP)
$03/E9FF   9D 07 20   STA $2007,x[$7E:2007]   A:0013   X:0000   Y:0000   P:envmxdizC - Store A in User's Current HP.
$03/EA02   B0 0C   BCS $0C    [$EA10]   A:0013   X:0000   Y:0000   P:envmxdizC - If greater than 00 branch to 03EA10.
---------------------------------------------------------------------------------------------------------------------------------------
$03/EA04   A9 00 00   LDA #$0000   A:FFFA   X:0000   Y:0000   P:eNvmxdizc - Load 0000 into A.
$03/EA07   9D 07 20   STA $2007,x[$7E:2007]   A:0000   X:0000   Y:0000   P:envmxdiZc - Store A in User's Current HP.
$03/EA0A   A9 80 00   LDA #$0080   A:0000   X:0000   Y:0000   P:envmxdiZc - Load 0080 into A. (Death)
$03/EA0D   9D 03 20   STA $2003,x[$7E:2003]   A:0080   X:0000   Y:0000   P:envmxdizc - Store A in 7E2003.

To this...

$03/E9FA   BD 87 26   LDA $2687,x[$7E:2687]   A:0019   X:0000   Y:0000   P:envmxdizC - Load Caster's Current HP.
$03/E9FD   E5 A9   SBC $A9    [$00:00A9]   A:0079   X:0000   Y:0000   P:envmxdizC - Subtract it by the value in A9.
$03/E9FF   8D 87 26   STA $2687,[$7E:2687]   A:0060   X:0000   Y:0000   P:envmxdizC - Store A in Caster's Current HP.
$03/EA02   B0 0C   BCS $0C    [$EA10]   A:0060   X:0000   Y:0000   P:envmxdizC - If more than 00 branch to 03EA02.
----------------------------------------------------------------------------------------------------------------------
$03/EA04   A9 00 00   LDA #$0000   A:FFFA   X:0000   Y:0000   P:eNvmxdizc - Load 0000 into A. - Load 0000 into A.
$03/EA07   8D 87 26   STA $2687, [$7E:2687]   A:0000   X:0000   Y:0000   P:envmxdiZc - Store A in User's Current HP. - Store A in Caster
$03/EA0A   A9 80 00   LDA #$0080   A:0000   X:0000   Y:0000   P:envmxdiZc - Load 0080 into A. (Death)
$03/EA0D   8D 03 20   STA $2003, [$7E:2003]   A:0080   X:0000   Y:0000   P:envmxdizc - Store A in 7E2003.

And there you have it. Two different ways to modify Dark Wave, one is to simulate Darkness from FFIV:DS and the other is to allow it to cast a spell, if one actually wanted to use something more complex than Kick's routine or normal attack modification.


fedorajoe

  • Mom Bomb
  • *
  • Posts: 123
  • Gender: Male
  • "G...Golbez!"
    • View Profile
Re: Changing details of Dark Wave
« Reply #24 on: September 07, 2016, 11:35:45 AM »
Forgive me for thread necromancy, but did anyone ever get around to making a Gil Toss command out of Dark?

I'd like to have Gil Toss for my next project and thought Dark was the logical choice.  This thread had a great breakdown of how the command works but I'm not sure, for example, what value you'd use to swap HP for gil.

Thanks!
:cookie:

Bahamut ZERO

  • Cagnazzo
  • *
  • Posts: 347
  • Gender: Male
  • If ye're takin a beatin, hop in de back row!
    • View Profile
Re: Changing details of Dark Wave
« Reply #25 on: September 07, 2016, 12:14:07 PM »
Hmm from looking at a post before your's the HP portion of the code is this chunk:

Quote
$03/E9FA   BD 07 20   LDA $2007,x[$7E:2007]   A:0019   X:0000   Y:0000   P:envmxdizC - Load User's Current HP.
$03/E9FD   E5 A9   SBC $A9    [$00:00A9]   A:002C   X:0000   Y:0000   P:envmxdizC - Reduce A by the value in A9 (1/8th of Max HP)
$03/E9FF   9D 07 20   STA $2007,x[$7E:2007]   A:0013   X:0000   Y:0000   P:envmxdizC - Store A in User's Current HP.
$03/EA02   B0 0C   BCS $0C    [$EA10]   A:0013   X:0000   Y:0000   P:envmxdizC - If greater than 00 branch to 03EA10.


Granted, I have no knowledge in ASM to help change it from HP Loss to Gil loss, but this looks like a nice spot to start off with.  :banonsmash:
I update my graphics thread on almost a daily basis, so keep an eye out for new stuff!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Changing details of Dark Wave
« Reply #26 on: September 07, 2016, 11:23:05 PM »
BZ's mostly right about what would need to be changed, except he left out the part where the amount of HP (GP) to subtract is determined.
The problem you'd face in making it all work is that GP is a three-byte value, versus HP which is only two bytes. SNES can only calculate two-byte values. So the way the amount is calculated - as well as possibly the way it's subtracted - would have to be adjusted. I guess. I mean, you could just ignore the lowest byte of GP, I suppose. You'd also want to up the damage done by the attack, right? When I was theorizing about this, I was thinking that it'd be like the gil toss in FFV, which deals a very large amount of damage.
I mean, I can help with this, probably, but I'd need specifics about what you'd want the command to do.

fedorajoe

  • Mom Bomb
  • *
  • Posts: 123
  • Gender: Male
  • "G...Golbez!"
    • View Profile
Re: Changing details of Dark Wave
« Reply #27 on: September 08, 2016, 12:00:40 AM »
Wow, thank you!

The ideal situation, for my project, would be a similar system to The After Years:  damage and gil spent = level x 30 per enemy.

This is an ability you'd have right near the beginning so I wouldn't want it to be too overpowered.  With that said, if you'd already posted a way to do it FFV or FFVI style I would have simply used your code with no complaints! :)

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Changing details of Dark Wave
« Reply #28 on: September 08, 2016, 03:00:14 PM »
No, I haven't made any gil toss command yet. Anything I said here or anywhere else about it was just theoretical musing. But it's definitely something I can do.
So, what you're looking for...
If I understand correctly, the damage formula would look like:

D = 30 x L x T

where
D is the damage output (as well as amount of gil spent)
L is the caster (attacker)'s level
T is the number of living targets in the target party
and D is divided evenly among all living targets, such that a level 30 character deals 900 damage to all targets, regardless of how many targets are on the field, but spends 900 gil for one target, 1800 gil for two targets, 2700 gil for three targets, etc.

Did I get that right?

Also, I'm assuming we want different results if the player doesn't have enough gil. I'm not sure which of the following would be easiest to do, but tell me your preference:
A) When the player has some - but not enough - gil, the command deals the "right" amount of damage, but entirely wipes out the last of the player's gil (e.g., a level 30 player with 1800 gil attacking three targets deals 900 damage to all three targets and ends up with zero gil)
B) When the player has some - but not enough - gil, the command fails outright and the player retains that small amount of gil
C) When the player has some - but not enough - gil, the command deals a prorated amount of damage and entirely wipes out the last of the player's gil (e.g., a level 30 player with 1800 gil attacking three targets deals 600 damage to all three targets - instead of 900 - and ends up with zero gil)
note: regardless of which method above is used, I assume the command should fail outright if the player has zero gil to begin with

I'll have to write in a custom damage calculation in order to make this all possible, so I'll need to know the following as well:
1) Does your ROM have a header?
2) Has any custom assembly been written into your ROM (this does not include any edits made with FF4kster or most other editors, but does most likely include augmentation patches, such as my User Options or Break Damage Limit patches)
3) If you open your ROM in a hex editor and jump to offset 1F410 (with a header, or 1F210 without), are there seven lines of FFs there?

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: Changing details of Dark Wave
« Reply #29 on: September 08, 2016, 03:56:43 PM »
Since this is a  custom project you may implement whatever you need, but if I was you I would implement as its in other installments of FF. Besides 30* Level will mean you will never reach 9999dmg.

In FFV Gil Toss:
Code: [Select]
Gil cost = 50 * Level * (# of targets attacked)
Damage = (Attack - Defense) * M
  Attack = Level + 10
  M = 150
  Defense = Enemy Defense

Personally I find it a neat formula, because you cant abuse it vs bosses (supposedly they have high def) and it doesnt do a constant damage as in FFVI (as far as I remember)