File tree Expand file tree Collapse file tree 3 files changed +5
-0
lines changed
Expand file tree Collapse file tree 3 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -244,6 +244,7 @@ namespace casioemu {
244244 SetupOpcodeDispatch ();
245245 SetupRegisterProxies ();
246246 impl_csr_mask = emulator.GetModelInfo (" csr_mask" );
247+ real_hardware = emulator.GetModelInfo (" real_hardware" );
247248 }
248249
249250 void CPU::SetupOpcodeDispatch () {
Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ namespace casioemu {
6565 size_t impl_hint;
6666 uint16_t impl_csr_mask;
6767
68+ bool real_hardware;
69+
6870 void SetupOpcodeDispatch ();
6971 void SetupRegisterProxies ();
7072
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ namespace casioemu {
1010 void CPU::OP_ADDSP () {
1111 impl_operands[0 ].value |= (impl_operands[0 ].value & 0x80 ) ? 0xFF00 : 0 ;
1212 reg_sp += impl_operands[0 ].value ;
13+ if (real_hardware) reg_sp &= ~1 ;
1314 }
1415
1516 void CPU::OP_CTRL () {
@@ -46,6 +47,7 @@ namespace casioemu {
4647 break ;
4748 case 11 :
4849 reg_sp = impl_operands[1 ].value ;
50+ if (real_hardware) reg_sp &= ~1 ;
4951 break ;
5052 }
5153 }
You can’t perform that action at this time.
0 commit comments