mirror of https://github.com/mgba-emu/mgba.git
Core: Merge color_t definitions in
This commit is contained in:
parent
f5923c74a7
commit
4edd7286f3
|
@ -11,6 +11,14 @@
|
||||||
struct VFile;
|
struct VFile;
|
||||||
struct mRTCSource;
|
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 {
|
struct mCore {
|
||||||
void* cpu;
|
void* cpu;
|
||||||
void* board;
|
void* board;
|
||||||
|
@ -19,7 +27,7 @@ struct mCore {
|
||||||
void (*deinit)(struct mCore*);
|
void (*deinit)(struct mCore*);
|
||||||
|
|
||||||
void (*desiredVideoDimensions)(struct mCore*, unsigned* width, unsigned* height);
|
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 (*isROM)(struct mCore*, struct VFile* vf);
|
||||||
bool (*loadROM)(struct mCore*, struct VFile* vf, struct VFile* save, const char* fname);
|
bool (*loadROM)(struct mCore*, struct VFile* vf, struct VFile* save, const char* fname);
|
||||||
|
|
|
@ -54,7 +54,7 @@ static void _GBCoreDesiredVideoDimensions(struct mCore* core, unsigned* width, u
|
||||||
*height = GB_VIDEO_VERTICAL_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;
|
struct GBCore* gbcore = (struct GBCore*) core;
|
||||||
gbcore->renderer.outputBuffer = buffer;
|
gbcore->renderer.outputBuffer = buffer;
|
||||||
gbcore->renderer.outputBufferStride = stride;
|
gbcore->renderer.outputBufferStride = stride;
|
||||||
|
|
|
@ -8,14 +8,9 @@
|
||||||
|
|
||||||
#include "util/common.h"
|
#include "util/common.h"
|
||||||
|
|
||||||
|
#include "core/core.h"
|
||||||
#include "gb/video.h"
|
#include "gb/video.h"
|
||||||
|
|
||||||
#ifdef COLOR_16_BIT
|
|
||||||
typedef uint16_t color_t;
|
|
||||||
#else
|
|
||||||
typedef uint32_t color_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct GBVideoSoftwareRenderer {
|
struct GBVideoSoftwareRenderer {
|
||||||
struct GBVideoRenderer d;
|
struct GBVideoRenderer d;
|
||||||
|
|
||||||
|
|
|
@ -8,14 +8,9 @@
|
||||||
|
|
||||||
#include "util/common.h"
|
#include "util/common.h"
|
||||||
|
|
||||||
|
#include "core/core.h"
|
||||||
#include "gba/video.h"
|
#include "gba/video.h"
|
||||||
|
|
||||||
#ifdef COLOR_16_BIT
|
|
||||||
typedef uint16_t color_t;
|
|
||||||
#else
|
|
||||||
typedef uint32_t color_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct GBAVideoSoftwareSprite {
|
struct GBAVideoSoftwareSprite {
|
||||||
struct GBAObj obj;
|
struct GBAObj obj;
|
||||||
int y;
|
int y;
|
||||||
|
|
Loading…
Reference in New Issue