Running N64 homebrew the absurd way: The GameShark Pro loader

Do you really, really want to play homebrew on your original N64 hardware? Is a flash cart just too pedestrian and mainstream for you? Do you posses a GameShark Pro, a 4MB Expansion Pak, and a brain disease that makes you enjoy doing things the hard way? Well, I sure do! And hoo boy, do I have a project for you…

Read on, brave souls, for herein lies the story of how I played a commercial homebrew NES game (legally purchased electronically from Steam) on my N64 via an NES emulator, which I loaded with a GameShark Pro that was interfaced to my Windows 10 PC via a very specific USB-to-Parallel adapter, that was then passed through to a lubuntu virtual machine running via VirtualBox, containing a USB GameShark homebrew loader program.

Doesn’t that sound fun?

This method made the rounds on the web a couple of years ago, but nobody really described how to do it in layman’s terms and the information was a bit scattered. So when I found out about it, it still took some piecing together. Let’s rectify that and make the method as clear as possible. Let’s get started!

The Background

What You’ll Need

  • An original N64 with a 4MB Expansion Pak installed
  • A GameShark Pro with a functional parallel port
  • A USB-to-Parallel adapter based off of a MosChip 7705 bridge
  • The ability to run Linux (I prefer lubuntu on VirtualBox for these sorts of projects)
  • A copy of gs_libusb
  • Your favorite NES ROM (I highly recommend Micro Mages! The Steam version even includes a legal NES ROM that works perfectly for this project.)

The basic goal for this project is that we need to run a Linux application called “gs_libusb” to transfer programs to our GameShark Pro. The tough part is how to get them talking to each other.

The hardest part of making this work might be sourcing the USB-to-Parallel adapter. Any old adapter off of Amazon or eBay or whatever just won’t work. As I mentioned in my post about connecting the GameShark to a PC, it’s only possible to do this with an adapter based off of a MosChip MCS7705 bridge (in fact, gs_libusb is hard-coded to look for it). I don’t know how to identify whether a random cable has this chip, so hunting one down is hard. I did manage to figure out that the USB-1475 manufactured by Cables Unlimited contains this chip and works well. These specific cables don’t seem to be produced anymore and are hard to come by these days. If anyone knows of other cables that contain the right chip, please let me know by leaving a comment.

Next, you’ll need to have the right version of the GameShark Pro. Versions 3.1, 3.2, and 3.3 all came with parallel ports on the back. All versions of 3.1 and 3.2 should work, but only certain versions of 3.3 carts will work. With version 3.3, some contain a working parallel port and some don’t. Usually, GameSharks with a speckled-looking case will work. The folks over at Micro-64 have a good explanation of the difference. (That article also explains how to load homebrew with legacy PC hardware, so check it out if you have an old Windows 98 machine lying around and can’t find the USB-to-Parallel adapter that’s needed for this method.)

Enough rambling, let’s get to it. Here’s the method…

The Method

Step 1: Set up your virtual machine

I won’t go into much depth here about how to set up a virtual machine, I’ll just reiterate that I like lubuntu and Virtual Box for projects like this. Go through the normal setup process for any virtual machine and you’ll be good to go. Here are the important configuration changes you’ll need to make once your install is complete:

  • Install the Virtual Box Extension Pack: By default, Virtual Box only supports USB 1.1. Installing the Extension Pack will allow us to configure USB 3.0.
  • Set your virtual machine to use USB 3.0: Without this step, you’ll be relegated to USB 1.1 and probably get a lot of very frustrating USB timeout errors when you attempt to load anything to the N64. Once the Extension Pack is installed, edit the USB settings for your virtual machine to set them to USB 3.0 mode. Then, with the USB-to-Parallel adapter plugged into your host machine, add a USB device filter for “MosChip Semiconductor MCS7705 Parallel port adapter [0100].” This is what will allow the virtual machine to see your adapter. Or, alternately, add a blank filter to allow all USB devices to pass through.
  • Optional – Install the VirtualBox Guest Additions for Linux: This isn’t strictly necessary, it just makes life easier by allowing you to copy/paste files from Windows to Linux and share a clipboard. Instructions for the install are at the VirtualBox site. I highly recommend doing this, unless you prefer to map network drives to do file sharing between systems.

Step 2: Compile gs_libusb

This is the loader program that will send files to the GameShark Pro, but it’s just provided as source code and needs to be compiled on your system. It’s not too hard, just follow these steps on your Linux machine:

  • Install libusb 1.0 dev libraries: libusb is a tool that allows programs to communicate with USB devices. Your system may have the binaries installed already, but we’ll need the libraries to compile our own code with it. To get them, open a terminal prompt and enter the following commands…
sudo apt-get update
sudo apt-get install libusb-1.0-0-dev
  • Download and extract the gs_libusb project: Grab the whole project from the Github page (download it as a .zip) and extract it to a reasonable directory somewhere, such as your home directory.
  • Compile the code: Open a terminal window in the root gs_libusb-master directory and type the following commands…
sudo make clean
sudo make

Assuming your libusb 1.0 libraries installed correctly, the compile should run quickly, and that’s all there is to this step. You’ll see warnings, but they can be safely ignored.

Step 3: Prepare your N64

Now we need to make sure that the N64 is ready to accept a program we send it. Just do the following…

  • Ensure your N64 has a 4MB Expansion Pak installed: This step is absolutely required, this simply won’t work without an Expansion Pak.
  • Plug in your GameShark: Use a common game, such as Super Mario 64 or Pilotwings 64, in the top slot. Avoid anything that uses the Expansion Pak memory.
  • Plug the USB-to-Parallel adapter into the GameShark: This should be self-explanatory.
  • Boot your game: Power on your N64 and choose to start your game. Make sure to turn the Code Generator ON and start the game Without Cheats. Once the game begins, your GameShark is ready and waiting for commands on the parallel port! (I typically use Super Mario 64, loaded up to the Select File screen.)

Step 4: Run the loader

Finally, the real step. With our VM prepared, gs_libusb compiled, and our N64 waiting patiently, let’s send it something to run!

  • Plug the USB-to-Parallel adapter into your PC: Be careful here and ensure that the VM actually picks it up and sees it. Run the following command at the terminal to ensure the MCS7705 is listed. If it’s not, check your VM’s USB settings and make sure that your host PC hasn’t “claimed” the device. (Unplug it and plug it back in with the VM running.)
lsusb
  • Copy your ROM to the gs_libusb-master/examples directory: Really, you can put the ROM anywhere on your Linux machine, this will just make the next command simpler.
  • Execute the loader to run an NES emulator and your ROM: Run the following command from the root gs_libusb-master directory. It will load Neon64 and and whatever ROM you specify in place of YOUR_ROM.bin!
sudo ./gsuploader/gsuploader examples/neon64gs.bin examples/YOUR_ROM.bin
  • Let everything load: Here, all you have to do is wait. Your N64 will appear to freeze while the load is happening; that’s okay. Once the load is complete, you should see the Neon64 main screen. Hit any button and play! At any time, you can hit L+R to bring up the main menu.

Step 5: Run other programs

  • The examples folder contains a simple demo program that you can run, too. With everything set up and working, just run the following command to load it instead of neon64gs.bin:
sudo ./gsuploader/gsuploader examples/flames.bin
  • It’s also possible to build and run your own programs to be compatible with this load method. To do so, you’ll need to install gsdevkit, which will give you a complete GameShark-compatible homebrew toolchain. Go knock yourself out!

Much of the info in this tutorial was gleaned from the relevant GitHub Readme files and the following video. Have a look if you want to see someone walk through running the loader:

Running Homebrew on the N64 Without an Everdrive

How the Saturn Floppy Disk Drive breathed new life into Sega Rally

The Sega Saturn Floppy Disk Drive… Useless, or Totally Useless? (Or Totally Cool?)

Let’s face it, Sega did not make a lot of good decisions in the 90s when it came to hardware add-ons and peripherals. The 32X was a straight up debacle. The Sega CD was criminally underutilized. Both are a big part of how Sega lost the trust of consumers, likely contributing to the poor sales of the Saturn and ultimately the company’s demise as a hardware manufacturer. Oh, and let’s not forget about the crazy crap like the Activator. And even an official Sega Power Strip? What the hell was going on over there?

Well, if you’re not already familiar with it, add another one to the list of poorly supported 90s Sega hardware: the Sega Saturn Floppy Disk Drive. The Saturn FDD is, quite possibly, the most superfluous gaming accessory I’ve ever purchased. I recently bought an “untested/junk” drive purely as a project and to have as a curiosity (because I’m a sucker for hardware oddities). After a bit of tinkering. I actually managed to get it working, and you know what? I kinda love it.

Yeah, part of that is the sheer novelty of digging out 25 year old floppy disks from my closet and actually finding a use for them. But part of it is that it’s, well, legitimately useful. But only if you’re trying to do some very specific things.

The folks over at Sega Saturn Shiro have done a fine job of cataloging just how poorly supported this device was. Though the drive was never released in the US, code for it snuck into a handful of games. And by “handful,” I mean nine actually work. So yeah, if you’re looking at this as an alternative to the internal save RAM or a memory cartridge for typical saved games, forget it. Get yourself another backup RAM cart and sleep better at night, with an extra $200 in your pocket.

That said, there is a value proposition here. A single floppy disk, which should cost you no more than $1 if you don’t already have a few laying around, holds over 22,000 blocks of Saturn data. Compare that to the roughly 8000 blocks in an official Backup Memory cart (about $50 these days for a US version), or the 400+ blocks in the internal memory. Given the sheer amount of space you get, the FDD might be worth considering if you’re looking to use it in a few very specific scenarios. Here, in my opinion, are all of those scenarios. All four of them.

  1. You want to do homebrew with Game BASIC and are looking for a fast and easy way to access lots of raw image, texture, and sound data. Streaming the data from your PC each time you load your game is a painfully slow process. The Saturn’s internal memory isn’t nearly enough for even a couple of image files, and backup memory carts will fill up fast. In my opinion, this is actually a great use for it.
  2. You want to get deep into building or playing homebrew shooting games with Dezaemon 2. This is a fascinating world that I’m only starting to scratch the surface of. Long story short, larger storage is a must when you’re building a whole shoot-em-up of your own.
  3. You really, really want to play the Saturn version of Hexen without passwords and don’t want to waste half a memory cart on it. A non-password save in Hexen requires a backup memory cartridge with 3801 free blocks. Absurd. How did this get through QA? Unfortunately, the game doesn’t support direct save and load with the FDD, but you can always copy it to floppy manually to free up space. This is, in my opinion, a legitimate use. Though the broader question of whether you should really be playing Hexen on the Saturn in the 21st century is a whole other can of worms…

And, finally, the reason that is really motivating this post:

4. Multiple Sega Rally ghost files. If you’ve played Sega Rally, I assume you know that there are ghost cars in the game. Set a fast time on a course, and the next time you race it, there will be a “ghost” of your run for you to race against. But did you know that it’s actually possible to save those and race them again any time you want? Well, for the last 25 years, I had no idea! That’s because I never owned an official Sega memory cartridge that supports direct in-game save. I’ve just had a Pro Action Replay since the 90s, and was content with it. But if you plug in an official cart, the game will automatically save your ghosts for next time! If you have almost 2000 free blocks of space, that is.

Okay, but if it’s possible to save ghosts with just the memory cart, where does the FDD come in? Simple – it’s the easiest way to have multiple ghost files. Normally, the game saves all your best ghosts in one save file, which is why it’s so large (and the fact that Sega didn’t bother to implement any compression, but I digress). This is a problem in Sega Rally for one simple reason:

Lancia Stratos.

The Lancia Stratos is, far and away, the fastest car in the game (yes, there are only three, but my point stands). This is annoying because even a mediocre run in the Stratos will typically blow away an excellent run in the Celica or Delta by several seconds. As a result, all your ghosts will pretty much automatically be Stratos ghosts. And that completely sucks the fun out of trying to improve your times with the Celica and Delta. My solution for this conundrum has been to copy separate saves onto floppy for Stratos ghosts and non-Stratos ghosts, then restore whichever I want to practice with to my official memory cart. And I’m loving it! This has completely rejuvenated my interest in Time Attack mode with the Celica and Delta, sparking a whole new interest in the game that had been missing for years.

Now, you might be thinking “why buy an FDD if I could just have two memory carts for way cheaper and do the same thing?” Again, simple. If a memory cart is present, the game will automatically use that for both your ghosts save AND your records save. In fact, if you have a records save in your internal memory, the game will completely ignore it when a memory cart is present. That means, if you want to maintain a single leader board with all your best times, but keep separate ghost files for the different cars, you’re going to be doing a LOT of tedious cart swapping and copying files back and forth between your separate memory carts, using the Saturn’s internal memory as a go-between. Yeah, you could do it, but it’s a dangerous proposition. The Saturn’s cartridge slot is notoriously delicate and that much swapping will most likely destroy it.

“The floppy drive won’t destroy your Saturn because of cartridge swapping” is a pretty strong endorsement, in my opinion.

It Ain’t Pretty But It Works – Connecting the GameShark Pro N64 to a PC

Here’s a little sneak peek into a project I’m currently working on (pardon the mess)… Ever since I managed to get a serial connection working from a modern PC to my Sega Saturn for the Game BASIC project, I’ve been interested in what else I can do by connecting old game consoles to a PC. That led me to the GameShark Pro for N64, which has a parallel port for communicating with a computer.

Unfortunately, the GameShark is an incredibly flaky piece of hardware that gets bricked constantly. I bought three different ones off of eBay and every single one was broken in some way. I returned the first one, but like a true tinkerer, I decided “that’s it, I’m fixing these” for the other two. One was an easy enough fix – all I had to do was boot it with the right game. By sheer chance, after being completely unable to get it to boot with Mario 64, it worked perfectly on the first try with the second game I picked: Jet Force Gemini. That unlocked it and got it working with everything. The remaining GameShark had bigger problems: a corrupted codelist that allowed it to boot, but was completely unusable. However, I had learned that it’s possible to revive bad GameSharks via the parallel connection, so easy enough, right?

Well let me tell you, getting a parallel connection working with any remotely modern PC is an absolute pain in the butt. Unlike USB->Serial adapters, USB->Parallel ones don’t support the full range of the port’s functionality. Basically, they work for printers and not much else. So here’s all I tried:

  • A special USB-to-Parallel adapter… It’s actually possible to load homebrew on an N64 via the GameShark, if you have the right adapter. Specifically, one based on a MosChip MCS7705 bridge. Unfortunately, I have no idea how to tell if an adapter uses this chip and most sellers don’t list that kind of technical information. So I had to do some sleuthing and found that the USB-1475 from Cables Unlimited contains this chip. Problem is, I don’t think it’s made anymore and is hard to track down. I took a gamble on the one seller I could find that had it in stock for a reasonable price. It was a questionable site I’d never heard of before, but you know what? It showed up quickly and was exactly what I’d ordered, all for about $7.50. The cable itself worked in the sense that my PC recognized it, but it didn’t work for talking to the GameShark. Oh well, that was a longshot, anyway. I will save it for homebrew experiments. (And for the record, the site I ordered it from is now out of stock, so I may have gotten the last one. If you know of a good way to identify other cables that will work, let me know.)
  • A mini-PCIe-to-PCIe adapter with a combo Serial/Parallel port adapter… I thought for sure this one would work. I pulled out an older laptop than the one I currently use. It was made for Windows 7 and is currently running Windows 10. I removed the WiFi adapter and replaced it with this mini-PCIe-to-PCIe adapter/extension. Then, I popped a PCIe serial/parallel combo card into the new PCIe port it provides. You can see this whole setup in the pictures, and it actually worked brilliantly… for serial connections. For the life of me, I just couldn’t get it to talk to the GameShark via parallel, either natively in Windows 10 or in Windows 98/XP VMs. I still don’t know what went wrong here, whether it was the adapters not supporting the kind of communication I needed or the VMs or what. So I punted on that approach, which led me to the one that actually worked:
  • A Wyse thin-client with native serial and parallel ports, hacked to run Windows 98 and XP… That’s what you see above. And of course the shipment for the parallel cable I ordered was delayed, so I had to precariously plug the computer itself into a disassembled GameShark. It ain’t pretty, but it works! I have the thin-client running Windows XP Pro headlessly with a USB WiFi adapter so that I can Remote Desktop into it. With that setup, I was able to run the old GameShark PC software, connect to the GameShark, and fix the codelist. I did this by saving the codes from the working GameShark and loading them into the broken one. After tinkering with it a bit, I was even able to upgrade the system software from v3.2 to v3.3!

So there we have it – I now own two working GameSharks and a whole bunch of other hardware and adapters that most people would probably think I’m kinda nuts for having. But the experimenting is half the fun, right? Now to get to hacking! But wait… it turns out I need an N64 Expansion Pak to do all the really cool GameShark<>PC communication. I suppose it’s finally time I got one, huh?

Sega Saturn Homebrew with Game BASIC

Sega Saturn for Game BASIC - Complete in Box
Game BASIC for Sega Saturn – Complete in Box

Part 1: Introduction

Summary

Game BASIC for Sega Saturn is a homebrew development kit that allows you to program games for the Sega Saturn using the BASIC programming language.  If you’re familiar with the PlayStation’s Net Yaroze platform, think of this as the Saturn’s answer to it – just cheaper and easier to get started with.

Game BASIC’s use of the BASIC language makes for a very low barrier to entry in terms of programming skill.  Though the Saturn is notoriously difficult to program for, Game BASIC makes it easy to get started and is surprisingly powerful, allowing very easy sprite manipulation and straightforward 3D polygon implementation.  It even includes an adapter cable that allows you to communicate with the Saturn from your PC to transfer or save programs and streamline development. For example, here’s a Pilotwings-esque demo, but in Game BASIC:

“Jump” demo, provided with Game BASIC (video courtesy Satakore.com)

The caveat?  Game BASIC was released only in Japan, so this means a complete setup can be difficult to obtain and all documentation is in Japanese!  Moreover, the supporting software that allows you to use your PC for streamlined development was intended for the Windows 95 era and flat out does not install on modern systems. Oh, and the adapter cable that allows you to connect your Saturn to your PC is a 25-pin serial connection!

Who in the world still has both Game BASIC and a Windows 95 PC with a physical serial port? Nobody!  (Well, unless you’re Modern Vintage Gamer) But if you’re a brave experimenter who’s not afraid to tinker a bit, there are still multiple options to get everything working, even today!  You can even do a lot just via emulation.  So, let’s head to the Lab and get started…

Continue reading “Sega Saturn Homebrew with Game BASIC”