all repos — mgba @ 4edd7286f39fe940a890394626567211e072badb

mGBA Game Boy Advance Emulator

Core: Merge color_t definitions in
Jeffrey Pfau jeffrey@endrift.com
Sun, 31 Jan 2016 20:22:18 -0800
commit

4edd7286f39fe940a890394626567211e072badb

parent

f5923c74a7007ed4e00cd23bddaf7e2312fdc096

4 files changed, 12 insertions(+), 14 deletions(-)

jump to
M src/core/core.hsrc/core/core.h

@@ -11,6 +11,14 @@

struct VFile; struct mRTCSource; +#ifdef COLOR_16_BIT +typedef uint16_t color_t; +#define BYTES_PER_PIXEL 2 +#else +typedef uint32_t color_t; +#define BYTES_PER_PIXEL 4 +#endif + struct mCore { void* cpu; void* board;

@@ -19,7 +27,7 @@ bool (*init)(struct mCore*);

void (*deinit)(struct mCore*); void (*desiredVideoDimensions)(struct mCore*, unsigned* width, unsigned* height); - void (*setVideoBuffer)(struct mCore*, void* buffer, size_t stride); + void (*setVideoBuffer)(struct mCore*, color_t* buffer, size_t stride); bool (*isROM)(struct mCore*, struct VFile* vf); bool (*loadROM)(struct mCore*, struct VFile* vf, struct VFile* save, const char* fname);
M src/gb/core.csrc/gb/core.c

@@ -54,7 +54,7 @@ *width = GB_VIDEO_HORIZONTAL_PIXELS;

*height = GB_VIDEO_VERTICAL_PIXELS; } -static void _GBCoreSetVideoBuffer(struct mCore* core, void* buffer, size_t stride) { +static void _GBCoreSetVideoBuffer(struct mCore* core, color_t* buffer, size_t stride) { struct GBCore* gbcore = (struct GBCore*) core; gbcore->renderer.outputBuffer = buffer; gbcore->renderer.outputBufferStride = stride;
M src/gb/renderers/software.hsrc/gb/renderers/software.h

@@ -8,13 +8,8 @@ #define GB_RENDERER_SOFTWARE_H

#include "util/common.h" +#include "core/core.h" #include "gb/video.h" - -#ifdef COLOR_16_BIT -typedef uint16_t color_t; -#else -typedef uint32_t color_t; -#endif struct GBVideoSoftwareRenderer { struct GBVideoRenderer d;
M src/gba/renderers/video-software.hsrc/gba/renderers/video-software.h

@@ -8,13 +8,8 @@ #define VIDEO_SOFTWARE_H

#include "util/common.h" +#include "core/core.h" #include "gba/video.h" - -#ifdef COLOR_16_BIT -typedef uint16_t color_t; -#else -typedef uint32_t color_t; -#endif struct GBAVideoSoftwareSprite { struct GBAObj obj;