aboutsummaryrefslogtreecommitdiff
path: root/backends/dc
diff options
context:
space:
mode:
authorMarcus Comstedt2005-06-27 15:16:58 +0000
committerMarcus Comstedt2005-06-27 15:16:58 +0000
commite2d1b7afa480b69495fcc73ab9157d1139127500 (patch)
treeb4f49dea6bb1a066a530dda974de7150bb53e2db /backends/dc
parent9e134593383520a0f9c2f63633b7b6ce84365419 (diff)
downloadscummvm-rg350-e2d1b7afa480b69495fcc73ab9157d1139127500.tar.gz
scummvm-rg350-e2d1b7afa480b69495fcc73ab9157d1139127500.tar.bz2
scummvm-rg350-e2d1b7afa480b69495fcc73ab9157d1139127500.zip
Implemented OSystem_Dreamcast::grabPalette().
svn-id: r18472
Diffstat (limited to 'backends/dc')
-rw-r--r--backends/dc/dc.h1
-rw-r--r--backends/dc/display.cpp14
2 files changed, 15 insertions, 0 deletions
diff --git a/backends/dc/dc.h b/backends/dc/dc.h
index d95c6f7f37..e3a0f76325 100644
--- a/backends/dc/dc.h
+++ b/backends/dc/dc.h
@@ -64,6 +64,7 @@ class OSystem_Dreamcast : public OSystem {
// Set colors of the palette
void setPalette(const byte *colors, uint start, uint num);
+ void grabPalette(byte *colors, uint start, uint num);
// Set the size of the video bitmap.
// Typically, 320x200
diff --git a/backends/dc/display.cpp b/backends/dc/display.cpp
index 04ab8d6481..e45312bdbb 100644
--- a/backends/dc/display.cpp
+++ b/backends/dc/display.cpp
@@ -142,6 +142,20 @@ void OSystem_Dreamcast::setPalette(const byte *colors, uint start, uint num)
_screen_dirty = true;
}
+void OSystem_Dreamcast::grabPalette(byte *colors, uint start, uint num)
+{
+ const unsigned short *src = palette + start;
+ if(num>0)
+ while( num-- ) {
+ unsigned short p = *src++;
+ colors[0] = ((p&0x7c00)>>7)|((p&0x7000)>>12);
+ colors[1] = ((p&0x03e0)>>2)|((p&0x0380)>>7);
+ colors[2] = ((p&0x001f)<<3)|((p&0x001c)>>2);
+ colors[3] = 0xff;
+ colors += 4;
+ }
+}
+
void OSystem_Dreamcast::setScaling()
{
if(_screen_w > 400) {