all repos — mgba @ 7142a0f820eff4f4d1aae1a45e9d6c74f8b5219b

mGBA Game Boy Advance Emulator

Fix WININ priority trampling over the active windows (fixes #75)
Jeffrey Pfau jeffrey@endrift.com
Sat, 05 Jul 2014 14:34:10 -0700
commit

7142a0f820eff4f4d1aae1a45e9d6c74f8b5219b

parent

ae12dd907c4553de0d72f7da66135a39b70767ba

2 files changed, 25 insertions(+), 15 deletions(-)

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

@@ -88,9 +88,17 @@ softwareRenderer->blda = 0;

softwareRenderer->bldb = 0; softwareRenderer->bldy = 0; + softwareRenderer->winN[0].h.packed = 0; + softwareRenderer->winN[0].v.packed = 0; + softwareRenderer->winN[0].control.packed = 0; softwareRenderer->winN[0].control.priority = 0; + softwareRenderer->winN[1].h.packed = 0; + softwareRenderer->winN[1].v.packed = 0; + softwareRenderer->winN[1].control.packed = 0; softwareRenderer->winN[1].control.priority = 1; + softwareRenderer->objwin.packed = 0; softwareRenderer->objwin.priority = 2; + softwareRenderer->winout.packed = 0; softwareRenderer->winout.priority = 3; softwareRenderer->mosaic.packed = 0;
M src/gba/renderers/video-software.hsrc/gba/renderers/video-software.h

@@ -87,17 +87,19 @@ };

uint16_t packed; }; -union WindowControl { - struct { - unsigned bg0Enable : 1; - unsigned bg1Enable : 1; - unsigned bg2Enable : 1; - unsigned bg3Enable : 1; - unsigned objEnable : 1; - unsigned blendEnable : 1; - unsigned : 2; +struct WindowControl { + union { + struct { + unsigned bg0Enable : 1; + unsigned bg1Enable : 1; + unsigned bg2Enable : 1; + unsigned bg3Enable : 1; + unsigned objEnable : 1; + unsigned blendEnable : 1; + unsigned : 2; + }; + uint8_t packed; }; - uint8_t packed; int8_t priority; };

@@ -105,7 +107,7 @@ #define MAX_WINDOW 5

struct Window { uint8_t endX; - union WindowControl control; + struct WindowControl control; }; struct GBAVideoSoftwareRenderer {

@@ -146,13 +148,13 @@

struct WindowN { union WindowRegion h; union WindowRegion v; - union WindowControl control; + struct WindowControl control; } winN[2]; - union WindowControl winout; - union WindowControl objwin; + struct WindowControl winout; + struct WindowControl objwin; - union WindowControl currentWindow; + struct WindowControl currentWindow; int nWindows; struct Window windows[MAX_WINDOW];