-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDisplay.h
executable file
·107 lines (84 loc) · 2.5 KB
/
Display.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*
Frodo, Commodore 64 emulator for the iPhone
Copyright (C) 1994-1997,2002 Christian Bauer
See gpl.txt for license information.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Display.h - C64 graphics display, emulator window handling
*
* Frodo (C) 1994-1997,2002 Christian Bauer
*/
#ifndef _DISPLAY_H
#define _DISPLAY_H
#import <CoreGraphics/CoreGraphics.h>
// Display dimensions
#if defined(SMALL_DISPLAY)
const int C64DISPLAY_X = 0x180;
const int DISPLAY_X = 0x140;
const int DISPLAY_Y = 0x110;
#else
const int C64DISPLAY_X = 0x180;
const int DISPLAY_X = 0x180;
const int DISPLAY_Y = 0x110;
#endif
class C64Window;
class C64Screen;
class C64;
class Prefs;
// Class for C64 graphics display
class C64Display {
public:
C64Display(C64 *the_c64);
~C64Display();
void UpdateLEDs(uint8 led);
uint8 *BitmapBase(void);
int BitmapXMod(void);
#if FRODO_DISPLAY_FORMAT == DISPLAY_FORMAT_32BIT || FRODO_DISPLAY_FORMAT == DISPLAY_FORMAT_16BIT
CGImageRef GetImageBuffer() /*__attribute__((section("__TEXT, __groupme")))*/;
#endif
void PollKeyboard(uint8 *key_matrix, uint8 *rev_matrix);
void InitColors(uint8 *colors);
void NewPrefs(Prefs *prefs);
void Update();
C64 *TheC64;
private:
// buffer used by the emulator
uint8 *pixels;
#if FRODO_DISPLAY_FORMAT == DISPLAY_FORMAT_32BIT
#pragma pack(push,1)
struct ColorPalette2 {
unsigned char b, g, r, a;
};
#pragma pack(pop)
CGContextRef context;
uint *imageBuffer;
ColorPalette2 palette2[16];
#elif FRODO_DISPLAY_FORMAT == DISPLAY_FORMAT_16BIT
#pragma pack(push,1)
struct ColorPalette2 {
unsigned char b:5;
unsigned char g:5;
unsigned char r:5;
};
#pragma pack(pop)
CGContextRef context;
uint *imageBuffer;
ColorPalette2 palette2[16];
#elif FRODO_DISPLAY_FORMAT == DISPLAY_FORMAT_INDEXED
// image buffer data
CGImageRef _image;
#endif
};
// Exported functions
extern long ShowRequester(const char *str, const char *button1, const char *button2 = NULL);
#endif