openMSX
V9990BitmapConverter.hh
Go to the documentation of this file.
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
9namespace openmsx {
10
11class V9990;
12class V9990VRAM;
13
17{
18public:
19 using Pixel = uint32_t;
20
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
29 void convertLine(std::span<Pixel> dst, unsigned x, unsigned y,
30 int cursorY, bool drawCursors);
31
34 void setColorMode(V9990ColorMode colorMode_, V9990DisplayMode display) {
35 colorMode = colorMode_;
36 highRes = isHighRes(display);
37 }
38
39private:
40 [[nodiscard]] static bool isHighRes(V9990DisplayMode display) {
41 return display == one_of(B4, B5, B6, B7);
42 }
43
44private:
47 V9990& vdp;
48
51 V9990VRAM& vram;
52
56 std::span<const Pixel, 64> const palette64;
57 std::span<const int16_t, 64> const palette64_32768;
58
62 std::span<const Pixel, 256> const palette256;
63 std::span<const int16_t, 256> const palette256_32768;
64
68 std::span<const Pixel, 32768> const palette32768;
69
74 V9990ColorMode colorMode;
75 bool highRes;
76};
77
78} // namespace openmsx
79
80#endif
Utility class to convert VRAM content to host pixels.
void convertLine(std::span< Pixel > dst, unsigned x, unsigned y, int cursorY, bool drawCursors)
Convert a line of VRAM into host pixels.
void setColorMode(V9990ColorMode colorMode_, V9990DisplayMode display)
Set a different rendering mode.
Implementation of the Yamaha V9990 VDP as used in the GFX9000 cartridge by Sunrise.
Definition V9990.hh:35
This file implemented 3 utility functions:
Definition Autofire.cc:11