From 0d35476da0714f7947f4d81e2f111e35e548534d Mon Sep 17 00:00:00 2001 From: Riyyi Date: Wed, 17 Aug 2022 22:34:33 +0200 Subject: [PATCH] Emulator: Add ProcessingUnit base class --- src/apu.h | 4 +++- src/cpu.h | 4 +++- src/ppu.h | 4 +++- src/processingunit.cpp | 16 ++++++++++++++++ src/processingunit.h | 14 ++++++++++++++ 5 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 src/processingunit.cpp create mode 100644 src/processingunit.h diff --git a/src/apu.h b/src/apu.h index 72395f0..aba98d2 100644 --- a/src/apu.h +++ b/src/apu.h @@ -7,7 +7,9 @@ #pragma once -class APU { +#include "processingunit.h" + +class APU : public ProcessingUnit { public: APU(); virtual ~APU(); diff --git a/src/cpu.h b/src/cpu.h index cea7572..1f94e0c 100644 --- a/src/cpu.h +++ b/src/cpu.h @@ -7,7 +7,9 @@ #pragma once -class CPU { +#include "processingunit.h" + +class CPU final : public ProcessingUnit { public: CPU(); virtual ~CPU(); diff --git a/src/ppu.h b/src/ppu.h index 6b5adfe..9d7a0d2 100644 --- a/src/ppu.h +++ b/src/ppu.h @@ -7,7 +7,9 @@ #pragma once -class PPU { +#include "processingunit.h" + +class PPU final : public ProcessingUnit { public: PPU(); virtual ~PPU(); diff --git a/src/processingunit.cpp b/src/processingunit.cpp new file mode 100644 index 0000000..851c7b8 --- /dev/null +++ b/src/processingunit.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2022 Riyyi + * Copyright (C) 2022 Th3FrankXD + * + * SPDX-License-Identifier: MIT + */ + +#include "processingunit.h" + +ProcessingUnit::ProcessingUnit() +{ +} + +ProcessingUnit::~ProcessingUnit() +{ +} diff --git a/src/processingunit.h b/src/processingunit.h new file mode 100644 index 0000000..d43d5dd --- /dev/null +++ b/src/processingunit.h @@ -0,0 +1,14 @@ +/* + * Copyright (C) 2022 Riyyi + * Copyright (C) 2022 Th3FrankXD + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +class ProcessingUnit { +public: + ProcessingUnit(); + virtual ~ProcessingUnit(); +};