From 390b54c975da3f481725e76fe30800114e0f65ff Mon Sep 17 00:00:00 2001
From: AnonymusRaccoon
Date: Thu, 30 Jan 2020 18:14:27 +0100
Subject: [PATCH] Adding the architecture for the scoring system
---
sources/Cartridge/Cartridge.cpp | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/sources/Cartridge/Cartridge.cpp b/sources/Cartridge/Cartridge.cpp
index ec9e80a..88275fb 100644
--- a/sources/Cartridge/Cartridge.cpp
+++ b/sources/Cartridge/Cartridge.cpp
@@ -61,7 +61,20 @@ namespace ComSquare::Cartridge
uint32_t Cartridge::_getHeaderAddress()
{
- return 0x81c0;
+ uint32_t address[] = {0x7FC0, 0xFFC0, 0x81C0, 0x101C0};
+ int bestScore = -1;
+ uint32_t bestAddress = 0;
+
+ for (uint32_t addr : address) {
+ int score = 0;
+
+ // TODO Implement a scoring system for the address here.
+ if (score > bestScore) {
+ bestScore = score;
+ bestAddress = addr;
+ }
+ }
+ return bestAddress;
}
bool Cartridge::_loadHeader()