From e6ca42be64f6dd139f0f57f103d108e98ae6d90b Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Tue, 18 Nov 2014 22:27:25 -0800 Subject: [PATCH] CPU fixes from tracing against AppleWin - All regs are 0xFF on reboot - Stack pointer is 0xFC on reboot - Flags are set accordingly - Fix op_JMP_ind tracing display --- src/x86/cpu.S | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/x86/cpu.S b/src/x86/cpu.S index b26833ba..935883f5 100644 --- a/src/x86/cpu.S +++ b/src/x86/cpu.S @@ -913,7 +913,7 @@ E(op_BRK) #endif Push(%al) orb $(B_Flag|X_Flag), F_Reg - xorw %ax, %ax + xorw %ax, %ax movb F_Reg, %al SNX_PROLOGUE(cpu65_flags_encode) movb SNX(cpu65_flags_encode,_XAX,1), %al @@ -1249,10 +1249,7 @@ E(op_JMP_abs) Continue E(op_JMP_ind) // 0x6c - GetFromPC_B - xchgb %al, %ah - GetFromPC_B - xchgb %al, %ah + GetFromPC_W cmpb $0xFF, %al je jmp_special GetFromMem_W(_XAX) @@ -2252,10 +2249,14 @@ E(cpu65_run) // Zero all used registers xorLQ _XAX, _XAX xorLQ XY_Reg_X, XY_Reg_X + movb $0xFF, X_Reg + movb $0xFF, Y_Reg xorLQ AF_Reg_X, AF_Reg_X + movb $0xFF, A_Reg + orb $(C_Flag|X_Flag|I_Flag|V_Flag|B_Flag|Z_Flag|N_Flag), F_Reg xorLQ PC_Reg_X, PC_Reg_X xorLQ EffectiveAddr_X, EffectiveAddr_X - movLQ $0x1FF, SP_Reg_X + movLQ $0x1FC, SP_Reg_X jmp ex_reset exit_cpu65_run: