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 <class 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  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
one_of.hh
openmsx::B5
@ B5
Definition: V9990ModeEnum.hh:8
V9990ModeEnum.hh
openmsx::V9990ColorMode
V9990ColorMode
Definition: V9990ModeEnum.hh:11
openmsx::B6
@ 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:439
openmsx::Pixel
uint32_t Pixel
Definition: GLHQLiteScaler.cc:98
openmsx::V9990
V9990
Definition: V9990.cc:974
one_of
Definition: one_of.hh:7
openmsx::V9990DisplayMode
V9990DisplayMode
Definition: V9990ModeEnum.hh:6
openmsx::V9990BitmapConverter::setColorMode
void setColorMode(V9990ColorMode colorMode_, V9990DisplayMode display)
Set a different rendering mode.
Definition: V9990BitmapConverter.hh:32
openmsx::B7
@ B7
Definition: V9990ModeEnum.hh:8
openmsx::V9990BitmapConverter
Utility class to convert VRAM content to host pixels.
Definition: V9990BitmapConverter.hh:17
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:13
openmsx::x
constexpr KeyMatrixPosition x
Keyboard bindings.
Definition: Keyboard.cc:1419
openmsx::V9990VRAM
V9990VRAM
Definition: V9990VRAM.cc:59
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::V9990
Implementation of the Yamaha V9990 VDP as used in the GFX9000 cartridge by Sunrise.
Definition: V9990.hh:31
openmsx::B4
@ B4
Definition: V9990ModeEnum.hh:8