From 9f86a3be264852dc703e38ac7c986fe49af1df8c Mon Sep 17 00:00:00 2001 From: byuu <2107894+byuu@users.noreply.github.com> Date: Wed, 16 Oct 2019 16:17:56 +0900 Subject: [PATCH] v111.9 Cleanups. --- bsnes/sfc/ppu-fast/io.cpp | 17 ----------------- bsnes/sfc/ppu-fast/ppu.cpp | 5 +---- bsnes/sfc/ppu-fast/ppu.hpp | 1 - 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/bsnes/sfc/ppu-fast/io.cpp b/bsnes/sfc/ppu-fast/io.cpp index 2ee16095..9db01ea0 100644 --- a/bsnes/sfc/ppu-fast/io.cpp +++ b/bsnes/sfc/ppu-fast/io.cpp @@ -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 { diff --git a/bsnes/sfc/ppu-fast/ppu.cpp b/bsnes/sfc/ppu-fast/ppu.cpp index 2848ec71..49cae4d9 100644 --- a/bsnes/sfc/ppu-fast/ppu.cpp +++ b/bsnes/sfc/ppu-fast/ppu.cpp @@ -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 = {}; } diff --git a/bsnes/sfc/ppu-fast/ppu.hpp b/bsnes/sfc/ppu-fast/ppu.hpp index 9b29278f..f93b39a3 100644 --- a/bsnes/sfc/ppu-fast/ppu.hpp +++ b/bsnes/sfc/ppu-fast/ppu.hpp @@ -250,7 +250,6 @@ public: alwaysinline auto vramAddress() const -> uint; alwaysinline auto readVRAM() -> uint16; template 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 alwaysinline auto readCGRAM(uint8 address) -> uint8;