GameBoy Cart Flasher
Details
Device
Concept
The idea for a device was made during a boring lecture in which I (owner of GB), was wondering on how to make upload my own programs on the media memory (popularly known as Cartrige or Cart). With the skills of Robert (aka Chroost), a colleague from the school benches, shortly after I had the opportunity to test the first version of the programmer using a serial port RS-232.
GB Cart Flasher v1
This is the first version of the programmer, based on a very popular (and cheap) system AT90S8515 Atmel AVR (ATMEGA8515 in v2). Outside, the whole system is completed by MAX232C matching voltage between RS-232/ATMEGA and some elements of the applications of these integrated circuits. It is the simplicity of the system and the fact that, in contrast to other solutions of this type, we used the serial port, the evidence of the unique solution. This device represented a kind of prototype, which allowed me to write a console first, then a graphic program to support the write, read and delete data in memory ROM / Flash / RAM, contained in the original and modified Carts (recordable). Unique appearance of the device is effect of the connector pins from PCI connector which was used to build GB cart connector. Despite the simplicity, this solution proved to be useful throughout the tests.
GB Cart Flasher v2
This version is a true show of Robert's skills. The very idea has changed a little, but as a result of the work on the program, we have improved a few small flaws in the software device and transmission protocol, and increased programming speed of a few dozen percent. But something else was a milestone: it was applied by using the USB interface, famous FT232BM cube, which is a converter USB ↔ RS-232. In addition, thanks to connector dismounted from the damaged console we have obtained greater certainty of Cart's mounting. All mounted on a printed circuit board made using photodegradation matched and placed in the housing, makes a very positive impression.
Due to the difficulty of fitting the IC FT232BM (layout made in SMD technology), we created also a new version of the device based on MAX232C, designed and tailored to the size of the cabinet. This is a nod toward those who wish to build a flasher, but do not have sufficient expertise or equipment to mount a USB converter, or simply want to make a cheaper version.
Console Version
Protocol
At the same time we designed bilateral protocol transmission between your computer and device.This protocol defined the size of packages, a software flow control system based on acks and accurate algorithms of writing, reading and deleting. The Protocol was the interface, which allows us to work independent of hardware and software.
Experiments
Initially, not having a hardware, I coded transmission algorithms, using the second computer as flasher emulator and connecting via cable (null-modem). In the course of these experiments, I noticed that using the ANSI C can move virtually all of the application of the system to system. This involved only a change in the module responsible for operating the equipment. So I separated this module and wrote its two versions: a library based on termio.h (Unix systems), and based on WINAPI (Windows console application).
Grand Final
In the meantime, it turned out that I need to write a project in C at the university, so I decided to use my work and give Linux version of the programmer, creating a user interface similar to console-style programs such as wget. So I fixed algorithms, added user interface based on command line and set of parameters, and all managed using Makefile files.
In parallel with the device module designed under Windows, in a few minutes made the port of application on Windows. In terms of appearance and behavior is not distinct from the version of Linux, because I used the same UI module.
GUI Version
Beginning of battle
After the end of console versions, I decided to do something more user friendly and wrap GBCF in the GUI, while retaining portability. This assumption made me began to look for multi platform API, allowing to create GUI. After long reflection I have chosen Qt (other options were GTK+ and wxWidgets) because of the great help, for an additional set of technologies (including handling of threads and easy internationalization) and C++. After several Qt tutorials and a few books on C++, I made the project of classes and GUI. Big impact on the appearance of programming application had the phone flasher software (Nokia Flasher by Rolis) and DVB TV SAT turner programmer (DSXFlash), because of the similar use and convenient interface. In addition, I accepted some of the project assumptions:
- uniform appearance for all systems
- ease of adding other languages
- common interface for hardware (the possibility of adding USB)
Especially the last assumption was important because in parallel with the creation GUI version, we builded USB flasher, which require a new module.
Problems
Creating a frame of application took me a few weeks of holidays. Once transferred the logic to object model (classes in C + +), I appeared on the problem of simultaneous use of several modules, hardware (ie switch between RS-232, and UBS in during his work). The solution proved to be Bridge Patter (of course I didn't knew the name back then), which I made by creating an abstract class and implementing AbstractPort in modules operating on equipment. Then it turned out that during the programming, GUI freeze, which forced me to discover multithreaded programming. At the same time I discovered that the crew of a Trolltech (producer Qt), solved very cool the issues of translation of program, which allowed me to create the English and Polish versions. After countless test the version of the RS-232 and USB, appeared RS-232/USB version (Windows) and RS-232 (Linux).
Result
With version 1.0, we decided to give the installer (Win) and packages (Linux). Thanks to excellent free program Inno Setup I have created installer, which imported to a minimum configuration (eg install a driver for USB), and added the appropriate shortcuts. More problem was with the creation of packages for Linux, however I finally made it, with the help of video tutorial by Horst Jens from site ShowMeDo.com, which show step-by-step process of creating a DEB package. A pack of DEB RPM created using “alien” program.







