From 6df0031bdb8b7de341512e7fb807097243c9f840 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Sat, 5 Jan 2013 02:19:00 -0500 Subject: Mess with Mode 5 some more. Secret of Mana's menu sprite is fixed; however, as of commit 3cd20e203f3b0af8c32921f86547a126d74b34eb (still not fixed in this commit!), Donkey Kong Country's Rareware icon is split by black columns. --- source/tile.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'source/tile.h') diff --git a/source/tile.h b/source/tile.h index c43e7af..73f2860 100644 --- a/source/tile.h +++ b/source/tile.h @@ -288,5 +288,48 @@ default: \ break; \ } + +#define RENDER_TILE_LARGE_HALFWIDTH(PIXEL, FUNCTION) \ + switch (Tile & (V_FLIP | H_FLIP)) \ + { \ + case H_FLIP: \ + StartPixel = 7 - StartPixel; \ + /* fallthrough for no-flip case - above was a horizontal flip */ \ + case 0: \ + if ((pixel = *(pCache + StartLine + StartPixel))) \ + { \ + pixel = PIXEL; \ + for (l = LineCount; l != 0; l--, sp += GFX.PPL, Depth += GFX.PPL) \ + { \ + for (int z = Pixels - 2; z >= 0; z -= 2) \ + if (GFX.Z1 > Depth [z]) \ + { \ + sp [z >> 1] = FUNCTION(sp + z, pixel); \ + Depth [z >> 1] = GFX.Z2; \ + }\ + } \ + } \ + break; \ + case H_FLIP | V_FLIP: \ + StartPixel = 7 - StartPixel; \ + /* fallthrough for V_FLIP-only case - above was a horizontal flip */ \ + case V_FLIP: \ + if ((pixel = *(pCache + 56 - StartLine + StartPixel))) \ + { \ + pixel = PIXEL; \ + for (l = LineCount; l != 0; l--, sp += GFX.PPL, Depth += GFX.PPL) \ + { \ + for (int z = Pixels - 2; z >= 0; z -= 2) \ + if (GFX.Z1 > Depth [z]) \ + { \ + sp [z >> 1] = FUNCTION(sp + z, pixel); \ + Depth [z >> 1] = GFX.Z2; \ + }\ + } \ + } \ + break; \ + default: \ + break; \ + } #endif -- cgit v1.2.3