GB Video: Fix disabled Obj

This commit is contained in:
Jeffrey Pfau 2016-01-26 20:58:45 -08:00
parent 2e77c45e06
commit 3c8cf83083
1 changed files with 11 additions and 9 deletions

View File

@ -158,15 +158,17 @@ static void GBVideoSoftwareRendererDrawScanline(struct GBVideoRenderer* renderer
}
}
int spriteHeight = 8;
if (GBRegisterLCDCIsObjSize(softwareRenderer->lcdc)) {
spriteHeight = 16;
}
int i;
for (i = 0; i < softwareRenderer->oamMax; ++i) {
// TODO: Sprite sizes
if (y >= softwareRenderer->obj[i]->y - 16 && y < softwareRenderer->obj[i]->y - 16 + spriteHeight) {
GBVideoSoftwareRendererDrawObj(softwareRenderer, softwareRenderer->obj[i], y);
if (GBRegisterLCDCIsObjEnable(softwareRenderer->lcdc)) {
int spriteHeight = 8;
if (GBRegisterLCDCIsObjSize(softwareRenderer->lcdc)) {
spriteHeight = 16;
}
int i;
for (i = 0; i < softwareRenderer->oamMax; ++i) {
// TODO: Sprite sizes
if (y >= softwareRenderer->obj[i]->y - 16 && y < softwareRenderer->obj[i]->y - 16 + spriteHeight) {
GBVideoSoftwareRendererDrawObj(softwareRenderer, softwareRenderer->obj[i], y);
}
}
}