m6809/konami: looped opcodes make more sense like this

This commit is contained in:
hap 2024-02-05 20:31:44 +01:00
parent 68778e18d2
commit b7c7a0efda
3 changed files with 16 additions and 13 deletions

View File

@ -10,8 +10,6 @@
TODO:
- verify cycle timing
- verify status flag handling
- what happens with block/shift opcodes when count is 0? maybe a full loop?
parodius does an indexed LSRD and checks for A==0 to jump over the opcode
References:

View File

@ -522,13 +522,14 @@ LSRD:
@m_temp.b.h = read_operand(0);
@m_temp.b.l = read_operand(1);
while(m_bcount--)
do
{
@eat(1);
m_cc &= ~CC_C;
m_cc |= (m_temp.w & 1) ? CC_C : 0;
m_temp.w = set_flags<uint16_t>(CC_NZ, m_temp.w >> 1);
}
} while (--m_bcount);
@write_operand(0, m_temp.b.h);
write_operand(1, m_temp.b.l);
return;
@ -540,11 +541,12 @@ ASLD:
@m_temp.b.h = read_operand(0);
@m_temp.b.l = read_operand(1);
while(m_bcount--)
do
{
@eat(1);
m_temp.w = set_flags<uint16_t>(CC_NZVC, m_temp.w, m_temp.w, m_temp.w << 1);
}
} while (--m_bcount);
@write_operand(0, m_temp.b.h);
write_operand(1, m_temp.b.l);
return;
@ -556,13 +558,14 @@ ASRD:
@m_temp.b.h = read_operand(0);
@m_temp.b.l = read_operand(1);
while(m_bcount--)
do
{
@eat(1);
m_cc &= ~CC_C;
m_cc |= (m_temp.w & 1) ? CC_C : 0;
m_temp.w = set_flags<uint16_t>(CC_NZ, ((int16_t) m_temp.w) >> 1);
}
} while (--m_bcount);
@write_operand(0, m_temp.b.h);
write_operand(1, m_temp.b.l);
return;
@ -574,11 +577,12 @@ ROLD:
@m_temp.b.h = read_operand(0);
@m_temp.b.l = read_operand(1);
while(m_bcount--)
do
{
@eat(1);
m_temp.w = set_flags<uint16_t>(CC_NZV, rotate_left(m_temp.w));
}
} while (--m_bcount);
@write_operand(0, m_temp.b.h);
write_operand(1, m_temp.b.l);
return;
@ -590,11 +594,12 @@ RORD:
@m_temp.b.h = read_operand(0);
@m_temp.b.l = read_operand(1);
while(m_bcount--)
do
{
@eat(1);
m_temp.w = set_flags<uint16_t>(CC_NZ, rotate_right(m_temp.w));
}
} while (--m_bcount);
@write_operand(0, m_temp.b.h);
write_operand(1, m_temp.b.l);
return;

View File

@ -361,7 +361,7 @@ void thunderx_state::pmc_run()
// 0x05 : byte : first byte of set 0
// 0x06 : byte : first byte of set 1
//
// the USA version is slightly different:
// thunderxa is slightly different:
//
// 0x05 : word : first byte of set 0
// 0x07 : byte : first byte of set 1