Changed the BRK instruction so that the B flag is set before the status

register is pushed on the stack.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@74 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
bwmott 2002-04-22 01:08:51 +00:00
parent dfd5cd86bb
commit a6e2e72f66
1 changed files with 5 additions and 3 deletions

View File

@ -13,14 +13,14 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: M6502.m4,v 1.2 2001-12-29 17:55:59 bwmott Exp $ // $Id: M6502.m4,v 1.3 2002-04-22 01:08:51 bwmott Exp $
//============================================================================ //============================================================================
/** /**
Code and cases to emulate each of the 6502 instruction Code and cases to emulate each of the 6502 instruction
@author Bradford W. Mott @author Bradford W. Mott
@version $Id: M6502.m4,v 1.2 2001-12-29 17:55:59 bwmott Exp $ @version $Id: M6502.m4,v 1.3 2002-04-22 01:08:51 bwmott Exp $
*/ */
#ifndef NOTSAMEPAGE #ifndef NOTSAMEPAGE
@ -157,11 +157,13 @@ define(M6502_BIT, `{
define(M6502_BRK, `{ define(M6502_BRK, `{
peek(PC++); peek(PC++);
B = true;
poke(0x0100 + SP--, PC >> 8); poke(0x0100 + SP--, PC >> 8);
poke(0x0100 + SP--, PC & 0x00ff); poke(0x0100 + SP--, PC & 0x00ff);
poke(0x0100 + SP--, PS()); poke(0x0100 + SP--, PS());
B = true;
I = true; I = true;
PC = peek(0xfffe); PC = peek(0xfffe);