Skip to content

Commit

Permalink
Revert "MSVC 2005 bugfix"
Browse files Browse the repository at this point in the history
This reverts commit eecbd7a.
  • Loading branch information
bearoso committed Feb 13, 2019
1 parent 49e399c commit bd96a8d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions c4emu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1021,11 +1021,10 @@ 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 = SAR((int64) READ_3WORD(Memory.C4RAM + 0x1f80) << 40, 40);
//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;
Expand Down

2 comments on commit bd96a8d

@OV2
Copy link
Collaborator

@OV2 OV2 commented on bd96a8d Feb 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int64	a = SAR(c, 30);
a = SAR(c, 10);

I think this was the problem - second line c should be a.

@bearoso
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I overlooked that, just like whoever wrote it. My new code is more obvious as to the intent, though, so I'll keep it.

Please sign in to comment.