øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1940.msg22004e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexb84e.htmldelayedslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1940.45e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexb84e.html.zx5 g^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈÐ:JOKtext/htmlISO-8859-1gzip@øÕ:JÿÿÿÿÿÿÿÿÑHTue, 10 Mar 2020 03:44:12 GMT0ó°° ®0®P®€§²ð®5 g^ÿÿÿÿÿÿÿÿî4:J Chillyfeez's Mods, hacks, research notes, etc.

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

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #45 on: December 31, 2014, 12:13:51 AM »
Ah... I forgot about steal prevention. I think that is among the stats that is adjusted, too, though not by the ratio. The level is adjusted, then 10 is added.
I was not aware of its factor in preemptive/back attack... I wonder what kind of effect that will have when it starts making monsters lv 66...

I should have rephrased that Level is used in calculating the starting status of the battle. The 2F byte is used for the the other matters that I mentioned.

These experiments seem like they could be fun, I rather liked what FFVIII and FFT's random battles did so including that into FFIV is a wonderful thought.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #46 on: January 06, 2015, 11:15:42 PM »
So I have a week off starting today. I'm going to visit family over the weekend, but I have big plans about actually finishing up the second chapter of A Threat from Within.

So naturally, today I worked on it for about 45 minutes then got distracted by some far more complicated hacking research.

You'll love this one, Grimoire - I am very close to devising a method by which other commands (besides Item, Dart and magics) can open a sub-menu. This is actually a potentially productive diversion, because I use Grimoire's custom Salve command in my hack, and if I can get this to work then I can modify it so that the player actually gets to choose which item is used (instead of it being the first item in the inventory every time).
It's kind of a minor thing in the end, but it'll give the custom command a more polished feel.

And of course, if it can be done with Salve, then it can also be done with Coat Hammer, though I'm not completely positive about how well it'll work, because I believe that one has its own set of valid choices (separate from what is a valid choice for Item), and this little trick I plan to devise involves a trip through the same routine Item uses to select an item. And I don't know how to conditionally gray-out items in the menu.

Anyway I'm turning in for the night, but there's what I hope to get done tomorrow.

And maybe finally finish the bosses at the end of chapter 2.

Maybe.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #47 on: January 06, 2015, 11:39:36 PM »
So I have a week off starting today. I'm going to visit family over the weekend, but I have big plans about actually finishing up the second chapter of A Threat from Within.

So naturally, today I worked on it for about 45 minutes then got distracted by some far more complicated hacking research.

You'll love this one, Grimoire - I am very close to devising a method by which other commands (besides Item, Dart and magics) can open a sub-menu. This is actually a potentially productive diversion, because I use Grimoire's custom Salve command in my hack, and if I can get this to work then I can modify it so that the player actually gets to choose which item is used (instead of it being the first item in the inventory every time).
It's kind of a minor thing in the end, but it'll give the custom command a more polished feel.

And of course, if it can be done with Salve, then it can also be done with Coat Hammer, though I'm not completely positive about how well it'll work, because I believe that one has its own set of valid choices (separate from what is a valid choice for Item), and this little trick I plan to devise involves a trip through the same routine Item uses to select an item. And I don't know how to conditionally gray-out items in the menu.

Anyway I'm turning in for the night, but there's what I hope to get done tomorrow.

And maybe finally finish the bosses at the end of chapter 2.

Maybe.

Ah that does sound awesome! Opening menus from commands was something I looked into a long time ago, but it was so confusing that I couldn't progress very far into it. As for Coat Hammer, it does have it's very specific choices, no indexing going on there just plain; "Is it This item? If not, branch". But nothing happens when the item up front is incorrect, so there's no fear of breaking anything should the incorrect choice be made.

This would really make them feel official though; I was never happy with the "if at top of list" but I had no better way to design it at the time. Though can you prevent strangeness like being able to access left-right hands? That might throw something off, then again, it might not. Best of luck with this though!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #48 on: January 07, 2015, 12:17:58 AM »
Ooh, I hadn't thought about left and right hands. Well, I'll stick with the original plan and see what happens.
I'm thinking that choosing a weapon would just do nothing, but we'll see I guess...

Re: Coat Hammer... It would probably be OK, then, with the exception of the homing wrench. It's not a "usable" item, right? So then it would be grayed out by the method I'm employing.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #49 on: January 07, 2015, 05:58:14 AM »
Ooh, I hadn't thought about left and right hands. Well, I'll stick with the original plan and see what happens.
I'm thinking that choosing a weapon would just do nothing, but we'll see I guess...

Re: Coat Hammer... It would probably be OK, then, with the exception of the homing wrench. It's not a "usable" item, right? So then it would be grayed out by the method I'm employing.

...Right, forgot all about the Homing Wrench. Hmm, not sure how I would make that work with such a plan.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #50 on: January 07, 2015, 03:48:45 PM »
SUCCESS!
So here's what we're looking at in terms of functionality...
Salve is now a command that, when selected, opens the item menu. All of the same items will be available as if you had selected Item.
If you choose an attack item (anything that by default targets one or all enemies), the targeting will be All Enemies.
If you choose a healing/support item (anything that by default targets one or all allies), the targeting will be All Allies.
If you choose a weapon from your left or right hand, there will be no difference than if you had selected it from item (no idea why, but I consider this among the best-case scenarios, so I'm not going to look into it)

In the end, not a whole lot of complicated changes had to be made, but it's all custom. I am 99% sure that it doesn't use any of the same space as any of my other stuff, but I'm only posting code here and no patch.

The original block of code that makes the game open a sub-menu is here:
Code: [Select]
$02/B9B9 FA          PLX                     A:0000 X:0000 Y:0000
$02/B9BA BD 03 33    LDA $3303,x[$7E:3307]   A:0000 X:0004 Y:0000 ;LOAD COMMAND SELECTED FROM MAIN COMMAND MENU
$02/B9BD C9 16       CMP #$16                A:0001 X:0004 Y:0000
$02/B9BF F0 1D       BEQ $1D    [$B9DE]      A:0001 X:0004 Y:0000 ;IF IT'S DART, JUMP TO SPECIALIZED DART SUB-MENU ROUTINE
$02/B9C1 C9 18       CMP #$18                A:0001 X:0004 Y:0000
$02/B9C3 F0 64       BEQ $64    [$BA29]      A:0001 X:0004 Y:0000 ;IF IT'S NINJA, JUMP TO THE BLACK MAGIC SUB-MENU ROUTINE
$02/B9C5 C9 05       CMP #$05                A:0001 X:0004 Y:0000
$02/B9C7 90 03       BCC $03    [$B9CC]      A:0001 X:0004 Y:0000 ;IF IT'S ANYTHING ELSE DARK WAVE OR LATER, JUMP BEYOND THE SUB-MENU ROUTINES
$02/B9CC 0A          ASL A                   A:0001 X:0004 Y:0000
$02/B9CD AA          TAX                     A:0002 X:0004 Y:0000 ;IF IT'S FIGHT, ITEM, WHITE MAGIC OR BLACK MAGIC, TURN THE COMMAND NUMBER INTO AN INDEX TO REFERENCE CODE POINTERS (2B9E6-2B9EF)
$02/B9CE BF E6 B9 02 LDA $02B9E6,x[$02:B9E8] A:0002 X:0002 Y:0000
$02/B9D2 85 0E       STA $0E    [$00:000E]   A:0005 X:0002 Y:0000
$02/B9D4 BF E7 B9 02 LDA $02B9E7,x[$02:B9E9] A:0005 X:0002 Y:0000
$02/B9D8 85 0F       STA $0F    [$00:000F]   A:00BA X:0002 Y:0000
$02/B9DA 6C 0E 00    JMP ($000E)[$02:BA05]   A:00BA X:0002 Y:0000 ;JUMP TO THE APPROPRIATE CODE BASED ON POINTERS

The first step here was to get the game to behave like Item if the command selected was Salve, so enter some custom code:
***
Code: [Select]
$02/B9BA 20 C3 9A    JSR $9AC3  [$02:9AC3];JUMP TO SUBROUTINE AT $02/9AC3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$02/9AC3 22 80 8D 14 JSL $148D80[$14:8D80];JUMP TO SUBROUTINE AT $14/8D80 (BECAUSE THERE REALLY ISN'T ENOUGH ROOM IN THE 28000 BLOCK FOR THIS)   
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$14/8D80 BD 03 33    LDA $3303,x[$00:342F];LOAD COMMAND SELECTED FROM MAIN COMMAND MENU
$14/8D83 C9 01       CMP #$01             
$14/8D85 F0 04       BEQ $04    [$8D8B]     
$14/8D87 C9 0A       CMP #$0A               
$14/8D89 D0 04       BNE $04    [$8D8F]   ;IF IT'S NOT SALVE OR ITEM, THEN LEAVE THIS ROUTINE   
$14/8D8B 85 F0       STA $F0    [$00:06F0];IF IT IS SALVE OR ITEM, STORE WHICH ONE INTO (NORMALLY UNUSED BYTE) 00F0 IN RAM - THIS WILL BE IMPORTANT LATER
$14/8D8D A9 01       LDA #$01             ;IF IT IS SALVE OR ITEM, CAUSE THE GAME TO BEGIN ACTING LIKE ITEM
$14/8D8F 6B          RTL                  ;RETURN
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~               
$02/9AC7 60          RTS                  ;BACK TO OUR REGULARLY SCHEDULED PROGRAM

So that makes it so selecting Salve is like selecting Item... except that makes it so selecting Salve is exactly like selecting Item. That's where storing that command into 00F0 comes into play...

For targeting:
Normally, item targeting is generated from the op code at $02/B606 - BD 1A 32    LDA $321A,x[$7E:321A]
Well, we need the game to act differently if Salve is the active command, so, enter more custom code:
***
Code: [Select]
$02/B606 20 B7 9A    JSR $9AB7  [$02:9AB7];JUMP TO SUBROUTINE AT $02/9AB7   
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$02/9AB7 22 90 8D 14 JSL $148D90[$14:8D90];JUMP TO SUBROUTINE AT $14/8D90 (STILL NO ROOM IN THE 28000 BLOCK)   
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$14/8D90 A5 F0       LDA $F0    [$00:00F0];LOAD WHETHER THIS IS ITEM OR SALVE   
$14/8D92 C9 0A       CMP #$0A               
$14/8D94 D0 0D       BNE $0D    [$8DA3]   ;IF NOT SALVE (AND THEREFORE ITEM) THEN LEAVE THIS ROUTINE
$14/8D96 BD 1A 32    LDA $321A,x[$7E:321A];OTHERWISE, LOAD ITEM'S TARGETING
$14/8D99 C9 40       CMP #$40               
$14/8D9B B0 03       BCS $03    [$8DA0]   ;IF IT'S AN ATTACK ITEM, SKIP AHEAD   
$14/8D9D A9 20       LDA #$20             ;IF IT'S A HEALING/SUPPORT ITEM, LOAD 20 (ALL ALLIES) INTO TARGETING   
$14/8D9F 6B          RTL                  ;AND RETURN
$14/8DA0 A9 60       LDA #$60             ;IF IT'S AN ATTACK ITEM, LOAD 60 (ALL ENEMIES) INTO TARGETING   
$14/8DA2 6B          RTL                  ;AND RETURN   
$14/8DA3 BD 1A 32    LDA $321A,x[$7E:321A];IF IT'S ITEM (COMMAND), LOAD ITEM'S NORMAL TARGETING INTO TARGETING   
$14/8DA6 6B          RTL                  ;AND RETURN
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
$02/9ABB 60          RTS                  ;BACK TO OUR REGULARLY SCHEDULED PROGRAM

The truth of the matter is that all of that targeting stuff is just for show. The Salve code is what actually assigns targeting to the command, but I needed to do this to make it look natural.

So now we have selected our item and targeting. Somewhere along the lines here, the game takes care of subtracting 1 from the item quantity, so we can remove that from the regular Salve code entirely.
Now, however, the game will still proceed as though the command was Item, meaning the Life item won't be split properly, so we still need whatever the Salve code does to make things work properly, and in order to do that, we need to tell the game to execute Salve if we chose Salve.

So, a bit of background code that normally takes place shortly after this is here:
Code: [Select]
$03/A6AD A9 01       LDA #$01This 01 will get loaded into the character's "next action," even if the action selected was Salve.
So, we're gonna use that 00F0 value again here:
***
Code: [Select]
$03/A6AD A5 F0       LDA $F0Now, instead, whichever action we really chose will be loaded into A and stored in the character's next action.

And finally, we have to change the Salve routine around so that it pays attention to the new stuff we just did, so now it will look like this:
***
Code: [Select]
$03/E2E4 A6 A6       LDX $A6    ;LOAD CHARACTER SLOT INTO X
$03/E2E6 BD 52 20    LDA $2052,x;LOAD ITEM SELECTED INTO A
$03/E2E9 85 FE       STA $FE    ;STORE A INTO 00FE
$03/E2EB 4C 24 E3    JMP $E324  ;JUMP TO $03/E324 (SKIPPING OVER THE NO-LONGER-RELEVANT QTY REDUCTION ROUTINE, SINCE ITEM SELECTION TAKES CARE OF THIS. REPLACED WITH EMPTY SPACE... PERHAPS FOR LATER USE!)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$03/E324 98          TYA       
$03/E325 85 01       STA $01   
$03/E327 A9 06       LDA #$06   
$03/E329 20 85 80    JSR $8085 
$03/E32C A9 F8       LDA #$F8   
$03/E32E 8D D4 26    STA $26D4  ;TARGETING STUFF, SINCE WHAT WE DID DURING ITEM SELECTION WAS REALLY JUST FOR SHOW
$03/E331 A5 FE       LDA $FE   
$03/E333 8D D2 26    STA $26D2  ;LOAD ITEM INTO NEXT ACTION TO TAKE
$03/E336 EE 2A 35    INC $352A 
$03/E339 20 3E CD    JSR $CD3E  ;MAGIC CALL
$03/E33C A5 FE       LDA $FE   
$03/E33E 8D C5 33    STA $33C5  ;MAGIC GRAPHIC
$03/E341 A9 0A       LDA #$0A   
$03/E343 8D C8 34    STA $34C8  ;LOAD "SALVE" INTO SMALL COMMAND DISPLAY WINDOW
$03/E346 A9 10       LDA #$10   
$03/E348 8D C7 34    STA $34C7  ;(DON'T KNOW)
$03/E34B 60          RTS        ;RETURN

And there you have it!
I can't really make a patch of this, because I don't have a clean base to work from for reference, but if you want this new Salve in your ROM, just write in the sections of code in this post that are preceded by three asterisks (***).

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #51 on: January 07, 2015, 04:13:18 PM »
This is fantastic! What a way to fix all of those ugly problems that my custom Salve had, including the pointlessness of hitting one enemy with an "All Enemies" spell, I'll see if I can get this working for the next Combat Boost patch, not to mention a lot of clever hacking at work here.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #52 on: January 07, 2015, 10:22:06 PM »
I was just looking through my files and I came across this patch I made back in early November when Slick was down.
It's another thing I developed for use in my own hack, but it could be used by anyone who wants this feature.
I call it "Unique Steals."
What it does is, when Stealing is successful against a boss monster, it changes the monster's item byte to 00 (Cure1,Cure1,Cure1,Cure1).
This allows you to have boss monsters that can hold unique items to steal, without the pitfall of infinite acquisitions that normally comes with steal-able items.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #53 on: January 07, 2015, 11:26:54 PM »
I was just looking through my files and I came across this patch I made back in early November when Slick was down.
It's another thing I developed for use in my own hack, but it could be used by anyone who wants this feature.
I call it "Unique Steals."
What it does is, when Stealing is successful against a boss monster, it changes the monster's item byte to 00 (Cure1,Cure1,Cure1,Cure1).
This allows you to have boss monsters that can hold unique items to steal, without the pitfall of infinite acquisitions that normally comes with steal-able items.

Wow, that is a Neat idea! I tried to get that to work, but I couldn't figure out the problems with Why the Item Byte wasn't being saved. Please tell me how you did it. Because of that Stealing isn't as useful as I would like it to be and this FFV-esque patch would set the groundwork for a more indepth Stealing system all around.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #54 on: January 08, 2015, 12:17:18 AM »
Well, it wasn't simple.
The problem with Sneak is that it doesn't ever have a chance to affect the target, so the data from 7E:2700 is never copied back to the monster's primary data entry (2000,x).
The primary data entry will keep any changes you make to it, but there is no easy way (like "A6 A6") to get an X value to index to the right monster.
So, I had to devise a long and arduous method based on the stealing character's "enemy target" byte - which wasn't easy, because for some silly reason, higher target values correspond to lower X values.
Unfortunately, this is another one where I didn't really keep track of where I put all the custom stuff, but if you were to put a breakpoint on the steal routine and watch a live disassembly against a boss, it would all come out. There's nothing going on in the background like in some of my other mods.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #55 on: January 08, 2015, 12:41:42 AM »
That was my hangup right there; the lack of targeting really threw me off and trying to force the mirror to load back into the original data did not go well as you can imagine. I'll have to take a look and see how you went about this soon then.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #56 on: February 08, 2015, 09:08:57 PM »
Just posted this on the Project II thread on RHDN, but it deserves to be on slick as well...

All offsets are ROM with header.

How to Turn "Call" into a Five Characer Word in the Magic Menu:
1) Open ROM with a hex editor
2) Jump to $00/B1A3 (this is the pointer into the list of magic names to "Call")
3) Change the two bytes at B1A3 from "FC B1" to "0B B2" (This will point to the first of the three blank spaces instead)
4) Jump to $00/B40C
5) Change it from "00" to "01" (Skipping this step will cause your new label to overwrite Child Rydia's "White" label)
6) Fill in your five character label beginning at B40D

That'll do it.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #57 on: February 08, 2015, 09:18:27 PM »
Oh that's Neat-O; ver' good to know.

Has anyone ever run into trouble mixing and matching magic? I'm thinking that I might like (someday) to give everyone just one magic command, possibly named for them, which is what made me think of it now. FuSoYa, for example, would just have one command for his magic: "Lunar"...and it has all the high level white and black spells...he doesn't need the level 1 spells, etc.
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #58 on: February 08, 2015, 09:25:49 PM »
Oh that's Neat-O; ver' good to know.

Has anyone ever run into trouble mixing and matching magic?

Yes. See: White on Dark Knight Cecil in Combat Boost.

I had originally planned to have it (obviously) be called Black or (Sword)Tech (replacing Ninja) but.... when the spell levels were reached they weren't learned because they were in the wrong spell book...

This is done purely for Rydia at the start of the game. She is the only character that learns Black and White Magic, when this is nullified learned spells are put in Every spellbook that the character has. This is the problem.

Apparently Phoenix made a spell patch... but that uses the characters of the Black, White, and Summon Magic which the Sword Skills were not, so it couldn't help me at all and I never really looked into it again, I'll eventually do something with it though, it's just not a pertinent concern.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #59 on: February 08, 2015, 09:35:29 PM »
Gotcha - yet another curve-ball, eh FF4?  Don't worry we'll have the last laugh: :laugh:
"Now I know; and knowing makes it even more confusing..."