When it comes to emulation, one could certainly think that weíve explored just about every aspect of the Game Boy so far. From multiplayer over the serial port, the Game Boy Printer, the Super Game Boy, the Game Boy Color Infrared Port, Rumble Carts, to even the accelerometers in Kirbyís Tilt Ďní Tumble: there isnít much emulators canít handle. However, there will always be new territory to uncover and explore, especially for those with creative minds. In the form of an enhancement or modification, custom sprites is one such example. An emulator with custom sprites has the ability to replace a gameís native graphics with data selected by the user. To my knowledge, no one has ever implemented such a feature into a Game Boy emulator. Until now that is.

Art History 101:

The original Game Boy, Game Boy Pocket, and the Japanese-only Game Boy Light were only capable of displaying graphics using four different shades of gray (this applies only to background tiles, sprites were restricted to 3 shades with one shade reserved for transparency). Each pixel was either completely on, 2/3 on, 1/3 on, or completely off. The monochrome palette lasted until the Super Game Boy came out, allowing games to be played with 32 (sometimes garrish) colored palettes, as well as custom ones. I never owned one, but I do remember having quite a few ďPlay It LoudĒ poster sheets that came with my Game Boy games advertising the Super Game Boy. Eventually the Game Boy Color came out allowing games to be played with colored palettes as well. Still, games that were not Game Boy Color only or backwards compatible games that did not fully utilize the Game Boy Color never really achieved significant colorizations, at least nothing that made them on par with native Game Boy Color games. There is a Game Boy Colorizer ROM hacking tool that aims to help hackers convert old DMG ROMs into fully capable GBC ROMs, but from what I have heard, it can be finnicky at best.

Currently, I am working on my own Game Boy emulator that I plan to call Game Boy Enhanced. It isnít a very original or clever name, but this is my first emulator, so I can afford to be simple and straightforward. Since the project will introduce me to emulator programming, I do want it to be as accurate as I can make it, however, I donít shy away from graphical enhancements when it comes to emulation. This is the future after all, so we might as well be able to make things shiny if we want to. At first, I was planning to have the usual assortment of enhancements that nearly every other emulator has: 2x-3x-4x nearest neighbor scaling, various scaling filters (the HQ family, SuperEagle, 2XSai), save states, and maybe built-in sound-ripping. However, one of the regulars on the Dolphin emulator forums suggested that it would be nice to allow custom sprites as a feature, and this got me thinking.

Dolphin is a pretty advanced emulator; it allows users to dump textures for games, edit them, and then load them into the game. This activity is quite popular in sprucing up old N64 games in the N64 emulation community, and the practice has extended to Gamecube and Wii games now too. I figured it would be possible to do the same with Game Boy Enhanced (GBE for short). Although there are a number of more pressing things to program for GBE, I decided to see if I could implement it anyway. The general theory is similar to how Dolphin operates. Based on the spriteís raw pixel data, GBE generates a unique hash to represent it. GBE stores every hash in a list. When drawing a sprite, GBE compares the current hash against the list. If the hash is in the list, rather than drawing the pixel data obtained from Video RAM (VRAM), GBE will load the custom sprite data from a file. I will go in-depth more about that, but first GBE needs to allow users to get the sprites to modify in the first place.

Taking a dump:

GBE needs to dump the sprites as the game generates them. The general idea is to get the hash and compare it to what we already have in the list. If the hash is already in the list, thereís no need to dump the sprite again, so GBE ignores it. When itís a brand new hash, GBE pulls the pixel data from VRAM and then saves that data to a BMP. The trick here is to make sure that the file is going to be as unique as the sprite itself, so GBE names it after the hash. This will help when loading the modified sprite as well. Since this work was fairly experimental, the hashes were simply 128-bit numbers converted to hexadecimal. Thatís enough to create a unique hash for every possible 8◊8 sprite possible as it takes 32 bytes (128-bits) for the Game Boy to represent an 8◊8 sprite. 8◊16 sprites have yet to be implemented in GBE, so Iím not worrying about that just yet.

Now here comes the fun part: editing tiny 8◊8 bitmaps. Obviously there are a couple of challenges. The first is in determining what youíre looking at exactly. If you donít have a discerning eye, it can be quite difficult to see the sprites youíre after. Of course enlarging the dumps in an image viewer helps, but most larger sprites are a combination of the 8◊8 sprites. Visualizing which ones match together is not unlike a puzzle game in and of itself. The next thing to consider is how you want to edit these sprites. Since whatever data entered here supercedes the Game Boyís color choice, custom sprites are not concerned with things like the palette. The colors in the BMP file are the final colors that will be output to the screen. If the custom sprites decide not to add color, they need only determine what shade of gray each pixel should be, irrespective of any programmed palette.

It takes a keen eye to edit 8◊8 sprites like this. Here we have Mario, obviously.

Once the sprites have been dumped and edited, the next step is to load them back into the emulator. Itís pretty much the reverse of what GBE does when dumping them. Whenever new sprite data is generated, GBE generates a hash for that and tries to load a BMP file named after that hash. Once the BMP file is loaded, it gets stored into a cache. GBE then updates a list of which hashes have already been used to get custom sprite data. The list ensures that the same hash isnít used again to load the BMP file since the cache already contains the custom sprite data. Whenever GBE draws a sprite whose hash matches an entry on the list, GBE draws the custom sprite data pulled from the BMP instead of VRAM. With this, GBE effectively replaces the original pixel data without affecting the rest of the game.

The whole process of custom sprites:

Look at all the colors

The custom pixel data can be anything we choose; it can even exceed the color limits of the Game Boy Color. The limitations enforced on the original system need not apply to GBE, since the emulator has the final say over graphical output, not the original hardware. Itís easy to have a sprite use 10, 20, or even 30 different colors. Although it takes a bit of creativity, thereís nothing stopping sprites from taking on a 16-bit look and feel. The only issue is the screen size (160 x 144 pixels) which makes for relatively small sprites.

However, the possibilities donít just end there. We can completely mod Game Boy games with this method to create custom pixel data for anything. Background tiles are stored and processed in the almost exact same manner as sprites. The method of generating hashes for background tiles and replacing background tiles with custom pixel data is identical, so it wasnít hard to program GBE to manipulate the background as well. Now itís possible to fully colorize original DMG games in a reliable manner. And yet thereís more; consider that this isnít just a method a colorizing sprites, itís a way to make the sprites look like whatever one wants them to look like. How about Tetris with Poke Balls? Super Daisy Land wherein Daisy saves Mario? Master Chief as Mega Man? Anyone with enough time and effort could alter or create just about anything.

If GBE ever catches on, I would hope this to be a defining feature, as it could prove popular within the ROM hacking community (even though, technically, the ROM data is not touched with this process). GBE isnít quite ready for its public release as an open-source project however, as Iím reworking LCD emulation and increasing game compatibility at this moment, and most of the custom sprite code needs to be rewritten as well. It should up on Google Code within a month however, so anyone wanting to play around with this neat feature can have a go.

Other emulators are quite capable of adding this functionality themselves if so desired. The method described here is not specific to Game Boy Enhanced at all nor the original Game Boy games it emulates. GBC, GBA, NES, SNES, Genesis: basically any system that uses sprites can also use custom sprite data. As long as the emulator has some way to view the sprite data (which an emulator needs to, if it ever wants to draw that data onscreen), it can generate a hash and replace the necessary data. Thatís not to say it would be easy to implement in every emulator, only that such possibilities do exist. Personally, I think this is an exciting opportunity for people and communities that want to see new life breathed into games that are now getting to be decades old. It could add interesting twists to games that weíve already been playing for years. I very much look forward to seeing how people apply this technique in the future.

A video of custom sprites in action can be found on my YouTube channel. Itís only Tetris (and not my best game, mind you), and not everything is fully colorized. This is just a proof-of-concept demonstration until the underlying implementation is perfected. Still, it works, and thatís half the battle :)

BGB is a GameBoy, GameBoy Color, and Super Gameboy emulator/debugger which runs on Windows. Program features accurate emulation of the hardware, powerful debugger, SGB multiplayer with up to 4 gamepads and TCP/IP game link support, graphics with GDI, DirectDraw, Direct3D, OpenGL output, and HQ2X, Scale2x, scanlines, blocky filter, accurate/high quality sound emulation, bandlimited synthesis, GameGenie and GameShark cheat, and more.

Here's changelog since v1.4.1:

1.4.2 - fixed a large number of small problems and bugs including: direct3d now works on secondary monitors, some accuracy fixes (including sagaia problem), added some features including: mono sound output and an exception break if making bad accesses during an OAM DMA transfer. tested to work on windows 8.

1.4.3 - fixed: loading/saving save files for roms with unicode filenames was broken if a save dir is not set. this was broken in 1.4.2.

Check out official website for further information and latest version of emulator.

Gearboy is a Nintendo Game Boy / Game Boy Color emulator written in C++.
The emulator is focused on readability of source code, but nevertheless it has good compatibility.
A lot of effort has gone into this in order to follow OOP and keep it as simple as possible.

GameBoy Online is a Game Boy and GameBoy Color emulator written in Javascript. It strives to be efficient and try to have a perfect compatibility. Currently the execution speed is not optimal even on browsers. For example on Chrome, which is nevertheless deemed to run Javascript faster on a PC running Windows 7 64-bit version with a double heart 2 CPUs at 2.2 GHz, games run at normal speed but almost skipping some frames.

The sound production is still experimental and rather poor quality. The video portion is by HTML5 or by creating images with BMP string URI. State backups are implemented using the object window.localStorage and are serialized / deserialized JSON. Ditto for backup SRAM.

GameBoy Online is a Game Boy and GameBoy Color emulator written in Javascript. It strives to be efficient and try to have a perfect compatibility. Currently the execution speed is not optimal even on browsers. For example on Chrome, which is nevertheless deemed to run Javascript faster on a PC running Windows 7 64-bit version with a double heart 2 CPUs at 2.2 GHz, games run at normal speed but almost skipping some frames.

The sound production is still experimental and rather poor quality. The video portion is by HTML5 or by creating images with BMP string URI. State backups are implemented using the object window.localStorage and are serialized / deserialized JSON. Ditto for backup SRAM.

Recent Changes:
- Worked around a problem of incorrect timing of setInterval in Google Chrome JavaScript engine V8.
- Update the algorithm automatically jump frame.
- Remove mozBeforePaint as Mozilla miscalculates the maximum rate of frames per second supported on newer operating systems.
- Changing the timing of the internal loop of the interpreter to 17ms 16ms.
- Added library support swfobject 2.2 for Internet Explorer.
- Update the default color of the background when it is cut and the boot ROM is disabled and the emulator is not in CGB.
- Remove unused characters in the code.
- Fixed a regression in the opcode ADC A, A '.
- Small update of the HALT opcode.
- Ensuring that the way the special case of the HDMA HALT is taken into account instead of the normal path when necessary.

gbpablog v0.9 is released. gbpablogis a Game Boy Emulator written in C++ with wxwidgets and sdl. Cross-platform: Windows, Linux and MAC. It's only for learning purposes.

gbpablog v0.9 Changelog:
- Added sound (*)
- Added support for savestates
- Improved the way the frames are drawn
- Fixed bug in MBC
- Implemented serial port interruption (needed by some games)
- The SDL library is no more needed to be installed in MacOSX, is included in the app bundle
- Improved accuracy
- Improved compatibility

* Note: The sound in ubuntu with pulseaudio is not good enough:
- Choppy sound with the package libsdl1.2debian-pulseaudio.
- Delayed sound with the package libsdl1.2debian-alsa but with some games can be acceptable.
- The emulator hangs with the package libsdl1.2debian-esd.

SharpBoy is a new Nintendo Game Boy and Game Boy Color emulator for windows by xdaniel written in C# using SlimDX. SlimDX End User Runtimes (click "Install .NET 4.0") required, latest .NET Framework 4 and DirectX recommended!.

Quote:

v0.2 (April 03rd 2011)
- GBC DMA emulation fixed, transfer length wasnīt being calculated correctly; fixes incorrect and missing graphics in some games
- LCDC emulation improved, fixes flickering and slowdown in certain games and demos
- MBC5 ROM bank select fixed; many more Game Boy Color games now start and/or run further
- Timing of screen drawing improved, which results in less graphical glitches with ex. flickering sprites for pseudo-transparency
- Temporary hack added to allow the Zelda: Oracle games to boot correctly, coupled with the above fixes they now go in-game
- DMG and CGB bootstrap ROMs now supported; have to be named DMG_ROM.bin and CGB_ROM.bin and enabled via the menu
- Manual system type selection implemented, emulator can now be forced to run in GB or GBC mode (not complete yet)
- Controls can be changed via the GUI
- Other minor GUI and usability improvements (ex. path to last ROM image run is saved to config.xml)

Notes and bugs:
Emulation is still incomplete and has bugs, especially with GBC games
No sound, serial link, SGB, etc. for now
No documentation yet either; controls cannot be changed from within the program (edit config.xml manually after first run)
GUI has some quirks (ex. window resizing), FPS limit and counter arenīt accurate
Debugger slows down emulation speed considerably, needs some serious optimization
Probably more...
...and despite this, thereīs a bunch of playable games:

Quote:
zBoy v0.12 [28 Feb 2011]
- Added the "--EPXSCALE" command-line parameter, to scale the video screen using the EPX algorithm (instead of the default nearest-neighbour scaling),
- Added the "--EPXSCALE3" command-line parameter, to scale the video screen using a modified version of the EPX algorithm (triple scaling),
- Added the "--EAGLESCALE" command-line parameter, to scale the video screen using the EAGLE algorithm,
- Fixed a bug in the hiscore saving module, that could lead sometimes the emulator to crash,
- Added support for saving hiscores in following games: Ms. Pac-Man, Tetris, Asteroids, Tetris Attack, Galaga & Galaxian, BattleCity and Dig Dug,
- The LY (LCD) counter is incremented even when the LCD is disabled (otherwise Baseball donīt start).

gbpablog is a new, cross-platform Nintendo Game Boy emulator available for Windows, Linux and Mac Os.

Quote:
gbpablog 0.8 (2011-02-26)

Added the possibility to change the keys on the keyboard
Added support for drag & drop roms
Added load of roms from command line
Added a menu list of recent roms
Added support for the roms with battery to save the state to a file and restore it in a later execution
Fixed bug with interruptions that prevented to start some games or produced graphic errors in others
Other minor changes

This is just a bug fix release. Affecting games are Gameboy Camera (hung up when loading saved data extracted from a real cartridge) and Super Mario Land 3: Wario Land (crashed when meeting the last boss).

Many thanks to Toshi for providing the good ROM dumps and the information about MMM01 to me. MMM01 games, Momotarou Collection 2 and Taito Variety Pack, are now playable. You may need to update to the good ROM dumps in order to play them. Cheat is now work again. This bug was introduced since V1.54 (a long long time ago).