added some message logging

This commit is contained in:
EkeEke 2012-07-22 19:53:21 +02:00
parent 8dad467ad2
commit 737fcd116c
5 changed files with 27 additions and 11 deletions

View File

@ -471,9 +471,6 @@ void cdc_reg_w(unsigned char data)
unsigned char cdc_reg_r(void)
{
#ifdef LOG_CDC
error("CDC register %X read (%X) ", scd.regs[0x04>>1].byte.l & 0x0F, s68k.pc);
#endif
switch (scd.regs[0x04>>1].byte.l & 0x0F)
{
case 0x01: /* IFSTAT */

View File

@ -190,6 +190,9 @@ INLINE void s68k_poll_detect(reg)
if (s68k.pc == s68k.poll.pc)
{
/* stop SUB-CPU until register is modified by MAIN-CPU */
#ifdef LOG_SCD
error("s68k stopped from %d cycles\n", s68k.cycles);
#endif
s68k.cycles = s68k.cycle_end;
s68k.stopped = 1 << reg;
}
@ -226,6 +229,9 @@ INLINE void s68k_poll_sync(reg)
/* restart MAIN-CPU */
m68k.stopped = 0;
#ifdef LOG_SCD
error("m68k started from %d cycles\n", cycles);
#endif
}
/* clear CPU register(s) access flags */
@ -269,6 +275,9 @@ static unsigned int scd_read_byte(unsigned int address)
if (address == 0xff8007)
{
unsigned int data = cdc_reg_r();
#ifdef LOG_CDC
error("CDC register %X read 0x%02X (%X) ", scd.regs[0x04>>1].byte.l & 0x0F, data, s68k.pc);
#endif
return data;
}
@ -1667,9 +1676,6 @@ int scd_context_load(uint8 *state)
load_param(&tmp32, 4); s68k_set_reg(M68K_REG_USP,tmp32);
load_param(&tmp32, 4); s68k_set_reg(M68K_REG_ISP,tmp32);
/* update IRQ level */
s68k_update_irq((scd.pending & scd.regs[0x32>>1].byte.l) >> 1);
return bufferptr;
}

View File

@ -274,6 +274,10 @@ void m68k_run(unsigned int cycles)
/* Save end cycles count for when CPU is stopped */
m68k.cycle_end = cycles;
#ifdef LOGVDP
error("[%d][%d] m68k run to %d cycles (%x)\n", v_counter, m68k.cycles, cycles, m68k.pc);
#endif
while (m68k.cycles < cycles)
{
/* Set tracing accodring to T1. */

View File

@ -212,12 +212,12 @@ void s68k_update_irq(unsigned int mask)
/* Set IRQ level */
CPU_INT_LEVEL = mask << 8;
/* Check interrupt mask to process IRQ */
m68ki_check_interrupts();
#ifdef LOG_SCD
error("[%d][%d] IRQ Level = %d(0x%02x) (%x)\n", v_counter, s68k.cycles, CPU_INT_LEVEL>>8,FLAG_INT_MASK,s68k.pc);
#endif
/* Check interrupt mask to process IRQ */
m68ki_check_interrupts();
}
void s68k_run(unsigned int cycles)
@ -234,6 +234,9 @@ void s68k_run(unsigned int cycles)
/* Save end cycles count for when CPU is stopped */
s68k.cycle_end = cycles;
#ifdef LOG_SCD
error("[%d][%d] s68k run to %d cycles (%x), irq mask = %x (%x)\n", v_counter, s68k.cycles, cycles, s68k.pc,FLAG_INT_MASK, CPU_INT_LEVEL);
#endif
while (s68k.cycles < cycles)
{

View File

@ -233,6 +233,9 @@ INLINE void m68k_poll_detect(reg)
if (m68k.pc == m68k.poll.pc)
{
/* stop MAIN-CPU until register is modified by SUB-CPU */
#ifdef LOG_SCD
error("m68k stopped from %d cycles\n", m68k.cycles);
#endif
m68k.cycles = m68k.cycle_end;
m68k.stopped = 1 << reg;
}
@ -269,6 +272,9 @@ INLINE void m68k_poll_sync(reg)
/* restart SUB-CPU */
s68k.stopped = 0;
#ifdef LOG_SCD
error("s68k started from %d cycles\n", cycles);
#endif
}
/* clear CPU register(s) access flags */