Users browsing this thread: 1 Guest(s)
Final Requests for Help

#11
Posts: 200
Threads: 1
Thanks Received: 10
Thanks Given: 0
Joined: Oct 2015
Reputation: 18
Status
None
it gets trickier in that Y needs to be restored for the $3A01 branch.  so you'll want to use the space created by the NOP'ed STA to turn the PLY into relocated twins.
Quote  

#12
Posts: 614
Threads: 49
Thanks Received: 0
Thanks Given: 4
Joined: Feb 2017
Reputation: 25
Status
None
(04-07-2021, 12:11 AM)Drakkhen Wrote:
Code:
C2/39D8: 5A           PHY
C2/39E4: 7A           PLY
C2/39FA: 99 09 33     STA $3309,Y  (in both slots)

Code:
C2/39D8: EA           NOP
C2/39E4: EA           NOP
C2/39FA: EA EA EA     NOP

These should be the only changes you'd need to make to the original function to work how you want

Drakkhen, you mad genius, that's it. This should honestly be released as a standalone patch. I can't imagine someone not wanting it, even in a mostly vanilla playthrough. Do you want to do that, or do you want me to?

assassin Wrote:it gets trickier in that Y needs to be restored for the $3A01 branch. so you'll want to use the space created by the NOP'ed STA to turn the PLY into relocated twins.
Not sure I understand. In my initial tests, Drakkhen's code seems to be working. It says "couldn't steal" until both items have been stolen, and then displays "doesn't have anything" once they are both gone. I changed the chance between the common and the rare to a 50/50 for testing purposes, and it seemed to work both ways. Is something screwy going on in the background that I'm not seeing?


Also, I have updated the original post with one more "just for fun" thing. Kappa is now unaffected by the imp status, but it would be fun if, when Imp is cast on her, she turns into a human (Sprite 13 - the merchant). I already have code to dummy out changing the character's portrait when they have imp status, so the lack of portrait is not a concern.


Projects:
FFVI: Divergent Paths (Completed) - a complete storyline and gameplay hack of FF6 that adds Leo as a playable character
  Find
Quote  

#13
Posts: 52
Threads: 5
Thanks Received: 24
Thanks Given: 0
Joined: Jun 2010
Reputation: 6
Status
None
(04-07-2021, 10:17 AM)assassin Wrote: it gets trickier in that Y needs to be restored for the $3A01 branch.  so you'll want to use the space created by the NOP'ed STA to turn the PLY into relocated twins.

Ah, yep, missed that.
I believe this should fix it:
Code:
C2/399E: A3 05          LDA $05,s
C2/39A0: AA             TAX 
C2/39A1: A9 01          LDA #$01
C2/39A3: 8D 01 34       STA $3401
C2/39A6: E0 08          CPX #$08
C2/39A8: B0 5F          BCS $3A09
C2/39AA: C2 20          REP #$20
C2/39AC: 5A             PHY 
C2/39AD: B9 08 33       LDA $3308,y
C2/39B0: 1A             INC 
C2/39B1: E2 21          SEP #$21
C2/39B3: F0 4B          BEQ $3A00
C2/39B5: EE 01 34       INC $3401
C2/39B8: BD 18 3B       LDA $3B18,x
C2/39BB: 69 32          ADC #$32
C2/39BD: B0 1A          BCS $39D9
C2/39BF: F9 18 3B       SBC $3B18,y
C2/39C2: 90 3C          BCC $3A00
C2/39C4: 30 13          BMI $39D9
C2/39C6: 85 EE          STA $EE
C2/39C8: BD 45 3C       LDA $3C45,x
C2/39CB: 4A             LSR 
C2/39CC: 90 02          BCC $39D0
C2/39CE: 06 EE          ASL $EE
C2/39D0: A9 64          LDA #$64
C2/39D2: 20 65 4B       JSR $4B65
C2/39D5: C5 EE          CMP $EE
C2/39D7: B0 27          BCS $3A00
C2/39D9: 20 5A 4B       JSR $4B5A
C2/39DC: C9 20          CMP #$20
C2/39DE: 90 01          BCC $39E1
C2/39E0: C8             INY 
C2/39E1: B9 08 33       LDA $3308,y
C2/39E4: EA             NOP 
C2/39E5: C9 FF          CMP #$FF
C2/39E7: F0 17          BEQ $3A00
C2/39E9: 8D 35 2F       STA $2F35
C2/39EC: 9D F4 32       STA $32F4,x
C2/39EF: BD 18 30       LDA $3018,x
C2/39F2: 0C 8C 3A       TSB $3A8C
C2/39F5: A9 FF          LDA #$FF
C2/39F7: 99 08 33       STA $3308,y
C2/39FA: EE 01 34       INC $3401
C2/39FD: 7A             PLY 
C2/39FE: 60             RTS 

C2/39FF: EA             NOP 
C2/3A00: 7A             PLY 
C2/3A01: E2 20          SEP #$20
C2/3A03: A9 00          LDA #$00
C2/3A05: 99 48 3D       STA $3D48,y
C2/3A08: 60             RTS 
Quote:This should honestly be released as a standalone patch. Do you want to do that, or do you want me to?
Have at it
Quote  
[-] The following 1 user says Thank You to Drakkhen for this post:
  • madsiur (04-07-2021)

#14
Posts: 200
Threads: 1
Thanks Received: 10
Thanks Given: 0
Joined: Oct 2015
Reputation: 18
Status
None
PowerPanda: Y needed restoring so that C2/3A01 would write to the proper counterattack variable when reached via C2/39E7.
Quote  

#15
Posts: 614
Threads: 49
Thanks Received: 0
Thanks Given: 4
Joined: Feb 2017
Reputation: 25
Status
None
Okay, I've gotten it working. Drakkhen, your full code was missing line C2/39D8, which had been nopped out in the previous version. I finally figured out that it needed to be restored to 5A in order for the later 7As to work. So the full code changes, in case anyone wants to duplicate it, are as follows:


Code:
;Presented with the original value, and the value to change it to underneath, marked with "->"

C2/39E4:
    7A
-> EA

C2/39E7
    F0 18
-> F0 17

C2/39FA
    99 09 33 EE 01 34 60
-> EE 01 34 7A 60 EA 7A


Projects:
FFVI: Divergent Paths (Completed) - a complete storyline and gameplay hack of FF6 that adds Leo as a playable character
  Find
Quote  

#16
Posts: 200
Threads: 1
Thanks Received: 10
Thanks Given: 0
Joined: Oct 2015
Reputation: 18
Status
None
1) C2/39D8's "PHY" isn't missing; it was deliberately moved to C2/39AC.
2) accordingly, your list of code changes is FAR from full.  nearly half of the function is shifted forward 1 byte!  most changes here are trivial, but nonetheless necessary for anybody who's typing in these bytes by hand (something i cannot recommend, btw).

better to just get xkas or asar, assemble his code, and then use a program like DOS's file compare (Windows command line usage example: "fc/b [file1] [file2] > diffs.txt") to get a full list of changed bytes.  trying to manually track this stuff is a recipe for aggravation and oversights.
Quote  

#17
Posts: 614
Threads: 49
Thanks Received: 0
Thanks Given: 4
Joined: Feb 2017
Reputation: 25
Status
None
(04-07-2021, 08:15 PM)assassin Wrote: 1) C2/39D8's "PHY" isn't missing; it was deliberately moved to C2/39AC.
2) accordingly, your list of code changes is FAR from full.  nearly half of the function is shifted forward 1 byte!  most changes here are trivial, but nonetheless necessary for anybody who's typing in these bytes by hand (something i cannot recommend, btw).

better to just get xkas or asar, assemble his code, and then use a program like DOS's file compare (Windows command line usage example: "fc/b [file1] [file2] > diffs.txt") to get a full list of changed bytes.  trying to manually track this stuff is a recipe for aggravation and oversights.


I tried several things, including xkas. Is there a reason that the PHY was moved to C2/39AC? I kept it in its place, and it *seems* to be working. I hand-entered my full list of changes into a clean untouched rom, tested it out, and I'm not noticing anything off.

EDIT: Looks like I did miss that 5A at C2/39AC. My xkas file also had an error in it, and didn't compile correctly, so it reverted to my hand-entered version without me noticing. Sorry about that. That being said, my 10-byte version IS working, so if there is no real difference between the two, I'll release the smaller of the two. Note that all of my branches EXCEPT for the one at $39E7 skip over the 7A at $3A00 and just go straight to the original code at $3A01.


Projects:
FFVI: Divergent Paths (Completed) - a complete storyline and gameplay hack of FF6 that adds Leo as a playable character
  Find
Quote  
[-] The following 1 user says Thank You to PowerPanda for this post:
  • assassin (04-07-2021)

#18
Posts: 200
Threads: 1
Thanks Received: 10
Thanks Given: 0
Joined: Oct 2015
Reputation: 18
Status
None
the reason for the changes:

PowerPanda Wrote:Not sure I understand. In my initial tests, Drakkhen's code seems to be working. It says "couldn't steal" until both items have been stolen, and then displays "doesn't have anything" once they are both gone. I changed the chance between the common and the rare to a 50/50 for testing purposes, and it seemed to work both ways. Is something screwy going on in the background that I'm not seeing?

(04-07-2021, 01:36 PM)assassin Wrote: PowerPanda: Y needed restoring so that C2/3A01 would write to the proper counterattack variable when reached via C2/39E7.

to solve this and still have stack balance, PHY needed (edit: apparently) to be moved up.

Quote:My xkas file also had an error in it, and didn't compile correctly

better to familiarize yourself with an assembler, than trying to pare down very functional code just to accommodate briefer hand-typing of instructions.

EDIT: it's possible your latest iteration works.  i thought it didn't at first, but am giving it a 3rd look.
EDIT 2: haha; i think it does.  i initially thought you wanted to eschew the fix and/or the requisite stack balance, but looks like you're retaining the former while accomplishing fewer edits for the latter.  kudos!  i stand by my comments on the worth of using assemblers, though. Tongue  practice at it!  it'll get easy, and prevent all sorts of busywork or outright errors.
Quote  

#19
Posts: 614
Threads: 49
Thanks Received: 0
Thanks Given: 4
Joined: Feb 2017
Reputation: 25
Status
None
Yes, I saw the obvious benefits of the assembler during my Genji Glove hack, but with my main patch at 95%+ completion, I've made the intentional decision to just keep doing what I've been doing, even though I know it's the harder way, rather than switch to a new process right at the end. I mean, I have one or two more C2 edits to do at this point (see first post), and the rest is animation and event code, which doesn't gain much benefit from assembly. But you don't have to win me over on assembly. if I do another hack after this one, I'm doing that from the start.


Projects:
FFVI: Divergent Paths (Completed) - a complete storyline and gameplay hack of FF6 that adds Leo as a playable character
  Find
Quote  

#20
Posts: 377
Threads: 34
Thanks Received: 10
Thanks Given: 7
Joined: Dec 2018
Reputation: 18
Status
Moog
You asked in the shout-box about the Airborne Imp bug. This will not only concern Palidor, but also your Celes if she gets imped after she's queued a jump but before she's leapt into the air. That's how I discovered the bug, actually, with a dedicated jumper and with a jumping Imped enemy.

Code:
====================================
Airborne Imp fix
====================================
C2/02a0:
    4C FD FB            JMP FreespaceC2  ***Can be reolcated

C2/FBF2:   ***Tied to space that follows, could be FBFA if %%% branch back is changed
    4C DA 02            JMP ExitCommandBlock            ; If airborne, skip the command blocking check so the imp can come down.
    
C2/FBFD:  ***Freespace, but tied to space that precedes.  Change %%% branch back if squished together.
    C2 20                REP #$20
    BD 18 30            LDA $3018,X
    2C 2C 3F            BIT $3F2C                          ; Are they in the middle of a Jump?
    E2 20                SEP #$20
    D0 E9                BRA Back to C2/FBF2  %%%% To move the first JMP to FBFA, make this D0 F1
    BD E4 3E            LDA $3EE4,X
    4C A3 02            JMP $02A3                        ; Continue with Imp check for command blocking.
This isn't optimized because as I was experimenting with it I found I needed less code on the exit than I thought. As such, there will be a few empty bytes between the FBF2 part and the FBFD part. If you smash the two together you can save 8 bytes, but the backwards branch needs to be subsequently reduced by 8 bytes (to D0 F1).

Uses 21 bytes in C2. You can put it in another bank's freespace if you instead make a long jump (JML) from 02A0, but that command uses four bytes instead of three and thus doesn't fit in the existing space. You would have to recreate some of the surrounding code that you displace with the JML.

Imps will still be able to jump when forced (as in, they have a jump queued or Palidor intercedes), but they will come back down from those jumps instead of replacing the 'land' action with a fight command.
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite