Skip to content

Commit

Permalink
remove unneeded masks for rotate instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
davidly committed Dec 28, 2024
1 parent e562453 commit 0c04f24
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions x80.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1803,7 +1803,8 @@ uint16_t x80_emulate( uint16_t maxcycles )
{
reg.fCarry = ( 0 != ( reg.a & 0x80 ) );
reg.a <<= 1;
reg.a = reg.fCarry ? ( reg.a | 1 ) : ( reg.a & 0xfe );
if ( reg.fCarry )
reg.a |= 1;
if ( reg.fZ80Mode )
{
reg.clearHN();
Expand Down Expand Up @@ -1838,7 +1839,8 @@ uint16_t x80_emulate( uint16_t maxcycles )
bool c = reg.fCarry;
reg.fCarry = ( 0 != ( 0x80 & reg.a ) );
reg.a <<= 1;
reg.a = c ? ( reg.a | 1 ) : ( reg.a & 0xfe );
if ( c )
reg.a |= 1;
if ( reg.fZ80Mode )
{
reg.clearHN();
Expand All @@ -1852,7 +1854,8 @@ uint16_t x80_emulate( uint16_t maxcycles )
bool c = reg.fCarry;
reg.fCarry = ( 0 != ( reg.a & 1 ) );
reg.a >>= 1;
reg.a = c ? ( reg.a | 0x80 ) : ( reg.a & 0x7f );
if ( c )
reg.a |= 0x80;
if ( reg.fZ80Mode )
{
reg.clearHN();
Expand Down

0 comments on commit 0c04f24

Please sign in to comment.