øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;u=123;area=showposts;start=360e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index50c1-2.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;area=showposts;u=123e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index50c1-2.html.zxòg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ P,ZZOKtext/htmlISO-8859-1gzip0|ÖZZÿÿÿÿÿÿÿÿTue, 10 Mar 2020 20:17:45 GMT0ó°° ®0®P®€§²ð®òg^ÿÿÿÿÿÿÿÿÝ[ZZ Show Posts - Grimoire LD

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Grimoire LD

361
Ok so if it matches it will skip, and if it does not match, it will execute them...

That is purely if it is a Positive.

If the bit reads Negative it will look to Not Match the Event Flag to Skip Instructions, it the correct Event Flag is ON then the instructions will play. If the bit reads Positive it will be the opposite. It will look to see if a certain Event Flag is OFF otherwise it will skip the instructions.

What in the world?...

Ok so if the high bit of XX is 1, it will play on a match (ON) and skip on a mismatch (OFF), but if the high bit of XX is 0, it will skip on a match (OFF) and play on a mismatch (ON)?

 :edit: I tried downloading and applying the patch but it looks like it messed with many of my events... (yes I used an unheadered rom)... are you sure the patch changes nothing else besides those instructions?

Yes, you have it right now.

Hmm, I was worried that might be the case, what events are messed up out of curiosity?

362
If I'm understanding correctly, you could actually make the max stat increase 8.
0,1,2,3,4,5,6,7 would raise the stat 1,2,3,4,5,6,7,8 respectively. You wouldn't use the instruction to raise a stat by zero, after all.
Also, would this be able to raise multiple stats with one instruction? For instance, if I made my parameter "CX" would it raise both Wis and Will by X?
Also, I don't really understand what you're saying about Z...
I'm going to disappear for about a week - got some real world stuff I need to do - so this will be my last message for a while.
Some cool stuff happening here, though. I look forward to seeing what develops!

Hah, I didn't think about that Chillyfeez, I just assumed it would be easier to use the half-byte in its basic sense, but I could throw in a "+1" to the entire thing to make it whatever is chosen +1.

Now Z is using the same system I used for the Flag Check, using a Dummy Movement bit to choose the actor that would get the stat boost. And yes, as you pointed out you could use this to increase two or more (or all) stats by Y.

Ok so if it matches it will skip, and if it does not match, it will execute them...

That is purely if it is a Positive.

If the bit reads Negative it will look to Not Match the Event Flag to Skip Instructions, it the correct Event Flag is ON then the instructions will play. If the bit reads Positive it will be the opposite. It will look to see if a certain Event Flag is OFF otherwise it will skip the instructions.

363
Alright, so next will turn "Decrement x100 Gil" into Gain Stat (X) by Y amount, for Z Character.

This will be approached with the Dummy Movement Bit as all for the character.

Here is the plan...

XY.

X =

08=Strength
10=Agility
20=Vitality
40=Wisdom
80=Will

Y = Stat Increase (up to 7)

Z will be looked at on an Actor Basis so if you want Dark Knight Cecil to gain +5 Strength you would use Movement Byte 00 (Move Left). If the character is not present then they simply will not gain the stat.



But that plan will come for another day. As of now here is the Party Dead/Flag Check Patch.

(Please let me know if this patch actually works. I tried something a little different for the patching process so I'm not sure if it will work correctly.)

As always the patch must be unheadered!

If anyone has other ideas for new Event Instructions let me know and I'll see what I can do.

364
Grimoire, you are indeed a miracle worker!!

So let me see if I understand this correctly...
  • The instruction in question is the one currently interpreted as "Load Graphic"
  • It will now essentially become "If flag XX is [ON/OFF] (based on top bit of XX; 1 = on, 0 = off), do the next YY actions"
  • The YY in this description is not a parameter in the usual sense but is read by the next byte following the instruction
  • If the specified flag matches the specified value, it will do the next number of bytes worth of actions (not counting the "fake parameter" byte)
  • If it does not, it will skip them (also skipping the "fake parameter" byte)

If this is correct, what I can do as far as the editor is concerned is get it to detect the patch on startup and set a flag in the editor which will tell it how to interpret the "Load Graphic" command (which I guess should now default to "Crash Game"?); that way it will be readable for both patched and unpatched roms.

Speaking of which, this could definitely be its own standalone patch, "Grimoire LD's Event Instruction Expansion Patch" or something

  • If the specified flag matches the specified value, it will do the next number of bytes worth of actions (not counting the "fake parameter" byte)
  • If it does not, it will skip them (also skipping the "fake parameter" byte)

    Close, but not quite.

    If the Specified Flag matches the Specified Value it will Skip the Next number of bytes worth of actions dependent on the fake parameter.
    If it does not match, it will play them, let me go by your example of Yang...

    "Crash Game 05" (Is Event Flag (05) "Yang free from Brainwashing?" OFF )
    "Character 1 Moves Left" (Dummy Parameter, meaning 01 (+1 from Carry) in this instance).
    "Show Message  XX" (Two bytes, so it needs to skip two bytes, if not active.) "Cecil: If only Yang were here..."
    (Continue event from here)

    Then let'use another example...

    Show Message "King: Cecil! It is good to see you."
    "Crash Game 133" (Is event Flag  (05)"Yang free from Brainwashing?" ON)
    NPC 2 Face Left (Dummy Parameter, tells the game to skip the next 17 (+1) instructions. Skipping to end of the event.
    Toggle Visibility of Yang NPC (1)
    Move Yang Right (1)
    Show Message "King: We feared the worst when we heard what happened with Leviathan!" (2)
    Show Message "Yang: I assure you my lord, I am no worse for wear!" (2)
    Clear Event Flag 05 (2) 8 Bytes used so it will display this message once and unless the previous flag is turned back on, it will not play again.
    "Crash Game 2XX" (2)(Is Event Flag (unused) OFF?)
    NPC 1 Face Right (1) (5  (+1) Skips)
    Show Message: (2)"King: You've returned not a moment too soon, Yang. A Dragon in Mt. Hobbs is disrupting our daily training. As our High Monk I ask you to vanquish it."
    Show Message: "(2) Yang: You have my word."
    Activate Event Flag XX (2) (Unused one from above)
    END

    (The next portion of the side quest as in getting the reward would be in a separate event, that just uses the normal Flag Check for speech)

    Because it is positive it will check to see if this Event Flag is Off, in order to play those instructions.

    I hope that made a bit more sense.

    As for creating a patch, that seems like a good idea. With this "dummy parameter" I set up I have a bit more freedom in what I want to do with the remaining unused event instructions.

    I really like the idea of implementing its use in the editor so it won't look so strange when compiled into a readable format.

365
Can anyone think of any events that use the "move camera up one space then down again" instruction?

This one is used in some events that really want to shake the screen for effect. I think when the Enterprise is crash landing in the underground, maybe the Leviathan... It it usually combined with the horizontal screen shake rumble.

Ah, you're right. I hadn't considered that.. that means we have 3 free Event Instructions, (+Gil/-Gil/Nothing) not 4, my mistake.

Alright then PinkPuff with this knowledge let's see if I can build your event instruction... For continuity purposes I'll build it right out of my "Are all characters dead or petrified?" routine, as I said, it won't interfere with anything unless it's built into an event where the entire party has died (in which case you should set the healing instructions to occur immediately after the battle. This event instruction would also serve purpose for the Side Project to give some presence to the optional party for Zeromus.

Hmm... well after working on this for a little while I noticed a glaring issue...

There's no easy way to tell the game that an event instruction has been skipped and since they're of variable length this means that either...

1. A hack of this sort would need to be set to only skip Either 1 Byte Event Instructions OR Two Byte Instructions.

2. Create an "artificial" YY. This can be done in a fairly easy fashion, but it would involve manipulating the basic movement patterns... as the amount of instructions to skip. So let's say this... in the editor (at the moment. You might be able to program this into the editor with full capability PinkPuff) You would use "Load Graphic" and say you set it to 85, this implies that the game will look to see if Yang has been freed from brainwashing (80 acting as the "On Check", 5 Acting as the Event Flag to check) Secondly you put "Placement 1 Faces Up" Immediately After this would then be the "YY" and that would technically be 04 +1 Instructions skipped (since it will be using the basic Event Routine Progress your choice will Always have to be (Value skipped +1))

I'd much rather try and work out of 2, than 1, since 1 is too binding. I'll see what I can do.


And the first part is done! I now have part of it successfully implemented, here is my redone "check if dead/petrified" and then here is my "Is Event Flag XX on? If so, skip the next (as designated by next event instruction byte over) actions.

Code: [Select]
$00/FD71 AD 03 10 LDA $1003  [$00:1003] A:00FD X:0000 Y:0002 P:envMxdiZc - Load Slot 1's Status Byte 1.
$00/FD74 29 C0 AND #$C0 A:0040 X:0000 Y:0002 P:envMxdizc - Get rid of all bits that are not Petrify or Dead
$00/FD76 F0 1F BEQ $1F    [$FD97] A:0040 X:0000 Y:0002 P:envMxdizc - If 00, branch to Flag Check Portions.
$00/FD78 AD 43 10 LDA $1043  [$00:1043] A:0040 X:0000 Y:0002 P:envMxdizc (Do this for the next four slots)
$00/FD7B 29 C0 AND #$C0 A:0080 X:0000 Y:0002 P:eNvMxdizc
$00/FD7D F0 18 BEQ $18    [$FD97] A:0080 X:0000 Y:0002 P:eNvMxdizc
$00/FD7F AD 83 10 LDA $1083  [$00:1083] A:0080 X:0000 Y:0002 P:eNvMxdizc
$00/FD82 29 C0 AND #$C0 A:0080 X:0000 Y:0002 P:eNvMxdizc
$00/FD84 F0 11 BEQ $11    [$FD97] A:0080 X:0000 Y:0002 P:eNvMxdizc
$00/FD86 AD C3 10 LDA $10C3  [$00:10C3] A:0080 X:0000 Y:0002 P:eNvMxdizc
$00/FD89 29 C0 AND #$C0 A:0080 X:0000 Y:0002 P:eNvMxdizc
$00/FD8B F0 0A BEQ $0A    [$FD97] A:0080 X:0000 Y:0002 P:eNvMxdizc
$00/FD8D AD 03 11 LDA $1103  [$00:1103] A:0080 X:0000 Y:0002 P:eNvMxdizc
$00/FD90 29 C0 AND #$C0 A:0080 X:0000 Y:0002 P:eNvMxdizc
$00/FD92 F0 03 BEQ $03    [$FD97] A:0080 X:0000 Y:0002 P:eNvMxdizc
$00/FD94 4C 04 EB JMP $EB04  [$00:EB04] A:0080 X:0000 Y:0002 P:eNvMxdizc - Branch to Event Switch Routine
-----------------------------------------------------------------------------------------------------------------------------
$00/FD97 20 CB E2 JSR $E2CB  [$00:E2CB] A:0000 X:0000 Y:0002 P:envMxdiZc - Jump to Event Instruction position
00/FD9A 10 31 BPL $31    [$FDCD] A:0084 X:0001 Y:0002 P:eNvMxdizc - Branch if the Value is Positive (Flag is Off Portion)
----------------------------------------------------------------------------------------------------------------------------------
$00/FD9C 29 7F AND #$7F A:0084 X:0001 Y:0002 P:eNvMxdizc - Clear all negative bits.
$00/FD9E 20 7F F1 JSR $F17F  [$00:F17F] A:0004 X:0001 Y:0002 P:envMxdizc - Jump to Event Flag Byte Placement Routine
$00/FDA1 A9 01 LDA #$01 A:0004 X:0001 Y:0004 P:envMxdizC - Load 01 into A.
$00/FDA3 C0 00 00 CPY #$0000 A:0001 X:0001 Y:0004 P:envMxdizC - Compare Y to 00 (due to subroutine above, it is now the amount of times it needs to loop to reach appropriate Event Flag)
$00/FDA6 F0 04 BEQ $04    [$FDAC] A:0001 X:0001 Y:0004 P:envMxdizC - If 00 branch.
$00/FDA8 0A ASL A A:0001 X:0001 Y:0004 P:envMxdizC - x2 A
$00/FDA9 88 DEY A:0002 X:0001 Y:0004 P:envMxdizc -1 Y
$00/FDAA 80 F7 BRA $F7    [$FDA3] A:0002 X:0001 Y:0003 P:envMxdizc - Loop back to FDA3.
------------------------------------------------------------------------------------------------------------------
$00/FDAC A6 3D LDX $3D    [$00:063D] A:0010 X:0001 Y:0000 P:envMxdiZC - Load Event Flag Bit into X.
$00/FDAE 48 PHA A:0010 X:0000 Y:0000 P:envMxdiZC - Push Event flag onto Stack
$00/FDAF BD 80 12 LDA $1280,x[$00:1280] A:0010 X:0000 Y:0000 P:envMxdiZC - Load Event Flag Byte
$00/FDB2 AA TAX A:0019 X:0000 Y:0000 P:envMxdizC - Transfer Event Flag Byte to X.
$00/FDB3 85 FF STA $FF    [$00:06FF] A:0019 X:0019 Y:0000 P:envMxdizC - Store Event Flag Byte into 06FF.
$00/FDB5 68 PLA A:0019 X:0019 Y:0000 P:envMxdizC - Pull Event Flag Bit from Stack.
$00/FDB6 2D FF 06 AND $06FF  [$00:06FF] A:0010 X:0019 Y:0000 P:envMxdizC - Test it against the Event Flag Byte to see if it goes through.
$00/FDB9 D0 01 BNE $01    [$FDBC] A:0010 X:0019 Y:0000 P:envMxdizC - If it is not 00, proceed.
-------------------------------------------------------------------------------------------------------------------------
$00/FDBB 60 RTS A:006D X:006B Y:0000 P:envMxdizc - Return
----------------------------------------------------------------------------------------------------------------------
$00/FDBC AE D3 09 LDX $09D3  [$00:09D3] A:006D X:006B Y:0000 P:envMxdizc - Load  X from Event Placements.
$00/FDBF BF 00 82 12 LDA $128200,x[$12:826B] A:0010 X:006B Y:0000 P:envMxdizC - Load A from Next Byte over (This is the dummy movement bit I mentioned above, which would correspond to how many instructions are skipped)
$00/FDC3 86 FF STX $FF    [$00:06FF] A:0001 X:006B Y:0000 P:envMxdizC - Store X in 06FF.
$00/FDC5 65 FF ADC $FF    [$00:06FF] A:0001 X:006B Y:0000 P:envMxdizC - Add the value of Event Placements onto A (Dummy Movement Bit set to 01, + Event Placement)
$00/FDC7 8D D3 09 STA $09D3  [$00:09D3] A:006D X:006B Y:0000 P:envMxdizc - Store this into the current Progress of Event Placement.

Whew! Now that was an interesting experiment and it seems to work great! I just need to throw in a check for "Is Event Flag XX Off?" Which as you can see, is already planned. I just need to get to it. So I think I can conclude this experiment to be a success!


 :edit: Let's get to the "If Event Flag is OFF then, shall we?

Code: [Select]

And that's done... it's is clean as I can get it, I'm sure someone else could condense it more, but it works perfectly fine as is, I rewrote the code to make it work with the Event Flag OFF Option.

[code]
$00/FD97 20 CB E2 JSR $E2CB  [$00:E2CB] A:000C X:0000 Y:0000 P:envMxdizc  - Jump to Event Instruction Pull Routine
$00/FD9A 29 7F AND #$7F A:000C X:0000 Y:0000 P:envMxdizc - Get rid of negative bit.
$00/FD9C 20 7F F1 JSR $F17F  [$00:F17F] A:000C X:0000 Y:0000 P:envMxdizc - Jump to Event Flag Byte Placement routine.
$00/FD9F A9 01 LDA #$01 A:000C X:0000 Y:0000 P:envMxdizc -  Load 01 into A.
$00/FDA1 C0 00 00 CPY #$0000 A:000C X:0000 Y:0000 P:envMxdizc - Compare Y to 0000 (Reaches Event Flag bit eventually)
$00/FDA4 F0 04 BEQ $04    [$FDAA] A:000C X:0000 Y:0000 P:envMxdizc - Branch if 00.
----------------------------------------------------------------------------------------------------------------
$00/FDA6 0A ASL A A:000C X:0000 Y:0000 P:envMxdizc - x2 A
$00/FDA7 88 DEY A:000C X:0000 Y:0000 P:envMxdizc - -1 Y
$00/FDA8 80 F7 BRA $F7    [$FDA1] A:000C X:0000 Y:0000 P:envMxdizc - Loop back.
---------------------------------------------------------------------------------------------------------------
$00/FDAA A6 3D LDX $3D    [$00:063D] A:000C X:0000 Y:0000 P:envMxdizc - Load Event Flag Bit into X.
$00/FDAC 48 PHA A:000C X:0000 Y:0000 P:envMxdizc - Push Event Flag onto Stack.
$00/FDAD AD D6 09 LDA $09D6  [$00:09D6] A:000C X:0000 Y:0000 P:envMxdizc - Load Event Flag Byte into X.
$00/FDB0 10 0D BPL $0D    [$FDBF] A:000C X:0000 Y:0000 P:envMxdizc - If positive, branch.
----------------------------------------------------------------------------------------------------------------------
$00/FDB2 BD 80 12 LDA $1280,x[$00:1280] A:000C X:0000 Y:0000 P:envMxdizc - Load Event Flag Byte Placement into A.
$00/FDB5 AA TAX A:000C X:0000 Y:0000 P:envMxdizc - Transfer Event Flag Byte into X.
$00/FDB6 85 FF STA $FF    [$00:06FF] A:000C X:0000 Y:0000 P:envMxdizc - Store A in 06FF.
$00/FDB8 68 PLA A:000C X:0000 Y:0000 P:envMxdizc - Pull Event Flag Bit from Stack
$00/FDB9 2D FF 06 AND $06FF  [$00:06FF] A:000C X:0000 Y:0000 P:envMxdizc - Get rid of all bits not present in 06FF in A.
$00/FDBC D0 0E BNE $0E    [$FDCC] A:000C X:0000 Y:0000 P:envMxdizc - Branch if Not 00 (Meaning Event Flag is On) to rest of routine
--------------------------------------------------------------------------------------------------------------------
$00/FDBE 60 RTS A:000C X:0000 Y:0000 P:envMxdizc
-----------------------------------------------------------------------------------------------------------------
$00/FDBF BD 80 12 LDA $1280,x[$00:1280] A:000C X:0000 Y:0000 P:envMxdizc
$00/FDC2 AA TAX A:000C X:0000 Y:0000 P:envMxdizc
$00/FDC3 85 FF STA $FF    [$00:06FF] A:000C X:0000 Y:0000 P:envMxdizc
$00/FDC5 68 PLA A:000C X:0000 Y:0000 P:envMxdizc
$00/FDC6 2D FF 06 AND $06FF  [$00:06FF] A:000C X:0000 Y:0000 P:envMxdizc
$00/FDC9 F0 01 BEQ $01    [$FDCC] A:000C X:0000 Y:0000 P:envMxdizc - (As above, except it is looking for a match within 06FF's bits and the Event Flag bit it is searching for)
----------------------------------------------------------------------------------------------------------
$00/FDCB 60 RTS A:000C X:0000 Y:0000 P:envMxdizc - Return
--------------------------------------------------------------------------------------------------------
$00/FDCC AE D3 09 LDX $09D3  [$00:09D3] A:000C X:0000 Y:0000 P:envMxdizc- Load X from Event Progress Placement.
$00/FDCF BF 00 82 12 LDA $128200,x[$12:8200] A:000C X:0000 Y:0000 P:envMxdizc - Load A from Event Placement +X (Dummy Movement Bit acting as the numerical value of actions to skip)
$00/FDD3 86 FF STX $FF    [$00:06FF] A:000C X:0000 Y:0000 P:envMxdizc - Store X in 06FF.
$00/FDD5 65 FF ADC $FF    [$00:06FF] A:000C X:0000 Y:0000 P:envMxdizc - Add 06FF onto A. (Event Placement + Dummy Movement Bit)
$00/FDD7 8D D3 09 STA $09D3  [$00:09D3] A:000C X:0000 Y:0000 P:envMxdizc  - Store A in Event Progress Placement.
$00/FDDA 60 RTS A:000C X:0000 Y:0000 P:envMxdizc - Return

And there we are! Now you may have Event Flags control actions taken within events and have different effects depending on whether it is On or Off and thrown in is the Dead/Petrified characters check.


366
The idea you present would work, IF there was a YY portion. None of the four unused/redundant Event Instructions have a YY portion to draw from and to add a YY portion to an instruction that did not originally have it to any of the existing Event Instructions would need a large rewrite to Events all together.

Hm, well if that's the only problem (besides the issue of deciphering how to read flag values) I have a very hack-ish solution:

"Do the following action if Flag XX is (on/off)"

Top bit of XX indicates whether you're looking for on or off, the rest indicate the flag number (since it seems all the used flags besides 255 are under 128 ^_^)

That way if you want multiple conditional instructions, it can still be done, though rather tediously:

Code: [Select]
If "saved Yang" is ON do the next action
 Placement 4: Yang toggles visibility
If "saved Yang" is ON do the next action
 Placement 4: Yang moves up
If "saved Yang" is ON do the next action
 Show Message: "Yang: Leave it to me"
If "saved Yang" is OFF do the next action
 Show Message: "Cecil: If only Yang were here"

Also I do like the stop-gap solution you proposed for my more immediate problem of switching to paladin/DK cecil, but I think if we can somehow swing a more general "conditional" instruction, it would vastly improve the expressiveness of the event code generally and open a lot of new doors.

This is a workable idea and quite easy (in theory) to put together. The first step would involve decrementing the value to -80 to reach the proper event Flag check and then reloading the  byte and checking to see if it is negative (which it will be if it is 80) to branch to the Event Flag Check. 80 will check to see if it is On while 00 will check to see if it is Off. But again, this does require reverse-engineering as you put it. So... I'll get on that and see what I can find. Hopefully it won't be too much math.

Alright, that was easy to find...

$00/EF81   20 CB E2   JSR $E2CB  [$00:E2CB]   A:00EF   X:0000   Y:0002   P:envMxdiZc - Jump to Event Instruction Jump Routine (Looks like this is already prepared as well)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$00/E2CB   E8    INX   A:00EF   X:0000   Y:0002   P:envMxdiZc - +1 to X.
$00/E2CC   86 B3   STX $B3    [$00:06B3]   A:00EF   X:0001   Y:0002   P:envMxdizc - store X in 06B3.
$00/E2CE   BD D5 09   LDA $09D5,x[$00:09D6]   A:00EF   X:0001   Y:0002   P:envMxdizc - Load Event Instruction Location +X (meaning next byte over) into A (in this case the Flag Number)
$00/E2D1   60    RTS   A:0005   X:0001   Y:0002   P:envMxdizc - Return
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$00/EF84   20 33 F1   JSR $F133  [$00:F133]   A:0005   X:0001   Y:0002   P:envMxdizc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$00/F133   20 7F F1   JSR $F17F  [$00:F17F]   A:0005   X:0001   Y:0002   P:envMxdizc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$00/F17F   48    PHA   A:0005   X:0001   Y:0002   P:envMxdizc - Push A onto Stack
$00/F180   4A    LSR A   A:0005   X:0001   Y:0002   P:envMxdizc -
$00/F181   4A    LSR A   A:0002   X:0001   Y:0002   P:envMxdizC -
$00/F182   4A    LSR A   A:0001   X:0001   Y:0002   P:envMxdizc - /8
$00/F183   85 3D   STA $3D    [$00:063D]   A:0000   X:0001   Y:0002   P:envMxdiZC - Store A in 063D.
$00/F185   64 3E   STZ $3E    [$00:063E]   A:0000   X:0001   Y:0002   P:envMxdiZC - Store Zero in 063E.
$00/F187   68    PLA   A:0000   X:0001   Y:0002   P:envMxdiZC - Pull A from Stack,
$00/F188   29 07   AND #$07   A:0005   X:0001   Y:0002   P:envMxdizC - AND 07 Only saves bits 1,2, and 4. Anything above them is set to 00.
$00/F18A   A8    TAY   A:0005   X:0001   Y:0002   P:envMxdizC - Transfer A to Y.
$00/F18B   60    RTS   A:0005   X:0001   Y:0005   P:envMxdizC - Return
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
$00/F136   A9 01   LDA #$01   A:0005   X:0001   Y:0005   P:envMxdizC - Load 01 into A.
$00/F138   C0 00 00   CPY #$0000   A:0001   X:0001   Y:0005   P:envMxdizC - Compare Y to 00.
$00/F13B   F0 05   BEQ $05    [$F142]   A:0001   X:0001   Y:0005   P:envMxdizC - If so, branch to end.
$00/F13D   0A    ASL A   A:0001   X:0001   Y:0005   P:envMxdizC - x2 A
$00/F13E   88    DEY   A:0002   X:0001   Y:0005   P:envMxdizc - 1 Y.
$00/F13F   4C 38 F1   JMP $F138  [$00:F138]   A:0002   X:0001   Y:0004   P:envMxdizc - Jump back to F138.
--------------------------------------------------------------------------------------------------
$00/F142   A6 3D   LDX $3D    [$00:063D]   A:0020   X:0001   Y:0000   P:envMxdiZC  - Load X from 063D (would be the Event Flag byte to look at)
$00/F144   1D 80 12   ORA $1280,x[$00:1280]   A:0020   X:0000   Y:0000   P:envMxdiZC - Add the amount of the flag present from the Event Flag Byte.
$00/F147   9D 80 12   STA $1280,x[$00:1280]   A:0039   X:0000   Y:0000   P:envMxdizC - Store A in the Event Flag.
[/code]

Very nicely done Square! This is very simple and effective.

It it quite simple really, I'll explain what Square did to look at it as well as I can...

It looks at raw hex of the Event Flag. (in this case it was 05)

It then takes that 05 and divides it by 8. This is how it finds what Event Flag Byte it is meant to be changing.

From there it stores the original flag hex and puts it into the stack and quickly withdraws it after the Event Flag Byte is found.

Once it is withdrawn it is AND'd to assure that the value is correct (remember the Event Flag Byte has already been chosen) making the last valid value as 07. Which corresponds with the last bit of a boolean)

A is transferred to Y and then is set to 01. This sets it for the proper path of being put successfully into the Event Flag Byte.

Y is compared to 00 to pass the branching condition which will occur when the original value (5 in this case) is successfully reached as an Event Flag Bit, in this case 05 would be the 5th Bit, which is 20 and that is where it is stored in the first Event Flag Byte as a 20.

I would basically just have to copy this code for the proper flag checks and your idea should be rather simple to put together PinkPuff! But I don't think I can handle that tonight. I'll give it a go tomorrow though.


367
So, with the code you posted that uses the Yes/No routine... would that replace the Yes/No routine? So you could have a game that has yes/no boxes or you could have a game that has flag-based branches, but not both? Also, can you only have one branch in an event with this method?

How does the "Repeat the next XX actions YY times" work? I was picturing the branch instruction to work more similar to that one where you could have code that uses multiple branches like

Code: [Select]
Show Message: "Elder: There are many paths ahead of you."
Show Message: " You can go to the moon using the Lunar Whale..."
If "awakened Yang" is off do the next 1 actions:
 Show Message: "Elder: Your friend Yang may still be alive"
If "found Yang" is on do the next 1 actions:
 Show Message: "Elder: Perhaps his wife knows how to wake him"
If "found Adamant" is off do the next 1 actions:
 Show Message: "Elder: A blacksmith in the underworld needs a rare ore, perhaps he can make something useful with it!"
If "found Tail" is on do the next 1 actions:
 Show Message: "Elder: There is a miner that collects tails, perhaps he will trade that one for something useful"
If "defeated Odin" is off do the next 1 actions:
 Show Message: "Elder: The ghost of Odin waits for you in Baron's basement"
Show Message: "Elder: Good luck, Cecil!"

So I take it it isn't as simple as "check flag value, compare to 0, if equal load A with YY, skip ahead bytes in the event code while decrementing A until 0"?

In any case, I guess something like that would involve hijacking an instruction that took two parameters, wouldn't it?

Slight misunderstanding... this custom code I made actually jumps into the final portion of the Yes/No routine without disrupting the original at all, as it uses the original jump's content within its entirety. (I didn't account for petrify though, which means I'll need to rewrite my custom code to make it a little lengthier for the purposes of covering all bases)

The idea you present would work, IF there was a YY portion. None of the four unused/redundant Event Instructions have a YY portion to draw from and to add a YY portion to an instruction that did not originally have it to any of the existing Event Instructions would need a large rewrite to Events all together.

While it is rather neat idea, it would not be usable in the basic sense, perhaps the custom code could have a table of its own to make it work. In any event I have not yet checked how the game accurately switches on and off booleans using a numeric value to jump into the flags and switch bits on and off. Once that portion is researched that part of it should be able to be done.

368
Can anyone think of any events that use the "move camera up one space then down again" instruction?

That seems like a silly one that could be easily changed to something else with very few consequences...
Though it has no natural parameters...

Haha! I had a post written up a few days ago about useless or unused event codes.

That "move camera up one space then down again" one was the very first one I mentioned due to its absurd uselessness.

From there I addressed the the two Add/Subtract Gils... then I noticed that was it so I never made the post.

All in all we have four event instructions to change as we will without disrupting anything the game normally does.

369
I'm curious as to what the presumed function of that instruction would be, PinkPuff, considering the fluidity of party slots?

I remember what I wanted as an event instruction now. It was, "reduce HP by XX."
I ended up putting some event-specific ASM in my hack to reduce party HP whenever a particular event occurs instead.
Wouldn't it make sense, for example, for the "Ouch!" event to reduce HP? That's not what I wanted it for, but it's a relatable example.

That's some good thinking there Chillyfeez, I personally would like the first option more you described by using an event instruction to do that.

Upon reflection, it wouldn't do what I wanted anyway.

The situation I'm thinking of is this:

Suppose you have a scenario involving the twins, but it could be done while Cecil is still a Dark Knight, or it could be done while he's a Paladin. Furthermore, you don't have any guarantees over who else might be in the party when the scenario is executed.

So I guess it would make more sense to have a function like,
"Change character graphic to DK Cecil if the 'became a paladin' flag is off, otherwise change character graphic to Paladin Cecil"

 :edit: ACTUALLY!! How about this:

"If Flag XX is on, do the following YY actions; otherwise skip past them"

This will require disassembly of the Yes/No Option for optimal use, while I would assume that your method here would work, there is no YY option allowed here because the instruction only has a single variable and that would be some heavily advanced hacking to get the game to read another variable for event instruction. While if you tie it into the  Yes/No Option of "If Flag XX is on keep following this event, if not, go to second event" would work much better I'd imagine.

So let's get to disassembling the Yes/No option and see how it works!

EAE9 - Show Message 1XX (Yes/No Box) F8

Or at least that was the plan, but this is doing so many functions I can't keep them straight, nor do I understand much about the graphics processing part, so I will skip to the important part to purely create another event instruction which can skip to the next event.

Alright, I understand now... that is rather simple and should be easy to manipulate. It looks like the game has a built in "check" there already, when the cursor is on Yes, it is 00 which means nothing special, all normal events proceed off of this. But when the cursor is on No, the game changes a certain value to 01 and through a series of code uses the game will skip to the next event through this instruction.

Here is what is being done...

$00/AC53   A5 8C   LDA $8C    [$00:068C]   A:0011   X:3745   Y:00D0   P:envMxdiZC - Load A from 068C (Cursor Choice)
$00/AC55   85 DB   STA $DB    [$00:06DB]   A:0001   X:3745   Y:00D0   P:envMxdizC - Store A in in Event Switcher
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
$00/EB00   A5 DB   LDA $DB    [$00:06DB]   A:0000   X:0010   Y:00D0   P:envMxdiZC - Load A from Event Switcher.
$00/EB02   F0 07   BEQ $07    [$EB0B]   A:0000   X:0010   Y:00D0   P:envMxdiZC - Branch if 00 past Event Switching.
----------------------------------------------------------------------------------
00/EB04   20 D2 E2   JSR $E2D2  [$00:E2D2]   A:00FF   X:006C   Y:00D0   P:envMxdiZC - Jump to Event Switching Routine
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
$00/E2D2   AE D3 09   LDX $09D3  [$00:09D3]   A:0001   X:0010   Y:00D0   P:envMxdizC - Load X from Event Position
$00/E2D5   E8    INX   A:0001   X:006B   Y:00D0   P:envMxdizC - +1 X.
$00/E2D6   BF 00 82 12   LDA $128200,x[$12:826C]   A:0001   X:006C   Y:00D0   P:envMxdizC - Load Event Instruction ID.
$00/E2DA   C9 FF   CMP #$FF   A:00FF   X:006C   Y:00D0   P:eNvMxdizC - Is it End Event?
$00/E2DC   F0 04   BEQ $04    [$E2E2]   A:00FF   X:006C   Y:00D0   P:envMxdiZC - If so, branch
----------------------------------------------------------------------------------------------------
$00/E2DE   E8    INX   A:00FF   X:006C   Y:00D0   P:envMxdiZC + 1 X
$00/E2DF   4C D6 E2   JMP $E2D6  [$00:E2D6]   A:00FF   X:006C   Y:00D0   P:envMxdiZC - Jump (backwards) to E2D6 to +1 X again to look for the end of the event.
-------------------------------------------------------------------------------------------------------
$00/E2E2   8E D3 09   STX $09D3  [$00:09D3]   A:00FF   X:006C   Y:00D0   P:envMxdiZC - Store X in Event Position
$00/E2E5   60    RTS   A:00FF   X:006C   Y:00D0   P:envMxdiZC - Return


And that's all it seems to take. If the new instruction looks at an Event Flag instead of at a cursor position to use the same Event Switch code everything should work properly.

This would also be the way to set up branching paths in a way where Actions in addition to Yes/No Options could influence the course of gameplay

My thinking is to make this two-pronged...

Say I wanted a scenario where a battle could be won, but didn't have to be and the outcome would be the way the game would branch to two different scenarios. To The first would be this... "Is Characters 1-5 Dead?" IF so, play Event Switcher"  That would accomplish this. Then in the code, do as you suggest; "Is Event Flag XX on? If so, branch to next event". In normal gameplay all characters can't be dead so the first part would never play, but that scenario can happen in events and event battles.

I will try an experiment shortly to see if I can put theory into practice...

Changing Event Instruction FC (Nothing) to (If All Characters are Dead move to next event)

First thing is first, we will need to go to the Pointer Table and make sure that FC's instruction start is read properly, so change the 0000 at E33E to 71FD (free space at the end of Bank 0)

And it worked in such an easy manner, I'm somewhat shocked! I created a custom Event Instruction as a test using my "dead party" idea and it was flawless. It jumped to the next event once it saw that the entire party was dead and if a party member was alive it would not use the Event Switcher.

$00/FD71   BD 03 10   LDA $1003,x[$00:1003]   A:00FD   X:0000   Y:0002   P:envMxdiZc - Load Character 1's Status Byte 1.
$00/FD74   10 17   BPL $17    [$FD8D]   A:0000   X:0000   Y:0002   P:envMxdiZc - If they are not dead, branch to End.
$00/FD71   BD 03 10   LDA $1003,x[$00:1003]   A:00FD   X:0000   Y:0002   P:envMxdiZc - Do this for the rest of the Slots.
$00/FD74   10 17   BPL $17    [$FD8D]   A:0080   X:0000   Y:0002   P:eNvMxdizc
$00/FD76   BD 43 10   LDA $1043,x[$00:1043]   A:0080   X:0000   Y:0002   P:eNvMxdizc
$00/FD79   10 12   BPL $12    [$FD8D]   A:0080   X:0000   Y:0002   P:eNvMxdizc
$00/FD7B   BD 83 10   LDA $1083,x[$00:1083]   A:0080   X:0000   Y:0002   P:eNvMxdizc
$00/FD7E   10 0D   BPL $0D    [$FD8D]   A:0080   X:0000   Y:0002   P:eNvMxdizc
$00/FD80   BD C3 10   LDA $10C3,x[$00:10C3]   A:0080   X:0000   Y:0002   P:eNvMxdizc
$00/FD83   10 08   BPL $08    [$FD8D]   A:0080   X:0000   Y:0002   P:eNvMxdizc
$00/FD85   BD 03 11   LDA $1103,x[$00:1103]   A:0080   X:0000   Y:0002   P:eNvMxdizc
$00/FD88   10 03   BPL $03    [$FD8D]   A:0080   X:0000   Y:0002   P:eNvMxdizc
$00/FD8A   20 04 EB   JSR $EB04  [$00:EB04]   A:0080   X:0000   Y:0002   P:eNvMxdizc - Jump to Subroutine (Event Switcher)
$00/FD8D   60    RTS   A:0000   X:0000   Y:0002   P:envMxdiZc

That's all it took.

Now as for the rest of your idea Pinkpuff, that is a bit more complicated... while I can easily set F8's variable to act as an event flag searcher, I do not know how the game actually tells if an event flag is off or on in a numerical fashion since the Event Flags are booleans (I think that's the right term) and they comprise of much more than one byte. So how the game turns them on and off, I do not know. Once that is found though your idea would work fine.

Though there is another suggestion I would make...

I would suggest looking for Dark Knight Cecil or Paladin Cecil rather than holding to Event Flag dealings. It would be something as simple as above...

Look through the each slots. If the slot is Dark Knight Cecil keep on with the current event.  If the slot is Paladin Cecil switch events. If neither, move on to the next slot.

Something like this would be really easy to build especially with all of the free space at the end of Bank 1, but from what you described the event would not be too terribly different. In such a case I think modifying the "Change Character Graphic" to look only at the two Cecil's (it doesn't ever use it for anything else in the default game) and using the pattern I mentioned above should do the trick.


370
I've started work on figuring out the Event Instructions Routines and my focus is primarily on the unused ones at the moment for some future plans.

Subtract XX *  100 Gil

Code: [Select]
$00/E97E 20 CB E2 JSR $E2CB  [$00:E2CB] A:00E9 X:0000 Y:0002 P:envMxdiZc - Jump to Event Progression Routine
$00/E981 85 18 STA $18    [$00:0618] A:0001 X:0001 Y:0002 P:envMxdizc - Store Event Variable in to 0618.
$00/E983 64 19 STZ $19    [$00:0619] A:0001 X:0001 Y:0002 P:envMxdizc - Store Zero in 0619.
$00/E985 A9 64 LDA #$64 A:0001 X:0001 Y:0002 P:envMxdizc - Load 100 into A (Remove 100 Gil)
$00/E987 85 1A STA $1A    [$00:061A] A:0064 X:0001 Y:0002 P:envMxdizc - Store a in Event Variable(2)
$00/E989 64 1B STZ $1B    [$00:061B] A:0064 X:0001 Y:0002 P:envMxdizc - Store Zero in 1B.
$00/E98B 22 95 C3 15 JSL $15C395[$15:C395] A:0064 X:0001 Y:0002 P:envMxdizc - Jump to Subroutine (?)
$00/E98F AD A0 16 LDA $16A0  [$00:16A0] A:0000 X:0001 Y:0000 P:envMxdiZc - Load Gil Total (Byte 1)
$00/E992 38 SEC A:00DB X:0001 Y:0000 P:eNvMxdizc - Set Carry Flag
$00/E993 E5 30 SBC $30    [$00:0630] A:00DB X:0001 Y:0000 P:eNvMxdizC - Subtract it by the value in 0630 (event designated value)
$00/E995 8D A0 16 STA $16A0  [$00:16A0] A:003F X:0001 Y:0000 P:envMxdizC - Store A in Gil Total (Byte 1)
$00/E998 AD A1 16 LDA $16A1  [$00:16A1] A:003F X:0001 Y:0000 P:envMxdizC - Load Gil Total (Byte 2)
$00/E99B E5 31 SBC $31    [$00:0631] A:0000 X:0001 Y:0000 P:envMxdiZC - Subtract it by the value in 0631.
$00/E99D 8D A1 16 STA $16A1  [$00:16A1] A:009D X:0001 Y:0000 P:eNvMxdizc - Store A in Gil Total (Byte 2)
$00/E9A0 AD A2 16 LDA $16A2  [$00:16A2] A:009D X:0001 Y:0000 P:eNvMxdizc - Load A from Gil Total (Byte 3)
$00/E9A3 E5 32 SBC $32    [$00:0632] A:0000 X:0001 Y:0000 P:envMxdiZc - Subtract it by the value in 0632.
$00/E9A5 8D A2 16 STA $16A2  [$00:16A2] A:00FF X:0001 Y:0000 P:eNvMxdizc - Store A in Gil Total (Byte 3)
$00/E9A8 B0 09 BCS $09    [$E9B3] A:00FF X:0001 Y:0000 P:eNvMxdizc - If above 00, skip to End.
---------------------------------------------------------------------------------------------------------------------------------
$00/E9AA 9C A0 16 STZ $16A0  [$00:16A0] A:00FF X:0001 Y:0000 P:eNvMxdizc - Store Zero in Gil Total 1,2, and 3.
$00/E9AD 9C A1 16 STZ $16A1  [$00:16A1] A:00FF X:0001 Y:0000 P:eNvMxdizc
$00/E9B0 9C A2 16 STZ $16A2  [$00:16A2] A:00FF X:0001 Y:0000 P:eNvMxdizc
$00/E9B3 4C D3 E0 JMP $E0D3  [$00:E0D3] A:00FF X:0001 Y:0000 P:eNvMxdizc - Jump to rest of routine


For such an unused command it came with a fair amount of space 37 Bytes all in all which is a nice tidy sum and may be enough room to set further functionalities of events. FFII for instance has a rather strange one-time event where at the top of the Mysidia Tower there are four orbs which increase Stats. Surely FFIV could have such a thing as well, no? The best way to handle this idea would be to make the value a stat can increase from 1-4 (10,20,40,80 bit booleans) and use the second value as the functional "X" value (7E100F/7E1014 for the start) To simplify things it would probably be the character in Slot 1 that would get the stat boosts. This is all in theory of course, but it seems like it should work.

Despite the Event Instruction of Add 100 * GP never being used in-game the routine it links to is used by Treasure Chests with Gil in them as well. The objective then would be to change that link to unused space.

$00/E978   20 DD 97   JSR $97DD  [$00:97DD]   A:0000   X:0001   Y:0000   P:envMxdiZc - Jump to Gil Acquisition Routine. Called by events...

Though I seem to have found the basic routines for events so I should probably set those first...

Code: [Select]
$00/E01A A2 00 00 LDX #$0000 A:00FF X:4B0E Y:0002 P:eNvMxdizc - Load 0000 into X.
$00/E01D 86 B3 STX $B3    [$00:06B3] A:00FF X:0000 Y:0002 P:envMxdiZc - Store X in B3.
$00/E01F BD D5 09 LDA $09D5,x[$00:09D5] A:00FF X:0000 Y:0002 P:envMxdiZc - Load A from Event Instruction ID.
$00/E022 8D 16 0A STA $0A16  [$00:0A16] A:00E5 X:0000 Y:0002 P:eNvMxdizc -  Store A in 0A16.
$00/E025 C9 D0 CMP #$D0 A:00E5 X:0000 Y:0002 P:eNvMxdizc - Is this event ID Below Toggle Screen Shake? (Meaning Movement)
$00/E027 90 03 BCC $03    [$E02C] A:00E5 X:0000 Y:0002 P:envMxdizC - Then branch to Movement Patterns.
--------------------------------------------------------------------------------
$00/E029 4C B8 E0 JMP $E0B8  [$00:E0B8] A:00E5 X:0000 Y:0002 P:envMxdizC - Jump to Rest of Event ID's Routines.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$00/E0B8 38 SEC A:00E5 X:0000 Y:0002 P:envMxdizC - Set Carry Flag
$00/E0B9 E9 D0 SBC #$D0 A:00E5 X:0000 Y:0002 P:envMxdizC - Subtract D0
$00/E0BB 64 3E STZ $3E    [$00:063E] A:0015 X:0000 Y:0002 P:envMxdizC - Store Zero in 3E.
$00/E0BD 0A ASL A A:0015 X:0000 Y:0002 P:envMxdizC - x2 A.
$00/E0BE 26 3E ROL $3E    [$00:063E] A:002A X:0000 Y:0002 P:envMxdizc
$00/E0C0 85 3D STA $3D    [$00:063D] A:002A X:0000 Y:0002 P:envMxdiZc - Store A in 063D.
$00/E0C2 A6 3D LDX $3D    [$00:063D] A:002A X:0000 Y:0002 P:envMxdiZc - Load X from x2 Event ID -D0
$00/E0C4 BD E6 E2 LDA $E2E6,x[$00:E310] A:002A X:002A Y:0002 P:envMxdizc - Load A from E2E6+X (Event ID Table)
$00/E0C7 85 3D STA $3D    [$00:063D] A:0067 X:002A Y:0002 P:envMxdizc - Store A in 063D.
$00/E0C9 BD E7 E2 LDA $E2E7,x[$00:E311] A:0067 X:002A Y:0002 P:envMxdizc - Load A from E2E7 +  (Event ID Table)
$00/E0CC 85 3E STA $3E    [$00:063E] A:00E9 X:002A Y:0002 P:eNvMxdizc - Store A in 063E.
$00/E0CE A6 B3 LDX $B3    [$00:06B3] A:00E9 X:002A Y:0002 P:eNvMxdizc - Load X from B3.
$00/E0D0 6C 3D 06 JMP ($063D)[$00:E967] A:00E9 X:0000 Y:0002 P:envMx - Jump to portion in designated table...


And there it is! The Event ID Table, similar to any other pointer table we've found thus far. I'll list them in order, though I probably won't tackle their contents for a while.


EB94 - Toggle Screen Shake D0
EB9D - Screen Flash D1
EBD4 - Screen blur and unblur D2
EBEF - Travel to/from Moon D3
E351 - Open Fat Chocobo Screen D4
EC17 - Open a Door D5
EB65 - Screen moves up 1 tile and down 1 tile D6
E54B - Toggle Running D7
E38B - Toggle Music Fade D8
E344 - Open Namingway Screen D9 (Judging from the amount of bytes here I imagine this is just a jump to another Jump)
E7C4 - Toggle Screen Fade DA
E90A - Toggle Status Ailments XX DB
E9E6 - Inn DC
E9B6 - Change Character Graphic to XX DD
E7FF - Restore HP (10 * XX HP) DE
E85F - Restore MP (10 * XX MP) DF
E8BF - Add Item XX to Inventory E0
E8CB - Remove Item XX from Inventory E1
E7D8 - Put in Spell List XX' SpellBook, Spell YY E2
E929 - Remove All Status Ailments but XX E3
E948 - Add Status Ailments XX E4
E967 - Add 100 * XX GP to Party E5
E97E - Subtract 100 * XX GP to Party E6
E578 - Add XX Character to Party E7
E6AF - Remove XX Character from Party E8
EAB5 - Pause XX Cycles E9
E379 - Fade Song XX in EA
0000 - Repeat Xx Time the Following YY Actions EB (blank because this is looked at in respect to the Movement Patterns)
E391 - Fight Battle with Enemy Set XX EC
E35E - Bring Up Shop XX ED
E339 - Show Message from Bank 02 (Event Call) EE
EF28 - Show Message from Bank 02 (Map Call) EF
EF4E - Show Message 0XX from Bank 01. F0
EF5F - Show Message 1XX from Bank 01. F1
EF81 - Set Event Flag XX F2
EF8A - Clear Event Flag XX F3
EF93 - Activate NPC XX F4
EF9C - Deactivate NPC XX F5
EF70 - Show Message XX (from Bank 3) F6
EB0E - Bring up Item Selection Window F7
EAE9 - Show Message 1XX (Yes/No Box) F8
E731 - Toggle Screen Tint XX F9
E559 - Play Song XX FA
E56F - Play Sound Effect XX FB
0000 - Load Some Type of Graphic FC (Actually Nothing)
C17C - Play Visual Effect FD
EDB1 - Load Map FE
EA20 - End Event FF

So we now know that "Load Some Type of Graphic?" is literally "Crash the Game". Why they would put it so high up is beyond me. Maybe they had an idea for an event function that just did not pan out as planned... so that alone is a free event slot.

371
Final Fantasy IV Research & Development / Re: 4bpp Graphics Backport
« on: March 16, 2015, 05:41:51 PM »
Now That looks much better! Good work so far!

372
Final Fantasy IV Research & Development / Re: 4bpp Graphics Backport
« on: March 16, 2015, 02:46:43 PM »
Time to report some more progress! I spent a bit of time staring at those DMA routines the game uses to load overworld/location protagonist and location graphics and finally understood how they work (at least enough for my needs). Some simplifications will be necessary - at least with some locations. I need to look at the way the game decides which tileset to load. If it's possible to have more than one town tileset and make different towns load different sets that would be pretty neat! On the other hand it sounds like quite a drag, rewriting the properties and palette associations to this point took a bit of time! I need a break...  :sleep:

P.S. And of course the game has to use different routines for all sprites - world map protagonists, location protagonists, protagonists splitting up for a cutscene (no kidding), townspeople, vehicles...  :bah:

Other than the inky water and the green squares around the bushes, this looks pretty grand Gedankenschild!

373
Well, I decided that Armor Break, while very neat in theory, is mostly useless in Combat Boost because I never really changed enemy's defense ratings (which generally range from 0-5) making it hardly have any effect.

The new effect of Armor Break will do much more, it will reduce an enemy's Evasion down to 00%, meaning that if your weapon can inflict a status it has a much greater chance to inflict that status and the enemy will no longer be able to evade your attacks. I may do some balancing in that regard with bosses though.

374
Final Fantasy IV Research & Development / Re: Japanese Title Screen
« on: March 09, 2015, 09:43:00 PM »
Hmm, so the hex before 438B9 is not even anything to do with the title screen? Do we know What it does then?

375
Final Fantasy IV Research & Development / Re: Japanese Title Screen
« on: March 09, 2015, 12:39:04 AM »
Yes, you can copy the title screen tiles and tile positioning data from one to the other but the animation and translucent routine/data is stored elsewhere.  I have no idea where, and it will look like crap in FF2us until the palette is edited.  If you use my title screen data as a reference you can sort of figure out how it works to modify it.  I'm going out of town today and tomorrow but I should be able to help more when I get back.

There is a large (like massive) amount of empty space right after the title screen at 0438B9 - I theorize that this is likely the routine for the flashing graphics and the like since I know it is never utilized normally in the game because that's where I placed all of my random AI and I have not noticed anything off with the title screen...

then again that could be empty space in all versions, would lead me to question why though.

That empty space is the tile positioning data I believe.

...Not sure what you mean there. Since it's all FF how can it be positioning anything? Also when these bytes are filled the title screen is unchanged. Unless there is something I'm not understanding in what you're saying.