ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/Frodo4/Src/Display.cpp
Revision: 1.1
Committed: 2003-07-01T17:09:43Z (20 years, 9 months ago) by cebix
Branch: MAIN
Log Message:
imported files

File Contents

# User Rev Content
1 cebix 1.1 /*
2     * Display.cpp - C64 graphics display, emulator window handling
3     *
4     * Frodo (C) 1994-1997,2002 Christian Bauer
5     *
6     * This program is free software; you can redistribute it and/or modify
7     * it under the terms of the GNU General Public License as published by
8     * the Free Software Foundation; either version 2 of the License, or
9     * (at your option) any later version.
10     *
11     * This program is distributed in the hope that it will be useful,
12     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     * GNU General Public License for more details.
15     *
16     * You should have received a copy of the GNU General Public License
17     * along with this program; if not, write to the Free Software
18     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19     */
20    
21     #include "sysdeps.h"
22    
23     #include "Display.h"
24     #include "main.h"
25     #include "Prefs.h"
26    
27    
28     // LED states
29     enum {
30     LED_OFF, // LED off
31     LED_ON, // LED on (green)
32     LED_ERROR_ON, // LED blinking (red), currently on
33     LED_ERROR_OFF // LED blinking, currently off
34     };
35    
36    
37     #undef USE_THEORETICAL_COLORS
38    
39     #ifdef USE_THEORETICAL_COLORS
40    
41     // C64 color palette (theoretical values)
42     const uint8 palette_red[16] = {
43     0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0x80, 0xff, 0x40, 0x80, 0x80, 0x80, 0xc0
44     };
45    
46     const uint8 palette_green[16] = {
47     0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x80, 0x40, 0x80, 0x40, 0x80, 0xff, 0x80, 0xc0
48     };
49    
50     const uint8 palette_blue[16] = {
51     0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x80, 0x40, 0x80, 0x80, 0xff, 0xc0
52     };
53    
54     #else
55    
56     // C64 color palette (more realistic looking colors)
57     const uint8 palette_red[16] = {
58     0x00, 0xff, 0x99, 0x00, 0xcc, 0x44, 0x11, 0xff, 0xaa, 0x66, 0xff, 0x40, 0x80, 0x66, 0x77, 0xc0
59     };
60    
61     const uint8 palette_green[16] = {
62     0x00, 0xff, 0x00, 0xff, 0x00, 0xcc, 0x00, 0xff, 0x55, 0x33, 0x66, 0x40, 0x80, 0xff, 0x77, 0xc0
63     };
64    
65     const uint8 palette_blue[16] = {
66     0x00, 0xff, 0x00, 0xcc, 0xcc, 0x44, 0x99, 0x00, 0x00, 0x00, 0x66, 0x40, 0x80, 0x66, 0xff, 0xc0
67     };
68    
69     #endif
70    
71    
72     /*
73     * Update drive LED display (deferred until Update())
74     */
75    
76     void C64Display::UpdateLEDs(int l0, int l1, int l2, int l3)
77     {
78     led_state[0] = l0;
79     led_state[1] = l1;
80     led_state[2] = l2;
81     led_state[3] = l3;
82     }
83    
84    
85     #if defined(__BEOS__)
86     #include "Display_Be.h"
87     #elif defined(AMIGA)
88     #include "Display_Amiga.h"
89     #elif defined(HAVE_SDL)
90     #include "Display_SDL.h"
91     #elif defined(__unix)
92     # ifdef __svgalib__
93     # include "Display_svga.h"
94     # else
95     # include "Display_x.h"
96     # endif
97     #elif defined(__mac__)
98     #include "Display_mac.h"
99     #elif defined(WIN32)
100     #include "Display_WIN32.h"
101     #elif defined(__riscos__)
102     #include "Display_Acorn.h"
103     #endif