diff options
Diffstat (limited to 'backends/dc')
-rw-r--r-- | backends/dc/dc.h | 1 | ||||
-rw-r--r-- | backends/dc/display.cpp | 14 |
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) { |