Golden Sun Hacking Community

Golden Sun Resources => Misc. GS Hacking => Topic started by: Salanewt on 26, May, 2015, 10:46:53 PM

Title: Transparency and Fading Effects
Post by: Salanewt on 26, May, 2015, 10:46:53 PM
So yeah. I've basically decided to start looking into some of the ways that GS2 utilizes transparency and stuff. For those who don't know, the GBA has some native semi-transparency, alpha blending, and brightness features that pretty much any game can utilize (more on that at GBATEK).

I also felt like making a little post about something neat I found about semi-transparency during battle. As of today, I have made note of a couple functions that deal with it, and have toyed around with the feature a bit. Looking at one function in particular that feels wildly inefficient, so I wouldn't mind shortening it a bit with the intention of maybe adding something cool to it later. Also found a couple RAM values that are pretty interesting.

A: The first is a counter. Not terribly interesting on its own, but it increases and/or loops depending on the next value. Located at #020306C2.

B: Whatever this value is will change how blending effects are applied to PC/enemy sprites in battle. Located at #020306C4. These values are:
0 - Starts off with this, no effects are applied.
1 (or anything other than 0, 2, 4, 6) - Current unit/target sprite blinks white.
2 - All not-currently-selected sprites fade in and out, including PC portrait in lower left.
4 - As the counter increases, every not-currently-selected sprite fades until they are completely invisible; setting the counter back to a lower level will fade them back in.
6 - In menus; all not-currently-selected sprites are translucent. When selecting target; all not-currently-selected sprites completely invisible.

As far as I can tell, only 0 and 1 seem to be used most of the time.

Oh yeah. I was also hoping to find out if anyone knows of any instances outside of battle where transparency is applied specifically to object sprites rather than background layers. I think the lighthouse beacons might use it when initially lighting them, but beyond that I can't think of any. I'm doing research for reasons, so any other info I can get would help me tremendously.