Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
newbie question: palettes, characters & maps (how to lay them out)   Message List  
Reply | Forward Message #14978 of 15019 |
Re: [gbadev] newbie question: palettes, characters & maps (how to lay them out)


> I have the basic idea that palettes hold colors values and the first
> colour is the mask color. I also understand that characters are unique
> sections (8*8) of a bg graphic. And finally maps are the layout of the
> characters as it appears on the bg.
Yes, that's right.

> In a typical scenario, I load the palette as bg_palette, characters in
> bg vram, and map in BG3. But when the graphic is rendered on the gba, I
> always find the first character of the BG as the background (instead of
> the maskcolor). In the process of trial and error, I have confused
> myself to such an extent of what is what.

BG3 should countain "map" of image, let's say (A is first character = 0x00)

ABCDE
FGHIJ
KLMNO

for 40x24 pixel graphics (which need unique "characters" for every tile, in
case of some repeating graphics pattern some tiles can use the same
character).

Than the character memory should contain graphics (indices to palette) for
every character. First 8*8 bytes for A, than 64 bytes for B, etc...
like
0000 0000
0044 4400
0400 0040
0400 0040
0455 5540
0400 0040
0400 0040
0000 0000

for graphics showing big letter A in color 4 with the central line in color
5.

And finally you have to set palette up to contain correct color 4 and 5.

...
- if you see instead of your picture the first character repeated on whole
screen, than your map is zeroed and the correct map is not loaded.

- if you see the lower layer at spots where "mask color" is used, that's
IMHO correct behavior, the "mask color" is transparent one, so you should
see lower layer trough those pixels. (I'm not sure how much you can
customise the transparency on GBA, sometimes you can switch it On/Off on
some HW, or eventually to specify which index in palette should be
transparent (instead of 0 to use let's say 255), refer to GBA docs for the
gfx chip transparency possibilities and how to set it up correctly)
Also keep in mind the correct priorities of layers (which one is on top,
which one is on bottom).
And if some pixel is "transparent" on all enabled layers, I think the GBA
will render it black, so if you want background of different color, make
sure you have some background layer enabled with correct color on it, or do
not use transparent pixels.

> I am using photoshop to convert RGB color graphic to indexed color. I
> try to edit the color table to put the mask color first, but it doesnt
> work somehow.

I'm not sure how well the photoshop in newer versions cope with such task,
but long time ago it was not possible to do it easily, and I used
PaintShopPro for such editing.
Find appropriate tools which will allow you to exchange colors in palette
and also patch the graphics accordingly to follow the exchange.
(or get some better conversion tool PC to GBA, where you can specify which
color is "mask" and it should patch the palette and picture even from
"bad" photoshop png)

Check http://www.gbadev.org/tools.php?section=gfx
There are tons of tools, actually maybe too much of them. :) Some of them
may help you to solve your problem.

I did use gfx2gba v0.13 by Markus, which did suit my needs perfectly and
Markus was very kind to incorporate some enhancements I did need.
But I think I did use 8bit pcx files, and not photoshop, so maybe I avoided
some problems you can run into.

If this mail does not help you, try to describe your problem one more in
other words, adding few imporant lines from source can be of some help too.
Don't forget to use debugging capabilities of some emulators to check
what's really loaded into video memory, that itself did help me to track
down bugs in my own code many times.

And don't forget to search trough http://www.gbadev.org for tutorials and
gfx explanation, I think there was some very good stuff.

--

PED - Peter Helcmanovsky - wishing to have 48h days
Braniskova 7 Kosice 04001 Slovakia / phone +420 721308701
(_ -- actually in Prag, so don't look after me --
"~/\~" -=- deRATized RAT -=- Being beyond Yer imagination -=-
,_oo_, 7 GODS demo group WWW pages: http://7gods.org
`'





Tue Feb 14, 2006 12:57 pm

ped7g
Offline Offline
Send Email Send Email

Forward
Message #14978 of 15019 |
Expand Messages Author Sort by Date

Hi, I have been a silent reader of the forum for quite sometime. Even though my question is too basic , comparing to the ones posted by others. However, I am...
Rajesh G S
gsronline
Offline Send Email
Feb 13, 2006
9:49 pm

... If I'm reading you right, I'm guessing that you are seeing the first character in your character table repeated across the display? If that's the case,...
Tursi
tursi1
Offline Send Email
Feb 14, 2006
8:52 am

... Yes, that's right. ... BG3 should countain "map" of image, let's say (A is first character = 0x00) ABCDE FGHIJ KLMNO for 40x24 pixel graphics (which need...
Ped
ped7g
Offline Send Email
Feb 16, 2006
12:21 am

... If you find a tool that does allow you to rearrange the palette to your liking, tell us all. I couldn't find it, but then again, I didn't look through the...
Palamon 3
palamon_3
Offline Send Email
Feb 16, 2006
7:07 pm

Photoshop rearranges the colors according to it's selection bar, ie from RED to BLUE to GREEN back to RED. So set your BG color to full RED with a hint of BLUE...
Fredrik Olsson
flubbaofward
Offline Send Email
Feb 16, 2006
11:33 pm

Hey, I'd recommend GraphicsGale (http://www.humanbalance.net/gale/us/index.html) to anyone who just wants to do simple pixel art without paying for an...
tarsius4
Offline Send Email
Feb 19, 2006
11:45 am

Also, Cosmigo's "ProMotion" is worth a look. Basically, DPaint++ - it will do everything you need. www.cosmigo.com Sreve ... -- Steve Wetherill ...
Steve Wetherill
escafeld
Offline Send Email
Feb 20, 2006
6:43 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help