2010-08-09 13:28:56 +00:00
|
|
|
//render.cpp
|
2010-09-06 11:13:51 +00:00
|
|
|
inline void render_line_mode0();
|
|
|
|
inline void render_line_mode1();
|
|
|
|
inline void render_line_mode2();
|
|
|
|
inline void render_line_mode3();
|
|
|
|
inline void render_line_mode4();
|
|
|
|
inline void render_line_mode5();
|
|
|
|
inline void render_line_mode6();
|
|
|
|
inline void render_line_mode7();
|
2010-08-09 13:28:56 +00:00
|
|
|
|
|
|
|
//cache.cpp
|
|
|
|
enum { COLORDEPTH_4 = 0, COLORDEPTH_16 = 1, COLORDEPTH_256 = 2 };
|
|
|
|
enum { TILE_2BIT = 0, TILE_4BIT = 1, TILE_8BIT = 2 };
|
|
|
|
|
|
|
|
struct pixel_t {
|
|
|
|
//bgr555 color data for main/subscreen pixels: 0x0000 = transparent / use palette color # 0
|
|
|
|
//needs to be bgr555 instead of palette index for direct color mode ($2130 bit 0) to work
|
|
|
|
uint16 src_main, src_sub;
|
|
|
|
//indicates source of palette # for main/subscreen (BG1-4, OAM, or back)
|
|
|
|
uint8 bg_main, bg_sub;
|
|
|
|
//color_exemption -- true when bg == OAM && palette index >= 192, disables color add/sub effects
|
|
|
|
uint8 ce_main, ce_sub;
|
|
|
|
//priority level of src_n. to set src_n,
|
|
|
|
//the priority of the pixel must be >pri_n
|
|
|
|
uint8 pri_main, pri_sub;
|
|
|
|
} pixel_cache[256];
|
|
|
|
|
2013-05-05 09:21:30 +00:00
|
|
|
uint8* bg_tiledata[3];
|
|
|
|
uint8* bg_tiledata_state[3]; //0 = valid, 1 = dirty
|
2010-08-09 13:28:56 +00:00
|
|
|
|
|
|
|
template<unsigned color_depth> void render_bg_tile(uint16 tile_num);
|
|
|
|
inline void flush_pixel_cache();
|
|
|
|
void alloc_tiledata_cache();
|
|
|
|
void flush_tiledata_cache();
|
|
|
|
void free_tiledata_cache();
|
|
|
|
|
|
|
|
//windows.cpp
|
|
|
|
struct window_t {
|
|
|
|
uint8 main[256], sub[256];
|
|
|
|
} window[6];
|
|
|
|
|
|
|
|
void build_window_table(uint8 bg, bool mainscreen);
|
|
|
|
void build_window_tables(uint8 bg);
|
|
|
|
|
|
|
|
//bg.cpp
|
|
|
|
struct {
|
|
|
|
uint16 tw, th; //tile width, height
|
|
|
|
uint16 mx, my; //screen mask x, y
|
|
|
|
uint16 scx, scy; //sc index offsets
|
|
|
|
} bg_info[4];
|
|
|
|
void update_bg_info();
|
|
|
|
|
|
|
|
template<unsigned bg> uint16 bg_get_tile(uint16 x, uint16 y);
|
|
|
|
template<unsigned mode, unsigned bg, unsigned color_depth> void render_line_bg(uint8 pri0_pos, uint8 pri1_pos);
|
|
|
|
|
|
|
|
//oam.cpp
|
|
|
|
struct sprite_item {
|
|
|
|
uint8 width, height;
|
|
|
|
uint16 x, y;
|
|
|
|
uint8 character;
|
|
|
|
bool use_nameselect;
|
|
|
|
bool vflip, hflip;
|
|
|
|
uint8 palette;
|
|
|
|
uint8 priority;
|
Updated to v067r23 release.
byuu says:
Added missing $4200 IRQ lock, which fixes Chou Aniki on the fast CPU
core, so slower PCs can get their brotherly love on.
Added range-based controller IOBit latching to the fast CPU core, which
enables Super Scope and Justifier support. Uses the priority queue as
well, so there is zero speed-hit. Given the way range-testing works, the
trigger point may vary by 1-2 pixels when firing at the same spot. Not
really a big deal when it avoids a massive speed penalty.
Fixed PAL and interlace-mode HVIRQs at V=0,H<2 on the fast CPU core.
Added the dot-renderer's sprite list update-on-OAM-write functionality
to the scanline-based PPU renderer. Unfortunately it looks like all the
speed gain was already taken from the global dirty flag I was using
before, but this certainly won't hurt speed any, so whatever.
Added #ifdef to stop CoInitialize(0) on non-Windows ports.
Added #ifdefs to stop gradient fade on Windows port. Not going to fuck
over the Linux port aesthetic because of Qt bug #47,326,927. If there's
a way to tell what Qt theme is being used, I can leave it enabled for
XP/Vista themes.
Moved HDMA trigger from 1104 to 1112, and reduced channel overhead from
24 to 16, to better simulate one-cycle DMA->CPU sync.
Code clarity: I've re-added my varint.hpp classes, and am actively using
them in the accuracy cores. So far, I haven't done anything that would
detriment speed, but it is certainly cool. The APU ports exposed by the
CPU and SMP now take uint2 address arguments, the CPU WRAM address
register is a uint17, and the IRQ H/VTIME values are uint10. This
basically allows the source to clearly convey the data sizes, and
eliminates the need to manually mask values when writing to registers or
reading from memory. I'm going to be doing this everywhere, and it will
have a speed impact eventually, because the automation means we can't
skip masks when we know the data is already masked off.
Source: archive contains the launcher code, so that I can look into why
it's crashing on XP tomorrow.
It doesn't look like Circuit USA's flags are going to work too well with
this new CPU core. Still not sure what the hell Robocop vs The
Terminator is doing, I'll read through the mega SNES thread for clues
tomorrow. Speedy Gonzales is definitely broken, as modifying the MDR was
breaking things with my current core. Probably because the new CPU core
doesn't wait for a cycle edge to trigger.
I was thinking that perhaps we could keep some form of cheat codes list
to work as game-specific hacks for the performance core. Keeps the hacks
out of the emulator, but could allow the remaining bugs to be worked
around for people who have no choice but to use the performance core.
2010-08-16 09:42:20 +00:00
|
|
|
bool size;
|
2010-08-09 13:28:56 +00:00
|
|
|
} sprite_list[128];
|
|
|
|
bool sprite_list_valid;
|
|
|
|
unsigned active_sprite;
|
|
|
|
|
|
|
|
uint8 oam_itemlist[32];
|
|
|
|
struct oam_tileitem {
|
|
|
|
uint16 x, y, pri, pal, tile;
|
|
|
|
bool hflip;
|
|
|
|
} oam_tilelist[34];
|
|
|
|
|
|
|
|
enum { OAM_PRI_NONE = 4 };
|
|
|
|
uint8 oam_line_pal[256], oam_line_pri[256];
|
|
|
|
|
Updated to v067r23 release.
byuu says:
Added missing $4200 IRQ lock, which fixes Chou Aniki on the fast CPU
core, so slower PCs can get their brotherly love on.
Added range-based controller IOBit latching to the fast CPU core, which
enables Super Scope and Justifier support. Uses the priority queue as
well, so there is zero speed-hit. Given the way range-testing works, the
trigger point may vary by 1-2 pixels when firing at the same spot. Not
really a big deal when it avoids a massive speed penalty.
Fixed PAL and interlace-mode HVIRQs at V=0,H<2 on the fast CPU core.
Added the dot-renderer's sprite list update-on-OAM-write functionality
to the scanline-based PPU renderer. Unfortunately it looks like all the
speed gain was already taken from the global dirty flag I was using
before, but this certainly won't hurt speed any, so whatever.
Added #ifdef to stop CoInitialize(0) on non-Windows ports.
Added #ifdefs to stop gradient fade on Windows port. Not going to fuck
over the Linux port aesthetic because of Qt bug #47,326,927. If there's
a way to tell what Qt theme is being used, I can leave it enabled for
XP/Vista themes.
Moved HDMA trigger from 1104 to 1112, and reduced channel overhead from
24 to 16, to better simulate one-cycle DMA->CPU sync.
Code clarity: I've re-added my varint.hpp classes, and am actively using
them in the accuracy cores. So far, I haven't done anything that would
detriment speed, but it is certainly cool. The APU ports exposed by the
CPU and SMP now take uint2 address arguments, the CPU WRAM address
register is a uint17, and the IRQ H/VTIME values are uint10. This
basically allows the source to clearly convey the data sizes, and
eliminates the need to manually mask values when writing to registers or
reading from memory. I'm going to be doing this everywhere, and it will
have a speed impact eventually, because the automation means we can't
skip masks when we know the data is already masked off.
Source: archive contains the launcher code, so that I can look into why
it's crashing on XP tomorrow.
It doesn't look like Circuit USA's flags are going to work too well with
this new CPU core. Still not sure what the hell Robocop vs The
Terminator is doing, I'll read through the mega SNES thread for clues
tomorrow. Speedy Gonzales is definitely broken, as modifying the MDR was
breaking things with my current core. Probably because the new CPU core
doesn't wait for a cycle edge to trigger.
I was thinking that perhaps we could keep some form of cheat codes list
to work as game-specific hacks for the performance core. Keeps the hacks
out of the emulator, but could allow the remaining bugs to be worked
around for people who have no choice but to use the performance core.
2010-08-16 09:42:20 +00:00
|
|
|
void update_sprite_list(unsigned addr, uint8 data);
|
2010-08-09 13:28:56 +00:00
|
|
|
void build_sprite_list();
|
|
|
|
bool is_sprite_on_scanline();
|
|
|
|
void load_oam_tiles();
|
|
|
|
void render_oam_tile(int tile_num);
|
|
|
|
void render_line_oam_rto();
|
|
|
|
void render_line_oam(uint8 pri0_pos, uint8 pri1_pos, uint8 pri2_pos, uint8 pri3_pos);
|
|
|
|
|
|
|
|
//mode7.cpp
|
|
|
|
template<unsigned bg> void render_line_mode7(uint8 pri0_pos, uint8 pri1_pos);
|
|
|
|
|
|
|
|
//addsub.cpp
|
|
|
|
inline uint16 addsub(uint32 x, uint32 y, bool halve);
|
|
|
|
|
|
|
|
//line.cpp
|
|
|
|
inline uint16 get_palette(uint8 index);
|
|
|
|
inline uint16 get_direct_color(uint8 p, uint8 t);
|
|
|
|
inline uint16 get_pixel_normal(uint32 x);
|
|
|
|
inline uint16 get_pixel_swap(uint32 x);
|
|
|
|
void render_line_output();
|
|
|
|
void render_line_clear();
|