From 547045e3c65ca34ea2a02a4da55c27aa94d8f316 Mon Sep 17 00:00:00 2001 From: notaz Date: Fri, 13 Jul 2007 13:39:09 +0000 Subject: [PATCH] NOT setting upper bits on PUSH PC, minor adjustments git-svn-id: file:///home/notaz/opt/svn/PicoDrive@189 be3aeb3a-fb24-0410-a615-afba39da0efa --- cpu/Cyclone/Cyclone.h | 4 ++-- cpu/Cyclone/Main.cpp | 12 ++++++------ cpu/Cyclone/OpArith.cpp | 3 +-- cpu/Cyclone/OpBranch.cpp | 12 ++++++------ 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/cpu/Cyclone/Cyclone.h b/cpu/Cyclone/Cyclone.h index 62a1314..6bce671 100644 --- a/cpu/Cyclone/Cyclone.h +++ b/cpu/Cyclone/Cyclone.h @@ -40,8 +40,8 @@ struct Cyclone unsigned short (*fetch16)(unsigned int a); // [r7,#0x84] unsigned int (*fetch32)(unsigned int a); // [r7,#0x88] void (*IrqCallback)(int int_level); // [r7,#0x8c] - optional irq callback function, see config.h - void (*ResetCallback)(); // [r7,#0x90] - if enabled in config.h, calls this whenever RESET opcode is encountered. - int (*UnrecognizedCallback)(); // [r7,#0x94] - if enabled in config.h, calls this whenever unrecognized opcode is encountered. + void (*ResetCallback)(void); // [r7,#0x90] - if enabled in config.h, calls this whenever RESET opcode is encountered. + int (*UnrecognizedCallback)(void); // [r7,#0x94] - if enabled in config.h, calls this whenever unrecognized opcode is encountered. }; // used only if Cyclone was compiled with compressed jumptable, see config.h diff --git a/cpu/Cyclone/Main.cpp b/cpu/Cyclone/Main.cpp index 96de268..5647fb1 100644 --- a/cpu/Cyclone/Main.cpp +++ b/cpu/Cyclone/Main.cpp @@ -102,9 +102,10 @@ static void PrintException(int ints) ot("no_sp_swap%i%s\n",ints,ms?"":":"); ot(" ldr r10,[r7,#0x60] ;@ Get Memory base\n"); - ot(" mov r1,r4,lsl #8\n"); - ot(" sub r1,r1,r10,lsl #8 ;@ r1 = Old PC\n"); - ot(" mov r1,r1,asr #8 ;@ push sign extended\n"); +// ot(" mov r1,r4,lsl #8\n"); +// ot(" sub r1,r1,r10,lsl #8 ;@ r1 = Old PC\n"); +// ot(" mov r1,r1,asr #8 ;@ push sign extended\n"); + ot(" sub r1,r4,r10 ;@ r1 = Old PC\n"); OpPush32(); OpPushSr(1); ot(" mov r0,r11\n"); @@ -634,12 +635,11 @@ static void PrintJumpTable() } if(ip&1) ott("0x%.4x", 0, "\n",0,ip++,1); if(ip&7) fseek(AsmFile, -1, SEEK_CUR); // remove last comma - ot("\n"); if(ip&7) { for(i = 8-(ip&7); i > 0; i--) ot(",0x0000"); - ot("\n"); } + ot("\n"); if(ms) { for(i = (0x2000-ip/2)/8+1; i > 0; i--) ot(" dcd 0,0,0,0,0,0,0,0\n"); @@ -687,7 +687,7 @@ static int CycloneMake() ot("\n;@ Dave's Cyclone 68000 Emulator v%x.%.3x - Assembler Output\n\n",CycloneVer>>12,CycloneVer&0xfff); ot(";@ (c) Copyright 2003 Dave, All rights reserved.\n"); - ot(";@ some code (c) Copyright 2005-2006 notaz, All rights reserved.\n"); + ot(";@ some code (c) Copyright 2005-2007 notaz, All rights reserved.\n"); ot(";@ Cyclone 68000 is free for non-commercial use.\n\n"); ot(";@ For commercial use, separate licencing terms must be obtained.\n\n"); diff --git a/cpu/Cyclone/OpArith.cpp b/cpu/Cyclone/OpArith.cpp index 47ff8b1..93d34a2 100644 --- a/cpu/Cyclone/OpArith.cpp +++ b/cpu/Cyclone/OpArith.cpp @@ -553,8 +553,7 @@ int OpAritha(int op) // EA calculation order defines how situations like suba.w (A0)+, A0 get handled. // different emus act differently in this situation, I couldn't fugure which is right behaviour. - // This is Musashi's behaviour. - if (type == 1) + if (/*type == */1) { EaCalcReadNoSE(-1,0,sea,size,0x003f); EaCalcReadNoSE(type!=1?10:-1,11,dea,2,0x0e00); diff --git a/cpu/Cyclone/OpBranch.cpp b/cpu/Cyclone/OpBranch.cpp index da76306..d1c2391 100644 --- a/cpu/Cyclone/OpBranch.cpp +++ b/cpu/Cyclone/OpBranch.cpp @@ -243,10 +243,10 @@ int OpJsr(int op) else { ot(";@ Jsr - Push old PC first\n"); - ot(" sub r1,r4,r10 ;@ r1 = Old PC\n"); - ot(" mov r1,r1,lsl #8\n"); ot(" ldr r0,[r7,#0x3c]\n"); - ot(" mov r1,r1,asr #8\n"); + ot(" sub r1,r4,r10 ;@ r1 = Old PC\n"); +// ot(" mov r1,r1,lsl #8\n"); +// ot(" mov r1,r1,asr #8\n"); ot(";@ Push r1 onto stack\n"); ot(" sub r0,r0,#4 ;@ Predecrement A7\n"); ot(" str r0,[r7,#0x3c] ;@ Save A7\n"); @@ -438,11 +438,11 @@ int OpBranch(int op) if (cc==1) { ot(";@ Bsr - remember old PC\n"); + ot(" ldr r2,[r7,#0x3c]\n"); ot(" sub r1,r4,r10 ;@ r1 = Old PC\n"); if (size) ot(" add r1,r1,#%d\n",1<