| 1 |
//render.cpp |
| 2 |
inline void render_line_mode0(); |
| 3 |
inline void render_line_mode1(); |
| 4 |
inline void render_line_mode2(); |
| 5 |
inline void render_line_mode3(); |
| 6 |
inline void render_line_mode4(); |
| 7 |
inline void render_line_mode5(); |
| 8 |
inline void render_line_mode6(); |
| 9 |
inline void render_line_mode7(); |
| 10 |
|
| 11 |
//cache.cpp |
| 12 |
enum { COLORDEPTH_4 = 0, COLORDEPTH_16 = 1, COLORDEPTH_256 = 2 }; |
| 13 |
enum { TILE_2BIT = 0, TILE_4BIT = 1, TILE_8BIT = 2 }; |
| 14 |
|
| 15 |
struct pixel_t { |
| 16 |
//bgr555 color data for main/subscreen pixels: 0x0000 = transparent / use palette color # 0 |
| 17 |
//needs to be bgr555 instead of palette index for direct color mode ($2130 bit 0) to work |
| 18 |
uint16 src_main, src_sub; |
| 19 |
//indicates source of palette # for main/subscreen (BG1-4, OAM, or back) |
| 20 |
uint8 bg_main, bg_sub; |
| 21 |
//color_exemption -- true when bg == OAM && palette index >= 192, disables color add/sub effects |
| 22 |
uint8 ce_main, ce_sub; |
| 23 |
//priority level of src_n. to set src_n, |
| 24 |
//the priority of the pixel must be >pri_n |
| 25 |
uint8 pri_main, pri_sub; |
| 26 |
} pixel_cache[256]; |
| 27 |
|
| 28 |
uint8* bg_tiledata[3]; |
| 29 |
uint8* bg_tiledata_state[3]; //0 = valid, 1 = dirty |
| 30 |
|
| 31 |
template<unsigned color_depth> void render_bg_tile(uint16 tile_num); |
| 32 |
inline void flush_pixel_cache(); |
| 33 |
void alloc_tiledata_cache(); |
| 34 |
void flush_tiledata_cache(); |
| 35 |
void free_tiledata_cache(); |
| 36 |
|
| 37 |
//windows.cpp |
| 38 |
struct window_t { |
| 39 |
uint8 main[256], sub[256]; |
| 40 |
} window[6]; |
| 41 |
|
| 42 |
void build_window_table(uint8 bg, bool mainscreen); |
| 43 |
void build_window_tables(uint8 bg); |
| 44 |
|
| 45 |
//bg.cpp |
| 46 |
struct { |
| 47 |
uint16 tw, th; //tile width, height |
| 48 |
uint16 mx, my; //screen mask x, y |
| 49 |
uint16 scx, scy; //sc index offsets |
| 50 |
} bg_info[4]; |
| 51 |
void update_bg_info(); |
| 52 |
|
| 53 |
template<unsigned bg> uint16 bg_get_tile(uint16 x, uint16 y); |
| 54 |
template<unsigned mode, unsigned bg, unsigned color_depth> void render_line_bg(uint8 pri0_pos, uint8 pri1_pos); |
| 55 |
|
| 56 |
//oam.cpp |
| 57 |
struct sprite_item { |
| 58 |
uint8 width, height; |
| 59 |
uint16 x, y; |
| 60 |
uint8 character; |
| 61 |
bool use_nameselect; |
| 62 |
bool vflip, hflip; |
| 63 |
uint8 palette; |
| 64 |
uint8 priority; |
| 65 |
bool size; |
| 66 |
} sprite_list[128]; |
| 67 |
bool sprite_list_valid; |
| 68 |
unsigned active_sprite; |
| 69 |
|
| 70 |
uint8 oam_itemlist[32]; |
| 71 |
struct oam_tileitem { |
| 72 |
uint16 x, y, pri, pal, tile; |
| 73 |
bool hflip; |
| 74 |
} oam_tilelist[34]; |
| 75 |
|
| 76 |
enum { OAM_PRI_NONE = 4 }; |
| 77 |
uint8 oam_line_pal[256], oam_line_pri[256]; |
| 78 |
|
| 79 |
void update_sprite_list(unsigned addr, uint8 data); |
| 80 |
void build_sprite_list(); |
| 81 |
bool is_sprite_on_scanline(); |
| 82 |
void load_oam_tiles(); |
| 83 |
void render_oam_tile(int tile_num); |
| 84 |
void render_line_oam_rto(); |
| 85 |
void render_line_oam(uint8 pri0_pos, uint8 pri1_pos, uint8 pri2_pos, uint8 pri3_pos); |
| 86 |
|
| 87 |
//mode7.cpp |
| 88 |
template<unsigned bg> void render_line_mode7(uint8 pri0_pos, uint8 pri1_pos); |
| 89 |
|
| 90 |
//addsub.cpp |
| 91 |
inline uint16 addsub(uint32 x, uint32 y, bool halve); |
| 92 |
|
| 93 |
//line.cpp |
| 94 |
inline uint16 get_palette(uint8 index); |
| 95 |
inline uint16 get_direct_color(uint8 p, uint8 t); |
| 96 |
inline uint16 get_pixel_normal(uint32 x); |
| 97 |
inline uint16 get_pixel_swap(uint32 x); |
| 98 |
void render_line_output(); |
| 99 |
void render_line_clear(); |