port to updated Cyclone, debug menu

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@217 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2007-08-05 19:41:41 +00:00
parent 3335750a7d
commit 0af33fe0ef
14 changed files with 170 additions and 91 deletions

View file

@ -417,9 +417,9 @@ static void OtherWrite8End(u32 a, u32 d, int realsize)
//u8 PicoReadM68k8_(u32 a);
#ifdef _ASM_CD_MEMORY_C
u8 PicoReadM68k8(u32 a);
u32 PicoReadM68k8(u32 a);
#else
static u8 PicoReadM68k8(u32 a)
static u32 PicoReadM68k8(u32 a)
{
u32 d=0;
@ -468,17 +468,17 @@ static u8 PicoReadM68k8(u32 a)
#ifdef __debug_io
dprintf("r8 : %06x, %02x @%06x", a&0xffffff, (u8)d, SekPc);
#endif
return (u8)d;
return d;
}
#endif
#ifdef _ASM_CD_MEMORY_C
u16 PicoReadM68k16(u32 a);
u32 PicoReadM68k16(u32 a);
#else
static u16 PicoReadM68k16(u32 a)
static u32 PicoReadM68k16(u32 a)
{
u16 d=0;
u32 d=0;
if ((a&0xe00000)==0xe00000) { d=*(u16 *)(Pico.ram+(a&0xfffe)); goto end; } // Ram
@ -515,7 +515,7 @@ static u16 PicoReadM68k16(u32 a)
if ((a&0xffffc0)==0xa12000)
rdprintf("m68k_regs r16: [%02x] @%06x", a&0x3f, SekPc);
d = (u16)OtherRead16(a, 16);
d = OtherRead16(a, 16);
if ((a&0xffffc0)==0xa12000)
rdprintf("ret = %04x", d);
@ -778,9 +778,9 @@ static void PicoWriteM68k32(u32 a,u32 d)
// -----------------------------------------------------------------
#ifdef _ASM_CD_MEMORY_C
u8 PicoReadS68k8(u32 a);
u32 PicoReadS68k8(u32 a);
#else
static u8 PicoReadS68k8(u32 a)
static u32 PicoReadS68k8(u32 a)
{
u32 d=0;
@ -868,16 +868,15 @@ static u8 PicoReadS68k8(u32 a)
#ifdef __debug_io2
dprintf("s68k r8 : %06x, %02x @%06x", a&0xffffff, (u8)d, SekPcS68k);
#endif
return (u8)d;
return d;
}
#endif
//u16 PicoReadS68k16_(u32 a);
#ifdef _ASM_CD_MEMORY_C
u16 PicoReadS68k16(u32 a);
u32 PicoReadS68k16(u32 a);
#else
static u16 PicoReadS68k16(u32 a)
static u32 PicoReadS68k16(u32 a)
{
u32 d=0;

View file

@ -36,8 +36,8 @@ SekRunPS:
ldr lr, =PicoCpuS68k
ldr r2, =CycloneEnd_M68k
ldr r3, =CycloneEnd_S68k
str r2, [r7,#0x54]
str r3, [lr,#0x54]
str r2, [r7,#0x98]
str r3, [lr,#0x98]
@ update aims
ldr r8, =SekCycleAim
@ -132,15 +132,14 @@ SekRunPS_end:
ldr r7, =PicoCpu
ldr lr, =PicoCpuS68k
mov r0, #0
str r0, [r7,#0x54] @ remove CycloneEnd handler
str r0, [lr,#0x54]
str r0, [r7,#0x98] @ remove CycloneEnd handler
str r0, [lr,#0x98]
@ return
add sp, sp, #2*4
ldmfd sp!, {r4-r11,pc}
CycloneRunLocal:
;@ r0-3 = Temporary registers
ldr r4,[r7,#0x40] ;@ r4 = Current PC + Memory Base
@ -159,20 +158,23 @@ CycloneRunLocal:
cmp r0,#6 ;@ irq>6 ?
andle r1,r1,#7 ;@ Get interrupt mask
cmple r0,r1 ;@ irq<=6: Is irq<=mask ?
ldrgt lr,[r7,#0x54] @ Interrupt will definitely use more cycles than our step,
bgt CycloneDoInterrupt @ so make this function return directly to CycloneEnd_*
bgt CycloneDoInterrupt
NoIntsLocal:
;@ Check if our processor is in stopped state and jump to opcode handler if not
ldr r0,[r7,#0x58]
;@ Check if our processor is in special state
;@ and jump to opcode handler if not
ldr r0,[r7,#0x58] ;@ state_flags
ldrh r8,[r4],#2 ;@ Fetch first opcode
tst r0,r0 ;@ stopped?
tst r0,#0x03 ;@ special state?
andeq r9,r9,#0xf0000000
ldreq pc,[r6,r8,asl #2] ;@ Jump to opcode handler
@ stopped
CycloneSpecial2:
tst r0,#2 ;@ tracing?
bne CycloneDoTrace
;@ stopped or halted
sub r4,r4,#2
ldr r1,[r7,#0x54]
ldr r1,[r7,#0x98]
mov r5,#0
bx r1

View file

@ -39,13 +39,14 @@ static int SekIntAckS68kM(int level)
#endif
#ifdef EMU_C68K
// interrupt acknowledgment
static void SekIntAckS68k(int level)
// interrupt acknowledgement
static int SekIntAckS68k(int level)
{
int level_new = new_irq_level(level);
dprintf("s68kACK %i -> %i", level, level_new);
PicoCpuS68k.irq = level_new;
return CYCLONE_INT_ACK_AUTOVECTOR;
}
static void SekResetAck()
@ -97,7 +98,7 @@ int SekResetS68k()
if (Pico.rom==NULL) return 1;
#ifdef EMU_C68K
PicoCpuS68k.stopped=0;
PicoCpuS68k.state_flags=0;
PicoCpuS68k.osp=0;
PicoCpuS68k.srh =0x27; // Supervisor mode
PicoCpuS68k.flags=4; // Z set