mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
NOT setting upper bits on PUSH PC, minor adjustments
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@189 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
c6a4c89286
commit
547045e3c6
4 changed files with 15 additions and 16 deletions
|
@ -40,8 +40,8 @@ struct Cyclone
|
||||||
unsigned short (*fetch16)(unsigned int a); // [r7,#0x84]
|
unsigned short (*fetch16)(unsigned int a); // [r7,#0x84]
|
||||||
unsigned int (*fetch32)(unsigned int a); // [r7,#0x88]
|
unsigned int (*fetch32)(unsigned int a); // [r7,#0x88]
|
||||||
void (*IrqCallback)(int int_level); // [r7,#0x8c] - optional irq callback function, see config.h
|
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.
|
void (*ResetCallback)(void); // [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.
|
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
|
// used only if Cyclone was compiled with compressed jumptable, see config.h
|
||||||
|
|
|
@ -102,9 +102,10 @@ static void PrintException(int ints)
|
||||||
ot("no_sp_swap%i%s\n",ints,ms?"":":");
|
ot("no_sp_swap%i%s\n",ints,ms?"":":");
|
||||||
|
|
||||||
ot(" ldr r10,[r7,#0x60] ;@ Get Memory base\n");
|
ot(" ldr r10,[r7,#0x60] ;@ Get Memory base\n");
|
||||||
ot(" mov r1,r4,lsl #8\n");
|
// ot(" mov r1,r4,lsl #8\n");
|
||||||
ot(" sub r1,r1,r10,lsl #8 ;@ r1 = Old PC\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,r1,asr #8 ;@ push sign extended\n");
|
||||||
|
ot(" sub r1,r4,r10 ;@ r1 = Old PC\n");
|
||||||
OpPush32();
|
OpPush32();
|
||||||
OpPushSr(1);
|
OpPushSr(1);
|
||||||
ot(" mov r0,r11\n");
|
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&1) ott("0x%.4x", 0, "\n",0,ip++,1);
|
||||||
if(ip&7) fseek(AsmFile, -1, SEEK_CUR); // remove last comma
|
if(ip&7) fseek(AsmFile, -1, SEEK_CUR); // remove last comma
|
||||||
ot("\n");
|
|
||||||
if(ip&7) {
|
if(ip&7) {
|
||||||
for(i = 8-(ip&7); i > 0; i--)
|
for(i = 8-(ip&7); i > 0; i--)
|
||||||
ot(",0x0000");
|
ot(",0x0000");
|
||||||
ot("\n");
|
|
||||||
}
|
}
|
||||||
|
ot("\n");
|
||||||
if(ms) {
|
if(ms) {
|
||||||
for(i = (0x2000-ip/2)/8+1; i > 0; i--)
|
for(i = (0x2000-ip/2)/8+1; i > 0; i--)
|
||||||
ot(" dcd 0,0,0,0,0,0,0,0\n");
|
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("\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(";@ (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(";@ Cyclone 68000 is free for non-commercial use.\n\n");
|
||||||
ot(";@ For commercial use, separate licencing terms must be obtained.\n\n");
|
ot(";@ For commercial use, separate licencing terms must be obtained.\n\n");
|
||||||
|
|
||||||
|
|
|
@ -553,8 +553,7 @@ int OpAritha(int op)
|
||||||
|
|
||||||
// EA calculation order defines how situations like suba.w (A0)+, A0 get handled.
|
// 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.
|
// 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(-1,0,sea,size,0x003f);
|
||||||
EaCalcReadNoSE(type!=1?10:-1,11,dea,2,0x0e00);
|
EaCalcReadNoSE(type!=1?10:-1,11,dea,2,0x0e00);
|
||||||
|
|
|
@ -243,10 +243,10 @@ int OpJsr(int op)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ot(";@ Jsr - Push old PC first\n");
|
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(" 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(";@ Push r1 onto stack\n");
|
||||||
ot(" sub r0,r0,#4 ;@ Predecrement A7\n");
|
ot(" sub r0,r0,#4 ;@ Predecrement A7\n");
|
||||||
ot(" str r0,[r7,#0x3c] ;@ Save A7\n");
|
ot(" str r0,[r7,#0x3c] ;@ Save A7\n");
|
||||||
|
@ -438,11 +438,11 @@ int OpBranch(int op)
|
||||||
if (cc==1)
|
if (cc==1)
|
||||||
{
|
{
|
||||||
ot(";@ Bsr - remember old PC\n");
|
ot(";@ Bsr - remember old PC\n");
|
||||||
|
ot(" ldr r2,[r7,#0x3c]\n");
|
||||||
ot(" sub r1,r4,r10 ;@ r1 = Old PC\n");
|
ot(" sub r1,r4,r10 ;@ r1 = Old PC\n");
|
||||||
if (size) ot(" add r1,r1,#%d\n",1<<size);
|
if (size) ot(" add r1,r1,#%d\n",1<<size);
|
||||||
ot(" mov r1,r1, lsl #8\n");
|
// ot(" mov r1,r1, lsl #8\n");
|
||||||
ot(" ldr r2,[r7,#0x3c]\n");
|
// ot(" mov r1,r1, asr #8\n");
|
||||||
ot(" mov r1,r1, asr #8\n");
|
|
||||||
ot("\n");
|
ot("\n");
|
||||||
ot(";@ Push r1 onto stack\n");
|
ot(";@ Push r1 onto stack\n");
|
||||||
ot(" sub r0,r2,#4 ;@ Predecrement A7\n");
|
ot(" sub r0,r2,#4 ;@ Predecrement A7\n");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue