summaryrefslogtreecommitdiff
path: root/app/test/main.cc
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-01-23 22:10:55 +0100
committerHannes Schulze <haschu0103@outlook.de>2025-01-23 22:10:55 +0100
commit0f24863561b7c609395b59ab73e634509d3111d8 (patch)
treeb89c6a8db88f0c1c8c55d41d733b6cfa566a08f4 /app/test/main.cc
parentb1d1573702f21e3104606d6ade5f5d39ec86a33a (diff)
copy reference implementation
Diffstat (limited to 'app/test/main.cc')
-rw-r--r--app/test/main.cc22
1 files changed, 14 insertions, 8 deletions
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 <iostream>
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<dummy_display>();
- 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<dummy_display>();
- auto sys_b = nes::nes{ cartridge, *display_b };
+ auto sys_b = nes::ref::nes{ std::move(cartridge_b), *display_b };
// Run.
while (true)