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 <cstdint>
6 
7 namespace openmsx {
8 
9 class V9990;
10 class V9990VRAM;
11 
14 template <class Pixel>
16 {
17 public:
19  V9990& vdp,
20  const Pixel* palette64, const int16_t* palette64_32768,
21  const Pixel* palette256, const int16_t* palette256_32768,
22  const Pixel* palette32768);
23 
26  void convertLine(Pixel* linePtr, unsigned x, unsigned y, int nrPixels,
27  int cursorY, bool drawCursors);
28 
31  void setColorMode(V9990ColorMode colorMode_, V9990DisplayMode display) {
32  colorMode = colorMode_;
33  highRes = isHighRes(display);
34  }
35 
36 private:
37  static bool isHighRes(V9990DisplayMode display) {
38  return (display == B4) || (display == B5) ||
39  (display == B6) || (display == 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
openmsx::B5
Definition: V9990ModeEnum.hh:8
V9990ModeEnum.hh
openmsx::V9990ColorMode
V9990ColorMode
Definition: V9990ModeEnum.hh:11
openmsx::B6
Definition: V9990ModeEnum.hh:8
openmsx::V9990BitmapConverter::convertLine
void convertLine(Pixel *linePtr, unsigned x, unsigned y, int nrPixels, int cursorY, bool drawCursors)
Convert a line of VRAM into host pixels.
Definition: V9990BitmapConverter.cc:440
openmsx::Pixel
uint32_t Pixel
Definition: GLHQLiteScaler.cc:93
openmsx::V9990
V9990
Definition: V9990.cc:974
openmsx::V9990DisplayMode
V9990DisplayMode
Definition: V9990ModeEnum.hh:6
openmsx::V9990BitmapConverter::setColorMode
void setColorMode(V9990ColorMode colorMode_, V9990DisplayMode display)
Set a different rendering mode.
Definition: V9990BitmapConverter.hh:31
openmsx::B7
Definition: V9990ModeEnum.hh:8
openmsx::V9990BitmapConverter
Utility class to convert VRAM content to host pixels.
Definition: V9990BitmapConverter.hh:15
openmsx::V9990BitmapConverter::V9990BitmapConverter
V9990BitmapConverter(V9990 &vdp, const Pixel *palette64, const int16_t *palette64_32768, const Pixel *palette256, const int16_t *palette256_32768, const Pixel *palette32768)
Definition: V9990BitmapConverter.cc:14
openmsx::x
constexpr KeyMatrixPosition x
Keyboard bindings.
Definition: Keyboard.cc:1377
openmsx::V9990VRAM
V9990VRAM
Definition: V9990VRAM.cc:59
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::V9990
Implementation of the Yamaha V9990 VDP as used in the GFX9000 cartridge by Sunrise.
Definition: V9990.hh:29
openmsx::B4
Definition: V9990ModeEnum.hh:8