code formatting

This commit is contained in:
ekeeke31 2009-10-06 08:05:18 +00:00
parent c2c79c0eb3
commit d129e7da94
4 changed files with 1222 additions and 1215 deletions

View File

@ -824,6 +824,10 @@ INLINE void m68k_set_irq(unsigned int int_level)
m68ki_check_interrupts(); /* Level triggered (IRQ) */ m68ki_check_interrupts(); /* Level triggered (IRQ) */
} }
#ifdef LOGVDP
extern uint16 v_counter;
extern void error(char *format, ...);
#endif
extern uint8 irq_status; extern uint8 irq_status;
void m68k_run (int cyc) void m68k_run (int cyc)
@ -846,6 +850,9 @@ void m68k_run (int cyc)
if (irq_status & 0x40) if (irq_status & 0x40)
count_m68k += m68k_execute(); count_m68k += m68k_execute();
#ifdef LOGVDP
error("[%d(%d)][%d(%d)] IRQ Level = %d (%d cycles)(%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488,temp, m68ki_remaining_cycles,m68k_get_reg (NULL, M68K_REG_PC));
#endif
/* interrupt level */ /* interrupt level */
m68k_set_irq(temp); m68k_set_irq(temp);
} }

View File

@ -343,7 +343,7 @@ int system_frame (int do_skip)
/* during this period, any VRAM or VSRAM writes should NOT be taken in account before next line */ /* during this period, any VRAM or VSRAM writes should NOT be taken in account before next line */
/* as a result, line is rendered immediately after HINT and current line is shortened */ /* as a result, line is rendered immediately after HINT and current line is shortened */
/* CRAM and VDP register writes that could occur during HBLANK are handled separately */ /* CRAM and VDP register writes that could occur during HBLANK are handled separately */
/* fix Lotus 1, Lotus 2 RECS, Striker, Skitchin, Zero the Kamikaze Squirell */ /* fix Striker, Zero the Kamikaze Squirell */
if ((line < vdp_height) && (h_counter == 0)) aim_m68k -= 36; if ((line < vdp_height) && (h_counter == 0)) aim_m68k -= 36;
/* update DMA timings */ /* update DMA timings */

View File

@ -292,7 +292,7 @@ void vdp_update_dma()
/* DMA bytes left */ /* DMA bytes left */
int dma_bytes = (left_cycles * rate) / m68cycles_per_line; int dma_bytes = (left_cycles * rate) / m68cycles_per_line;
#ifdef LOGERROR #ifdef LOGVDP
error("[%d(%d)][%d(%d)] DMA type %d (%d access/line)-> %d access (%d remaining) (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488,dma_type, rate, dma_length, dma_bytes, m68k_get_reg (NULL, M68K_REG_PC)); error("[%d(%d)][%d(%d)] DMA type %d (%d access/line)-> %d access (%d remaining) (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488,dma_type, rate, dma_length, dma_bytes, m68k_get_reg (NULL, M68K_REG_PC));
#endif #endif
@ -317,7 +317,7 @@ void vdp_update_dma()
/* 68K is frozen during DMA operation */ /* 68K is frozen during DMA operation */
count_m68k += dma_cycles; count_m68k += dma_cycles;
#ifdef LOGERROR #ifdef LOGVDP
error("-->CPU frozen for %d cycles\n", dma_cycles); error("-->CPU frozen for %d cycles\n", dma_cycles);
#endif #endif
} }
@ -327,7 +327,7 @@ void vdp_update_dma()
/* set DMA end cyles count */ /* set DMA end cyles count */
dma_endCycles = count_m68k + dma_cycles; dma_endCycles = count_m68k + dma_cycles;
#ifdef LOGERROR #ifdef LOGVDP
error("-->DMA ends in %d cycles\n", dma_cycles); error("-->DMA ends in %d cycles\n", dma_cycles);
#endif #endif
@ -451,7 +451,7 @@ unsigned int vdp_ctrl_r(void)
/* clear SPR/SCOL flags */ /* clear SPR/SCOL flags */
status &= 0xFF9F; status &= 0xFF9F;
#ifdef LOGERROR #ifdef LOGVDP
error("[%d(%d)][%d(%d)] VDP status read -> 0x%x (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488, temp, m68k_get_reg (NULL, M68K_REG_PC)); error("[%d(%d)][%d(%d)] VDP status read -> 0x%x (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488, temp, m68k_get_reg (NULL, M68K_REG_PC));
#endif #endif
return (temp); return (temp);
@ -465,7 +465,7 @@ unsigned int vdp_hvc_r(void)
/* interlace mode 2 */ /* interlace mode 2 */
if (im2_flag) vc = (vc << 1) | ((vc >> 7) & 1); if (im2_flag) vc = (vc << 1) | ((vc >> 7) & 1);
#ifdef LOGERROR #ifdef LOGVDP
error("[%d(%d)][%d(%d)] VDP HVC Read -> 0x%04x (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488,(vc << 8) | hc, m68k_get_reg (NULL, M68K_REG_PC)); error("[%d(%d)][%d(%d)] VDP HVC Read -> 0x%04x (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488,(vc << 8) | hc, m68k_get_reg (NULL, M68K_REG_PC));
#endif #endif
return ((vc << 8) | hc); return ((vc << 8) | hc);
@ -530,7 +530,7 @@ unsigned int vdp_data_r(void)
{ {
case 0x00: /* VRAM */ case 0x00: /* VRAM */
temp = *(uint16 *) & vram[(addr & 0xFFFE)]; temp = *(uint16 *) & vram[(addr & 0xFFFE)];
#ifdef LOGERROR #ifdef LOGVDP
error("[%d(%d)][%d(%d)] VRAM 0x%x read -> 0x%x (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488, addr, temp, m68k_get_reg (NULL, M68K_REG_PC)); error("[%d(%d)][%d(%d)] VRAM 0x%x read -> 0x%x (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488, addr, temp, m68k_get_reg (NULL, M68K_REG_PC));
#endif #endif
break; break;
@ -538,14 +538,14 @@ unsigned int vdp_data_r(void)
case 0x08: /* CRAM */ case 0x08: /* CRAM */
temp = *(uint16 *) & cram[(addr & 0x7E)]; temp = *(uint16 *) & cram[(addr & 0x7E)];
temp = UNPACK_CRAM (temp); temp = UNPACK_CRAM (temp);
#ifdef LOGERROR #ifdef LOGVDP
error("[%d(%d)][%d(%d)] CRAM 0x%x read -> 0x%x (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488, addr, temp, m68k_get_reg (NULL, M68K_REG_PC)); error("[%d(%d)][%d(%d)] CRAM 0x%x read -> 0x%x (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488, addr, temp, m68k_get_reg (NULL, M68K_REG_PC));
#endif #endif
break; break;
case 0x04: /* VSRAM */ case 0x04: /* VSRAM */
temp = *(uint16 *) & vsram[(addr & 0x7E)]; temp = *(uint16 *) & vsram[(addr & 0x7E)];
#ifdef LOGERROR #ifdef LOGVDP
error("[%d(%d)][%d(%d)] VSRAM 0x%x read -> 0x%x (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488, addr, temp, m68k_get_reg (NULL, M68K_REG_PC)); error("[%d(%d)][%d(%d)] VSRAM 0x%x read -> 0x%x (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488, addr, temp, m68k_get_reg (NULL, M68K_REG_PC));
#endif #endif
break; break;
@ -564,7 +564,7 @@ unsigned int vdp_data_r(void)
int vdp_int_ack_callback(int int_level) int vdp_int_ack_callback(int int_level)
{ {
#ifdef LOGERROR #ifdef LOGVDP
error("[%d(%d)][%d(%d)] INT Level %d ack (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488,int_level, m68k_get_reg (NULL, M68K_REG_PC)); error("[%d(%d)][%d(%d)] INT Level %d ack (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488,int_level, m68k_get_reg (NULL, M68K_REG_PC));
#endif #endif
@ -573,14 +573,14 @@ int vdp_int_ack_callback(int int_level)
{ {
vint_pending = 0; vint_pending = 0;
status &= ~0x80; /* clear VINT flag */ status &= ~0x80; /* clear VINT flag */
#ifdef LOGERROR #ifdef LOGVDP
error("---> VINT cleared\n"); error("---> VINT cleared\n");
#endif #endif
} }
else else
{ {
hint_pending = 0; hint_pending = 0;
#ifdef LOGERROR #ifdef LOGVDP
error("---> HINT cleared\n"); error("---> HINT cleared\n");
#endif #endif
} }
@ -622,7 +622,7 @@ static inline void data_w(unsigned int data)
{ {
case 0x01: /* VRAM */ case 0x01: /* VRAM */
#ifdef LOGERROR #ifdef LOGVDP
error("[%d(%d)][%d(%d)] VRAM 0x%x write -> 0x%x (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488, addr, data, m68k_get_reg (NULL, M68K_REG_PC)); error("[%d(%d)][%d(%d)] VRAM 0x%x write -> 0x%x (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488, addr, data, m68k_get_reg (NULL, M68K_REG_PC));
#endif #endif
@ -649,7 +649,7 @@ static inline void data_w(unsigned int data)
case 0x03: /* CRAM */ case 0x03: /* CRAM */
{ {
#ifdef LOGERROR #ifdef LOGVDP
error("[%d(%d)][%d(%d)] CRAM 0x%x write -> 0x%x (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488, addr, data, m68k_get_reg (NULL, M68K_REG_PC)); error("[%d(%d)][%d(%d)] CRAM 0x%x write -> 0x%x (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488, addr, data, m68k_get_reg (NULL, M68K_REG_PC));
#endif #endif
uint16 *p = (uint16 *) &cram[(addr & 0x7E)]; uint16 *p = (uint16 *) &cram[(addr & 0x7E)];
@ -666,11 +666,11 @@ static inline void data_w(unsigned int data)
{ {
/* remap current line (Striker) */ /* remap current line (Striker) */
remap_buffer(v_counter,bitmap.viewport.w + 2*bitmap.viewport.x); remap_buffer(v_counter,bitmap.viewport.w + 2*bitmap.viewport.x);
#ifdef LOGERROR #ifdef LOGVDP
error("Line remapped\n"); error("Line remapped\n");
#endif #endif
} }
#ifdef LOGERROR #ifdef LOGVDP
else error("Line NOT remapped\n"); else error("Line NOT remapped\n");
#endif #endif
} }
@ -678,7 +678,7 @@ static inline void data_w(unsigned int data)
} }
case 0x05: /* VSRAM */ case 0x05: /* VSRAM */
#ifdef LOGERROR #ifdef LOGVDP
error("[%d(%d)][%d(%d)] VSRAM 0x%x write -> 0x%x (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488, addr, data, m68k_get_reg (NULL, M68K_REG_PC)); error("[%d(%d)][%d(%d)] VSRAM 0x%x write -> 0x%x (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488, addr, data, m68k_get_reg (NULL, M68K_REG_PC));
#endif #endif
*(uint16 *) &vsram[(addr & 0x7E)] = data; *(uint16 *) &vsram[(addr & 0x7E)] = data;
@ -695,7 +695,7 @@ static inline void data_w(unsigned int data)
*/ */
static inline void reg_w(unsigned int r, unsigned int d) static inline void reg_w(unsigned int r, unsigned int d)
{ {
#ifdef LOGERROR #ifdef LOGVDP
error("[%d(%d)][%d(%d)] VDP register %d write -> 0x%x (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488, r, d, m68k_get_reg (NULL, M68K_REG_PC)); error("[%d(%d)][%d(%d)] VDP register %d write -> 0x%x (%x)\n", v_counter, count_m68k/488, count_m68k, count_m68k%488, r, d, m68k_get_reg (NULL, M68K_REG_PC));
#endif #endif
@ -770,11 +770,11 @@ static inline void reg_w(unsigned int r, unsigned int d)
*/ */
reg[1] = d; reg[1] = d;
render_line(v_counter, 0); render_line(v_counter, 0);
#ifdef LOGERROR #ifdef LOGVDP
error("Line redrawn\n"); error("Line redrawn\n");
#endif #endif
} }
#ifdef LOGERROR #ifdef LOGVDP
else else
error("Line NOT redrawn\n"); error("Line NOT redrawn\n");
#endif #endif
@ -823,11 +823,11 @@ static inline void reg_w(unsigned int r, unsigned int d)
/* remap entire line (see Road Rash I,II,III) */ /* remap entire line (see Road Rash I,II,III) */
reg[7] = d; reg[7] = d;
remap_buffer(v_counter,bitmap.viewport.w + 2*bitmap.viewport.x); remap_buffer(v_counter,bitmap.viewport.w + 2*bitmap.viewport.x);
#ifdef LOGERROR #ifdef LOGVDP
error("--> Line remapped\n"); error("--> Line remapped\n");
#endif #endif
} }
#ifdef LOGERROR #ifdef LOGVDP
else else
error("--> Line NOT remapped\n"); error("--> Line NOT remapped\n");
#endif #endif

File diff suppressed because it is too large Load Diff