13 #define NINTENDO_ENTERTAINMENT_SYSTEM
18 #define RGB(r,g,b) RGB_TO_NES(((r) | ((g) << 2) | ((b) << 4)))
19 #define RGB8(r,g,b) RGB_TO_NES((((r) >> 6) | (((g) >> 6) << 2) | (((b) >> 6) << 4)))
20 #define RGBHTML(RGB24bit) RGB_TO_NES((((RGB24bit) >> 22) | ((((RGB24bit) & 0xFFFF) >> 14) << 2) | ((((RGB24bit) & 0xFF) >> 6) << 4)))
28 #define RGB_DARKRED 0x06
29 #define RGB_GREEN 0x2A
30 #define RGB_DARKGREEN 0x1A
32 #define RGB_DARKBLUE 0x02
33 #define RGB_YELLOW 0x28
34 #define RGB_DARKYELLOW 0x18
38 #define RGB_PURPLE 0x14
39 #define RGB_BLACK 0x0F
40 #define RGB_DARKGRAY 0x00
41 #define RGB_LIGHTGRAY 0x10
42 #define RGB_WHITE 0x30
73 #define J_SELECT 0x04U
80 #define M_DRAWING 0x01U
81 #define M_TEXT_OUT 0x02U
82 #define M_TEXT_INOUT 0x03U
88 #define M_NO_SCROLL 0x04U
92 #define M_NO_INTERP 0x08U
98 #define S_PALETTE 0x10U
102 #define S_FLIPX 0x40U
106 #define S_FLIPY 0x80U
111 #define S_PRIORITY 0x20U
118 #define DMG_BLACK 0x03
119 #define DMG_DARK_GRAY 0x02
120 #define DMG_LITE_GRAY 0x01
121 #define DMG_WHITE 0x00
141 #define DMG_PALETTE(C0, C1, C2, C3) ((uint8_t)((((C3) & 0x03) << 6) | (((C2) & 0x03) << 4) | (((C1) & 0x03) << 2) | ((C0) & 0x03)))
146 #define SCREENWIDTH DEVICE_SCREEN_PX_WIDTH
149 #define SCREENHEIGHT DEVICE_SCREEN_PX_HEIGHT
184 #define CURRENT_BANK _current_bank
196 #define BANK(VARNAME) 0
211 #define BANKREF(VARNAME)
222 #define BANKREF_EXTERN(VARNAME) extern const void __bank_ ## VARNAME;
227 #define SWITCH_ROM_DUMMY(b)
234 #define SWITCH_ROM SWITCH_ROM_DUMMY
277 uint8_t joy0, joy1, joy2, joy3;
364 #define DISPLAY_OFF \
370 #define HIDE_LEFT_COLUMN \
371 shadow_PPUMASK &= ~(PPUMASK_SHOW_BG_LC | PPUMASK_SHOW_SPR_LC); \
376 #define SHOW_LEFT_COLUMN \
377 shadow_PPUMASK |= (PPUMASK_SHOW_BG_LC | PPUMASK_SHOW_SPR_LC);
383 shadow_PPUMASK |= PPUMASK_SHOW_BG;
389 shadow_PPUMASK &= ~PPUMASK_SHOW_BG;
394 #define SHOW_SPRITES \
395 shadow_PPUMASK |= PPUMASK_SHOW_SPR;
400 #define HIDE_SPRITES \
401 shadow_PPUMASK &= ~PPUMASK_SHOW_SPR;
406 #define SPRITES_8x16 \
407 shadow_PPUCTRL |= PPUCTRL_SPR_8X16;
412 #define SPRITES_8x8 \
413 shadow_PPUCTRL &= ~PPUCTRL_SPR_8X16;
430 #define COMPAT_PALETTE(C0,C1,C2,C3) ((uint8_t)(((C3) << 6) | ((C2) << 4) | ((C1) << 2) | (C0)))
454 #define set_bkg_2bpp_data set_bkg_data
488 #define set_tile_map set_bkg_tiles
663 #define set_tile_submap set_bkg_submap
716 #define set_tile_xy set_bkg_tile_xy
771 #define set_sprite_2bpp_data set_sprite_data
808 #define DISABLE_OAM_DMA \
813 #define DISABLE_VBL_TRANSFER DISABLE_OAM_DMA
815 #define ENABLE_OAM_DMA \
816 _shadow_OAM_base = (uint8_t)((uint16_t)&shadow_OAM >> 8)
820 #define ENABLE_VBL_TRANSFER ENABLE_OAM_DMA
824 #define MAX_HARDWARE_SPRITES 64
828 #define HARDWARE_SPRITE_CAN_FLIP_X 1
832 #define HARDWARE_SPRITE_CAN_FLIP_Y 1
941 itm->
y+=
y, itm->
x+=
x;
1007 if (first_tile < 256) {
1039 #define fill_rect fill_bkg_rect
char c
Definition: string.h:20
#define OLDCALL
Definition: types.h:21
uint16_t palette_color_t
Definition: cgb.h:85
void d
Definition: gb.h:665
uint8_t h
Definition: gb.h:644
__SHADOW_REG bkg_scroll_x
Definition: hardware.h:56
__SHADOW_REG bkg_scroll_y
Definition: hardware.h:57
void set_vram_byte(uint8_t *addr, uint8_t v) OLDCALL
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) OLDCALL
void set_sprite_tile(uint8_t nb, uint8_t tile)
Definition: nes.h:853
volatile uint8_t _current_bank
Definition: gb.h:474
void set_bkg_attributes_nes16x16(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *attributes) OLDCALL
void set_1bpp_colors_ex(uint8_t fgcolor, uint8_t bgcolor, uint8_t mode) OLDCALL
void scroll_bkg(int8_t x, int8_t y)
Definition: nes.h:754
void enable_interrupts(void)
Definition: nes.h:309
uint16_t _current_1bpp_colors
uint8_t joypad(void) OLDCALL
void delay(uint16_t d) OLDCALL
void disable_interrupts(void)
Definition: nes.h:325
void vmemset(void *s, uint8_t c, size_t n) OLDCALL
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:601
void set_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL
volatile struct OAM_item_t shadow_OAM[]
void set_data(uint8_t *vram_addr, const uint8_t *data, uint16_t len) OLDCALL
void mode(uint8_t m) OLDCALL
void set_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, const uint8_t *tiles) OLDCALL
void move_bkg(uint8_t x, uint8_t y)
Definition: nes.h:740
uint8_t _shadow_OAM_base
Definition: gb.h:1657
void set_native_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data)
Definition: nes.h:1006
uint8_t get_sprite_prop(uint8_t nb)
Definition: nes.h:909
void scroll_sprite(uint8_t nb, int8_t x, int8_t y)
Definition: nes.h:939
uint8_t get_mode(void) OLDCALL
volatile uint16_t sys_time
void SET_SHADOW_OAM_ADDRESS(void *address)
Definition: nes.h:836
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: nes.h:627
void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *attributes)
Definition: nes.h:538
void fill_bkg_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL
uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t) OLDCALL
struct OAM_item_t OAM_item_t
void set_sprite_prop(uint8_t nb, uint8_t prop)
Definition: nes.h:899
void set_sprite_palette(uint8_t first_palette, uint8_t nb_palettes, palette_color_t *rgb_data) OLDCALL
void set_sprite_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL
uint8_t palette_color_t
Definition: nes.h:44
void set_2bpp_palette(uint16_t palette)
Definition: nes.h:434
void set_bkg_palette(uint8_t first_palette, uint8_t nb_palettes, palette_color_t *rgb_data) OLDCALL
void joypad_ex(joypads_t *joypads) OLDCALL
void set_tile_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data, uint8_t base) OLDCALL
void set_sprite_palette_entry(uint8_t palette, uint8_t entry, palette_color_t rgb_data) OLDCALL
void move_sprite(uint8_t nb, uint8_t x, uint8_t y)
Definition: nes.h:923
uint8_t _submap_tile_offset
uint8_t joypad_init(uint8_t npads, joypads_t *joypads) OLDCALL
uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) OLDCALL
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: nes.h:687
void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL
uint8_t get_bkg_tile_xy(uint8_t x, uint8_t y) OLDCALL
void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL
void hide_sprite(uint8_t nb)
Definition: nes.h:949
void init_bkg(uint8_t c) OLDCALL
void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) OLDCALL
Definition: msx.h:554
void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor)
Definition: nes.h:440
void get_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL
void set_bkg_palette_entry(uint8_t palette, uint8_t entry, palette_color_t rgb_data) OLDCALL
uint8_t waitpad(uint8_t mask) OLDCALL
uint8_t get_sprite_tile(uint8_t nb)
Definition: nes.h:864
void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL
void display_off(void)
Definition: msx.h:225
unsigned char uint8_t
Definition: stdint.h:51
unsigned short int uint16_t
Definition: stdint.h:52
signed char int8_t
Definition: stdint.h:43
uint8_t x
Definition: gb.h:1645
uint8_t prop
Definition: gb.h:1647
uint8_t tile
Definition: gb.h:1646
uint8_t y
Definition: gb.h:1645