øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;u=25;area=showposts;start=210e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index8ffe-2.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;area=showposts;u=25e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index8ffe-2.html.zxD›h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ0Pdñ'OKtext/htmlISO-8859-1gzip@øÕñ'ÿÿÿÿÿÿÿÿWed, 11 Mar 2020 08:19:41 GMT0ó°° ®0®P®€§²ð®C›h^ÿÿÿÿÿÿÿÿ(6ñ' Show Posts - assassin

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 - assassin

211
Final Fantasy V Research & Development / Re: FFV Damage Calculator
« on: May 11, 2016, 04:05:17 AM »
^ yes, and also in Function C2/8A05.  but the bonus is only for certain types of attacks, as most won't recalculate damage after the M doubling.  and in both functions, the 2x damage is skipped for some M values, more grievously so in C2/8A05; i'm convinced that both skippings are bugs.

this was discussed previously:
http://slickproductions.org/forum/index.php?topic=1980.msg22024#msg22024
http://slickproductions.org/forum/index.php?topic=1975.msg22021;topicseen#msg22021
http://slickproductions.org/forum/index.php?topic=1975.msg21644;topicseen#msg21644

i recently put all of that into a (nearly) fully-fledged description, and corrected a wrong boolean (i got confused):
http://assassin17.brinkster.net/forum-posts/ff5-m-doubling-cant-evade-flooring-bug-desc1-excerpt.txt

the referenced "this patch" doesn't exist yet, mainly because i still don't know what Variable $63 does, and want a complete description before releasing anything.  however, i have little doubt they're bugs (with each being an inverse problem of the other), and fixing the nastier one just involves editing a single byte (branch length).

212
Game Modification Station / Re: WIP Patch: Permanent Morph bugfix
« on: May 11, 2016, 02:55:25 AM »
Quote
When I said three bytes, I was thinking that we could let C2/0B01 handle the check, but that only checks "if someone is morphed", not "is current target morphed" and we don't want casting Haste/Slow on someone ELSE to change the speed on Terra's Morph bar.

This is a somewhat risky suggestion what with all the hack authors out there, but couldn't we change the LDA $3EE2/BPL in C2/0B01 to CPX $3EE2/BEQ? In vanilla, there should only exist one Morpher (Terra) at a time (not considering craziness like the Rippler bug, but setting Morph via Rippler doesn't initialize their timer, so it doesn't set $3EE2 either).

looks like you talked yourself out of it..  but to chime in, i don't favor sacrificing capability just to save a few bytes.

tangent: setting Morph via a fictional yet somehow-more-conventional-than-Rippler way of a hacked Fire spell does seem to initialize the timer.  this is another reason why i don't favor dropping the 2048 decrementor capping.  Square has in place an elegant system via C2/083F that can get Morph up and running if any turn * sets the status, not merely one command.  however, to have this flexibility while avoiding nonsensical decrementors, you can't lean solely on the Morph menu code's $1CF6 check; the C2/0B01 capping needs to be there.

* not Rippler, which only affects Morph due to a bug.  it's a bit of a special case, likely foiled because some other entity already had Morph going into the Lore.

this isn't the only reason why i want to keep the cap; my last few posts mentioned another.  but it is a case of what happens when free space concerns trump all else, imho.  yes, you can't anticipate and cater to every hypothetical hack out there when coding a patch.  but simply *maintaining* capability present in the original game isn't so much catering to them, as simply playing it safe.  when did free space become THAT scarce?

is it a point of pride, having a "no free space needed!" tag on one's patch?  keep in mind that optimization =/= omission.  many of the people nerdy enough to care about a patch's consumption in the first place will see willy nilly lopping off of Square code for what it is, rather than be impressed.  now, i'm not actually saying the drops are done to impress people..  rather, i think there's a tendency to see Square's byte count usage as a watermark of sorts, that we should stay below.  but given lots of their code is Swiss cheese, why?!  isn't it natural that making things work right without tossing existing functionality might require more space?  some patches lend themselves to optimizing (not omitting) around this, while others not as much.

--------

regarding the mapping of the evil bytes: nice!

Code: [Select]
2: ogre nix can't break
but it does more than this, as seen at C2/1158.  these damned bits doing more than one thing, with only one of the uses being apparent to me, is why i often hesitate to name them at all.  i'm not actually saying my way is better, since there's help in getting *something* down on paper.  but should incomplete descriptions like this get a ", and ???" appended, just to convey they're still in-progress?

anyway, this documentation hopefully brings us closer to fixing the "Infinite turns w/ Quick and X-Magic" bug.  it seems like it should be fairly simple once a few bits are (were?) deciphered, but lack of clarity on these bits has kept me (and others) from acting.

213
Game Modification Station / Re: WIP Patch: Permanent Morph bugfix
« on: May 11, 2016, 01:32:35 AM »
a possible loophole is if the Morph timer gets reduced to something like FFFFh (and then 00FFh) when a Revert-prohibiting status is in effect, and you have a VERY small Morph decrementor (e.g. 16d).  once the status is gone, Revert won't necessarily be queued right after, as the next few calls to C2/1211 won't zero Morph's timer.  should the battle end quickly, you're now hoping that the end-of-battle code calls C2/0B36.  i don't like relying on it for this, especially given there are multiple ways for a battle to end, and thus multiple holes to plug for patchmakers.

I'm not 100% sure I understand what you're trying to explain, so bear with me... when you say "something like FFFFh", you mean if the subtraction is performed when $3F32 > $3F30, correct? As in, the last tick of the timer?
So if I understand you correctly, this is caused by not zeroing $3F30 in C2/1211? The smallest natural decrementor is 8 (Max supply, after Phunbaba, with Slow), so if $3F30 was exactly FFh, there can be a delay of up to 32 frames to run down the timer again and re-queue Revert, during which the battle could end, thus preventing Revert for about half a second. Correct?

in order:

yes, yes.
yes.
close; i think 64 frames with Slow, because C2/111B exits every other frame.

Quote
With the Stop/Quick/Freeze check in effect, those statuses will prevent C2/1211 from running the few remaining ticks of the timer down and re-queueing Revert until they end, while Sleep will let it keep running down over and over again and try to re-queue Revert every 32 (at most) frames, until the battle ends. If I'm not mistaken.

i thought Freeze was in the same category as Sleep, not Stop/Quick.  it's not a time-freeze; for instance, periodic damage/healing still work under it.  just carving out an exception for Morph -- if that's what you're indeed driving at -- seems a bit inconsistent.


Quote
As you say, this could also happen if the battle ends while Terra is Sleeping, or if Stopped/Frozen (and her timer ran out during their animation), or if her timer ran out while someone cast Quick, and then finished the battle while Quicked.

In the case of Stop/Freeze/Quick being in effect through battle end, since we pause C2/1211 for those statuses, we're always relying on battle ending code to correctly update the supply. In any case, since we're stopping the timer for battle end, we should make sure all battle endings update the supply as well.

but as i also said, my loophole "example is more obnoxious" than some of those, "given the Morph timer initially expired _during_ battle".

however, no disagreement that fixing battle ending scenarios is important.  it's just that when we lean on them for what's actually a mid-battle (albeit almost end-battle) change, we're putting more of our eggs in one basket.

Quote
a well-timed Haste or Slow casting might mitigate the problem of the "a possible loophole ..." scenario laid out in my May 5th post.  the now-recalculated, post-timer-expiration Morph decrementor will be rather large, so that will minimize the wait for a follow-up Revert to be queued.  (a wait that should really be infinitesimal or nonexistent, so this is an improvement, however weird).
---
oops, think i got that wrong, by assuming that a very low Morph supply would simply give a very large decrementor.  but the supply in that example is 0, and there are problems calling C2/0B01 with that:
- you edited out the decrementor capping at 2048.
- even with capping, the earlier "JSR $4792" will perform a divide by 0, and return nonsense.

so it's better called "an ill-timed Haste or Slow casting". :/

thus, i recommend adding back the capping check, and adding a "BEQ $0B2C" before the "JSR $4792", so a minimum supply gives a maximum decrementor.

while it might be tempting to drop the "JSR $0B36" to avoid this particular issue, my May 05, 2016, 10:18:44 PM CDT (May 06, 2016, 03:18:44 AM GMT) post -- and numerous others -- explains why doing that is nonsense and risky.

Sorry to open the debate on this again, but this just has me MORE convinced that updating the supply the very instant the timer runs out is the risky option. I seems safer to update the supply only once we've cleared $3EE2, thus stopping the calls to C2/1211 AND C2/0B01.

correct me if i'm wrong..  this risk presents once you do the following:

1) stop clearing $3EE2, in an effort to fix the bug.  noting that it's not the only way to fix it; relaxing C2/4BB2 could also work.

AND

2) give Function C2/0B01 a responsibility not held in the original game: handling Haste/Slow toggling.  noting that it's not the only option; Haste/Slow could instead use a modified decrementor on-the-fly in C2/1211.

AND

3) despite C2/0B01 having MORE responsibility in the patch, making it LESS robust by dropping the 2048 decrementor cap.  simply because you want to save space.

am i wrong on any of those three?

it seems to me that there's nothing inherently risky about C2/0B36 calls, until you choose to modify the game in a very specific way -- with one of those changes being driven not by any logical flaw in the vanilla code, but purely by space savings.

Quote
I just think it makes sense to only update supply after Morph definitely has ended, as marked by Revert executing, or the battle ending. In other words, dropping the "JSR $0B36" in C2/1211 in favour of a "STZ $3F30".

i still lean towards thinking you're nuts. :P

but a devil's advocate argument to fuck with myself:
if the Morph timer counts down from 65535 to 500, we don't update the Morph supply.  yet when it goes from 500 to 0, updating Morph supply is now vital?  while 0 is indeed a special case, is it special enough to say that a change of 500 outweighs a change of 65035?


Quote
Quote
i think an empty gauge would show up in end battle even if the latter is no longer called, but should really test it.

I'm not exactly sure if by "empty gauge" you mean "no decreasing green gauge" or a literally empty gauge (no increasing white ATB gauge either). If it's the former, clearing $3EE2 at battle end (thus stopping the calls to C2/1211) does indeed clear the green bar and restores the white ATB bar.

cool.. i wasn't sure exactly what i meant, just that the zeroing of the Morph gauge variable should show up in some way.

214
Game Modification Station / Re: WIP Patch: Permanent Morph bugfix
« on: May 10, 2016, 03:30:03 PM »
the second old post of mine i'm correcting today:

Quote
they zero the Morph gauge(s) right after that first update, suggesting they want an empty one displayed.  but because the Morph timer decrement function (C2/1211) is still called, the gauge gets re-synchronized with the Morph timer.  it would make sense to stop calling this function after the battle is won -- yet the ironic thing is, the empty gauge would never show up then, because the game doesn't bother to call C2/5C54 outside of the first function (and battle start-up).

C2/5C54 is actually called from C2/111B, not C2/1211.  so i think an empty gauge would show up in end battle even if the latter is no longer called, but should really test it.

215
Game Modification Station / Re: WIP Patch: Permanent Morph bugfix
« on: May 10, 2016, 02:36:06 PM »
That's really neat! Just one question, why do you mention $E8-EA? Those don't seem to have anything to do with this method, or am I missing something?

just to picture something holding the 24-bit value that you're subtracting the 8-bit value from.

Quote
VERY nice. With this method, update_decrementor fits inline in C2/0B01. Now, if we can find a way to reduce C2/09D2 by three bytes to fit our call, this patch can be completely inline. Thanks! :)

you're welcome.  but it's gotta be more than 3 bytes to fit both the $3EE2 test and the call, no?  that said, i'm not sure why you have "PHA / PLA" surrounding the call to init_morph.

216
Game Modification Station / Re: WIP Patch: Permanent Morph bugfix
« on: May 10, 2016, 02:09:18 PM »
a well-timed Haste or Slow casting might mitigate the problem of the "a possible loophole ..." scenario laid out in my May 5th post.  the now-recalculated, post-timer-expiration Morph decrementor will be rather large, so that will minimize the wait for a follow-up Revert to be queued.  (a wait that should really be infinitesimal or nonexistent, so this is an improvement, however weird).

oops, think i got that wrong, by assuming that a very low Morph supply would simply give a very large decrementor.  but the supply in that example is 0, and there are problems calling C2/0B01 with that:
- you edited out the decrementor capping at 2048.
- even with capping, the earlier "JSR $4792" will perform a divide by 0, and return nonsense.

so it's better called "an ill-timed Haste or Slow casting". :/

thus, i recommend adding back the capping check, and adding a "BEQ $0B2C" before the "JSR $4792", so a minimum supply gives a maximum decrementor.

while it might be tempting to drop the "JSR $0B36" to avoid this particular issue, my May 05, 2016, 10:18:44 PM CDT (May 06, 2016, 03:18:44 AM GMT) post -- and numerous others -- explains why doing that is nonsense and risky.

217
Game Modification Station / Re: WIP Patch: Permanent Morph bugfix
« on: May 10, 2016, 03:16:07 AM »
re valid assembler: definitely yes on the first one, likely yes on the second (but maybe try "JSL"), leaning no on the third (but i've never tried using a relative operand like that before, so maybe your way will work).

the joke was a bit lost on me.  though you did have me thinking, "why is he going through all this trouble to avoid growing C2/0B01 when he's consuming all this free space in the process?  doesn't he know he can JSR?  he seemed smarter in his earlier posts."  you exploited the leeway that comes with being a new patch maker. ;P  but this now means i'll judge you like a veteran from here forward.

glad you came up with something better.

C2/47B7 actually leaves with 16-bit $E9 in A, so you can drop the "LDA $E9".

and it just dawned on me that (65535 * num) is a special case that equals (65536 * num) - num.  so just put num in $EA, pretend $E9 and $E8 are 0, and do an imaginary subtraction of num from that 24-bit value.  you'll always need borrows out of the top 2 bytes, so we can have:

Code: [Select]
LDA $3ADD,X
dec
; sta $ea    (for clarity, don't actually need to save this)
xba
lda #$ff
; sta $e9   (for clarity, don't actually need to save this)
rep #$20

or 1 byte smaller:

Code: [Select]
tdc
LDA $3ADD,X
xba
rep #$20
dec

obviously, these have no flexibility whatsoever if you ever want to change 65535 to another value.  but they are very fast.

218
Game Modification Station / Re: WIP Patch: Permanent Morph bugfix
« on: May 09, 2016, 01:13:50 AM »
Quote
On a side note, does xkas support calling or branching to straight addresses instead of labels? I keep declaring my labels using "org $address" and then put nothing but my label in there, just so I can jump or branch to that address. If I'm just making a call and not inserting code, can't I just type in the address? I can never get that to work but maybe I'm doing it wrong. :/

afaik, absolute calls and jumps can simply have the address.  but relative ones (e.g. BRA) will expect a label.  this is from using xkas v0.06.

---------

Code: [Select]
;To use this, we need to modify init_morph to set 16-bit A both in set_morpher
;and update_decrementor, but there's no room for an extra "REP #$20" without
;relocating parts of that function.


;The silly way
           
;BRA end        ;(ignore this; used for testing the above)
REP #$20        ;We need to set 16-bit A so update_decrementor works,
                ;but init_morph loads $3EE2, expecting it to be 8-bit
                ;What do...?
SEP #$10
LDY $3EE3       ;(Commandeer Y to preserve $3EE3 briefly)
TDC
STA $3EE2       ;We only care about the n flag being clear, so zero $3EE3
JSR init_morph  ;Now init_morph won't reset the Morph timer
STY $3EE3       ;Restore $3EE3
end:
!plpyxa
RTS

ugghhh to this excerpt. :P  a few things:

- why the "SEP #$10" if X/Y are already 8-bit in the calling function?

Code: [Select]
TDC
STA $3EE2       ;We only care about the n flag being clear, so zero $3EE3

so which address are you trying to zero?  if i'm reading your goal right, skip the TDC, and just do a "STZ $3EE3" before the "REP #$20".

Code: [Select]
;(New code, 2 bytes added)
BMI set_morpher ;If no one is morphed, set morpher, init timer, and set decrementor
;(Modified code)
BRA set_decrementor ;If somone is, only update decrementor
;(End of new and modified code)

what is going to be in the "(Modified code)" area?  if there's nothing, then change those two branches into a "BPL set_decrementor".  we will find a way to be rid of this $3EE3 silliness, eventually.

----------

as far as gaining back a little of the precision lost from the move from 65535 to 255, you could: put the ATB multiplier in $E8, use C2/47B7 (16-bit * 8- bit multiplier) to multiply it by 511, then load 16-bit $E8 (as you know the result fits in it), and have an extra LSR.  slight, but it's something.  might take more extra space, but so what?

or go all-out and multiply 65535 by ATB multiplier, then employ 24-bit / 8-bit division, using the Step Mine special effect an as example.  the extra space is a little bothersome, but maybe worth it.  any speed loss is *certainly* fine in my book, given you're not doing this calculation from oft-called C2/1211 anymore.

219
Game Modification Station / Re: WIP Patch: Permanent Morph bugfix
« on: May 08, 2016, 01:20:37 AM »
you're right.  i got myself confused somehow.  maybe i thought you'd be using the current Morph timer, rather than always 255, on later calls to C2/0B01.

i'm not sure how you're reworking a function that normally exits whenever there's a Morpher in $3EE2.  best post your code.

a well-timed Haste or Slow casting might mitigate the problem of the "a possible loophole ..." scenario laid out in my May 5th post.  the now-recalculated, post-timer-expiration Morph decrementor will be rather large, so that will minimize the wait for a follow-up Revert to be queued.  (a wait that should really be infinitesimal or nonexistent, so this is an improvement, however weird).

i appreciate you trying to not waste cycles with constant calculations, and recognize your striving for parallelism with the ATB multiplier, but that variable only gets its value from one source.  the hypothetically-reworked Morph decrementor gets its value from TWO separate sources, so maybe it's best to keep a backup of the thing and modify a copy like you were doing, since those sources can change independently of each other.

again, i can be more useful if you post your code.

220
Game Modification Station / Re: WIP Patch: Permanent Morph bugfix
« on: May 07, 2016, 11:30:52 PM »
i hope you meant C2/0B01 and not C2/01B1.

and i see a problem with calling that if Hasted or Slowed mid-Morph: it'll calculate the decrementor based off the old Morph Supply.  why not stick with your old May 5th code of keeping the decrementor, and modifying a copy as needed in C2/1211?

221
Game Modification Station / Re: WIP Patch: Permanent Morph bugfix
« on: May 07, 2016, 07:45:57 PM »
i don't think you want to do it until you actually know Gau is Leaping or re-joining, which is why i recommended in C2/48E0.  do it too early, and it might be called twice.

222
Game Modification Station / Re: WIP Patch: Permanent Morph bugfix
« on: May 07, 2016, 01:51:28 AM »
1) try the "For What Ails Ya" patch from this website.  it fixes that sort of bug, though I don't recall offhand whether Leap was accounted for.

EDIT: nope, it doesn't directly address end-of-battle code.

not sure why your C2/4903 call wouldn't work.  where in C2/47FB are you putting it?  try in C2/48E0.  you'll want to do it before C2/4936 is called, because that's what copies the in-battle Item menu to the more persistent Item list.[/EDIT]

2) ah, i knew it!  my subconscious must have remembered LightPhoenix's expansion.

223
Game Modification Station / Re: Leet Sketcher's Anniversary Pack
« on: May 06, 2016, 01:34:16 AM »
ah, thanks.  yes, i was.  i stupidly didn't have a script in front of me when posting that.  btw, bover_87's Monster Scripts FAQ has Phunbaba #3's counterattack script way wrong, apparently a paste of #4.  i could totally blame that, but i wasn't even looking at it at the time. :P

another minor anchor tag move: Better Dice's, into the "Setzer's Dice weapons..." table cell.  that should be the only other one, unless you care about all your screenshots being slightly scrolled off when reached via anchor links.

224
Game Modification Station / Re: Leet Sketcher's Anniversary Pack
« on: May 06, 2016, 12:51:15 AM »
congrats on an eventful year!

minor website corrections:
- 'Uploaded "Bye Bye Breath" patch v1.0.' is listed twice.  change the second.
- there is no "stone_faced" anchor tag, so clicking that rename update does nothing.
- clicking "Leet Sketcher's Anniversary Pack"! scrolls you down slightly too far.  consider moving the anchor tag into the top of the "In honor of..." table cell instead.  Novalia Spirit made the same mistake on his website. :P
- change my website link to: http://assassin17.brinkster.net/

as for Phunbaba, i think having a very strong X-Fighter attack him at 15361+ HP (of 26000 total) can also accomplish the first bug.  i was aware of it as a Blow Fish -learning loophole, but didn't think about it being another path to a full party.

225
Game Modification Station / Re: WIP Patch: Permanent Morph bugfix
« on: May 06, 2016, 12:00:29 AM »
guess i didn't follow your post, and thought you were suggesting that the pointers to automatically-called commands could also be re-used.

regarding just the RTS pointers: how much can be done with 10 bytes, particularly when only 6 are contiguous?  can you elaborate on how they might be leveraged?