mirror of
https://github.com/holub/mame
synced 2025-04-18 22:49:58 +03:00
minx: don't crash mame on divide by 0
This commit is contained in:
parent
8ca4fcbbf9
commit
04edb1b554
@ -41,7 +41,7 @@ TODO:
|
||||
- Add support for O and C flags in NEG8 instruction
|
||||
- Verify MUL (CE D8) and DIV (CE D9)
|
||||
- Doublecheck behaviour of CMPN instructions ( CF 60 .. CF 63 )
|
||||
- DIV (CE D9) division by zero handling - is supposed to raise a EX4 exception. A real Pokemini unit will freeze. MAME currently will crash.
|
||||
- DIV (CE D9) division by zero handling - is supposed to raise a EX4 exception. A real Pokemini unit will freeze.
|
||||
|
||||
*/
|
||||
|
||||
|
@ -454,7 +454,7 @@ void minx_cpu_device::execute_one_ce()
|
||||
break;
|
||||
case 0xD8: { m_HL = ( m_HL & 0x00FF ) * ( m_BA & 0x00FF ); }
|
||||
break;
|
||||
case 0xD9: { int d = m_HL / ( m_BA & 0x00FF ); m_HL = ( ( m_HL - ( ( m_BA & 0x00FF ) * d ) ) << 8 ) | d; }
|
||||
case 0xD9: { if ( m_BA & 0x00FF ) { int d = m_HL / ( m_BA & 0x00FF ); m_HL = ( ( m_HL - ( ( m_BA & 0x00FF ) * d ) ) << 8 ) | d; } }
|
||||
break;
|
||||
case 0xDA: { /* illegal operation? */ }
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user