2017-08-29 22:23:32 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <cstdint>
|
|
|
|
|
2017-09-07 01:15:28 +01:00
|
|
|
#include "GameBoyBus.h"
|
2017-08-29 22:23:32 +01:00
|
|
|
#include "AbstractColourPalette.h"
|
|
|
|
|
|
|
|
namespace EightBit {
|
2017-09-07 01:15:28 +01:00
|
|
|
namespace GameBoy {
|
|
|
|
class Display {
|
|
|
|
public:
|
|
|
|
enum {
|
|
|
|
BufferWidth = 256,
|
|
|
|
BufferHeight = 256,
|
|
|
|
BufferCharacterWidth = BufferWidth / 8,
|
|
|
|
BufferCharacterHeight = BufferHeight / 8,
|
|
|
|
RasterWidth = 160,
|
|
|
|
RasterHeight = 144,
|
|
|
|
};
|
2017-08-29 22:23:32 +01:00
|
|
|
|
2017-09-07 01:15:28 +01:00
|
|
|
Display(const AbstractColourPalette* colours, Bus& bus);
|
2017-08-29 22:23:32 +01:00
|
|
|
|
2017-09-07 01:15:28 +01:00
|
|
|
const std::vector<uint32_t>& pixels() const;
|
2017-08-29 22:23:32 +01:00
|
|
|
|
2017-09-07 01:15:28 +01:00
|
|
|
void initialise();
|
|
|
|
void render();
|
2017-08-29 22:23:32 +01:00
|
|
|
|
2017-09-07 01:15:28 +01:00
|
|
|
private:
|
|
|
|
std::vector<uint32_t> m_pixels;
|
|
|
|
Bus& m_bus;
|
|
|
|
const AbstractColourPalette* m_colours;
|
|
|
|
};
|
|
|
|
}
|
2017-08-29 22:23:32 +01:00
|
|
|
}
|