mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-11-05 03:07:44 +00:00
cac871cf2b
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <Bus.h>
|
|
#include <LR35902.h>
|
|
|
|
#include "FuseTest.h"
|
|
#include "FuseExpectedTestResult.h"
|
|
|
|
#include <LR35902.h>
|
|
#include <GameBoyBus.h>
|
|
#include <Ram.h>
|
|
|
|
namespace Fuse {
|
|
class TestRunner : public EightBit::GameBoy::Bus {
|
|
private:
|
|
const Test& m_test;
|
|
const ExpectedTestResult& m_expected;
|
|
|
|
bool m_failed;
|
|
bool m_unimplemented;
|
|
|
|
EightBit::Ram m_ram;
|
|
EightBit::GameBoy::LR35902 m_cpu;
|
|
|
|
void initialise();
|
|
void initialiseRegisters();
|
|
void initialiseMemory();
|
|
|
|
void check();
|
|
void checkregisters();
|
|
void checkMemory();
|
|
|
|
void dumpDifference(const std::string& description, uint8_t high, uint8_t low) const;
|
|
void dumpDifference(
|
|
const std::string& highDescription,
|
|
const std::string& lowDescription,
|
|
EightBit::register16_t actual, EightBit::register16_t expected) const;
|
|
|
|
protected:
|
|
virtual uint8_t& reference(uint16_t address) {
|
|
return m_ram.reference(address);
|
|
}
|
|
|
|
public:
|
|
TestRunner(const Test& test, const ExpectedTestResult& expected);
|
|
|
|
void run();
|
|
bool failed() const { return m_failed; }
|
|
bool unimplemented() const { return m_unimplemented; }
|
|
};
|
|
} |