Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes needed for MINIMAL_CORE=3 ... #1288

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/gba/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ static bool _GBACoreInit(struct mCore* core) {
mRTCGenericSourceInit(&core->rtc, core);
gba->rtcSource = &core->rtc.d;

#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 3
GBAVideoSoftwareRendererCreate(&gbacore->renderer);
gbacore->renderer.outputBuffer = NULL;
#endif

#ifndef DISABLE_THREADING
mVideoThreadProxyCreate(&gbacore->threadProxy);
Expand Down Expand Up @@ -387,6 +389,7 @@ static void _GBACoreChecksum(const struct mCore* core, void* data, enum mCoreChe
static void _GBACoreReset(struct mCore* core) {
struct GBACore* gbacore = (struct GBACore*) core;
struct GBA* gba = (struct GBA*) core->board;
#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 3
if (gbacore->renderer.outputBuffer) {
struct GBAVideoRenderer* renderer = &gbacore->renderer.d;
#ifndef DISABLE_THREADING
Expand All @@ -399,6 +402,7 @@ static void _GBACoreReset(struct mCore* core) {
#endif
GBAVideoAssociateRenderer(&gba->video, renderer);
}
#endif

GBAOverrideApplyDefaults(gba, gbacore->overrides);

Expand Down
6 changes: 6 additions & 0 deletions src/gba/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,11 @@ static void GBAVideoDummyRendererDeinit(struct GBAVideoRenderer* renderer) {
}

static uint16_t GBAVideoDummyRendererWriteVideoRegister(struct GBAVideoRenderer* renderer, uint32_t address, uint16_t value) {
#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 3
if (renderer->cache) {
GBAVideoCacheWriteVideoRegister(renderer->cache, address, value);
}
#endif
switch (address) {
case REG_DISPCNT:
value &= 0xFFF7;
Expand Down Expand Up @@ -257,15 +259,19 @@ static uint16_t GBAVideoDummyRendererWriteVideoRegister(struct GBAVideoRenderer*
}

static void GBAVideoDummyRendererWriteVRAM(struct GBAVideoRenderer* renderer, uint32_t address) {
#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 3
if (renderer->cache) {
mCacheSetWriteVRAM(renderer->cache, address);
}
#endif
}

static void GBAVideoDummyRendererWritePalette(struct GBAVideoRenderer* renderer, uint32_t address, uint16_t value) {
#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 3
if (renderer->cache) {
mCacheSetWritePalette(renderer->cache, address >> 1, mColorFrom555(value));
}
#endif
}

static void GBAVideoDummyRendererWriteOAM(struct GBAVideoRenderer* renderer, uint32_t oam) {
Expand Down