X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2Fcd%2Fbuffering.c;h=e0e888db7190cccd4f45b67e6d3616cef550736c;hb=02ba8788a0a15cd76fefc777908738cc27e78e6c;hp=ad8b355dfff77a8614c3a8f057d30abf9f0b662c;hpb=b542be4686241c9e0722ff8e452980f9ac2b4d7c;p=picodrive.git diff --git a/Pico/cd/buffering.c b/Pico/cd/buffering.c index ad8b355..e0e888d 100644 --- a/Pico/cd/buffering.c +++ b/Pico/cd/buffering.c @@ -12,7 +12,7 @@ static int hits, reads; void PicoCDBufferInit(void) { - void *tmp; + void *tmp = NULL; prev_lba = 0x80000000; hits = reads = 0; @@ -43,11 +43,17 @@ void PicoCDBufferFree(void) cd_buffer = NULL; } if (reads) - printf("CD buffer hits: %i/%i (%i%%)\n", hits, reads, hits * 100 / reads); + elprintf(EL_STATUS, "CD buffer hits: %i/%i (%i%%)\n", hits, reads, hits * 100 / reads); } -/* this is a try to fight slow SD access of GP2X */ +void PicoCDBufferFlush(void) +{ + prev_lba = 0x80000000; +} + + +/* this is was a try to fight slow SD access of GP2X */ PICO_INTERNAL void PicoCDBufferRead(void *dest, int lba) { int is_bin, offs, read_len, moved = 0; @@ -80,7 +86,6 @@ PICO_INTERNAL void PicoCDBufferRead(void *dest, int lba) dprintf("CD buffer seek %i -> %i\n", prev_lba, lba); pm_seek(Pico_mcd->TOC.Tracks[0].F, where_seek, SEEK_SET); } -else if (prev_lba == 0x80000000) printf("wtf?\n"); dprintf("CD buffer miss %i -> %i\n", prev_lba, lba); @@ -90,7 +95,6 @@ else if (prev_lba == 0x80000000) printf("wtf?\n"); dprintf("CD buffer move=%i, read_len=%i", PicoCDBuffers - read_len, read_len); memmove(cd_buffer + read_len*2048, cd_buffer, (PicoCDBuffers - read_len)*2048); moved = 1; -if (prev_lba == 0x80000000) printf("wtf?\n"); } else {