DS Video: Minor extended background fixes

This commit is contained in:
Vicki Pfau 2017-03-03 19:08:27 -08:00
parent 7b8fc0dbaa
commit 61ef3501c1
2 changed files with 16 additions and 3 deletions

View File

@ -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);

View File

@ -414,7 +414,11 @@ static void DSVideoSoftwareRendererDrawGBAScanline(struct GBAVideoRenderer* rend
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 @@ static void DSVideoSoftwareRendererDrawGBAScanline(struct GBAVideoRenderer* rend
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 @@ void DSVideoSoftwareRendererDrawBackgroundExt0(struct GBAVideoSoftwareRenderer*
color_t* mainPalette = background->extPalette;
if (variant) {
palette = background->variantPalette;
mainPalette = background->variantPalette;
}
if (!mainPalette) {
return;
}
int paletteData;