diff src/console/Nsf_Emu.cxx @ 323:230decbfe9be trunk

[svn] - what would we have ever done without Aerdan?
author nenolod
date Thu, 30 Nov 2006 23:02:05 -0800
parents fb513e10174e
children 986f098da058
line wrap: on
line diff
--- a/src/console/Nsf_Emu.cxx	Thu Nov 30 22:57:16 2006 -0800
+++ b/src/console/Nsf_Emu.cxx	Thu Nov 30 23:02:05 2006 -0800
@@ -472,7 +472,7 @@
 	
 	saved_state.pc = badop_addr;
 	low_mem [0x1FF] = (badop_addr - 1) >> 8;
-	low_mem [0x1FE] = (badop_addr - 1);
+	low_mem [0x1FE] = (badop_addr - 1) & 0xFF;
 	r.sp = 0xFD;
 	r.pc = init_addr;
 	r.a  = track;
@@ -523,7 +523,7 @@
 				
 				r.pc = play_addr;
 				low_mem [0x100 + r.sp--] = (badop_addr - 1) >> 8;
-				low_mem [0x100 + r.sp--] = (badop_addr - 1);
+				low_mem [0x100 + r.sp--] = (badop_addr - 1) & 0xFF;
 			}
 		}
 	}