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) const;
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 using enum V9990DisplayMode;
42 return display == one_of(B4, B5, B6, B7);
43 }
44
45private:
48 V9990& vdp;
49
52 V9990VRAM& vram;
53
57 std::span<const Pixel, 64> const palette64;
58 std::span<const int16_t, 64> const palette64_32768;
59
63 std::span<const Pixel, 256> const palette256;
64 std::span<const int16_t, 256> const palette256_32768;
65
69 std::span<const Pixel, 32768> const palette32768;
70
75 V9990ColorMode colorMode;
76 bool highRes;
77};
78
79} // namespace openmsx
80
81#endif
Utility class to convert VRAM content to host pixels.
void convertLine(std::span< Pixel > dst, unsigned x, unsigned y, int cursorY, bool drawCursors) const
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