1 /*
2  *  Display.cpp - C64 graphics display, emulator window handling
3  *
4  *  Frodo (C) 1994-1997,2002 Christian Bauer
5  */
6 
7 #include "sysdeps.h"
8 
9 #include "Display.h"
10 #include "main.h"
11 #include "Prefs.h"
12 
13 
14 // LED states
15 enum {
16 	LED_OFF,		// LED off
17 	LED_ON,			// LED on (green)
18 	LED_ERROR_ON,	// LED blinking (red), currently on
19 	LED_ERROR_OFF	// LED blinking, currently off
20 };
21 
22 
23 #undef USE_THEORETICAL_COLORS
24 
25 #ifdef USE_THEORETICAL_COLORS
26 
27 // C64 color palette (theoretical values)
28 const uint8 palette_red[16] = {
29 	0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0x80, 0xff, 0x40, 0x80, 0x80, 0x80, 0xc0
30 };
31 
32 const uint8 palette_green[16] = {
33 	0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x80, 0x40, 0x80, 0x40, 0x80, 0xff, 0x80, 0xc0
34 };
35 
36 const uint8 palette_blue[16] = {
37 	0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x80, 0x40, 0x80, 0x80, 0xff, 0xc0
38 };
39 
40 #else
41 
42 // C64 color palette (more realistic looking colors)
43 const uint8 palette_red[16] = {
44 	0x00, 0xff, 0x99, 0x00, 0xcc, 0x44, 0x11, 0xff, 0xaa, 0x66, 0xff, 0x40, 0x80, 0x66, 0x77, 0xc0
45 };
46 
47 const uint8 palette_green[16] = {
48 	0x00, 0xff, 0x00, 0xff, 0x00, 0xcc, 0x00, 0xff, 0x55, 0x33, 0x66, 0x40, 0x80, 0xff, 0x77, 0xc0
49 };
50 
51 const uint8 palette_blue[16] = {
52 	0x00, 0xff, 0x00, 0xcc, 0xcc, 0x44, 0x99, 0x00, 0x00, 0x00, 0x66, 0x40, 0x80, 0x66, 0xff, 0xc0
53 };
54 
55 #endif
56 
57 
58 /*
59  *  Update drive LED display (deferred until Update())
60  */
61 
UpdateLEDs(int l0,int l1,int l2,int l3)62 void C64Display::UpdateLEDs(int l0, int l1, int l2, int l3)
63 {
64 	led_state[0] = l0;
65 	led_state[1] = l1;
66 	led_state[2] = l2;
67 	led_state[3] = l3;
68 }
69 
70 
71 #if defined(__BEOS__)
72 #include "Display_Be.i"
73 #elif defined(AMIGA)
74 #include "Display_Amiga.i"
75 #elif defined(HAVE_SDL)
76 #include "Display_SDL.i"
77 #elif defined(__unix)
78 # ifdef __svgalib__
79 #  include "Display_svga.i"
80 # else
81 #  include "Display_x.i"
82 # endif
83 #elif defined(__mac__)
84 #include "Display_mac.i"
85 #elif defined(WIN32)
86 #include "Display_WIN32.i"
87 #elif defined(__riscos__)
88 #include "Display_Acorn.i"
89 #endif
90