cd: switch to CD controller code from genplus
[picodrive.git] / pico / cd / buffering.c
index dbf7b28..8420336 100644 (file)
@@ -1,7 +1,13 @@
-// Buffering handling
-// (c) Copyright 2007, Grazvydas "notaz" Ignotas
+/*
+ * Buffering handling
+ * (C) notaz, 2007,2008
+ *
+ * This work is licensed under the terms of MAME license.
+ * See COPYING file in the top-level directory.
+ */
 
 #include "../pico_int.h"
+#include "../cd/cue.h"
 
 int PicoCDBuffers = 0;
 static unsigned char *cd_buffer = NULL;
@@ -9,6 +15,8 @@ static int prev_lba = 0x80000000;
 
 static int hits, reads;
 
+#undef dprintf
+#define dprintf(...)
 
 void PicoCDBufferInit(void)
 {
@@ -59,7 +67,7 @@ PICO_INTERNAL void PicoCDBufferRead(void *dest, int lba)
        int is_bin, offs, read_len, moved = 0;
        reads++;
 
-       is_bin = Pico_mcd->TOC.Tracks[0].ftype == TYPE_BIN;
+       is_bin = Pico_mcd->TOC.Tracks[0].ftype == CT_BIN;
 
        if (PicoCDBuffers <= 0)
        {
@@ -109,7 +117,7 @@ PICO_INTERNAL void PicoCDBufferRead(void *dest, int lba)
        if (is_bin)
        {
                int i = 0;
-#if REDUCE_IO_CALLS
+#ifdef _PSP_FW_VERSION
                int bufs = (read_len*2048) / (2048+304);
                pm_read(cd_buffer, bufs*(2048+304), Pico_mcd->TOC.Tracks[0].F);
                for (i = 1; i < bufs; i++)