Add background sizes to GLSL mode 0
Jeffrey Pfau jeffrey@endrift.com
Tue, 07 May 2013 22:21:40 -0700
1 files changed,
9 insertions(+),
0 deletions(-)
jump to
M
src/gba/renderers/video-glsl.c
→
src/gba/renderers/video-glsl.c
@@ -35,10 +35,19 @@
"vec4 backgroundMode0(int bgcnt, int hofs, int vofs) {\n" " int charBase = ((bgcnt / 4) & 3) * 8192;\n" " int screenBase = ((bgcnt / 256) & 0x1F) * 1024;\n" + " int size = bgcnt >> 14;\n" " int localX = hofs + int(x);\n" " int localY = vofs + int(y);\n" " int xBase = localX & 0xF8;\n" " int yBase = localY & 0xF8;\n" + " if (size == 1) {\n" + " xBase += (localX & 0x100) << 5;\n" + " } else if (size == 2) {\n" + " yBase += localY & 0x100;\n" + " } else if (size == 3) {\n" + " xBase += (localX & 0x100) << 5;\n" + " yBase += (localY & 0x100) << 1;\n" + " }\n" " screenBase = screenBase + (xBase / 8) + (yBase * 4);\n" " int mapData = DESERIALIZE(texture2D(vram, VRAM_INDEX(screenBase)));\n" " charBase = charBase + ((mapData & 0x3FF) * 16) + (localX & 0x4) / 4 + (localY & 0x7) * 2;\n"