nemesis112
Still Fresh
Does anybody have any experience moving from the Musashi M68k core to Cyclone? Just having some problems integrating it.
Cheers....
Cheers....
Well it depends what you are using it for. There are still bugs in Cyclone so it could be what ever M68K code you are trying to run on it is causing it to bomb out.
Are you sure you are setting membase correctly? If you don't then who knows where the cyclone will be reading opcodes from.
The cycle count in Cyclone is different from Musashi, are you dealing with this correctly?
Post the code somewhere, I'm sure we can get what ever you are working on going. It doesn't have to be everything. The Cyclone initialisation code, memory handlers etc.
switch((pc&0xF00000)>>20) {
case 0x0:
MyCyclone.membase=(int)memory.cpu;
break;
case 0x2:
MyCyclone.membase=(int)(memory.cpu+bankaddress)-0x200000;
break;
case 0x1:
if (pc<=0x10FFff)
MyCyclone.membase=(int)memory.ram-0x100000;
break;
case 0xC:
if (pc<=0xc1FFff)
MyCyclone.membase=(int)memory.bios-0xc00000;
break;
}
$000000 +------------------------+
| |
| RAM |
| | $1FFFFF
$200000 +------------------------+
| shadow |
| of $000000-$1FFFFF | with 2MB
| RAM | $3FFFFF
$400000 +------------------------+
. .
. ... .
. .
. . $7FFFFF
$800000 +------------------------+
| |
| ROM |
| | $DFFFFF
$E00000 +------------------------+
| BOOT-(EP)ROM | $E1FFFF
$E20000 +------------------------+
. .
. ... .
. . $EFFFFF
$F00000 +------------------------+
| TOM |
$F10000 |------------------------+
| JERRY |
+------------------------+ $F1FFFF
switch((pc&0xF00000)>>20) {
// 0x000000 - 0x1FFFFF point should be in system ram
case 0x0:
case 0x1:
MyCyclone.membase=(int)memory.ram;
break;
// 0x200000 - 0x3FFFFF - shadow ram, so point to system using offset
case 0x2:
case 0x3:
MyCyclone.membase=(int)memory.ram-0x200000;
break;
// because you've put bankaddress here I'm assuming
// memory.cpu is the rom banks?
case 0x8:
case 0x9:
case 0xA:
case 0xB:
case 0xC:
case 0xD:
MyCyclone.membase=(int)(memory.cpu+bankaddress)-0x800000;
break;
// I'm assuming bios is the same as Boot rom, could be wrong
case 0xE:
MyCyclone.membase=(int)memory.bios-0xE00000;
break;
// anything else? just point it at ram
case default:
MyCyclone.membase=(int)memory.ram-(pc&0xF00000);
break;
}
static unsigned int MyCheckPc(unsigned int pc) {
WriteLog("MyCheckPC %u\n",pc);
WriteLog("S) Offset: %u, PC: %u\n",MyCyclone.membase,pc);
pc-=MyCyclone.membase; // Get the real program counter
switch((pc&0xF00000)>>20) {
// 0x000000 - 0x1FFFFF point should be in system ram
case 0x0:
case 0x1:
MyCyclone.membase=(int)jaguar_mainRam;
break;
// 0x200000 - 0x3FFFFF - shadow ram, so point to system using offset
case 0x2:
case 0x3:
MyCyclone.membase=(int)jaguar_mainRam-0x200000;
break;
case 0x8:
case 0x9:
case 0xA:
case 0xB:
case 0xC:
case 0:
MyCyclone.membase=(int)jaguar_mainRom-0x800000;
break;
// I'm assuming bios is the same as Boot rom, could be wrong
case 0xE:
MyCyclone.membase=(int)jaguar_bootRom-0xE00000;
break;
// anything else? just point it at ram
default:
MyCyclone.membase=(int)jaguar_mainRam-(pc&0xF00000);
break;
}
WriteLog("E) Offset: %u, PC: %u\n",MyCyclone.membase,pc);
return MyCyclone.membase+pc; // New program counter
}