Users browsing this thread: 1 Guest(s)
Issue with SwdTech Speed Patch

#2
Posts: 175
Threads: 11
Thanks Received: 10
Thanks Given: 8
Joined: May 2013
Reputation: 13
Status
Well-Fed
@assassin has written a Sketch Bug fix for 1.0 that actually SAVES 7 bytes rather than using seven more -- I found it at Master ZED's page, it's there towards the bottom. It's also included in most if not all of the major bugfix compilations.

The idea of using that free space to JSL somewhere else is sound, though, if you do want to keep working on v1.1. (... Although if you want to keep using more patches, I highly recommend using 1.0 instead for greater patch compatibility.) The thing to remember is that when you JSL, you need to RTL -- my first thought as to why the game is crashing on you is that you ended the subroutine with an RTS instead.

When you jump to a subroutine, the game stores the address you... return to? I believe it adds the bytes, so if you JSR at C3/2330, it pushes $2333, not $2330, to the stack. When you JSL, it pushes THREE bytes -- in this case, it would push all of $C32333. Similarly, RTS only pulls two bytes from the stack, while RTL pulls three -- the game doesn't track whether you JSL or JSR, it relies on you to code the return properly. If you JSL from bank C1 into C3, but then RTS at the end of your new code, the game will jump to that address in C3. 

So basically what you'd do in your case is JSR to C1/FFF8, JSL to your new code in bank C3, RTL back to C1/FFFC, and RTS back to where you started from.

tl;dr: Use assassin's patch on 1.0 and work from there, but also, yes, you can add new code to a different bank if necessary, just make sure you're returning properly.


Current Project: FF6: Tensei | Discord ID: TristanGrayse
  Find
Quote  



Messages In This Thread
Issue with SwdTech Speed Patch - by ExiaTreason - 11-24-2017, 02:45 AM
RE: Issue with SwdTech Speed Patch - by GrayShadows - 11-24-2017, 03:54 AM
RE: Issue with SwdTech Speed Patch - by assassin - 11-24-2017, 07:33 AM
RE: Issue with SwdTech Speed Patch - by Warrax - 11-24-2017, 01:53 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite