構成 | |
| struct | BgState |
型定義 | |
| typedef struct BgState | BgState |
列挙型 | |
| enum | BgType { BgType_Text8bpp, BgType_Text4bpp, BgType_Rotation, BgType_ExRotation, BgType_Bmp8, BgType_Bmp16 } |
Allowed background types, used in bgInitMain and bgInitSub. [詳細] | |
| enum | BgSize { BgSize_R_128x128 = (0 << 14), BgSize_R_256x256 = (1 << 14), BgSize_R_512x512 = (2 << 14), BgSize_R_1024x1024 = (3 << 14), BgSize_T_256x256 = (0 << 14) | (1 << 16), BgSize_T_512x256 = (1 << 14) | (1 << 16), BgSize_T_256x512 = (2 << 14) | (1 << 16), BgSize_T_512x512 = (3 << 14) | (1 << 16), BgSize_ER_128x128 = (0 << 14) | (2 << 16), BgSize_ER_256x256 = (1 << 14) | (2 << 16), BgSize_ER_512x512 = (2 << 14) | (2 << 16), BgSize_ER_1024x1024 = (3 << 14) | (2 << 16), BgSize_B8_128x128 = ((0 << 14) | BIT(7) | (3 << 16)), BgSize_B8_256x256 = ((1 << 14) | BIT(7) | (3 << 16)), BgSize_B8_512x256 = ((2 << 14) | BIT(7) | (3 << 16)), BgSize_B8_512x512 = ((3 << 14) | BIT(7) | (3 << 16)), BgSize_B8_1024x512 = (1 << 14) | (3 << 16), BgSize_B8_512x1024 = (0) | (3 << 16), BgSize_B16_128x128 = ((0 << 14) | BIT(7) | BIT(2) | (4 << 16)), BgSize_B16_256x256 = ((1 << 14) | BIT(7) | BIT(2) | (4 << 16)), BgSize_B16_512x256 = ((2 << 14) | BIT(7) | BIT(2) | (4 << 16)), BgSize_B16_512x512 = ((3 << 14) | BIT(7) | BIT(2) | (4 << 16)) } |
Allowed background Sizes The lower 16 bits of these defines can be used directly to set the background control register bits. [詳細] | |
関数 | |
| bool | bgIsText (int id) |
| int | bgInit_call (int layer, BgType type, BgSize size, int mapBase, int tileBase) |
| int | bgInitSub_call (int layer, BgType type, BgSize size, int mapBase, int tileBase) |
| void | bgUpdate (void) |
| Must be called once per frame to update scroll/scale/and rotation of backgrounds. | |
| void | bgSetRotate (int id, int angle) |
| Sets the rotation angle of the specified background and updates the transform matrix. | |
| void | bgRotate (int id, int angle) |
| Rotates the background counter clockwise by the specified angle. (this rotation is cumulative). | |
| void | bgSet (int id, int angle, s32 sx, s32 sy, s32 scrollX, s32 scrollY, s32 rotCenterX, s32 rotCenterY) |
| Sets the rotation and scale of the background and update background control registers. | |
| void | bgSetRotateScale (int id, int angle, s32 sx, s32 sy) |
| Sets the rotation and scale of the background and update background control registers. | |
| void | bgSetScale (int id, s32 sx, s32 sy) |
| Sets the scale of the specified background. | |
| int | bgInit (int layer, BgType type, BgSize size, int mapBase, int tileBase) |
| Initializes a background on the main display Sets up background control register with specified settings and defaults to 256 color mode for tiled backgrounds. Sets the rotation/scale attributes for rot/ex rot backgrounds to 1:1 scale and 0 angle of rotation. | |
| int | bgInitSub (int layer, BgType type, BgSize size, int mapBase, int tileBase) |
| Initializes a background on the sub display Sets up background control register with specified settings and defaults to 256 color mode for tiled backgrounds. Sets the rotation/scale attributes for rot/ex rot backgrounds to 1:1 scale and 0 angle of rotation. | |
| vuint16 * | bgSetControlBits (int id, u16 bits) |
| allows direct access to background control for the chosen layer, returns a pointer to the current control bits | |
| void | bgClearControlBits (int id, u16 bits) |
| Clears the specified bits from the backgrounds control register. | |
| void | bgSetPriority (int id, unsigned int priority) |
| Sets the background priority. | |
| void | bgSetMapBase (int id, unsigned int base) |
| Sets the background map base. | |
| void | bgSetTileBase (int id, unsigned int base) |
| Sets the background map base. | |
| void | bgSetScrollf (int id, s32 x, s32 y) |
| Sets the scroll hardware to the specified location (fixed point). | |
| void | bgSetScroll (int id, int x, int y) |
| Sets the scroll hardware to the specified location. | |
| void | bgMosaicEnable (int id) |
| Enables mosaic on the specified background. | |
| void | bgMosaicDisable (int id) |
| Disables mosaic on the specified background. | |
| void | bgSetMosaic (unsigned int dx, unsigned int dy) |
| Sets the horizontal and vertical mosaic values for all backgrounds. | |
| void | bgSetMosaicSub (unsigned int dx, unsigned int dy) |
| Sets the horizontal and vertical mosaic values for all backgrounds (Sub Display). | |
| int | bgGetPriority (int id) |
| Gets the background priority. | |
| int | bgGetMapBase (int id) |
| Gets the current map base for the supplied background. | |
| int | bgGetTileBase (int id) |
| Gets the background tile base. | |
| u16 * | bgGetMapPtr (int id) |
| Gets a pointer to the background map. | |
| u16 * | bgGetGfxPtr (int id) |
| Gets a pointer to the background graphics. | |
| void | bgScrollf (int id, s32 dx, s32 dy) |
| Scrolls the background by the specified relative values (fixed point). | |
| void | bgScroll (int id, int dx, int dy) |
| Scrolls the background by the specified relative values. | |
| void | bgShow (int id) |
| Shows the current background via the display control register. | |
| void | bgHide (int id) |
| Hides the current background via the display control register. | |
| void | bgSetCenterf (int id, s32 x, s32 y) |
| Sets the center of rotation for the supplied background (fixed point). | |
| void | bgSetCenter (int id, int x, int y) |
| Sets the center of rotation for the supplied background. | |
変数 | |
| vuint16 * | bgControl [8] |
| bg_scroll * | bgScrollTable [8] |
| bg_transform * | bgTransform [8] |
| BgState | bgState [8] |
| enum BgSize |
Allowed background Sizes The lower 16 bits of these defines can be used directly to set the background control register bits.
| enum BgType |
Allowed background types, used in bgInitMain and bgInitSub.
| static bgClearControlBits | ( | int | id, | |
| u16 | bits | |||
| ) | [inline] |
Clears the specified bits from the backgrounds control register.
| id | background id returned from bgInit or bgInitSub | |
| bits | sets the specified bits to clear in the backgrounds control register |
| static bgGetGfxPtr | ( | int | id | ) | [inline] |
Gets a pointer to the background graphics.
| id | background id returned from bgInit or bgInitSub |
| static bgGetMapBase | ( | int | id | ) | [inline] |
Gets the current map base for the supplied background.
| id | background id returned from bgInit or bgInitSub |
| static bgGetMapPtr | ( | int | id | ) | [inline] |
Gets a pointer to the background map.
| id | background id returned from bgInit or bgInitSub |
| static bgGetPriority | ( | int | id | ) | [inline] |
Gets the background priority.
| id | background id returned from bgInit or bgInitSub |
| static bgGetTileBase | ( | int | id | ) | [inline] |
Gets the background tile base.
| id | background id returned from bgInit or bgInitSub |
| static bgHide | ( | int | id | ) | [inline] |
Hides the current background via the display control register.
| id | background id returned from bgInit or bgInitSub |
Initializes a background on the main display Sets up background control register with specified settings and defaults to 256 color mode for tiled backgrounds. Sets the rotation/scale attributes for rot/ex rot backgrounds to 1:1 scale and 0 angle of rotation.
| layer | background hardware layer to init. Must be 0 - 3 | |
| type | the type of background to init | |
| size | the size of the background | |
| mapBase | the 2k offset into vram the tile map will be placed --OR-- the 16k offset into vram the bitmap data will be placed for bitmap backgrounds | |
| tileBase | the 16k offset into vram the tile graphics data will be placed |
Initializes a background on the sub display Sets up background control register with specified settings and defaults to 256 color mode for tiled backgrounds. Sets the rotation/scale attributes for rot/ex rot backgrounds to 1:1 scale and 0 angle of rotation.
| layer | background hardware layer to init. Must be 0 - 3 | |
| type | the type of background to init | |
| size | the size of the background | |
| mapBase | the 2k offset into vram the tile map will be placed --OR-- the 16k offset into vram the bitmap data will be placed for bitmap backgrounds | |
| tileBase | the 16k offset into vram the tile graphics data will be placed |
| static bgMosaicDisable | ( | int | id | ) | [inline] |
Disables mosaic on the specified background.
| id | background id returned from bgInit or bgInitSub |
| static bgMosaicEnable | ( | int | id | ) | [inline] |
Enables mosaic on the specified background.
| id | background id returned from bgInit or bgInitSub |
| static bgRotate | ( | int | id, | |
| int | angle | |||
| ) | [inline] |
Rotates the background counter clockwise by the specified angle. (this rotation is cumulative).
| id | background id returned from bgInit or bgInitSub | |
| angle | the angle of counter clockwise rotation (-32768 to 32767) |
| static bgScroll | ( | int | id, | |
| int | dx, | |||
| int | dy | |||
| ) | [inline] |
Scrolls the background by the specified relative values.
| id | background id returned from bgInit or bgInitSub | |
| dx | horizontal scroll | |
| dy | vertical scroll |
| static bgScrollf | ( | int | id, | |
| s32 | dx, | |||
| s32 | dy | |||
| ) | [inline] |
Scrolls the background by the specified relative values (fixed point).
| id | background id returned from bgInit or bgInitSub | |
| dx | the 8 bits fractional fixed point horizontal scroll | |
| dy | the 8 bits fractional fixed point vertical scroll |
| static void bgSet | ( | int | id, | |
| int | angle, | |||
| s32 | sx, | |||
| s32 | sy, | |||
| s32 | scrollX, | |||
| s32 | scrollY, | |||
| s32 | rotCenterX, | |||
| s32 | rotCenterY | |||
| ) | [inline] |
Sets the rotation and scale of the background and update background control registers.
| id | background id returned from bgInit or bgInitSub | |
| angle | the angle of counter clockwise rotation (-32768 to 32767) | |
| sx | the 24.8 bit fractional fixed point inverse horizontal scaling to apply | |
| sy | the 24.8 bit fractional fixed point inverse vertical scaling to apply | |
| scrollX | the 24.8 bit fractional fixed point horizontal scroll to apply | |
| scrollY | the 24.8 bit fractional fixed point vertical scroll to apply | |
| rotCenterX | the 24.8 bit fractional fixed point center of rotation x component | |
| rotCenterY | the 24.8 bit fractional fixed point center of rotation y component |
| static bgSetCenter | ( | int | id, | |
| int | x, | |||
| int | y | |||
| ) | [inline] |
Sets the center of rotation for the supplied background.
| id | background id returned from bgInit or bgInitSub | |
| x | center x | |
| y | center y |
| static bgSetCenterf | ( | int | id, | |
| s32 | x, | |||
| s32 | y | |||
| ) | [inline] |
Sets the center of rotation for the supplied background (fixed point).
| id | background id returned from bgInit or bgInitSub | |
| x | the 8 bits fractional center x | |
| y | the 8 bits fractional center y |
| static bgSetControlBits | ( | int | id, | |
| u16 | bits | |||
| ) | [inline] |
allows direct access to background control for the chosen layer, returns a pointer to the current control bits
| id | background id returned from bgInit or bgInitSub | |
| bits | sets the specified bits to set in the backgrounds control register |
| static bgSetMapBase | ( | int | id, | |
| unsigned int | base | |||
| ) | [inline] |
Sets the background map base.
| id | background id returned from bgInit or bgInitSub | |
| base | the 2k offset into vram for the backgrounds tile map or the 16k offset for bitmap graphics |
| static bgSetMosaic | ( | unsigned int | dx, | |
| unsigned int | dy | |||
| ) | [inline] |
Sets the horizontal and vertical mosaic values for all backgrounds.
| dx | horizontal mosaic value (between 0 and 15) | |
| dy | vertical mosaic value (between 0 and 15) |
| static bgSetMosaicSub | ( | unsigned int | dx, | |
| unsigned int | dy | |||
| ) | [inline] |
Sets the horizontal and vertical mosaic values for all backgrounds (Sub Display).
| dx | horizontal mosaic value (between 0 and 15) | |
| dy | vertical mosaic value (between 0 and 15) |
| static bgSetPriority | ( | int | id, | |
| unsigned int | priority | |||
| ) | [inline] |
Sets the background priority.
| id | background id returned from bgInit or bgInitSub | |
| priority | background priority (0-3), higher level priority will result in background rendering on top of lower level |
| static bgSetRotate | ( | int | id, | |
| int | angle | |||
| ) | [inline] |
Sets the rotation angle of the specified background and updates the transform matrix.
| id | background id returned from bgInit or bgInitSub | |
| angle | the angle of counter clockwise rotation (0 to 511) |
| static void bgSetRotateScale | ( | int | id, | |
| int | angle, | |||
| s32 | sx, | |||
| s32 | sy | |||
| ) | [inline] |
Sets the rotation and scale of the background and update background control registers.
| id | background id returned from bgInit or bgInitSub | |
| angle | the angle of counter clockwise rotation (-32768 to 32767) | |
| sx | the 24.8 bit fractional fixed point horizontal scaling to apply | |
| sy | the 24.8 bit fractional fixed point vertical scaling to apply |
| static bgSetScale | ( | int | id, | |
| s32 | sx, | |||
| s32 | sy | |||
| ) | [inline] |
Sets the scale of the specified background.
| id | background id returned from bgInit or bgInitSub | |
| sx | the 24.8 bit fractional fixed point horizontal scaling to apply | |
| sy | the 24.8 bit fractional fixed point vertical scaling to apply |
| static bgSetScroll | ( | int | id, | |
| int | x, | |||
| int | y | |||
| ) | [inline] |
Sets the scroll hardware to the specified location.
| id | background id returned from bgInit or bgInitSub | |
| x | the horizontal scroll | |
| y | the vertical scroll |
| static bgSetScrollf | ( | int | id, | |
| s32 | x, | |||
| s32 | y | |||
| ) | [inline] |
Sets the scroll hardware to the specified location (fixed point).
| id | background id returned from bgInit or bgInitSub | |
| x | the 8 bits fractional fixed point horizontal scroll | |
| y | the 8 bits fractional fixed point vertical scroll |
| static bgSetTileBase | ( | int | id, | |
| unsigned int | base | |||
| ) | [inline] |
Sets the background map base.
| id | background id returned from bgInit or bgInitSub | |
| base | the 16k offset into vram for the backgrounds tile map ignored for bitmap graphics |
| static bgShow | ( | int | id | ) | [inline] |
Shows the current background via the display control register.
| id | background id returned from bgInit or bgInitSub |
1.6.3