assert.h | |
---|
assert(x) | macro, assert x == true |
ctype.h | |
---|
bool isalpha(char c); | is a letter (a-z, A-Z) |
bool isupper(char c); | is an uppercase letter (A-Z) |
bool islower(char c); | is a lowercase letter (a-z) |
bool isdigit(char c); | is a digit (0-9) |
bool isspace(char c); | is a space (' '), tab (\\t), or newline (\\n) |
char toupper(char c); | uppercase if it is a letter (a-z), otherwise unchanged |
char tolower(char c); | lowercase if it is a letter (A-Z), otherwise unchanged. |
limits.h | |
---|
rand.h | |
---|
initrand(uint16_t seed) | initalise the pseudo-random number generator |
uint16_t __rand_seed | the random number seed, can be saved and restored if needed |
uint8_t rand(void) | returns a random byte (8 bit) value. |
uint16_t randw(void) | returns a random word (16 bit) value |
void initarand(uint16_t seed) | inits random generator using the linear lagged additive method |
uint8_t arand(void) | a random number generated with the linear lagged additive method |
setjmp.h | |
---|
stdarg.h | -> asm/sm83/stdarg.h |
---|
stdatomic.h | |
---|
stdbool.h | |
---|
bool | boolean type |
false | |
true | |
stddef.h | |
---|
NULL | the null value |
ptrdiff_t | |
size_t | |
max_align_t | |
wchar_t | |
rsize_t | |
errno_t | |
offsetof(s, m) | |
stdint.h | |
---|
int8_t | standard signed byte |
int16_t | standard signed word |
int32_t | |
int64_t | |
uint8_t | standard unsigned byte |
uint16_t | standard unsigned word |
uint32_t | |
uint64_t | |
intptr_t | types for `void *' pointers |
uintptr_t | |
stdio.h | |
---|
void putchar(char c) | print char to stdout |
void printf(const char *format, …) | print the string and arguments given by format(see stdio.h) to stdout |
void sprintf(char *str, const char *format, ...) | print the string and arguments given by format to a buffer |
void puts(const char *s) | writes the string and a trailing newline to stdout |
char *gets(char *s) | reads a line from stdin into a buffer |
char getchar(void) | reads and returns a single character from stdin |
stdlib.h | |
---|
void exit(int status) | normal program termination |
int abs(int i) | absolute value of int |
long labs(long num) | absolute value of long int |
int atoi(const char *s) | converts an ASCII string to an int |
long atol(const char *s) | converts an ASCII string to a long |
char *itoa(int n, char *s, unsigned char radix) | converts the int n into the base radix ASCII string s, radix 10 is decimal |
char *uitoa(unsigned int n, char *s, unsigned char radix) | converts an unsigned int into a radix base ASCII string |
char *ltoa(long n, char *s, unsigned char radix) | converts a long into a base radix ASCII string |
char *ultoa(unsigned long n, char *s, unsigned char radix) | converts an unsigned long into a base radix ASCII string |
void *calloc (size_t nmemb, size_t size) | |
void *malloc (size_t size) | |
void *realloc (void *ptr, size_t size) | |
void *aligned_alloc(size_t alignment, size_t size) | |
void free (void * ptr) | |
void *bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *) REENTRANT) | binary search |
void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *) REENTRANT) | quicksort |
stdnoreturn.h | |
---|
string.h | -> asm/sm83/string.h |
---|
char *strcpy(char *dest, const char *src) | copies the string src to dest |
int strcmp(const char *s1, const char *s2) | compares strings |
void *memcpy(void *dest, const void *src, size_t len) | copies n bytes from memory area src to memory area dest |
void *memmove (void *dest, const void *src, size_t n) | copies n bytes from src to dest, areas may overlap |
void *memset (void *s, int c, size_t n) | fills the memory region s with n bytes using value c |
char *reverse(char *s) | reverses the characters in a string |
char *strcat(char *s1, const char *s2) | concatenate strings. appends string s2 to the end of string s1 |
int strlen(const char *s) | calculates the length of a string |
char *strncat(char *s1, const char *s2, int n) | concatenate at most n characters from s2 onto the end of s1 |
int strncmp(const char *s1, const char *s2, int n) | compare strings (at most n characters) |
char *strncpy(char *s1, const char *s2, int n) | copy n characters from string s2 to s1 |
int memcmp(const void *buf1, const void *buf2, size_t count) | compare up to count bytes in buffers buf1 and buf2 |
time.h | |
---|
time_t | time type |
clock_t clock(void) | program’s uptime in ticks, wraps around every 18 minues |
time_t time(time_t *t) | divide the above by 60, gives uptime in seconds |
typeof.h | |
---|
types.h | |
---|
NULL | good 'ol NULL |
FALSE | |
TRUE | |
-> asm/types.h | |
fixed | fixed point number |
->asm/sm83/types.h | |
gbdk/bcd.h | -> gb/bcd.h |
---|
gbdk/console.h | |
---|
void gotoxy(uint8_t x, uint8_t y) | move the cursor to an absolute position at x, y |
uint8_t posx(void) | returns the current X position of the cursor |
uint8_t posy(void) | returns the current Y position of the cursor |
void setchar(char c) | writes out a single character at the current cursor position |
void cls(void) | clears the screen |
gbdk/emu_debug.h | |
---|
EMU_MESSAGE(message_text) | macro to display a message in the emulator debug message window |
BGB_MESSAGE(message_text) | exactly the same |
EMU_PROFILE_BEGIN(MSG) | macro to start a profiling block for the emulator (BGB, Emulicious, etc) |
BGB_PROFILE_BEGIN(MSG) | exactly the same |
EMU_PROFILE_END(MSG) | macro to end a profiling block and print the results in the emulator debug message window |
BGB_PROFILE_END(MSG) | same |
void EMU_profiler_message(void) | display preset debug information in the emulator debug messages window |
BGB_profiler_message | same as above |
void EMU_printf(const char *format, ...) | print the string and arguments given by format to the emulator debug message window |
BGB_printf(...) | same |
void EMU_fmtbuf(const unsigned char * format, void * data) | print formatted buffer to the emulator debug message window |
EMU_BREAKPOINT | break code execution in the debugger |
BGB_BREAKPOINT | same |
gbdk/far_ptr.h | |
---|
gbdk/font.h | |
---|
font_t | font type |
font_spect[], font_italic[], font_ibm[], font_min[] | default fonts sets |
font_ibm_fixed[] | backwards compatible font set |
void font_init(void) | initializes the font system. should be called before other font functions |
font_t font_load(void *font) | load a font and set it as the current font, returns handle to that font |
font_t font_set(font_t font_handle) | set the current font by handle returned by font_load() |
sfont_handle | font type, contains first tile of the font and pointer to the base of the font |
void font_color(uint8_t forecolor, uint8_t backcolor) | set the current foreground colour (for pixels) and background colour |
gbdk/gbdecompress.h | -> gb/gbdecompress.h |
---|
gbdk/gbdk-lib.h | -> asm/sm83/provides.h |
---|
gbdk/incbin.h | |
---|
gbdk/metasprites.h | -> gb/metasprites.h |
---|
gbdk/platform.h | -> gb/gb.h, gb/cgb.h, gb/sgb.h |
---|
gbdk/rledecompress.h | |
---|
uint8_t rle_init(void * data) | initialize the RLE decompressor with RLE data at address data |
uint8_t rle_decompress(void * dest, uint8_t len) | decompress RLE compressed data into dest for len bytes |
gbdk/version.h | |
---|
__GBDK_VERSION | version 4.4.0 is defined as 440 |
gb/bcd.h | |
---|
gb/bgb_emu.h | -> gbdk/emu_debug.h |
---|
gb/cgb.h | |
---|
RGB(r, g, b) | macro to create a CGB palette color entry out of 5-bit color components |
RGB8(r, g, b) | macro to create a CGB palette color entry out of 8-bit color components |
RGBHTML(RGB24bit) | macro to convert a 24 Bit RGB color to a CGB palette color entry |
RGB_RED | |
RGB_DARKRED | |
RGB_GREEN | |
RGB_DARKGREEN | |
RGB_BLUE | |
RGB_DARKBLUE | |
RGB_YELLOW | |
RGB_DARKYELLOW | |
RGB_CYAN | |
RGB_AQUA | |
RGB_PINK | |
RGB_PURPLE | |
RGB_BLACK | |
RGB_DARKGRAY | |
RGB_LIGHTGRAY | |
RGB_WHITE | |
RGB_LIGHTFLESH | |
RGB_BROWN | |
RGB_ORANGE | |
RGB_TEAL | |
palette_color_t | color type |
void set_bkg_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) | set CGB background palette(s) |
void set_sprite_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) | set CGB sprite palette(s) |
void set_bkg_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) | sets a single color in the specified CGB background palette |
void set_sprite_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) | sets a single color in the specified CGB sprite palette |
void cpu_slow(void) | set CPU speed to slow (Normal Speed) operation |
void cpu_fast(void) | set CPU speed to fast (CGB Double Speed) operation |
void set_default_palette(void) | sets CGB palette 0 to be compatible with the DMG/GBP |
gb/crash_handler.h | including crash_handler.h installs a handler for an execution of an unitialized memory 0xFF(RST 38) |
---|
gb/drawing.h | slow drawings routines |
---|
GRAPHICS_WIDTH | 160 |
GRAPHICS_HEIGHT | 144 |
void gprint(char *str) | print the string 'str' with no interpretation |
void gprintln(int16_t number, int8_t radix, int8_t signed_value) | print 16 bit number in radix(base) in the default font at the current text position |
void gprintn(int8_t number, int8_t radix, int8_t signed_value) | print 8 bit number in radix(base) in the default font at the current text position |
int8_t gprintf(char *fmt,...) | print the string and arguments given by fmt with arguments |
void plot(uint8_t x, uint8_t y, uint8_t colour, uint8_t mode) | old style plot - try plot_point() |
void plot_point(uint8_t x, uint8_t y) | plot a point in the current drawing mode and colour at x,y |
void switch_data(uint8_t x, uint8_t y, uint8_t *src, uint8_t *dst) | exchanges the tile on screen at x,y with the tile pointed by src, original tile is saved in dst |
void draw_image(uint8_t *data) | draw a full screen image at data |
void line(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2) | draw a line in the current drawing mode and colour from x1,y1 to x2,y2 |
void box(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint8_t style) | draw a rectangle with corners x1,y1 and x2,y2 using fill mode style(one of NOFILL or FILL) |
void circle(uint8_t x, uint8_t y, uint8_t radius, uint8_t style) | draw a circle with centre at x,y and radius using fill mode style(one of NOFILL or FILL) |
uint8_t getpix(uint8_t x, uint8_t y) | returns the current colour of the pixel at x,y |
void wrtchr(char chr) | prints the character chr in the default font at the current text position |
void gotogxy(uint8_t x, uint8_t y) | sets the current text position to x,y |
void color(uint8_t forecolor, uint8_t backcolor, uint8_t mode) | set the current forecolor, backcolor, and draw mode |
gb/emu_debug.h | -> gbdk/emu_debug.h |
---|
gb/gbdecompress.h | |
---|
uint16_t gb_decompress(const uint8_t * sour, uint8_t * dest) | gb-decompress data from sour into dest, GBTD format |
void gb_decompress_bkg_data(uint8_t first_tile, const uint8_t * sour) | gb-decompress background tiles into VRAM |
void gb_decompress_win_data(uint8_t first_tile, const uint8_t * sour) | gb-decompress window tiles into VRAM |
void gb_decompress_sprite_data(uint8_t first_tile, const uint8_t * sour) | gb-decompress sprite tiles into VRAM |
gb/hblankcpy.h | |
---|
uint8_t * hblank_copy_destination | destination address for hblank copy routines |
void hblank_copy_vram(const uint8_t * sour, uint8_t count) | hblank stack copy routine. performs the required STAT_REG, IE_REG, IF_REG manipulation |
void hblank_cpy_vram(const uint8_t * sour, uint8_t count) | hblank stack copy routine. doesn’t perform the required manipulation |
void hblank_copy(uint8_t * dest, const uint8_t * sour, uint16_t size) | hblank stack copy routine (must be called with interrupts disabled!), size rounded to 16-byte chunks |
gb/isr.h | |
---|
gb/metasprites.h | |
---|
metasprite_t | metasprite type: dx, dy, dtile, props |
void hide_sprites_range(uint8_t from, uint8_t to) | hides all hardware sprites in range from <= X < to |
uint8_t move_metasprite_ex(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_prop, uint8_t base_sprite, uint8_t x, uint8_t y) | moves metasprite to the absolute position x and y |
uint8_t move_metasprite(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y) | replaced by move_metasprite_ex above |
uint8_t move_metasprite_flipx(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_prop, uint8_t base_sprite, uint8_t x, uint8_t y) | moves metasprite to the absolute position x and y, flipped by X (horizontally) |
uint8_t move_metasprite_vflip(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y) | obsolete, replaced by the above one |
uint8_t move_metasprite_flipy(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_prop, uint8_t base_sprite, uint8_t x, uint8_t y) | moves metasprite to the absolute position x and y, flipped by Y (vertically) |
uint8_t move_metasprite_hflip(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y) | obsolete |
uint8_t move_metasprite_flipxy(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_prop, uint8_t base_sprite, uint8_t x, uint8_t y) | moves metasprite to the absolute position x and y, flipped by X and Y (horizontally and vertically) |
uint8_t move_metasprite_hvflip(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y) | obsolete |
void hide_metasprite(const metasprite_t * metasprite, uint8_t base_sprite) | hides a metasprite from the screen |
gb/sgb.h | |
---|
uint8_t sgb_check(void) | returns a non-zero value if running on a Super GameBoy |
void sgb_transfer(uint8_t * packet) | transfer a SGB packet |
gb/hardware.h | |
---|
__BYTES _VRAM[] | memory map |
__BYTES _VRAM8000[] | |
__BYTES _VRAM8800[] | |
__BYTES _VRAM9000[] | |
__BYTES _SCRN0[] | |
__BYTES _SCRN1[] | |
__BYTES _SRAM[] | |
__BYTES _RAM[] | |
__BYTES _RAMBANK[] | |
__BYTES _OAMRAM[] | |
__BYTE_REG _IO[] | |
__BYTE_REG _AUD3WAVERAM[] | |
__BYTE_REG _HRAM[] | |
__BYTE_REG rRAMG | MBC5 registers |
__BYTE_REG rROMB0 | |
__BYTE_REG rROMB1 | |
__BYTE_REG rRAMB | |
__BYTE_REG rMBC7_SRAM_ENABLE_1 | MBC7 registers |
__BYTE_REG rMBC7_SRAM_ENABLE_2 | |
__BYTE_REG rMBC7_LATCH_1 | |
__BYTE_REG rMBC7_LATCH_2 | |
__BYTE_REG rMBC7_ACCEL_X_LO | |
__BYTE_REG rMBC7_ACCEL_X_HI | |
__BYTE_REG rMBC7_ACCEL_Y_LO | |
__BYTE_REG rMBC7_ACCEL_Y_HI | |
__REG P1_REG | rP1 joystick register |
__REG SB_REG | rSB serial IO data buffer |
__REG SC_REG | rSC serial IO control register |
__REG DIV_REG | rDIV divider register |
__REG TIMA_REG | rTIMA timer counter |
__REG TMA_REG | rTMA timer modulo |
__REG TAC_REG | rTAC timer control |
__REG IF_REG | rIF interrupt flags |
__REG NR10_REG | rAUD1SWEEP sound Channel 1, NR10: Sweep |
__REG NR11_REG | rAUD1LEN sound Channel 1, NR11: Sound length/Wave pattern duty |
__REG NR12_REG | rAUD1ENV sound Channel 1, NR12: Volume Envelope |
__REG NR13_REG | rAUD1LOW sound Channel 1, NR13: Frequency Low |
__REG NR14_REG | rAUD1HIGH sound Channel 1, NR14: Frequency High |
__REG NR21_REG | rAUD2LEN sound Channel 2, NR21_REG: Tone |
__REG NR22_REG | rAUD2ENV sound Channel 2, NR22_REG: Volume Envelope |
__REG NR23_REG | rAUD2LOW sound Channel 2, NR23_REG: Frequency data Low |
__REG NR24_REG | rAUD2HIGH sound Channel 2, NR24_REG: Frequency data High |
__REG NR30_REG | rAUD3ENA sound Channel 3, NR30_REG: Sound on/off |
__REG NR31_REG | rAUD3LEN sound Channel 3, NR31_REG: Sound Length |
__REG NR32_REG | rAUD3LEVEL sound Channel 3, NR32_REG: Select output level |
__REG NR33_REG | rAUD3LOW sound Channel 3, NR33_REG: Frequency data Low |
__REG NR34_REG | rAUD3HIGH sound Channel 3, NR34_REG: Frequency data High |
__REG NR41_REG | rAUD4LEN sound Channel 4, NR41_REG: Sound Length |
__REG NR42_REG | rAUD4ENV sound Channel 4, NR42_REG: Volume Envelope |
__REG NR43_REG | rAUD4POLY sound Channel 4, NR43_REG: Polynomial Counter |
__REG NR44_REG | rAUD4GO sound Channel 4, NR44_REG: Counter / Consecutive and Initial |
__REG NR50_REG | rAUDVOL sound Master Volume, NR50: Volume and Cart external sound input (VIN) |
__REG NR51_REG | rAUDTERM sound Panning, NR51: Enable/disable left and right output for sound channels |
__REG NR52_REG | rAUDENA sound Master Control, NR52: ON / OFF |
__BYTE_REG AUD3WAVE[16]; | |
__BYTE_REG PCM_SAMPLE[16]; | |
__REG LCDC_REG | rLCDC LCD control |
__REG STAT_REG | rSTAT LCD status |
__REG SCY_REG | rSCY scroll Y |
__REG SCX_REG | rSCX scroll X |
__REG LY_REG | rLY LCDC Y-coordinate |
__REG LYC_REG | rLYC LY compare |
__REG DMA_REG | rDMA DMA transfer |
__REG BGP_REG | rBGP set and Read the Background palette |
__REG OBP0_REG | rOBP0 set and Read the OBJ (Sprite) palette 0 |
__REG OBP1_REG | rOBP1 |
__REG WY_REG | rWY window Y coordinate |
__REG WX_REG | rWX window X coordinate |
__REG KEY1_REG | rKEY1, rSPD cpu speed |
__REG VBK_REG | rVBK VRAM bank select (CGB only) |
__REG HDMA1_REG | rHDMA1 DMA control 1 |
__REG HDMA2_REG | rHDMA2 |
__REG HDMA3_REG | rHDMA3 |
__REG HDMA4_REG | rHDMA4 |
__REG HDMA5_REG | rHDMA5 |
__REG RP_REG | rRP IR port |
__REG BCPS_REG | rBCPS BG color palette specification |
__REG BCPD_REG | rBCPD BG color palette data |
__REG OCPS_REG | rOCPS OBJ color palette specification |
__REG OCPD_REG | rOCPD OBJ color palette data |
__REG SVBK_REG | rSVBK, rSMBK selects the WRAM upper region bank (CGB Only) |
__REG PCM12_REG | rPCM12 sound channel 1&2 PCM amplitude (R) |
__REG PCM34_REG | rPCM34 sound channel 3&4 PCM amplitude (R) |
__REG IE_REG | rIE interrupt enable |
gb/gb.h | |
---|
J_UP | |
J_DOWN | |
J_LEFT | |
J_RIGHT | |
J_A | |
J_B | |
J_SELECT | |
J_START | |
void (*int_handler)(void) | interrupt handler type |
void remove_VBL(int_handler h) | removes the VBL interrupt handler |
void remove_LCD(int_handler h) | removes the LCD interrupt handler |
void remove_TIM(int_handler h) | removes the TIM interrupt handler |
void remove_SIO(int_handler h) | removes the Serial Link / SIO interrupt handler |
void remove_JOY(int_handler h) | removes the JOY interrupt handler |
void add_VBL(int_handler h) | adds a Vertical Blanking interrupt handler, up to 4 |
void add_LCD(int_handler h) | |
void add_TIM(int_handler h) | |
void add_low_priority_TIM(int_handler h) | |
void add_SIO(int_handler h) | |
void add_JOY(int_handler h) | |
void nowait_int_handler(void) | interrupt handler chain terminator that does not wait for .STAT |
void wait_int_handler(void) | default Interrupt handler chain terminator that waits for STAT_REG |
uint8_t cancel_pending_interrupts(void) | cancel pending interrupts |
void mode(uint8_t m) | set the current screen mode |
uint8_t get_mode(void) | |
uint8_t get_system(void) | return SYSTEM_60HZ |
uint8_t _cpu | DMG_TYPE, MGB_TYPE, CGB_TYPE |
uint8_t _is_GBA | gba detection |
volatile uint16_t sys_time | global Time Counter in VBL periods (60Hz) |
__REG _vbl_done | VBL_DONE flag indicating the VBlank ISR has run |
void send_byte(void) | serial link: send the byte in ref _io_out out through the serial port |
void receive_byte(void) | serial link: receive a byte from the serial port into _io_in |
volatile uint8_t _io_status | serial link: current IO Status. An OR of IO_* |
volatile uint8_t _io_in | serial link: byte just read after calling receive_byte() |
volatile uint8_t _io_out | serial link: write byte to send here before calling send_byte() |
__REG _current_bank | CURRENT_BANK tracks current active ROM bank |
SWITCH_ROM(b) | makes default platform MBC switch the active ROM bank |
SWITCH_RAM(b) | switches SRAM bank on MBC1 and other compatible MBCs |
ENABLE_RAM | enables SRAM on MBC1 and other compatible MBCs |
DISABLE_RAM | disables SRAM on MBC1 and other compatible MBCs |
SWITCH_ROM_MBC5(b) | makes MBC5 switch to the active ROM bank |
SWITCH_ROM_MBC5_8M(b) | makes MBC5 to switch the active ROM bank using the full 8MB size |
void delay(uint16_t d) | delays the given number of milliseconds |
uint8_t joypad(void) | reads the joypad: J_START, J_SELECT, J_A, J_B, J_UP, J_DOWN, J_LEFT, J_RIGHT |
uint8_t waitpad(uint8_t mask) | waits until at least one of the buttons given in mask are pressed |
void waitpadup(void) | waits for the directional pad and all buttons to be released |
joypads_t | multiplayer joypad structure |
uint8_t joypad_init(uint8_t npads, joypads_t * joypads) | initializes joypads_t structure for polling multiple joypads |
void joypad_ex(joypads_t * joypads) | polls all avaliable joypads (for the GB and ones connected via SGB) |
void enable_interrupts(void) | enables unmasked interrupts |
void disable_interrupts(void) | disables interrupts |
set_interrupts(uint8_t flags) | clears and sets interrupts VBL_IFLAG, LCD_IFLAG, TIM_IFLAG, SIO_IFLAG, JOY_IFLAG |
void reset(void) | performs a soft reset |
void vsync(void) | halts the CPU and waits for the vertical blank interrupt |
void wait_vbl_done(void) | obsolete, use vsync() |
void display_off(void) | turns the display off |
void refresh_OAM(void) | copies data from shadow OAM to OAM |
void hiramcpy(uint8_t dst, const void *src, uint8_t n) | copies data from somewhere in the lower address space to part of hi-ram |
DISPLAY_ON | turns the display back on |
DISPLAY_OFF | turns the display off |
SHOW_BKG | turns on the background layer |
HIDE_BKG | turns off the background layer |
SHOW_WIN | turns on the Window layer |
HIDE_WIN | turns off the window layer |
SHOW_SPRITES | turns on the sprites layer |
HIDE_SPRITES | turns off the sprites layer |
SPRITES_8x16 | sets sprite size to 8x16 pixels, two tiles one above the other |
SPRITES_8x8 | sets sprite size to 8x8 pixels, one tile |
void set_vram_byte(uint8_t * addr, uint8_t v) | set byte in vram at given memory location |
uint8_t get_vram_byte(uint8_t * addr) | get byte from vram at given memory location(slow) |
uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) | get address of X,Y tile of background map |
void set_1bpp_colors_ex(uint8_t fgcolor, uint8_t bgcolor, uint8_t mode) | sets the Foreground and Background colors used by the set_*_1bpp_*() functions |
void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor) | sets the Foreground and Background colors used by the set_*_1bpp_*() functions |
void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) | sets VRAM Tile Pattern data for the Background / Window |
set_bkg_2bpp_data | same |
void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) | sets VRAM Tile Pattern data for the Background / Window using 1bpp source data |
void get_bkg_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) | copies from Background / Window VRAM Tile Pattern data into a buffer(slow) |
void set_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) | sets a rectangular region of Background Tile Map |
set_tile_map | same |
void set_bkg_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile) | sets a rectangular region of Background Tile Map. The base_tile is added to the tile ID for each map entry |
void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) | sets a rectangular region of Background Tile Map Attributes |
void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) | sets a rectangular area of the Background Tile Map using a sub-region |
set_tile_submap | same |
void set_bkg_based_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile) | sets a rectangular area of the Background Tile Map using a sub-region |
void set_bkg_submap_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) | sets a rectangular area of the Background Tile Map Attributes using a sub-region |
void get_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) | copies a rectangular region of Background Tile Map entries into a buffer(slow) |
uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t) | set single tile t on background layer at x,y |
set_tile_xy | same |
uint8_t * set_bkg_attribute_xy(uint8_t x, uint8_t y, uint8_t a) | set single attribute data a on background layer at x,y |
set_attribute_xy | same |
uint8_t get_bkg_tile_xy(uint8_t x, uint8_t y) | get single tile t on background layer at x,y(slow) |
void move_bkg(uint8_t x, uint8_t y) | moves the Background Layer to the position specified in x and y in pixels |
void scroll_bkg(int8_t x, int8_t y) | moves the Background relative to it's current position |
uint8_t * get_win_xy_addr(uint8_t x, uint8_t y) | get address of X,Y tile of window map |
void set_win_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) | sets VRAM Tile Pattern data for the Window / Background |
void set_win_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) | sets VRAM Tile Pattern data for the Window / Background using 1bpp source data |
void get_win_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) | copies from Window / Background VRAM Tile Pattern data into a buffer(slow) |
void set_win_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) | sets a rectangular region of the Window Tile Map |
void set_win_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile) | sets a rectangular region of the Window Tile Map. The base_tile is added to the tile ID for each map entry |
void set_win_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) | sets a rectangular area of the Window Tile Map using a sub-region |
void set_win_based_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile) | Sets a rectangular area of the Window Tile Map using a sub-region. The base_tile is added to the tiles IDs |
void get_win_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) | copies a rectangular region of Window Tile Map entries into a buffer(slow) |
uint8_t * set_win_tile_xy(uint8_t x, uint8_t y, uint8_t t) | set single tile t on window layer at x,y |
uint8_t get_win_tile_xy(uint8_t x, uint8_t y) | get single tile t on window layer at x,y(slow) |
void move_win(uint8_t x, uint8_t y) | moves the Window to the x,y position on the screen |
void scroll_win(int8_t x, int8_t y) | move the Window relative to its current position |
void set_sprite_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) | sets VRAM Tile Pattern data for Sprites |
set_sprite_2bpp_data | same |
void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) | sets VRAM Tile Pattern data for Sprites using 1bpp source data |
void get_sprite_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) | copies from Sprite VRAM Tile Pattern data into a buffer(slow) |
OAM_item_t | sprite Attributes structure: x, y, tile, prop |
volatile struct OAM_item_t shadow_OAM[] | shadow OAM array in WRAM, that is DMA-transferred into the real OAM each Vblank |
_shadow_OAM_base | MSB of shadow_OAM address is used by OAM DMA copying routine |
DISABLE_OAM_DMA | DISABLE_VBL_TRANSFER disable OAM DMA copy each Vblank |
ENABLE_OAM_DMA | ENABLE_VBL_TRANSFER Enable OAM DMA copy each VBlank and set default shadow_OAM array |
MAX_HARDWARE_SPRITES | 40 |
void SET_SHADOW_OAM_ADDRESS(void * address) | enable OAM DMA copy each VBlank and set it to transfer any 256-byte aligned array |
void set_sprite_tile(uint8_t nb, uint8_t tile) | sets sprite number nb in the OAM to display tile number tile |
uint8_t get_sprite_tile(uint8_t nb) | returns the tile number of sprite number nb in the OAM |
void set_sprite_prop(uint8_t nb, uint8_t prop) | sets the OAM Property Flags of sprite number nb to those defined in prop |
uint8_t get_sprite_prop(uint8_t nb) | returns the OAM Property Flags of sprite number nb |
void move_sprite(uint8_t nb, uint8_t x, uint8_t y) | moves sprite number nb to the x,y position on the screen |
void scroll_sprite(uint8_t nb, int8_t x, int8_t y) | moves sprite number nb relative to its current position |
void hide_sprite(uint8_t nb) | hides sprite number nb by moving it to zero position by Y |
void set_data(uint8_t *vram_addr, const uint8_t *data, uint16_t len) | copies arbitrary data to an address in VRAM |
void get_data(uint8_t *data, uint8_t *vram_addr, uint16_t len) | copies arbitrary data from an address in VRAM into a buffer(slow) |
void vmemcpy(uint8_t *dest, uint8_t *sour, uint16_t len) | copies arbitrary data from an address in VRAM into a buffer |
void set_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, const uint8_t *tiles) | sets a rectangular region of Tile Map entries at a given VRAM Address |
void set_tile_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data, uint8_t base) | sets VRAM Tile Pattern data starting from given base address |
void get_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, uint8_t *tiles) | copies a rectangular region of Tile Map entries from a given VRAM Address into a buffer(slow) |
void set_native_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data) | sets VRAM Tile Pattern data in the native format |
void set_bkg_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) | sets VRAM Tile Pattern data for the Background / Window in the native format |
void set_sprite_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) | sets VRAM Tile Pattern data for Sprites in the native format |
void init_win(uint8_t c) | initializes the entire Window Tile Map with Tile Number c |
void init_bkg(uint8_t c) | initializes the entire Background Tile Map with Tile Number c |
void vmemset (void *s, uint8_t c, size_t n) | fills the VRAM memory region s of size n with Tile Number c |
void fill_bkg_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) | fills a rectangular region of Tile Map entries for the Background layer with tile |
void fill_win_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) | fills a rectangular region of Tile Map entries for the Window layer with tile |