2010-09-01 13:18:10 +00:00
|
|
|
class Screen {
|
2010-09-01 13:20:05 +00:00
|
|
|
struct Regs {
|
|
|
|
bool addsub_mode;
|
|
|
|
bool direct_color;
|
|
|
|
|
|
|
|
bool color_mode;
|
|
|
|
bool color_halve;
|
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
|
|
|
bool color_enable[7];
|
2010-09-01 13:20:05 +00:00
|
|
|
|
|
|
|
unsigned color_b;
|
|
|
|
unsigned color_g;
|
|
|
|
unsigned color_r;
|
2010-09-01 13:22:05 +00:00
|
|
|
unsigned color;
|
2010-09-01 13:20:05 +00:00
|
|
|
} regs;
|
|
|
|
|
|
|
|
struct Output {
|
2010-09-01 13:22:05 +00:00
|
|
|
struct Pixel {
|
2010-09-01 13:20:05 +00:00
|
|
|
unsigned color;
|
|
|
|
unsigned priority;
|
2010-09-01 13:22:05 +00:00
|
|
|
unsigned source;
|
2010-09-01 13:20:05 +00:00
|
|
|
} main[256], sub[256];
|
|
|
|
|
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 void plot_main(unsigned x, unsigned color, unsigned priority, unsigned source);
|
|
|
|
alwaysinline void plot_sub(unsigned x, unsigned color, unsigned priority, unsigned source);
|
2010-09-01 13:20:05 +00:00
|
|
|
} output;
|
|
|
|
|
2010-09-01 13:22:05 +00:00
|
|
|
ColorWindow window;
|
2010-09-01 13:20:05 +00:00
|
|
|
|
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 unsigned get_palette(unsigned color);
|
|
|
|
unsigned get_direct_color(unsigned palette, unsigned tile);
|
|
|
|
alwaysinline uint16 addsub(unsigned x, unsigned y, bool halve);
|
2010-09-01 13:20:05 +00:00
|
|
|
void scanline();
|
2010-09-01 13:18:10 +00:00
|
|
|
void render_black();
|
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 uint16 get_pixel_main(unsigned x);
|
|
|
|
alwaysinline uint16 get_pixel_sub(unsigned x);
|
2010-09-01 13:18:10 +00:00
|
|
|
void render();
|
2010-09-24 13:18:09 +00:00
|
|
|
|
|
|
|
void serialize(serializer&);
|
2013-05-05 09:21:30 +00:00
|
|
|
Screen(PPU& self);
|
2010-09-01 13:18:10 +00:00
|
|
|
~Screen();
|
|
|
|
|
2013-05-05 09:21:30 +00:00
|
|
|
PPU& self;
|
2010-09-01 13:18:10 +00:00
|
|
|
friend class PPU;
|
|
|
|
};
|