@@ -52,6 +52,7 @@ impl<CPU: CpuDetails> M68000<CPU> {
5252 cycle_count += self . process_pending_exceptions ( memory) ;
5353 }
5454
55+ self . current_pc = self . regs . pc ;
5556 let instruction = match self . get_next_instruction ( memory) {
5657 Ok ( i) => i,
5758 Err ( e) => return ( 0 , String :: from ( "" ) , cycle_count, Some ( e) ) ,
@@ -74,7 +75,7 @@ impl<CPU: CpuDetails> M68000<CPU> {
7475 Err ( e) => Some ( e) ,
7576 } ;
7677
77- ( instruction . pc , dis, cycle_count, exception)
78+ ( self . current_pc . 0 , dis, cycle_count, exception)
7879 }
7980
8081 fn instruction_unknown_instruction < M : MemoryAccess + ?Sized > ( & mut self , _: & mut M , _: & Instruction ) -> InterpreterResult {
@@ -143,7 +144,7 @@ impl<CPU: CpuDetails> M68000<CPU> {
143144
144145 fn instruction_bcc < M : MemoryAccess + ?Sized > ( & mut self , _: & mut M , inst : & Instruction ) -> InterpreterResult {
145146 let ( condition, displacement) = inst. operands . condition_displacement ( ) ;
146- self . execute_bcc ( inst . pc . wrapping_add ( 2 ) , condition, displacement)
147+ self . execute_bcc ( condition, displacement)
147148 }
148149
149150 fn instruction_bchg < M : MemoryAccess + ?Sized > ( & mut self , memory : & mut M , inst : & Instruction ) -> InterpreterResult {
@@ -158,7 +159,7 @@ impl<CPU: CpuDetails> M68000<CPU> {
158159
159160 fn instruction_bra < M : MemoryAccess + ?Sized > ( & mut self , _: & mut M , inst : & Instruction ) -> InterpreterResult {
160161 let disp = inst. operands . displacement ( ) ;
161- self . execute_bra ( inst . pc . wrapping_add ( 2 ) , disp)
162+ self . execute_bra ( disp)
162163 }
163164
164165 fn instruction_bset < M : MemoryAccess + ?Sized > ( & mut self , memory : & mut M , inst : & Instruction ) -> InterpreterResult {
@@ -168,7 +169,7 @@ impl<CPU: CpuDetails> M68000<CPU> {
168169
169170 fn instruction_bsr < M : MemoryAccess + ?Sized > ( & mut self , memory : & mut M , inst : & Instruction ) -> InterpreterResult {
170171 let disp = inst. operands . displacement ( ) ;
171- self . execute_bsr ( memory, inst . pc . wrapping_add ( 2 ) , disp)
172+ self . execute_bsr ( memory, disp)
172173 }
173174
174175 fn instruction_btst < M : MemoryAccess + ?Sized > ( & mut self , memory : & mut M , inst : & Instruction ) -> InterpreterResult {
@@ -210,7 +211,7 @@ impl<CPU: CpuDetails> M68000<CPU> {
210211
211212 fn instruction_dbcc < M : MemoryAccess + ?Sized > ( & mut self , _: & mut M , inst : & Instruction ) -> InterpreterResult {
212213 let ( cc, reg, disp) = inst. operands . condition_register_displacement ( ) ;
213- self . execute_dbcc ( inst . pc . wrapping_add ( 2 ) , cc, reg, disp)
214+ self . execute_dbcc ( cc, reg, disp)
214215 }
215216
216217 /// If a zero divide exception occurs, this method returns the effective address calculation time, and the
0 commit comments