diff options
| author | Hannes Schulze <haschu0103@outlook.de> | 2025-02-06 20:47:29 +0100 |
|---|---|---|
| committer | Hannes Schulze <haschu0103@outlook.de> | 2025-02-06 20:47:29 +0100 |
| commit | 8fd56566520ae93bda64fe335cef9202388c6364 (patch) | |
| tree | b0828c4aa0409d7435a0de638b49a6525c67ac16 | |
| parent | c02f8e99460ba07f90c486b9e7388a7ab9dff3bd (diff) | |
remove ENABLE_PPU
| -rw-r--r-- | CMakeLists.txt | 1 | ||||
| -rw-r--r-- | lib/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | lib/nes/sys/cpu.cc | 18 |
3 files changed, 0 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b19668..df387fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,6 @@ option(NES_ENABLE_SANITIZER_ADDRESS "Enable address sanitizer." OFF) option(NES_ENABLE_SANITIZER_UNDEFINED_BEHAVIOR "Enable undefined behavior sanitizer." OFF) option(NES_ENABLE_DEBUG_OUTPUT "Enable debug output." OFF) option(NES_ENABLE_SNAPSHOTS "Enable snapshot functionality for debugging purposes." OFF) -option(NES_ENABLE_PPU "Enable Picture Processing Unit." ON) add_library(nes_options INTERFACE) add_library(nes::options ALIAS nes_options) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index ce78076..5dde4fd 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -4,9 +4,6 @@ add_library(nes::nes ALIAS nes) target_include_directories(nes PUBLIC .) target_link_libraries(nes PRIVATE nes::options) -if(NES_ENABLE_PPU) - target_compile_definitions(nes PUBLIC NES_ENABLE_PPU) -endif() if(NES_ENABLE_DEBUG_OUTPUT) target_compile_definitions(nes PUBLIC NES_ENABLE_DEBUG_OUTPUT) target_link_libraries(nes PUBLIC spdlog::spdlog) diff --git a/lib/nes/sys/cpu.cc b/lib/nes/sys/cpu.cc index b2f9a88..cdc9682 100644 --- a/lib/nes/sys/cpu.cc +++ b/lib/nes/sys/cpu.cc @@ -50,13 +50,11 @@ namespace nes::sys { // See https://www.nesdev.org/wiki/CPU_unofficial_opcodes -#ifdef NES_ENABLE_PPU if (nmi_pending_) { execute_interrupt(address{ 0xFFFA }); nmi_pending_ = false; } -#endif auto const opcode = advance_pc8(); switch (opcode) @@ -1349,7 +1347,6 @@ namespace nes::sys if (addr <= address{ 0x1FFF }) { return ram_[addr.get_absolute() % ram_size]; } if (addr <= address{ 0x3FFF }) { -#ifdef NES_ENABLE_PPU switch (addr.get_absolute() % 8) { case 0: return ppu_.read_latch(); @@ -1363,16 +1360,9 @@ namespace nes::sys default: return 0x0; } -#else - return 0x0; -#endif } if (addr <= address{ 0x4013 }) { return 0x0; } // TODO: APU registers -#ifdef NES_ENABLE_PPU if (addr == address{ 0x4014 }) { return ppu_.read_latch(); } -#else - if (addr == address{ 0x4014 }) { return 0x0; } -#endif if (addr == address{ 0x4015 }) { return 0x0; } // TODO: APU registers if (addr == address{ 0x4016 }) { return controller_1_.read(); } if (addr == address{ 0x4017 }) { return controller_2_.read(); } @@ -1392,7 +1382,6 @@ namespace nes::sys if (addr <= address{ 0x1FFF }) { ram_[addr.get_absolute() % ram_size] = value; return; } if (addr <= address{ 0x3FFF }) { -#ifdef NES_ENABLE_PPU switch (addr.get_absolute() % 8) { case 0: ppu_.write_ppuctrl(value); return; @@ -1405,16 +1394,9 @@ namespace nes::sys case 7: ppu_.write_ppudata(value); return; default: return; } -#else - return; -#endif } if (addr <= address{ 0x4013 }) { return; } // TODO: APU registers -#ifdef NES_ENABLE_PPU if (addr == address{ 0x4014 }) { ppu_.write_oamdma(value); return; } -#else - if (addr == address{ 0x4014 }) { return; } -#endif if (addr == address{ 0x4015 }) { return; } // TODO: APU registers if (addr == address{ 0x4016 }) { controller_1_.write(value); return; } if (addr == address{ 0x4017 }) { controller_2_.write(value); return; } |
