From e4a5fbba5855b917b5ec4881e5ef29035e08a01e Mon Sep 17 00:00:00 2001 From: Riyyi Date: Wed, 17 Aug 2022 22:23:21 +0200 Subject: [PATCH 1/2] Emulator: Add main structure classes --- src/apu.cpp | 16 ++++++++++++++++ src/apu.h | 14 ++++++++++++++ src/cpu.cpp | 16 ++++++++++++++++ src/cpu.h | 14 ++++++++++++++ src/dma.cpp | 16 ++++++++++++++++ src/dma.h | 14 ++++++++++++++ src/ppu.cpp | 16 ++++++++++++++++ src/ppu.h | 14 ++++++++++++++ 8 files changed, 120 insertions(+) create mode 100644 src/apu.cpp create mode 100644 src/apu.h create mode 100644 src/cpu.cpp create mode 100644 src/cpu.h create mode 100644 src/dma.cpp create mode 100644 src/dma.h create mode 100644 src/ppu.cpp create mode 100644 src/ppu.h diff --git a/src/apu.cpp b/src/apu.cpp new file mode 100644 index 0000000..72027e0 --- /dev/null +++ b/src/apu.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2022 Riyyi + * Copyright (C) 2022 Th3FrankXD + * + * SPDX-License-Identifier: MIT + */ + +#include "apu.h" + +APU::APU() +{ +} + +APU::~APU() +{ +} diff --git a/src/apu.h b/src/apu.h new file mode 100644 index 0000000..72395f0 --- /dev/null +++ b/src/apu.h @@ -0,0 +1,14 @@ +/* + * Copyright (C) 2022 Riyyi + * Copyright (C) 2022 Th3FrankXD + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +class APU { +public: + APU(); + virtual ~APU(); +}; diff --git a/src/cpu.cpp b/src/cpu.cpp new file mode 100644 index 0000000..6ce2bc7 --- /dev/null +++ b/src/cpu.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2022 Riyyi + * Copyright (C) 2022 Th3FrankXD + * + * SPDX-License-Identifier: MIT + */ + +#include "cpu.h" + +CPU::CPU() +{ +} + +CPU::~CPU() +{ +} diff --git a/src/cpu.h b/src/cpu.h new file mode 100644 index 0000000..cea7572 --- /dev/null +++ b/src/cpu.h @@ -0,0 +1,14 @@ +/* + * Copyright (C) 2022 Riyyi + * Copyright (C) 2022 Th3FrankXD + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +class CPU { +public: + CPU(); + virtual ~CPU(); +}; diff --git a/src/dma.cpp b/src/dma.cpp new file mode 100644 index 0000000..f008d82 --- /dev/null +++ b/src/dma.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2022 Riyyi + * Copyright (C) 2022 Th3FrankXD + * + * SPDX-License-Identifier: MIT + */ + +#include "dma.h" + +DMA::DMA() +{ +} + +DMA::~DMA() +{ +} diff --git a/src/dma.h b/src/dma.h new file mode 100644 index 0000000..252240a --- /dev/null +++ b/src/dma.h @@ -0,0 +1,14 @@ +/* + * Copyright (C) 2022 Riyyi + * Copyright (C) 2022 Th3FrankXD + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +class DMA { +public: + DMA(); + virtual ~DMA(); +}; diff --git a/src/ppu.cpp b/src/ppu.cpp new file mode 100644 index 0000000..93b3398 --- /dev/null +++ b/src/ppu.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2022 Riyyi + * Copyright (C) 2022 Th3FrankXD + * + * SPDX-License-Identifier: MIT + */ + +#include "ppu.h" + +PPU ::PPU() +{ +} + +PPU ::~PPU() +{ +} diff --git a/src/ppu.h b/src/ppu.h new file mode 100644 index 0000000..6b5adfe --- /dev/null +++ b/src/ppu.h @@ -0,0 +1,14 @@ +/* + * Copyright (C) 2022 Riyyi + * Copyright (C) 2022 Th3FrankXD + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +class PPU { +public: + PPU(); + virtual ~PPU(); +}; From 0d35476da0714f7947f4d81e2f111e35e548534d Mon Sep 17 00:00:00 2001 From: Riyyi Date: Wed, 17 Aug 2022 22:34:33 +0200 Subject: [PATCH 2/2] 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(); +};