2010-09-01 13:20:05 +00:00
|
|
|
class Sprite {
|
2010-09-06 11:13:51 +00:00
|
|
|
bool priority0_enable;
|
|
|
|
bool priority1_enable;
|
|
|
|
bool priority2_enable;
|
|
|
|
bool priority3_enable;
|
|
|
|
|
2010-09-01 13:20:05 +00:00
|
|
|
struct Regs {
|
|
|
|
unsigned priority0;
|
|
|
|
unsigned priority1;
|
|
|
|
unsigned priority2;
|
|
|
|
unsigned priority3;
|
|
|
|
|
|
|
|
unsigned base_size;
|
|
|
|
unsigned nameselect;
|
|
|
|
unsigned tiledata_addr;
|
|
|
|
unsigned first_sprite;
|
|
|
|
|
|
|
|
bool main_enable;
|
|
|
|
bool sub_enable;
|
|
|
|
|
|
|
|
bool interlace;
|
|
|
|
|
|
|
|
bool time_over;
|
|
|
|
bool range_over;
|
|
|
|
} regs;
|
|
|
|
|
|
|
|
struct List {
|
|
|
|
unsigned width;
|
|
|
|
unsigned height;
|
|
|
|
unsigned x;
|
|
|
|
unsigned y;
|
|
|
|
unsigned character;
|
|
|
|
bool use_nameselect;
|
|
|
|
bool vflip;
|
|
|
|
bool hflip;
|
|
|
|
unsigned palette;
|
|
|
|
unsigned priority;
|
|
|
|
bool size;
|
|
|
|
} list[128];
|
2010-09-01 13:22:05 +00:00
|
|
|
bool list_valid;
|
2010-09-01 13:20:05 +00:00
|
|
|
|
|
|
|
uint8 itemlist[32];
|
|
|
|
struct TileList {
|
|
|
|
unsigned x;
|
|
|
|
unsigned y;
|
|
|
|
unsigned priority;
|
|
|
|
unsigned palette;
|
|
|
|
unsigned tile;
|
|
|
|
bool hflip;
|
|
|
|
} tilelist[34];
|
|
|
|
|
|
|
|
struct Output {
|
|
|
|
uint8 palette[256];
|
|
|
|
uint8 priority[256];
|
|
|
|
} output;
|
|
|
|
|
2010-09-01 13:22:05 +00:00
|
|
|
LayerWindow window;
|
|
|
|
|
|
|
|
void frame();
|
2010-09-01 13:20:05 +00:00
|
|
|
void update_list(unsigned addr, uint8 data);
|
|
|
|
void address_reset();
|
|
|
|
void set_first();
|
Update to v068r10 release.
(there was no r09 release posted to the WIP thread)
byuu says:
It is feature-complete, but horizontal mosaic is less accurate. I have
an idea for a mosaic color ring buffer to get it equally accurate, but
I haven't implemented it yet. For now it's just a simple x & ~(mosaic >>
1) trick that is passable.
Hires blending was left out, as it's more processor intensive and
blargg's NTSC does a better job with that anyway.
There's some OPT vertical positioning issues in the SNES Test Program's
character test; Goodbye, Anthrox has some sort of fast CPU DMA issue;
etc.
Total speedup is a mere 13.5%. Not quite the 50% I wanted in the best
case, but I'll take what I can get.
254->289fps in Zelda 3 on my E8400 now. There's another 15% hiding with
blargg's SMP and 5-10% with blargg's fast DSP, but they lose too much
accuracy. It'd put me at or below Snes9X accuracy, while still being 50%
slower.
SSE2 was performing worse this time, both on x86 and amd64, so I left
that optimization off.
So, barring a miracle, this is about the best it's going to get.
2010-09-03 11:37:36 +00:00
|
|
|
alwaysinline bool on_scanline(unsigned sprite);
|
2010-09-01 13:20:05 +00:00
|
|
|
void render();
|
2010-09-24 13:18:09 +00:00
|
|
|
|
|
|
|
void serialize(serializer&);
|
2010-09-01 13:20:05 +00:00
|
|
|
Sprite(PPU &self);
|
|
|
|
|
|
|
|
PPU &self;
|
|
|
|
friend class PPU;
|
|
|
|
};
|