Changing the background/empty color

TerraEsperZ
Junior Member
Posts: 8
Joined: Wed Oct 08, 2008 11:08 pm

Changing the background/empty color

Post by TerraEsperZ »

Hi everyone, and thanks for giving us the opportunity to make suggestion for VBA-M, an already great emulator [img]<fileStore.core_Emoticons>/emoticons/smile.png[/img]/emoticons/smile@2x.png 2x" width="20" height="20" />.

 

One of my hobbies is making screenshot maps of console games, a process which usually requires taking a lot of screen captures of a level, usually several times over to capture different parts like the foreground, the background, the sprites, etc.

 

One of the biggest problem I've encountered while mapping is that, when removing a layer like, say, the background one, it is often replaced with the color black (RGB 0,0,0) (but not always, since some games seem to use their own colors for a sort of blue-screen effect). Anyway, the problem is that black is a color often used both in sprites and in some games' actual level graphics. It therefore becomes very hard to isolate a game's specific layer; if removing the background left a unique, user-defined color in its place, you could easily remove only that color and be left with clean screenshots that could then be assembled and pasted over a similar collage of the background.

 

Me and a few mapping friends have been lucky to see similar options included in other emulators (specifically Gens and FCEUX) and I thus humbly suggest a similar option if it is at all feasible by VBA-M's coders. It wouldn't even need to be fancy; both of my example simply read a user-defined RGB value in the emulator's config file.

 

Anyway, I don't want to sound like I'm demanding anything. If you ever consider such a thing, I and others would be very grateful. Thanks for reading [img]<fileStore.core_Emoticons>/emoticons/smile.png[/img]/emoticons/smile@2x.png 2x" width="20" height="20" />.

spacy51
Senior Member
Posts: 371
Joined: Tue Mar 18, 2008 4:59 pm

Changing the background/empty color

Post by spacy51 »

I might have a look at that.

 

 

Do you have a website where you upload your creations? I'd like to have a look at them,

TerraEsperZ
Junior Member
Posts: 8
Joined: Wed Oct 08, 2008 11:08 pm

Changing the background/empty color

Post by TerraEsperZ »

What (few) games I've finished mapping are posted at www.VGMaps.com. I've never really thought about making a site of my own, since I suck at site design and probably would suck at maintaining it too. I also start mapping way more game than I ever finish, mostly because I tend to lose interest along the way, but also because sometimes it's just too difficult or time-consuming.

 

I really don't want to brag, but if you're interested, here are the game I've fully mapped:

 

-Game Boy: Nemesis, Gradius-The Interstellar Assault, Mega Man IV, Mega Man V, The Legend Of Zelda-Oracle Of Seasons

 

-Game Boy Advance: NiGHTS Into Dreams-Score Attack

 

-NES: Battletoads & Double Dragon, Gimmick!, Gradius 2, Maniac Mansion (Famicom), The Goonies 2, Treasure Master, Ufouria

 

-Genesis: Castlevania Bloodlines

 

-PC: Legend Of Kyrandia, Hand Of Fate, Prince Of Persia, Prince Of Persia 2

 

I've started twice as many as that, but most of it has been abandoned or put on hold indefinitely.

 

One game I was eager to finish mapping was Metroid Fusion, but that "black-on-black" problem just made it too long and hard to map even a single room, so I eventually gave up in the hopes of going back to it later.

 

Of course, two other people finished it in the meantime, but I'm still hoping to do it myself, if only because I have different ideas on how to do it and their maps have some mistakes on them.

 

Anyway, thanks for the interest [img]<fileStore.core_Emoticons>/emoticons/smile.png[/img]/emoticons/smile@2x.png 2x" width="20" height="20" />

spacy51
Senior Member
Posts: 371
Joined: Tue Mar 18, 2008 4:59 pm

Changing the background/empty color

Post by spacy51 »

Wow, I didn't knew there were people creating maps of whole games. That sure brings back memories and reminds me, I probably know more of some game maps than I know about my RL environment [img]<fileStore.core_Emoticons>/emoticons/laugh.png[/img]/emoticons/laugh@2x.png 2x" width="20" height="20" />

 

 

Well, I had a quick look at the Map Viewer tool and I used Ctrl+ 1-8 and I am not so sure what to do. Are you talking about the scenario, where the game itself uses black, or where some layers are removed, and even though it should logically be transparent then, it's black or something else?

 

Btw, do you think I should re-add the menu entries for dispalying/hiding the seperate game layers? I am sure I did this some days ago, but somehow I reverted the changes -_-"

Last edited by spacy51 on Thu Oct 16, 2008 2:13 pm, edited 1 time in total.
TerraEsperZ
Junior Member
Posts: 8
Joined: Wed Oct 08, 2008 11:08 pm

Changing the background/empty color

Post by TerraEsperZ »

Regarding the menu entries, I personally never used them to enable/disable layers, but they were handy in some cases to indicate whether the various layers were being displayed or not, since it was sometimes hard to tell after playing with them for a while.

 

As for what I'm asking for, I must first admit that I'm not entirely sure if it's VBA or the game that's the problem. Alright, let's use a practical example: layer 5 (called OBJ in VBA) is (typically I assume) the sprite layer. Let's say that I turn off every layer except that one; in many games like, say, Metroid Fusion, I would see only the various sprites over a black screen. But in Castlevania: Harmony Of Dissonance, instead of black there's usually another color, like green for the title screen or blue for the introduction story, and it's still there even if you disable all eight layers.

 

checks something

 

Well, what do you know? After checking with "Castlevania: Harmony Of Dissonance", it would appear that this background color that shows up even with all layers turned off is the first color in the background palette.

 

I don't know if the implications of this would make my request harder to implement, but in theory, you'd have to change VBA-M's behaviour so that instead of defaulting to the first background palette entry as an "empty" or "transparent" color, you'd instead employ a user-defined color. Anyway, I appreciate your continued interest [img]<fileStore.core_Emoticons>/emoticons/smile.png[/img]/emoticons/smile@2x.png 2x" width="20" height="20" />

spacy51
Senior Member
Posts: 371
Joined: Tue Mar 18, 2008 4:59 pm

Changing the background/empty color

Post by spacy51 »

Hm, ok, so you dump your things only with the screenshot feature, not with the Map or OAM dialogs?

 

First, you need an indication of what layers are displayed, probably something quicker than than having to open the menu every time. Maybe I can add a modeless dialog or an optional status bar for that.

 

Second, I have to take a look at what happens when a layer is disabled. Of course I can't display transparent in the emulator, but it might be possible to expose a transparency mask by the core, which could be used by the screenshot function to create a BMP or PNG with this mask as an alpha channel. I'm pretty sure this would greatly improve your productivity.

Last edited by spacy51 on Fri Oct 17, 2008 9:48 am, edited 1 time in total.
TerraEsperZ
Junior Member
Posts: 8
Joined: Wed Oct 08, 2008 11:08 pm

Changing the background/empty color

Post by TerraEsperZ »

Regarding what layers are displayed, it's not that important (to me at least), so don't feel like you have to waste time on that.

 

Sometimes, I'll use the Map Browser instead of taking screenshots if, for some reason, the map in-game is affected by some color/transparency effect that can't simply be disabled with layers, or if I want to include an area that is slightly off-screen but that I know is there. But usually, I simply capture from the game while playing since it's usually easier like that.

 

I'll admit that I don't know anything about alpha channel mask since the program I use the most for mapping remains goold old Paint. It doesn't have many features (read: none) but has one advantage: basic map assembly can be done easier and quicker with simpler keyboard shortcuts than with Paint Shop Pro which I also have but only use for transparencies. A simple cut-and-paste with the color I want to remove selected as the background one and presto! I can put a level's foreground over the background and that's that. I've tried using PSP but it remains clumsier and less intuitive to use for basic screenshot assembly.

 

Paint's simplicity I guess is also it's weakness. Whatever an alpha channel mask is, Paint doesn't know what to do with it I'm sure. The "Shape Opaqueness" choice box is all you have; either you move/paste an image "as is", or else you select a color that will be removed. This is why I'm interested in being able to either change the color that VBA-M displays by default with every layer disabled (in case said color is used by the game's graphics), or instead use a color that no GB/GBC/GBA game can use based on how the palette is calculated.

 

A friend, Maxim, did this with Gens, and you can change the background color to an RGB value that is outside the Genesis palette as rendered by the emulator, thus removing any fear of ever unknowingly removing a single pixel from a screenshot. For example, #FF00FF as the background while Gens cannot render anything "pinkier" than #F800F8. Does that make any sense?

spacy51
Senior Member
Posts: 371
Joined: Tue Mar 18, 2008 4:59 pm

Changing the background/empty color

Post by spacy51 »

Ah, ok. So all of it would come down to replace all pixels that are transparent in theory with a user-definable color which will default to some 32bit value outside of the GBA's 15-bit color space. For example, pure white #ffffff isn't possible in the GBA color space IIRC. This optional hack would work best when running VBA-M in 16bit or 24/32 bit mode.

 

Here's the link to the tech doc: http://nocash.emubase.de/gbatek.htm#lcdcolorpalettes

TerraEsperZ
Junior Member
Posts: 8
Joined: Wed Oct 08, 2008 11:08 pm

Changing the background/empty color

Post by TerraEsperZ »

Technically, that would work great, even though according to the tech doc, there's a chance that this could interfere with a game's graphics if it uses that background color. An optional hack that could be turned on and off, thus restoring the original color if wanted, would work best.

Last edited by TerraEsperZ on Fri Oct 17, 2008 11:10 pm, edited 1 time in total.
spacy51
Senior Member
Posts: 371
Joined: Tue Mar 18, 2008 4:59 pm

Changing the background/empty color

Post by spacy51 »

Today I tried realizing the color-changing feature with a cheat code, writing to 0x05000000 (palette RAM, first color), but even though the color actually changes as desired when looking at the palette viewer, the game does not change at all.

 

I would guess that the cheat code gets applied at the wrong time, so it does not affect rendering. Any other ideas?

 

EDIT:

Ah, it probably was this:

VRAM, OAM, and Palette RAM Access

These memory regions can be accessed during H-Blank or V-Blank only (unless display is disabled by Forced Blank bit in DISPCNT register).

from http://nocash.emubase.de/gbatek.htm

Last edited by spacy51 on Sun Oct 26, 2008 3:50 pm, edited 1 time in total.
Post Reply