#2074 - RiZeUp - Tue Jan 28, 2003 10:02 pm
Alright im starting to learn to code for the gba right now. But REG_BLDMOD is troubleing me at the moment. I have searched the forum and i also saw pages like thepernproject just to let you guys know i did some research before posting this. Im not just asking you guys to chew everything up for me.
Ive been trying to set REG_BLDMOD for my game with no success yet. Im working in background mode 0 and right now im only using background 1(ive tried other levels with no working result). Im trying to set transparency on this background. If im not mistaken transparency will use the first color in the palette for backgrounds like with sprites. Ive tried endless possibilities with the REG_BLDMOD register but its never transparent. Am I missing something?
what should a good setting for reg_bldmod look like?
_________________
~RiZeUp
#2077 - Splam - Tue Jan 28, 2003 10:27 pm
You are a bit mistaken about transparencies (or at least their use with LBDMOD) Any tile background will be transparent on palatte entry 0 but the BLDMOD is used for colour special fx and doesn't have anything to do with colour 0.
What you have is 2 lists source 1 and source 2 pixels, you choose from those which backgrounds etc you want the effects to apply to. You also have a 2 bit mode which can be
0 nothing
1 alpha blend
2 brighteness increase
3 brightness decrease
Theres also another 2 registers BLDY and BLDALPHA which control the amounts for the alpha blend and brightness chages.
Basically if you want bits of 1 background to show through another DONT touch BLDMOD, just set the pixels to be colour 0. BLDMOD is only used for alpha/brightness control and actually setting bits in it when you don't mean to will do some strange things (like normal colour 0 transparency can go totaly wrong).
#2078 - RiZeUp - Tue Jan 28, 2003 10:47 pm
Thanx alot for your reply. This really cleared some of my questions. But even when i dont touch REG_BLDMOD it doesnt seem to use any transparency.(btw i dont know if this is important... but im using HAM)
I made a simple tileset really quick with a green background(i know pple normallly use pink but im not too confortable with my masculinity yet ;) ) I made sure the first color in the palette is the green i used for the background that i wanted to be transparent. When i convert it using gfx2gba everything seems right in the .c for the palette and the raw image data. But inside the game i still get a green background instead of black since it should be transparent. Im starting to think it may be due to the text function included with ham thats messing with my palette or something like that. Im gonna try more stuff.
_________________
~RiZeUp
#2079 - Splam - Tue Jan 28, 2003 11:09 pm
Are you overlaying one BG onto another and only seeing green where colour 0 is and not the lower priority BG or do you only have 1 BG displayed? If only 1 then you WILL see green because the gba uses colour 0 to be the backdrop BD so your tiles will be transparent but still showing the BD colour 0. Just set it to black ;) In fact when you copy your palette in set it to black anyway unless you want the BD to be sky or something in which case make it blue :)
#2081 - RiZeUp - Wed Jan 29, 2003 1:33 am
Thanx alot splam you really helped me alot. I just needed a little push in the right direction. Everything seems fine that way.
_________________
~RiZeUp
#2082 - Splam - Wed Jan 29, 2003 1:52 am
No problem. Things like colour 0 transparency are easy to get confused with "key" colour on windows etc if you've not done any console coding b4.