Users browsing this thread: 1 Guest(s)
Patch: Pugs Rage
12-24-2021, 11:17 AM
(This post was last modified: 12-24-2021, 01:16 PM by SilentEnigma.)
Great stuff, @assassin.
Now, assuming I've done my job right with modding C2/5841 - C2/585F (building the compressed list @ $257E), your example list should not be possible. The only duplicates should be the padding at the end. (Just like you should never actually see FFh in the middle of the compressed list in vanilla. Am I missing something?)
To help my case, I believe the battle rage list was originally not going to be compressed. Then the strange loop would have been necessary:
(note the slightly tweaked C2/05F2)
This resembles the loop C2/053C - C2/0549 for locating a randomly selected Magic/Lore spell from an uncompressed list.
With this in mind, I do not take the rage loop itself as any evidence that it is possible to have a compressed rage list with nulls in the middle.
If I am mistaken, then I would definitely want to restore the correct game behavior via some similar list-crawling as you suggested. (But I think we're good, so... onward!)
You raise a great point with the rage count, and that is a beautiful revamp for C2/A691 -- Since every list item of index 0 through ($3A9A) - 1 is going to be a valid rage ID, then why get fancy with duplicate IDs? Just as well to compare the list index to ($3A9A) - 1 and call it a day. Excellent.
We still need the "SEP #$10" at the beginning, but besides that it's testing great so far. We only get 3 bytes out of C2/A691, but then C2/A6AB can be eliminated entirely.
In total, it is going to save about 24 bytes.
If all checks out, I'll generate another set of patches to incorporate your optimization.
Thanks!
By the way, C2/585F in the "AZ" variants of this patch has a benign bug...
Merry Christmas!
Now, assuming I've done my job right with modding C2/5841 - C2/585F (building the compressed list @ $257E), your example list should not be possible. The only duplicates should be the padding at the end. (Just like you should never actually see FFh in the middle of the compressed list in vanilla. Am I missing something?)
To help my case, I believe the battle rage list was originally not going to be compressed. Then the strange loop would have been necessary:
(note the slightly tweaked C2/05F2)
Code:
Hypothetical Early Build:
C2/05ED: BD 7E 25 LDA $257E,X (Rage menu. was filled in C2/580C routine.)
C2/05F0: C9 FF CMP #$FF
C2/05F2: F0 04 BEQ $05F8 (branch if that menu slot was null [BEQ $0600 in FF3us 1.0])
C2/05F4: C6 EE DEC $EE (decrement our random index)
C2/05F6: F0 05 BEQ $05FD (if it's zero, branch, and use the menu item last read)
C2/05F8: E8 INX
C2/05F9: D0 F2 BNE $05ED (loop again to check next menu entry)
C2/05FB: 80 03 BRA $0600 (if we've looped a full 256 times and somehow there's
been no match with the random index, branch and just
use enemy #0)
This resembles the loop C2/053C - C2/0549 for locating a randomly selected Magic/Lore spell from an uncompressed list.
With this in mind, I do not take the rage loop itself as any evidence that it is possible to have a compressed rage list with nulls in the middle.
If I am mistaken, then I would definitely want to restore the correct game behavior via some similar list-crawling as you suggested. (But I think we're good, so... onward!)
You raise a great point with the rage count, and that is a beautiful revamp for C2/A691 -- Since every list item of index 0 through ($3A9A) - 1 is going to be a valid rage ID, then why get fancy with duplicate IDs? Just as well to compare the list index to ($3A9A) - 1 and call it a day. Excellent.
We still need the "SEP #$10" at the beginning, but besides that it's testing great so far. We only get 3 bytes out of C2/A691, but then C2/A6AB can be eliminated entirely.
In total, it is going to save about 24 bytes.
If all checks out, I'll generate another set of patches to incorporate your optimization.
Thanks!
By the way, C2/585F in the "AZ" variants of this patch has a benign bug...
Code:
Pugs Rage v1.1:
C2/585F: D0 E3 BNE $5844 ; noted as BNE $5846 in the readme
Should be:
C2/585F: D0 E5 BNE $5846
Merry Christmas!
« Next Oldest | Next Newest »
|
||||
Users browsing this thread: 1 Guest(s)