X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2Fcd%2FPico.c;h=013340cc884f692246193f62d6a9054f31d0e56f;hb=bf098bc53228f6b5016cb4a6126f4466bfba4e00;hp=d98795603a9dda94c3934fb2dd758d3524d2e721;hpb=672ad671130bb662f099b790fdaef4be85e6c146;p=picodrive.git diff --git a/Pico/cd/Pico.c b/Pico/cd/Pico.c index d987956..013340c 100644 --- a/Pico/cd/Pico.c +++ b/Pico/cd/Pico.c @@ -64,9 +64,22 @@ static __inline void SekRunS68k(int cyc) #endif } -// TODO: tidy -extern unsigned char m68k_regs[0x40]; -extern unsigned char s68k_regs[0x200]; +static int Status_CDC; + +static __inline void check_cd_dma(void) +{ + int ddx; + + if (!(Status_CDC & 0x08)) return; + + ddx = Pico_mcd->s68k_regs[4] & 7; + if (ddx < 2) return; // invalid + if (ddx < 4) Pico_mcd->s68k_regs[4] |= 0x40; // Data set ready in host port + if (ddx == 6) return; // invalid + + Update_CDC_TRansfer(ddx); // now go and do the actual transfer +} + // Accurate but slower frame which does hints static int PicoFrameHintsMCD(void) @@ -115,6 +128,8 @@ static int PicoFrameHintsMCD(void) if(Pico.m.padDelay[1]++ > 25) Pico.m.padTHPhase[1]=0; } + check_cd_dma(); + // H-Interrupts: if(y <= lines_vis && --hint < 0) // y <= lines_vis: Comix Zone, Golden Axe {