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 
8 namespace openmsx {
9 
10 class V9990;
11 class V9990VRAM;
12 
15 template<typename Pixel>
17 {
18 public:
20  V9990& vdp,
21  const Pixel* palette64, const int16_t* palette64_32768,
22  const Pixel* palette256, const int16_t* palette256_32768,
23  const Pixel* palette32768);
24 
27  void convertLine(Pixel* linePtr, unsigned x, unsigned y, int nrPixels,
28  int cursorY, bool drawCursors);
29 
32  void setColorMode(V9990ColorMode colorMode_, V9990DisplayMode display) {
33  colorMode = colorMode_;
34  highRes = isHighRes(display);
35  }
36 
37 private:
38  [[nodiscard]] static bool isHighRes(V9990DisplayMode display) {
39  return display == one_of(B4, B5, B6, B7);
40  }
41 
42 private:
45  V9990& vdp;
46 
49  V9990VRAM& vram;
50 
54  const Pixel* const palette64;
55  const int16_t* const palette64_32768;
56 
60  const Pixel* const palette256;
61  const int16_t* const palette256_32768;
62 
66  const Pixel* const palette32768;
67 
72  V9990ColorMode colorMode;
73  bool highRes;
74 };
75 
76 } // namespace openmsx
77 
78 #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:31
This file implemented 3 utility functions:
Definition: Autofire.cc:5
uint32_t Pixel
constexpr KeyMatrixPosition x
Keyboard bindings.
Definition: Keyboard.cc:124