nes.h
Go to the documentation of this file.
#ifndef _NES_H
#define _NES_H
#include <types.h>
#include <stdint.h>
#include <gbdk/version.h>
#include <nes/hardware.h>
#include <nes/rgb_to_nes_macro.h>
#define NINTENDO_NES
// Here NINTENDO means Game Boy & related clones
#ifdef NINTENDO
#undef NINTENDO
#endif
#ifdef SEGA
#undef SEGA
#endif
#ifdef MSX
#undef MSX
#endif
#define SYSTEM_BITS_NTSC 0x00
#define SYSTEM_BITS_PAL 0x40
#define SYSTEM_BITS_DENDY 0x80
extern const uint8_t _SYSTEM;
#define SYSTEM_60HZ 0x00
#define SYSTEM_50HZ 0x01
#define TIMER_VBLANK_PARITY_MODE_SYSTEM_60HZ 0x78
#define TIMER_VBLANK_PARITY_MODE_SYSTEM_50HZ 0x5D
#define RGB(r,g,b) RGB_TO_NES(((r) | ((g) << 2) | ((b) << 4)))
#define RGB8(r,g,b) RGB_TO_NES((((r) >> 6) | (((g) >> 6) << 2) | (((b) >> 6) << 4)))
#define RGBHTML(RGB24bit) RGB_TO_NES((((RGB24bit) >> 22) | ((((RGB24bit) & 0xFFFF) >> 14) << 2) | ((((RGB24bit) & 0xFF) >> 6) << 4)))
#define RGB_RED 0x16 // EGA12
#define RGB_DARKRED 0x06 // EGA4
#define RGB_GREEN 0x2A // EGA10
#define RGB_DARKGREEN 0x1A // EGA2
#define RGB_BLUE 0x12 // EGA9
#define RGB_DARKBLUE 0x02 // EGA1
#define RGB_YELLOW 0x28 // EGA14
#define RGB_DARKYELLOW 0x18 // EGA6
#define RGB_CYAN 0x2C // EGA11
#define RGB_AQUA 0x1C // EGA3
#define RGB_PINK 0x24 // EGA13
#define RGB_PURPLE 0x14 // EGA5
#define RGB_BLACK 0x0F // EGA0
#define RGB_DARKGRAY 0x00 // EGA8
#define RGB_LIGHTGRAY 0x10 // EGA7
#define RGB_WHITE 0x30 // EGA15
typedef uint8_t palette_color_t;
void set_bkg_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) NO_OVERLAY_LOCALS;
void set_sprite_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) NO_OVERLAY_LOCALS;
void set_bkg_palette_entry(uint8_t palette, uint8_t entry, palette_color_t rgb_data) NO_OVERLAY_LOCALS;
void set_sprite_palette_entry(uint8_t palette, uint8_t entry, palette_color_t rgb_data) NO_OVERLAY_LOCALS;
#define J_UP 0x08U
#define J_DOWN 0x04U
#define J_LEFT 0x02U
#define J_RIGHT 0x01U
#define J_A 0x80U
#define J_B 0x40U
#define J_SELECT 0x20U
#define J_START 0x10U
#define M_DRAWING 0x01U
#define M_TEXT_OUT 0x02U
#define M_TEXT_INOUT 0x03U
#define M_NO_SCROLL 0x04U
#define M_NO_INTERP 0x08U
#define S_PALETTE 0x10U
#define S_FLIPX 0x40U
#define S_FLIPY 0x80U
#define S_PRIORITY 0x20U
#define S_PAL(n) n
/* Interrupt flags */
#define EMPTY_IFLAG 0x00U
#define VBL_IFLAG 0x01U
#define LCD_IFLAG 0x02U
#define TIM_IFLAG 0x04U
/* DMG Palettes */
#define DMG_BLACK 0x03
#define DMG_DARK_GRAY 0x02
#define DMG_LITE_GRAY 0x01
#define DMG_WHITE 0x00
#define DMG_PALETTE(C0, C1, C2, C3) ((uint8_t)((((C3) & 0x03) << 6) | (((C2) & 0x03) << 4) | (((C1) & 0x03) << 2) | ((C0) & 0x03)))
/* Limits */
#define SCREENWIDTH DEVICE_SCREEN_PX_WIDTH
#define SCREENHEIGHT DEVICE_SCREEN_PX_HEIGHT
typedef void (*int_handler)(void) NONBANKED;
void remove_VBL(int_handler h) NO_OVERLAY_LOCALS;
void remove_LCD(int_handler h) NO_OVERLAY_LOCALS;
void remove_TIM(int_handler h) NO_OVERLAY_LOCALS;
void add_VBL(int_handler h) NO_OVERLAY_LOCALS;
void add_LCD(int_handler h) NO_OVERLAY_LOCALS;
void add_TIM(int_handler h) NO_OVERLAY_LOCALS;
#define MAX_LCD_ISR_CALLS 4
void mode(uint8_t m) NO_OVERLAY_LOCALS;
uint8_t get_mode(void) NO_OVERLAY_LOCALS;
inline uint8_t get_system(void) {
if(_SYSTEM == SYSTEM_BITS_NTSC)
return SYSTEM_60HZ;
else
return SYSTEM_50HZ;
}
extern volatile uint16_t sys_time;
extern volatile uint8_t _current_bank;
#define CURRENT_BANK _current_bank
#ifndef BANK
#define BANK(VARNAME) ( (uint8_t) & __bank_ ## VARNAME )
#endif
#define BANKREF(VARNAME) void __func_ ## VARNAME(void) __banked __naked { \
__asm \
.local b___func_ ## VARNAME \
___bank_ ## VARNAME = b___func_ ## VARNAME \
.globl ___bank_ ## VARNAME \
__endasm; \
}
#define BANKREF_EXTERN(VARNAME) extern const void __bank_ ## VARNAME;
#define SWITCH_ROM_DUMMY(b)
#define SWITCH_ROM_UNROM(b) _switch_prg0(b)
#define SWITCH_ROM SWITCH_ROM_UNROM
#define SWITCH_RAM(b) 0
#define ENABLE_RAM
#define DISABLE_RAM
void delay(uint16_t d) NO_OVERLAY_LOCALS;
uint8_t joypad(void) NO_OVERLAY_LOCALS;
uint8_t waitpad(uint8_t mask) NO_OVERLAY_LOCALS;
void waitpadup(void) NO_OVERLAY_LOCALS;
typedef struct {
uint8_t npads;
union {
struct {
uint8_t joy0, joy1, joy2, joy3;
};
uint8_t joypads[4];
};
} joypads_t;
uint8_t joypad_init(uint8_t npads, joypads_t * joypads) NO_OVERLAY_LOCALS;
void joypad_ex(joypads_t * joypads) NO_OVERLAY_LOCALS;
inline void enable_interrupts(void) {
__asm__("cli");
}
inline void disable_interrupts(void) {
__asm__("sei");
}
void set_interrupts(uint8_t flags) NO_OVERLAY_LOCALS;
inline void reset(void) {
__asm__("jmp [0xFFFC]");
}
void vsync(void) NO_OVERLAY_LOCALS;
void wait_vbl_done(void) NO_OVERLAY_LOCALS;
void display_on(void) NO_OVERLAY_LOCALS;
void display_off(void) NO_OVERLAY_LOCALS;
void refresh_OAM(void) NO_OVERLAY_LOCALS;
#define DISPLAY_ON \
display_on();
#define DISPLAY_OFF \
display_off();
#define HIDE_LEFT_COLUMN \
shadow_PPUMASK &= ~(PPUMASK_SHOW_BG_LC | PPUMASK_SHOW_SPR_LC); \
#define SHOW_LEFT_COLUMN \
shadow_PPUMASK |= (PPUMASK_SHOW_BG_LC | PPUMASK_SHOW_SPR_LC);
#define SET_BORDER_COLOR(C)
#define SHOW_BKG \
shadow_PPUMASK |= PPUMASK_SHOW_BG;
#define HIDE_BKG \
shadow_PPUMASK &= ~PPUMASK_SHOW_BG;
#define SHOW_SPRITES \
shadow_PPUMASK |= PPUMASK_SHOW_SPR;
#define HIDE_SPRITES \
shadow_PPUMASK &= ~PPUMASK_SHOW_SPR;
#define SPRITES_8x16 \
shadow_PPUCTRL |= PPUCTRL_SPR_8X16;
#define SPRITES_8x8 \
shadow_PPUCTRL &= ~PPUCTRL_SPR_8X16;
void set_vram_byte(uint8_t * addr, uint8_t v) NO_OVERLAY_LOCALS;
uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) NO_OVERLAY_LOCALS;
#define COMPAT_PALETTE(C0,C1,C2,C3) ((uint8_t)(((C3) << 6) | ((C2) << 4) | ((C1) << 2) | (C0)))
inline void set_2bpp_palette(uint16_t palette) {
palette;
}
extern uint16_t _current_1bpp_colors;
void set_1bpp_colors_ex(uint8_t fgcolor, uint8_t bgcolor, uint8_t mode) NO_OVERLAY_LOCALS;
inline void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor) {
set_1bpp_colors_ex(fgcolor, bgcolor, 0);
}
void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS;
#define set_bkg_2bpp_data set_bkg_data
void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS;
void set_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) NO_OVERLAY_LOCALS;
#define set_tile_map set_bkg_tiles
void set_bkg_attributes_nes16x16(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *attributes) NO_OVERLAY_LOCALS;
inline void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *attributes)
{
set_bkg_attributes_nes16x16(x >> 1, y >> 1, (w + 1) >> 1, (h + 1) >> 1, attributes);
}
void set_bkg_submap_attributes_nes16x16(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) NO_OVERLAY_LOCALS;
inline void set_bkg_submap_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *attributes, uint8_t map_w)
{
set_bkg_submap_attributes_nes16x16(x >> 1, y >> 1, (w + 1) >> 1, (h + 1) >> 1, attributes, (map_w + 1) >> 1);
}
inline 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);
void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) NO_OVERLAY_LOCALS;
#define set_tile_submap set_bkg_submap
inline 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);
void get_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) NO_OVERLAY_LOCALS;
uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t) NO_OVERLAY_LOCALS;
#define set_tile_xy set_bkg_tile_xy
void set_bkg_attribute_xy_nes16x16(uint8_t x, uint8_t y, uint8_t a) NO_OVERLAY_LOCALS;
inline void set_bkg_attribute_xy(uint8_t x, uint8_t y, uint8_t a)
{
set_bkg_attribute_xy_nes16x16(x >> 1, y >> 1, a);
}
#define set_attribute_xy set_bkg_attribute_xy
uint8_t get_bkg_tile_xy(uint8_t x, uint8_t y) NO_OVERLAY_LOCALS;
inline void move_bkg(scroll_x_t x, scroll_y_t y) {
// store low 8 bits to shadow scroll registers
bkg_scroll_x = (uint8_t)x;
bkg_scroll_y = (uint8_t)(y >= 240 ? (y - 240) : y);
// store 9th bit of x and y in shadow PPUCTRL register
#if DEVICE_SCREEN_BUFFER_WIDTH > 32 && DEVICE_SCREEN_BUFFER_HEIGHT > 30
uint8_t msb_x = (uint8_t)((x >> 8) & 1);
uint8_t msb_y = (uint8_t)(y >= 240 ? 1 : 0);
shadow_PPUCTRL = (shadow_PPUCTRL & 0xFC) | (msb_y << 1) | msb_x;
#elif DEVICE_SCREEN_BUFFER_WIDTH > 32
uint8_t msb_x = (uint8_t)((x >> 8) & 1);
shadow_PPUCTRL = (shadow_PPUCTRL & 0xFC) | msb_x;
#elif DEVICE_SCREEN_BUFFER_HEIGHT > 30
uint8_t msb_y = (uint8_t)(y >= 240 ? 1 : 0);
shadow_PPUCTRL = (shadow_PPUCTRL & 0xFC) | (msb_y << 1);
#endif
}
inline void scroll_bkg(int8_t x, int8_t y) {
move_bkg(bkg_scroll_x + x, bkg_scroll_y + y);
}
void set_sprite_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS;
#define set_sprite_2bpp_data set_sprite_data
void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS;
typedef struct OAM_item_t {
uint8_t y; //< Y coordinate of the sprite on screen - 1
uint8_t tile; //< Sprite tile number
uint8_t prop; //< OAM Property Flags
uint8_t x; //< X coordinate of the sprite on screen
} OAM_item_t;
extern volatile struct OAM_item_t shadow_OAM[];
extern uint8_t _shadow_OAM_base;
#define DISABLE_OAM_DMA \
_shadow_OAM_base = 0
#define DISABLE_VBL_TRANSFER DISABLE_OAM_DMA
#define ENABLE_OAM_DMA \
_shadow_OAM_base = (uint8_t)((uint16_t)&shadow_OAM >> 8)
#define ENABLE_VBL_TRANSFER ENABLE_OAM_DMA
#define MAX_HARDWARE_SPRITES 64
#define HARDWARE_SPRITE_CAN_FLIP_X 1
#define HARDWARE_SPRITE_CAN_FLIP_Y 1
inline void SET_SHADOW_OAM_ADDRESS(void * address) {
_shadow_OAM_base = (uint8_t)((uint16_t)address >> 8);
}
void set_sprite_tile(uint8_t nb, uint8_t tile) NO_OVERLAY_LOCALS;
uint8_t get_sprite_tile(uint8_t nb) NO_OVERLAY_LOCALS;
void set_sprite_prop(uint8_t nb, uint8_t prop) NO_OVERLAY_LOCALS;
uint8_t get_sprite_prop(uint8_t nb) NO_OVERLAY_LOCALS;
void move_sprite(uint8_t nb, uint8_t x, uint8_t y) NO_OVERLAY_LOCALS;
void scroll_sprite(uint8_t nb, int8_t x, int8_t y) NO_OVERLAY_LOCALS;
void hide_sprite(uint8_t nb) NO_OVERLAY_LOCALS;
void set_data(uint8_t *vram_addr, const uint8_t *data, uint16_t len) NO_OVERLAY_LOCALS;
void set_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, const uint8_t *tiles) NO_OVERLAY_LOCALS;
inline void set_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data) {
if (first_tile < 256) {
set_bkg_data(first_tile, nb_tiles, data);
if(first_tile + nb_tiles > 256)
set_sprite_data(first_tile - 256, nb_tiles, data);
} else {
set_sprite_data(first_tile - 256, nb_tiles, data);
}
}
void set_bkg_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS;
void set_sprite_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS;
inline void set_native_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data) {
if (first_tile < 256) {
set_bkg_native_data(first_tile, nb_tiles, data);
if(first_tile + nb_tiles > 256)
set_sprite_native_data(first_tile - 256, nb_tiles, data);
} else {
set_sprite_native_data(first_tile - 256, nb_tiles, data);
}
}
void init_bkg(uint8_t c) NO_OVERLAY_LOCALS;
void vmemset (void *s, uint8_t c, size_t n) NO_OVERLAY_LOCALS;
void fill_bkg_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) NO_OVERLAY_LOCALS;
#define fill_rect fill_bkg_rect
void flush_shadow_attributes(void) NO_OVERLAY_LOCALS;
uint8_t _switch_prg0(uint8_t bank) NO_OVERLAY_LOCALS;
#endif /* _NES_H */
c
char c
Definition: string.h:20
NONBANKED
#define NONBANKED
Definition: types.h:40
palette_color_t
uint16_t palette_color_t
Definition: cgb.h:85
d
uint8_t d
Definition: gb.h:419
h
uint8_t h
Definition: gb.h:419
hardware.h
bkg_scroll_x
__SHADOW_REG bkg_scroll_x
Definition: hardware.h:81
bkg_scroll_y
__SHADOW_REG bkg_scroll_y
Definition: hardware.h:82
scroll_x_t
uint8_t scroll_x_t
Definition: hardware.h:68
scroll_y_t
uint8_t scroll_y_t
Definition: hardware.h:69
shadow_PPUCTRL
__SHADOW_REG shadow_PPUCTRL
Definition: hardware.h:20
OAM_item_t
struct OAM_item_t OAM_item_t
SET_SHADOW_OAM_ADDRESS
void SET_SHADOW_OAM_ADDRESS(void *address)
Definition: nes.h:1083
SYSTEM_50HZ
#define SYSTEM_50HZ
Definition: nes.h:34
SYSTEM_60HZ
#define SYSTEM_60HZ
Definition: nes.h:33
SYSTEM_BITS_NTSC
#define SYSTEM_BITS_NTSC
Definition: nes.h:28
_SYSTEM
const uint8_t _SYSTEM
_current_1bpp_colors
uint16_t _current_1bpp_colors
_current_bank
volatile uint8_t _current_bank
Definition: gb.h:534
_shadow_OAM_base
uint8_t _shadow_OAM_base
Definition: gb.h:1836
_switch_prg0
uint8_t _switch_prg0(uint8_t bank) NO_OVERLAY_LOCALS
add_LCD
void add_LCD(int_handler h) NO_OVERLAY_LOCALS
add_TIM
void add_TIM(int_handler h) NO_OVERLAY_LOCALS
add_VBL
void add_VBL(int_handler h) NO_OVERLAY_LOCALS
delay
void delay(uint16_t d) NO_OVERLAY_LOCALS
disable_interrupts
void disable_interrupts(void)
Definition: nes.h:512
display_off
void display_off(void) NO_OVERLAY_LOCALS
Definition: msx.h:248
display_on
void display_on(void) NO_OVERLAY_LOCALS
enable_interrupts
void enable_interrupts(void)
Definition: nes.h:496
fill_bkg_rect
void fill_bkg_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) NO_OVERLAY_LOCALS
flush_shadow_attributes
void flush_shadow_attributes(void) NO_OVERLAY_LOCALS
get_bkg_tile_xy
uint8_t get_bkg_tile_xy(uint8_t x, uint8_t y) NO_OVERLAY_LOCALS
get_bkg_tiles
void get_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) NO_OVERLAY_LOCALS
get_bkg_xy_addr
uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) NO_OVERLAY_LOCALS
get_mode
uint8_t get_mode(void) NO_OVERLAY_LOCALS
get_sprite_prop
uint8_t get_sprite_prop(uint8_t nb) NO_OVERLAY_LOCALS
Definition: gb.h:1955
get_sprite_tile
uint8_t get_sprite_tile(uint8_t nb) NO_OVERLAY_LOCALS
Definition: gb.h:1897
get_system
uint8_t get_system(void)
Definition: nes.h:318
hide_sprite
void hide_sprite(uint8_t nb) NO_OVERLAY_LOCALS
Definition: gb.h:2000
init_bkg
void init_bkg(uint8_t c) NO_OVERLAY_LOCALS
int_handler
void(* int_handler)(void) NONBANKED
Definition: nes.h:193
joypad
uint8_t joypad(void) NO_OVERLAY_LOCALS
joypad_ex
void joypad_ex(joypads_t *joypads) NO_OVERLAY_LOCALS
joypad_init
uint8_t joypad_init(uint8_t npads, joypads_t *joypads) NO_OVERLAY_LOCALS
mode
void mode(uint8_t m) NO_OVERLAY_LOCALS
move_bkg
void move_bkg(scroll_x_t x, scroll_y_t y)
Definition: nes.h:973
move_sprite
void move_sprite(uint8_t nb, uint8_t x, uint8_t y) NO_OVERLAY_LOCALS
Definition: gb.h:1972
palette_color_t
uint8_t palette_color_t
Definition: nes.h:65
refresh_OAM
void refresh_OAM(void) NO_OVERLAY_LOCALS
remove_LCD
void remove_LCD(int_handler h) NO_OVERLAY_LOCALS
remove_TIM
void remove_TIM(int_handler h) NO_OVERLAY_LOCALS
remove_VBL
void remove_VBL(int_handler h) NO_OVERLAY_LOCALS
reset
void reset(void)
Definition: nes.h:534
scroll_bkg
void scroll_bkg(int8_t x, int8_t y)
Definition: nes.h:1001
scroll_sprite
void scroll_sprite(uint8_t nb, int8_t x, int8_t y) NO_OVERLAY_LOCALS
Definition: gb.h:1988
set_1bpp_colors
void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor)
Definition: nes.h:658
set_1bpp_colors_ex
void set_1bpp_colors_ex(uint8_t fgcolor, uint8_t bgcolor, uint8_t mode) NO_OVERLAY_LOCALS
set_2bpp_palette
void set_2bpp_palette(uint16_t palette)
Definition: nes.h:652
set_bkg_1bpp_data
void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS
set_bkg_attribute_xy
void set_bkg_attribute_xy(uint8_t x, uint8_t y, uint8_t a)
Definition: nes.h:945
set_bkg_attribute_xy_nes16x16
void set_bkg_attribute_xy_nes16x16(uint8_t x, uint8_t y, uint8_t a) NO_OVERLAY_LOCALS
set_bkg_attributes
void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *attributes)
Definition: nes.h:756
set_bkg_attributes_nes16x16
void set_bkg_attributes_nes16x16(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *attributes) NO_OVERLAY_LOCALS
set_bkg_based_submap
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)
Definition: gb.h:1314
set_bkg_based_tiles
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)
Definition: gb.h:1181
set_bkg_data
void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS
set_bkg_native_data
void set_bkg_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS
Definition: gb.h:2167
set_bkg_palette
void set_bkg_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) NO_OVERLAY_LOCALS
set_bkg_palette_entry
void set_bkg_palette_entry(uint8_t palette, uint8_t entry, palette_color_t rgb_data) NO_OVERLAY_LOCALS
set_bkg_submap
void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) NO_OVERLAY_LOCALS
Definition: msx.h:627
set_bkg_submap_attributes
void set_bkg_submap_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *attributes, uint8_t map_w)
Definition: nes.h:819
set_bkg_submap_attributes_nes16x16
void set_bkg_submap_attributes_nes16x16(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) NO_OVERLAY_LOCALS
set_bkg_tile_xy
uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t) NO_OVERLAY_LOCALS
set_bkg_tiles
void set_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) NO_OVERLAY_LOCALS
set_data
void set_data(uint8_t *vram_addr, const uint8_t *data, uint16_t len) NO_OVERLAY_LOCALS
set_interrupts
void set_interrupts(uint8_t flags) NO_OVERLAY_LOCALS
set_native_tile_data
void set_native_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data)
Definition: nes.h:1275
set_sprite_1bpp_data
void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS
set_sprite_data
void set_sprite_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS
set_sprite_native_data
void set_sprite_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS
Definition: gb.h:2184
set_sprite_palette
void set_sprite_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) NO_OVERLAY_LOCALS
set_sprite_palette_entry
void set_sprite_palette_entry(uint8_t palette, uint8_t entry, palette_color_t rgb_data) NO_OVERLAY_LOCALS
set_sprite_prop
void set_sprite_prop(uint8_t nb, uint8_t prop) NO_OVERLAY_LOCALS
Definition: gb.h:1945
set_sprite_tile
void set_sprite_tile(uint8_t nb, uint8_t tile) NO_OVERLAY_LOCALS
Definition: gb.h:1886
set_tile_data
void set_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data)
Definition: nes.h:1228
set_tiles
void set_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, const uint8_t *tiles) NO_OVERLAY_LOCALS
set_vram_byte
void set_vram_byte(uint8_t *addr, uint8_t v) NO_OVERLAY_LOCALS
shadow_OAM
volatile struct OAM_item_t shadow_OAM[]
sys_time
volatile uint16_t sys_time
vmemset
void vmemset(void *s, uint8_t c, size_t n) NO_OVERLAY_LOCALS
vsync
void vsync(void) NO_OVERLAY_LOCALS
wait_vbl_done
void wait_vbl_done(void) NO_OVERLAY_LOCALS
waitpad
uint8_t waitpad(uint8_t mask) NO_OVERLAY_LOCALS
waitpadup
void waitpadup(void) NO_OVERLAY_LOCALS
rgb_to_nes_macro.h
stdint.h
int8_t
signed char int8_t
Definition: stdint.h:43
uint16_t
unsigned short int uint16_t
Definition: stdint.h:52
uint8_t
unsigned char uint8_t
Definition: stdint.h:51
OAM_item_t
Definition: gb.h:1823
OAM_item_t::prop
uint8_t prop
Definition: gb.h:1826
OAM_item_t::tile
uint8_t tile
Definition: gb.h:1825
OAM_item_t::x
uint8_t x
Definition: gb.h:1824
OAM_item_t::y
uint8_t y
Definition: gb.h:1824
joypads_t
Definition: gb.h:755
version.h