DIY: Gameboy Cartridge Programming

Monday, May 30, 2011

A long overdue post

Wow, this month went fast!  I was extremely busy getting everything sorted out for college and finishing up my classes, but now I have the next 6 months free.

Firstly, I managed to get my hands on the Gameboy image quantizer, shown here.  I got a copy from someone who managed to download it in the 6 or so weeks it was available at the link on that page.  You can find a working download link here.

I decided to take apart my Propeller-powered ROM reader, and rebuild it with an ARM7 cortex-m3, which I'm hoping will make it cost less in the end and give me a chance to brush up on C.

Also, I WILL be making a Gameboy programming tutorial over the next 3 months, which will include code snippets for the various parts of the Gameboy (for example, the LCD initialization code, reading buttons, etc etc).

On a final note, I would like to get an idea of how many people would buy a USB Gameboy cartridge reader/writer for around $30.  Just leave a comment or email me -- that way, I can get an idea of if this is worth taking my time to make into a product.


--Vaati

Saturday, April 16, 2011

My ROM reader is progressing!

Ok, I have made a vow to post to this blog at least once every month.  Now that I'm not as busy with school (I have the week of the 18th off for spring break) I will be churning through my projects, starting with my Gameboy projects.

Now then, for the interesting stuff.
As I mentioned in my previous post, I rebuilt my ROM reader with a much better and more recent propeller module that has an on-board FTDI chip for USB communication.  Here's some pictures of the ROM reader, revision 3.0:

Above is a picture of the ROM reader, with its 30 or 40 jumper wires.

A close up picture of the module I'm using.  I actually got it for free at a Propeller Expo.  :D

Here's a close up of the ROM chip.  It's a 64Kbyte UV EPROM I got two of them for $3 or so at a big surplus warehouse.

My goal is to get a read speed (including sending the data to the computer) of under 10 seconds for these 64Kbyte chips.  Right now I have gotten it down to about 20 seconds by removing unnecessary dummy objects and by removing the transfer of, essentially, another byte for each byte I'm reading.  Today I will also look around for some faster communication methods (there's a rather promising looking 5Mbit/sec method that I am really eager to test out) and maybe make another post if I make leaps in technology that could impact the world's perception of UV EPROMs and their viability as storage devices.

Oh, and on a side note -- I found out that there are 3 others who are building GB cartridge readers/writers.  Two of them use the arduino, and one of them is basically the exact same one I built last year, except they stole the plans from the two Polish students who copyrighted it.  One of the arduino-based flasher is featured on hackaday, and can be found at Inside Gadgets.

--Vaati

Sunday, March 13, 2011

My [not quite finished...] cart reader/writer

I have been working on a ROM reader/writer for a while, originally as the basis for a universal programmer, but that can wait -- I have decided to implement it as a GameBoy (and possibly other platforms!!) cartridge reader/writer.  So far all I have done is created a huge mess of wires on a breadboard, and tried reading a 512k UV EPROM.

So, here's the amazing pictures of this groundbreaking technology:

The above photo shows the microcontroller I'm using, which is actually in a handy little module [which, by the way, is a DIY module that I paid next to nothing for] and it shows the jumble of all the jumper wires I own, and the 512k UV EPROM, which may or may not have been damaged by the camera flash...


As you can also see somewhat on the right, there's a RCA connector for a TV.  Since the microcontroller that I used (the Parallax Propeller, if you didn't recognize it) can do 1-pin video, I displayed all the ROM data on the TV.

Here's some more pictures:

On this one, you can even see my little 2.1mm power connector to breadboard adapter, which has come in handy for a BUNCH of projects.  The huge mess of wires is also a bit more noticeable here too.



This is just the same thing, different angle.  Can you spot the Kid Icarus Mask ROM chip?


Now, for a summary of the code...

First, since this is the Propeller, you need to define the clock speed at 80MHz (yeah -- that fast, not even overclocked) and define the Output Enable (OE on most flash/ROM chip pinouts) and Chip Select (sometimes called chip enable; labeled as CS or CE).  I put them as IO pins 27 and 28, simply because it made everything much easier.

You also need to define the variable for the address you'll be incrementing.  I called mine "addr" for simplicity.  Also define another variable, which will be the actual data held in the addresses -- "data" seems to be a fitting name...
Since this is the Propeller, you also need to define what objects (if any) you will be using for your program.  The demo program I have uses the 1-pin TV text object, which was a lifesaver, since I wouldn't have had enough jumper wires for normal 3 pin TV.
Now for the actual process of reading (I havent tried writing chips yet, since I only have one flash chip, which is currently in my cartridge).  What you do is define "addr" as: %0_0_0_0_0_0_0....  Basically, you need to have as many zeros as there are address lines on the ROM chip.  Once I configure it for GB carts, it will be 16 zeros.  Then, you will need to set OE and CS to outputs, set the pins connected to the address lines of the ROM to outputs, and set the data lines to input.  To read, you set OE and CS to low, write "addr" to the address pins, wait a few moments (moments are of course, microseconds) and then read the data pins.  Wait a few more microseconds and then repeat as many times as there are addresses in the ROM chip.


That's pretty much all there is to it!  As you can see, its super simple...


I will be working on reconstructing this on my breadboard today and tomorrow.  I'm hoping to get some more pictures and maybe even a video of it working.

Finally, I am planning on selling this project once it's completed, for about $20 to $25, fully assembled and ready-to-go, as long as I can find an alternative connector...

That's all for now...  If any of you know of a source for an equivalent to the GameBoy cartridge connector, PLEASE leave a comment with a link!


--Vaati

Thursday, February 24, 2011

An important update, including a link to download GB Assembler Studio.

Wow -- This blog is over one year old!  It's been a while since I last made a post...

The main reason I am posting this is because there are some issues with the Gameboy Assembler studio download in the previous post -- I forgot that the website with that file doesn't work/exist anymore.

I just found out that I can upload the zip directly to google docs!  Here's the download link:
Download GB Assembler Studio.

A final thing I'd like to mention is that I've added a "contact me" page.  You can find it just above the blog title, in depressingly small text.  If you can figure out my text spamblocker of encrypted awesomeness, then you can email me; I will usually get back to you within 24 hours (as long as I don't disable the google mail checker extension in chrome...)

Well, everything went better than expected, and I am happy that there is a way around having to upload files to some virus-teeming site like megaupload or some torrent site...

Tell me if the download link works.

Thursday, September 16, 2010

Yet Another Update Post

I finally decided to get this blog on Devrs.com, since it seems to have enough info.  By the looks of it, there have been a lot more visitors since.

I keep putting off posting a tutorial, because of schoolwork, testing, and planning for college I don't have much time to spare.  However, I am definitely going to start posting ASM tutorials within the next two weeks.


EDIT: I found that the Gameboy Assembler Studio application that I use to program the gameboy is no longer up on the web.  I will try to get it uploaded somewhere useful and provide a working link for it when I have the time.  It's a really great GUI that was designed for windows 95, but it still works great for me on Windows 7.


To end this short update, I have a question for you who visit this site.  Should I create development blogs for other classic systems, such as the NES/SNES and maybe even the Gameboy Advance?  I have some information on those systems, as well as great tools I have downloaded throughout my journey of the internet.
What do you think?



Another post is sure to come soon, plus an article from another GameBoy developer from YouTube.

--Vaati

Thursday, June 24, 2010

Assembly School Link

I found the ever-elusive ASM School website, which is a pretty good Gameboy Assembly tutorial:
http://gameboy.mongenel.com/asmschool.html

I have another big project in the works right now, so once I finish that I'll write up a tutorial or two on my assembly adventures.

Friday, June 18, 2010

Update

Now that school is finally over and the ACT's are in the past, I can get into the real programming of the Gameboy, which is what this blog is all about.

I found this really awesome program for the computer that is probably the only windows application (not command line crap) for creating gameboy games. It's called Gameboy Assembler Studio, and it can be downloaded right here. Since that site may go down in time, I'll get permission from the site admin to post a zip file of that program on this blog if that ever happens.

Since I have never coded anything in assembly before, I will have to browse around for some good tutorials and post a few links of good tutorials in a few days.

Also, I will be making my own gameboy cartridge reader/writer from scratch, and I'll probably sell it on my main website for $20 to $30 if I can find a low-priced cartridge connector.