Backport c4emu and gfx fixes (#810)

C4emu backport:
C4: Do the sign extend manually.
Revert "MSVC 2005 bugfix"

GFX backport:
Fix GCC warning about indentation. 
GFX.DoInterlace-- should occur even if we don't render frame.
This commit is contained in:
bladeoner 2019-02-17 18:33:34 +01:00 committed by dborth
parent 6b23a58a83
commit f93f2b84fa
2 changed files with 6 additions and 7 deletions

View File

@ -1022,11 +1022,11 @@ void S9xSetC4 (uint8 byte, uint16 Address)
if (Memory.C4RAM[0x1f4d] != 0x0e)
printf("$7f4d=%02x, expected 0e for command 54 %02x\n", Memory.C4RAM[0x1f4d], Memory.C4RAM[0x1f4d]);
#endif
int64 b = (int64) READ_3WORD(Memory.C4RAM + 0x1f80);
int64 c = b << 40;
int64 a = SAR(c, 30);
a = SAR(c, 10);
int64 a = (int64)READ_3WORD(Memory.C4RAM + 0x1f80);
a |= 0xffffffffff000000 * ((a >> 23) & 1);
//printf("%08X%08X\n", (uint32) (a>>32), (uint32) (a&0xFFFFFFFF));
a *= a;
//printf("%08X%08X\n", (uint32) (a>>32), (uint32) (a&0xFFFFFFFF));
WRITE_3WORD(Memory.C4RAM + 0x1f83, a);
WRITE_3WORD(Memory.C4RAM + 0x1f86, (a >> 24));
break;

View File

@ -200,6 +200,8 @@ void S9xBuildDirectColourMaps (void)
void S9xStartScreenRefresh (void)
{
GFX.InterlaceFrame = !GFX.InterlaceFrame;
if (GFX.DoInterlace)
GFX.DoInterlace--;
if (IPPU.RenderThisFrame)
{
@ -211,9 +213,6 @@ void S9xStartScreenRefresh (void)
return;
}
if (GFX.DoInterlace)
GFX.DoInterlace--;
S9xGraphicsScreenResize();
IPPU.RenderedFramesCount++;