From 0f24863561b7c609395b59ab73e634509d3111d8 Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Thu, 23 Jan 2025 22:10:55 +0100 Subject: copy reference implementation --- app/test/main.cc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'app/test/main.cc') diff --git a/app/test/main.cc b/app/test/main.cc index 3bb785f..564b593 100644 --- a/app/test/main.cc +++ b/app/test/main.cc @@ -1,7 +1,8 @@ -#include "nes/display.hh" -#include "nes/nes.hh" +#include "nes/util/display.hh" #include "nes/util/rgb.hh" #include "nes/util/snapshot.hh" +#include "nes/nes.hh" +#include "nes/ref/nes.hh" #include namespace @@ -41,20 +42,25 @@ int main() { auto const path = "/Users/hannes/Documents/temp/supermario.nes"; - auto cartridge = nes::cartridge::from_file(path); - if (!cartridge.is_valid()) + // Initialize the system to be tested. + auto cartridge_a = nes::cartridge::from_file(path); + if (!cartridge_a.is_valid()) { std::cerr << "Could not load cartridge!" << std::endl; std::abort(); } - - // Initialize the system to be tested. auto display_a = std::make_unique(); - auto sys_a = nes::nes{ cartridge, *display_a }; + auto sys_a = nes::nes{ std::move(cartridge_a), *display_a }; // Initialize the (assumed to be working) reference implementation. + auto cartridge_b = nes::ref::cartridge::from_file(path); + if (!cartridge_b.is_valid()) + { + std::cerr << "Could not load cartridge!" << std::endl; + std::abort(); + } auto display_b = std::make_unique(); - auto sys_b = nes::nes{ cartridge, *display_b }; + auto sys_b = nes::ref::nes{ std::move(cartridge_b), *display_b }; // Run. while (true) -- cgit v1.3.1