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 
9 namespace openmsx {
10 
11 class V9990;
12 class V9990VRAM;
13 
16 template<std::unsigned_integral Pixel>
18 {
19 public:
21  V9990& vdp,
22  const Pixel* palette64, const int16_t* palette64_32768,
23  const Pixel* palette256, const int16_t* palette256_32768,
24  const Pixel* palette32768);
25 
28  void convertLine(Pixel* linePtr, unsigned x, unsigned y, int nrPixels,
29  int cursorY, bool drawCursors);
30 
33  void setColorMode(V9990ColorMode colorMode_, V9990DisplayMode display) {
34  colorMode = colorMode_;
35  highRes = isHighRes(display);
36  }
37 
38 private:
39  [[nodiscard]] static bool isHighRes(V9990DisplayMode display) {
40  return display == one_of(B4, B5, B6, B7);
41  }
42 
43 private:
46  V9990& vdp;
47 
50  V9990VRAM& vram;
51 
55  const Pixel* const palette64;
56  const int16_t* const palette64_32768;
57 
61  const Pixel* const palette256;
62  const int16_t* const palette256_32768;
63 
67  const Pixel* const palette32768;
68 
73  V9990ColorMode colorMode;
74  bool highRes;
75 };
76 
77 } // namespace openmsx
78 
79 #endif
Definition: one_of.hh:7
Utility class to convert VRAM content to host pixels.
V9990BitmapConverter(V9990 &vdp, const Pixel *palette64, const int16_t *palette64_32768, const Pixel *palette256, const int16_t *palette256_32768, const Pixel *palette32768)
void convertLine(Pixel *linePtr, unsigned x, unsigned y, int nrPixels, 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:32
This file implemented 3 utility functions:
Definition: Autofire.cc:9
uint32_t Pixel
constexpr KeyMatrixPosition x
Keyboard bindings.
Definition: Keyboard.cc:127