øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1883.msg20482e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index8441.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1883.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index8441.html.zxg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ'+£OKtext/htmlISO-8859-1gzip0|Ö+£ÿÿÿÿÿÿÿÿTue, 10 Mar 2020 05:00:12 GMT0ó°° ®0®P®€§²ð®g^ÿÿÿÿÿÿÿÿÝ^+£ Grimoire LD's Notes, Patches, and Hacks (Dark Knight/Paladin Swap In Battle!)

Author Topic: Grimoire LD's Notes, Patches, and Hacks (Dark Knight/Paladin Swap In Battle!)  (Read 78645 times)

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
@Chillyfeez - I must be, thanks for the reminder.

Alright, now that I know more about Banks thanks to Dragonsbrethren lets try something new... and that is recording data anywhere I can find it (if I can understand what its doing)

Start of Game
Code: [Select]
$00/8290 9C 00 17 STZ $1700  [$00:1700] A:0000 X:1000 Y:2000 P:envMxdIZC
$00/8293 9C 01 17 STZ $1701  [$00:1701] A:0000 X:1000 Y:2000 P:envMxdIZC
$00/8296 9C 03 17 STZ $1703  [$00:1703] A:0000 X:1000 Y:2000 P:envMxdIZC
$00/8299 9C 0F 17 STZ $170F  [$00:170F] A:0000 X:1000 Y:2000 P:envMxdIZC
$00/829C 9C 12 17 STZ $1712  [$00:1712] A:0000 X:1000 Y:2000 P:envMxdIZC
$00/829F 9C 18 17 STZ $1718  [$00:1718] A:0000 X:1000 Y:2000 P:envMxdIZC
$00/82A2 9C 1C 17 STZ $171C  [$00:171C] A:0000 X:1000 Y:2000 P:envMxdIZC
$00/82A5 9C 20 17 STZ $1720  [$00:1720] A:0000 X:1000 Y:2000 P:envMxdIZC
$00/82A8 9C 24 17 STZ $1724  [$00:1724] A:0000 X:1000 Y:2000 P:envMxdIZC
$00/82AB 9C 28 17 STZ $1728  [$00:1728] A:0000 X:1000 Y:2000 P:envMxdIZC
$00/82AE 9C 2B 17 STZ $172B  [$00:172B] A:0000 X:1000 Y:2000 P:envMxdIZC
$00/82B1 9C 1B 17 STZ $171B  [$00:171B] A:0000 X:1000 Y:2000 P:envMxdIZC
$00/82B4 9C 1F 17 STZ $171F  [$00:171F] A:0000 X:1000 Y:2000 P:envMxdIZC
$00/82B7 9C 23 17 STZ $1723  [$00:1723] A:0000 X:1000 Y:2000 P:envMxdIZC
$00/82BA 9C 27 17 STZ $1727  [$00:1727] A:0000 X:1000 Y:2000 P:envMxdIZC -  All of this Simply means Get rid of any and all Map Locations being Saved.
$00/82BD A2 00 00 LDX #$0000 A:0000 X:1000 Y:2000 P:envMxdIZC - Load 0000 into X.
$00/82C0 8E 2C 17 STX $172C  [$00:172C] A:0000 X:0000 Y:2000  - Store 0000 in... wait a second! You just stored Zero there!
$00/82C3 A2 00 00 LDX #$0000 A:0000 X:0000 Y:2000 P:envMxdIZC - Load 0000 into X (this better be because of a loop...)
---------------------------------------------------------------------------------------(Looping Point)-------------------------------------------------------------------
$00/82C6 BF 00 F2 12 LDA $12F200,x[$12:F200] A:0000 X:0000 Y:2000 P:envMxdIZC - Load sequence of bytes starting from 12F200, looks to be something dealing with default NPC placements.
$00/82CA 9D E0 12 STA $12E0,x[$00:12E0] A:00DB X:0000 Y:2000 P:eNvMxdIzC - Store in 12E0 (NPC Placements?)
$00/82CD E8 INX A:00DB X:0000 Y:2000 P:eNvMxdIzC - +1 to X.
$00/82CE E0 40 00 CPX #$0040 A:00DB X:0001 Y:2000 P:envMxdIzC - Do this 40 times more (one for each area?)
$00/82D1 D0 F3 BNE $F3    [$82C6] A:00DB X:0001 Y:2000 P:eNvMxdIzc - Loop back to start of this process.
----------------------------------------------------------------------Looping Point-------------------------------------------------------------------------
$00/82D6 BF 40 F2 12 LDA $12F240,x[$12:F240] A:00FF X:0000 Y:2000 P:envMxdIZC - Load A from 12F240 (Default NPC Visibility Arrangements?)
$00/82DA 9D 80 12 STA $1280,x[$00:1280] A:0000 X:0000 Y:2000 P:envMxdIZC - Store A in Default-NPC visibility area.
$00/82DD E8 INX A:0000 X:0000 Y:2000 P:envMxdIZC - +1 to X.
$00/82DE E0 20 00 CPX #$0020 A:0000 X:0001 Y:2000 P:envMxdIzC - Do this 20 times more (I'm no longer sure. Obviously there are more than 32 maps!)
$00/82E1 D0 F3 BNE $F3    [$82D6] A:0000 X:0001 Y:2000 P:eNvMxdIzc - Loop back to start of Process.
-------------------------------------------------------------------------Looping Point-------------------------------------------------------
$00/82E3 A2 00 00 LDX #$0000 A:0000 X:0020 Y:2000 P:envMxdIZC - Load 0000 into X.
$00/82E6 9E A0 12 STZ $12A0,x[$00:12A0] A:0000 X:0000 Y:2000 P:envMxdIZC - Store Zero in Default Treasure Areas.
$00/82E9 E8 INX A:0000 X:0000 Y:2000 P:envMxdIZC - +1 to X
$00/82EA E0 20 00 CPX #$0020 A:0000 X:0001 Y:2000 P:envMxdIzC - Do this 20 times more (There are more than 32 maps!)
$00/82ED D0 F7 BNE $F7    [$82E6] A:0000 X:0001 Y:2000 P:eNvMxdIzc - Loop back to Start of Process.
----------------------------------------------------------------------
$00/82EF A9 FE LDA #$FE A:0000 X:0020 Y:2000 P:envMxdIZC - Load Sort.
$00/82F1 8D 9C 14 STA $149C  [$00:149C] A:00FE X:0020 Y:2000 P:eNvMxdIzC - Store Sort in Items.
$00/82F4 A9 FF LDA #$FF A:00FE X:0020 Y:2000 P:eNvMxdIzC - Load TrashCan into A.
$00/82F6 8D 9E 14 STA $149E  [$00:149E] A:00FF X:0020 Y:2000 P:eNvMxdIzC - Store Trashcan in Items.
$00/82F9 A9 01 LDA #$01 A:00FF X:0020 Y:2000 P:eNvMxdIzC - Load Quantity of 1.
$00/82FB 8D 9D 14 STA $149D  [$00:149D] A:0001 X:0020 Y:2000 P:envMxdIzC - Store A in Sort Amount.
$00/82FE 8D 9F 14 STA $149F  [$00:149F] A:0001 X:0020 Y:2000 P:envMxdIzC - Store A in Trashcan Amount.
$00/8301 60 RTS A:0001 X:0020 Y:2000 P:envMxdIzC - Return.

Well... that wasn't as enlightening as I'd hoped it would be... by any stretch. At the start of game the game clears NPC sets, NPC placements, Treasures Found, and loads Sort and Trashcan into items... let's hope the next piece of code is better than this.

Start of Game Part 2 -

Code: [Select]
$00/805C 20 D0 92 JSR $92D0  [$00:92D0] A:0001 X:0020 Y:2000 P:envMxdIzC - Jump to Subroutine
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
$00/92D0 A2 00 00 LDX #$0000 A:0001 X:0020 Y:2000 P:envMxdIzC - Load 0000 into X.
$00/92D3 A0 00 00 LDY #$0000 A:0001 X:0000 Y:2000 P:envMxdIZC - Load 0000 into Y.
------------------------------------------------------------------Looping Point--------------------------------------------------------------------------
$00/92D6 BF 00 A9 0F LDA $0FA900,x[$0F:A900] A:0001 X:0000 Y:0000 P:envMxdIZC - Load Character 1 from ROM.
$00/92DA 99 00 10 STA $1000,y[$00:1000] A:0081 X:0000 Y:0000 P:eNvMxdIzC - Store A in Character Slot 1.
$00/92DD E8 INX A:0081 X:0000 Y:0000 P:eNvMxdIzC - +1 to X.
$00/92DE C8 INY A:0081 X:0001 Y:0000 P:envMxdIzC - +1 to Y.
$00/92DF C0 14 00 CPY #$0014 A:0081 X:0001 Y:0001 P:envMxdIzC - Do this for each pertinent stat.
$00/92E2 D0 F2 BNE $F2    [$92D6] A:0081 X:0001 Y:0001 P:eNvMxdIzc - Loop back to start of process
------------------------------------------------------------------------------
$00/92E4 A0 00 00 LDY #$0000 A:0003 X:0014 Y:0014 P:envMxdIZC - Load 0000 into Y.
------------------------------------------------------Looping Point-------------------------------------------------
$00/92E7 BF 00 A9 0F LDA $0FA900,x[$0F:A914] A:0003 X:0014 Y:0000 P:envMxdIZC - Load Character 1's Default Critical Hit Chance into A. )
$00/92EB 99 2D 10 STA $102D,y[$00:102D] A:0002 X:0014 Y:0000 P:envMxdIzC - Store A in Slot's Critical Hit Chance.
$00/92EE E8 INX A:0002 X:0014 Y:0000 P:envMxdIzC - +1 to X
$00/92EF C8 INY A:0002 X:0015 Y:0000 P:envMxdIzC - +1 to Y.
$00/92F0 C0 03 00 CPY #$0003 A:0002 X:0015 Y:0001 P:envMxdIzC - Do this for Critical Hit Chance/Critical Bonus Damage/And ?Steal Evade?
$00/92F3 D0 F2 BNE $F2    [$92E7] A:0002 X:0015 Y:0001 P:eNvMxdIzc - Loop back to start of process.
-----------------------------------------------------------------------
$00/92F5 A0 00 00 LDY #$0000 A:000A X:0017 Y:0003 P:envMxdIZC - Load 0000 into Y.
--------------------------------------------------------------------------Looping Point---------------------------------------------------------------------
$00/92F8 BF 00 A9 0F LDA $0FA900,x[$0F:A917] A:000A X:0017 Y:0000 P:envMxdIZC - Load Experience to Level Up (etc)
$00/92FC 99 37 10 STA $1037,y[$00:1037] A:00B8 X:0017 Y:0000 P:eNvMxdIzC - Store A in Experience (etc)
$00/92FF E8 INX A:00B8 X:0017 Y:0000 P:eNvMxdIzC +1 X
$00/9300 C8 INY A:00B8 X:0018 Y:0000 P:envMxdIzC +1 Y
$00/9301 C0 09 00 CPY #$0009 A:00B8 X:0018 Y:0001 P:envMxdIzC - Do this 9 more times.
$00/9304 D0 F2 BNE $F2    [$92F8] A:00B8 X:0018 Y:0001 P:eNvMxdIzc - Loop back to start of process.
----------------------------------------------------------------------
$00/9306 A0 00 00 LDY #$0000 A:0000 X:0020 Y:0009 P:envMxdIZC - Load 0000 into Y.
$00/9309 84 3D STY $3D    [$00:063D] A:0000 X:0020 Y:0000 P:envMxdIZC - Store Y in ?Current Encounter? Wha?
$00/930B 20 5E E6 JSR $E65E  [$00:E65E] A:0000 X:0020 Y:0000 P:envMxdIZC - Jump to Subroutine
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$00/E65E A9 00 LDA #$00 A:0000 X:0020 Y:0000 P:envMxdIZC - Load 00 into A.
$00/E660 4C 6E E6 JMP $E66E  [$00:E66E] A:0000 X:0020 Y:0000 P:envMxdIZC - Jump to... E bytes away! Come on Square! Make this a Branch Always, not a Jump.
-----------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------
$00/E66E 85 07 STA $07    [$00:0607] A:0000 X:0020 Y:0000 P:envMxdIZC - Store A in 07.
$00/E670 0A ASL A A:0000 X:0020 Y:0000 P:envMxdIZC - x2 A
$00/E671 0A ASL A A:0000 X:0020 Y:0000 P:envMxdIZc - x2 A
$00/E672 0A ASL A A:0000 X:0020 Y:0000 P:envMxdIZc -x2 A
$00/E673 38 SEC A:0000 X:0020 Y:0000 P:envMxdIZc - Set Carry Flag.
$00/E674 E5 07 SBC $07    [$00:0607] A:0000 X:0020 Y:0000 P:envMxdIZC - Subtract A from the value in 0607.
$00/E676 AA TAX A:0000 X:0020 Y:0000 P:envMxdIZC - Transfer A to X.
$00/E677 A9 07 LDA #$07 A:0000 X:0000 Y:0000 P:envMxdIZC - Load 07 into A.
$00/E679 85 07 STA $07    [$00:0607] A:0007 X:0000 Y:0000 P:envMxdIzC - Store A in 0607
$00/E67B A4 3D LDY $3D    [$00:063D] A:0007 X:0000 Y:0000 P:envMxdIzC - Load 063D into Y (why...?)
-------------------------------------------------------------Looping Point-------------------------------------------
(This section of data might also be used by Actors taken in from Shadow Slots or Fresh)
$00/E67D BF 00 AB 0F LDA $0FAB00,x[$0F:AB00] A:0007 X:0000 Y:0000 P:envMxdIZC - Load starting equipment of character into A.
$00/E681 99 30 10 STA $1030,y[$00:1030] A:006E X:0000 Y:0000 P:envMxdIzC - Store A in Character's Equipment Section.
$00/E684 E8 INX A:006E X:0000 Y:0000 P:envMxdIzC - +1 X
$00/E685 C8 INY A:006E X:0001 Y:0000 P:envMxdIzC - +1 Y
$00/E686 C6 07 DEC $07    [$00:0607] A:006E X:0001 Y:0001 P:envMxdIzC - Subtract A from the value in 0607?
$00/E688 D0 F3 BNE $F3    [$E67D] A:006E X:0001 Y:0001 P:envMxdIzC - Loop back to start of process.
------------------------------------------------------------------
$00/E68A 46 3E LSR $3E    [$00:063E] A:0001 X:0007 Y:0007 P:envMxdIZC - /2 063E.
$00/E68C 66 3D ROR $3D    [$00:063D] A:0001 X:0007 Y:0007 P:envMxdIZc - /2 063D
$00/E68E A5 3D LDA $3D    [$00:063D] A:0001 X:0007 Y:0007 P:envMxdIZc - Load 063D into A.
$00/E690 4A LSR A A:0000 X:0007 Y:0007 P:envMxdIZc - /2 A
$00/E691 4A LSR A A:0000 X:0007 Y:0007 P:envMxdIZc - /2 A
$00/E692 4A LSR A A:0000 X:0007 Y:0007 P:envMxdIZc - /2 A
$00/E693 4A LSR A A:0000 X:0007 Y:0007 P:envMxdIZc - /2 A
$00/E694 4A LSR A A:0000 X:0007 Y:0007 P:envMxdIZc - /2 A
$00/E695 22 06 80 03 JSL $038006[$03:8006] A:0000 X:0007 Y:0007 P:envMxdIZc - Jump to Subroutine... in the Battle Bank?
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$03/8006 4C 36 80 JMP $8036  [$03:8036] A:0000 X:0007 Y:0007 P:envMxdIZc - Jump to a byte 36 bytes away (Cute. So instead of jumping directly to it with the above JSL you instead waste more bytes by making this instruction jump 30 bytes away with 3 bytes instead of branching with 2. - All that's in there seems to be battle resetting stuff.
--------------------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++
$00/E699 60 RTS A:0000 X:0007 Y:0007 P:envMxdIZc - Return
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$00/930E A9 00 LDA #$00 A:0000 X:0007 Y:0007 P:envMxdIZc - Load 00 into A
$00/9310 22 06 80 03 JSL $038006[$03:8006] A:0000 X:0007 Y:0007 P:envMxdIZc - Jump to Same Exact Subroutine as above.
$00/9314 60 RTS A:0000 X:0007 Y:0007 P:envMxdIZc - Return
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$00/805F 22 3E C2 15 JSL $15C23E[$15:C23E] A:0000 X:0007 Y:0007 P:envMxdIZc - Jump to Rom - (Spells put in Spellbooks)

I think that's enough for tonight.






Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile

Normal Shadow Slot procedure.

Code: [Select]
$00/E6B9 B9 00 10 LDA $1000,y[$00:1040] A:0000 X:0001 Y:0040 P:envMxdizc - Load Indexed Slot ID from A
$00/E6BC 29 1F AND #$1F A:0084 X:0001 Y:0040 P:eNvMxdizc - Check character's ID.
$00/E6BE DD D5 09 CMP $09D5,x[$00:09D6] A:0004 X:0001 Y:0040 P:envMxdizc - Is it the same as the value in 09D6 (What ID the event is looking to remove)
$00/E6C1 F0 17 BEQ $17    [$E6DA] A:0004 X:0001 Y:0040 P:envMxdiZC - If so branch to 00E6DA
-----------------------------------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------------------------------
$00/E6DA BD D5 09 LDA $09D5,x[$00:09D6] A:0004 X:0001 Y:0040 P:envMxdiZC - Load Slot ID into A.
$00/E6DD 3A DEC A A:0004 X:0001 Y:0040 P:envMxdizC - -1 to A.
$00/E6DE AA TAX A:0003 X:0001 Y:0040 P:envMxdizC - Transfer A to X.
$00/E6DF BD 1D E7 LDA $E71D,x[$00:E720] A:0003 X:0003 Y:0040 P:envMxdizC - Load A from 7EE71D (first I've ever seen this address)
$00/E6E2 30 31 BMI $31    [$E715] A:0000 X:0003 Y:0040 P:envMxdiZC - Branch if minus to 00E715.
$00/E6E4 C2 20 REP #$20 A:0000 X:0003 Y:0040 P:envMxdiZC - Reset Processor Status (for two bytes in A)
$00/E6E6 0A ASL A A:0000 X:0003 Y:0040 P:envmxdiZC
$00/E6E7 0A ASL A A:0000 X:0003 Y:0040 P:envmxdiZc
$00/E6E8 0A ASL A A:0000 X:0003 Y:0040 P:envmxdiZc
$00/E6E9 0A ASL A A:0000 X:0003 Y:0040 P:envmxdiZc
$00/E6EA 0A ASL A A:0000 X:0003 Y:0040 P:envmxdiZc
$00/E6EB 0A ASL A A:0000 X:0003 Y:0040 P:envmxdiZc - x12 A.
$00/E6EC 85 40 STA $40    [$00:0640] A:0000 X:0003 Y:0040 P:envmxdiZc - Store A in 0640.
$00/E6EE A9 00 00 LDA #$0000 A:0000 X:0003 Y:0040 P:envmxdiZc - Load 0000 into A (why not just use a TDC?)
$00/E6F1 E2 20 SEP #$20 A:0000 X:0003 Y:0040 P:envmxdiZc - Set Processor Status back to one byte.
$00/E6F3 A9 40 LDA #$40 A:0000 X:0003 Y:0040 P:envMxdiZc - Load 40 into A. (Amount of times to loop)
$00/E6F5 85 07 STA $07    [$00:0607] A:0040 X:0003 Y:0040 P:envMxdizc - Store A in 0607.
$00/E6F7 A6 3D LDX $3D    [$00:063D] A:0040 X:0003 Y:0040 P:envMxdizc - Store X in 063D.
$00/E6F9 A4 40 LDY $40    [$00:0640] A:0040 X:0040 Y:0040 P:envMxdizc - Load Y from 40.
--------------------------------------------------------Looping Point-----------------------------------------------------------------------------------
$00/E6FB BD 00 10 LDA $1000,x[$00:1040] A:0040 X:0040 Y:0000 P:envMxdiZc - Load Character ID into A. (+ other stats)
$00/E6FE 99 40 11 STA $1140,y[$00:1140] A:0084 X:0040 Y:0000 P:eNvMxdizc - Store A in Shadow Slot.
$00/E701 E8 INX A:0084 X:0040 Y:0000 P:eNvMxdizc - +1 X
$00/E702 C8 INY A:0084 X:0041 Y:0000 P:envMxdizc - +1 Y
$00/E703 C6 07 DEC $07    [$00:0607] A:0084 X:0041 Y:0001 P:envMxdizc - -1 to 0607.
$00/E705 D0 F4 BNE $F4    [$E6FB] A:0084 X:0041 Y:0001 P:envMxdizc - If not 00 loop back to start of process.
-------------------------------------------------------------
$00/E707 A6 40 LDX $40    [$00:0640] A:0000 X:0080 Y:0040 P:envMxdiZc - Load 0040 into X.
$00/E709 9E 43 11 STZ $1143,x[$00:1143] A:0000 X:0000 Y:0040 P:envMxdiZc
$00/E70C 9E 44 11 STZ $1144,x[$00:1144] A:0000 X:0000 Y:0040 P:envMxdiZc 
$00/E70F 9E 45 11 STZ $1145,x[$00:1145] A:0000 X:0000 Y:0040 P:envMxdiZc
$00/E712 9E 46 11 STZ $1146,x[$00:1146] A:0000 X:0000 Y:0040 P:envMxdiZc - Store Zero in Shadow Slot's Status Bytes.
$00/E715 A6 3D LDX $3D    [$00:063D] A:0000 X:0000 Y:0040 P:envMxdiZc - Load 063D into A.
$00/E717 9E 00 10 STZ $1000,x[$00:1040] A:0000 X:0040 Y:0040 P:envMxdizc - Store Zero in Slot's ID.
$00/E71A 4C D3 E0 JMP $E0D3  [$00:E0D3] A:0000 X:0040 Y:0040 P:envMxdizc - Jump to 00E0D3.
(Unrelated it appears)

Hmm... so we will need part of data that is empty enough for 14x40 bytes which is 500 bytes. That's asking a lot for a section or RAM... I'll take a look though and see if there's any such place, but I somewhat doubt it. Ah well...

Damage Panels

Code: [Select]
$00/9601 BD 07 10 LDA $1007,x[$00:1007] A:0000 X:0000 Y:0003 P:envmxdizC - Load slot's HP.
$00/9604 F0 11 BEQ $11    [$9617] A:089D X:0000 Y:0003 P:envmxdizC - If 00 skip to end.
$00/9606 38 SEC A:089D X:0000 Y:0003 P:envmxdizC - Set Carry Flag.
$00/9607 E9 32 00 SBC #$0032 A:089D X:0000 Y:0003 P:envmxdizC - -50 HP.
$00/960A 9D 07 10 STA $1007,x[$00:1007] A:086B X:0000 Y:0003 P:envmxdizC - Store A in Slot's HP.

Easy enough to change the damage Damage Panels inflict, even above 255 if so desired because it was used in two bytes.

Big Chocobo Code

Big Chocobo Code -

Code: [Select]
$01/CF8F BD 40 14 LDA $1440,x[$7E:1442] A:0002 X:0002 Y:0468 P:envMxdizc - Load Indexed Item.
$01/CF92 F0 0C BEQ $0C    [$CFA0] A:00CE X:0002 Y:0468 P:eNvMxdizc - If 00 branch to 01CFA0
$01/CF94 C9 19 CMP #$19 A:00CE X:0002 Y:0468 P:eNvMxdizc - Is it the Legend Sword?
$01/CF96 F0 08 BEQ $08    [$CFA0] A:00CE X:0002 Y:0468 P:eNvMxdizC - If so branch to 01CFA0.
$01/CF98 C9 C8 CMP #$C8 A:00CE X:0002 Y:0468 P:eNvMxdizC -Is it the Crystal?
$01/CF9A F0 04 BEQ $04    [$CFA0] A:00CE X:0002 Y:0468 P:envMxdizC - If so branch to 01CFA0.
$01/CF9C C9 EE CMP #$EE A:00CE X:0002 Y:0468 P:envMxdizC - Is it Package or above? (Key Items)
$01/CF9E 90 02 BCC $02    [$CFA2] A:00CE X:0002 Y:0468 P:eNvMxdizc - If not, branch to 01CFA2.
$01/CFA2 A9 7E LDA #$7E A:00CE X:0002 Y:0468 P:eNvMxdizc - Load 7E into A.
$01/CFA4 85 45 STA $45    [$00:0145] A:007E X:0002 Y:0468 P:envMxdizc - Store A in 45.
$01/CFA6 A4 41 LDY $41    [$00:0141] A:007E X:0002 Y:0468 P:envMxdizc - Load Y from 41.
$01/CFA8 B9 40 13 LDA $1340,y[$7E:1340] A:007E X:0002 Y:0000 P:envMxdiZc - Load A from 1340+y.
$01/CFAB F0 23 BEQ $23    [$CFD0] A:0000 X:0002 Y:0000 P:envMxdiZc - If 00 branch to 01CFD0.
$01/CFD0 BD 40 14 LDA $1440,x[$7E:1442] A:0000 X:0002 Y:0000 P:envMxdiZc - Load item indexed by X.
$01/CFD3 99 40 13 STA $1340,y[$7E:1340] A:00CE X:0002 Y:0000 P:eNvMxdizc - Store item into location indexed by y.
$01/CFD6 BD 41 14 LDA $1441,x[$7E:1443] A:00CE X:0002 Y:0000 P:eNvMxdizc - Load item quantity indexed by x.
$01/CFD9 18 CLC A:0003 X:0002 Y:0000 P:envMxdizc - Clear Carry Flag.
$01/CFDA 79 41 13 ADC $1341,y[$7E:1341] A:0003 X:0002 Y:0000 P:envMxdizc - Add the quantity onto the already existing quantity.
$01/CFDD 99 41 13 STA $1341,y[$7E:1341] A:0003 X:0002 Y:0000 P:envMxdizc - Store Item quantity in Big Chocobo inventory.
$01/CFE0 9E 40 14 STZ $1440,x[$7E:1442] A:0003 X:0002 Y:0000 P:envMxdizc - Store Zero in indexed item x.
$01/CFE3 9E 41 14 STZ $1441,x[$7E:1443] A:0003 X:0002 Y:0000 P:envMxdizc - Store Zero in indexed item quantity x.
$01/CFE6 20 85 84 JSR $8485  [$01:8485] A:0003 X:0002 Y:0000 P:envMxdizc - Jump to Subroutine

What I'm missing that's important from the above is how to load that extremely long scrolling screen. If we had that we could forget all about ever needing a storage anyhow considering that would allow us to carry 168 items alone (still only the first 48 carried into battle though)

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
"The circle is now complete..."    OK, not actually, but I see it forming  :tongue:

  It's funny because the Fat Chocobo code was one of the 1st things I looked into when trying to mess around after joining the Forum. But I was scared away by assembly; ran like a kid from a barking dog.  :sad:

 But that's what edged me over to the experience mod...need for more storage space in RAM - with aim of eliminating the need to store stats: just calculate everything when someone joins the party. Things are going well there, after I finishing some tile-editing for Pinkpuff I went back to my experience spreadsheets to attack the stats. I'll write more about that on the other thread, but the short of it is that's even easier than experience, they are all more or less straight formulas - DkC: +1 to Vit on odd levels, +1 to Agl on even levels, etc.

So that and the previous work Phoenix did with the shadow party expansion should clear up space. I figure that for any character all that needs be stored is current experience, level, maybe TNL (depends on slowdown) - and equipment*: and I was thinking instead of FC taking equipment away I might try converting Namingway and have him access those spots in RAM for each characters' equipment.

I'm working to finish up the stat/HP/MP gain algorithms and then pseudo-code in hand try and face the barking dog called Assembly. One thing slowing me down** is how close I should stick to the original stats. Obviously as close as possible is the goal, but if I give a character 2 extra points of strength at the beginning to better ensure coherence later is that going to screw things up? I'd love to hear any thoughts anyone has on that.

Damn it all...that was such a long way to say "agreed, RAM space is hard to come by..." But anyway, back to the spreadsheets  :cycle:

*I have to think about spells too - most them are level based, but I have to look into how best to attack who has what. I think (in the interest of saving space) I'll hook them into the event flags which grant them - Mt. Hobs = Fire 1. This may actually be the procedure now; not sure yet.

**I plan to look at the damage routines to see how big a deal a difference of 1-3 in stats means - opinions also welcome

 -  :edit: OK, need to think with reference to Str/4 --- http://slickproductions.org/forum/index.php?topic=341.msg2633#msg2633
« Last Edit: February 03, 2014, 01:58:17 PM by LordGarmonde »
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Ah, one thing that Phoenix didn't take into account was the Critical Hit Rate/Critical Hit Bonus Damage/?Steal Evade, because we didn't know what those bytes were back them he likely thought them useless so he didn't include them in his hack. His hack unfortunately would make it so a character would never hit a critical (0 x 2 is still 0).

Converting Namingway... I imagine a lot of work went into his functionality... but I think that functionality can be scrapped and remade... I'm not yet sure to What though. So your working on another project? What is its aim?

Also Large Update - It has come to my attention that monsters cannot use the Animation Cues for Any Commands (or else the game implodes) so I will need to re-release my Break Skills Patch and the Combo Patch with this fix. When this occurs this post will be edited to say that those patches have been updated in their respective topic sections.

 :edit: The patches of Break Skill and Combo have been updated to include the fix so monsters no longer freeze the game when they use break skills.
« Last Edit: February 04, 2014, 05:02:13 PM by Grimoire LD »

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Ah, one thing that Phoenix didn't take into account was the Critical Hit Rate/Critical Hit Bonus Damage/?Steal Evade, because we didn't know what those bytes were back them he likely thought them useless so he didn't include them in his hack. His hack unfortunately would make it so a character would never hit a critical (0 x 2 is still 0).

Tricky-tricky...but good catch!

Quote
Converting Namingway... I imagine a lot of work went into his functionality... but I think that functionality can be scrapped and remade... I'm not yet sure to What though. So your working on another project? What is its aim?

I'm not a re-namer, never have been; hence my willingness to work things around regarding Namingway. That goes back to what I was interested in before I ended-up on the experience/level tangent which was stripping members of gear automatically when they leave. Originally I was going to throw it in Fat Chocobo's storage, but then I worry about cluttering that up and not knowing it because it's happening behind the scenes and you only check in sporadically.

My lazy/limited ability approach was basically to try and reuse the Fat Chocobo code, just changing the storage addresses and the portrait from FC to Namingway. But since that requires a separate block of memory for storage I went looking into how to save room, which lead me to Phoenix's approach where I fell down the hole chasing down the experience issue in efforts to eliminate as much of the need to use memory as possible. Admittedly the other sticking point for me was that the setup Square settled on pissed me off - our friend the Dark Knight never gains MP - but that doesn't mean an entry of 00 every 5th byte on the ROM is the way to go...but anyway...

Looking at the data, I pared the stat list down to: character id (1 byte), class id (1), level (1), max HP (2), max MP (2), base str/agil/vit/wis/will (5), helmet (1), armor (1), gauntlet (1), right-hand weapon (2), left-hand weapon (2), and experience (3). This adds up to 22 essential bytes per character. Finally, I divided the 320-byte block by 22, and lo and behold there's room for 320/22 = 14.54 characters. It's like it was fated to be.

I'm thinking given that same list that the base stats can be eliminated, since they can be redetermined when a character rejoins - perhaps max HP & MP similarly but that's an issue with fixed gains vs slightly random variance and consistency, but it should work. I'd have to use 3 bytes for the TNL value; I'm pretty sure that's where the problem came from in Edward rejoining at his starting level of 5.

I just got an idea in writing this - if I build off the above - then there are already enough slots for everyone's equipment. Could there be a way to look at those addresses when talking to Namingway leaving FC exactly as he is?

So somewhat separate projects as they ended up but they all came out of the same desire to be able to swap people in and out at will and not leave the player frustrated at losing equipment all the time and not being stuck with Cid not being able to have a level below 20.
"Now I know; and knowing makes it even more confusing..."

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
I've considered rewriting Namingway's routine to turn him into a party-changer, but I only have a very vague idea of how I would even begin to tackle that.
The party changing dynamics of my hack (I promise, the preview is coming - the demo first chapter is actually complete, it's the character sampling portion afterward that's takng so long. Seems I grossly underestimated how much of an undertaking it would be) are worked out in a way that very specifically avoids the need for "one single action to change the entire party," so if Iever get around to attempting it, it will be a side project.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
I was never quite that ambitious (even in my mind) about switching out the party; even a vague idea is still a good start. I always had in the back of my mind something like FF4A's end swapping, but simplified. I'm thinking in my hack of only defaulting to 4 characters for the lunar subterrane/core to up the challenge a bit more. But as a fun option I was thinking of having the rest of the gang waiting in the tower like in FF4A and you could grab any one of them as the 5th member. That wouldn't be so bad to set up I think - each character has a response action of remove the current 5th member (if any) and add themselves - but that's still in the dream vault - experience/stats are still first up (almost done!)
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Very interesting discussion here... there are parts of RAM around 7E1C00 that never seem to have anything in them and have roughly 200 bytes to spare in that. I toyed around with the idea of adding all of the character's default data in that area at the start of the game by using Cecil's default code and redirecting it and while that section of it works perfectly. It is actually turning them into a character which is the difficult part. The Shadow Slot is normally saved in byte by byte. It's not piecemeal as it is with Default Cecil. But if we changed it to be Piecemeal... I see no reason why this section of RAM couldn't be our own Shadow Slot data.

Upon request I have touched up Geomancy. It will no longer Backfire on you, instantly killing Rydia, but will instead just say "Nothing happened". In addition to this change though is the addition of a Conditional and for that I added new code in the free space. So this is Geomancy-Eidolon Whip


Code: [Select]
$03/FF6A AD B3 26 LDA $26B3  [$7E:26B3] A:00F0 X:01CF Y:0010 P:eNvMxdIzc - Load Weapon from Right Hand into A.
$03/FF6D C9 35 CMP #$35 A:00F0 X:01CF Y:0010 P:eNvMxdIzc - Is it the Eidolon Whip (Blitz Whip)?
$03/FF6F F0 05 BEQ $05    [$FF76] A:00F0 X:01CF Y:0010 P:eNvMxdIzc - If so, branch to actual routine.
--------------------------------------------------------------------------------------------------------------------
$03/FF71 A9 00 LDA #$00 A:00F0 X:01CF Y:0010 P:eNvMxdIzc - Load 00 (Nothing happened) into A.
$03/FF73 4C A7 E1 JMP $E1A7  [$02:E1A7] A:00F0 X:01CF Y:0010 P:eNvMxdIzc - Jump to End of Geomancy Routine.
------------------------------------------------------------------------------------------------------------------------------
$03/FF76 20 8B 85 JSR $858B  [$02:858B] A:00F0 X:01CF Y:0010 P:eNvMxdIzc - Generate Random Number.
$03/FF79 C9 21 CMP #$21 A:00F0 X:01CF Y:0010 P:eNvMxdIzc - Is it less than 33?
$03/FF7B B0 04 BCS $04    [$FF81] A:00F0 X:01CF Y:0010 P:eNvMxdIzc - If so branch to next check.
$03/FF7D A9 36 LDA #$36 A:00F0 X:01CF Y:0010 P:eNvMxdIzc - Load Shiva into A.
$03/FF7F 80 0A BRA $0A    [$FF8B] A:00F0 X:01CF Y:0010 P:eNvMxdIzc - Branch to End of Routine.
-------------------------------------------------------------------------------------------------------------------------------------
$03/FF81 C9 42 CMP #$42 A:00F0 X:01CF Y:0010 P:eNvMxdIzc - Is it less than 66?
$03/FF83 B0 04 BCS $04    [$FF89] A:00F0 X:01CF Y:0010 P:eNvMxdIzc - If so, branch to Ramuh.
$03/FF85 A9 37 LDA #$37 A:00F0 X:01CF Y:0010 P:eNvMxdIzc - Load Ramuh into A.
$03/FF87 80 02 BRA $02    [$FF8B] A:00F0 X:01CF Y:0010 P:eNvMxdIzc - Branch to End of Routine.
---------------------------------------------------------------------------------------------------------------------------------------------
$03/FF89 A9 38 LDA #$38 A:00F0 X:01CF Y:0010 P:eNvMxdIzc - Load Ifrit into A.
$03/FF8B 4C A7 E1 JMP $E1A7  [$02:E1A7] A:00F0 X:01CF Y:0010 P:eNvMxdIzc - Jump to End of Geomancy.

In addition I changed the original "failed check" to have this Jump in the original Geomancy Routine at...

Code: [Select]
$03/E156 C9 28 CMP #$28 A:0022 X:0000 Y:0000 P:eNvMxdizc
$03/E158 B0 04 BCS $04    [$E15E] A:0022 X:0000 Y:0000 P:eNvMxdizc
$03/E15A 4C 6A FF JMP $FF6A  [$03:FF6A] A:0022 X:0000 Y:0000 P:eNvMxdizc

After that I decided to try and do something... interesting. I think the Whips in FFIV were a neat idea, but they are just so basic and boring. So I touched them up and in so doing discovered some previous limitations to my Magic Weapons routine. I made every Whip (except the Eidolon Whip which changes Geomancy) allow a possibility of summoning an Eidolon on hit. Impish Whip, Bird Whip, Dynamite Whip, and the Dragon Whip.

 If you try to summon an Eidolon the game will not load the actual graphics... at all.

So I changed some things in the routine and I now have Eidolons working perfectly! It just required a little more space and a couple more conditionals but it is working optimally now.

Code: [Select]
$03/FF10 C9 31 CMP #$31 A:00F0 X:01CF Y:0006 P:eNvMxdIzc - Is it Imp or Lower?
$03/FF12 90 04 BCC $04    [$FF18] A:00F0 X:01CF Y:0006 P:eNvMxdIzc - If so branch to part-way through Magic Routine
---------------------------------------------------------------------------
$03/FF14 C9 40 CMP #$40 A:00F0 X:01CF Y:0006 P:eNvMxdIzc - Is it lower than Bahamut?
$03/FF16 90 03 BCC $03    [$FF1B] A:00F0 X:01CF Y:0006 P:eNvMxdIzc - If so branch to Full Magic Routine
----------------------------------------------------------------------
$03/FF18 4C 3E CD JMP $CD3E  [$02:CD3E] A:00F0 X:01CF Y:0006 P:eNvMxdIzc - Jump and stay with part way through Magic Routine.
-------------------------------------------------------------------
$03/FF1B 20 46 CC JSR $CC46  [$02:CC46] A:00F0 X:01CF Y:0006 P:eNvMxdIzc - Jump to Full Magic Routine
$03/FF1E A9 C0 LDA #$C0 A:00F0 X:01CF Y:0006 P:eNvMxdIzc - Load Weapon Swing into A.
$03/FF20 8D C2 33 STA $33C2  [$7E:33C2] A:00F0 X:01CF Y:0006 P:eNvMxdIzc - Store A in First Visual cue.
$03/FF23 A9 00 LDA #$00 A:00F0 X:01CF Y:0006 P:eNvMxdIzc - Load 00 into A.
$03/FF25 8D C3 33 STA $33C3  [$7E:33C3] A:00F0 X:01CF Y:0006 P:eNvMxdIzc - Store A in Second visual cue.
$03/FF28 60 RTS A:00F0 X:01CF Y:0006 P:eNvMxdIzc - Return

What those first two bytes do that are replaced are show the name of the spell being used... not a big loss considering I'd rather have an actual attack animation rather than have the name of the summon's attack show up and then attacking After the spell is done being cast.

And there you have it! I now have Eidolons being summoned from Whips and the Eidolon Whip summoning randomly Shiva, Ifrit, or Ramuh!
« Last Edit: February 04, 2014, 10:26:05 PM by Grimoire LD »

Dark Knight

  • Ymir
  • *
  • Posts: 10
    • View Profile
Wow, this is an amazing piece of work that's been going on around here. Similar to fedorajoe, I've created a new command for Cid out of the dummied out command. I've removed the message popping up after the execution of the command. All works fine as I want it, but one thing alludes me is the name of the spell appears in the pop up box instead of the command's name popping up during battle. Basically, I want it to be like the Pray command where the player will see Pray instead of Cure1. How is this preform?

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Excellent! I am glad to see that the tutorial with the back and forth was easy enough to follow.

The information you want is here...
(Ordinarily done at the end of routines so that is why the Return is here)

A9 0B   LDA #$0B   A:0010   X:00CE   Y:0000   P:envMxdizC - Load 15 into A. (Cid's Unused Command is Command ID 15)
8D C8 34   STA $34C8  [$7E:34C8]   A:000B   X:00CE   Y:0000   P:envMxdizC - Store A in 7E34C8.
A9 10   LDA #$10   A:000B   X:00CE   Y:0000   P:envMxdizC - Load 10 into A. (Mini-Message Data)
8D C7 34   STA $34C7  [$7E:34C7]   A:0010   X:00CE   Y:0000   P:envMxdizC - Store A in 7E34C7.
60    RTS   A:0010   X:00CE   Y:0000   P:envMxdizC -Return

That should be all you need.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Alright! For a while now I have been agonizing on how to properly use the space left to me by Auto-Hide's departure and I think I finally have it figured out...

Ever since playing Dissidia I had always wondered if there could be some story or plot event where Cecil would regain Dark Wave, after all Dark is not inherently evil in FFIV's world, the King of Baron appears to have been a Dark Knight of some sort if judging by FFIV:DS.

But it wouldn't be proper to just Give Paladin Cecil the ability to use Dark Wave just after he became a Paladin, then I got to thinking... "what if he reobtained Dark Wave somehow on his journey?" Then that dream was crushed by Square's mind bogglingly silly manner of drawing commands directly from ROM at the start of every battle, dependent on the Actor. Though I am still brainstorming ideas on how to get by that bout of curious game design, I did find a way to accomplish this dream of mine in a way that feels compatible with FFIV's basic story and in a way, a neat reference to FFIV DS.

In FFIV DS you can steal the Darkness Augment from Odin.

What I will do then is turn that idea into Odin's Armor. This is obtained in addition to the Odin Summon.

When worn this will change the effect of Cover into Dark Wave (Curse you non-standard manner of switching Command names! That unfortunately doesn't work outside of it actually Being in a command).

So if you want Paladin Cecil to retain that Dark Knight-like manner of being, you can use the Odin's Armor (which will have some nice stat bonuses as well). That seems like a Much better prize to me than Odin himself is.

Here is the code...

Odin's Armor turns Cover's Effect into Dark

Code: [Select]
$03/AB4A BD 31 20 LDA $2031,x[$7E:2031] A:0000 X:0000 Y:0012 P:envMxdiZc - Load Armor into A.
$03/AB4D C9 86 CMP #$86 A:0082 X:0000 Y:0012 P:eNvMxdizc - Is it Odin's Armor? (Silver Armor)
$03/AB4F D0 50 BNE $50    [$ABA1] A:0086 X:0000 Y:0012 P:envMxdiZC - If not, branch to rest of "turn start routine".
---------------------------------------------------(Looping Point)---------------------------------------------------------------
$03/AB51 BD 03 33 LDA $3303,x[$7E:3303] A:0086 X:0000 Y:0012 P:envMxdiZC - Load the first command byte.
$03/AB54 C9 13 CMP #$13 A:0000 X:0000 Y:0012 P:envMxdiZC - Is it Cover?
$03/AB56 D0 07 BNE $07    [$AB5F] A:0000 X:0000 Y:0012 P:eNvMxdizc - If not, branch to rest of routine.
-----------------------------------------------------------------------------------------
$03/AB58 A9 05 LDA #$05 A:0013 X:000C Y:0012 P:envMxdiZC - Load 05 (Dark) into A.
$03/AB5A 9D 03 33 STA $3303,x[$7E:330F] A:0005 X:000C Y:0012 P:envMxdizC - Store Dark in place of Cover.
$03/AB5D 80 0C BRA $0C    [$AB6B] A:0005 X:000C Y:0012 P:envMxdizC - Branch to rest of end of routine.
---------------------------------------------------------------------------------------------
$03/AB5F E8 INX A:0000 X:0000 Y:0012 P:eNvMxdizc
$03/AB60 E8 INX A:0000 X:0001 Y:0012 P:envMxdizc
$03/AB61 E8 INX A:0000 X:0002 Y:0012 P:envMxdizc
$03/AB62 E8 INX A:0000 X:0003 Y:0012 P:envMxdizc + 4 X, to reach next command.
$03/AB63 E6 FE INC $FE    [$00:00FE] A:0000 X:0004 Y:0012 P:envMxdizc - +1 to FE (first command checked)
$03/AB65 A5 FE LDA $FE    [$00:00FE] A:0000 X:0004 Y:0012 P:envMxdizc - Load FE into A.
$03/AB67 C9 19 CMP #$1A A:0001 X:0004 Y:0012 P:envMxdizc - Has it looked through all 25(+1) commands?
$03/AB69 D0 E6 BNE $E6    [$AB51] A:0001 X:0004 Y:0012 P:eNvMxdizc - If not, loop back to start.
--------------------------------------------------------------------------------------------------
$03/AB6B CA DEX A:0005 X:000C Y:0012 P:envMxdizC - -1 to X (to reach targeting of command)
$03/AB6C A9 60 LDA #$60 A:0005 X:000B Y:0012 P:envMxdizC - Load Target All Enemies into A.
$03/AB6E 9D 03 33 STA $3303,x[$7E:330E] A:0060 X:000B Y:0012 P:envMxdizC - Store A in Command Targeting.
$03/AB71 A5 CD LDA $CD    [$00:00CD] A:0060 X:000B Y:0012 P:envMxdizC - Load Character ID into A.
$03/AB73 85 00 STA $00    [$00:0000] A:0005 X:000B Y:0012 P:envMxdizC - Store A in 00.
$03/AB75 60 RTS A:0005 X:000B Y:0012 P:envMxdizC - Return.

I am fiddling with ideas on how to make this look at a range of commands. The only exception is that the command Must be unique to the character. So as not to replace an earlier character's command.  I'll think more on it later. For now I managed to give Paladin Cecil Dark Wave back without it feeling out of place!

Here are some pictures of the process in action...

Without Odin's Armor Cover will act as it always has.


With Odin's Armor equipped however...


You can use Cover as if it were Dark Wave!


Well this was an intriguing experiment. I am glad to see if worked without flaws.


Though this is a good use of it. I think
Chillyfeez knocks it out of the park by using this section for Limit Breaks.


Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Wow. I did it. And it was so easy too... I have concocted a way to take those absolutely worthless "start of game" code and turn them into something that will expand our options by a fair amount!

This is all it took...

(Start of Game Character Creation)
$00/92D6   BF 55 FD 13   LDA $13FD55,x[$13:FD55]   A:0006   X:0000   Y:0000   P:envMxdIZc -  Load Character's Commands.
$00/92DA   99 00 1C   STA $1C00,y[$00:1C00]   A:0000   X:0000   Y:0000   P:envMxdIZc - Store them in unused section of RAM.
$00/92DD   E8    INX   A:0000   X:0000   Y:0000   P:envMxdIZc - +1 X
$00/92DE   C8    INY   A:0000   X:0001   Y:0000   P:envMxdIzc - +1 Y
$00/92DF   C0 6B 00   CPY #$006B   A:0000   X:0001   Y:0001   P:envMxdIzc - Has it placed all commands within memory?

And that was step 1.

Step 2 was even easier...

$03/8BA1   A6 E3   LDX $E3    [$00:00E3]   A:0005   X:0000   Y:0000   P:envMxdIzc - Load Slot Pointer.
$03/8BA3   BF 00 1C 00   LDA $001C00,x[$00:1C00]   A:0005   X:0000   Y:0000   P:envMxdIZc - Load New Location of Commands.
$03/8BA7   99 03 33   STA $3303,y[$7E:3303]   A:0000   X:0000   Y:0000   P:envMxdIZc - Store A in appropriate location.


At first I had the fear that this was a universal "Add Character to Party"... which would have made sense. But it's not. It is used purely by Start of Game Cecil, and do you know the way around this? Add Cecil to the party manually by the event. Does the same exact thing.
And that is All.

I am amazed at how simple this really was. Now you could use the Apples/Soma Drops to give any character you please any skill you please within the rules of the Game! An "Augment" system can be created out of this with a bit of work, make no mistake about it...

This is an enormous breakthrough for me. I am wondering what else I can use this fairly large empty space of RAM for...

Dark Knight

  • Ymir
  • *
  • Posts: 10
    • View Profile
Re: Grimoire LD's Notes, Patches, and Hacks (Commands stored directly in RAM!)
« Reply #327 on: February 08, 2014, 11:48:48 AM »
Thanks Grimoire LD, its working as intended. Everything is well explained and easy to follow, you're doing great work here. Good luck in your future endeavors.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Patches, and Hacks (Commands stored directly in RAM!)
« Reply #328 on: February 08, 2014, 04:42:23 PM »
Thank you Dark Knight, should you ever have any requests or any more questions you can feel free to ask either Chillyfeez or myself.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Patches, and Hacks (Commands stored directly in RAM!)
« Reply #329 on: February 08, 2014, 06:55:00 PM »
So I fixed up my Hunt code, I ended up making part of a Dummy-Steal Routine, that links into the actual Steal Routine. This allows the Hunt to support the possibility for 24 Different Items! This is up from only 6, which was a little underwhelming. At the end of the original section of the Hunt Rewards System there is a JMP to the new section of code at FF90.

Hunt Rewards System+
Code: [Select]
$03/FF90 7B TDC A:003A X:0000 Y:0000 P:envMxdiZc - Set A to 00 basically.
$03/FF91 1A INC A A:0000 X:0000 Y:0000 P:envMxdiZc - +1 to Item Quantity.
$03/FF92 85 AA STA $AA    [$00:00AA] A:0001 X:0000 Y:0000 P:envMxdizc - Store A in Item Quantity.
$03/FF94 AD 73 27 LDA $2773  [$7E:2773] A:0001 X:0000 Y:0000 P:envMxdizc - Load Target's (now modified by original Hunt Rewards System) Item Byte.
$03/FF97 0A ASL A A:003A X:0000 Y:0000 P:envMxdizc
$03/FF98 0A ASL A A:0074 X:0000 Y:0000 P:envMxdizc - x4.
$03/FF99 85 FE STA $FE    [$00:00FE] A:00E8 X:0000 Y:0000 P:eNvMxdizc - Store the value in FE (The Value is how the game normally finds the item reference)
$03/FF9B A9 03 LDA #$03 A:00E8 X:0000 Y:0000 P:eNvMxdizc - Load 03 into A. (Rank 4 Obtaining Item compared to 0000 as Rank 1 obtaining item. But these Item Drops go unused except for Hunting)
$03/FF9D 20 79 83 JSR $8379  [$03:8379] A:0003 X:0000 Y:0000 P:envMxdizc - Jump to RNG Subroutine.
$03/FFA0 65 FE ADC $FE    [$00:00FE] A:0000 X:0000 Y:0000 P:envMxdizc - Add FE onto the RNG chosen.
$03/FFA2 AA TAX A:00E8 X:0000 Y:0000 P:eNvMxdizc - Transfer A to X.
$03/FFA3 BF 00 9F 0E LDA $0E9F00,x[$0E:9FE8] A:00E8 X:00E8 Y:0000 P:envMxdizc - Load Item Byte + the extra 0-3 to give it the range of all possibilities
$03/FFA7 20 5A E2 JSR $E25A  [$03:E25A] A:00B0 X:00E8 Y:0000 P:eNvMxdizc - Jump to rest of Steal Routine.
$03/FFAA 20 B1 85 JSR $85B1  [$03:85B1] A:001D X:0020 Y:0008 P:envMxdizc - Load Message Data Set-up
$03/FFAD 60 RTS A:0003 X:0020 Y:0008 P:envMxdizc - Return

Item is Displayed


Enemy Dies


The Items are as follows...

Item Rewards for Hunting

1 - Bomb Part, Notus, ZeusRage, Silk Web
2 - Tonic, Potion, Mute Bell, VampFang
3 - GaeaRobe, Revive, Scanner, Dark Kiss
4 - Ether, Bomb Arm, Impish Whip, Siren - RNG 20+
5 - Remedy, Whisker, Ranger Key (Will Allow you into the first part of the Troian Artemis Cult), Scholar Cap - RNG 30+
6 - Artemis Arrows, Silver Stopwatch, StarVeil, Artemis Key (Will allow you into the Inner Temple of the Artemis Cult where you can purchase the best equipment for Rosa.) - RNG 40+

A quick reminder how Hunt Rewards work... When you have a Beast-type (replacing Reptile, but also includes previous Reptiles) enemy in Critical and you use Hunt you will automatically kill the foe and obtain an item. The formula for the item chosen is this...

1 - (Enemy's Level +20). Which means that if you're lucky you could use this on a Gargoyle and get an item of the 4th Table. for higher level foes like an IceBeast (Level 40) You might not get anything more than a 1st Table Item. But the IceBeast itself is Level 40 which would also be your first chance to get a 60+ Item, which is the final table where the end goal in that is to get the Artemis Key. Though you'd have to be extremely lucky. First the RNG has to read 40+20 so that's 1 in 40 there. Then the table loaded has to be the 6th Table which is a 1/6 chance, finally you will need to get the 4th slot of the 6th Table which is a 1 /4 chance.

By fighting later game Beasts you should have a better chance at it, and its not like any of the rewards you get from Hunting are worthless (well maybe the GaeaRobe after Rosa is kidnapped)


Let me know if you think any of those might be a touch too overpowered, please.
« Last Edit: February 08, 2014, 09:10:02 PM by Grimoire LD »