11 March 2016 - Forum Rules

Main Menu

Toejam and Earl Disassembly

Started by RyanfaeScotland, January 24, 2016, 06:03:55 PM

Previous topic - Next topic

Shade Aurion

Nice! I hope someone uses this to make a Rick and Morty hack of ToeJam and Earl :3


Been following this project for a little while now, and I must say, keep up the good work!

To get my feet wet in ROM hacking (as well as get me more experienced with game dev in general), I'm using this to make a hack with Toejam and Earl's girlfriends, Lewanda and Latisha. What I would like to do with the hack is put a different, feminine spin on the game, with new playable characters, new dialogue, new voices, new foods, and even a new story too.

I do have a few questions, however.
* If the music is ever included in the disassembly, how easy or hard would it be to replace songs? If possible, I'd like to replace "Toejam Slowjam" with "Ode to Sharla" from Panic on Funkotron.

* Will this disassembly allow for full-on text string editing in the future? I got a head start on the hack by replacing some of the text, and I found that if I type anything that exceeds the character limit, other lines will read as jumbled gibberish. For instance, changing "jammin!" to "stylin!" appears correctly, but changing "c'mon earl" to "c'mon lewanda" will fuck up the rest of the gameplay text.

* Would this allow for editing the tile spacing on certain graphics? Once I make the girls' sprites, they'll probably be taller than Toejam or Earl. Plus, trying to fit Lewanda's name into the HUD is proving to be tough, since "Lewanda" has far more letters than "Earl".

* How do I edit the "Toejam & Earl" logo at the beginning? I see the file in here, but when I try to open it with Retro Graphics Toolkit, it gives me an error message.

Thanks and looking forward to more! Hopefully with this project, as well as the recently released Back in the Groove, the Toejam & Earl series will finally start to get the recognition it deserves.
Currently working on Latisha & Lewanda, a romhack of Toejam & Earl.


Thanks LightningSam, look forward to seeing what you produce.

The idea of adding the girls in occured to me as well and with the release of BitG I imagine a lot of people would like to see that. Replacing T&E with them is a good place to start, then you can add them in as 2 options alongside T&E and finally implement a fully fledged 4 player mode once you are a game dev god! ;) :)

To your questions:

If the music is ever included in the disassembly, how easy or hard would it be to replace songs?
Music will definitely be included in the disassembly but I'm afraid I have no idea how hard it would be to replace as I've never worked with Mega Drive music before (or any other music for that matter). I'm sure this'll become clearer as the first songs are discovered.

Will this disassembly allow for full-on text string editing in the future?
Yes, definitely. Currently I've no plans to make any tools that will facilitate this but so long as you understand assembly you will be able to do as you please and text work should be fairly straight forward.

Would this allow for editing the tile spacing on certain graphics?
Same answer as above, once the disassembly is complete anything will be possible however I imagine making the sprites taller will be trickier that editing the text or name graphics.

How do I edit the "Toejam & Earl" logo at the beginning? I see the file in here, but when I try to open it with Retro Graphics Toolkit, it gives me an error message.
I've only opened the files in Retro Graphics Toolkit which is done by opening both the file and a palette using File -> Open -> Tiles -> Open Tiles and selecting OK on all the menus except "Set 0 as Transparent" then for the palette I don't think I've exported the correct one yet so I just open it with File -> Palette -> Open Palette and then select a random one from one of the directories. I haven't actually tried editing anything yet so keep me posted on how it goes.

Good luck!


Thanks! I'm definitely gonna need it, especially if I wish to write new text. (learning assembly looks super complicated)

Btw, I tried to open LogoScreen.bin again, this time using your advice, and I still got the same error message:

QuoteError: This is not a valid tile file. Each tile is 32 bytes and this file is not a multiple of 32, so it is not a valid tile file

(I added punctuation so that it's easier to read)

None of the other graphics I have opened so far seem to have this problem.
Currently working on Latisha & Lewanda, a romhack of Toejam & Earl.


Hmmm that's annoying. If you go into the Help -> About in Retro Graphics Toolkit what does it say for when it was built? Mine is: This program was built on Dec 9 2018 02:27:54

What other graphics programs have you used so far to try it? Would be interested to know what others work well.


Yup, same build date. Just now, I tried opening the file with FaTILEty, and it shows up in there. (I'm not sure how to arrange the tiles to put them in order, but I'll save that for a different thread.)

Anyway, I am pleased to announce that the hack is slowly advancing! I got the new header and HUD names in, and I changed the character palettes in a palette dump I got out of Gens. Once I get to the point where I can put the new palette into the game, I may have to give some Earthlings different colors as a result, as I found that a few of them share the same palette as Toejam and Earl.

Currently working on Latisha & Lewanda, a romhack of Toejam & Earl.


Looking good LightningSam, keep us posted with how you get on.  :thumbsup:

Things are progressing well on my side as well, will do another write up soon.


Just thought I'd check in so that people know I'm still around. Haven't updated the site much, not at all this year I don't think, but the T&E repo still get a bit of love every now and then.

Have got a new PC so will need to go about getting that set up again before any more progress is made.


Progress Report 8

Date: 19-Jun-2020
Current Goal: Moving from Easy68K to VASM.
Complete: 100%.

It's been a long time since my last update. As usual I got distracted with other projects, then something caught my interest that made me think about my own disassembly and now I'm back to make as much progress as I can before I get distracted again.

As you may recall, the last big change I'd made development wise was to start coding exclusively in Visual Studio Code and use Easy68K only for assembling the code and building the final binary. This has worked well, I've made huge progress on the disassembly as a result and even managed to get the build process down to just a handful of keystrokes. However, it still wasn't quite slick enough. Building shouldn't take 3 applications to do it. It shouldn't take a handful of keystrokes. It should be a single keystroke and it should happen from within a single application.

And so that is why I decided it was time to bite the bullet and change assembler, something that I knew was inevitable ever since the day I realised Easy68K doesn't have command line support. Thank you very much Professor Kelly, for the great tool and all the support, but it is time we went our separate ways.

I think the thing that piqued my interest and got me back on the T&E track was the discovery of a new person (new to me at least!) supplying the world with high quality assembly knowledge: ChibiAkumas on his YouTube Channel. And so it seemed only fitting to go with the assembler he uses for his 68K work (well, that and it is modern, well documented, well maintained and widely used): VASM.

VASM is a portable and retargetable assembler to create linkable objects in various formats or absolute code. I have no idea what that means, but what I do know is that ChibiAkumas has a video explaining its setup in the first 5 minutes and also supplies a ready to rock download pack containing everything you need to get assembling fast. I haven't exactly copied his set up but I've certainly lifted liberally from it!

And with VASM setup and working from the Windows command line it was time to set up Visual Studio Code to use it. This was done via a custom build task, allowing the press of CTRL+SHIFT+B to completely assemble and build the source from code to binary, at least it would if the damn thing would build!

Which is where the real fun began!

Turns out Easy68K and VASM aren't perfectly compatible (not huge surprise really). Here are the things I can remember I had to do to get the code reassembling and building once again:

  • Make sure all PEA instructions have their opcode length set.
  • Make sure all BRA (and related) instructions have their length set.
  • Make sure no ORG statements overlap or are duplicated.
  • Replace * as the comment marker with ;.
  • Move the code that starts at $00000000 to be first in the Master file

And to be honest I think that's about it! It felt a lot more at the time but all in all it wasn't too bad, 4 days in total for the move. Getting the VSCode problemMatcher set up, which jumps you straight to the lines that are causing build problems, made a world of difference. The ORG statement overlaps were harder, as no indication is given as to which areas are overlapping and I have a lot of them spread out over many files. This wasn't an issue in Easy68K since it just overwrites sections that overlap, but VASM is stricter and refuses to generate a build until you sort them. A sure sign that we're working with grown up tools now! With a little Excel and Notepad++ wizardry I was able to set up a macro and spreadsheet that helped narrow it down and root out all the overlap and a lot of duplicate code in the process.

And that was it done! The disassembly once again builds into a bit perfect copy of the original ROM. And best of all, although the Easy68K code wouldn't build in VASM the VASM code will build in Easy68K, so although I don't plan to maintain compatibility going forward it is still nice to know that the first commit will still work with either set up.

Little bit more spit and polish and I'll be ready to commit that very first commit of the future!


Hey Ryan, I just came across your progress on TJ&E, it's really impressive. I was able to get it building with the latest vasm, though I had to update one line from your repo:

--- a/Source/Earthlings/Code/Earthlings.X68
+++ b/Source/Earthlings/Code/Earthlings.X68
@@ -2895,7 +2895,7 @@ ShipPieceAbility:
        MOVE.w  D3, D3
        EXT.l   D3
        MOVE.l  D3, -(A7)           ;level onto the stack
-       JSR     -$0416(PC)          ;call this (ShowShipPieces - Shows ship piece)
+       JSR     ShowShipPieces(PC)  ;call this (ShowShipPieces - Shows ship piece)
After that all good. Thanks for getting this going, would love to hear if you continued with it over the last couple years.