redesigned display peripheral
This commit is contained in:
@@ -1,15 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <bitset>
|
||||
#include <memory>
|
||||
|
||||
namespace chocochip8 {
|
||||
|
||||
constexpr size_t gcWidth = 128;
|
||||
constexpr size_t gcHeight = 64;
|
||||
using Scanline = std::bitset<gcWidth>;
|
||||
using Framebuffer = std::array<Scanline, gcHeight>;
|
||||
|
||||
enum class Key {
|
||||
KEY_0, KEY_1, KEY_2, KEY_3,
|
||||
@@ -20,11 +17,9 @@ namespace chocochip8 {
|
||||
|
||||
class Display {
|
||||
public:
|
||||
friend class Interpreter;
|
||||
Display(): mpFramebuffer{std::make_unique<Framebuffer>()} {}
|
||||
virtual ~Display() = default;
|
||||
protected:
|
||||
std::unique_ptr<Framebuffer> mpFramebuffer;
|
||||
virtual int blit(const Scanline& spriteScanline, int y) = 0;
|
||||
virtual void clear() = 0;
|
||||
};
|
||||
|
||||
class Buzzer {
|
||||
|
||||
Reference in New Issue
Block a user