Users browsing this thread: 1 Guest(s)
Patch: Pugs Rage

#6
Posts: 175
Threads: 23
Thanks Received: 22
Thanks Given: 7
Joined: Feb 2016
Reputation: 8
Status
Enlight
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)
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.  Victory

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! Santa
Quote  
[-] The following 1 user says Thank You to SilentEnigma for this post:
  • assassin (12-24-2021)



Messages In This Thread
Patch: Pugs Rage - by SilentEnigma - 12-06-2021, 12:48 AM
RE: Patch: Pugs Rage - by assassin - 12-06-2021, 04:54 AM
RE: Patch: Pugs Rage - by SilentEnigma - 12-06-2021, 03:32 PM
RE: Patch: Pugs Rage - by SilentEnigma - 12-20-2021, 02:53 AM
RE: Patch: Pugs Rage - by assassin - 12-23-2021, 02:04 AM
RE: Patch: Pugs Rage - by SilentEnigma - 12-24-2021, 11:17 AM
RE: Patch: Pugs Rage - by assassin - 12-24-2021, 02:37 PM
RE: Patch: Pugs Rage - by CVReynolds - 12-28-2021, 04:45 PM
RE: Patch: Pugs Rage - by SilentEnigma - 12-31-2021, 05:55 PM
RE: Patch: Pugs Rage - by assassin - 01-02-2022, 03:12 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite