Optimise TC0100SCN char layer

This commit is contained in:
Barry Harris 2013-01-21 15:31:18 +00:00
parent f30aa572a4
commit 1aee560d86
1 changed files with 11 additions and 1 deletions

View File

@ -380,8 +380,12 @@ void TC0100SCNRenderCharLayer(INT32 Chip)
Rows = 32;
}
GfxDecode(256, 2, 8, 8, TC0100SCNPlaneOffsets, TC0100SCNXOffsets, TC0100SCNYOffsets, 0x80, (UINT8*)CharRam, TC0100SCNChars[Chip]);
if (TC0100SCNCharRamUpdate[Chip]) {
GfxDecode(256, 2, 8, 8, TC0100SCNPlaneOffsets, TC0100SCNXOffsets, TC0100SCNYOffsets, 0x80, (UINT8*)CharRam, TC0100SCNChars[Chip]);
TC0100SCNCharRamUpdate[Chip] = 0;
}
// we could use TC0100SCNCharLayerUpdate to render to a temp buffer, but since there is no row/col scroll here, it would probably be slower
for (my = 0; my < Rows; my++) {
for (mx = 0; mx < Columns; mx++) {
Attr = BURN_ENDIAN_SWAP_INT16(VideoRam[TileIndex]);
@ -489,6 +493,8 @@ void TC0100SCNReset()
TC0100SCNDblWidth[i] = 0;
TC0100SCNBgLayerUpdate[i] = 1;
TC0100SCNFgLayerUpdate[i] = 1;
TC0100SCNCharLayerUpdate[i] = 1;
TC0100SCNCharRamUpdate[i] = 1;
}
}
@ -519,6 +525,8 @@ void TC0100SCNInit(INT32 Chip, INT32 nNumTiles, INT32 xOffset, INT32 yOffset, IN
TC0100SCNPaletteOffset[Chip] = 0;
TC0100SCNFgLayerUpdate[Chip] = 1;
TC0100SCNBgLayerUpdate[Chip] = 1;
TC0100SCNCharLayerUpdate[Chip] = 1;
TC0100SCNCharRamUpdate[Chip] = 1;
if (!TC0100SCNClipWidth[Chip] || !TC0100SCNClipHeight[Chip]) bprintf(PRINT_IMPORTANT, _T("TC0100SCNInit called before GenericTilesInit\n"));
@ -584,6 +592,8 @@ void TC0100SCNExit()
TC0100SCNPaletteOffset[i] = 0;
TC0100SCNBgLayerUpdate[i] = 0;
TC0100SCNFgLayerUpdate[i] = 0;
TC0100SCNCharLayerUpdate[i] = 0;
TC0100SCNCharRamUpdate[i] = 0;
}
TC0100SCNNum = 0;