GsBG

Background picture handler

struct GsBG {
        u_long attribute;
        short x, y;
        short w, h;
        short scrollx, scrolly;
        u_char r, g, b;
        GsMAP *map;
        short mx, my;
        short scalex, scaley;
        long rotate;
};

Members

attribute Attribute bits as shown below (Bits not defined below are reserved by the system)
6: Brightness adjustment switch
    0: ON
    1: OFF
24-25: Sprite pattern colour mode
    0: 4-bit CLUT
    1: 8-bit CLUT
    2: 15-bit Direct
27: Rotation & scaling functions
    0: ON
    1: OFF
28-29: Semi-transparency rate
    0: 0.5 x Back + 0.5 x Forward
    1: 1.0 x Back + 1.0 x Forward
    2: 1.0 x Back - 1.0 x Forward
    3: 1.0 x Back + 0.25 x Forward
30: Semi-transparency mode
    0: Semi-transparency OFF
    1: Semi-transparency ON
31: Sprite display mode
    0: Displayed
    1: Not displayed
x, y Display position of the upper left-hand point
w, h BG display size (in pixels)
scrollx, scrolly x,y scroll values
r, g, b Display brightness is set in r, g, b. (Normal brightness is 128.)
map Pointer to map data
mx, my Rotation and enlargement central point coordinates
scalex, scaley Scale values in x and y directions
rotate Rotation angle (4096 = 1 degree)

Explanation

GsBG is a structure used to describe a background.
A background (BG) consists of a large rectangle drawn from GsMAP data based upon a combination of small rectangles defined by GsCELL data.
Every background has an associated GsBG structure.
The background may be manipulated via this structure.
To enter a GsBG object in an ordering table, use GsSortBg().
x, y specify the screen display position.
w, h specify the BG display size in pixels, and are not dependent on cell size or map size. If the display area is larger than the map, the content of the map is repeatedly displayed (this is referred to as tiling).
scrollx, scrolly specify the offset from the map display position in dots.
r, g, b specify the brightness values for red, green, and blue. The allowed range is 0 to 255. 128 is the brightness of the original pattern; 255 represents a two-fold increase in brightness.
map is a pointer to the start of the map data. Map data is represented by the GsMAP structure.
mx, my specify the center of rotation and scaling as relative coordinates. The upper left-hand point of the BG is the point of origin. For example, if rotation is around the center of the BG, these values should be specified as w/2 and h/2, respectively.
scalex, scaley specify enlargement/reduction values in the x and y directions. These values represent units of 4096 (which is equivalent to a fixed point value of 1.0). scalex and scaley can be set up to 8 times the original size.
rotate specifies the amount of rotation around the Z-axis (4096 = 1°).