aboutsummaryrefslogtreecommitdiff
path: root/source/tile.h
diff options
context:
space:
mode:
authorNebuleon Fumika2013-01-05 02:19:00 -0500
committerNebuleon Fumika2013-01-05 02:19:00 -0500
commit6df0031bdb8b7de341512e7fb807097243c9f840 (patch)
treea7464f8acdbe8def0a4388d505d3c96b4d30ec76 /source/tile.h
parent7c1327bd24d539a79824c504a9ac438c8a97a207 (diff)
downloadsnes9x2005-6df0031bdb8b7de341512e7fb807097243c9f840.tar.gz
snes9x2005-6df0031bdb8b7de341512e7fb807097243c9f840.tar.bz2
snes9x2005-6df0031bdb8b7de341512e7fb807097243c9f840.zip
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.
Diffstat (limited to 'source/tile.h')
-rw-r--r--source/tile.h43
1 files changed, 43 insertions, 0 deletions
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