frodo-wii/Src/Display.cpp

110 lines
2.8 KiB
C++
Raw Normal View History

2008-12-31 17:16:24 +01:00
/*
* Display.cpp - C64 graphics display, emulator window handling
2009-01-12 20:54:49 +01:00
*
* Frodo (C) 1994-1997,2002-2005 Christian Bauer
2008-12-31 17:16:24 +01:00
*
2009-01-12 20:54:49 +01:00
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2008-12-31 17:16:24 +01:00
*/
2009-01-12 20:54:49 +01:00
#include "sysdeps.h"
2008-12-31 17:16:24 +01:00
#include "Display.h"
#include "main.h"
2009-01-12 20:54:49 +01:00
#include "Prefs.h"
2008-12-31 17:16:24 +01:00
2009-01-12 20:54:49 +01:00
2008-12-31 17:16:24 +01:00
// 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
};
2009-01-12 20:54:49 +01:00
#define USE_PEPTO_COLORS 1
2008-12-31 17:16:24 +01:00
2009-01-12 20:54:49 +01:00
#ifdef USE_PEPTO_COLORS
2008-12-31 17:16:24 +01:00
2009-01-12 20:54:49 +01:00
// C64 color palette
// Values based on measurements by Philip "Pepto" Timmermann <pepto@pepto.de>
// (see http://www.pepto.de/projects/colorvic/)
2008-12-31 17:16:24 +01:00
const uint8 palette_red[16] = {
2009-01-12 20:54:49 +01:00
0x00, 0xff, 0x86, 0x4c, 0x88, 0x35, 0x20, 0xcf, 0x88, 0x40, 0xcb, 0x34, 0x68, 0x8b, 0x68, 0xa1
2008-12-31 17:16:24 +01:00
};
const uint8 palette_green[16] = {
2009-01-12 20:54:49 +01:00
0x00, 0xff, 0x19, 0xc1, 0x17, 0xac, 0x07, 0xf2, 0x3e, 0x2a, 0x55, 0x34, 0x68, 0xff, 0x4a, 0xa1
2008-12-31 17:16:24 +01:00
};
const uint8 palette_blue[16] = {
2009-01-12 20:54:49 +01:00
0x00, 0xff, 0x01, 0xe3, 0xbd, 0x0a, 0xc0, 0x2d, 0x00, 0x00, 0x37, 0x34, 0x68, 0x59, 0xff, 0xa1
2008-12-31 17:16:24 +01:00
};
#else
2009-01-12 20:54:49 +01:00
// C64 color palette (traditional Frodo colors)
2008-12-31 17:16:24 +01:00
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] = {
2009-01-12 20:54:49 +01:00
0x00, 0xff, 0x00, 0xff, 0x00, 0xcc, 0x00, 0xdd, 0x55, 0x33, 0x66, 0x40, 0x80, 0xff, 0x77, 0xc0
2008-12-31 17:16:24 +01:00
};
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__)
2009-01-12 20:54:49 +01:00
#include "Display_Be.h"
2008-12-31 17:16:24 +01:00
#elif defined(AMIGA)
2009-01-12 20:54:49 +01:00
#include "Display_Amiga.h"
2008-12-31 17:16:24 +01:00
#elif defined(HAVE_SDL)
2009-01-12 20:54:49 +01:00
# if defined(QTOPIA) or defined(MAEMO) or defined(WII)
# include "Display_EmbeddedSDL.h"
# else
# include "Display_SDL.h"
# endif
2008-12-31 17:16:24 +01:00
#elif defined(__unix)
# ifdef __svgalib__
2009-01-12 20:54:49 +01:00
# include "Display_svga.h"
2008-12-31 17:16:24 +01:00
# else
2009-01-12 20:54:49 +01:00
# include "Display_x.h"
2008-12-31 17:16:24 +01:00
# endif
#elif defined(__mac__)
2009-01-12 20:54:49 +01:00
#include "Display_mac.h"
2008-12-31 17:16:24 +01:00
#elif defined(WIN32)
2009-01-12 20:54:49 +01:00
#include "Display_WIN32.h"
2008-12-31 17:16:24 +01:00
#elif defined(__riscos__)
2009-01-12 20:54:49 +01:00
#include "Display_Acorn.h"
2008-12-31 17:16:24 +01:00
#endif