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
7#include <array>
8#include <cstdint>
9#include <span>
10
11namespace openmsx {
12
16{
17public:
18 using Pixel = uint32_t;
19 using DPixel = uint64_t;
20
42 BitmapConverter(std::span<const Pixel, 16 * 2> palette16,
43 std::span<const Pixel, 256> palette256,
44 std::span<const Pixel, 32768> palette32768);
45
54 void convertLine(std::span<Pixel> buf, std::span<const byte, 128> vramPtr);
55
65 void convertLinePlanar(std::span<Pixel> buf,
66 std::span<const byte, 128> vramPtr0,
67 std::span<const byte, 128> vramPtr1);
68
72 inline void setDisplayMode(DisplayMode mode_)
73 {
74 mode = mode_;
75 }
76
79 inline void palette16Changed()
80 {
81 dPaletteValid = false;
82 }
83
84private:
85 void calcDPalette();
86
87 inline void renderGraphic4(std::span<Pixel, 256> buf,
88 std::span<const byte, 128> vramPtr0);
89 inline void renderGraphic5(std::span<Pixel, 512> buf,
90 std::span<const byte, 128> vramPtr0) const;
91 inline void renderGraphic6(std::span<Pixel, 512> buf,
92 std::span<const byte, 128> vramPtr0,
93 std::span<const byte, 128> vramPtr1);
94 inline void renderGraphic7(std::span<Pixel, 256> buf,
95 std::span<const byte, 128> vramPtr0,
96 std::span<const byte, 128> vramPtr1) const;
97 inline void renderYJK( std::span<Pixel, 256> buf,
98 std::span<const byte, 128> vramPtr0,
99 std::span<const byte, 128> vramPtr1) const;
100 inline void renderYAE( std::span<Pixel, 256> buf,
101 std::span<const byte, 128> vramPtr0,
102 std::span<const byte, 128> vramPtr1) const;
103 inline void renderBogus( std::span<Pixel, 256> buf) const;
104
105private:
106 std::span<const Pixel, 16 * 2> palette16;
107 std::span<const Pixel, 256> palette256;
108 std::span<const Pixel, 32768> palette32768;
109
110 std::array<DPixel, 16 * 16> dPalette;
111 DisplayMode mode;
112 bool dPaletteValid = false;
113};
114
115} // namespace openmsx
116
117#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:11