What's new

GB Enhanced

Shonumi

EmuTalk Member
Project Page: code.google.com/p/gb-enhanced/
Project Name: GB Enhanced

Hello everyone. For the past year or so, I've been working on my very first emulator. I've been programming for years and have been involved with emulators as an end-user for over a decade now, but I've never gotten into programming emulators until recently. Hopefully GB Enhanced will serve as a gateway to other handhelds I have my eyes on (the GBA and DS primarily).

The goal of GB Enhanced is to provide a highly portable emulator (using only C++ and SDL) while including as many optional enhancements as possible. Anyway, yes, GB Enhanced is yet another Game Boy emulator, but we all have to start somewhere right?

GB Enhanced does offer something new to the emulation scene however: custom graphics. GB Enhanced has the ability to dump or extract sprites and backgrounds, let the user edit them, and then dynamically inject those graphics back into the game. This allows for users to modify the game's look and feel without ROM hacking. Anything that can be seen in the game can be changed (with some limitations mind you). GB Enhanced even lets players colorize old monochrome games.

Screenshot of Kirby's Dream Land with custom graphics (also in attachments):
i1.minus.com/jZgBmfdw9IoeE.png

Video of the game with custom graphics in action (mind the poor audio quality):

GB Enhanced will play most games without any noticeable issues, but there are still things to work out and many more features I would like to add (tons of scaling filters). At any rate, I'm releasing an initial 1.0 version since there's been a lot of work done so far. Not expecting anyone to start raving about it and using it as their default GB emulator, but I do appreciate testers and bug reporters (especially with the custom graphics).

Other misc. notes, it supports 360 controllers out of the box. No GBC support yet (it's not done in master, but like 95% done in a different branch). No save states either (it's coming :p). I appreciate any and all feedback.

===========================================================================

UPDATE - 5/19/2014

"HD" custom graphics are ready for user testing! This only works with DMG games or GBC games that are running in DMG mode. GBC support is planned in the future, but this is an important first step that needs to be sorted out for bugs before merging into master.

DOWNLOAD : GB Enhanced - custom-gfx-hd

Tutorial

1) To make custom graphics, extract the ZIP archive and edit the gbe.ini file. Change this line from 0 to 1. Drag and drop your Game Boy ROM in Windows Explorer over gbe.exe. The emulator will now run in dumping mode to extract the graphics.

2) Sprites are automatically dumped into the Dump\Sprites folder as the game generates them. Background tiles must be dumped manually via the mouse. Hover your mouse over the screen. GBE will highlight the background tile that it will dump. Any tiles that are the same as the one under the mouse cursor will be highlighted as well. This is to give users more control over which graphics they can edit and have an idea of where each tile is used in the game. Dumping hundreds of background tiles automatically is not very user friendly (since you largely cannot tell what goes where). Left-Click with the mouse to actually dump the tile. Background tiles will be dumped to the Dump\BG folder.

Screenshot - Dumping BG Tiles

3) Once you have dumped the sprites and background tiles, you can edit them. Open the images in your editor of choice and make your changes. Important: GBE only supports loading 24-Bit BMPs and 24-bit PNGs Make sure you remove/do not add an alpha channel to these images. I highly recommend GIMP or anything but MS Paint. When making "HD" graphics, GBE supports scales of 2x to 4x of the image's original size. 1x custom sprites are of course supported as well. Please note, when making "HD" graphics, all of the edited images should use the same scale (e.g. mixing 2x edits with 3x edits is a no-no).

Screenshot - Preparing to edit the dumped graphics

4) Move the edited images to the corresponding Load\Sprites or Load\BG.

5) To load the custom graphics, first change this line in gbe.ini back to 0. Now change this line to 1 to load custom graphics.

6) If you are using "HD" custom graphics, change this line in gbe.ini to reflect the scale factor used (2x, 3x, 4x).

7) If you are using PNGs for the custom graphics, change this line in gbe.ini to 1. Otherwise, leave it on 0. Note, GBE does not support mixing and matching the file types it loads. It will only load all PNG files, or all BMP files.

8) In Windows Explorer, drag and drop the Game Boy ROM over gbe.exe. The game should now start with your custom graphics! Enjoy your work!

Screenshot - Tetris ... with Pokeballs

===========================================================================
 

Attachments

  • GBE_4.png
    GBE_4.png
    5.2 KB · Views: 5,784
Last edited:
OP
S

Shonumi

EmuTalk Member
Haha, actually I was wondering who would be the first to ask that :p

Nope, no joke, totally legit. April 1st just happens to be start of the year's second quarter, and I figured I had enough code that warranted an initial release. It's gone from idle talk, to working theory, and finally application. Works on a similar level to custom textures (popularized in N64 emulators) except GB Enhanced doesn't yet support HD custom graphics. There's no technical reason, I just need to think of a sane way to implement it. I wrote this article last year for anyone interested:

CLICKY

There's still some work to be done: more accurate APU emulation, misc. graphical errors, and again a plethora of further enhancements (possible widescreen hack? I've got the theory set in my head...) I've always appreciated the efforts people took to develop emulators, so hopefully I can contribute back to the community in some way. Let me know if there's anything specific you'd like to see in GB Enhanced too; that's how custom graphics became a reality ;)
 
Last edited by a moderator:
F

Fanatic 64

Guest
Let's start with the Oracle games instead!

And we need something like this for SNES (I had thought about it a long time ago, but someone told me that what this guy is doing was next to impossible...).
 
OP
S

Shonumi

EmuTalk Member
Nothing is impossible, just really, really hard at times ;) It might be impractical for other emulators depending on their setup, but in theory, as long as you can accurately hash the BG and Sprite tiles, there's nothing specific about custom graphics (maybe I should start calling them Custom Tiles since that's really more accurate?) to the Game Boy or GB Enhanced.

One of the things I did not discuss in my blog/article about Custom Tiles (because I hadn't encountered this issue really back then) is that there are two potential bottlenecks that could make it really demanding on some computers. The first is the amount and frequency of hashing an emulator needs to do. If VRAM is frequently updated, the hashes need to reflect those changes. There's also I/O performance from the disk to consider, especially when a lot of new graphics have to be loaded all at once. For the Game Boy, doing 40 sprites and 1024 background tiles isn't too bad, but there is the potential to encounter performance issues on more "advanced" systems like the SNES, Genesis, GBA, etc. It depends on how smart the emulator is about hashing the data and when we load. One idea I'm working with is to include a "manifest" that defines all the hashes that should be looked at (for when people start making their own Custom Tile packages) so GB Enhanced automatically ignores anything but that list. Another idea is to lower the accuracy of the hash, but that could give you odd results. I expect all of this to be more relevant when enter GBA territory later this year, but for now GB Enhanced handles Custom Tiles pretty well without hammering your CPU or HDD/SDD (I think :p).

As for HD custom graphics, it's in the pipeline once GBC support comes. The only thing really stopping GBC support from hitting master is sprite/background priorities. I *think* I have it nailed down, but Perfect Dark keeps doing weird things. Hopefully I can get some work done over the weekend and make the merge. Currently GB Enhanced's GBC functionality has no dumping/loading capabilities as far as custom graphics go. I was focused mainly on getting games to run first. Colored palettes need to be taken into account for Custom Tile but that's basically just making the hashes fancier and updating them more often. So eventually, HD Oracle of Seasons is definitely a possibility. It's just a matter of time and effort at this point, since most of the groundwork is actually pretty much done.
 
F

Fanatic 64

Guest
I was thinking, someone should add a Game Boy Textures subforum to the High Resolution Textures forum. And while they're at it, rename Saturn Textures to Dreamcast Textures, since the only thread there is about how to retexture Dreamcast games anyway.

And I'm indeed very excited about the idea of playing Game Boy games in full color and HD! Hopefully we can get some texture/sprite artists interested in this too!

And NES, you can convert BMP to PNG with Paint. Open the file, choose Save As, and select PNG file type.
 

NES_player4LIFE

Texture Pack Invader
Moderator
I was thinking, someone should add a Game Boy Textures subforum to the High Resolution Textures forum. And while they're at it, rename Saturn Textures to Dreamcast Textures, since the only thread there is about how to retexture Dreamcast games anyway.
Good idea.
And I'm indeed very excited about the idea of playing Game Boy games in full color and HD! Hopefully we can get some texture/sprite artists interested in this too!
It make a person all tingly inside, doesn't it?

And NES, you can convert BMP to PNG with Paint. Open the file, choose Save As, and select PNG file type.
Yes, I'm aware of that but have you ever tried repeating a task like that 500+ times?
I would much rather have a line of code edited and have the program spit out the results.
 
OP
S

Shonumi

EmuTalk Member
Yeah, nothing stops GBE from natively opening .PNG files. SDL_image can do that just fine and it would literally take me 10 minutes to set everything up code-wise. I have no objections to adding more dependencies to the project, as long as they're SDL_* stuff. When I start emulating the Serial Transfer and the IR port, I'm going to need to use SDL_net. For the sake of simplicity, I'm thinking of only supporting .PNG and .BMP though (why use .TIF or .JPG anyway?). Though if people are vocal enough, it's not that hard to change.

Again, development on HD stuff has to wait on GBC support (which is this close to being done). I fixed a number of bugs in the Oracle Zelda games today. Once I test more games (Lufia won't boot, and that's troublesome) and fix sprite/background priorities (it's almost there, but not quite) GBC support can be merged, and I can work on implementing Custom Tiles for GBC games, then HD Custom Tiles for all games :) It shouldn't take me that long (by May at the latest, likely sooner).

If you're interested, I've opened up two issues on the project page relating to Custom Tiles:

http://code.google.com/p/gb-enhanced/issues/detail?id=6
http://code.google.com/p/gb-enhanced/issues/detail?id=7
 
Last edited:
F

Fanatic 64

Guest
I'm going to go ahead and ask you not to implement JPEG. Why open the door for lossy sprite packs when PNG works just fine?

And it's very good to see the emulator is progressing. Specially if GBC and HD sprites support is coming in just a month. I'm guessing save states support will come after that?

Anyway, keep up the great work!
 
OP
S

Shonumi

EmuTalk Member
Yeah, I'm holding off of implementing save states specifically because the emulator is in flux at the moment regarding all the information a proper save state needs to take into account. I'd like to make sure that save states won't change that much to reduce save state incompatibility down the road. Anyway, they should be coming soon.
 
OP
S

Shonumi

EmuTalk Member
Apologies for the lack of updates. Been playing games instead of working on stuff :p

Anyway, the HD graphics is almost complete. In DMG games (or in DMG mode at least) the HD functionality works flawlessly, as far as I can tell. I am not an artist, so I haven't had the time to rework something like Kirby's Dream Land to show you all. I will, however, compile the latest revision of GBE so that everyone can test this new feature. I would like people to test it, give it a shot, and report anything that looks like a bug, a missing feature, or anything of that nature. There are still somethings to update in the code (PNG loading, mainly) but some time this weekend, a build will be available for all. I'll also post detailed instructions (with pretty pictures) as a tutorial.

Please note that HD graphics currently only applies to DMG games (no GBC support yet :() The reason for this is due to the way GBE calculates the hashes for custom graphics and the way GBC software takes advantage of the color palettes. On a technical level, whenever the game makes things "fade in" or "fade out", it does this simply by gradually changing the palettes of the on-screen graphics. GBE uses the palettes in calculating hashes, so when fading in/out, the "same" sprite or background tile has hundreds of lighter and darker variations. GBE technically sees them all as "different". To give you an idea of how troublesome this is, Mega Man Xtreme dumps some 1000+ sprites just getting to the start screen. Obviously no one wants to edit all of those individually, but I'm working on a solution in the meantime. It's actually an interesting problem, and hopefully I've come up with a novel idea to counter it.

Anyway, expect to see stuff here Saturday-ish.
 
OP
S

Shonumi

EmuTalk Member
As I said, I have finished work on HD custom graphics for DMG GB games. I would like for people to test it and provide any and all feedback :)

DOWNLOAD : GB Enhanced - custom-gfx-hd

Tutorial

1) To make custom graphics, extract the ZIP archive and edit the gbe.ini file. Change this line from 0 to 1. Drag and drop your Game Boy ROM in Windows Explorer over gbe.exe. The emulator will now run in dumping mode to extract the graphics.

2) Sprites are automatically dumped into the Dump\Sprites folder as the game generates them. Background tiles must be dumped manually via the mouse. Hover your mouse over the screen. GBE will highlight the background tile that it will dump. Any tiles that are the same as the one under the mouse cursor will be highlighted as well. This is to give users more control over which graphics they can edit and have an idea of where each tile is used in the game. Dumping hundreds of background tiles automatically is not very user friendly (since you largely cannot tell what goes where). Left-Click with the mouse to actually dump the tile. Background tiles will be dumped to the Dump\BG folder.

Screenshot - Dumping BG Tiles

3) Once you have dumped the sprites and background tiles, you can edit them. Open the images in your editor of choice and make your changes. Important: GBE only supports loading 24-Bit BMPs and 24-bit PNGs Make sure you remove/do not add an alpha channel to these images. I highly recommend GIMP or anything but MS Paint. When making "HD" graphics, GBE supports scales of 2x to 4x of the image's original size. 1x custom sprites are of course supported as well. Please note, when making "HD" graphics, all of the edited images should use the same scale (e.g. mixing 2x edits with 3x edits is a no-no).

Screenshot - Preparing to edit the dumped graphics

4) Move the edited images to the corresponding Load\Sprites or Load\BG.

5) To load the custom graphics, first change this line in gbe.ini back to 0. Now change this line to 1 to load custom graphics.

6) If you are using "HD" custom graphics, change this line in gbe.ini to reflect the scale factor used (2x, 3x, 4x).

7) If you are using PNGs for the custom graphics, change this line in gbe.ini to 1. Otherwise, leave it on 0. Note, GBE does not support mixing and matching the file types it loads. It will only load all PNG files, or all BMP files.

8) In Windows Explorer, drag and drop the Game Boy ROM over gbe.exe. The game should now start with your custom graphics! Enjoy your work!

Screenshot - Tetris ... with Pokeballs

Again, please report any issues you encounter. And if there are any Linux users, I'll guide them through the process of setting up GBE upon request (the above is focused on Windows users, even though I'm not one myself). Thanks for any one willing to take the time to test :D
 
Last edited:

NES_player4LIFE

Texture Pack Invader
Moderator
Great news, texture pack here we come!
Please update your first post to contain this information.

I have also archived the latest release Here.

Bug report.
Win 7 64bit
System error
{The program can't start missing libstdc++6.dll}
 
Last edited:
OP
S

Shonumi

EmuTalk Member
Oh man, I thought I fixed that error :( Why does MinGW insist on using shared libs anyway for libgcc and libstdc++?

Will update the first post and the downloadable build later tonight.
 
OP
S

Shonumi

EmuTalk Member
Excuse the double post. The missing .dll file issue should be fixed. See the first post for a new build.
 
OP
S

Shonumi

EmuTalk Member
That option is for loading PNGs. During the editing process, you have to convert them to PNGs. Unfortunately, saving images to PNG is non-trivial and involves either relying on yet more external dependencies (something other than SDL, SDL_image, SDL_net, or SDL_ttf, which is the most I would like to use) or implementing my own exporter (which isn't as hard as it sounds, just not as high a priority as other features). I see the second option as the most likely even though it plays into the not-invented-here-syndrome, but I honestly hate the amount of libraries it takes to build some emulators, and I would avoid that at all costs.

It will come eventually, but that's a bit down the road. I'm more concerned getting the functionality right this early in GBE's development. I'll make an issue report though for dumping graphics in PNG :)

EDIT: Here is the issue report: https://code.google.com/p/gb-enhanced/issues/detail?id=9

The old issue, Issue 6 was specifically for loading them as .PNGs rather than exporting. Implementing this seems simple enough. Just give it some time ;)
 
Last edited:

chiburunga

New member
I was just messing around... (the glitch was my fault when i selected the tiles)
hylaHhz.png


I'm not allowed to post images since i'm new on the forum so remove the spaces!
 
Last edited by a moderator:

Top