Cubear’s projects include the fan-favorite DressCode mod for Final Fantasy V, and numerous MSU-1 hacks including for Donkey Kong Country 2 and Live A Live, just to name a few. You can follow Cubear’s work via YouTube, X. or Patreon.
What is a hack? (game modification)
There’s hacks that adjust data, and there’s hacks that adjust code. (or code and data)
This document is about the latter. No shade on the former, it’s valid, but it’s not what I do so I can’t comment upon the process.
In essence, an ASM hack, assembly hacking, or whatever you want to call it, is a modification of the game’s internal code. You write a bit of code to accomplish a task, you insert it into the game, and voila! You’ve probably broken everything. Don’t worry, it’s normal and it happens to everybody.
All this sounds pretty simple, but it takes a bit of getting used to.. for instance, once your code is written, how do you get the game to run it? When?
Well, to get the game to run your code you’re gonna have to hook.
So what’s a hook? It’s a place in the code where something is working in a manner you desire, somewhere convenient, somewhere that runs when the function you are trying to alter is running, perhaps.
So let’s look at a sample bit of code…
PHA
ASL
TAX
LDA $3100,x
STA $3E
PLA
RTS
It doesn’t matter what this is doing or not doing. I wrote it at random to be roughly representative of code you might encounter in basically any 6502 game.
Let’s say the information in $3100,x or $3E were interesting to you. Maybe it’s a map load, or a song’s track number or a spell or item being used… whatever you want to change, you could change it here.
So let’s say that you’re changing the number, maybe only on a specific number, like the spell number 0x56, you want to replace with 0x6E, but otherwise let the values pass unchanged.
Your code might look like:
CMP #$56 Compare value in A with 0x56
BNE + Branch forward if it is not equal
LDA #$6E Load 0x6E into A
+ Branches merge here
All in all a pretty simple thing, but unless you tell the game to run your code, it won’t run it!
So now what we need is a hook.
On hooks:
In a ROM, every instruction is an array of bytes. Different instructions will be different sizes, in bytes.
For example, let’s look at where we’d like to hook.
Now, on SNES there are two different sizes of “hook”
(maybe 3 but we’ll ignore hooking with branches for now since they’re often impractical)
JMP, JSR are 3 bytes.
JML, JSL are 4 bytes.
Shifting bytes around in a ROM is a really hard task. So let’s not do it. Instead, we will overwrite the bytes in the ROM with new bytes.
So, from looking at where we want to hook, LDA $3100,x seems the smart place. If we can get away with a 3-byte hook, we replace just that one instruction, 3 bytes into 3 bytes, everything is great.
So let’s do it using JSR.. and you return from JSR with RTS.
In this way we can run a lot more code during those three bytes than the program originally intended.
Oh! but there’s a bit of a problem! We erased an instruction and it’s not being replaced! This means the game will NEVER perform the LDA $3100,x instruction. Let’s correct that. You almost always need to move the code you replaced in order to place your hook, you need to move it into your hook.
This will do exactly what we wanted to do in the first place. Compare the value being loaded from $3100,x with 0x56, if it IS 0x56, replace it with 0x6E, and if not, pass the loaded value through unchanged.
Perfect! But… what if there’s no free space in the same bank? What if we need to use 24-bit addressing, what if we need that 4 byte hook? (this will come up VERY often)
then it’s time to find 4 bytes to hook with.
We could hook 4 bytes with
TAX
LDA $3100,x
one byte + three bytes.. four bytes. Nice and simple. Just need to put TAX into your new code area as well.
Let’s say that’s not an option for whatever reason. What if you need a 4 byte hook but the things around only add up to 5 or 6…? for instance,
LDA $3100,x
STA $3E
That’s five bytes. If you replace 5 bytes with 4 bytes, the 5th byte remains and it will completely ruin your day. Luckily there’s a 1 byte instruction you can always overwrite dangling bytes with.
So the code we’re replacing got split up in our code block. This is just because we want to modify what was being written to $3E, so it needs to happen after our code, so it just goes at the END of our code space.
Alright so now that we know what a hook looks like, how do we write one for ASAR?
Well, now WHERE in the rom the code we’re replacing is is very important.
ASAR’s org instruction tells ASAR where to place code, so let’s say LDA $3100,x is in ROM at $C082CE
Our hook for asar looks like:
org $C082CE
JSL bankFAfree
NOP
and then we also need to tell ASAR where to put our new code, let’s say FA8000 is completely empty.
and that’s it. That’s how you hook with ASAR, that’s how you figure out where to hook, that’s everything about hooking to run your own code in a game. Apply your ASM with ASAR and it’ll insert your hook and your code for you.
Richard Murtland is a solo indie developer and content creator who names Dragon Warrior as one of his favorite childhood games. You can follow Richard’s work via YouTube or X.
Part Love Letter, Part Randomizer
Hot on the heels of Splintered‘s Early Access release, Richard sits down with clymax of FFV Central to give our readers an inside look at the development journey.
Q1: Looking over dotMake Studios’ developer page on Steam, Splintered appears to be your foray into indie development. Is this the game you’ve always wanted to make? Indie devs tend to have dev experience in some industry, so we’d like to ask: what’s your concurrent (or if none, former) line of work (before taking the plunge)?
A1: In a lot of ways, yes! I wanted to make a game that pushed the envelope on something, and in this case that something is: a game that’s built from the ground up to support (and be supported by) a randomizer, making it a core part of the game loop. It’s been an exciting journey with a lot of interesting problems to solve.
I was previously a software engineer.
Q2: This should be an easy one: give us your elevator pitch on why solo-character RPGs are better than party-based RPGs.
A2: I’m not sure if they are! But I’m also not sure if solo-character RPGs have been given their fair shake. In my mind, the 1v1 style combat of Dragon Quest 1 got left behind pretty quick. Sure, it’s appeared in some other games and other forms (monster battlers, Undertale, FFXVI -kidding-), but I always felt there was more to explore in the realm of a traditional 1v1 RPG. At the end of the day, I think it’d be great if someone played Splintered and went from “There’s not much you can do with just one character.” to “Oh, that was a lot of fun!”.
Q3: We at FFV Central are no stranger to rando mods for classic JRPGs. (Our flagship release is a self-randomizer capable of dynamically toggling randomization of five different aspects of the game during a run.) What aspect of Splintered barely did not make the cut for randomization at least for the foreseeable future, and why?
A3: So on one hand: I can’t think of an idea that I’ve been forced to leave behind, which was part of my goal with Splintered. Sure, some features are more difficult than others, but having complete control over the base game gives me a wide variety of possibilities at my finger tips. If there’s something I want to do, I just need to build/rebuild the features to support it.
On the other hand: This freedom also comes with a cost. The game needs to be good start to finish. From the base game with Chapter 1, to the first randomized run with Chapter 2, and everything in between as players work their way towards the eventual Chapter 5.
As I’m typing this, it’s four days after the Early Access Release and I’ve released 3 small patches. Fixing two edge case softlocks, putting my randomizer versioning to test (so that the majority of players that didn’t experience any issues can seamlessly continue their run as if nothing happened), and making improvements to the base game and accessibility based on feedback (which is actually one of the parts of development that I quite enjoy!). I’m excited to deliver the next content patch, which adds the in-game customizer that’s needed to really bring the randomizer to life, but I’ll be spending today working on a much needed Rebindable Keys feature and some related controller support. (Don’t worry though, the content patch will be out soon!)
Q4: Without spoiling anything meant to be kept as a surprise, what major feature are you looking to add to Splintered either before it makes it out of early access or, if none, during its lifecycle? Any plans for a GOG release?
A4: So a lot of the work for the “Clairvoyant Challenge Mode” is already done. It should arrive shortly after the customizer. I won’t spoil the features, but if you think “what would happen if your character was clairvoyant”, you can probably guess a few.
No current plans for a GOG release, but I’ve heard some recent interest so I’ll be considering it around release time. I’m open to the idea, there’s just a lot of other things I’m focused on atm w/ the EA release.
Q5: Even in the world of modding, it’s not easy for a solo modder as myself to go up against group mods or compilation mods, let alone in the gamedev sphere. Which parts of Splintered were done by you versus outsourced or acquired?
A5: It’s just me (with the help of Unity, Famitracker, and Aseprite). I’ll be to hiring a professional translation service to localize the game to Japanese soon. Also, within this last year, Splintered‘s had a community begin to form around the game and they’re the best! They’ve been immensely helpful with their early feedback and participation in the recent Beta Tests.
Q6: Tell us a bit about the tech behind Splintered: what’s the game engine, and how’s your experience with the engine thus far?
A6: Splintered is made with Unity. It’s alright. It does everything I need it to do and I’m hoping I’ll need to make use of the porting features some day soon!
Q7: Closing remarks: we recently conducted a player vote for a next franchise to rando-mod next. Dragon Warrior narrowly beat out Chrono Trigger, Secret of Mana, and Romancing Saga, and we’ve already begun looking at it. (Dragon Warrior was actually my first RPG, and its giveaway promo was what helped me convince my parents to get me a one-year subscription to Nintendo Power magazine.) Needless to say, 2025 is a great time to be a Dragon Warrior fan! Thank you for your love-letter randomizer and for your time for this interview.
A7: Woohoo! Sounds like a wonderful choice and best of luck with the randomizer! Thanks for having me and for the interest in Splintered!
If anyone wants to check out the game, you can find Splintered on Steam [link]. There’s currently a 10% release week sale that lasts until Friday morning (3/28 10am PST). There’s also a demo available.
syo is a content creator specializing in analyzing the techniques used by speedrunners in FF games. You can follow syo’s projects via YouTube, Twitch, or Patreon.
No, not Final Fantasy II (IV) on the SNES. FF II on the Famicom.
Remembered more for its unconventional (by FF standards) system for character progression than for its existence in the 8-bit era of gaming, FF II gets a special treat for fans, in the form of a feature video from FF-speedrun content-creator syo. (The system would later find a new home in the sister franchise, SaGa.)
Speaking with FFV Central about what prompted the video to be made in the first place, syo says:
I became fascinated with the NES version when I learned about the use of the poison status to skip encounters.
The whole idea is what hooked me to make the video when I first found out about the speedrun.
Tactical Toxicity
We at FFV Central certainly didn’t know why staying poisoned would make a run go quicker (before watching syo’s video, that is).
All we could imagine was the punishment of playing through an RPG with the screen continually blurring in and out (or, apparently in this case, with audio blaring).
On what else stood out when making the video, syo says:
For [the] glitchless [speedrun category], I was surprised to learn that it’s significantly faster to have Firion solo carry the game, it seems wrong but it’s just how smart people figured out how to abuse the progression system.
Here at FFV Central, we’ve also seen the surprising effectiveness of solo carries versus party-oriented approaches, and it’s interesting to see this strategy come up in FF II.
For instance, notorious in the community of JRPG achievement hunters, the All Party Combinations Subset for Final Fantasy on Retro Achievements1 was ultimately designed to require party members not only being alive but also being within a certain level range of one another.2
On what syo may have done differently in the video, syo says:
Something I wish I’d touched on a bit more too is that on the overworld, encounters are always after a set amount of steps, so its very fast to just save 1 tile before an encounter, get the encounter, and then soft reset.
This tricks the game into thinking you got the encounter and lets you continue walking freely.
Sounds only slightly harder than entering the menu to do the same in the overworld in FFV. And much easier than memorizing a step route (typically the fastest option).
Leaderboard Denied
Speaking to FF Central further, syo lamented the lack of a recognized speedrun category for FF II’s English mod, despite some of the fascinating quirks this game offers to players. Says syo:
I’d really like to see . . . [interested] reader[s] . . . try their hand at speedrunning the game. The [FF I & II speedrunning] discord is a great place to get started, and with enough interest, the goal of getting these categories made will come naturally.
What do you think? Are you a fan of FF II on the Famicom? Do you think there should be a speedrun category for FF II in English?
A Plan Forward
If you have ideas to help make the leaderboard happen, check out the speedrunning Discord mentioned above or reach out to us.
For example, for the English mod to both be eligible for a category and attract runners, the English mod would need some playtesting to confirm that all the time-saving glitches in the Japanese version remain intact in the English mod.
It’d be preferable that such runs be recorded so that they can serve as a reference for the leaderboard moderators.
Some measure of the time difference between the Japanese and English versions should also be documented.
The modding team at FFV Central can investigate porting these glitches back over from the Japanese version if needed.
This post has been viewed 28 time(s).
Bravo to our community members who have bested this subset on Retro Achievements. A feature post may come soon. ↩︎
But only after one of our modders (solidification) raised solo carrying as being a potential exploit, to the achievement author. ↩︎