Archive for the ‘Software Development’ Category

Otaku No Yen

Sunday, January 30th, 2000

This is a Gameboy emulator that I threw together over the period of about seven days. It’s been sitting around on my computer for a few weeks and I thought I should finally release it. Let’s optimistically refer to it as an “alpha” release. It’s not particularly robust or speedy right now. There’s still a lot of work to be done with it before the emulator becomes really useful to anyone.

Why another emulator? Well, I never really set out to write a Gameboy emulator, it just kind of happened over the New Year lull when I wasn’t feeling up to working on any of my other projects. I originally intended to just crank out a very basic Gameboy Colour emulator in Java and ended up deviating in to an ActiveX control. The Java version is still lurking on my machine, waiting for my return and one day I’ll get back to that too. For now, this emulator is teaching me a lot about the Gameboy that I didn’t know and that will be useful when I eventually pick up where I left off with the Java version. The C++ that this emulator is written in, is also very portable, so I might just scrap the Java code base and start over again with a fresh perspective.

What’s really different about this emulator, as you might have gathered, is that it’s an ActiveX control, yes, it’s a Window’s evil. The emulator will let you embed it in to almost anything that can use ActiveX, so you could place it inside of a web page, Microsoft Word document, or an Excel spreadsheet. You can write an interface around it to allow for source level debugging, or if you are writing an IDE for Gameboy programmers you can assemble/compile the source code and then launch straight in to the emulator with fully integrated debugging. If there is a quirky feature you want, for instance, you might want to play multi-player over the Internet on a Gameboy game, you can easily throw together a TCP/IP program that will exchange the data from the emulator. Or you could have it capture each video frame and save it to the hard drive and later take all of the frames and create a movie for download from a web site. There are a lot of possibilities.

Right now the control doesn’t do much, it has a limited number of methods, has some graphical glitches, does not run every game out there, does not support sound or save RAM or link cable. Eventually these desirable features will be added as time allows, and more importantly, as user interest prompts me to “get on with it!”

ADDITIONAL INFO

 

Methods

  • LoadROM — Load ROM specified image (v0.1)
  • ReadROM — Read a byte from ROM (v0.2)
  • WriteROM — Write a byte to ROM (v0.2)
  • ReadMemory — Read a byte from memory (v0.2)
  • WriteMemory — Write a byte to memory (v0.2)
  • Go — Begin executing ROM (v0.1)
  • Reset — Reset Gameboy (v0.1)
  • DrawTime — Get number of milliseconds last video frame took to draw (v0.3)

Properties

  • A — Get/Set accumulator (v0.2)
  • B — Get/Set register B (v0.2)
  • C — Get/Set register C (v0.2)
  • D — Get/Set register D (v0.2)
  • E — Get/Set register E (v0.2)
  • H — Get/Set register H (v0.2)
  • L — Get/Set register L (v0.2)
  • AF — Get/Set Accumulator & Status Flags (v0.2)
  • BC — Get/Set register pair BC (v0.2)
  • DE — Get/Set register pair DE (v0.2)
  • HL — Get/Set register pair HL (v0.2)
  • PC — Get/Set Program Counter (v0.2)
  • SP — Get/Set Stack Pointer (v0.2)
  • FlagZero — Get/Set Zero Flag (v0.3)
  • FlagCarry — Get/Set Carry Flag (v0.3)
  • FlagHalfCarry — Get/Set Half Carry Flag (v0.3)
  • FlagNegative — Get/Set Negative Flag (v0.3)
  • KeyCodeA — Get/Set key used for “A” button (v0.2)
  • KeyCodeB — Get/Set key used for “B” button (v0.2)
  • KeyCodeStart — Get/Set key used for “Start” button (v0.2)
  • KeyCodeSelect — Get/Set key used for “Select” button (v0.2)
  • KeyCodeUp — Get/Set key used for “Up” button (v0.2)
  • KeyCodeDown — Get/Set key used for “Down” button (v0.2)
  • KeyCodeLeft — Get/Set key used for “Left” button (v0.2)
  • KeyCodeRight — Get/Set key used for “Right” button (v0.2)

Events

  • VBL — Fires every time a Vertical Blank occurs

 

DOWNLOAD

The Otaku No Yen Gameboy emulator is totally free! The executables are free to use for personal hobby use. The only thing I ask is that you do not charge for either distributing the executables or source code, and any derivative works you give credit to the original author. That means you have to say “Thanks” to Otaku. As improvements are made to NoYen so these improvements will automatically be reflected in your product, benefiting everyone.

For any commercial or shareware package where a fee is charged you must license the NoYen ActiveX control from me.

Included in the archive is the ActiveX control, and a Microsoft Visual BASIC 6.0 project that will show the basic code needed to load a ROM image. THe file “NoYen.frm” is the one that is most interesting as it invokes the methods that actually make the emulator work.

When you open the project you may receive a message that NoYen.OCX cannot be found. You will need to add the control to the Visual BASIC project by selecting “Project.Components.Browse” and opening the NoYen.OCX file.

If you don’t have Visual BASIC you can use Delphi, C++, the Microsoft ActiveX Control Test Container that is shipped with Microsoft Developer Studio, Internet Explorer, or even Microsoft Access.

Download the current version of Otaku No Yen (v0.3 alpha)

Download a stand-alone executable version of Otaku No Yen (v0.3 alpha)

Rednex Gameboy Development System

Sunday, August 1st, 1999

nintendo_gameboy_pocket1.gifThe Rednex Gameboy Development System allows adept programmers to write software for the Nintendo Gameboy and Gameboy Colour using assembly language. The development system consists of an assembler, a multi-party linker, and a number of include files that lists registers. Hundreds of commercial Nintendo Gameboy & Gameboy Colour entertainment titles have been created with this system since it was first created.

The RGBDS (Rednex Gameboy Development System) development tools allow you to program the Nintendo Gameboy & Gameboy Colour hand held console. The package consists of an assembler, a linker, a library packager, an executable patch program, and a Bung cartridge transfer utility.

Best of all, it’s free! That’s right! Free! The executables are free to use, either for personal hobby use, or full blown commercial productions — I know of at least a dozen commercial games you can purchase that are written with RGBDS — and the source code is free to modify.

The only thing I ask is that you do not charge for either distributing the executables or source code, and any derivative works you give credit to the original authors of the tools. That means you have to say “Thanks” to the original authors SurfSmurf and Otaku.

The assembler is constantly being updated and improved. It is currently written in the ‘C’ language and makes use of Bison for parsing.

ADDITIONAL INFO

I’m experimenting with moving the RGBDS tool chain to Java. The benefit of using Java would be to enable separate CPU modules to be dynamically loaded at run-time with no recompilation of the assembler executable. A simple command-line switch could take care of it. There would also only be one version of each “executable” that would need to be distributed for all supported platforms.

The RGBFIX tool is now completely re-written in Java. As I haven’t had much opportunity to experiment with distributing a Java “executable package” on multiple platforms recently I’m just going to leave this one as a Win32 executable and the accompanying class & source files.

DOWNLOAD

RGBASM Executable (Win32/zipped) v1.11

XLINK Executable (Win32/zipped) v1.08d

XLIB Executable (Win32/zipped)

RGBFIX Executable (Win32/zipped) v1.05

RGBDS package (Win32/zipped) v1.10e (not latest version)

RGBDS source (zipped)

RGBDS Documentation (zipped)

RGBDS Documentation (on-line)