X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2Fcd%2Fcd_sys.c;h=833680b1bc81d4972e7723540e7f440119df15dc;hb=bf098bc53228f6b5016cb4a6126f4466bfba4e00;hp=72d6c0eda38022db5b082f4f3c6b7437f9b0ac16;hpb=cc68a136aa179a5f32fe40208371eb9c2b0aadae;p=picodrive.git diff --git a/Pico/cd/cd_sys.c b/Pico/cd/cd_sys.c index 72d6c0e..833680b 100644 --- a/Pico/cd/cd_sys.c +++ b/Pico/cd/cd_sys.c @@ -1,6 +1,6 @@ #include #include "cd_sys.h" -//#include "cd_file.h" +#include "cd_file.h" #include "../PicoInt.h" @@ -15,18 +15,6 @@ #define FAST_REV 0x10300 // FAST REVERSE track CDD status #define PLAYING 0x0100 // PLAYING audio track CDD status -/* -#include "gens.h" -#include "G_dsound.h" -#include "cdda_mp3.h" -#include "lc89510.h" -#include "Star_68k.h" -#include "Mem_M68K.h" -#include "Mem_S68K.h" -#include "save.h" -#include "misc.h" -*/ - /* int CDDA_Enable; @@ -45,8 +33,6 @@ static int CDD_Complete; static int File_Add_Delay = 0; -//_scd SCD; - #define CHECK_TRAY_OPEN \ @@ -191,9 +177,7 @@ void Check_CD_Command(void) if (File_Add_Delay == 0) { -#if 0 // TODO FILE_Read_One_LBA_CDC(); -#endif } else File_Add_Delay--; } @@ -215,9 +199,7 @@ void Check_CD_Command(void) int Init_CD_Driver(void) { -#if 0 // TODO FILE_Init(); -#endif return 0; } @@ -225,9 +207,7 @@ int Init_CD_Driver(void) void End_CD_Driver(void) { -#if 0 // TODO FILE_End(); -#endif } @@ -240,33 +220,29 @@ void Reset_CD(void) } -int Insert_CD(char *buf, char *iso_name) +int Insert_CD(char *iso_name, int is_bin) { + int ret = 0; + // memset(CD_Audio_Buffer_L, 0, 4096 * 4); // memset(CD_Audio_Buffer_R, 0, 4096 * 4); - if (iso_name == NULL) - { - CD_Present = 0; - } - else + CD_Present = 0; + + if (iso_name != NULL) { -#if 0 // TODO - Load_ISO(buf, iso_name); - CD_Present = 1; -#endif - return 0; + ret = Load_ISO(iso_name, is_bin); + if (ret == 0) + CD_Present = 1; } - return 0; + return ret; } void Stop_CD(void) { -#if 0 // TODO Unload_ISO(); -#endif CD_Present = 0; } @@ -436,7 +412,7 @@ int Get_Total_Lenght_CDD_c23(void) Pico_mcd->cdd.Ext = 0; // FIXME: remove -Pico_mcd->cdd.Seconde = 2; +//Pico_mcd->cdd.Seconde = 2; CDD_Complete = 1; @@ -462,7 +438,7 @@ int Get_First_Last_Track_CDD_c24(void) Pico_mcd->cdd.Ext = 0; // FIXME: remove -Pico_mcd->cdd.Minute = Pico_mcd->cdd.Seconde = 1; +//Pico_mcd->cdd.Minute = Pico_mcd->cdd.Seconde = 1; CDD_Complete = 1; @@ -546,9 +522,7 @@ int Play_CDD_c3(void) { Pico_mcd->s68k_regs[0x36] &= ~0x01; // AUDIO //CD_Audio_Starting = 1; -#if 0 // TODO FILE_Play_CD_LBA(); -#endif } if (Pico_mcd->scd.Cur_Track == 100) Pico_mcd->cdd.Minute = 0x0A02; @@ -651,9 +625,7 @@ int Resume_CDD_c7(void) { Pico_mcd->s68k_regs[0x36] &= ~0x01; // AUDIO //CD_Audio_Starting = 1; -#if 0 // TODO FILE_Play_CD_LBA(); -#endif } if (Pico_mcd->scd.Cur_Track == 100) Pico_mcd->cdd.Minute = 0x0A02; @@ -669,7 +641,7 @@ int Resume_CDD_c7(void) } -int Fast_Foward_CDD_c8(void) +int Fast_Foward_CDD_c8(void) { CHECK_TRAY_OPEN CHECK_CD_PRESENT @@ -690,7 +662,7 @@ int Fast_Foward_CDD_c8(void) } -int Fast_Rewind_CDD_c9(void) +int Fast_Rewind_CDD_c9(void) { CHECK_TRAY_OPEN CHECK_CD_PRESENT @@ -751,9 +723,7 @@ int Open_Tray_CDD_cD(void) Pico_mcd->scd.Status_CDC &= ~1; // Stop CDC read -#if 0 // TODO Unload_ISO(); -#endif CD_Present = 0; Pico_mcd->scd.Status_CDD = TRAY_OPEN;