DS Video: Minor extended background fixes
Vicki Pfau vi@endrift.com
Fri, 03 Mar 2017 19:08:27 -0800
2 files changed,
16 insertions(+),
3 deletions(-)
M
include/mgba/internal/ds/video.h
→
include/mgba/internal/ds/video.h
@@ -64,6 +64,8 @@ DECL_BITFIELD(DSRegisterPOWCNT1, uint16_t);
// TODO DECL_BIT(DSRegisterPOWCNT1, Swap, 15); +DECL_BIT(GBARegisterBGCNT, ExtendedMode0, 2); +DECL_BIT(GBARegisterBGCNT, ExtendedMode1, 7); DECL_BIT(GBARegisterBGCNT, ExtPaletteSlot, 13); DECL_BITFIELD(DSRegisterMASTER_BRIGHT, uint16_t);
M
src/ds/renderers/software.c
→
src/ds/renderers/software.c
@@ -414,7 +414,11 @@ case 4:
GBAVideoSoftwareRendererDrawBackgroundMode2(softwareRenderer, &softwareRenderer->bg[2], y); break; case 5: - DSVideoSoftwareRendererDrawBackgroundExt0(softwareRenderer, &softwareRenderer->bg[2], y); + if (!GBARegisterBGCNTIsExtendedMode1(softwareRenderer->bg[2].control)) { + DSVideoSoftwareRendererDrawBackgroundExt0(softwareRenderer, &softwareRenderer->bg[2], y); + } else { + // TODO + } break; } }@@ -430,7 +434,11 @@ break;
case 3: case 4: case 5: - DSVideoSoftwareRendererDrawBackgroundExt0(softwareRenderer, &softwareRenderer->bg[3], y); + if (!GBARegisterBGCNTIsExtendedMode1(softwareRenderer->bg[3].control)) { + DSVideoSoftwareRendererDrawBackgroundExt0(softwareRenderer, &softwareRenderer->bg[3], y); + } else { + // TODO + } break; } }@@ -659,7 +667,10 @@ BACKGROUND_BITMAP_INIT;
color_t* mainPalette = background->extPalette; if (variant) { - palette = background->variantPalette; + mainPalette = background->variantPalette; + } + if (!mainPalette) { + return; } int paletteData;