UIQ3 update, some makefile unification, rm old configs, stuff
[picodrive.git] / Pico / cd / buffering.c
index ad8b355..e0e888d 100644 (file)
@@ -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
        {