This brings back some of the nasty threading issues squashed a few days ago. Hopefully when SDL is no longer used for video in the Qt port, this will go away. Fwiw, the issue seems particular to the Advance Wars intro. Probably happens in other games, but I've yet to see it (it's an X11 threading issue, maybe doesn't happen on Windows/OS X?)
Also to remember to check out the emutalk forums for even more News posts and downloads!
Emulating Game Boy Games With Custom/Colorized Sprites
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.
Here is list of latest changes:
+ fixes window glitches with many games
+ fixed a bug resetting DIV register
+ sound filters adjusted for maximum resemblance to dmg
+ increased ghosting effect
+ improved MBC3 overall performance
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.
fixed time keeping problems (hiccups) on windows 7. fixed inaccuracy in mid-scanline change of LCDC bits (gejmboj). fixed a condition that would cause inaccurate timing of interrupt (final fantasy adventure). added "gameboy or GBC" system mode setting. added "blurry" doubler. fixed searching any opcode with a space giving "IO error 105". added field in IO map to view/edit the "low" bank of multicart emulation. fixed "remotejoy" bring broken. screen window can now init on secondary monitor. fixed failure of GUI elements initing on secondary monitor. fixed wrong field in wav file written.
Check out official website for further information and latest version of emulator.
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.
+ greatly improved game link accuracy, most games should now work perfectly.
+ added optional HQ2X and Scale2x graphics filters
+ various accuracy improvements including sound registers, joypad timing, and lcd/interrupt timing
+ Performance/efficiency improvements including waitloop detection and more efficient high quality sound rendering and others
+ Major debugger improvements: Supports SYM files containing debug symbols. "on jump" access breakpoints. immideate entry of data into assembler, data, and stack viewer. improved assembler flexibility. Multiline code/data entry window. Keyboard shortcut for navigation to previous/next breakpoint, label etc. Live update memory mode. edit IO map registers. Fixed causes of accidental running while debugging.
+ Sound quality improvements: CH3 and CH4 are now bandlimited in high quality mode. Improved DC offset accuracy. fixed sound timing inaccuracies.
+ Improved WAV writer + screenshot recording. Fixed audio/video desync problems. Exported files are now better named.
+ fixed windows 98 compatibility problem. eliminated requirement for DX9. improved wine support.
+ New truecolor/hi-res icon.
+ Many small bug fixes and improvements.
Check out official website for further information and latest version of emulator.
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:
- Emulating an undocumented behavior: HDMA becomes GDMA when LCD is disabled. This fixes Worms Armageddon. Manual disassembly + Firebug = :3
- Optimized the DMA code by inlining whole tile block loads. Kirby Tilt N Tumble can now boot, I will get the special gyro implementation landed soon, since it is running as an MBC type 5 cartridge for now.
- Updated Updating the midscanline working pixel determinism.
- Updated LYthe LY register reset write case handling.
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 good but still new Nintendo Game Boy and Game Boy Color emulator for windows by the talented Zelda hacker xdaniel written in C# using OpenTK.
Here's the changelog:
v0.3 (May 11th 2011) • Switched rendering from using SlimDX to OpenTK, SlimDX Runtimes no longer needed; video filtering now selectable
• GBC DMA copy operations improved, fixes certain DMA transfers spanning different areas of memory
• Improved support for "undocumented" I/O registers, Demotronic Demo no longer detects the emulator and now runs with some glitches
• Above change, coupled with improved graphics emulation, also fixed colorization of monochrome games via the CGB bootstrap ROM
• Preliminary MBC emulation for Pocket Camera / Game Boy Camera; no actual camera support
• Frame skipping and speed-up functionality implemented
• ROMs can now be loaded from ZIP archives (using the DotNetZip library); recent ROM history added to menu
A new version of the Game Boy emulator BGB has been released.
Quote:
v1.3.2
more accurate SGB color scheme. improved detection of non-working vsync.
fixed: bootroms don´t load if read only.
fixed: "load rom dialog on startup" not working.
fixed: "game controller works only if focus" not working.
fixed: setting borderless window, and switching to fullscreen, if using directdraw, the "window" can still move, and cause graphical glitches and crash.
fixed: GBC accurate initial WRAM values as left by bootrom (fixes the menu in baby felix - halloween).
fixed: a sprite on X = 0 uses more time in mode 3, too.
fixed: inconsistent timing if resetting in the debugger.
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)
v0.1a (March 30th 2011)
- Bugfix release, fixed possible crashes at startup
SharpBoy is a new Nintendo Game Boy and Game Boy Color emulator for windows by xdaniel written in C# using SlimDX. Download SharpBoy.
Quote:
Nintendo Game Boy Emulator in C# using SlimDX, written in 2011 by xdaniel
Downloads: SharpBoy v0.1 (32-bit binary)
Default controls:
B: A
A: S
Start: Return
Select: Space
D-Pad: Cursor keys
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:
A new version of the Game Boy emulator zBoy has been released.
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
--scale(Default=4.0)
Multiplier applied to the display output dimensions.
--width
Set the display output dimensions directly
--height
Set the display output dimensions directly
Features
- MBC1 emulation
- Sound
- OpenGL hq4x scaling
Known Issues
- The emulator crashes on some games due to incorrect z80
emulation.
Missing
- MBC2/3/4 emulation
- Saved games
- Serial I/O
One of the best GameBoy/GameBoy Color emulators has been updated. Changes:
- added direct3D and OpenGL output, giving accelerated graphics on windows vista/7. greatly improved emulation accuracy based on lots of test roms/research, also fixing a number of remaining rom compatibility problems. added VBA compatible RTC loading/saving (in the .sav file). added support for the GBC bootrom. fixed lots of bugs. improved debugger functionality. redone cheat searcher. various performance improvements. various gameplay experience related improvements.
The kigb.exe in the previous zip contains debug code. It won't load the save state files created by previous releases. Please re-download the new zip file. Sorry.
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).
Fixed bug in graphics introduced in 1.1, affecting legend of zelda oracle of ages/seasons, and alfred chicken. Added separate settings for DMG and GBC border bitmaps. various fixes.
- New Features:
* Support GB boot ROM (not included)
- Changes:
* In the menu File->Emulation->Simulate startup is replaced by
File->Emulation->Boot ROM. Boot ROM can be emulated and simulated for
GB and GBC mode, respectively.
* [Interal change] Source is ported from C to C++.
- Bugs Fixed:
* Hyper Lode Runner no longer hung.
* Warlocked no longer hung.
* Colors in Vertical Mess Demo were incorrect. Fixed.
* Graphics gliches appeared when showing the Gin & Tonic Trick in Mental
Respirator. Fixed.
* Graphics in Versatility should be corrupted as in the real GB. Fixed.
* When showing the intro video in F-1 Racing Championship, the top few
lines should sometimes corrupted as in the real GBC. Fixed.
* Fixed a crash bug when changing palettes with no ROM loaded in WinXP.
fixed problem with saving color schemes. show ram values in cheat searcher. analog joystick can be used with mbc7. cpu registers can be changed in debugger. various fixes.