X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fcd%2Fpico.c;h=8b65f4fadb9ce4b8dcb80c05eaa89b49b61021c3;hb=c987bb5c36d92c1441e4dcfd9bded3e5dc1f1ff6;hp=33899e494423f02c6518feabce7c51305a74bea1;hpb=1cfc5cc4ce06642b9bc45ca3b9d32793718e9455;p=picodrive.git diff --git a/pico/cd/pico.c b/pico/cd/pico.c index 33899e4..8b65f4f 100644 --- a/pico/cd/pico.c +++ b/pico/cd/pico.c @@ -8,7 +8,7 @@ extern unsigned char formatted_bram[4*0x10]; extern unsigned int s68k_poll_adclk; void (*PicoMCDopenTray)(void) = NULL; -int (*PicoMCDcloseTray)(void) = NULL; +void (*PicoMCDcloseTray)(void) = NULL; PICO_INTERNAL void PicoInitMCD(void) @@ -45,13 +45,12 @@ PICO_INTERNAL int PicoResetMCD(void) Reset_CD(); LC89510_Reset(); gfx_cd_reset(); - PicoMemResetCD(1); #ifdef _ASM_CD_MEMORY_C //PicoMemResetCDdecode(1); // don't have to call this in 2M mode #endif // use SRam.data for RAM cart - if (PicoOpt&POPT_EN_MCD_RAMCART) { + if (PicoOpt & POPT_EN_MCD_RAMCART) { if (SRam.data == NULL) SRam.data = calloc(1, 0x12000); } @@ -208,33 +207,20 @@ static __inline void update_chips(void) // update gfx chip if (Pico_mcd->rot_comp.Reg_58 & 0x8000) gfx_cd_update(); - - // delayed setting of DMNA bit (needed for Silpheed) - if (Pico_mcd->m.state_flags & 2) { - Pico_mcd->m.state_flags &= ~2; - if (!(Pico_mcd->s68k_regs[3] & 4)) { - Pico_mcd->s68k_regs[3] |= 2; - Pico_mcd->s68k_regs[3] &= ~1; -#ifdef USE_POLL_DETECT - if ((s68k_poll_adclk&0xfe) == 2) { - SekSetStopS68k(0); s68k_poll_adclk = 0; - } -#endif - } - } -} - - -static __inline void getSamples(int y) -{ - int len = PsndRender(0, PsndLen); - if (PicoWriteSound) PicoWriteSound(len); - // clear sound buffer - PsndClear(); } #define PICO_CD +#define CPUS_RUN(m68k_cycles,s68k_cycles) \ +{ \ + if ((PicoOpt&POPT_EN_MCD_PSYNC) && (Pico_mcd->m.busreq&3) == 1) { \ + SekRunPS(m68k_cycles, s68k_cycles); /* "better/perfect sync" */ \ + } else { \ + SekRunM68k(m68k_cycles); \ + if ((Pico_mcd->m.busreq&3) == 1) /* no busreq/no reset */ \ + SekRunS68k(s68k_cycles); \ + } \ +} #include "../pico_cmn.c"