2010-08-09 13:28:56 +00:00
|
|
|
#ifdef PPU_CPP
|
|
|
|
|
|
|
|
void PPU::Sprite::update(unsigned addr, uint8 data) {
|
|
|
|
if(addr < 0x0200) {
|
|
|
|
unsigned n = addr >> 2;
|
|
|
|
addr &= 3;
|
|
|
|
if(addr == 0) {
|
|
|
|
list[n].x = (list[n].x & 0x100) | data;
|
|
|
|
} else if(addr == 1) {
|
|
|
|
list[n].y = data;
|
|
|
|
} else if(addr == 2) {
|
|
|
|
list[n].character = data;
|
|
|
|
} else { //(addr == 3)
|
|
|
|
list[n].vflip = data & 0x80;
|
|
|
|
list[n].hflip = data & 0x40;
|
|
|
|
list[n].priority = (data >> 4) & 3;
|
|
|
|
list[n].palette = (data >> 1) & 7;
|
|
|
|
list[n].nameselect = data & 1;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
unsigned n = (addr & 0x1f) << 2;
|
|
|
|
list[n + 0].x = ((data & 0x01) << 8) | (list[n + 0].x & 0xff);
|
|
|
|
list[n + 0].size = data & 0x02;
|
|
|
|
list[n + 1].x = ((data & 0x04) << 6) | (list[n + 1].x & 0xff);
|
|
|
|
list[n + 1].size = data & 0x08;
|
|
|
|
list[n + 2].x = ((data & 0x10) << 4) | (list[n + 2].x & 0xff);
|
|
|
|
list[n + 2].size = data & 0x20;
|
|
|
|
list[n + 3].x = ((data & 0x40) << 2) | (list[n + 3].x & 0xff);
|
|
|
|
list[n + 3].size = data & 0x80;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-27 08:57:31 +00:00
|
|
|
void PPU::Sprite::synchronize() {
|
|
|
|
for(unsigned n = 0; n < 544; n++) update(n, ppu.oam[n]);
|
|
|
|
}
|
|
|
|
|
2010-08-09 13:28:56 +00:00
|
|
|
unsigned PPU::Sprite::SpriteItem::width() const {
|
|
|
|
if(size == 0) {
|
2013-05-05 09:21:30 +00:00
|
|
|
static unsigned width[] = { 8, 8, 8, 16, 16, 32, 16, 16};
|
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 width[ppu.sprite.regs.base_size];
|
2010-08-09 13:28:56 +00:00
|
|
|
} else {
|
2013-05-05 09:21:30 +00:00
|
|
|
static unsigned width[] = {16, 32, 64, 32, 64, 64, 32, 32};
|
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 width[ppu.sprite.regs.base_size];
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned PPU::Sprite::SpriteItem::height() const {
|
|
|
|
if(size == 0) {
|
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
|
|
|
if(ppu.sprite.regs.interlace && ppu.sprite.regs.base_size >= 6) return 16;
|
2013-05-05 09:21:30 +00:00
|
|
|
static unsigned height[] = { 8, 8, 8, 16, 16, 32, 32, 32};
|
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 height[ppu.sprite.regs.base_size];
|
2010-08-09 13:28:56 +00:00
|
|
|
} else {
|
2013-05-05 09:21:30 +00:00
|
|
|
static unsigned height[] = {16, 32, 64, 32, 64, 64, 64, 32};
|
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 height[ppu.sprite.regs.base_size];
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|