aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNebuleon Fumika2013-02-07 18:47:15 -0500
committerNebuleon Fumika2013-02-07 18:47:15 -0500
commit5680258a6a7d8f59649de6a2aad490b4e15054b0 (patch)
treec12766f90ba61d7c6f6e6c1ba22bf5f83a318947
parent635c87890530777a2e7b2f4c45a72f8f51c7d5f0 (diff)
downloadsnes9x2005-5680258a6a7d8f59649de6a2aad490b4e15054b0.tar.gz
snes9x2005-5680258a6a7d8f59649de6a2aad490b4e15054b0.tar.bz2
snes9x2005-5680258a6a7d8f59649de6a2aad490b4e15054b0.zip
Stop inlining the regular tile drawing code. That was a micro-optimisation, and this revert brings the code a bit closer to mainline Snes9x.
-rw-r--r--source/tile.cpp65
1 files changed, 1 insertions, 64 deletions
diff --git a/source/tile.cpp b/source/tile.cpp
index 653a6d7..87d1fac 100644
--- a/source/tile.cpp
+++ b/source/tile.cpp
@@ -589,71 +589,8 @@ void DrawTile16 (uint32 Tile, uint32 Offset, uint32 StartLine,
{
TILE_PREAMBLE
register uint8 *bp;
- uint8 Pixel;
- uint16 *Screen = (uint16 *) GFX.S + Offset;
- uint8 *Depth = GFX.DB + Offset;
- switch (Tile & (H_FLIP | V_FLIP))
- {
- case 0:
- bp = pCache + StartLine;
- for (l = LineCount; l != 0; l--, bp += 8, Screen += GFX.PPL, Depth += GFX.PPL)
- {
- for (uint8 N = 0; N < 8; N++)
- {
- if (GFX.Z1 > Depth [N] && (Pixel = bp[N]))
- {
- Screen [N] = ScreenColors [Pixel];
- Depth [N] = GFX.Z2;
- }
- }
- }
- break;
- case H_FLIP:
- bp = pCache + StartLine;
- for (l = LineCount; l != 0; l--, bp += 8, Screen += GFX.PPL, Depth += GFX.PPL)
- {
- for (uint8 N = 0; N < 8; N++)
- {
- if (GFX.Z1 > Depth [N] && (Pixel = bp[7 - N]))
- {
- Screen [N] = ScreenColors [Pixel];
- Depth [N] = GFX.Z2;
- }
- }
- }
- break;
- case H_FLIP | V_FLIP:
- bp = pCache + 56 - StartLine;
- for (l = LineCount; l != 0; l--, bp -= 8, Screen += GFX.PPL, Depth += GFX.PPL)
- {
- for (uint8 N = 0; N < 8; N++)
- {
- if (GFX.Z1 > Depth [N] && (Pixel = bp[7 - N]))
- {
- Screen [N] = ScreenColors [Pixel];
- Depth [N] = GFX.Z2;
- }
- }
- }
- break;
- case V_FLIP:
- bp = pCache + 56 - StartLine;
- for (l = LineCount; l != 0; l--, bp -= 8, Screen += GFX.PPL, Depth += GFX.PPL)
- {
- for (uint8 N = 0; N < 8; N++)
- {
- if (GFX.Z1 > Depth [N] && (Pixel = bp[N]))
- {
- Screen [N] = ScreenColors [Pixel];
- Depth [N] = GFX.Z2;
- }
- }
- }
- break;
- default:
- break;
- }
+ RENDER_TILE(WRITE_4PIXELS16, WRITE_4PIXELS16_FLIPPED, 4)
}
void DrawClippedTile16 (uint32 Tile, uint32 Offset,