openMSX
BitmapConverter.hh
Go to the documentation of this file.
1#ifndef BITMAPCONVERTER_HH
2#define BITMAPCONVERTER_HH
3
4#include "DisplayMode.hh"
5#include "openmsx.hh"
6#include <array>
7#include <cstdint>
8#include <span>
9
10namespace openmsx {
11
15{
16public:
17 using Pixel = uint32_t;
18 using DPixel = uint64_t;
19
41 BitmapConverter(std::span<const Pixel, 16 * 2> palette16,
42 std::span<const Pixel, 256> palette256,
43 std::span<const Pixel, 32768> palette32768);
44
53 void convertLine(std::span<Pixel> buf, std::span<const byte, 128> vramPtr);
54
64 void convertLinePlanar(std::span<Pixel> buf,
65 std::span<const byte, 128> vramPtr0,
66 std::span<const byte, 128> vramPtr1);
67
71 inline void setDisplayMode(DisplayMode mode_)
72 {
73 mode = mode_;
74 }
75
78 inline void palette16Changed()
79 {
80 dPaletteValid = false;
81 }
82
83private:
84 void calcDPalette();
85
86 inline void renderGraphic4(std::span<Pixel, 256> buf,
87 std::span<const byte, 128> vramPtr0);
88 inline void renderGraphic5(std::span<Pixel, 512> buf,
89 std::span<const byte, 128> vramPtr0);
90 inline void renderGraphic6(std::span<Pixel, 512> buf,
91 std::span<const byte, 128> vramPtr0,
92 std::span<const byte, 128> vramPtr1);
93 inline void renderGraphic7(std::span<Pixel, 256> buf,
94 std::span<const byte, 128> vramPtr0,
95 std::span<const byte, 128> vramPtr1);
96 inline void renderYJK( std::span<Pixel, 256> buf,
97 std::span<const byte, 128> vramPtr0,
98 std::span<const byte, 128> vramPtr1);
99 inline void renderYAE( std::span<Pixel, 256> buf,
100 std::span<const byte, 128> vramPtr0,
101 std::span<const byte, 128> vramPtr1);
102 inline void renderBogus( std::span<Pixel, 256> buf);
103
104private:
105 std::span<const Pixel, 16 * 2> palette16;
106 std::span<const Pixel, 256> palette256;
107 std::span<const Pixel, 32768> palette32768;
108
109 std::array<DPixel, 16 * 16> dPalette;
110 DisplayMode mode;
111 bool dPaletteValid = false;
112};
113
114} // namespace openmsx
115
116#endif
Utility class for converting VRAM contents to host pixels.
void convertLinePlanar(std::span< Pixel > buf, std::span< const byte, 128 > vramPtr0, std::span< const byte, 128 > vramPtr1)
Convert a line of V9938 VRAM to 256 or 512 host pixels.
void convertLine(std::span< Pixel > buf, std::span< const byte, 128 > vramPtr)
Convert a line of V9938 VRAM to 256 or 512 host pixels.
void palette16Changed()
Inform this class about changes in the palette16 array.
void setDisplayMode(DisplayMode mode_)
Select the display mode to use for scanline conversion.
Represents a VDP display mode.
This file implemented 3 utility functions:
Definition Autofire.cc:9