-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDisplay.cpp
More file actions
executable file
·89 lines (69 loc) · 1.92 KB
/
Copy pathDisplay.cpp
File metadata and controls
executable file
·89 lines (69 loc) · 1.92 KB
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
/*
* Display.cpp - C64 graphics display, emulator window handling
*
* Frodo (C) 1994-1997,2002 Christian Bauer
*/
#include "sysdeps.h"
#include "Display.h"
#include "main.h"
#include "Prefs.h"
// LED states
enum {
LED_OFF, // LED off
LED_ON, // LED on (green)
LED_ERROR_ON, // LED blinking (red), currently on
LED_ERROR_OFF // LED blinking, currently off
};
#undef USE_THEORETICAL_COLORS
#ifdef USE_THEORETICAL_COLORS
// C64 color palette (theoretical values)
const uint8 palette_red[16] = {
0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0x80, 0xff, 0x40, 0x80, 0x80, 0x80, 0xc0
};
const uint8 palette_green[16] = {
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x80, 0x40, 0x80, 0x40, 0x80, 0xff, 0x80, 0xc0
};
const uint8 palette_blue[16] = {
0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x80, 0x40, 0x80, 0x80, 0xff, 0xc0
};
#else
// C64 color palette (more realistic looking colors)
const uint8 palette_red[16] = {
0x00, 0xff, 0x99, 0x00, 0xcc, 0x44, 0x11, 0xff, 0xaa, 0x66, 0xff, 0x40, 0x80, 0x66, 0x77, 0xc0
};
const uint8 palette_green[16] = {
0x00, 0xff, 0x00, 0xff, 0x00, 0xcc, 0x00, 0xff, 0x55, 0x33, 0x66, 0x40, 0x80, 0xff, 0x77, 0xc0
};
const uint8 palette_blue[16] = {
0x00, 0xff, 0x00, 0xcc, 0xcc, 0x44, 0x99, 0x00, 0x00, 0x00, 0x66, 0x40, 0x80, 0x66, 0xff, 0xc0
};
#endif
/*
* Update drive LED display (deferred until Update())
*/
void C64Display::UpdateLEDs(int l0, int l1, int l2, int l3)
{
led_state[0] = l0;
led_state[1] = l1;
led_state[2] = l2;
led_state[3] = l3;
}
#if defined(__BEOS__)
#include "Display_Be.i"
#elif defined(AMIGA)
#include "Display_Amiga.i"
#elif defined(HAVE_SDL)
#include "Display_SDL.i"
#elif defined(__unix)
# ifdef __svgalib__
# include "Display_svga.i"
# else
# include "Display_x.i"
# endif
#elif defined(__mac__)
#include "Display_mac.i"
#elif defined(WIN32)
#include "Display_WIN32.i"
#elif defined(__riscos__)
#include "Display_Acorn.i"
#endif