mirror of https://github.com/mgba-emu/mgba.git
Fix objwin on objs when objs are off in winout
This commit is contained in:
parent
f1afeae74c
commit
10509fe69d
|
@ -624,7 +624,7 @@ static void _drawScanline(struct GBAVideoSoftwareRenderer* renderer, int y) {
|
||||||
renderer->start = renderer->end;
|
renderer->start = renderer->end;
|
||||||
renderer->end = renderer->windows[w].endX;
|
renderer->end = renderer->windows[w].endX;
|
||||||
renderer->currentWindow = renderer->windows[w].control;
|
renderer->currentWindow = renderer->windows[w].control;
|
||||||
if (!GBAWindowControlIsObjEnable(renderer->currentWindow.packed)) {
|
if (!GBAWindowControlIsObjEnable(renderer->currentWindow.packed) && !GBARegisterDISPCNTIsObjwinEnable(renderer->dispcnt)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int i;
|
int i;
|
||||||
|
@ -1605,25 +1605,39 @@ static void _postprocessSprite(struct GBAVideoSoftwareRenderer* renderer, unsign
|
||||||
uint32_t flags = FLAG_TARGET_2 * renderer->target2Obj;
|
uint32_t flags = FLAG_TARGET_2 * renderer->target2Obj;
|
||||||
|
|
||||||
int objwinSlowPath = GBARegisterDISPCNTIsObjwinEnable(renderer->dispcnt);
|
int objwinSlowPath = GBARegisterDISPCNTIsObjwinEnable(renderer->dispcnt);
|
||||||
int objwinDisable = 0;
|
bool objwinDisable = false;
|
||||||
|
bool objwinOnly = false;
|
||||||
if (objwinSlowPath) {
|
if (objwinSlowPath) {
|
||||||
objwinDisable = !GBAWindowControlIsObjEnable(renderer->objwin.packed);
|
objwinDisable = !GBAWindowControlIsObjEnable(renderer->objwin.packed);
|
||||||
|
// TODO: Fix this for current window when WIN0/1 are enabled
|
||||||
|
objwinOnly = !objwinDisable && !GBAWindowControlIsObjEnable(renderer->winout.packed);
|
||||||
}
|
}
|
||||||
if (objwinSlowPath && objwinDisable) {
|
if (objwinSlowPath) {
|
||||||
for (x = 0; x < VIDEO_HORIZONTAL_PIXELS; ++x, ++pixel) {
|
if (objwinDisable) {
|
||||||
uint32_t color = renderer->spriteLayer[x] & ~FLAG_OBJWIN;
|
for (x = 0; x < VIDEO_HORIZONTAL_PIXELS; ++x, ++pixel) {
|
||||||
uint32_t current = *pixel;
|
uint32_t color = renderer->spriteLayer[x] & ~FLAG_OBJWIN;
|
||||||
if ((color & FLAG_UNWRITTEN) != FLAG_UNWRITTEN && !(current & FLAG_OBJWIN) && (color & FLAG_PRIORITY) >> OFFSET_PRIORITY == priority) {
|
uint32_t current = *pixel;
|
||||||
_compositeBlendObjwin(renderer, pixel, color | flags, current);
|
if ((color & FLAG_UNWRITTEN) != FLAG_UNWRITTEN && !(current & FLAG_OBJWIN) && (color & FLAG_PRIORITY) >> OFFSET_PRIORITY == priority) {
|
||||||
|
_compositeBlendObjwin(renderer, pixel, color | flags, current);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
|
} else if (objwinOnly) {
|
||||||
|
for (x = 0; x < VIDEO_HORIZONTAL_PIXELS; ++x, ++pixel) {
|
||||||
|
uint32_t color = renderer->spriteLayer[x] & ~FLAG_OBJWIN;
|
||||||
|
uint32_t current = *pixel;
|
||||||
|
if ((color & FLAG_UNWRITTEN) != FLAG_UNWRITTEN && (current & FLAG_OBJWIN) && (color & FLAG_PRIORITY) >> OFFSET_PRIORITY == priority) {
|
||||||
|
_compositeBlendObjwin(renderer, pixel, color | flags, current);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
for (x = 0; x < VIDEO_HORIZONTAL_PIXELS; ++x, ++pixel) {
|
for (x = 0; x < VIDEO_HORIZONTAL_PIXELS; ++x, ++pixel) {
|
||||||
uint32_t color = renderer->spriteLayer[x] & ~FLAG_OBJWIN;
|
uint32_t color = renderer->spriteLayer[x] & ~FLAG_OBJWIN;
|
||||||
uint32_t current = *pixel;
|
uint32_t current = *pixel;
|
||||||
if ((color & FLAG_UNWRITTEN) != FLAG_UNWRITTEN && (color & FLAG_PRIORITY) >> OFFSET_PRIORITY == priority) {
|
if ((color & FLAG_UNWRITTEN) != FLAG_UNWRITTEN && (color & FLAG_PRIORITY) >> OFFSET_PRIORITY == priority) {
|
||||||
_compositeBlendNoObjwin(renderer, pixel, color | flags, current);
|
_compositeBlendNoObjwin(renderer, pixel, color | flags, current);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue