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 <concepts>
7#include <cstdint>
8#include <span>
9
10namespace openmsx {
11
12class V9990;
13class V9990VRAM;
14
17template<std::unsigned_integral Pixel>
19{
20public:
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
Definition: one_of.hh:7
Utility class to convert VRAM content to host pixels.
V9990BitmapConverter(V9990 &vdp, std::span< const Pixel, 64 > palette64, std::span< const int16_t, 64 > palette64_32768, std::span< const Pixel, 256 > palette256, std::span< const int16_t, 256 > palette256_32768, std::span< const Pixel, 32768 > palette32768)
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:9