Cleanups.
This commit is contained in:
byuu 2019-10-16 16:17:56 +09:00
parent 6b7e6e01bb
commit 9f86a3be26
3 changed files with 1 additions and 22 deletions

View File

@ -38,23 +38,6 @@ auto PPU::writeVRAM(uint8 data) -> void {
if constexpr(Byte == 1) {
vram[address] = vram[address] & 0x00ff | data << 8;
}
updateTiledata(address);
}
auto PPU::updateTiledata(uint address) -> void {
/*
auto word = vram[address & 0x7fff];
auto line2bpp = tilecache[TileMode::BPP2] + (address << 3 & 0x3fff8);
auto line4bpp = tilecache[TileMode::BPP4] + (address << 2 & 0x1ffc0) + (address << 3 & 0x38);
auto line8bpp = tilecache[TileMode::BPP8] + (address << 1 & 0x0ffc0) + (address << 3 & 0x38);
uint plane4bpp = address >> 2 & 2;
uint plane8bpp = address >> 2 & 6;
for(uint x : range(8)) {
line2bpp[7 - x] = word >> x & 1 | word >> x + 7 & 2;
line4bpp[7 - x] = line4bpp[7 - x] & ~(3 << plane4bpp) | (word >> x & 1) << plane4bpp | (word >> x + 7 & 2) << plane4bpp;
line8bpp[7 - x] = line8bpp[7 - x] & ~(3 << plane8bpp) | (word >> x & 1) << plane8bpp | (word >> x + 7 & 2) << plane8bpp;
}
*/
}
auto PPU::readOAM(uint10 address) -> uint8 {

View File

@ -167,10 +167,7 @@ auto PPU::power(bool reset) -> void {
bus.map(reader, writer, "00-3f,80-bf:2100-213f");
if(!reset) {
for(uint address : range(32768)) {
vram[address] = 0x0000;
updateTiledata(address);
}
for(auto& word : vram) word = 0x0000;
for(auto& color : cgram) color = 0x0000;
for(auto& object : objects) object = {};
}

View File

@ -250,7 +250,6 @@ public:
alwaysinline auto vramAddress() const -> uint;
alwaysinline auto readVRAM() -> uint16;
template<bool Byte> alwaysinline auto writeVRAM(uint8 data) -> void;
alwaysinline auto updateTiledata(uint address) -> void;
alwaysinline auto readOAM(uint10 address) -> uint8;
alwaysinline auto writeOAM(uint10 address, uint8 data) -> void;
template<bool Byte> alwaysinline auto readCGRAM(uint8 address) -> uint8;