mirror of
https://github.com/knightfox75/nds_nflib.git
synced 2025-06-18 16:55:32 -04:00
library: Cleanup headers
This commit is contained in:
parent
7aac024b0b
commit
57cc1d519c
@ -27,15 +27,15 @@ extern "C" {
|
||||
|
||||
/// Struct that holds information about affine tiled backgrounds.
|
||||
typedef struct {
|
||||
s32 x; ///< X position
|
||||
s32 y; ///< Y position
|
||||
s32 x_center; ///< X center
|
||||
s32 y_center; ///< Y center
|
||||
s32 x_scale; ///< X zoom (PA)
|
||||
s32 y_scale; ///< Y zoom (PD)
|
||||
s32 x_tilt; ///< X shear (PB)
|
||||
s32 y_tilt; ///< Y shear (PC)
|
||||
s32 angle; ///< Rotation angle
|
||||
s32 x; ///< X position
|
||||
s32 y; ///< Y position
|
||||
s32 x_center; ///< X center
|
||||
s32 y_center; ///< Y center
|
||||
s32 x_scale; ///< X zoom (PA)
|
||||
s32 y_scale; ///< Y zoom (PD)
|
||||
s32 x_tilt; ///< X shear (PB)
|
||||
s32 y_tilt; ///< Y shear (PC)
|
||||
s32 angle; ///< Rotation angle
|
||||
} NF_TYPE_AFFINE_BG;
|
||||
|
||||
/// Information of all affine backgrounds.
|
||||
@ -79,7 +79,7 @@ void NF_InitAffineBgSys(u8 screen);
|
||||
/// @param name Name used for the BG for other functions.
|
||||
/// @param width BG width.
|
||||
/// @param height BG height.
|
||||
void NF_LoadAffineBg(const char* file, const char* name, u16 width, u16 height);
|
||||
void NF_LoadAffineBg(const char *file, const char *name, u16 width, u16 height);
|
||||
|
||||
/// Deletes the specified affine background from RAM.
|
||||
///
|
||||
@ -90,7 +90,7 @@ void NF_LoadAffineBg(const char* file, const char* name, u16 width, u16 height);
|
||||
/// ```
|
||||
///
|
||||
/// @param name Name of the background.
|
||||
void NF_UnloadAffineBg(const char* name);
|
||||
void NF_UnloadAffineBg(const char *name);
|
||||
|
||||
/// Create an affine background in a layer using graphics preloaded in RAM.
|
||||
///
|
||||
@ -107,7 +107,7 @@ void NF_UnloadAffineBg(const char* name);
|
||||
/// @param layer Layer (2 - 3).
|
||||
/// @param name Name of the background.
|
||||
/// @param wrap True to enable wrap around mode.
|
||||
void NF_CreateAffineBg(u8 screen, u8 layer, const char* name, u8 wrap);
|
||||
void NF_CreateAffineBg(u8 screen, u8 layer, const char *name, u8 wrap);
|
||||
|
||||
/// Deletes from VRAM the background of the specified screen and layer.
|
||||
///
|
||||
|
@ -54,7 +54,7 @@ extern char NF_ROOTFOLDER[64];
|
||||
/// @param code Error code.
|
||||
/// @param text Description.
|
||||
/// @param value Additional info.
|
||||
void NF_Error(u16 code, const char* text, u32 value);
|
||||
void NF_Error(u16 code, const char *text, u32 value);
|
||||
|
||||
/// Defines the root folder of your project (FAT or NitroFS).
|
||||
///
|
||||
@ -74,7 +74,7 @@ void NF_Error(u16 code, const char* text, u32 value);
|
||||
/// ```
|
||||
///
|
||||
/// @param folder
|
||||
void NF_SetRootFolder(const char* folder);
|
||||
void NF_SetRootFolder(const char *folder);
|
||||
|
||||
/// Function copy blocks of memory from RAM to VRAM fast.
|
||||
///
|
||||
@ -90,7 +90,7 @@ void NF_SetRootFolder(const char* folder);
|
||||
/// @param destination Destination pointer.
|
||||
/// @param source Source pointer.
|
||||
/// @param size Number of bytes to copy.
|
||||
void NF_DmaMemCopy(void* destination, const void* source, u32 size);
|
||||
void NF_DmaMemCopy(void *destination, const void *source, u32 size);
|
||||
|
||||
/// Returns the language ID set by the user in the firmware.
|
||||
///
|
||||
@ -103,7 +103,7 @@ void NF_DmaMemCopy(void* destination, const void* source, u32 size);
|
||||
/// 6 : Chinese
|
||||
///
|
||||
/// @return The language ID.
|
||||
extern u8 NF_GetLanguage(void);
|
||||
u8 NF_GetLanguage(void);
|
||||
|
||||
/// @}
|
||||
|
||||
|
@ -32,11 +32,11 @@ extern "C" {
|
||||
|
||||
/// Struct that holds information about 16-bit bitmap backgrounds.
|
||||
typedef struct {
|
||||
u16* buffer; ///< Data buffer
|
||||
u32 size; ///< Size of the buffer
|
||||
u16 width; ///< Width of the image (max 256 pixels)
|
||||
u16 height; ///< Height of the image (max 256 pixels)
|
||||
bool inuse; ///< True if the slot is in use
|
||||
u16 *buffer; ///< Data buffer
|
||||
u32 size; ///< Size of the buffer
|
||||
u16 width; ///< Width of the image (max 256 pixels)
|
||||
u16 height; ///< Height of the image (max 256 pixels)
|
||||
bool inuse; ///< True if the slot is in use
|
||||
} NF_TYPE_BG16B_INFO;
|
||||
|
||||
/// Information of all 16-bit bitmap backgrounds
|
||||
@ -47,11 +47,11 @@ extern u16* NF_16BITS_BACKBUFFER[2];
|
||||
|
||||
/// Struct that holds information about 8-bit bitmap backgrounds.
|
||||
typedef struct {
|
||||
u8* data; ///< Data buffer
|
||||
u32 data_size; ///< Data buffer size
|
||||
u16* pal; ///< Palette buffer
|
||||
u32 pal_size; ///< Palette buffer size
|
||||
bool inuse; ///< True if the slot is in use
|
||||
u8 *data; ///< Data buffer
|
||||
u32 data_size; ///< Data buffer size
|
||||
u16 *pal; ///< Palette buffer
|
||||
u32 pal_size; ///< Palette buffer size
|
||||
bool inuse; ///< True if the slot is in use
|
||||
} NF_TYPE_BG8B_INFO;
|
||||
|
||||
/// Information of all 8-bit bitmap backgrounds
|
||||
@ -59,8 +59,8 @@ extern NF_TYPE_BG8B_INFO NF_BG8B[NF_SLOTS_BG8B];
|
||||
|
||||
/// Information of a backbuffer of 8 bit
|
||||
typedef struct {
|
||||
u8* data; ///< Pointer to the bitmap
|
||||
u16* pal; ///< Pointer to the bitmap palette
|
||||
u8 *data; ///< Pointer to the bitmap
|
||||
u16 *pal; ///< Pointer to the bitmap palette
|
||||
} NF_TYPE_BB8B_INFO;
|
||||
|
||||
/// Backbuffer of 8 bit of each screen
|
||||
@ -143,7 +143,7 @@ void NF_InitBitmapBgSys(u8 screen, u8 mode);
|
||||
///
|
||||
/// @param file File name without extension.
|
||||
/// @param slot Slot number (0 - 15).
|
||||
void NF_Load16bitsBg(const char* file, u8 slot);
|
||||
void NF_Load16bitsBg(const char *file, u8 slot);
|
||||
|
||||
/// Loads a 16 bits image into a RAM slot.
|
||||
///
|
||||
@ -164,10 +164,10 @@ void NF_Load16bitsBg(const char* file, u8 slot);
|
||||
/// @param slot Slot number (0 - 15).
|
||||
/// @param size_x Width in pixels.
|
||||
/// @param size_y Height in pixels.
|
||||
void NF_Load16bitsImage(const char* file, u8 slot, u16 size_x, u16 size_y);
|
||||
void NF_Load16bitsImage(const char *file, u8 slot, u16 size_x, u16 size_y);
|
||||
|
||||
// Internal use only. Generic loader of 16-bit data to RAM.
|
||||
void NF_Load16bImgData(const char* file, u8 slot, u16 x, u16 y, u8 type);
|
||||
void NF_Load16bImgData(const char *file, u8 slot, u16 x, u16 y, u8 type);
|
||||
|
||||
/// Deletes from RAM the 16-bit image stored in the selected slot.
|
||||
///
|
||||
@ -256,7 +256,7 @@ void NF_Reset8bitsBgBuffers(void);
|
||||
///
|
||||
/// @param file File name without extension.
|
||||
/// @param slot Slot number (0 - 15).
|
||||
void NF_Load8bitsBg(const char* file, u8 slot);
|
||||
void NF_Load8bitsBg(const char *file, u8 slot);
|
||||
|
||||
/// Deletes from RAM the 8-bit image stored in the selected slot.
|
||||
///
|
||||
|
@ -34,15 +34,15 @@ extern "C" {
|
||||
|
||||
/// Struct that holds collision map information
|
||||
typedef struct {
|
||||
char* tiles; ///< Tileset data
|
||||
char* map; ///< Map data
|
||||
char* pal; ///< Palette data (TODO: Remove, it looks unused)
|
||||
u32 tiles_size; ///< Size of the tileset
|
||||
u32 map_size; ///< Size of the map
|
||||
u32 pal_size; ///< Size of the palette (TODO: Remove, it looks unused)
|
||||
u16 width; ///< Width of map in pixels
|
||||
u16 height; ///< Height of map in pixels
|
||||
bool inuse; ///< True if the slot is in use
|
||||
char *tiles; ///< Tileset data
|
||||
char *map; ///< Map data
|
||||
char *pal; ///< Palette data (TODO: Remove, it looks unused)
|
||||
u32 tiles_size; ///< Size of the tileset
|
||||
u32 map_size; ///< Size of the map
|
||||
u32 pal_size; ///< Size of the palette (TODO: Remove, it looks unused)
|
||||
u16 width; ///< Width of map in pixels
|
||||
u16 height; ///< Height of map in pixels
|
||||
bool inuse; ///< True if the slot is in use
|
||||
} NF_TYPE_CMAP_INFO;
|
||||
|
||||
/// Information of all collision maps
|
||||
@ -73,7 +73,7 @@ void NF_ResetCmapBuffers(void);
|
||||
/// @param id Slot number (0 - 31)
|
||||
/// @param width Map width (in pixels)
|
||||
/// @param height Map height (in pixels)
|
||||
void NF_LoadCollisionMap(const char* file, u8 id, u16 width, u16 height);
|
||||
void NF_LoadCollisionMap(const char *file, u8 id, u16 width, u16 height);
|
||||
|
||||
/// Unload from RAM the collision map at the specified slot.
|
||||
///
|
||||
@ -112,7 +112,7 @@ void NF_SetTile(u8 slot, s32 x, s32 y, u16 value);
|
||||
/// @param id Slot number (0 - 31)
|
||||
/// @param width Map width (in pixels)
|
||||
/// @param height Map height (in pixels)
|
||||
void NF_LoadCollisionBg(const char* file, u8 id, u16 width, u16 height);
|
||||
void NF_LoadCollisionBg(const char *file, u8 id, u16 width, u16 height);
|
||||
|
||||
/// Unload from RAM the collision background at the specified slot.
|
||||
///
|
||||
|
@ -40,7 +40,7 @@ extern "C" {
|
||||
///
|
||||
/// @param file File path.
|
||||
/// @param slot Slot number (0 - 15).
|
||||
void NF_LoadBMP(const char* file, u8 slot);
|
||||
void NF_LoadBMP(const char *file, u8 slot);
|
||||
|
||||
/// @}
|
||||
|
||||
|
@ -28,14 +28,14 @@ extern "C" {
|
||||
#define NF_SLOTS_RAWSOUND 32
|
||||
|
||||
/// Buffers of all loaded sound files
|
||||
extern char* NF_BUFFER_RAWSOUND[NF_SLOTS_RAWSOUND];
|
||||
extern char *NF_BUFFER_RAWSOUND[NF_SLOTS_RAWSOUND];
|
||||
|
||||
/// Struct that holds information about the loaded sound files
|
||||
typedef struct {
|
||||
bool available; ///< True if this slot is available
|
||||
u32 size; ///< Size of the sound effect in bytes
|
||||
u16 freq; ///< Frecuency of the sample
|
||||
u8 format; ///< Format of the sample
|
||||
bool available; ///< True if this slot is available
|
||||
u32 size; ///< Size of the sound effect in bytes
|
||||
u16 freq; ///< Frecuency of the sample
|
||||
u8 format; ///< Format of the sample
|
||||
} NF_TYPE_RAWSOUND_INFO;
|
||||
|
||||
/// Information of all sound effects.
|
||||
@ -68,7 +68,7 @@ void NF_ResetRawSoundBuffers(void);
|
||||
/// @param id Destination slot number (0 - 31)
|
||||
/// @param freq Frequency of the sample in Hz (11025, 22050, etc)
|
||||
/// @param format Sample format (0 -> 8 bits, 1 -> 16 bits, 2 -> ADPCM).
|
||||
void NF_LoadRawSound(const char* file, u16 id, u16 freq, u8 format);
|
||||
void NF_LoadRawSound(const char *file, u16 id, u16 freq, u8 format);
|
||||
|
||||
/// Deletes from RAM the sound file stored in the specified slot.
|
||||
///
|
||||
|
@ -31,17 +31,17 @@ extern "C" {
|
||||
#define NF_SLOTS_SPR256PAL 64
|
||||
|
||||
/// Buffers to hold 256 color sprite graphics
|
||||
extern char* NF_BUFFER_SPR256GFX[NF_SLOTS_SPR256GFX];
|
||||
extern char *NF_BUFFER_SPR256GFX[NF_SLOTS_SPR256GFX];
|
||||
|
||||
/// Buffers to hold 256 color sprite palettes
|
||||
extern char* NF_BUFFER_SPR256PAL[NF_SLOTS_SPR256PAL];
|
||||
extern char *NF_BUFFER_SPR256PAL[NF_SLOTS_SPR256PAL];
|
||||
|
||||
/// Struct that holds information about sprite graphics in RAM
|
||||
typedef struct {
|
||||
u32 size; ///< Size in bytes of the graphics data
|
||||
u16 width; ///< Width of graphics data
|
||||
u16 height; ///< Height of graphics data
|
||||
bool available; ///< True if this slot is free, false otherwise
|
||||
u32 size; ///< Size in bytes of the graphics data
|
||||
u16 width; ///< Width of graphics data
|
||||
u16 height; ///< Height of graphics data
|
||||
bool available; ///< True if this slot is free, false otherwise
|
||||
} NF_TYPE_SPR256GFX_INFO;
|
||||
|
||||
/// Information of all sprite graphics in RAM
|
||||
@ -49,8 +49,8 @@ extern NF_TYPE_SPR256GFX_INFO NF_SPR256GFX[NF_SLOTS_SPR256GFX];
|
||||
|
||||
/// Struct that holds information about sprite palettes in RAM
|
||||
typedef struct {
|
||||
u32 size; ///< Size in bytes of the palette
|
||||
bool available; ///< True if this slot is free, false otherwise
|
||||
u32 size; ///< Size in bytes of the palette
|
||||
bool available; ///< True if this slot is free, false otherwise
|
||||
} NF_TYPE_SPR256PAL_INFO;
|
||||
|
||||
/// Information of all palettes in RAM
|
||||
@ -58,15 +58,15 @@ extern NF_TYPE_SPR256PAL_INFO NF_SPR256PAL[NF_SLOTS_SPR256PAL];
|
||||
|
||||
/// Struct that holds information about sprite graphics in VRAM
|
||||
typedef struct {
|
||||
u32 size; ///< Size in bytes of the graphics data
|
||||
u16 width; ///< Width of graphics data
|
||||
u16 height; ///< Height of graphics data
|
||||
u32 address; ///< Address of the graphics in VRAM
|
||||
u16 ramid; ///< RAM slot with the original copy of the graphics
|
||||
u16 framesize; ///< Size of a frame in bytes
|
||||
u16 lastframe; ///< Last frame index
|
||||
bool keepframes; ///< For animated sprites, keep all frames in RAM
|
||||
bool inuse; ///< True if this slot is in use
|
||||
u32 size; ///< Size in bytes of the graphics data
|
||||
u16 width; ///< Width of graphics data
|
||||
u16 height; ///< Height of graphics data
|
||||
u32 address; ///< Address of the graphics in VRAM
|
||||
u16 ramid; ///< RAM slot with the original copy of the graphics
|
||||
u16 framesize; ///< Size of a frame in bytes
|
||||
u16 lastframe; ///< Last frame index
|
||||
bool keepframes; ///< For animated sprites, keep all frames in RAM
|
||||
bool inuse; ///< True if this slot is in use
|
||||
} NF_TYPE_SPR256VRAM_INFO;
|
||||
|
||||
/// Information of all sprite graphics in VRAM
|
||||
@ -74,8 +74,8 @@ extern NF_TYPE_SPR256VRAM_INFO NF_SPR256VRAM[2][128];
|
||||
|
||||
/// Struct that holds information about sprite palettes in VRAM
|
||||
typedef struct {
|
||||
bool inuse; ///< True if this slot is in use
|
||||
u8 ramslot; ///< Slot index of the original palette in RAM
|
||||
bool inuse; ///< True if this slot is in use
|
||||
u8 ramslot; ///< Slot index of the original palette in RAM
|
||||
} NF_TYPE_SPRPALSLOT_INFO;
|
||||
|
||||
/// Information of all palettes in VRAM
|
||||
@ -83,25 +83,25 @@ extern NF_TYPE_SPRPALSLOT_INFO NF_SPRPALSLOT[2][16];
|
||||
|
||||
/// Struct that defines OAM information
|
||||
typedef struct {
|
||||
u8 index; ///< Sprite number
|
||||
s16 x; ///< X coordinate
|
||||
s16 y; ///< Y coordinate
|
||||
u8 layer; ///< Layer priority
|
||||
u8 pal; ///< Palette index
|
||||
u32 size; ///< Sprite of the sprite (macro)
|
||||
u32 color; ///< Color mode (macro)
|
||||
u32* gfx; ///< Pointer to the graphics data
|
||||
s8 rot; ///< Rotation matrix index (0 - 31, -1 = none)
|
||||
bool doublesize; ///< Enable double size mode when rotating
|
||||
bool hide; ///< Hide the sprite
|
||||
bool vflip; ///< Vertical flip
|
||||
bool hflip; ///< Horizontal flip
|
||||
bool mosaic; ///< Enable mosaic effect
|
||||
u16 gfxid; ///< Graphics object ID
|
||||
u16 frame; ///< Current frame
|
||||
u16 framesize; ///< Size of the frame in bytes
|
||||
u16 lastframe; ///< Last frame
|
||||
bool created; ///< True if this sprite has been created
|
||||
u8 index; ///< Sprite number
|
||||
s16 x; ///< X coordinate
|
||||
s16 y; ///< Y coordinate
|
||||
u8 layer; ///< Layer priority
|
||||
u8 pal; ///< Palette index
|
||||
u32 size; ///< Sprite of the sprite (macro)
|
||||
u32 color; ///< Color mode (macro)
|
||||
u32 *gfx; ///< Pointer to the graphics data
|
||||
s8 rot; ///< Rotation matrix index (0 - 31, -1 = none)
|
||||
bool doublesize; ///< Enable double size mode when rotating
|
||||
bool hide; ///< Hide the sprite
|
||||
bool vflip; ///< Vertical flip
|
||||
bool hflip; ///< Horizontal flip
|
||||
bool mosaic; ///< Enable mosaic effect
|
||||
u16 gfxid; ///< Graphics object ID
|
||||
u16 frame; ///< Current frame
|
||||
u16 framesize; ///< Size of the frame in bytes
|
||||
u16 lastframe; ///< Last frame
|
||||
bool created; ///< True if this sprite has been created
|
||||
} NF_TYPE_SPRITEOAM_INFO;
|
||||
|
||||
/// OAM information of all sprites
|
||||
@ -109,15 +109,15 @@ extern NF_TYPE_SPRITEOAM_INFO NF_SPRITEOAM[2][128];
|
||||
|
||||
/// Struct with information of sprite allocation in VRAM
|
||||
typedef struct {
|
||||
s32 free; ///< Free VRAM
|
||||
u32 next; ///< Next free location
|
||||
u32 last; ///< Last used location
|
||||
u32 pos[128]; ///< Location in VRAM to reuse after a free
|
||||
u32 size[128]; ///< Size of the block to reuse
|
||||
u16 deleted; ///< Number of free'd blocks
|
||||
s32 fragmented; ///< Fragmented VRAM
|
||||
s32 inarow; ///< Contiguous VRAM
|
||||
s32 max; ///< Maxmimum addressable VRAM
|
||||
s32 free; ///< Free VRAM
|
||||
u32 next; ///< Next free location
|
||||
u32 last; ///< Last used location
|
||||
u32 pos[128]; ///< Location in VRAM to reuse after a free
|
||||
u32 size[128]; ///< Size of the block to reuse
|
||||
u16 deleted; ///< Number of free'd blocks
|
||||
s32 fragmented; ///< Fragmented VRAM
|
||||
s32 inarow; ///< Contiguous VRAM
|
||||
s32 max; ///< Maxmimum addressable VRAM
|
||||
} NF_TYPE_SPRVRAM_INFO;
|
||||
|
||||
/// Information of sprite allocation in VRAM of both screens
|
||||
@ -196,7 +196,7 @@ void NF_InitSpriteSys(int screen, ...);
|
||||
/// @param id Slot number (0 - 255).
|
||||
/// @param width Width of the graphics object (in pixels).
|
||||
/// @param height Height of the graphics object (in pixels).
|
||||
void NF_LoadSpriteGfx(const char* file, u16 id, u16 width, u16 height);
|
||||
void NF_LoadSpriteGfx(const char *file, u16 id, u16 width, u16 height);
|
||||
|
||||
/// Delete from RAM the graphics of the selected slot and mark it as free.
|
||||
///
|
||||
@ -230,7 +230,7 @@ void NF_UnloadSpriteGfx(u16 id);
|
||||
///
|
||||
/// @param file File name without extension.
|
||||
/// @param id Slot number (0 - 63).
|
||||
void NF_LoadSpritePal(const char* file, u8 id);
|
||||
void NF_LoadSpritePal(const char *file, u8 id);
|
||||
|
||||
/// Delete the selected palette from RAM and mark it as free.
|
||||
///
|
||||
@ -433,7 +433,7 @@ void NF_SpriteUpdatePalette(u8 screen, u8 pal);
|
||||
/// @param r Red component (0 - 31).
|
||||
/// @param g Green component (0 - 31).
|
||||
/// @param b Blue component (0 - 31).
|
||||
void NF_SpriteGetPalColor(u8 screen, u8 pal, u8 number, u8* r, u8* g, u8* b);
|
||||
void NF_SpriteGetPalColor(u8 screen, u8 pal, u8 number, u8 *r, u8 *g, u8 *b);
|
||||
|
||||
/// @}
|
||||
|
||||
|
@ -44,33 +44,33 @@ extern "C" {
|
||||
|
||||
/// Struct that holds information about 3D sprites
|
||||
typedef struct {
|
||||
s16 x; ///< X coordinate
|
||||
s16 y; ///< Y coordinate
|
||||
s16 z; ///< Z coordinate
|
||||
s16 rx; ///< X axis rotation (-512 << 6 to 512 << 6)
|
||||
s16 ry; ///< Y axis rotation (-512 << 6 to 512 << 6)
|
||||
s16 rz; ///< Z axis rotation (-512 << 6 to 512 << 6)
|
||||
bool rot; ///< True if the sprite is being rotated
|
||||
u16 sx; ///< X scale (0 to 64 << 6 to more than 512 << 6)
|
||||
u16 sy; ///< Y scale (0 to 64 << 6 to more than 512 << 6)
|
||||
bool scale; ///< True if the sprite is being scaled
|
||||
s16 width; ///< Sprite width
|
||||
s16 height; ///< Sprite height
|
||||
bool inuse; ///< True if the sprite is being used
|
||||
bool show; ///< True if the sprite has to be drawn
|
||||
u32 gfx_tex_format; ///< Texture format
|
||||
u32 gfx; ///< Address of the texture in VRAM
|
||||
u16 gfxid; ///< ID of the texture/graphics being used by the sprite
|
||||
u16 frame; ///< Current frame
|
||||
u16 newframe; ///< Next frame
|
||||
u16 framesize; ///< Frame size in bytes
|
||||
u16 lastframe; ///< Last frame
|
||||
u32 gfx_pal_format; ///< Palette format
|
||||
u32 pal; ///< Address of the palette in VRAM
|
||||
u16 palid; ///< ID of the palette being used by the sprite
|
||||
u16 prio; ///< Sprite priority (lower values are higher priorities)
|
||||
u8 poly_id; ///< Polygon ID (0 by default, don't use 63)
|
||||
u8 alpha; ///< Alpha value (0 - 31) (31 by default)
|
||||
s16 x; ///< X coordinate
|
||||
s16 y; ///< Y coordinate
|
||||
s16 z; ///< Z coordinate
|
||||
s16 rx; ///< X axis rotation (-512 << 6 to 512 << 6)
|
||||
s16 ry; ///< Y axis rotation (-512 << 6 to 512 << 6)
|
||||
s16 rz; ///< Z axis rotation (-512 << 6 to 512 << 6)
|
||||
bool rot; ///< True if the sprite is being rotated
|
||||
u16 sx; ///< X scale (0 to 64 << 6 to more than 512 << 6)
|
||||
u16 sy; ///< Y scale (0 to 64 << 6 to more than 512 << 6)
|
||||
bool scale; ///< True if the sprite is being scaled
|
||||
s16 width; ///< Sprite width
|
||||
s16 height; ///< Sprite height
|
||||
bool inuse; ///< True if the sprite is being used
|
||||
bool show; ///< True if the sprite has to be drawn
|
||||
u32 gfx_tex_format; ///< Texture format
|
||||
u32 gfx; ///< Address of the texture in VRAM
|
||||
u16 gfxid; ///< ID of the texture/graphics being used by the sprite
|
||||
u16 frame; ///< Current frame
|
||||
u16 newframe; ///< Next frame
|
||||
u16 framesize; ///< Frame size in bytes
|
||||
u16 lastframe; ///< Last frame
|
||||
u32 gfx_pal_format; ///< Palette format
|
||||
u32 pal; ///< Address of the palette in VRAM
|
||||
u16 palid; ///< ID of the palette being used by the sprite
|
||||
u16 prio; ///< Sprite priority (lower values are higher priorities)
|
||||
u8 poly_id; ///< Polygon ID (0 by default, don't use 63)
|
||||
u8 alpha; ///< Alpha value (0 - 31) (31 by default)
|
||||
} NF_TYPE_3DSPRITE_INFO;
|
||||
|
||||
/// Information of all 3D sprites
|
||||
@ -78,15 +78,15 @@ extern NF_TYPE_3DSPRITE_INFO NF_3DSPRITE[NF_3DSPRITES];
|
||||
|
||||
/// Struct that holds information about 3D sprite textures in VRAM
|
||||
typedef struct {
|
||||
u32 size; ///< Size of the texture in bytes
|
||||
u16 width; ///< Width
|
||||
u16 height; ///< Height
|
||||
u32 address; ///< Address in VRAM
|
||||
u16 ramid; ///< RAM slot where it comes from
|
||||
u16 framesize; ///< Frame size in bytes
|
||||
u16 lastframe; ///< Last frame
|
||||
bool keepframes; ///< For animated sprites, keep all frames in RAM
|
||||
bool inuse; ///< True if this slot is in use
|
||||
u32 size; ///< Size of the texture in bytes
|
||||
u16 width; ///< Width
|
||||
u16 height; ///< Height
|
||||
u32 address; ///< Address in VRAM
|
||||
u16 ramid; ///< RAM slot where it comes from
|
||||
u16 framesize; ///< Frame size in bytes
|
||||
u16 lastframe; ///< Last frame
|
||||
bool keepframes; ///< For animated sprites, keep all frames in RAM
|
||||
bool inuse; ///< True if this slot is in use
|
||||
} NF_TYPE_TEX256VRAM_INFO;
|
||||
|
||||
/// Information of all 3D sprite textures in VRAM
|
||||
@ -94,8 +94,8 @@ extern NF_TYPE_TEX256VRAM_INFO NF_TEX256VRAM[NF_3DSPRITES];
|
||||
|
||||
/// Struct that holds information about 3D sprite palettes in VRAM
|
||||
typedef struct {
|
||||
bool inuse; ///< True if this slot is in use
|
||||
u8 ramslot; ///< Slot index of the original palette in RAM
|
||||
bool inuse; ///< True if this slot is in use
|
||||
u8 ramslot; ///< Slot index of the original palette in RAM
|
||||
} NF_TYPE_3DSPRPALSLOT_INFO;
|
||||
|
||||
/// Information of all 3D sprite palettes in VRAM
|
||||
@ -103,14 +103,14 @@ extern NF_TYPE_3DSPRPALSLOT_INFO NF_TEXPALSLOT[32];
|
||||
|
||||
/// Struct with information of 3D sprite allocation in VRAM
|
||||
typedef struct {
|
||||
s32 free; ///< Free VRAM
|
||||
u32 next; ///< Next free location
|
||||
u32 last; ///< Last used location
|
||||
u32 pos[NF_3DSPRITES]; ///< Location in VRAM to reuse after a free
|
||||
u32 size[NF_3DSPRITES]; ///< Size of the block to reuse
|
||||
u16 deleted; ///< Number of free'd blocks
|
||||
s32 fragmented; ///< Fragmented VRAM
|
||||
s32 inarow; ///< Contiguous VRAM
|
||||
s32 free; ///< Free VRAM
|
||||
u32 next; ///< Next free location
|
||||
u32 last; ///< Last used location
|
||||
u32 pos[NF_3DSPRITES]; ///< Location in VRAM to reuse after a free
|
||||
u32 size[NF_3DSPRITES]; ///< Size of the block to reuse
|
||||
u16 deleted; ///< Number of free'd blocks
|
||||
s32 fragmented; ///< Fragmented VRAM
|
||||
s32 inarow; ///< Contiguous VRAM
|
||||
} NF_TYPE_TEXVRAM_INFO;
|
||||
|
||||
/// Information of 3D sprite allocation in VRAM
|
||||
@ -118,9 +118,9 @@ extern NF_TYPE_TEXVRAM_INFO NF_TEXVRAM;
|
||||
|
||||
/// Struct with information about created 3D sprites
|
||||
typedef struct {
|
||||
s16 total; ///< Total number of 3D sprites created
|
||||
u16 id[NF_3DSPRITES]; ///< Sprite IDs
|
||||
u16 bck[NF_3DSPRITES]; ///< Backup IDs
|
||||
s16 total; ///< Total number of 3D sprites created
|
||||
u16 id[NF_3DSPRITES]; ///< Sprite IDs
|
||||
u16 bck[NF_3DSPRITES]; ///< Backup IDs
|
||||
} NF_TYPE_CREATED_3DSPRITE_INFO;
|
||||
|
||||
/// Information of created 3D sprites
|
||||
@ -394,7 +394,7 @@ void NF_3dSpriteUpdatePalette(u8 pal);
|
||||
/// @param r Red component (0 - 31).
|
||||
/// @param g Green component (0 - 31).
|
||||
/// @param b Blue component (0 - 31).
|
||||
void NF_3dSpriteGetPalColor(u8 pal, u8 number, u8* r, u8* g, u8* b);
|
||||
void NF_3dSpriteGetPalColor(u8 pal, u8 number, u8 *r, u8 *g, u8 *b);
|
||||
|
||||
/// Sets the depth of the selected 3D sprite.
|
||||
///
|
||||
|
@ -32,13 +32,13 @@ extern "C" {
|
||||
|
||||
/// Struct that holds text layer information
|
||||
typedef struct {
|
||||
u16 width; ///< Rightmost tile of a row (for 32 columns this is 31)
|
||||
u16 height; ///< Bottom-most tile of a column (for 24 rows this is 23)
|
||||
u8 rotation; ///< Text rotation
|
||||
u8 slot; ///< Slot where the tileset of this text layer is loaded
|
||||
u8 pal; ///< Palette used for the text (0 by default)
|
||||
bool exist; ///< True if this layer has been loaded
|
||||
bool update; ///< True if this layer needs to be updated
|
||||
u16 width; ///< Rightmost tile of a row (for 32 columns this is 31)
|
||||
u16 height; ///< Bottom-most tile of a column (for 24 rows this is 23)
|
||||
u8 rotation; ///< Text rotation
|
||||
u8 slot; ///< Slot where the tileset of this text layer is loaded
|
||||
u8 pal; ///< Palette used for the text (0 by default)
|
||||
bool exist; ///< True if this layer has been loaded
|
||||
bool update; ///< True if this layer needs to be updated
|
||||
} NF_TYPE_TEXT_INFO;
|
||||
|
||||
/// Information of all text layers.
|
||||
@ -93,7 +93,7 @@ void NF_InitTextSys(u8 screen);
|
||||
/// @param width Map width (in pixels)
|
||||
/// @param height Map height (in pixels)
|
||||
/// @param rotation Rotation (0 - 2)
|
||||
void NF_LoadTextFont(const char* file, const char* name, u16 width, u16 height, u8 rotation);
|
||||
void NF_LoadTextFont(const char *file, const char *name, u16 width, u16 height, u8 rotation);
|
||||
|
||||
/// Delete from RAM the font with the specified name.
|
||||
///
|
||||
@ -104,7 +104,7 @@ void NF_LoadTextFont(const char* file, const char* name, u16 width, u16 height,
|
||||
/// ```
|
||||
///
|
||||
/// @param name Font name
|
||||
void NF_UnloadTextFont(const char* name);
|
||||
void NF_UnloadTextFont(const char *name);
|
||||
|
||||
/// Create a special tiled background to write text on it.
|
||||
///
|
||||
@ -122,7 +122,7 @@ void NF_UnloadTextFont(const char* name);
|
||||
/// @param layer Background layer (0 - 3)
|
||||
/// @param rotation Rotation (0 - 2)
|
||||
/// @param name Font name
|
||||
void NF_CreateTextLayer(u8 screen, u8 layer, u8 rotation, const char* name);
|
||||
void NF_CreateTextLayer(u8 screen, u8 layer, u8 rotation, const char *name);
|
||||
|
||||
/// Delete a text layer.
|
||||
///
|
||||
@ -167,7 +167,7 @@ void NF_DeleteTextLayer(u8 screen, u8 layer);
|
||||
/// @param x X coordinate
|
||||
/// @param y Y coordinate
|
||||
/// @param text String to write to the screen
|
||||
void NF_WriteText(u8 screen, u8 layer, u16 x, u16 y, const char* text);
|
||||
void NF_WriteText(u8 screen, u8 layer, u16 x, u16 y, const char *text);
|
||||
|
||||
/// Copy the temporary text buffers of both screens to VRAM.
|
||||
///
|
||||
|
@ -63,7 +63,7 @@ extern "C" {
|
||||
/// @param width Map width (in pixels)
|
||||
/// @param height Map height (in pixels)
|
||||
/// @param rotation Rotation (0 - 2)
|
||||
void NF_LoadTextFont16(const char* file, const char* name, u16 width, u16 height, u8 rotation);
|
||||
void NF_LoadTextFont16(const char *file, const char *name, u16 width, u16 height, u8 rotation);
|
||||
|
||||
/// Create a special tiled background to write text on it with a 8x16 font.
|
||||
///
|
||||
@ -81,7 +81,7 @@ void NF_LoadTextFont16(const char* file, const char* name, u16 width, u16 height
|
||||
/// @param layer Background layer (0 - 3)
|
||||
/// @param rotation Rotation (0 - 2)
|
||||
/// @param name Font name
|
||||
void NF_CreateTextLayer16(u8 screen, u8 layer, u8 rotation, const char* name);
|
||||
void NF_CreateTextLayer16(u8 screen, u8 layer, u8 rotation, const char *name);
|
||||
|
||||
/// Write text in a layer with a 8x16 font at the specified coordinates.
|
||||
///
|
||||
@ -112,7 +112,7 @@ void NF_CreateTextLayer16(u8 screen, u8 layer, u8 rotation, const char* name);
|
||||
/// @param x X coordinate
|
||||
/// @param y Y coordinate
|
||||
/// @param text String to write to the screen
|
||||
void NF_WriteText16(u8 screen, u8 layer, u16 x, u16 y, const char* text);
|
||||
void NF_WriteText16(u8 screen, u8 layer, u16 x, u16 y, const char *text);
|
||||
|
||||
/// Clears the contents of a text layer with a 8x16 font filling it with zeroes.
|
||||
///
|
||||
|
@ -49,23 +49,23 @@ extern u8 NF_BANKS_TILES[2];
|
||||
extern u8 NF_BANKS_MAPS[2];
|
||||
|
||||
/// Buffers to hold background tiles.
|
||||
extern char* NF_BUFFER_BGTILES[NF_SLOTS_TBG];
|
||||
extern char *NF_BUFFER_BGTILES[NF_SLOTS_TBG];
|
||||
|
||||
/// Buffers to hold background maps.
|
||||
extern char* NF_BUFFER_BGMAP[NF_SLOTS_TBG];
|
||||
extern char *NF_BUFFER_BGMAP[NF_SLOTS_TBG];
|
||||
|
||||
/// Buffers to hold background palettes.
|
||||
extern char* NF_BUFFER_BGPAL[NF_SLOTS_TBG];
|
||||
extern char *NF_BUFFER_BGPAL[NF_SLOTS_TBG];
|
||||
|
||||
/// Struct that holds information about regular tiled backgrounds.
|
||||
typedef struct {
|
||||
char name[32]; ///< Background name
|
||||
u32 tilesize; ///< Tileset size
|
||||
u32 mapsize; ///< Map size
|
||||
u32 palsize; ///< Palette size
|
||||
u16 width; ///< Background width
|
||||
u16 height; ///< Background height
|
||||
bool available; ///< If the background is available it is true.
|
||||
char name[32]; ///< Background name
|
||||
u32 tilesize; ///< Tileset size
|
||||
u32 mapsize; ///< Map size
|
||||
u32 palsize; ///< Palette size
|
||||
u16 width; ///< Background width
|
||||
u16 height; ///< Background height
|
||||
bool available; ///< If the background is available it is true.
|
||||
} NF_TYPE_TBG_INFO;
|
||||
|
||||
/// Information of all tiled backgrounds.
|
||||
@ -73,9 +73,9 @@ extern NF_TYPE_TBG_INFO NF_TILEDBG[NF_SLOTS_TBG];
|
||||
|
||||
/// Struct that holds information about extended palettes.
|
||||
typedef struct {
|
||||
char* buffer; ///< Buffer that holds the palette
|
||||
u32 palsize; ///< Palette size
|
||||
bool inuse; ///< True if the slot is in use.
|
||||
char *buffer; ///< Buffer that holds the palette
|
||||
u32 palsize; ///< Palette size
|
||||
bool inuse; ///< True if the slot is in use.
|
||||
} NF_TYPE_EXBGPAL_INFO;
|
||||
|
||||
/// Information of all extended palettes.
|
||||
@ -94,19 +94,19 @@ extern NF_TYPE_EXBGPAL_INFO NF_EXBGPAL[NF_SLOTS_EXBGPAL];
|
||||
/// - 2: 256 x Largen than 512
|
||||
/// - 3: Both dimensions are larger than 512
|
||||
typedef struct {
|
||||
u8 tilebase; ///< Initial VRAM block used by the tile set
|
||||
u8 tileblocks; ///< Number of blocks used by the tile set
|
||||
u8 mapbase; ///< Initial VRAM block used by the map
|
||||
u8 mapblocks; ///< Number of blocks used by the map
|
||||
u16 bgwidth; ///< Background width
|
||||
u16 bgheight; ///< Background height
|
||||
u16 mapwidth; ///< Map width
|
||||
u16 mapheight; ///< Map height
|
||||
u8 bgtype; ///< Background type
|
||||
u8 bgslot; ///< Graphics buffer used (NF_BUFFER_BGMAP)
|
||||
u8 blockx; ///< Map block (horizontal)
|
||||
u8 blocky; ///< Map block (vertical)
|
||||
bool created; ///< True if the background has been created
|
||||
u8 tilebase; ///< Initial VRAM block used by the tile set
|
||||
u8 tileblocks; ///< Number of blocks used by the tile set
|
||||
u8 mapbase; ///< Initial VRAM block used by the map
|
||||
u8 mapblocks; ///< Number of blocks used by the map
|
||||
u16 bgwidth; ///< Background width
|
||||
u16 bgheight; ///< Background height
|
||||
u16 mapwidth; ///< Map width
|
||||
u16 mapheight; ///< Map height
|
||||
u8 bgtype; ///< Background type
|
||||
u8 bgslot; ///< Graphics buffer used (NF_BUFFER_BGMAP)
|
||||
u8 blockx; ///< Map block (horizontal)
|
||||
u8 blocky; ///< Map block (vertical)
|
||||
bool created; ///< True if the background has been created
|
||||
} NF_TYPE_TBGLAYERS_INFO;
|
||||
|
||||
/// Information of all backgrounds loaded to the screen
|
||||
@ -195,7 +195,7 @@ void NF_InitTiledBgSys(u8 screen);
|
||||
/// @param name Name used for the BG for other functions.
|
||||
/// @param width BG width.
|
||||
/// @param height BG height.
|
||||
void NF_LoadTiledBg(const char* file, const char* name, u16 width, u16 height);
|
||||
void NF_LoadTiledBg(const char *file, const char *name, u16 width, u16 height);
|
||||
|
||||
/// Load a tilesed and palette from FAT to RAM.
|
||||
///
|
||||
@ -218,7 +218,8 @@ void NF_LoadTiledBg(const char* file, const char* name, u16 width, u16 height);
|
||||
/// @param height Height of the BG in pixels.
|
||||
/// @param tile_start First tile to load.
|
||||
/// @param tile_end Last tile to load.
|
||||
void NF_LoadTilesForBg(const char* file, const char* name, u16 width, u16 height, u16 tile_start, u16 tile_end);
|
||||
void NF_LoadTilesForBg(const char *file, const char *name, u16 width, u16 height,
|
||||
u16 tile_start, u16 tile_end);
|
||||
|
||||
/// Delete from RAM the BG with the specified name.
|
||||
///
|
||||
@ -234,7 +235,7 @@ void NF_LoadTilesForBg(const char* file, const char* name, u16 width, u16 height
|
||||
/// ```
|
||||
///
|
||||
/// @param name Name used for the BG.
|
||||
void NF_UnloadTiledBg(const char* name);
|
||||
void NF_UnloadTiledBg(const char *name);
|
||||
|
||||
/// Create a BG on the screen, using data loaded in RAM.
|
||||
///
|
||||
@ -251,7 +252,7 @@ void NF_UnloadTiledBg(const char* name);
|
||||
/// @param screen Screen (0 - 1).
|
||||
/// @param layer Layer (0 - 3).
|
||||
/// @param name Name used for the BG.
|
||||
void NF_CreateTiledBg(u8 screen, u8 layer, const char* name);
|
||||
void NF_CreateTiledBg(u8 screen, u8 layer, const char *name);
|
||||
|
||||
/// Delete the BG of the specified screen and layer.
|
||||
///
|
||||
@ -397,7 +398,7 @@ void NF_BgUpdatePalette(u8 screen, u8 layer);
|
||||
/// @param r Red component result (0 - 31).
|
||||
/// @param g Green component result (0 - 31).
|
||||
/// @param b Blue component result (0 - 31).
|
||||
void NF_BgGetPalColor(u8 screen, u8 layer, u8 number, u8* r, u8* g, u8* b);
|
||||
void NF_BgGetPalColor(u8 screen, u8 layer, u8 number, u8 *r, u8 *g, u8 *b);
|
||||
|
||||
/// Returns the number of extended palette used by specified tile.
|
||||
///
|
||||
@ -448,7 +449,7 @@ void NF_SetTilePal(u8 screen, u8 layer, u16 tile_x, u16 tile_y, u8 pal);
|
||||
///
|
||||
/// @param file File (.pal extension).
|
||||
/// @param slot RAM slot (0 - 127)
|
||||
void NF_LoadExBgPal(const char* file, u8 slot);
|
||||
void NF_LoadExBgPal(const char *file, u8 slot);
|
||||
|
||||
/// Deletes a loaded palette from RAM.
|
||||
///
|
||||
|
@ -110,7 +110,7 @@ void NF_WiFiDisconnectAp(void);
|
||||
/// @param address IP address.
|
||||
/// @param port Port.
|
||||
/// @return True if it has been created successfully
|
||||
bool NF_WIFI_CreateUdpSender(const char* address, u16 port);
|
||||
bool NF_WIFI_CreateUdpSender(const char *address, u16 port);
|
||||
|
||||
/// Creates a socket in server mode using UDP.
|
||||
///
|
||||
@ -142,7 +142,7 @@ bool NF_WIFI_CreateUdpListener(u16 port);
|
||||
///
|
||||
/// @param data Text string to be sent.
|
||||
/// @return True on success.
|
||||
bool NF_WIFI_UdpSend(const char* data);
|
||||
bool NF_WIFI_UdpSend(const char *data);
|
||||
|
||||
/// Listens to data from the currently open socket.
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user