all repos — mgba @ c6954bcb4aee26ba951f4a2b5dfcfa1f30bdd2c8

mGBA Game Boy Advance Emulator

Fix regressed sprite x wrapping
Jeffrey Pfau jeffrey@endrift.com
Thu, 02 Oct 2014 00:54:39 -0700
commit

c6954bcb4aee26ba951f4a2b5dfcfa1f30bdd2c8

parent

58400c859fff7d5799a6dd04801509989912c294

1 files changed, 2 insertions(+), 1 deletions(-)

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

@@ -1520,7 +1520,8 @@ int end = renderer->end;

uint32_t flags = GBAObjAttributesCGetPriority(sprite->c) << OFFSET_PRIORITY; flags |= FLAG_TARGET_1 * ((renderer->currentWindow.blendEnable && renderer->target1Obj && renderer->blendEffect == BLEND_ALPHA) || GBAObjAttributesAGetMode(sprite->a) == OBJ_MODE_SEMITRANSPARENT); flags |= FLAG_OBJWIN * (GBAObjAttributesAGetMode(sprite->a) == OBJ_MODE_OBJWIN); - int x = GBAObjAttributesBGetX(sprite->b); + int32_t x = GBAObjAttributesBGetX(sprite->b) << 23; + x >>= 23; uint16_t* vramBase = &renderer->d.vram[BASE_TILE >> 1]; unsigned charBase = GBAObjAttributesCGetTile(sprite->c) * 0x20; int variant = renderer->target1Obj && renderer->currentWindow.blendEnable && (renderer->blendEffect == BLEND_BRIGHTEN || renderer->blendEffect == BLEND_DARKEN);