openMSX
CharacterConverter.hh
Go to the documentation of this file.
1#ifndef CHARACTERCONVERTER_HH
2#define CHARACTERCONVERTER_HH
3
4#include "openmsx.hh"
5#include <cstdint>
6#include <span>
7
8namespace openmsx {
9
10class VDP;
11class VDPVRAM;
12class DisplayMode;
13
14
18{
19public:
20 using Pixel = uint32_t;
21
33 CharacterConverter(VDP& vdp, std::span<const Pixel, 16> palFg, std::span<const Pixel, 16> palBg);
34
43 void convertLine(std::span<Pixel> buf, int line);
44
48 void setDisplayMode(DisplayMode mode);
49
50private:
51 inline void renderText1 (std::span<Pixel, 256> buf, int line);
52 inline void renderText1Q (std::span<Pixel, 256> buf, int line);
53 inline void renderText2 (std::span<Pixel, 512> buf, int line);
54 inline void renderGraphic1(std::span<Pixel, 256> buf, int line);
55 inline void renderGraphic2(std::span<Pixel, 256> buf, int line);
56 inline void renderMulti (std::span<Pixel, 256> buf, int line);
57 inline void renderMultiQ (std::span<Pixel, 256> buf, int line);
58 inline void renderBogus (std::span<Pixel, 256> buf);
59 inline void renderBlank (std::span<Pixel, 256> buf);
60 inline void renderMultiHelper(Pixel* pixelPtr, int line,
61 unsigned mask, unsigned patternQuarter);
62
63 [[nodiscard]] std::span<const byte, 32> getNamePtr(int line, int scroll);
64
65private:
66 VDP& vdp;
67 VDPVRAM& vram;
68
69 std::span<const Pixel, 16> palFg;
70 std::span<const Pixel, 16> palBg;
71
72 unsigned modeBase = 0; // not strictly needed, but avoids Coverity warning
73};
74
75} // namespace openmsx
76
77#endif
Utility class for converting VRAM contents to host pixels.
void setDisplayMode(DisplayMode mode)
Select the display mode to use for scanline conversion.
void convertLine(std::span< Pixel > buf, int line)
Convert a line of V9938 VRAM to 256 or 512 host pixels.
Represents a VDP display mode.
Manages VRAM contents and synchronizes the various users of the VRAM.
Definition VDPVRAM.hh:397
Unified implementation of MSX Video Display Processors (VDPs).
Definition VDP.hh:64
This file implemented 3 utility functions:
Definition Autofire.cc:9