| 1 |
#ifndef V9990BITMAPCONVERTER_HH |
| 2 |
#define V9990BITMAPCONVERTER_HH |
| 3 |
|
| 4 |
#include "V9990ModeEnum.hh" |
| 5 |
#include "one_of.hh" |
| 6 |
#include <cstdint> |
| 7 |
#include <span> |
| 8 |
|
| 9 |
namespace openmsx { |
| 10 |
|
| 11 |
class V9990; |
| 12 |
class V9990VRAM; |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
class V9990BitmapConverter |
| 17 |
{ |
| 18 |
public: |
| 19 |
using Pixel = uint32_t; |
| 20 |
|
| 21 |
V9990BitmapConverter( |
| 22 |
V9990& vdp, |
| 23 |
std::span<const Pixel, 64> palette64, std::span<const int16_t, 64> palette64_32768, |
| 24 |
std::span<const Pixel, 256> palette256, std::span<const int16_t, 256> palette256_32768, |
| 25 |
std::span<const Pixel, 32768> palette32768); |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
void convertLine(std::span<Pixel> dst, unsigned x, unsigned y, |
| 30 |
int cursorY, bool drawCursors) const; |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
void setColorMode(V9990ColorMode colorMode_, V9990DisplayMode display) { |
| 35 |
colorMode = colorMode_; |
| 36 |
highRes = isHighRes(display); |
| 37 |
} |
| 38 |
|
| 39 |
private: |
| 40 |
[[nodiscard]] static bool isHighRes(V9990DisplayMode display) { |
| 41 |
using enum V9990DisplayMode; |
| 42 |
return display == one_of(B4, B5, B6, B7); |
| 43 |
} |
| 44 |
|
| 45 |
private: |
| 46 |
|
| 47 |
|
| 48 |
V9990& vdp; |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
V9990VRAM& vram; |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
std::span<const Pixel, 64> const palette64; |
| 58 |
std::span<const int16_t, 64> const palette64_32768; |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
std::span<const Pixel, 256> const palette256; |
| 64 |
std::span<const int16_t, 256> const palette256_32768; |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
std::span<const Pixel, 32768> const palette32768; |
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
V9990ColorMode colorMode; |
| 76 |
bool highRes; |
| 77 |
}; |
| 78 |
|
| 79 |
} |
| 80 |
|
| 81 |
#endif |