openMSX
CharacterConverter.hh
Go to the documentation of this file.
1#ifndef CHARACTERCONVERTER_HH
2#define CHARACTERCONVERTER_HH
3
4#include "openmsx.hh"
5
6#include <cstdint>
7#include <span>
8
9namespace openmsx {
10
11class VDP;
12class VDPVRAM;
13class DisplayMode;
14
15
19{
20public:
21 using Pixel = uint32_t;
22
34 CharacterConverter(VDP& vdp, std::span<const Pixel, 16> palFg, std::span<const Pixel, 16> palBg);
35
44 void convertLine(std::span<Pixel> buf, int line) const;
45
49 void setDisplayMode(DisplayMode mode);
50
51private:
52 inline void renderText1 (std::span<Pixel, 256> buf, int line) const;
53 inline void renderText1Q (std::span<Pixel, 256> buf, int line) const;
54 inline void renderText2 (std::span<Pixel, 512> buf, int line) const;
55 inline void renderGraphic1(std::span<Pixel, 256> buf, int line) const;
56 inline void renderGraphic2(std::span<Pixel, 256> buf, int line) const;
57 inline void renderMulti (std::span<Pixel, 256> buf, int line) const;
58 inline void renderMultiQ (std::span<Pixel, 256> buf, int line) const;
59 inline void renderBogus (std::span<Pixel, 256> buf) const;
60 inline void renderBlank (std::span<Pixel, 256> buf) const;
61 inline void renderMultiHelper(Pixel* pixelPtr, int line,
62 unsigned mask, unsigned patternQuarter) const;
63
64 [[nodiscard]] std::span<const byte, 32> getNamePtr(int line, int scroll) const;
65
66private:
67 VDP& vdp;
68 VDPVRAM& vram;
69
70 std::span<const Pixel, 16> palFg;
71 std::span<const Pixel, 16> palBg;
72
73 unsigned modeBase = 0; // not strictly needed, but avoids Coverity warning
74};
75
76} // namespace openmsx
77
78#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) const
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:399
Unified implementation of MSX Video Display Processors (VDPs).
Definition VDP.hh:66
This file implemented 3 utility functions:
Definition Autofire.cc:11