Tidy the Z80 test classes, based on code analysis.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon 2018-11-27 22:28:09 +00:00
parent 0313037d6f
commit 555423d10a
6 changed files with 12 additions and 25 deletions

View File

@ -10,7 +10,7 @@ void Board::powerOn() {
CPU().reset();
}
void Board::powerOff() {
void Board::powerOff() noexcept {
CPU().powerOff();
EightBit::Bus::powerOff();
}

View File

@ -16,14 +16,14 @@ class Board : public EightBit::Bus {
public:
Board(const Configuration& configuration);
EightBit::Z80& CPU() { return m_cpu; }
EightBit::Z80& CPU() noexcept { return m_cpu; }
virtual void powerOn() final;
virtual void powerOff() final;
void powerOn() final;
void powerOff() noexcept final;
protected:
virtual void initialise() final;
virtual EightBit::MemoryMapping mapping(uint16_t address) final {
void initialise() final;
EightBit::MemoryMapping mapping(uint16_t address) noexcept final {
return { m_ram, 0x0000, 0xffff, EightBit::MemoryMapping::ReadWrite };
}

View File

@ -1,8 +0,0 @@
#include "stdafx.h"
#include "Configuration.h"
Configuration::Configuration() noexcept
: m_debugMode(false),
m_profileMode(false),
m_romDirectory("roms") {
}

View File

@ -4,9 +4,9 @@
#include <Register.h>
class Configuration {
class Configuration final {
public:
Configuration() noexcept;
Configuration() noexcept = default;
bool isDebugMode() const {
return m_debugMode;
@ -24,7 +24,7 @@ public:
m_profileMode = value;
}
std::string getRomDirectory() const {
const std::string& getRomDirectory() const {
return m_romDirectory;
}
@ -33,8 +33,7 @@ public:
}
private:
bool m_debugMode;
bool m_profileMode;
std::string m_romDirectory;
bool m_debugMode = false;
bool m_profileMode = false;
std::string m_romDirectory = "roms";
};

View File

@ -147,7 +147,6 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="Board.cpp" />
<ClCompile Include="Configuration.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>

View File

@ -28,9 +28,6 @@
<ClCompile Include="Board.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Configuration.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="test.cpp">
<Filter>Source Files</Filter>
</ClCompile>