Skip to content

Commit

Permalink
C4: Do the sign extend manually.
Browse files Browse the repository at this point in the history
  • Loading branch information
bearoso committed Feb 13, 2019
1 parent bd96a8d commit 35eb5e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion c4emu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,8 @@ 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 a = SAR((int64) READ_3WORD(Memory.C4RAM + 0x1f80) << 40, 40);
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));
Expand Down

0 comments on commit 35eb5e5

Please sign in to comment.