forked from audetto/AppleWin
/
nframe.h
70 lines (50 loc) · 1.8 KB
/
nframe.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
#include "frontends/common2/commonframe.h"
#include <memory>
#include <string>
#include <ncurses.h>
namespace na2
{
class ASCIIArt;
class EvDevPaddle;
struct NCurses;
class NFrame : public common2::CommonFrame
{
public:
NFrame(const std::shared_ptr<EvDevPaddle> & paddle);
WINDOW * GetWindow();
WINDOW * GetStatus();
void Initialize(bool resetVideoState) override;
void Destroy() override;
void VideoPresentScreen() override;
int FrameMessageBox(LPCSTR lpText, LPCSTR lpCaption, UINT uType) override;
void FrameRefreshStatus(int drawflags);
void ProcessEvDev();
void ChangeColumns(const int x);
void ChangeRows(const int x);
void Init(int rows, int columns);
private:
const std::shared_ptr<EvDevPaddle> myPaddle;
int myRows;
int myColumns;
int myTextFlashCounter;
bool myTextFlashState;
std::shared_ptr<WINDOW> myFrame;
std::shared_ptr<WINDOW> myStatus;
std::shared_ptr<ASCIIArt> myAsciiArt;
std::shared_ptr<NCurses> myNCurses;
LPBYTE myTextBank1; // Aux
LPBYTE myTextBank0; // Main
LPBYTE myHiresBank1;
LPBYTE myHiresBank0;
void VideoUpdateFlash();
chtype MapCharacter(Video & video, BYTE ch);
bool Update40ColCell(Video & video, int x, int y, int xpixel, int ypixel, int offset);
bool Update80ColCell(Video & video, int x, int y, int xpixel, int ypixel, int offset);
bool UpdateLoResCell(Video &, int x, int y, int xpixel, int ypixel, int offset);
bool UpdateDLoResCell(Video &, int x, int y, int xpixel, int ypixel, int offset);
bool UpdateHiResCell(Video &, int x, int y, int xpixel, int ypixel, int offset);
bool UpdateDHiResCell(Video &, int x, int y, int xpixel, int ypixel, int offset);
void InitialiseNCurses();
};
}