diff options
author | Ian C <ianc@noddybox.co.uk> | 2018-09-14 14:06:27 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2018-09-14 14:06:27 +0000 |
commit | 0663e04fa81ba4b3061d14a9ebdd3d2b4fe6600c (patch) | |
tree | c9ad9d5666c2135af980a22d50632b0590e0727e /snesgfx.c | |
parent | 6cd4196bfb302f54fa11591a4aa4658b9896fade (diff) |
Some fixes to 16x16 mode.
Diffstat (limited to 'snesgfx.c')
-rw-r--r-- | snesgfx.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -110,7 +110,7 @@ static void Convert4Colour16x16(png_bytep *data, unsigned char *mem; size_t size; - size = width / 16 * height / 16 * 512; + size = ((width / 16 * height / 16) / 8 + 1) * 512; if (!size) { @@ -137,7 +137,7 @@ static void Convert4Colour16x16(png_bytep *data, int offset; int f; - offset = (tile / 16) * 512 + (tile % 16) * 32; + offset = (tile / 8) * 512 + (tile % 8) * 32; GetPlanes(x, y, plane_left, 2, 16, data, width, height); GetPlanes(x + 8, y, plane_right, 2, 16, data, width, height); @@ -211,7 +211,7 @@ static void Convert16Colour16x16(png_bytep *data, unsigned char *mem; size_t size; - size = width / 16 * height / 16 * 1024; + size = ((width / 16 * height / 16) / 8 + 1) * 1024; if (!size) { @@ -238,7 +238,7 @@ static void Convert16Colour16x16(png_bytep *data, int offset; int f; - offset = (tile / 16) * 1024 + (tile % 16) * 64; + offset = (tile / 8) * 1024 + (tile % 8) * 64; GetPlanes(x, y, plane_left, 4, 16, data, width, height); GetPlanes(x + 8, y, plane_right, 4, 16, data, width, height); |