11
Final Fantasy V Research & Development / Re: Enemy Group size/spell animation issues
« Last post by Shinryuu on April 18, 2018, 01:55:35 PM »Oh, sorry my bad, lol. I'll try to find some free space in the rom then. Thanks again.
We have EVEN MORE themes now, but some old ones are gone...Basically, it pauses code execution where you currently are, jumps to a different spot, executes there until it hits a "return" (RTL in this case) and then unpauses.
It happens roughly like so.Code: [Select]$C1/6BDE 22 34 12 D8 JSL $D8/1234
$D8/1234 <do some stuff here>
...
$D8/12FF 6B RTL //returns to where you stopped
$C1/6BE2 <continue here like normal>
There is also a "small" counterpart JSR that functions the same but can't leave the current bank.
The target area of JSL doesn't have to be in the ROM, you can also move to the RAM and execute that (for your own sanity, don't), which is basically like a regular language's eval.
Now here's the thing that separates JSL from a regular function call: you do not have to move to the start of a function, you can go wherever you want.
Start of a "function", middle of it or heck execute a data table if you want, asm doesn't stop you, only the crashes will.
P.S. I wonder what cause the crashes ... is it software bug, is it some 'hidden' limitation of the GPU. Will the game crash if we use contemporary powerful PC? What about a different emulator?Without even looking at it, I'm fairly confident that the OAM data overflowed into whatever else (maybe the stack), which caused the crash. This is probably why FF6's engine only used 6 slots for monsters, and probably why it had two separate routines for displaying damage with different numbers of targets hit at once. Although, I haven't really looked at FF5 enough to know if it has something similar or not.
$C1/6BDE 22 34 12 D8 JSL $D8/1234
$D8/1234 <do some stuff here>
...
$D8/12FF 6B RTL //returns to where you stopped
$C1/6BE2 <continue here like normal>