2010-09-01 13:18:10 +00:00
|
|
|
#ifdef PPU_CPP
|
|
|
|
|
2010-09-01 13:20:05 +00:00
|
|
|
unsigned PPU::Screen::get_palette(unsigned color) {
|
2010-09-01 13:22:05 +00:00
|
|
|
#if defined(ARCH_LSB)
|
Update to v074r11 release.
byuu says:
Changelog:
- debugger compiles on all three profiles
- libsnes compiles on all three platforms (no API changes to libsnes)
- memory.cpp : namespace memory removed (wram -> cpu, apuram -> smp,
vram, oam, cgram -> ppu)
- sa1.cpp : namespace memory removed (SA-1 specific functions merged
inline to SA1::bus_read,write)
- GameBoy: added serial link support with interrupts and proper 8192hz
timing, but obviously it acts as if no other GB is connected to it
- GameBoy: added STAT OAM interrupt, and better STAT d1,d0 mode values
- UI: since Qt is dead, I've renamed the config files back to bsnes.cfg
and bsnes-geometry.cfg
- SA1: IRAM was not syncing to CPU on SA-1 side
- PPU/Accuracy and PPU/Performance needed Sprite oam renamed to Sprite
sprite; so that I could add uint8 oam[544]
- makes more sense anyway, OAM = object attribute memory, obj or
sprite are better names for Sprite rendering class
- more cleanup
2011-01-24 09:03:17 +00:00
|
|
|
return ((uint16*)ppu.cgram)[color];
|
2010-09-01 13:22:05 +00:00
|
|
|
#else
|
2010-09-01 13:20:05 +00:00
|
|
|
color <<= 1;
|
Update to v074r11 release.
byuu says:
Changelog:
- debugger compiles on all three profiles
- libsnes compiles on all three platforms (no API changes to libsnes)
- memory.cpp : namespace memory removed (wram -> cpu, apuram -> smp,
vram, oam, cgram -> ppu)
- sa1.cpp : namespace memory removed (SA-1 specific functions merged
inline to SA1::bus_read,write)
- GameBoy: added serial link support with interrupts and proper 8192hz
timing, but obviously it acts as if no other GB is connected to it
- GameBoy: added STAT OAM interrupt, and better STAT d1,d0 mode values
- UI: since Qt is dead, I've renamed the config files back to bsnes.cfg
and bsnes-geometry.cfg
- SA1: IRAM was not syncing to CPU on SA-1 side
- PPU/Accuracy and PPU/Performance needed Sprite oam renamed to Sprite
sprite; so that I could add uint8 oam[544]
- makes more sense anyway, OAM = object attribute memory, obj or
sprite are better names for Sprite rendering class
- more cleanup
2011-01-24 09:03:17 +00:00
|
|
|
return (ppu.cgram[color + 0] << 0) + (ppu.cgram[color + 1] << 8);
|
2010-09-01 13:22:05 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
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
|
|
|
unsigned PPU::Screen::get_direct_color(unsigned p, unsigned t) {
|
|
|
|
return ((t & 7) << 2) | ((p & 1) << 1) |
|
|
|
|
(((t >> 3) & 7) << 7) | (((p >> 1) & 1) << 6) |
|
|
|
|
((t >> 6) << 13) | ((p >> 2) << 12);
|
|
|
|
}
|
|
|
|
|
2010-09-01 13:22:05 +00:00
|
|
|
uint16 PPU::Screen::addsub(unsigned x, unsigned y, bool halve) {
|
|
|
|
if(!regs.color_mode) {
|
|
|
|
if(!halve) {
|
|
|
|
unsigned sum = x + y;
|
|
|
|
unsigned carry = (sum - ((x ^ y) & 0x0421)) & 0x8420;
|
|
|
|
return (sum - carry) | (carry - (carry >> 5));
|
|
|
|
} else {
|
|
|
|
return (x + y - ((x ^ y) & 0x0421)) >> 1;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
unsigned diff = x - y + 0x8420;
|
|
|
|
unsigned borrow = (diff - ((x ^ y) & 0x8420)) & 0x8420;
|
|
|
|
if(!halve) {
|
|
|
|
return (diff - borrow) & (borrow - (borrow >> 5));
|
|
|
|
} else {
|
|
|
|
return (((diff - borrow) & (borrow - (borrow >> 5))) & 0x7bde) >> 1;
|
|
|
|
}
|
|
|
|
}
|
2010-09-01 13:20:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PPU::Screen::scanline() {
|
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
|
|
|
unsigned main_color = get_palette(0);
|
|
|
|
unsigned sub_color = (self.regs.pseudo_hires == false && self.regs.bgmode != 5 && self.regs.bgmode != 6)
|
|
|
|
? regs.color : main_color;
|
2010-09-01 13:22:05 +00:00
|
|
|
|
2010-09-01 13:20:05 +00:00
|
|
|
for(unsigned x = 0; x < 256; x++) {
|
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
|
|
|
output.main[x].color = main_color;
|
2010-09-01 13:20:05 +00:00
|
|
|
output.main[x].priority = 0;
|
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
|
|
|
output.main[x].source = 6;
|
2010-09-01 13:22: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
|
|
|
output.sub[x].color = sub_color;
|
2010-09-01 13:20:05 +00:00
|
|
|
output.sub[x].priority = 0;
|
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
|
|
|
output.sub[x].source = 6;
|
2010-09-01 13:20:05 +00:00
|
|
|
}
|
2010-09-01 13:22:05 +00:00
|
|
|
|
|
|
|
window.render(0);
|
|
|
|
window.render(1);
|
2010-09-01 13:20:05 +00:00
|
|
|
}
|
|
|
|
|
2010-09-01 13:18:10 +00:00
|
|
|
void PPU::Screen::render_black() {
|
2013-05-05 09:21:30 +00:00
|
|
|
uint32* data = self.output + self.vcounter() * 1024;
|
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
|
|
|
if(self.interlace() && self.field()) data += 512;
|
2011-09-24 09:51:08 +00:00
|
|
|
memset(data, 0, self.display.width << 2);
|
2010-09-01 13:18:10 +00:00
|
|
|
}
|
|
|
|
|
2010-09-01 13:22:05 +00:00
|
|
|
uint16 PPU::Screen::get_pixel_main(unsigned x) {
|
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
|
|
|
auto main = output.main[x];
|
|
|
|
auto sub = output.sub[x];
|
2010-09-01 13:22:05 +00:00
|
|
|
|
|
|
|
if(!regs.addsub_mode) {
|
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
|
|
|
sub.source = 6;
|
2010-09-01 13:22:05 +00:00
|
|
|
sub.color = regs.color;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!window.main[x]) {
|
|
|
|
if(!window.sub[x]) {
|
|
|
|
return 0x0000;
|
|
|
|
}
|
|
|
|
main.color = 0x0000;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
if(main.source != 5 && regs.color_enable[main.source] && window.sub[x]) {
|
2010-09-01 13:22:05 +00:00
|
|
|
bool halve = false;
|
|
|
|
if(regs.color_halve && window.main[x]) {
|
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
|
|
|
if(!regs.addsub_mode || sub.source != 6) halve = true;
|
|
|
|
}
|
|
|
|
return addsub(main.color, sub.color, halve);
|
|
|
|
}
|
|
|
|
|
|
|
|
return main.color;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint16 PPU::Screen::get_pixel_sub(unsigned x) {
|
|
|
|
auto main = output.sub[x];
|
|
|
|
auto sub = output.main[x];
|
|
|
|
|
|
|
|
if(!regs.addsub_mode) {
|
|
|
|
sub.source = 6;
|
|
|
|
sub.color = regs.color;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!window.main[x]) {
|
|
|
|
if(!window.sub[x]) {
|
|
|
|
return 0x0000;
|
|
|
|
}
|
|
|
|
main.color = 0x0000;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(main.source != 5 && regs.color_enable[main.source] && window.sub[x]) {
|
|
|
|
bool halve = false;
|
|
|
|
if(regs.color_halve && window.main[x]) {
|
|
|
|
if(!regs.addsub_mode || sub.source != 6) halve = true;
|
2010-09-01 13:22:05 +00:00
|
|
|
}
|
|
|
|
return addsub(main.color, sub.color, halve);
|
|
|
|
}
|
|
|
|
|
|
|
|
return main.color;
|
|
|
|
}
|
|
|
|
|
2010-09-01 13:18:10 +00:00
|
|
|
void PPU::Screen::render() {
|
2013-05-05 09:21:30 +00:00
|
|
|
uint32* data = self.output + self.vcounter() * 1024;
|
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
|
|
|
if(self.interlace() && self.field()) data += 512;
|
|
|
|
|
|
|
|
if(!self.regs.pseudo_hires && self.regs.bgmode != 5 && self.regs.bgmode != 6) {
|
|
|
|
for(unsigned i = 0; i < 256; i++) {
|
2012-04-29 06:16:44 +00:00
|
|
|
data[i] = video.palette[self.regs.display_brightness << 15 | get_pixel_main(i)];
|
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
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for(unsigned i = 0; i < 256; i++) {
|
2012-04-29 06:16:44 +00:00
|
|
|
*data++ = video.palette[self.regs.display_brightness << 15 | get_pixel_sub(i)];
|
|
|
|
*data++ = video.palette[self.regs.display_brightness << 15 | get_pixel_main(i)];
|
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
|
|
|
}
|
2010-09-01 13:18:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-05 09:21:30 +00:00
|
|
|
PPU::Screen::Screen(PPU& self) : self(self) {
|
2010-09-01 13:18:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
PPU::Screen::~Screen() {
|
|
|
|
}
|
|
|
|
|
2010-09-01 13:22:05 +00:00
|
|
|
void PPU::Screen::Output::plot_main(unsigned x, unsigned color, unsigned priority, unsigned source) {
|
2010-09-01 13:20:05 +00:00
|
|
|
if(priority > main[x].priority) {
|
|
|
|
main[x].color = color;
|
2010-09-01 13:22:05 +00:00
|
|
|
main[x].priority = priority;
|
|
|
|
main[x].source = source;
|
2010-09-01 13:20:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-01 13:22:05 +00:00
|
|
|
void PPU::Screen::Output::plot_sub(unsigned x, unsigned color, unsigned priority, unsigned source) {
|
2010-09-01 13:20:05 +00:00
|
|
|
if(priority > sub[x].priority) {
|
|
|
|
sub[x].color = color;
|
2010-09-01 13:22:05 +00:00
|
|
|
sub[x].priority = priority;
|
|
|
|
sub[x].source = source;
|
2010-09-01 13:20:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-01 13:18:10 +00:00
|
|
|
#endif
|