Users browsing this thread: 1 Guest(s)
Hold B to Walk

#1
Posts: 156
Threads: 25
Thanks Received: 41
Thanks Given: 48
Joined: Feb 2017
Reputation: 13
Status
None
This is a small one, but I wanted to post it. I love the idea of MasterZED's "Hold B to Run" patch, but the amount of time that I spend running vs the amount of time I spend walking made me want to only hold a button if I intended to move slowly. I took a look at his code, and realized if I swapped $C0/432F with $C0/4E33, it would have the desired effect.

Code:
ORIGINAL (Hold B to Run)
$C0/4E21 AD 19 42    LDA $4219   ;Load 2nd byte for controller 1
$C0/4E24 29 80       AND #$80    ;AND for B button only
$C0/4E26 D0 07       BNE $4E2F   ;Branch if button pressed/held
$C0/4E28 AD DF 11    LDA $11DF   ;Load offset with Sprint Shoes bit
$C0/4E2B 29 20       AND #$20    ;AND for Sprint Shoes bit only
$C0/4E2D F0 04       BEQ $4E33   ;If no Sprint Shoes, branch
$C0/4E2F A9 03       LDA #$03    ;Load sprinting walking speed...
$C0/4E31 80 02       BRA $4E35   ;and branch
$C0/4E33 A9 02       LDA #$02    ;Load normal walking speed
$C0/4E35 99 75 08    STA $0875,y ;Store walking speed

MODIFIED
$C0/4E21 AD 19 42    LDA $4219   ;Load 2nd byte for controller 1
$C0/4E24 29 80       AND #$80    ;AND for B button only
$C0/4E26 D0 07       BNE $4E2F   ;Branch if button pressed/held
$C0/4E28 AD DF 11    LDA $11DF   ;Load offset with Sprint Shoes bit
$C0/4E2B 29 20       AND #$20    ;AND for Sprint Shoes bit only
$C0/4E2D F0 04       BEQ $4E33   ;If no Sprint Shoes, branch
$C0/4E2F A9 02       LDA #$02    ;Load normal walking speed...
$C0/4E31 80 02       BRA $4E35   ;and branch
$C0/4E33 A9 03       LDA #$03    ;Load sprinting walking speed
$C0/4E35 99 75 08    STA $0875,y ;Store walking speed

I'm sure there's a way to modify his other two patches also; the ones that stack with Sprint Shoes, but since I am removing Sprint Shoes from the game, I have not tested them out.


Projects:
Divergent Paths (Completed) - a redo of the 3 scenarios in the original game that gives equal time to each group. Meant to be a basis for future mods.
FFVI: Definitive Edition (In Progress) - a hack built off of Divergent Paths that changes the events in Thamasa to bring closure to Banon's story and allow Leo to permanently join your party.
  Find
Quote  
[-] The following 2 users say Thank You to PowerPanda for this post:
  • Poco Loco (07-16-2018), Simulacrum (10-26-2017)

#2
Posts: 153
Threads: 10
Thanks Received: 59
Thanks Given: 15
Joined: May 2013
Reputation: 13
Status
Well-Fed
If you want to save a few CPU cycles, you can actually modify it a little bit further:

Code:
MODIFIED
$C0/4E21 AD 19 42    LDA $4219   ;Load 2nd byte for controller 1
$C0/4E24 29 80       AND #$80    ;AND for B button only
$C0/4E26 D0 0B       BNE $4E33   ;Branch if button pressed/held
$C0/4E28 A9 03       LDA #$03    ;Load sprinting walking speed
$C0/4E2A 80 08       BRA $4E35   ;and branch
$C0/4E2C EA          NOP            ; Not technically necessary, since
$C0/4E2D EA EA       NOP : NOP      ; this code would never be reached, but
$C0/4E2F EA EA       NOP : NOP      ; visually cleaner than leaving it in.
$C0/4E31 EA EA       NOP : NOP
$C0/4E33 A9 03       LDA #$02    ;Load normal walking speed
$C0/4E35 99 75 08    STA $0875,y ;Store walking speed

This removes the check for the Sprint Shoes bit, since you're not using them anyway; hilariously, if you WERE using the Sprint Shoes, the change you made would cause them to have the same effect as pressing B -- your character would walk slowly.


Current Project: FF6: Tensei | Discord ID: TristanGrayse
  Find
Quote  
[-] The following 3 users say Thank You to GrayShadows for this post:
  • PowerPanda (10-24-2017), Robo Jesus (12-24-2017), Simulacrum (10-26-2017)

#3
Posts: 156
Threads: 25
Thanks Received: 41
Thanks Given: 48
Joined: Feb 2017
Reputation: 13
Status
None
Wow, I know a whole lot more about ASM than I did 8 months ago.  Gray Shadows, there is something off in your code. The player has to press B once in order for the run speed to take effect. I think the problem is a miscounted byte. 4E2B should be $09, not $08.

(EDIT, July 7th, 2018: There were 2 error. 4E2B should have been 09, and 4E2D should have been 03)

Either way, I re-wrote the whole thing and cleaned it up. It's tested and working. (EDIT: after cleanup, it ended up the same as yours)
Code:
MODIFIED 
$C0/4E21 AD 19 42    LDA $4219   ;Load 2nd byte for controller 1
$C0/4E24 29 80       AND #$80    ;AND for B button only
$C0/4E26 D0 0B       BNE $4E2C   ;Branch if button pressed/held
$C0/4E28 A9 03       LDA #$03    ;Load sprinting walking speed
$C0/4E2A 80 09       BRA $4E2E   ;and branch
$C0/4E31 EA EA       NOP
$C0/4E33 EA EA       NOP
$C0/4E35 EA EA EA    NOP
$C0/4E2C A9 02       LDA #$02    ;Load normal walking speed...
$C0/4E2E 99 75 08    STA $0875,y ;Store walking speed


Projects:
Divergent Paths (Completed) - a redo of the 3 scenarios in the original game that gives equal time to each group. Meant to be a basis for future mods.
FFVI: Definitive Edition (In Progress) - a hack built off of Divergent Paths that changes the events in Thamasa to bring closure to Banon's story and allow Leo to permanently join your party.
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite