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 <concepts>
6#include <span>
7
8namespace openmsx {
9
10class VDP;
11class VDPVRAM;
12class DisplayMode;
13
14
17template<std::unsigned_integral Pixel>
19{
20public:
32 CharacterConverter(VDP& vdp, std::span<const Pixel, 16> palFg, std::span<const Pixel, 16> palBg);
33
42 void convertLine(std::span<Pixel> buf, int line);
43
47 void setDisplayMode(DisplayMode mode);
48
49private:
50 inline void renderText1 (std::span<Pixel, 256> buf, int line);
51 inline void renderText1Q (std::span<Pixel, 256> buf, int line);
52 inline void renderText2 (std::span<Pixel, 512> buf, int line);
53 inline void renderGraphic1(std::span<Pixel, 256> buf, int line);
54 inline void renderGraphic2(std::span<Pixel, 256> buf, int line);
55 inline void renderMulti (std::span<Pixel, 256> buf, int line);
56 inline void renderMultiQ (std::span<Pixel, 256> buf, int line);
57 inline void renderBogus (std::span<Pixel, 256> buf);
58 inline void renderBlank (std::span<Pixel, 256> buf);
59 inline void renderMultiHelper(Pixel* pixelPtr, int line,
60 unsigned mask, unsigned patternQuarter);
61
62 [[nodiscard]] std::span<const byte, 32> getNamePtr(int line, int scroll);
63
64private:
65 VDP& vdp;
66 VDPVRAM& vram;
67
68 std::span<const Pixel, 16> palFg;
69 std::span<const Pixel, 16> palBg;
70
71 unsigned modeBase = 0; // not strictly needed, but avoids Coverity warning
72};
73
74} // namespace openmsx
75
76#endif
Utility class for converting VRAM contents to host pixels.
void convertLine(std::span< Pixel > buf, int line)
Convert a line of V9938 VRAM to 256 or 512 host pixels.
CharacterConverter(VDP &vdp, std::span< const Pixel, 16 > palFg, std::span< const Pixel, 16 > palBg)
Create a new bitmap scanline converter.
void setDisplayMode(DisplayMode mode)
Select the display mode to use for scanline conversion.
Represents a VDP display mode.
Definition: DisplayMode.hh:16
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
uint32_t Pixel