diff options
Diffstat (limited to 'backends/platform/ds')
-rw-r--r-- | backends/platform/ds/arm9/source/fat/gba_nds_fat.c | 3 | ||||
-rw-r--r-- | backends/platform/ds/arm9/source/osystem_ds.cpp | 31 | ||||
-rw-r--r-- | backends/platform/ds/arm9/source/osystem_ds.h | 3 | ||||
-rw-r--r-- | backends/platform/ds/ds.mk | 4 | ||||
-rw-r--r-- | backends/platform/ds/makefile | 2 |
5 files changed, 25 insertions, 18 deletions
diff --git a/backends/platform/ds/arm9/source/fat/gba_nds_fat.c b/backends/platform/ds/arm9/source/fat/gba_nds_fat.c index 7f0757ef53..698590418c 100644 --- a/backends/platform/ds/arm9/source/fat/gba_nds_fat.c +++ b/backends/platform/ds/arm9/source/fat/gba_nds_fat.c @@ -18,6 +18,9 @@ //--------------------------------------------------------------- // Includes +// Allow use of stuff in <time.h> +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h + #include "gba_nds_fat.h" #include "disc_io.h" #include <string.h> diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp index 3ad92b4355..462990cb32 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.cpp +++ b/backends/platform/ds/arm9/source/osystem_ds.cpp @@ -20,6 +20,9 @@ */ +// Allow use of stuff in <time.h> +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h + #include "common/scummsys.h" #include "common/system.h" @@ -243,7 +246,7 @@ void OSystem_DS::setCursorPalette(const byte *colors, uint start, uint num) { } bool OSystem_DS::grabRawScreen(Graphics::Surface *surf) { - surf->create(DS::getGameWidth(), DS::getGameHeight(), 1); + surf->create(DS::getGameWidth(), DS::getGameHeight(), Graphics::PixelFormat::createFormatCLUT8()); // Ensure we copy using 16 bit quantities due to limitation of VRAM addressing @@ -259,13 +262,13 @@ bool OSystem_DS::grabRawScreen(Graphics::Surface *surf) { return true; } -void OSystem_DS::grabPalette(unsigned char *colours, uint start, uint num) { +void OSystem_DS::grabPalette(unsigned char *colors, uint start, uint num) { // consolePrintf("Grabpalette"); for (unsigned int r = start; r < start + num; r++) { - *colours++ = (BG_PALETTE[r] & 0x001F) << 3; - *colours++ = (BG_PALETTE[r] & 0x03E0) >> 5 << 3; - *colours++ = (BG_PALETTE[r] & 0x7C00) >> 10 << 3; + *colors++ = (BG_PALETTE[r] & 0x001F) << 3; + *colors++ = (BG_PALETTE[r] & 0x03E0) >> 5 << 3; + *colors++ = (BG_PALETTE[r] & 0x7C00) >> 10 << 3; } } @@ -756,7 +759,7 @@ Graphics::Surface *OSystem_DS::createTempFrameBuffer() { _framebuffer.w = DS::getGameWidth(); _framebuffer.h = DS::getGameHeight(); _framebuffer.pitch = DS::getGameWidth(); - _framebuffer.bytesPerPixel = 1; + _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8(); } else { @@ -781,7 +784,7 @@ Graphics::Surface *OSystem_DS::createTempFrameBuffer() { _framebuffer.w = width; _framebuffer.h = height; _framebuffer.pitch = width; - _framebuffer.bytesPerPixel = 1; + _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8(); } @@ -849,16 +852,16 @@ Common::WriteStream *OSystem_DS::createConfigWriteStream() { return file.createWriteStream(); } -u16 OSystem_DS::applyGamma(u16 colour) { +u16 OSystem_DS::applyGamma(u16 color) { // Attempt to do gamma correction (or something like it) to palette entries // to improve the contrast of the image on the original DS screen. - // Split the colour into it's component channels - int r = colour & 0x001F; - int g = (colour & 0x03E0) >> 5; - int b = (colour & 0x7C00) >> 10; + // Split the color into it's component channels + int r = color & 0x001F; + int g = (color & 0x03E0) >> 5; + int b = (color & 0x7C00) >> 10; - // Caluclate the scaling factor for this colour based on it's brightness + // Caluclate the scaling factor for this color based on it's brightness int scale = ((23 - ((r + g + b) >> 2)) * _gammaValue) >> 3; // Scale the three components by the scaling factor, with clamping @@ -871,7 +874,7 @@ u16 OSystem_DS::applyGamma(u16 colour) { b = b + ((b * scale) >> 4); if (b > 31) b = 31; - // Stick them back together into a 555 colour value + // Stick them back together into a 555 color value return 0x8000 | r | (g << 5) | (b << 10); } diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h index 7feed7541f..b745b4dc6e 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.h +++ b/backends/platform/ds/arm9/source/osystem_ds.h @@ -36,6 +36,7 @@ #include "audio/mixer_intern.h" #include "graphics/surface.h" #include "graphics/colormasks.h" +#include "graphics/palette.h" class OSystem_DS : public BaseBackend, public PaletteManager { protected: @@ -183,7 +184,7 @@ public: Common::WriteStream *createConfigWriteStream(); Common::SeekableReadStream *createConfigReadStream(); - u16 applyGamma(u16 colour); + u16 applyGamma(u16 color); void setGammaValue(int gamma) { _gammaValue = gamma; } void engineDone(); diff --git a/backends/platform/ds/ds.mk b/backends/platform/ds/ds.mk index a9ed3e0096..654475e1f3 100644 --- a/backends/platform/ds/ds.mk +++ b/backends/platform/ds/ds.mk @@ -170,10 +170,10 @@ dsclean: # HACK/FIXME: C compiler, for cartreset.c -- we should switch this to use CXX # as soon as possible. -CC := $(DEVKITARM)/bin/arm-eabi-gcc +CC := $(DEVKITPRO)/devkitARM/bin/arm-eabi-gcc # HACK/TODO: Pointer to objcopy. This should really be set by configure -OBJCOPY := $(DEVKITARM)/bin/arm-eabi-objcopy +OBJCOPY := $(DEVKITPRO)/devkitARM/bin/arm-eabi-objcopy # # Set various flags diff --git a/backends/platform/ds/makefile b/backends/platform/ds/makefile index 58d6fd4c02..e24a36ef81 100644 --- a/backends/platform/ds/makefile +++ b/backends/platform/ds/makefile @@ -3,7 +3,7 @@ -export PATH := $(DEVKITARM)/bin:$(PATH) +export PATH := $(DEVKITPRO)/devkitARM/bin:$(PATH) export portdir = $(CURDIR)/arm9 export srcdir = $(CURDIR)/../../.. |