all repos — mgba @ 2d02719fa57d4e4a33168955a8e0c34dfabc301a

mGBA Game Boy Advance Emulator

Revert "GBA Video: Fix out-of-order OBJWIN"

This reverts commit f34f45257a6c52ea2e96e8ba75e8f7bfe8d5e245.
Jeffrey Pfau jeffrey@endrift.com
Wed, 28 Dec 2016 19:05:57 -0800
commit

2d02719fa57d4e4a33168955a8e0c34dfabc301a

parent

d752df421f09a993092563df349736acdedbb7f5

2 files changed, 5 insertions(+), 29 deletions(-)

jump to
M src/gba/renderers/video-software.csrc/gba/renderers/video-software.c

@@ -459,7 +459,6 @@

static void _cleanOAM(struct GBAVideoSoftwareRenderer* renderer) { int i; int oamMax = 0; - int objwinMax = 0; for (i = 0; i < 128; ++i) { struct GBAObj obj; LOAD_16(obj.a, 0, &renderer->d.oam->obj[i].a);

@@ -471,22 +470,14 @@ if (GBAObjAttributesAIsTransformed(obj.a)) {

height <<= GBAObjAttributesAGetDoubleSize(obj.a); } if (GBAObjAttributesAGetY(obj.a) < VIDEO_VERTICAL_PIXELS || GBAObjAttributesAGetY(obj.a) + height >= VIDEO_VERTICAL_TOTAL_PIXELS) { - if (GBAObjAttributesAGetMode(obj.a) == OBJ_MODE_OBJWIN) { - renderer->objwinSprites[objwinMax].y = GBAObjAttributesAGetY(obj.a); - renderer->objwinSprites[objwinMax].endY = GBAObjAttributesAGetY(obj.a) + height; - renderer->objwinSprites[objwinMax].obj = obj; - ++objwinMax; - } else { - renderer->sprites[oamMax].y = GBAObjAttributesAGetY(obj.a); - renderer->sprites[oamMax].endY = GBAObjAttributesAGetY(obj.a) + height; - renderer->sprites[oamMax].obj = obj; - ++oamMax; - } + renderer->sprites[oamMax].y = GBAObjAttributesAGetY(obj.a); + renderer->sprites[oamMax].endY = GBAObjAttributesAGetY(obj.a) + height; + renderer->sprites[oamMax].obj = obj; + ++oamMax; } } } renderer->oamMax = oamMax; - renderer->objwinMax = objwinMax; renderer->oamDirty = 0; }

@@ -742,20 +733,7 @@ continue;

} int i; int drawn; - for (i = 0; i < renderer->objwinMax; ++i) { - int localY = y; - if (renderer->spriteCyclesRemaining <= 0) { - break; - } - struct GBAVideoSoftwareSprite* sprite = &renderer->objwinSprites[i]; - if (GBAObjAttributesAIsMosaic(sprite->obj.a)) { - localY = mosaicY; - } - if ((localY < sprite->y && (sprite->endY - 256 < 0 || localY >= sprite->endY - 256)) || localY >= sprite->endY) { - continue; - } - GBAVideoSoftwareRendererPreprocessSprite(renderer, &sprite->obj, localY); - } + for (i = 0; i < renderer->oamMax; ++i) { int localY = y; if (renderer->spriteCyclesRemaining <= 0) {
M src/gba/renderers/video-software.hsrc/gba/renderers/video-software.h

@@ -154,9 +154,7 @@ struct GBAVideoSoftwareBackground bg[4];

int oamDirty; int oamMax; - int objwinMax; struct GBAVideoSoftwareSprite sprites[128]; - struct GBAVideoSoftwareSprite objwinSprites[128]; int start; int end;