Init video memory from the dummy renderer

This commit is contained in:
Jeffrey Pfau 2013-04-20 02:51:40 -07:00
parent 1972e73bec
commit cf9a7224a3
2 changed files with 7 additions and 6 deletions

View File

@ -4,15 +4,16 @@
#include "gba-io.h"
#include <limits.h>
#include <string.h>
static void GBAVideoRendererInit(struct GBAVideoRenderer* renderer);
static void GBAVideoDummyRendererInit(struct GBAVideoRenderer* renderer);
static void GBAVideoDummyRendererDeinit(struct GBAVideoRenderer* renderer);
static uint16_t GBAVideoDummyRendererWriteVideoRegister(struct GBAVideoRenderer* renderer, uint32_t address, uint16_t value);
static void GBAVideoDummyRendererDrawScanline(struct GBAVideoRenderer* renderer, int y);
static void GBAVideoDummyRendererFinishFrame(struct GBAVideoRenderer* renderer);
static struct GBAVideoRenderer dummyRenderer = {
.init = GBAVideoDummyRendererInit,
.deinit = GBAVideoDummyRendererDeinit,
.writeVideoRegister = GBAVideoDummyRendererWriteVideoRegister,
.drawScanline = GBAVideoDummyRendererDrawScanline,
@ -127,9 +128,10 @@ uint16_t GBAVideoReadDISPSTAT(struct GBAVideo* video) {
return (video->inVblank) | (video->inHblank << 1) | (video->vcounter << 2);
}
static void GBAVideoDummyRendererInit(struct GBAVideoRenderer* renderer) {
(void)(renderer);
// Nothing to do
static void GBAVideoRendererInit(struct GBAVideoRenderer* renderer) {
memset(renderer->palette, 0, sizeof(renderer->palette));
memset(renderer->vram, 0, sizeof(renderer->vram));
memset(&renderer->oam, 0, sizeof(renderer->oam));
}
static void GBAVideoDummyRendererDeinit(struct GBAVideoRenderer* renderer) {

View File

@ -89,7 +89,6 @@ union GBAOAM {
};
struct GBAVideoRenderer {
void (*init)(struct GBAVideoRenderer* renderer);
void (*deinit)(struct GBAVideoRenderer* renderer);
uint16_t (*writeVideoRegister)(struct GBAVideoRenderer* renderer, uint32_t address, uint16_t value);