diff --git a/cmake/SelectPcsx2Plugins.cmake b/cmake/SelectPcsx2Plugins.cmake index 4ebd286d61..a4883dda53 100644 --- a/cmake/SelectPcsx2Plugins.cmake +++ b/cmake/SelectPcsx2Plugins.cmake @@ -292,7 +292,6 @@ endif() set(CDVDisoEFP FALSE) set(CDVDpeops FALSE) set(CDVDlinuz FALSE) # used to be compiled on linux -set(CDVDiso FALSE) # used to be compiled on linux # [TODO] Write CMakeLists.txt for these plugins. (or not ;) ) set(PeopsSPU2 FALSE) diff --git a/old_plugins.sln b/old_plugins.sln index 386bbcccc1..be29442c37 100644 --- a/old_plugins.sln +++ b/old_plugins.sln @@ -32,8 +32,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wx", "wx", "{62BF822E-6A12- EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZeroGS", "plugins\zerogs\dx\Windows\zerogs.vcxproj", "{5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CDVDiso", "plugins\CDVDiso\src\Windows\CDVDiso.vcxproj", "{5F78E90B-BD22-47B1-9CA5-7A80F4DF5EF3}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundTouch", "3rdparty\soundtouch\SoundTouch.vcxproj", "{E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "3rdparty\zlib\zlib.vcxproj", "{2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}" @@ -79,15 +77,6 @@ Global {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Release|Win32.ActiveCfg = Release|Win32 {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Release|Win32.Build.0 = Release|Win32 {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Release|x64.ActiveCfg = Release|Win32 - {5F78E90B-BD22-47B1-9CA5-7A80F4DF5EF3}.Debug|Win32.ActiveCfg = Debug|Win32 - {5F78E90B-BD22-47B1-9CA5-7A80F4DF5EF3}.Debug|Win32.Build.0 = Debug|Win32 - {5F78E90B-BD22-47B1-9CA5-7A80F4DF5EF3}.Debug|x64.ActiveCfg = Debug|Win32 - {5F78E90B-BD22-47B1-9CA5-7A80F4DF5EF3}.Devel|Win32.ActiveCfg = Devel|Win32 - {5F78E90B-BD22-47B1-9CA5-7A80F4DF5EF3}.Devel|Win32.Build.0 = Devel|Win32 - {5F78E90B-BD22-47B1-9CA5-7A80F4DF5EF3}.Devel|x64.ActiveCfg = Devel|Win32 - {5F78E90B-BD22-47B1-9CA5-7A80F4DF5EF3}.Release|Win32.ActiveCfg = Release|Win32 - {5F78E90B-BD22-47B1-9CA5-7A80F4DF5EF3}.Release|Win32.Build.0 = Release|Win32 - {5F78E90B-BD22-47B1-9CA5-7A80F4DF5EF3}.Release|x64.ActiveCfg = Release|Win32 {E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}.Debug|Win32.ActiveCfg = Debug|Win32 {E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}.Debug|Win32.Build.0 = Debug|Win32 {E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}.Debug|x64.ActiveCfg = Debug|x64 @@ -228,7 +217,6 @@ Global {0FADC26C-0E9D-4DD7-84B1-BF4F7754E90C} = {88F517F9-CE1C-4005-9BDF-4481FEB55053} {62BF822E-6A12-49A8-BE8C-C55A9BCA24DA} = {0FADC26C-0E9D-4DD7-84B1-BF4F7754E90C} {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8} = {703FD00B-D7A0-41E3-BD03-CEC86B385DAF} - {5F78E90B-BD22-47B1-9CA5-7A80F4DF5EF3} = {703FD00B-D7A0-41E3-BD03-CEC86B385DAF} {E9B51944-7E6D-4BCD-83F2-7BBD5A46182D} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {F4EB4AB2-C595-4B05-8BC0-059024BC796C} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} diff --git a/plugins/CDVDiso/ReadMe.txt b/plugins/CDVDiso/ReadMe.txt deleted file mode 100644 index 6287d13bf1..0000000000 --- a/plugins/CDVDiso/ReadMe.txt +++ /dev/null @@ -1,78 +0,0 @@ -CDVDiso v0.5 ------------- - - This is an extension to use with play station2 emulators - as PCSX2 (only one right now). - The plugin is free open source code. - -Linux requeriments: ------------------- - You need the GTK library, compiled with GTK v1.2.5, - the Zlib library (v1.1.3) and the bz2 library (v1.0.0). - -Usage: ------ - Place the file "libCDVDiso.so" (linux) or "CDVDiso.dll" (win32) at the Plugin - directory of the Emulator to use it. - - Linux only: Also place the cfgCDVDiso file at your $HOME directory or at the - Emulator directory. - -Configuration: -------------- - You can either write the iso you want to use in the config dialog, or everytime - you run the emu open it, if you're doing this don't write anything in the dialog. - -Creating an iso (linux only): ---------------- - To create an iso you can use the buttons 'Create Iso' or 'Create Compressed Iso', - the file will be the one in the Iso Edit, and the Cdrom Device is the cdrom that - will be used as source. - The compression method is specified by the Compression Method Combo. - - Note: This will fail if the file in the Iso Edit already exists (if it's - compressed the .Z or .bz suffix will be added). - -Compressed isos: ---------------- - You must create them by the Compress Iso button, this will create a .Z or .bz - file (the compressed image) and a .Z.table or .bz.index file (this is a table, - for speed reasons), both will be created in the same dir the selected iso - image, the original image will not be deleted and/or changed, and also you can - decompress the compressed iso with Decompress Iso button. - The compression method is specified by the Compression Method Combo. - - Note: you only can decompress the images with the Decompress button, not with - compress or bzip2. - -Compression Method: ------------------- - .Z - compress faster: this will compress faster, but not as good as the .bz. - .bz - compress better: will compress better, but slower. - -Changes: -------- - v0.5: - * Added block dumping code - * Added BZ2/Z2 format ;) - * Added optimaze asm code of zlib with vsnet2003 only. Compression / Uncompression should be faster now (shadow) - * Added Vsnet2005 beta1 project files + amd64 asm optimaze code for zlib (shadow) - - v0.4: - * Rewrote mostly ;) - * .bz is still unsupported - - v0.3: - * Better Iso detection, thx florin :) - * Updated to PS2Edefs v0.4.5 - - v0.2: - * Added support for isos using 2048 blocksize - * Nero images are supported - * Better extension filtering - - v0.1: - * First Release - * Tested with Pcsx2 - - Email: diff --git a/plugins/CDVDiso/src/CDVDiso.h b/plugins/CDVDiso/src/CDVDiso.h deleted file mode 100644 index 5c99462070..0000000000 --- a/plugins/CDVDiso/src/CDVDiso.h +++ /dev/null @@ -1,159 +0,0 @@ -/* CDVDiso - * Copyright (C) 2002-2004 CDVDiso Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __CDVDISO_H__ -#define __CDVDISO_H__ - -#ifdef _MSC_VER -#pragma warning(disable : 4018) -#endif - -#include "PS2Edefs.h" -#include "libiso.h" - -#ifdef __cplusplus - -#ifdef _MSC_VER -#define EXPORT_C_(type) extern "C" __declspec(dllexport) type CALLBACK -#else -#define EXPORT_C_(type) extern "C" __attribute__((stdcall, externally_visible, visibility("default"))) type -#endif - -#else - -#ifdef _MSC_VER -#define EXPORT_C_(type) __declspec(dllexport) type __stdcall -#else -#define EXPORT_C_(type) __attribute__((stdcall, externally_visible, visibility("default"))) type -#endif - -#endif - -EXPORT_C_(u32) -PS2EgetLibType(); -EXPORT_C_(u32) -PS2EgetLibVersion2(u32 type); -EXPORT_C_(char *) -PS2EgetLibName(); - - -EXPORT_C_(s32) -CDVDinit(); -EXPORT_C_(s32) -CDVDopen(const char *pTitleFilename); -EXPORT_C_(void) -CDVDclose(); -EXPORT_C_(void) -CDVDshutdown(); -EXPORT_C_(s32) -CDVDreadTrack(u32 lsn, int mode); - -// return can be NULL (for async modes) -EXPORT_C_(u8 *) -CDVDgetBuffer(); - -EXPORT_C_(s32) -CDVDreadSubQ(u32 lsn, cdvdSubQ *subq); //read subq from disc (only cds have subq data) -EXPORT_C_(s32) -CDVDgetTN(cdvdTN *Buffer); //disk information -EXPORT_C_(s32) -CDVDgetTD(u8 Track, cdvdTD *Buffer); //track info: min,sec,frame,type -EXPORT_C_(s32) -CDVDgetTOC(void *toc); //gets ps2 style toc from disc -EXPORT_C_(s32) -CDVDgetDiskType(); //CDVD_TYPE_xxxx -EXPORT_C_(s32) -CDVDgetTrayStatus(); //CDVD_TRAY_xxxx -EXPORT_C_(s32) -CDVDctrlTrayOpen(); //open disc tray -EXPORT_C_(s32) -CDVDctrlTrayClose(); //close disc tray - -// extended funcs - -EXPORT_C_(void) -CDVDconfigure(); -EXPORT_C_(void) -CDVDabout(); -EXPORT_C_(s32) -CDVDtest(); -EXPORT_C_(void) -CDVDnewDiskCB(void (*callback)()); - -#define CDVD_LOG __Log -extern FILE *cdvdLog; - -void __Log(char *fmt, ...); - -#define VERBOSE 1 - -#define DEV_DEF "" -#define CDDEV_DEF "/dev/cdrom" - -typedef struct -{ - int slsn; - int elsn; -#ifdef _WINDOWS_ - HANDLE handle; -#else - FILE *handle; -#endif -} _cdIso; - -extern _cdIso cdIso[8]; - -#define CD_FRAMESIZE_RAW 2352 -#define DATA_SIZE (CD_FRAMESIZE_RAW - 12) - -#define itob(i) ((i) / 10 * 16 + (i) % 10) /* u_char to BCD */ -#define btoi(b) ((b) / 16 * 10 + (b) % 16) /* BCD to u_char */ - -#define MSF2SECT(m, s, f) (((m)*60 + (s)-2) * 75 + (f)) - -extern const u8 version; -extern const u8 revision; -extern const u8 build; - -extern char IsoFile[256]; -extern char IsoCWD[256]; -extern char CdDev[256]; - -extern int BlockDump; -extern isoFile *fdump; -extern isoFile *iso; - -extern u8 cdbuffer[]; -extern u8 *pbuffer; -extern int cdblocksize; -extern int cdblockofs; -extern int cdoffset; -extern int cdtype; -extern int cdblocks; - -extern int Zmode; // 1 Z - 2 bz2 -extern int fmode; // 0 - file / 1 - Zfile -extern char *Ztable; - -extern char *methods[]; - -void UpdateZmode(); -void CfgOpenFile(); -void SysMessage(char *fmt, ...); - -#endif diff --git a/plugins/CDVDiso/src/CDVDisop.cpp b/plugins/CDVDiso/src/CDVDisop.cpp deleted file mode 100644 index a65488e655..0000000000 --- a/plugins/CDVDiso/src/CDVDisop.cpp +++ /dev/null @@ -1,557 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#include "CDVDiso.h" -#include "Config.h" - -#ifndef MAX_PATH -#define MAX_PATH 255 -#endif - -char IsoFile[256]; -char IsoCWD[256]; -char CdDev[256]; - -_cdIso cdIso[8]; -u8 *pbuffer; -int cdblocksize; -int cdblockofs; -int cdoffset; -int cdtype; -int cdblocks; - -int Zmode; // 1 Z - 2 bz2 -int fmode; // 0 - file / 1 - Zfile -char *Ztable; - -int BlockDump; -isoFile *fdump; -isoFile *iso; - -FILE *cdvdLog = NULL; - -// This var is used to detect resume-style behavior of the Pcsx2 emulator, -// and skip prompting the user for a new CD when it's likely they want to run the existing one. -static char cdvdCurrentIso[MAX_PATH]; - -char *methods[] = - { - ".Z - compress faster", - ".BZ - compress better", - NULL}; - -#ifdef PCSX2_DEBUG -char *LibName = "Linuz Iso CDVD (Debug) "; -#else -char *LibName = "Linuz Iso CDVD "; -#endif - -const u8 version = PS2E_CDVD_VERSION; -const u8 revision = 0; -const u8 build = 9; - -u8 cdbuffer[CD_FRAMESIZE_RAW * 10] = {0}; - -s32 msf_to_lba(u8 m, u8 s, u8 f) -{ - u32 lsn; - lsn = f; - lsn += (s - 2) * 75; - lsn += m * 75 * 60; - return lsn; -} - -void lba_to_msf(s32 lba, u8 *m, u8 *s, u8 *f) -{ - lba += 150; - *m = lba / (60 * 75); - *s = (lba / 75) % 60; - *f = lba % 75; -} - -#define btoi(b) ((b) / 16 * 10 + (b) % 16) /* BCD to u_char */ -#define itob(i) ((i) / 10 * 16 + (i) % 10) /* u_char to BCD */ - - -EXPORT_C_(char *) -PS2EgetLibName() -{ - return LibName; -} - -EXPORT_C_(u32) -PS2EgetLibType() -{ - return PS2E_LT_CDVD; -} - -EXPORT_C_(u32) -PS2EgetLibVersion2(u32 type) -{ - return (version << 16) | (revision << 8) | build; -} - -#ifdef PCSX2_DEBUG -void __Log(char *fmt, ...) -{ - va_list list; - - if (cdvdLog == NULL) - return; - - va_start(list, fmt); - vfprintf(cdvdLog, fmt, list); - va_end(list); -} -#else -#define __Log 0 && -#endif - - -EXPORT_C_(s32) -CDVDinit() -{ -#ifdef PCSX2_DEBUG - cdvdLog = fopen("logs/cdvdLog.txt", "w"); - if (cdvdLog == NULL) { - cdvdLog = fopen("cdvdLog.txt", "w"); - if (cdvdLog == NULL) { - SysMessage("Can't create cdvdLog.txt"); - return -1; - } - } - setvbuf(cdvdLog, NULL, _IONBF, 0); - CDVD_LOG("CDVDinit\n"); -#endif - - cdvdCurrentIso[0] = 0; - memset(cdIso, 0, sizeof(cdIso)); - return 0; -} - -EXPORT_C_(void) -CDVDshutdown() -{ - cdvdCurrentIso[0] = 0; -#ifdef CDVD_LOG - if (cdvdLog != NULL) - fclose(cdvdLog); -#endif -} - -EXPORT_C_(s32) -CDVDopen(const char *pTitle) -{ - LoadConf(); - - if (pTitle != NULL) - strcpy(IsoFile, pTitle); - - if (*IsoFile == 0) - strcpy(IsoFile, cdvdCurrentIso); - - if (*IsoFile == 0) { - char temp[256]; - - CfgOpenFile(); - - if (IsoFile[0] == 0) { - // user pressed CANCEL - return 1; - } - - strcpy(temp, IsoFile); - *IsoFile = 0; - SaveConf(); - strcpy(IsoFile, temp); - } - - iso = isoOpen(IsoFile); - if (iso == NULL) { - SysMessage("Error loading %s\nMake sure the iso file is not mounted in any disk emulation software!", IsoFile); - return -1; - } - - if (iso->type == ISOTYPE_DVD) - cdtype = CDVD_TYPE_PS2DVD; - else if (iso->type == ISOTYPE_AUDIO) - cdtype = CDVD_TYPE_CDDA; - else - cdtype = CDVD_TYPE_PS2CD; - - if (BlockDump) { - char fname_only[MAX_PATH]; - -#ifdef _WIN32 - char fname[MAX_PATH], ext[MAX_PATH]; - _splitpath(IsoFile, NULL, NULL, fname, ext); - _makepath(fname_only, NULL, NULL, fname, NULL); -#else - char *p, *plast; - - plast = p = strchr(IsoFile, '/'); - while (p != NULL) { - plast = p; - p = strchr(p + 1, '/'); - } - - // Lets not create dumps in the plugin directory. - strcpy(fname_only, "../"); - if (plast != NULL) - strcat(fname_only, plast + 1); - else - strcat(fname_only, IsoFile); - - plast = p = strchr(fname_only, '.'); - - while (p != NULL) { - plast = p; - p = strchr(p + 1, '.'); - } - - if (plast != NULL) - *plast = 0; - -#endif - strcat(fname_only, ".dump"); - fdump = isoCreate(fname_only, ISOFLAGS_BLOCKDUMP); - if (fdump) - isoSetFormat(fdump, iso->blockofs, iso->blocksize, iso->blocks); - } else { - fdump = NULL; - } - - return 0; -} - -EXPORT_C_(void) -CDVDclose() -{ - if (!iso) - return; - - strcpy(cdvdCurrentIso, IsoFile); - - isoClose(iso); - if (fdump != NULL) - isoClose(fdump); -} - -EXPORT_C_(s32) -CDVDreadSubQ(u32 lsn, cdvdSubQ *subq) -{ - if (!iso) - return -1; - - // fake it - u8 min, sec, frm; - subq->ctrl = 4; - subq->mode = 1; - subq->trackNum = itob(1); - subq->trackIndex = itob(1); - - lba_to_msf(lsn, &min, &sec, &frm); - subq->trackM = itob(min); - subq->trackS = itob(sec); - subq->trackF = itob(frm); - - subq->pad = 0; - - lba_to_msf(lsn + (2 * 75), &min, &sec, &frm); - subq->discM = itob(min); - subq->discS = itob(sec); - subq->discF = itob(frm); - return 0; -} - -EXPORT_C_(s32) -CDVDgetTN(cdvdTN *Buffer) -{ - Buffer->strack = 1; - Buffer->etrack = 1; - - return 0; -} - -EXPORT_C_(s32) -CDVDgetTD(u8 Track, cdvdTD *Buffer) -{ - if (!iso) - return -1; - - if (Track == 0) { - Buffer->lsn = iso->blocks; - } else { - Buffer->type = CDVD_MODE1_TRACK; - Buffer->lsn = 0; - } - - return 0; -} - -static s32 layer1start = -1; - -static bool testForPartitionInfo(const u8 (&tempbuffer)[CD_FRAMESIZE_RAW]) -{ - const int off = iso->blockofs; - - // test for: CD001 - return ( - (tempbuffer[off + 1] == 0x43) && - (tempbuffer[off + 2] == 0x44) && - (tempbuffer[off + 3] == 0x30) && - (tempbuffer[off + 4] == 0x30) && - (tempbuffer[off + 5] == 0x31)); -} - -EXPORT_C_(s32) -CDVDgetTOC(void *toc) -{ - if (!iso) - return -1; - - u8 type = CDVDgetDiskType(); - u8 *tocBuff = (u8 *)toc; - - //__Log("CDVDgetTOC\n"); - - if (type == CDVD_TYPE_DVDV || type == CDVD_TYPE_PS2DVD) { - // get dvd structure format - // scsi command 0x43 - memset(tocBuff, 0, 2048); - - if (layer1start != -2 && iso->blocks >= 0x300000) { - //int off = iso->blockofs; - - // dual sided - tocBuff[0] = 0x24; - tocBuff[1] = 0x02; - tocBuff[2] = 0xF2; - tocBuff[3] = 0x00; - tocBuff[4] = 0x41; - tocBuff[5] = 0x95; - - tocBuff[14] = 0x60; // dual sided, ptp - - tocBuff[16] = 0x00; - tocBuff[17] = 0x03; - tocBuff[18] = 0x00; - tocBuff[19] = 0x00; - - // search for it - if (layer1start == -1) { - printf("CDVD: searching for layer1..."); - - /*tempbuffer = (u8*)malloc(CD_FRAMESIZE_RAW * 10); - for (layer1start = (iso->blocks / 2 - 0x10) & ~0xf; layer1start < 0x200010; layer1start += 16) - { - isoReadBlock(iso, tempbuffer, layer1start); - // CD001 - if (tempbuffer[off+1] == 0x43 && - tempbuffer[off+2] == 0x44 && - tempbuffer[off+3] == 0x30 && - tempbuffer[off+4] == 0x30 && - tempbuffer[off+5] == 0x31) - break; - } - free(tempbuffer);*/ - - uint midsector = (iso->blocks / 2) & ~0xf; - uint deviation = 0; - - while ((layer1start == -1) && (deviation < midsector - 16)) { - u8 tempbuffer[CD_FRAMESIZE_RAW]; - isoReadBlock(iso, tempbuffer, midsector - deviation); - - if (testForPartitionInfo(tempbuffer)) - layer1start = midsector - deviation; - else { - isoReadBlock(iso, tempbuffer, midsector + deviation); - if (testForPartitionInfo(tempbuffer)) - layer1start = midsector + deviation; - } - - if (layer1start != -1) { - if (tempbuffer[iso->blockofs] != 0x01) { - fprintf(stderr, "(LinuzCDVDiso): Invalid partition type on layer 1!? (type=0x%x)", tempbuffer[iso->blockofs]); - } - } - deviation += 16; - } - - - if (layer1start == -1) { - printf("(LinuzCDVDiso): Couldn't find second layer on dual layer... ignoring\n"); - // fake it - tocBuff[0] = 0x04; - tocBuff[1] = 0x02; - tocBuff[2] = 0xF2; - tocBuff[3] = 0x00; - tocBuff[4] = 0x86; - tocBuff[5] = 0x72; - - tocBuff[16] = 0x00; - tocBuff[17] = 0x03; - tocBuff[18] = 0x00; - tocBuff[19] = 0x00; - layer1start = -2; - return 0; - } - - printf("(LinuzCDVDiso): found at 0x%8.8x\n", layer1start); - layer1start = layer1start + 0x30000 - 1; - } - - tocBuff[20] = layer1start >> 24; - tocBuff[21] = (layer1start >> 16) & 0xff; - tocBuff[22] = (layer1start >> 8) & 0xff; - tocBuff[23] = (layer1start >> 0) & 0xff; - } else { - // fake it - tocBuff[0] = 0x04; - tocBuff[1] = 0x02; - tocBuff[2] = 0xF2; - tocBuff[3] = 0x00; - tocBuff[4] = 0x86; - tocBuff[5] = 0x72; - - tocBuff[16] = 0x00; - tocBuff[17] = 0x03; - tocBuff[18] = 0x00; - tocBuff[19] = 0x00; - } - } else if ((type == CDVD_TYPE_CDDA) || (type == CDVD_TYPE_PS2CDDA) || - (type == CDVD_TYPE_PS2CD) || (type == CDVD_TYPE_PSCDDA) || (type == CDVD_TYPE_PSCD)) { - // cd toc - // (could be replaced by 1 command that reads the full toc) - u8 min, sec, frm; - s32 i, err; - cdvdTN diskInfo; - cdvdTD trackInfo; - memset(tocBuff, 0, 1024); - if (CDVDgetTN(&diskInfo) == -1) { - diskInfo.etrack = 0; - diskInfo.strack = 1; - } - if (CDVDgetTD(0, &trackInfo) == -1) - trackInfo.lsn = 0; - - tocBuff[0] = 0x41; - tocBuff[1] = 0x00; - - //Number of FirstTrack - tocBuff[2] = 0xA0; - tocBuff[7] = itob(diskInfo.strack); - - //Number of LastTrack - tocBuff[12] = 0xA1; - tocBuff[17] = itob(diskInfo.etrack); - - //DiskLength - lba_to_msf(trackInfo.lsn, &min, &sec, &frm); - tocBuff[22] = 0xA2; - tocBuff[27] = itob(min); - tocBuff[28] = itob(sec); - - for (i = diskInfo.strack; i <= diskInfo.etrack; i++) { - err = CDVDgetTD(i, &trackInfo); - lba_to_msf(trackInfo.lsn, &min, &sec, &frm); - tocBuff[i * 10 + 30] = trackInfo.type; - tocBuff[i * 10 + 32] = err == -1 ? 0 : itob(i); //number - tocBuff[i * 10 + 37] = itob(min); - tocBuff[i * 10 + 38] = itob(sec); - tocBuff[i * 10 + 39] = itob(frm); - } - } else - return -1; - - return 0; -} - -EXPORT_C_(s32) -CDVDreadTrack(u32 lsn, int mode) -{ - if (!iso) - return -1; - - int _lsn = lsn; - - //__Log("CDVDreadTrack: %x %x\n", lsn, mode); - if (_lsn < 0) { - // lsn = 2097152 + (-_lsn); - lsn = iso->blocks - (-_lsn); - } - // printf ("CDRreadTrack %d\n", lsn); - - isoReadBlock(iso, cdbuffer, lsn); - if (fdump != NULL) { - isoWriteBlock(fdump, cdbuffer, lsn); - } - - pbuffer = cdbuffer; - switch (mode) { - case CDVD_MODE_2352: - break; - case CDVD_MODE_2340: - pbuffer += 12; - break; - case CDVD_MODE_2328: - pbuffer += 24; - break; - case CDVD_MODE_2048: - pbuffer += 24; - break; - } - - return 0; -} - -EXPORT_C_(u8 *) -CDVDgetBuffer() -{ - return pbuffer; -} - -EXPORT_C_(s32) -CDVDgetDiskType() -{ - return cdtype; -} - -EXPORT_C_(s32) -CDVDgetTrayStatus() -{ - return CDVD_TRAY_CLOSE; -} - -EXPORT_C_(s32) -CDVDctrlTrayOpen() -{ - return 0; -} -EXPORT_C_(s32) -CDVDctrlTrayClose() -{ - return 0; -} - - -EXPORT_C_(s32) -CDVDtest() -{ - if (*IsoFile == 0) - return 0; - - iso = isoOpen(IsoFile); - if (iso == NULL) - return -1; - isoClose(iso); - - return 0; -} diff --git a/plugins/CDVDiso/src/CMakeLists.txt b/plugins/CDVDiso/src/CMakeLists.txt deleted file mode 100644 index 97cb832109..0000000000 --- a/plugins/CDVDiso/src/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -# Check that people use the good file -if(NOT TOP_CMAKE_WAS_SOURCED) - message(FATAL_ERROR " - You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir. - It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt") -endif() - - -# plugin name -set(Output CDVDiso) -set(CDVDisoFinalFlags "") - -# CDVDiso sources -set(CDVDisoSources - CDVDisop.cpp - libiso.cpp) - -# CDVDiso headers -set(CDVDisoHeaders - CDVDiso.h - libiso.h) - -# CDVDiso Linux sources -set(CDVDisoLinuxSources - Linux/Config.cpp - Linux/interface.c - Linux/Linux.cpp - Linux/support.c) - -# CDVDiso Linux headers -set(CDVDisoLinuxHeaders - Linux/callbacks.h - Linux/Config.h - Linux/interface.h - Linux/support.h) - -set(CDVDisoFinalSources - ${CDVDisoSources} - ${CDVDisoHeaders} - ${CDVDisoLinuxSources} - ${CDVDisoLinuxHeaders} -) - -set(CDVDisoFinalLibs - ${BZIP2_LIBRARIES} -) - -# add additional include directories -include_directories(Linux) - -add_pcsx2_plugin(${Output} "${CDVDisoFinalSources}" "${CDVDisoFinalLibs}" "${CDVDisoFinalFlags}") diff --git a/plugins/CDVDiso/src/Linux/CDVDiso.glade b/plugins/CDVDiso/src/Linux/CDVDiso.glade deleted file mode 100644 index cc070ab635..0000000000 --- a/plugins/CDVDiso/src/Linux/CDVDiso.glade +++ /dev/null @@ -1,422 +0,0 @@ - - - - - - - 5 - True - CDVD Config Dialog - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - 5 - True - False - 5 - - - - True - False - 10 - - - - True - True - True - True - 0 - - True - * - False - - - 0 - True - True - - - - - - True - True - Select Iso - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - False - - - - - 0 - True - True - - - - - - True - False - 10 - - - - True - GTK_PROGRESS_LEFT_TO_RIGHT - 0 - 0.10000000149 - PANGO_ELLIPSIZE_NONE - - - 0 - True - False - - - - - - True - True - Stop - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - False - GTK_PACK_END - - - - - 0 - False - False - - - - - - True - False - 5 - - - - True - Compression Method: - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - True - False - True - False - - - - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - - - - - - - 0 - True - False - - - - - 0 - True - True - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - True - True - Compress Iso - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Decompress Iso - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - True - True - - - - - - True - False - 5 - - - - True - Cdrom Device: - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - * - False - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - True - True - Create Iso - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Create Compressed Iso - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - True - True - - - - - - True - True - Create a dump of the running iso - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - True - True - - - - - - - diff --git a/plugins/CDVDiso/src/Linux/Config.cpp b/plugins/CDVDiso/src/Linux/Config.cpp deleted file mode 100644 index 0517fccaf3..0000000000 --- a/plugins/CDVDiso/src/Linux/Config.cpp +++ /dev/null @@ -1,328 +0,0 @@ -/* CDVDiso - * Copyright (C) 2002-2004 CDVDiso Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "Config.h" - -const char *s_strIniPath = "./inis/CDVDiso.ini"; -GtkWidget *AboutDlg, *ConfDlg, *MsgDlg, *FileSel; -GtkWidget *Edit, *CdEdit; - -void LoadConf() -{ - FILE *f; - char cfg[256]; - - //sprintf(cfg, "%s/.PS2E/CDVDiso.cfg", getenv("HOME")); - strcpy(cfg, s_strIniPath); - f = fopen(cfg, "r"); - - if (f == NULL) { - printf("Unable to load %s\n", cfg); - strcpy(IsoFile, DEV_DEF); - strcpy(CdDev, CDDEV_DEF); - BlockDump = 0; - SaveConf(); - return; - } - - fscanf(f, "IsoFile = %[^\n]\n", IsoFile); - fscanf(f, "CdDev = %[^\n]\n", CdDev); - fscanf(f, "BlockDump = %d\n", &BlockDump); - - if (!strncmp(IsoFile, "CdDev =", 9)) - *IsoFile = 0; // quick fix - if (*CdDev == 0) - strcpy(CdDev, CDDEV_DEF); - - fclose(f); -} - -void SaveConf() -{ - FILE *f; - char cfg[256]; - - //sprintf(cfg, "%s/.PS2E", getenv("HOME")); - - //mkdir(cfg, 0755); - //sprintf(cfg, "%s/.PS2E/CDVDiso.cfg", getenv("HOME")); - strcpy(cfg, s_strIniPath); - - f = fopen(cfg, "w"); - if (f == NULL) { - printf("Unable to save %s\n", cfg); - return; - } - - fprintf(f, "IsoFile = %s\n", IsoFile); - fprintf(f, "CdDev = %s\n", CdDev); - fprintf(f, "BlockDump = %d\n", BlockDump); - fclose(f); -} - -void SysMessage(char *fmt, ...) -{ - va_list list; - char tmp[256]; - char cmd[256]; - - va_start(list, fmt); - vsprintf(tmp, fmt, list); - va_end(list); - - sprintf(cmd, "message \"%s\"", tmp); - SysMessageLoc(tmp); -} - -void OnFile_Ok() -{ - const gchar *File; - - gtk_widget_hide(FileSel); - File = gtk_file_selection_get_filename(GTK_FILE_SELECTION(FileSel)); - strcpy(IsoFile, File); - gtk_main_quit(); -} - -void OnFile_Cancel() -{ - gtk_widget_hide(FileSel); - gtk_main_quit(); -} - -void CfgOpenFile() -{ - GtkWidget *Ok, *Cancel; - - FileSel = gtk_file_selection_new("Select Iso File"); - - Ok = GTK_FILE_SELECTION(FileSel)->ok_button; - gtk_signal_connect(GTK_OBJECT(Ok), "clicked", - GTK_SIGNAL_FUNC(OnFile_Ok), NULL); - gtk_widget_show(Ok); - - Cancel = GTK_FILE_SELECTION(FileSel)->cancel_button; - gtk_signal_connect(GTK_OBJECT(Cancel), "clicked", - GTK_SIGNAL_FUNC(OnFile_Cancel), NULL); - gtk_widget_show(Cancel); - - gtk_widget_show(FileSel); - gdk_window_raise(FileSel->window); - - gtk_main(); - - SaveConf(); -} - -void OnMsg_Ok() -{ - gtk_widget_destroy(MsgDlg); - gtk_main_quit(); -} - -void SysMessageLoc(char *fmt, ...) -{ - GtkWidget *Ok, *Txt; - GtkWidget *Box, *Box1; - va_list list; - int w; - char msg[512]; - - va_start(list, fmt); - vsprintf(msg, fmt, list); - va_end(list); - - if (msg[strlen(msg) - 1] == '\n') - msg[strlen(msg) - 1] = 0; - - w = strlen(msg) * 6 + 20; - - MsgDlg = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_widget_set_usize(MsgDlg, w, 70); - gtk_window_set_position(GTK_WINDOW(MsgDlg), GTK_WIN_POS_CENTER); - gtk_window_set_title(GTK_WINDOW(MsgDlg), "cdriso Msg"); - gtk_container_set_border_width(GTK_CONTAINER(MsgDlg), 0); - - Box = gtk_vbox_new(0, 0); - gtk_container_add(GTK_CONTAINER(MsgDlg), Box); - gtk_widget_show(Box); - - Txt = gtk_label_new(msg); - - gtk_box_pack_start(GTK_BOX(Box), Txt, FALSE, FALSE, 5); - gtk_widget_show(Txt); - - Box1 = gtk_hbutton_box_new(); - gtk_box_pack_start(GTK_BOX(Box), Box1, FALSE, FALSE, 0); - gtk_widget_show(Box1); - - Ok = gtk_button_new_with_label("Ok"); - gtk_signal_connect(GTK_OBJECT(Ok), "clicked", GTK_SIGNAL_FUNC(OnMsg_Ok), NULL); - gtk_container_add(GTK_CONTAINER(Box1), Ok); - GTK_WIDGET_SET_FLAGS(Ok, GTK_CAN_DEFAULT); - gtk_widget_show(Ok); - - gtk_widget_show(MsgDlg); - - gtk_main(); -} - -void OnOk(GtkButton *button, gpointer user_data) -{ - const char *tmp; - - stop = true; - tmp = gtk_entry_get_text(GTK_ENTRY(Edit)); - strcpy(IsoFile, tmp); - tmp = gtk_entry_get_text(GTK_ENTRY(CdEdit)); - strcpy(CdDev, tmp); - - if - is_checked(ConfDlg, "checkBlockDump") - BlockDump = 1; - else - BlockDump = 0; - - SaveConf(); - gtk_widget_destroy(ConfDlg); - gtk_main_quit(); -} - -void OnCancel(GtkButton *button, gpointer user_data) -{ - stop = true; - gtk_widget_destroy(ConfDlg); - gtk_main_quit(); -} - -void OnFileSel_Ok() -{ - const gchar *File; - - File = gtk_file_selection_get_filename(GTK_FILE_SELECTION(FileSel)); - gtk_entry_set_text(GTK_ENTRY(Edit), File); - gtk_widget_destroy(FileSel); -} - -void OnFileSel_Cancel() -{ - gtk_widget_destroy(FileSel); -} - -void OnFileSel(GtkButton *button, gpointer user_data) -{ - GtkWidget *Ok, *Cancel; - - FileSel = gtk_file_selection_new("Select Psx Iso File"); - gtk_file_selection_set_filename(GTK_FILE_SELECTION(FileSel), IsoFile); - - Ok = GTK_FILE_SELECTION(FileSel)->ok_button; - gtk_signal_connect(GTK_OBJECT(Ok), "clicked", GTK_SIGNAL_FUNC(OnFileSel_Ok), NULL); - gtk_widget_show(Ok); - - Cancel = GTK_FILE_SELECTION(FileSel)->cancel_button; - gtk_signal_connect(GTK_OBJECT(Cancel), "clicked", GTK_SIGNAL_FUNC(OnFileSel_Cancel), NULL); - gtk_widget_show(Cancel); - - gtk_widget_show(FileSel); - gdk_window_raise(FileSel->window); -} - - -EXPORT_C_(void) -CDVDconfigure() -{ - int i; - - LoadConf(); - - ConfDlg = create_Config(); - - Edit = lookup_widget(ConfDlg, "GtkEntry_Iso"); - gtk_entry_set_text(GTK_ENTRY(Edit), IsoFile); - CdEdit = lookup_widget(ConfDlg, "GtkEntry_CdDev"); - gtk_entry_set_text(GTK_ENTRY(CdEdit), CdDev); - - Progress = lookup_widget(ConfDlg, "GtkProgressBar_Progress"); - - BtnCompress = lookup_widget(ConfDlg, "GtkButton_Compress"); - BtnDecompress = lookup_widget(ConfDlg, "GtkButton_Decompress"); - BtnCreate = lookup_widget(ConfDlg, "GtkButton_Create"); - BtnCreateZ = lookup_widget(ConfDlg, "GtkButton_CreateZ"); - - methodlist = NULL; - for (i = 0; i < 2; i++) - methodlist = g_list_append(methodlist, methods[i]); - - Method = lookup_widget(ConfDlg, "GtkCombo_Method"); - gtk_combo_set_popdown_strings(GTK_COMBO(Method), methodlist); - if (strstr(IsoFile, ".Z") != NULL) - gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(Method)->entry), methods[0]); - else - gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(Method)->entry), methods[1]); - - set_checked(ConfDlg, "checkBlockDump", (BlockDump == 1)); - - gtk_widget_show_all(ConfDlg); - gtk_main(); -} - -void OnAboutOk(GtkMenuItem *menuitem, gpointer userdata) -{ - gtk_widget_hide(AboutDlg); - gtk_main_quit(); -} - -EXPORT_C_(void) -CDVDabout() -{ - GtkWidget *Label; - GtkWidget *Ok; - GtkWidget *Box, *BBox; - char AboutText[255]; - - sprintf(AboutText, "%s %d.%d\n", LibName, revision, build); - - AboutDlg = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_widget_set_usize(AboutDlg, 260, 80); - gtk_window_set_title(GTK_WINDOW(AboutDlg), "CDVD About Dialog"); - gtk_window_set_position(GTK_WINDOW(AboutDlg), GTK_WIN_POS_CENTER); - gtk_container_set_border_width(GTK_CONTAINER(AboutDlg), 10); - - Box = gtk_vbox_new(0, 0); - gtk_container_add(GTK_CONTAINER(AboutDlg), Box); - gtk_widget_show(Box); - - Label = gtk_label_new(AboutText); - gtk_box_pack_start(GTK_BOX(Box), Label, FALSE, FALSE, 0); - gtk_widget_show(Label); - - BBox = gtk_hbutton_box_new(); - gtk_box_pack_start(GTK_BOX(Box), BBox, FALSE, FALSE, 0); - gtk_widget_show(BBox); - - Ok = gtk_button_new_with_label("Ok"); - gtk_signal_connect(GTK_OBJECT(Ok), "clicked", - GTK_SIGNAL_FUNC(OnAboutOk), NULL); - gtk_container_add(GTK_CONTAINER(BBox), Ok); - GTK_WIDGET_SET_FLAGS(Ok, GTK_CAN_DEFAULT); - gtk_widget_show(Ok); - - gtk_widget_show(AboutDlg); - gtk_main(); -} diff --git a/plugins/CDVDiso/src/Linux/Config.h b/plugins/CDVDiso/src/Linux/Config.h deleted file mode 100644 index 7ce213cc9e..0000000000 --- a/plugins/CDVDiso/src/Linux/Config.h +++ /dev/null @@ -1,79 +0,0 @@ -/* CDVDiso - * Copyright (C) 2002-2004 CDVDiso Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#include "support.h" -#include "callbacks.h" -#include "interface.h" - -#ifdef __cplusplus -} -#endif - -#include "CDVDiso.h" - -void SaveConf(); -void LoadConf(); -extern void SysMessageLoc(char *fmt, ...); - -extern char *LibName; - -extern const u8 revision; -extern const u8 build; - -extern GtkWidget *AboutDlg, *ConfDlg, *MsgDlg, *FileSel; -extern GtkWidget *Edit, *CdEdit; -extern bool stop; - -extern GtkWidget *Method, *Progress; -extern GtkWidget *BtnCompress, *BtnDecompress; -extern GtkWidget *BtnCreate, *BtnCreateZ; - -extern GList *methodlist; - -// Make it easier to check and set checkmarks in the gui -#define is_checked(main_widget, widget_name) (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name)))) -#define set_checked(main_widget, widget_name, state) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name)), state) - - -extern void OnFileSel(GtkButton *button, gpointer user_data); -extern void OnStop(GtkButton *button, gpointer user_data); -extern void OnCompress(GtkButton *button, gpointer user_data); -extern void OnDecompress(GtkButton *button, gpointer user_data); -extern void OnCreate(GtkButton *button, gpointer user_data); -extern void OnCreateZ(GtkButton *button, gpointer user_data); -extern void OnOk(GtkButton *button, gpointer user_data); -extern void OnCancel(GtkButton *button, gpointer user_data); diff --git a/plugins/CDVDiso/src/Linux/Linux.cpp b/plugins/CDVDiso/src/Linux/Linux.cpp deleted file mode 100644 index 17bec6b7a3..0000000000 --- a/plugins/CDVDiso/src/Linux/Linux.cpp +++ /dev/null @@ -1,674 +0,0 @@ -/* CDVDiso - * Copyright (C) 2002-2004 CDVDiso Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "Config.h" - -unsigned char Zbuf[CD_FRAMESIZE_RAW * 10 * 2]; - -GtkWidget *Method, *Progress; -GtkWidget *BtnCompress, *BtnDecompress; -GtkWidget *BtnCreate, *BtnCreateZ; - -GList *methodlist; -extern char *methods[]; -unsigned char param[4]; -int cddev = -1; -bool stop; - -#define CD_LEADOUT (0xaa) - -union -{ - struct cdrom_msf msf; - unsigned char buf[CD_FRAMESIZE_RAW]; -} cr; - -void OnStop(GtkButton *button, gpointer user_data) -{ - stop = true; -} - -void UpdZmode() -{ - const char *tmp; - - tmp = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(Method)->entry)); - if (!strcmp(tmp, methods[0])) - Zmode = 1; - else - Zmode = 2; -} - -char buffer[2352 * 10]; - -void OnCompress(GtkButton *button, gpointer user_data) -{ - struct stat buf; - u32 lsn; - u8 cdbuff[10 * 2352]; - char Zfile[256]; - const char *tmp; - int ret = 0; - isoFile *src; - isoFile *dst; - - tmp = gtk_entry_get_text(GTK_ENTRY(Edit)); - strcpy(IsoFile, tmp); - UpdZmode(); - - if (Zmode == 1) - sprintf(Zfile, "%s.Z2", IsoFile); - if (Zmode == 2) - sprintf(Zfile, "%s.BZ2", IsoFile); - - if (stat(Zfile, &buf) != -1) { - /*char str[256];*/ - return; - /* sprintf(str, "'%s' already exists, overwrite?", Zfile); - if (MessageBox(hDlg, str, "Question", MB_YESNO) != IDYES) { - return; - }*/ - } - - src = isoOpen(IsoFile); - if (src == NULL) - return; - dst = isoCreate(Zfile, Zmode == 1 ? ISOFLAGS_Z2 : ISOFLAGS_BZ2); - if (dst == NULL) - return; - - gtk_widget_set_sensitive(BtnCompress, FALSE); - gtk_widget_set_sensitive(BtnDecompress, FALSE); - gtk_widget_set_sensitive(BtnCreate, FALSE); - gtk_widget_set_sensitive(BtnCreateZ, FALSE); - stop = false; - - for (lsn = 0; lsn < src->blocks; lsn++) { - printf("block %d ", lsn); - putchar(13); - fflush(stdout); - ret = isoReadBlock(src, cdbuff, lsn); - if (ret == -1) - break; - ret = isoWriteBlock(dst, cdbuff, lsn); - if (ret == -1) - break; - - gtk_progress_bar_update(GTK_PROGRESS_BAR(Progress), (lsn * 100) / src->blocks); - while (gtk_events_pending()) - gtk_main_iteration(); - if (stop) - break; - } - isoClose(src); - isoClose(dst); - - if (!stop) - gtk_entry_set_text(GTK_ENTRY(Edit), IsoFile); - - gtk_widget_set_sensitive(BtnCompress, TRUE); - gtk_widget_set_sensitive(BtnDecompress, TRUE); - gtk_widget_set_sensitive(BtnCreate, TRUE); - gtk_widget_set_sensitive(BtnCreateZ, TRUE); - - if (!stop) { - if (ret == -1) { - SysMessageLoc("Error compressing iso image"); - } else { - SysMessageLoc("Iso image compressed OK"); - } - } -} - -void OnDecompress(GtkButton *button, gpointer user_data) -{ -#if 0 - struct stat buf; - FILE *f; - unsigned long c = 0, p = 0, s; - char table[256]; - char *tmp; - int blocks; - - tmp = gtk_entry_get_text(GTK_ENTRY(Edit)); - strcpy(IsoFile, tmp); - - if (strstr(IsoFile, ".Z") != NULL) Zmode = 1; - else Zmode = 2; - - strcpy(table, IsoFile); - if (Zmode == 1) strcat(table, ".table"); - else strcat(table, ".index"); - - if (stat(table, &buf) == -1) - { - return; - } - - if (Zmode == 1) - c = s = buf.st_size / 6; - else - c = s = (buf.st_size / 4) - 1; - - f = fopen(table, "rb"); - Ztable = (char*)malloc(buf.st_size); - fread(Ztable, 1, buf.st_size, f); - fclose(f); - - cdHandle[0] = fopen(IsoFile, "rb"); - if (cdHandle[0] == NULL) - { - return; - } - - if (Zmode == 1) - IsoFile[strlen(IsoFile) - 2] = 0; - else - IsoFile[strlen(IsoFile) - 3] = 0; - - f = fopen(IsoFile, "wb"); - if (f == NULL) - { - return; - } - - gtk_widget_set_sensitive(BtnCompress, FALSE); - gtk_widget_set_sensitive(BtnDecompress, FALSE); - gtk_widget_set_sensitive(BtnCreate, FALSE); - gtk_widget_set_sensitive(BtnCreateZ, FALSE); - stop = false; - - if (Zmode == 1) - { - blocks = 1; - } - else - { - blocks = 10; - } - - while (c--) - { - unsigned long size, pos, ssize; - float per; - - if (Zmode == 1) - { - pos = *(unsigned long*) & Ztable[p * 6]; - fseek(cdHandle[0], pos, SEEK_SET); - - ssize = *(unsigned short*) & Ztable[p * 6 + 4]; - fread(Zbuf, 1, ssize, cdHandle[0]); - } - else - { - pos = *(unsigned long*) & Ztable[p * 4]; - fseek(cdHandle[0], pos, SEEK_SET); - - ssize = *(unsigned long*) & Ztable[p * 4 + 4] - pos; - fread(Zbuf, 1, ssize, cdHandle[0]); - } - - size = CD_FRAMESIZE_RAW * blocks; - if (Zmode == 1) - uncompress(cdbuffer, &size, Zbuf, ssize); - else - BZ2_bzBuffToBuffDecompress(cdbuffer, (unsigned int*)&size, Zbuf, ssize, 0, 0); - - fwrite(cdbuffer, 1, size, f); - - p++; - - per = ((float)p / s); - - gtk_progress_bar_update(GTK_PROGRESS_BAR(Progress), per); - while (gtk_events_pending()) gtk_main_iteration(); - - if (stop) break; - } - if (!stop) gtk_entry_set_text(GTK_ENTRY(Edit), IsoFile); - - fclose(f); - fclose(cdHandle[0]); - cdHandle[0] = NULL; - free(Ztable); - Ztable = NULL; - - gtk_widget_set_sensitive(BtnCompress, TRUE); - gtk_widget_set_sensitive(BtnDecompress, TRUE); - gtk_widget_set_sensitive(BtnCreate, TRUE); - gtk_widget_set_sensitive(BtnCreateZ, TRUE); - - if (!stop) SysMessageLoc("Iso Image Decompressed OK"); -#endif -} - -void incSector() -{ - param[2]++; - if (param[2] == 75) { - param[2] = 0; - param[1]++; - } - if (param[1] == 60) { - param[1] = 0; - param[0]++; - } -} - -long CDR_open(void) -{ - if (cddev != -1) - return 0; - cddev = open(CdDev, O_RDONLY); - if (cddev == -1) { - printf("CDR: Could not open %s\n", CdDev); - return -1; - } - - return 0; -} - -long CDR_close(void) -{ - if (cddev == -1) - return 0; - close(cddev); - cddev = -1; - - return 0; -} - -// return Starting and Ending Track -// buffer: -// byte 0 - start track -// byte 1 - end track -long CDR_getTN(unsigned char *buffer) -{ - struct cdrom_tochdr toc; - - if (ioctl(cddev, CDROMREADTOCHDR, &toc) == -1) - return -1; - - buffer[0] = toc.cdth_trk0; // start track - buffer[1] = toc.cdth_trk1; // end track - - return 0; -} - -// return Track Time -// buffer: -// byte 0 - frame -// byte 1 - second -// byte 2 - minute -long CDR_getTD(unsigned char track, unsigned char *buffer) -{ - struct cdrom_tocentry entry; - - if (track == 0) - track = 0xaa; // total time - entry.cdte_track = track; - entry.cdte_format = CDROM_MSF; - - if (ioctl(cddev, CDROMREADTOCENTRY, &entry) == -1) - return -1; - - buffer[0] = entry.cdte_addr.msf.minute; /* minute */ - buffer[1] = entry.cdte_addr.msf.second; /* second */ - buffer[2] = entry.cdte_addr.msf.frame; /* frame */ - - return 0; -} - -// read track -// time: -// byte 0 - minute -// byte 1 - second -// byte 2 - frame -unsigned char *CDR_readTrack(unsigned char *time) -{ - cr.msf.cdmsf_min0 = time[0]; - cr.msf.cdmsf_sec0 = time[1]; - cr.msf.cdmsf_frame0 = time[2]; - - if (ioctl(cddev, CDROMREADRAW, &cr) == -1) - return NULL; - return cr.buf; -} - - -void OnCreate(GtkButton *button, gpointer user_data) -{ - FILE *f; - struct stat buf; - struct tm *Tm; - time_t Ttime; - unsigned long ftrack, ltrack; - unsigned long p = 0, s; - unsigned char *buffer; - unsigned char bufferz[2352]; - unsigned char start[4], end[4]; - const char *tmp; -#ifdef VERBOSE - unsigned long count = 0; - int i = 0; -#endif - - memset(bufferz, 0, sizeof(bufferz)); - ftrack = 1; - ltrack = CD_LEADOUT; - - tmp = gtk_entry_get_text(GTK_ENTRY(Edit)); - strcpy(IsoFile, tmp); - - if (stat(IsoFile, &buf) == 0) { - printf("File %s Already exists\n", IsoFile); - return; - } - - if (CDR_open() == -1) { - return; - } - - if (CDR_getTD(ftrack, start) == -1) { - printf("Error getting TD\n"); - - CDR_close(); - return; - } - if (CDR_getTD(ltrack, end) == -1) { - printf("Error getting TD\n"); - - CDR_close(); - return; - } - - f = fopen(IsoFile, "wb"); - if (f == NULL) { - CDR_close(); - printf("Error opening %s", IsoFile); - return; - } - - printf("Making Iso: from %2.2d:%2.2d:%2.2d to %2.2d:%2.2d:%2.2d\n", - start[0], start[1], start[2], end[0], end[1], end[2]); - - memcpy(param, start, 3); - - time(&Ttime); - - stop = false; - s = MSF2SECT(end[0], end[1], end[2]); - gtk_widget_set_sensitive(BtnCompress, FALSE); - gtk_widget_set_sensitive(BtnDecompress, FALSE); - gtk_widget_set_sensitive(BtnCreate, FALSE); - gtk_widget_set_sensitive(BtnCreateZ, FALSE); - - for (;;) /* loop until end */ - { - float per; - - if ((param[0] == end[0]) & (param[1] == end[1]) & (param[2] == end[2])) - break; - buffer = CDR_readTrack(param); - if (buffer == NULL) { - int i; - - for (i = 0; i < 10; i++) { - buffer = CDR_readTrack(param); - if (buffer != NULL) - break; - } - if (buffer == NULL) { - printf("Error Reading %2d:%2d:%2d\n", param[0], param[1], param[2]); - buffer = bufferz; - buffer[12] = param[0]; - buffer[13] = param[1]; - buffer[14] = param[2]; - buffer[15] = 0x2; - } - } - fwrite(buffer, 1, 2352, f); -#ifdef VERBOSE - count += CD_FRAMESIZE_RAW; - - printf("reading %2d:%2d:%2d ", param[0], param[1], param[2]); - if ((time(NULL) - Ttime) != 0) { - i = (count / 1024) / (time(NULL) - Ttime); - printf("( %5dKbytes/s, %dX)", i, i / 150); - } - putchar(13); - fflush(stdout); -#endif - - incSector(); - - p++; - per = ((float)p / s); - gtk_progress_bar_update(GTK_PROGRESS_BAR(Progress), per); - while (gtk_events_pending()) - gtk_main_iteration(); - if (stop) - break; - } - - Ttime = time(NULL) - Ttime; - Tm = gmtime(&Ttime); - printf("\nTotal Time used: %d:%d:%d\n", Tm->tm_hour, Tm->tm_min, - Tm->tm_sec); - - CDR_close(); - fclose(f); - - gtk_widget_set_sensitive(BtnCompress, TRUE); - gtk_widget_set_sensitive(BtnDecompress, TRUE); - gtk_widget_set_sensitive(BtnCreate, TRUE); - gtk_widget_set_sensitive(BtnCreateZ, TRUE); - - if (!stop) - SysMessageLoc("Iso Image Created OK"); -} - -void OnCreateZ(GtkButton *button, gpointer user_data) -{ - FILE *f; - FILE *t; - struct stat buf; - struct tm *Tm; - time_t Ttime; - unsigned long ftrack, ltrack; - unsigned long p = 0, s, c = 0; - unsigned char *buffer; - unsigned char bufferz[2352]; - unsigned char start[4], end[4]; - char table[256]; - const char *tmp; - int b, blocks; -#ifdef VERBOSE - unsigned long count = 0; - int i = 0; -#endif - - memset(bufferz, 0, sizeof(bufferz)); - ftrack = 1; - ltrack = CD_LEADOUT; - - tmp = gtk_entry_get_text(GTK_ENTRY(Edit)); - strcpy(IsoFile, tmp); - - UpdZmode(); - - if (Zmode == 1) { - blocks = 1; - if (strstr(IsoFile, ".Z") == NULL) - strcat(IsoFile, ".Z"); - } else { - blocks = 10; - if (strstr(IsoFile, ".bz") == NULL) - strcat(IsoFile, ".bz"); - } - - if (stat(IsoFile, &buf) == 0) { - printf("File %s Already exists\n", IsoFile); - return; - } - - strcpy(table, IsoFile); - if (Zmode == 1) - strcat(table, ".table"); - else - strcat(table, ".index"); - - t = fopen(table, "wb"); - - if (t == NULL) - return; - if (CDR_open() == -1) { - fclose(t); - return; - } - if (CDR_getTD(ftrack, start) == -1) { - printf("Error getting TD\n"); - CDR_close(); - fclose(t); - return; - } - - if (CDR_getTD(ltrack, end) == -1) { - printf("Error getting TD\n"); - CDR_close(); - fclose(t); - return; - } - - f = fopen(IsoFile, "wb"); - if (f == NULL) { - CDR_close(); - fclose(t); - printf("Error opening %s", IsoFile); - return; - } - - printf("Making Iso: from %2.2d:%2.2d:%2.2d to %2.2d:%2.2d:%2.2d\n", - start[0], start[1], start[2], end[0], end[1], end[2]); - - memcpy(param, start, 3); - - time(&Ttime); - - stop = false; - s = MSF2SECT(end[0], end[1], end[2]) / blocks; - gtk_widget_set_sensitive(BtnCompress, FALSE); - gtk_widget_set_sensitive(BtnDecompress, FALSE); - gtk_widget_set_sensitive(BtnCreate, FALSE); - gtk_widget_set_sensitive(BtnCreateZ, FALSE); - - for (;;) /* loop until end */ - { - unsigned long size; - unsigned char Zbuf[CD_FRAMESIZE_RAW * 10 * 2]; - float per; - - for (b = 0; b < blocks; b++) { - if ((param[0] == end[0]) & (param[1] == end[1]) & (param[2] == end[2])) - break; - - buffer = CDR_readTrack(param); - if (buffer == NULL) { - int i; - - for (i = 0; i < 10; i++) { - buffer = CDR_readTrack(param); - if (buffer != NULL) - break; - } - - if (buffer == NULL) { - printf("Error Reading %2d:%2d:%2d\n", param[0], param[1], param[2]); - buffer = bufferz; - buffer[12] = param[0]; - buffer[13] = param[1]; - buffer[14] = param[2]; - buffer[15] = 0x2; - } - } - memcpy(cdbuffer + b * CD_FRAMESIZE_RAW, buffer, CD_FRAMESIZE_RAW); - - incSector(); - } - if ((param[0] == end[0]) & (param[1] == end[1]) & (param[2] == end[2])) - break; - - size = CD_FRAMESIZE_RAW * blocks * 2; - if (Zmode == 1) - compress(Zbuf, &size, cdbuffer, CD_FRAMESIZE_RAW); - else - BZ2_bzBuffToBuffCompress((char *)Zbuf, (unsigned int *)&size, (char *)cdbuffer, CD_FRAMESIZE_RAW * 10, 1, 0, 30); - - fwrite(&c, 1, 4, t); - if (Zmode == 1) - fwrite(&size, 1, 2, t); - - fwrite(Zbuf, 1, size, f); - - c += size; -#ifdef VERBOSE - count += CD_FRAMESIZE_RAW * blocks; - - printf("reading %2d:%2d:%2d ", param[0], param[1], param[2]); - if ((time(NULL) - Ttime) != 0) { - i = (count / 1024) / (time(NULL) - Ttime); - printf("( %5dKbytes/s, %dX)", i, i / 150); - } - putchar(13); - fflush(stdout); -#endif - - p++; - per = ((float)p / s); - - gtk_progress_bar_update(GTK_PROGRESS_BAR(Progress), per); - while (gtk_events_pending()) - gtk_main_iteration(); - - if (stop) - break; - } - if (Zmode == 2) - fwrite(&c, 1, 4, f); - - if (!stop) - gtk_entry_set_text(GTK_ENTRY(Edit), IsoFile); - - Ttime = time(NULL) - Ttime; - Tm = gmtime(&Ttime); - printf("\nTotal Time used: %d:%d:%d\n", Tm->tm_hour, Tm->tm_min, - Tm->tm_sec); - - CDR_close(); - fclose(f); - fclose(t); - - gtk_widget_set_sensitive(BtnCompress, TRUE); - gtk_widget_set_sensitive(BtnDecompress, TRUE); - gtk_widget_set_sensitive(BtnCreate, TRUE); - gtk_widget_set_sensitive(BtnCreateZ, TRUE); - - if (!stop) - SysMessageLoc("Compressed Iso Image Created OK"); -} diff --git a/plugins/CDVDiso/src/Linux/Makefile b/plugins/CDVDiso/src/Linux/Makefile deleted file mode 100644 index eb5b0f7948..0000000000 --- a/plugins/CDVDiso/src/Linux/Makefile +++ /dev/null @@ -1,33 +0,0 @@ - -CC = gcc - -PLUGIN = libCDVDiso.so -CFG = cfgCDVDiso -MKISO = mkiso -CFLAGS = -fPIC -Wall -g -I.. -I. -D_FILE_OFFSET_BITS=64 -Wextra -OBJS = ../CDVDisop.o Config.o Linux.o ../libiso.o -CFGOBJS = conf.o interface.o support.o ${OBJS} -LIBS = -lz -lbz2 -lstdc++ -CFGLIBS = $(shell pkg-config --libs gtk+-2.0) ${LIBS} -CFLAGS += $(shell pkg-config --cflags gtk+-2.0) -I../../../../common/include -I../../../../3rdparty -DEPS:= $(OBJS:.o=.d) $(CFGOBJS:.o=.d) - -all: plugin cfg -install: all - -plugin: ${OBJS} - rm -f ${PLUGIN} - ${CC} -shared -Wl,-soname,${PLUGIN} ${CFLAGS} ${OBJS} -o ${PLUGIN} ${LIBS} - -cfg: ${CFGOBJS} - rm -f ${CFG} - ${CC} ${CFLAGS} ${CFGOBJS} -o ${CFG} ${CFGLIBS} - strip ${CFG} - -clean: - rm -f ${OBJS} ${DEPS} ${PLUGIN} ${CFGOBJS} ${CFG} - -%.o: %.c - ${CC} ${CFLAGS} -c -o $@ $< -MD -MF $(patsubst %.o,%.d,$@) - --include ${DEPS} diff --git a/plugins/CDVDiso/src/Linux/callbacks.c b/plugins/CDVDiso/src/Linux/callbacks.c deleted file mode 100644 index 14949cbbd6..0000000000 --- a/plugins/CDVDiso/src/Linux/callbacks.c +++ /dev/null @@ -1,74 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#include "callbacks.h" -#include "interface.h" -#include "support.h" - - -void -OnFileSel (GtkButton *button, - gpointer user_data) -{ - -} - - -void -OnStop (GtkButton *button, - gpointer user_data) -{ - -} - - -void -OnCompress (GtkButton *button, - gpointer user_data) -{ - -} - - -void -OnDecompress (GtkButton *button, - gpointer user_data) -{ - -} - - -void -OnCreate (GtkButton *button, - gpointer user_data) -{ - -} - - -void -OnCreateZ (GtkButton *button, - gpointer user_data) -{ - -} - - -void -OnOk (GtkButton *button, - gpointer user_data) -{ - -} - - -void -OnCancel (GtkButton *button, - gpointer user_data) -{ - -} - diff --git a/plugins/CDVDiso/src/Linux/callbacks.h b/plugins/CDVDiso/src/Linux/callbacks.h deleted file mode 100644 index f05704f10f..0000000000 --- a/plugins/CDVDiso/src/Linux/callbacks.h +++ /dev/null @@ -1,26 +0,0 @@ -#include - - -void OnFileSel(GtkButton *button, - gpointer user_data); - -void OnStop(GtkButton *button, - gpointer user_data); - -void OnCompress(GtkButton *button, - gpointer user_data); - -void OnDecompress(GtkButton *button, - gpointer user_data); - -void OnCreate(GtkButton *button, - gpointer user_data); - -void OnCreateZ(GtkButton *button, - gpointer user_data); - -void OnOk(GtkButton *button, - gpointer user_data); - -void OnCancel(GtkButton *button, - gpointer user_data); diff --git a/plugins/CDVDiso/src/Linux/interface.c b/plugins/CDVDiso/src/Linux/interface.c deleted file mode 100644 index 559fbed98d..0000000000 --- a/plugins/CDVDiso/src/Linux/interface.c +++ /dev/null @@ -1,251 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#include -#include - -#include -#include - -#include "callbacks.h" -#include "interface.h" -#include "support.h" - -#define GLADE_HOOKUP_OBJECT(component,widget,name) \ - g_object_set_data_full (G_OBJECT (component), name, \ - gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref) - -#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \ - g_object_set_data (G_OBJECT (component), name, widget) - -GtkWidget* -create_Config (void) -{ - GtkWidget *Config; - GtkWidget *vbox1; - GtkWidget *hbox1; - GtkWidget *GtkEntry_Iso; - GtkWidget *button5; - GtkWidget *hbox2; - GtkWidget *GtkProgressBar_Progress; - GtkWidget *button6; - GtkWidget *hbox4; - GtkWidget *label2; - GtkWidget *GtkCombo_Method; - GList *GtkCombo_Method_items = NULL; - GtkWidget *combo_entry1; - GtkWidget *hbuttonbox2; - GtkWidget *GtkButton_Compress; - GtkWidget *GtkButton_Decompress; - GtkWidget *hbox3; - GtkWidget *label1; - GtkWidget *GtkEntry_CdDev; - GtkWidget *hbuttonbox3; - GtkWidget *GtkButton_Create; - GtkWidget *GtkButton_CreateZ; - GtkWidget *checkBlockDump; - GtkWidget *hbuttonbox1; - GtkWidget *button1; - GtkWidget *button2; - - Config = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (Config, "Config"); - gtk_container_set_border_width (GTK_CONTAINER (Config), 5); - gtk_window_set_title (GTK_WINDOW (Config), _("CDVD Config Dialog")); - - vbox1 = gtk_vbox_new (FALSE, 5); - gtk_widget_set_name (vbox1, "vbox1"); - gtk_widget_show (vbox1); - gtk_container_add (GTK_CONTAINER (Config), vbox1); - gtk_container_set_border_width (GTK_CONTAINER (vbox1), 5); - - hbox1 = gtk_hbox_new (FALSE, 10); - gtk_widget_set_name (hbox1, "hbox1"); - gtk_widget_show (hbox1); - gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 0); - - GtkEntry_Iso = gtk_entry_new (); - gtk_widget_set_name (GtkEntry_Iso, "GtkEntry_Iso"); - gtk_widget_show (GtkEntry_Iso); - gtk_box_pack_start (GTK_BOX (hbox1), GtkEntry_Iso, TRUE, TRUE, 0); - - button5 = gtk_button_new_with_mnemonic (_("Select Iso")); - gtk_widget_set_name (button5, "button5"); - gtk_widget_show (button5); - gtk_box_pack_start (GTK_BOX (hbox1), button5, FALSE, FALSE, 0); - - hbox2 = gtk_hbox_new (FALSE, 10); - gtk_widget_set_name (hbox2, "hbox2"); - gtk_widget_show (hbox2); - gtk_box_pack_start (GTK_BOX (vbox1), hbox2, FALSE, FALSE, 0); - - GtkProgressBar_Progress = gtk_progress_bar_new (); - gtk_widget_set_name (GtkProgressBar_Progress, "GtkProgressBar_Progress"); - gtk_widget_show (GtkProgressBar_Progress); - gtk_box_pack_start (GTK_BOX (hbox2), GtkProgressBar_Progress, TRUE, FALSE, 0); - - button6 = gtk_button_new_with_mnemonic (_("Stop")); - gtk_widget_set_name (button6, "button6"); - gtk_widget_show (button6); - gtk_box_pack_end (GTK_BOX (hbox2), button6, FALSE, FALSE, 0); - - hbox4 = gtk_hbox_new (FALSE, 5); - gtk_widget_set_name (hbox4, "hbox4"); - gtk_widget_show (hbox4); - gtk_box_pack_start (GTK_BOX (vbox1), hbox4, TRUE, TRUE, 0); - - label2 = gtk_label_new (_("Compression Method:")); - gtk_widget_set_name (label2, "label2"); - gtk_widget_show (label2); - gtk_box_pack_start (GTK_BOX (hbox4), label2, FALSE, FALSE, 0); - gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_CENTER); - - GtkCombo_Method = gtk_combo_new (); - g_object_set_data (G_OBJECT (GTK_COMBO (GtkCombo_Method)->popwin), - "GladeParentKey", GtkCombo_Method); - gtk_widget_set_name (GtkCombo_Method, "GtkCombo_Method"); - gtk_widget_show (GtkCombo_Method); - gtk_box_pack_start (GTK_BOX (hbox4), GtkCombo_Method, TRUE, FALSE, 0); - GtkCombo_Method_items = g_list_append (GtkCombo_Method_items, (gpointer) ""); - gtk_combo_set_popdown_strings (GTK_COMBO (GtkCombo_Method), GtkCombo_Method_items); - g_list_free (GtkCombo_Method_items); - - combo_entry1 = GTK_COMBO (GtkCombo_Method)->entry; - gtk_widget_set_name (combo_entry1, "combo_entry1"); - gtk_widget_show (combo_entry1); - - hbuttonbox2 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox2, "hbuttonbox2"); - gtk_widget_show (hbuttonbox2); - gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox2, TRUE, TRUE, 0); - - GtkButton_Compress = gtk_button_new_with_mnemonic (_("Compress Iso")); - gtk_widget_set_name (GtkButton_Compress, "GtkButton_Compress"); - gtk_widget_show (GtkButton_Compress); - gtk_container_add (GTK_CONTAINER (hbuttonbox2), GtkButton_Compress); - GTK_WIDGET_SET_FLAGS (GtkButton_Compress, GTK_CAN_DEFAULT); - - GtkButton_Decompress = gtk_button_new_with_mnemonic (_("Decompress Iso")); - gtk_widget_set_name (GtkButton_Decompress, "GtkButton_Decompress"); - gtk_widget_show (GtkButton_Decompress); - gtk_container_add (GTK_CONTAINER (hbuttonbox2), GtkButton_Decompress); - GTK_WIDGET_SET_FLAGS (GtkButton_Decompress, GTK_CAN_DEFAULT); - - hbox3 = gtk_hbox_new (FALSE, 5); - gtk_widget_set_name (hbox3, "hbox3"); - gtk_widget_show (hbox3); - gtk_box_pack_start (GTK_BOX (vbox1), hbox3, FALSE, FALSE, 0); - - label1 = gtk_label_new (_("Cdrom Device: ")); - gtk_widget_set_name (label1, "label1"); - gtk_widget_show (label1); - gtk_box_pack_start (GTK_BOX (hbox3), label1, FALSE, FALSE, 0); - gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_CENTER); - - GtkEntry_CdDev = gtk_entry_new (); - gtk_widget_set_name (GtkEntry_CdDev, "GtkEntry_CdDev"); - gtk_widget_show (GtkEntry_CdDev); - gtk_box_pack_start (GTK_BOX (hbox3), GtkEntry_CdDev, TRUE, TRUE, 0); - - hbuttonbox3 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox3, "hbuttonbox3"); - gtk_widget_show (hbuttonbox3); - gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox3, TRUE, TRUE, 0); - - GtkButton_Create = gtk_button_new_with_mnemonic (_("Create Iso")); - gtk_widget_set_name (GtkButton_Create, "GtkButton_Create"); - gtk_widget_show (GtkButton_Create); - gtk_container_add (GTK_CONTAINER (hbuttonbox3), GtkButton_Create); - GTK_WIDGET_SET_FLAGS (GtkButton_Create, GTK_CAN_DEFAULT); - - GtkButton_CreateZ = gtk_button_new_with_mnemonic (_("Create Compressed Iso")); - gtk_widget_set_name (GtkButton_CreateZ, "GtkButton_CreateZ"); - gtk_widget_show (GtkButton_CreateZ); - gtk_container_add (GTK_CONTAINER (hbuttonbox3), GtkButton_CreateZ); - GTK_WIDGET_SET_FLAGS (GtkButton_CreateZ, GTK_CAN_DEFAULT); - - checkBlockDump = gtk_check_button_new_with_mnemonic (_("Create a dump of the running iso")); - gtk_widget_set_name (checkBlockDump, "checkBlockDump"); - gtk_widget_show (checkBlockDump); - gtk_box_pack_start (GTK_BOX (vbox1), checkBlockDump, FALSE, FALSE, 0); - - hbuttonbox1 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox1, "hbuttonbox1"); - gtk_widget_show (hbuttonbox1); - gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, TRUE, TRUE, 0); - - button1 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_set_name (button1, "button1"); - gtk_widget_show (button1); - gtk_container_add (GTK_CONTAINER (hbuttonbox1), button1); - GTK_WIDGET_SET_FLAGS (button1, GTK_CAN_DEFAULT); - - button2 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_set_name (button2, "button2"); - gtk_widget_show (button2); - gtk_container_add (GTK_CONTAINER (hbuttonbox1), button2); - GTK_WIDGET_SET_FLAGS (button2, GTK_CAN_DEFAULT); - - g_signal_connect ((gpointer) button5, "clicked", - G_CALLBACK (OnFileSel), - NULL); - g_signal_connect ((gpointer) button6, "clicked", - G_CALLBACK (OnStop), - NULL); - g_signal_connect ((gpointer) GtkButton_Compress, "clicked", - G_CALLBACK (OnCompress), - NULL); - g_signal_connect ((gpointer) GtkButton_Decompress, "clicked", - G_CALLBACK (OnDecompress), - NULL); - g_signal_connect ((gpointer) GtkButton_Create, "clicked", - G_CALLBACK (OnCreate), - NULL); - g_signal_connect ((gpointer) GtkButton_CreateZ, "clicked", - G_CALLBACK (OnCreateZ), - NULL); - g_signal_connect ((gpointer) button1, "clicked", - G_CALLBACK (OnOk), - NULL); - g_signal_connect ((gpointer) button2, "clicked", - G_CALLBACK (OnCancel), - NULL); - - /* Store pointers to all widgets, for use by lookup_widget(). */ - GLADE_HOOKUP_OBJECT_NO_REF (Config, Config, "Config"); - GLADE_HOOKUP_OBJECT (Config, vbox1, "vbox1"); - GLADE_HOOKUP_OBJECT (Config, hbox1, "hbox1"); - GLADE_HOOKUP_OBJECT (Config, GtkEntry_Iso, "GtkEntry_Iso"); - GLADE_HOOKUP_OBJECT (Config, button5, "button5"); - GLADE_HOOKUP_OBJECT (Config, hbox2, "hbox2"); - GLADE_HOOKUP_OBJECT (Config, GtkProgressBar_Progress, "GtkProgressBar_Progress"); - GLADE_HOOKUP_OBJECT (Config, button6, "button6"); - GLADE_HOOKUP_OBJECT (Config, hbox4, "hbox4"); - GLADE_HOOKUP_OBJECT (Config, label2, "label2"); - GLADE_HOOKUP_OBJECT (Config, GtkCombo_Method, "GtkCombo_Method"); - GLADE_HOOKUP_OBJECT (Config, combo_entry1, "combo_entry1"); - GLADE_HOOKUP_OBJECT (Config, hbuttonbox2, "hbuttonbox2"); - GLADE_HOOKUP_OBJECT (Config, GtkButton_Compress, "GtkButton_Compress"); - GLADE_HOOKUP_OBJECT (Config, GtkButton_Decompress, "GtkButton_Decompress"); - GLADE_HOOKUP_OBJECT (Config, hbox3, "hbox3"); - GLADE_HOOKUP_OBJECT (Config, label1, "label1"); - GLADE_HOOKUP_OBJECT (Config, GtkEntry_CdDev, "GtkEntry_CdDev"); - GLADE_HOOKUP_OBJECT (Config, hbuttonbox3, "hbuttonbox3"); - GLADE_HOOKUP_OBJECT (Config, GtkButton_Create, "GtkButton_Create"); - GLADE_HOOKUP_OBJECT (Config, GtkButton_CreateZ, "GtkButton_CreateZ"); - GLADE_HOOKUP_OBJECT (Config, checkBlockDump, "checkBlockDump"); - GLADE_HOOKUP_OBJECT (Config, hbuttonbox1, "hbuttonbox1"); - GLADE_HOOKUP_OBJECT (Config, button1, "button1"); - GLADE_HOOKUP_OBJECT (Config, button2, "button2"); - - return Config; -} - diff --git a/plugins/CDVDiso/src/Linux/interface.h b/plugins/CDVDiso/src/Linux/interface.h deleted file mode 100644 index 3731082721..0000000000 --- a/plugins/CDVDiso/src/Linux/interface.h +++ /dev/null @@ -1,5 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -GtkWidget *create_Config(void); diff --git a/plugins/CDVDiso/src/Linux/support.c b/plugins/CDVDiso/src/Linux/support.c deleted file mode 100644 index 00aff29822..0000000000 --- a/plugins/CDVDiso/src/Linux/support.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#include -#include - -#include - -#include "support.h" - -GtkWidget* -lookup_widget (GtkWidget *widget, - const gchar *widget_name) -{ - GtkWidget *parent, *found_widget; - - for (;;) - { - if (GTK_IS_MENU (widget)) - parent = gtk_menu_get_attach_widget (GTK_MENU (widget)); - else - parent = widget->parent; - if (!parent) - parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey"); - if (parent == NULL) - break; - widget = parent; - } - - found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget), - widget_name); - if (!found_widget) - g_warning ("Widget not found: %s", widget_name); - return found_widget; -} - -static GList *pixmaps_directories = NULL; - -/* Use this function to set the directory containing installed pixmaps. */ -void -add_pixmap_directory (const gchar *directory) -{ - pixmaps_directories = g_list_prepend (pixmaps_directories, - g_strdup (directory)); -} - -/* This is an internally used function to find pixmap files. */ -static gchar* -find_pixmap_file (const gchar *filename) -{ - GList *elem; - - /* We step through each of the pixmaps directory to find it. */ - elem = pixmaps_directories; - while (elem) - { - gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data, - G_DIR_SEPARATOR_S, filename); - if (g_file_test (pathname, G_FILE_TEST_EXISTS)) - return pathname; - g_free (pathname); - elem = elem->next; - } - return NULL; -} - -/* This is an internally used function to create pixmaps. */ -GtkWidget* -create_pixmap (GtkWidget *widget, - const gchar *filename) -{ - gchar *pathname = NULL; - GtkWidget *pixmap; - - if (!filename || !filename[0]) - return gtk_image_new (); - - pathname = find_pixmap_file (filename); - - if (!pathname) - { - g_warning (_("Couldn't find pixmap file: %s"), filename); - return gtk_image_new (); - } - - pixmap = gtk_image_new_from_file (pathname); - g_free (pathname); - return pixmap; -} - -/* This is an internally used function to create pixmaps. */ -GdkPixbuf* -create_pixbuf (const gchar *filename) -{ - gchar *pathname = NULL; - GdkPixbuf *pixbuf; - GError *error = NULL; - - if (!filename || !filename[0]) - return NULL; - - pathname = find_pixmap_file (filename); - - if (!pathname) - { - g_warning (_("Couldn't find pixmap file: %s"), filename); - return NULL; - } - - pixbuf = gdk_pixbuf_new_from_file (pathname, &error); - if (!pixbuf) - { - fprintf (stderr, "Failed to load pixbuf file: %s: %s\n", - pathname, error->message); - g_error_free (error); - } - g_free (pathname); - return pixbuf; -} - -/* This is used to set ATK action descriptions. */ -void -glade_set_atk_action_description (AtkAction *action, - const gchar *action_name, - const gchar *description) -{ - gint n_actions, i; - - n_actions = atk_action_get_n_actions (action); - for (i = 0; i < n_actions; i++) - { - if (!strcmp (atk_action_get_name (action, i), action_name)) - atk_action_set_description (action, i, description); - } -} - diff --git a/plugins/CDVDiso/src/Linux/support.h b/plugins/CDVDiso/src/Linux/support.h deleted file mode 100644 index a5525c7337..0000000000 --- a/plugins/CDVDiso/src/Linux/support.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - -/* - * Standard gettext macros. - */ -#ifdef ENABLE_NLS -#include -#undef _ -#define _(String) dgettext(PACKAGE, String) -#define Q_(String) g_strip_context((String), gettext(String)) -#ifdef gettext_noop -#define N_(String) gettext_noop(String) -#else -#define N_(String) (String) -#endif -#else -#define textdomain(String) (String) -#define gettext(String) (String) -#define dgettext(Domain, Message) (Message) -#define dcgettext(Domain, Message, Type) (Message) -#define bindtextdomain(Domain, Directory) (Domain) -#define _(String) (String) -#define Q_(String) g_strip_context((String), (String)) -#define N_(String) (String) -#endif - - -/* - * Public Functions. - */ - -/* - * This function returns a widget in a component created by Glade. - * Call it with the toplevel widget in the component (i.e. a window/dialog), - * or alternatively any widget in the component, and the name of the widget - * you want returned. - */ -GtkWidget *lookup_widget(GtkWidget *widget, - const gchar *widget_name); - - -/* Use this function to set the directory containing installed pixmaps. */ -void add_pixmap_directory(const gchar *directory); - - -/* - * Private Functions. - */ - -/* This is used to create the pixmaps used in the interface. */ -GtkWidget *create_pixmap(GtkWidget *widget, - const gchar *filename); - -/* This is used to create the pixbufs used in the interface. */ -GdkPixbuf *create_pixbuf(const gchar *filename); - -/* This is used to set ATK action descriptions. */ -void glade_set_atk_action_description(AtkAction *action, - const gchar *action_name, - const gchar *description); diff --git a/plugins/CDVDiso/src/Windows/CDVDiso.def b/plugins/CDVDiso/src/Windows/CDVDiso.def deleted file mode 100644 index 30dbfff001..0000000000 --- a/plugins/CDVDiso/src/Windows/CDVDiso.def +++ /dev/null @@ -1,26 +0,0 @@ -; CDVDiso.def : Declares the module parameters for the DLL. - -EXPORTS - ; Explicit exports can go here - PS2EgetLibType @2 - PS2EgetLibName @3 - PS2EgetLibVersion2 @4 - CDVDinit @5 - CDVDshutdown @6 - CDVDopen @7 - CDVDclose @8 - CDVDreadTrack @9 - CDVDgetBuffer @10 - CDVDreadSubQ @11 - CDVDgetTN @12 - CDVDgetTD @13 - CDVDgetTOC @14 - CDVDgetDiskType @15 - CDVDgetTrayStatus @16 - CDVDctrlTrayOpen @17 - CDVDctrlTrayClose @18 - - CDVDconfigure @19 - CDVDtest @20 - CDVDabout @21 - diff --git a/plugins/CDVDiso/src/Windows/CDVDiso.rc b/plugins/CDVDiso/src/Windows/CDVDiso.rc deleted file mode 100644 index 32a37514ba..0000000000 --- a/plugins/CDVDiso/src/Windows/CDVDiso.rc +++ /dev/null @@ -1,127 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxresmw.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Spanish (Argentina) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ESS) -#ifdef _WIN32 -LANGUAGE LANG_SPANISH, SUBLANG_SPANISH_ARGENTINA -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxresmw.h""\r\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_CONFIG DIALOGEX 0, 0, 212, 161 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "CDVDconfigure" -FONT 8, "MS Sans Serif", 0, 0, 0x0 -BEGIN - DEFPUSHBUTTON "OK",IDOK,105,140,50,14 - EDITTEXT IDC_ISOFILE,10,10,145,14,ES_AUTOHSCROLL - PUSHBUTTON "Cancel",IDCANCEL,160,140,50,14 - PUSHBUTTON "Select Iso",IDC_SELECTISO,160,10,45,14 - PUSHBUTTON "Compress Iso",IDC_COMPRESSISO,33,75,65,14 - PUSHBUTTON "Decompress Iso",IDC_DECOMPRESSISO,113,75,65,14 - COMBOBOX IDC_METHOD,120,55,85,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH | WS_BORDER,10,35,145,14 - LTEXT "Compression Method:",IDC_STATIC,29,57,69,8 - PUSHBUTTON "Stop",IDC_STOP,160,35,45,14 - GROUPBOX "",IDC_STATIC,5,0,205,95 - GROUPBOX "Options",IDC_STATIC,5,100,205,30 - CONTROL "Enable Block Dump => ""ISO name.dump""",IDC_BLOCKDUMP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,115,148,10 -END - -IDD_ABOUT DIALOG 0, 0, 177, 106 -STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "CDVDabout" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,65,85,50,14 - LTEXT "CDVDiso Driver",IDC_NAME,70,10,50,8 - GROUPBOX "",IDC_STATIC,5,35,170,40 - LTEXT "Thanks to:\n mooby - coding hints and .bz support\n Brenden Conte - linux conf bugfix",IDC_STATIC,10,45,160,25 - LTEXT "Author: linuzappz ",IDC_STATIC,20,20,141,10 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_CONFIG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 205 - TOPMARGIN, 7 - BOTTOMMARGIN, 154 - END - - IDD_ABOUT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 170 - TOPMARGIN, 7 - BOTTOMMARGIN, 99 - END -END -#endif // APSTUDIO_INVOKED - -#endif // Spanish (Argentina) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/plugins/CDVDiso/src/Windows/CDVDiso.vcxproj b/plugins/CDVDiso/src/Windows/CDVDiso.vcxproj deleted file mode 100644 index af683d31e9..0000000000 --- a/plugins/CDVDiso/src/Windows/CDVDiso.vcxproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - Debug - Win32 - - - Devel - Win32 - - - Release - Win32 - - - - CDVDiso - {5F78E90B-BD22-47B1-9CA5-7A80F4DF5EF3} - CDVDiso - - - - DynamicLibrary - false - MultiByte - false - $(DefaultPlatformToolset) - - - DynamicLibrary - false - MultiByte - true - $(DefaultPlatformToolset) - - - DynamicLibrary - false - MultiByte - $(DefaultPlatformToolset) - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(Configuration)\ - true - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - $(ProjectName)-dev - - - - Disabled - - - $(SvnRootDir)\3rdparty\bzip2;$(SvnRootDir)\3rdparty\zlib;%(AdditionalIncludeDirectories) - - - $(OutDir)$(TargetName)$(TargetExt) - .\CDVDiso.def - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - - - $(SvnRootDir)\3rdparty\bzip2;$(SvnRootDir)\3rdparty\zlib;%(AdditionalIncludeDirectories) - - - $(OutDir)$(TargetName)$(TargetExt) - .\CDVDiso.def - true - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - - - Level3 - ProgramDatabase - $(SvnRootDir)\3rdparty\bzip2;$(SvnRootDir)\3rdparty\zlib;%(AdditionalIncludeDirectories) - - - $(OutDir)$(TargetName)$(TargetExt) - .\CDVDiso.def - true - MachineX86 - - - - - CompileAsCpp - CompileAsCpp - - - CompileAsCpp - CompileAsCpp - - - CompileAsCpp - CompileAsCpp - - - CompileAsCpp - CompileAsCpp - - - - - - - - - - - - - - {f4eb4ab2-c595-4b05-8bc0-059024bc796c} - false - - - {2f6c0388-20cb-4242-9f6c-a6ebb6a83f47} - false - - - - - - \ No newline at end of file diff --git a/plugins/CDVDiso/src/Windows/CDVDiso.vcxproj.filters b/plugins/CDVDiso/src/Windows/CDVDiso.vcxproj.filters deleted file mode 100644 index f7173d0e4f..0000000000 --- a/plugins/CDVDiso/src/Windows/CDVDiso.vcxproj.filters +++ /dev/null @@ -1,50 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - \ No newline at end of file diff --git a/plugins/CDVDiso/src/Windows/Config.cpp b/plugins/CDVDiso/src/Windows/Config.cpp deleted file mode 100644 index 6a6ccef9b1..0000000000 --- a/plugins/CDVDiso/src/Windows/Config.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include -#include - -#include "../CDVDiso.h" - -#define GetKeyV(name, var, s, t) \ - size = s; \ - type = t; \ - RegQueryValueEx(myKey, name, 0, &type, (LPBYTE)var, &size); - -#define GetKeyVdw(name, var) \ - GetKeyV(name, var, 4, REG_DWORD); - -#define SetKeyV(name, var, s, t) \ - RegSetValueEx(myKey, name, 0, t, (LPBYTE)var, s); - -#define SetKeyVdw(name, var) \ - SetKeyV(name, var, 4, REG_DWORD); - -void SaveConf() -{ - HKEY myKey; - DWORD myDisp; - - RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\PS2Eplugin\\CDVD\\CDVDiso", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &myKey, &myDisp); - - SetKeyV("IsoFile", IsoFile, sizeof(IsoFile), REG_BINARY); - SetKeyV("CurrentWorkingFolder", IsoCWD, sizeof(IsoCWD), REG_BINARY); - SetKeyVdw("BlockDump", &BlockDump); - - RegCloseKey(myKey); -} - -void LoadConf() -{ - HKEY myKey; - DWORD type, size; - - memset(IsoFile, 0, sizeof(IsoFile)); - - if (RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\PS2Eplugin\\CDVD\\CDVDiso", 0, KEY_ALL_ACCESS, &myKey) != ERROR_SUCCESS) { - SaveConf(); - return; - } - - GetKeyV("IsoFile", IsoFile, sizeof(IsoFile), REG_BINARY); - GetKeyV("CurrentWorkingFolder", IsoCWD, sizeof(IsoCWD), REG_BINARY); - GetKeyVdw("BlockDump", &BlockDump); - - RegCloseKey(myKey); -} diff --git a/plugins/CDVDiso/src/Windows/Config.h b/plugins/CDVDiso/src/Windows/Config.h deleted file mode 100644 index 4e767be7d3..0000000000 --- a/plugins/CDVDiso/src/Windows/Config.h +++ /dev/null @@ -1,2 +0,0 @@ -void SaveConf(); -void LoadConf(); diff --git a/plugins/CDVDiso/src/Windows/Makefile b/plugins/CDVDiso/src/Windows/Makefile deleted file mode 100644 index a8282185af..0000000000 --- a/plugins/CDVDiso/src/Windows/Makefile +++ /dev/null @@ -1,57 +0,0 @@ -# -# Makefile for MINGW32 -# - - -all: cdvdiso - -PLUGIN = CDVDiso.dll - -CC = gcc -NASM = nasmw -RM = rm -f -AR = ar -STRIP = strip -RC = windres - -OPTIMIZE = -O2 -fomit-frame-pointer -finline-functions -ffast-math -fno-strict-aliasing -FLAGS = -D__WIN32__ -D__MINGW32__ # -DENABLE_NLS -DPACKAGE=\"pcsx2\" -RC1FLAGS = -d__MINGW32__ -LIBS = -L./ -lcomctl32 -lwsock32 -lwinmm -lgdi32 -lcomdlg32 #-lintl -RESOBJ = cdvdiso.o - -OBJS = ../CDVDiso.o ../libiso.o -OBJS+= Config.o Win32.o ${RESOBJ} -OBJS+= ../zlib/adler32.o ../zlib/compress.o ../zlib/crc32.o ../zlib/gzio.o ../zlib/uncompr.o ../zlib/deflate.o ../zlib/trees.o \ - ../zlib/zutil.o ../zlib/inflate.o ../zlib/infback.o ../zlib/inftrees.o ../zlib/inffast.o -OBJS+= ../bzip2/blocksort.o ../bzip2/bzlib.o \ - ../bzip2/compress.o ../bzip2/crctable.o \ - ../bzip2/decompress.o ../bzip2/huffman.o \ - ../bzip2/randtable.o - -DEPS:= $(OBJS:.o=.d) - -CFLAGS = -Wall ${OPTIMIZE} -I. -I.. -I/usr/local/include -I../zlib -I../bzip2 ${FLAGS} - -cdvdiso: ${OBJS} - dllwrap --def plugin.def -o ${PLUGIN} ${OBJS} ${LIBS} -# ${CC} -shared -Wl,--kill-at,--output-def,plugin.def ${CFLAGS} ${OBJS} -o ${PLUGIN} ${LIBS} - ${STRIP} ${PLUGIN} - -.PHONY: clean cdvdiso - -clean: - ${RM} ${OBJS} ${DEPS} ${PCSX2} - -%.o: %.asm - ${NASM} ${ASMFLAGS} -o $@ $< - -%.o: %.c - ${CC} ${CFLAGS} -c -o $@ $< -MD -MF $(patsubst %.o,%.d,$@) - -${RESOBJ}: CDVDiso.rc - ${RC} -D__MINGW32__ -I rc -O coff -o $@ -i $< - --include ${DEPS} - - \ No newline at end of file diff --git a/plugins/CDVDiso/src/Windows/Win32.cpp b/plugins/CDVDiso/src/Windows/Win32.cpp deleted file mode 100644 index a6458b5c4b..0000000000 --- a/plugins/CDVDiso/src/Windows/Win32.cpp +++ /dev/null @@ -1,374 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#include - - -#include "Config.h" -#include "../CDVDiso.h" -#include "resource.h" - -HINSTANCE hInst; -#define MAXFILENAME 256 - -u8 Zbuf[2352 * 10 * 2]; -HWND hDlg; -HWND hProgress; -HWND hIsoFile; -HWND hMethod; -HWND hBlockDump; -int stop; - -void SysMessage(char *fmt, ...) -{ - va_list list; - char tmp[512]; - - va_start(list, fmt); - vsprintf(tmp, fmt, list); - va_end(list); - MessageBox(GetActiveWindow(), tmp, "CDVDiso Msg", 0); -} - -int _GetFile(char *out) -{ - OPENFILENAME ofn; - char szFileName[MAXFILENAME]; - char szFileTitle[MAXFILENAME]; - - memset(&szFileName, 0, sizeof(szFileName)); - memset(&szFileTitle, 0, sizeof(szFileTitle)); - - ofn.lStructSize = sizeof(OPENFILENAME); - ofn.hwndOwner = GetActiveWindow(); - ofn.lpstrFilter = - "Supported Formats\0*.bin;*.iso;*.img;*.nrg;*.mdf;*.Z;*.Z2;*.BZ2;*.dump\0" - "Cd Iso Format (*.bin;*.iso;*.img;*.nrg;*.mdf)\0" - "*.bin;*.iso;*.img;*.nrg;*.mdf\0" - "Compressed Z Iso Format (*.Z;*.Z2)\0" - "*.Z;*.Z2\0Compressed BZ Iso Format (*.BZ2)\0" - "*.BZ2\0Block Dumps (*.dump)\0*.dump\0All Files\0*.*\0"; - - ofn.lpstrCustomFilter = NULL; - ofn.nMaxCustFilter = 0; - ofn.nFilterIndex = 1; - ofn.lpstrFile = szFileName; - ofn.nMaxFile = MAXFILENAME; - ofn.lpstrInitialDir = (IsoCWD[0] == 0) ? NULL : IsoCWD; - ofn.lpstrFileTitle = szFileTitle; - ofn.nMaxFileTitle = MAXFILENAME; - ofn.lpstrTitle = NULL; - ofn.lpstrDefExt = NULL; - ofn.Flags = OFN_HIDEREADONLY; - - if (GetOpenFileName((LPOPENFILENAME)&ofn)) { - strcpy(out, szFileName); - return 1; - } - - return 0; -} - -int _OpenFile(int saveConf) -{ - - int retval = 0; - - // for saving the pcsx2 current working directory; - char *cwd_pcsx2 = _getcwd(NULL, MAXFILENAME); - - if (IsoCWD[0] != 0) - _chdir(IsoCWD); - - if (_GetFile(IsoFile) == 1) { - // Save the user's new cwd: - if (_getcwd(IsoCWD, MAXFILENAME) == NULL) - IsoCWD[0] = 0; - - if (saveConf) - SaveConf(); - - retval = 1; - } - - // Restore Pcsx2's path. - if (cwd_pcsx2 != NULL) { - _chdir(cwd_pcsx2); - free(cwd_pcsx2); - cwd_pcsx2 = NULL; - } - return retval; -} - -void CfgOpenFile() -{ - _OpenFile(TRUE); -} - -void UpdZmode() -{ - if (ComboBox_GetCurSel(hMethod) == 0) { - Zmode = 1; - } else { - Zmode = 2; - } -} - - -void SysUpdate() -{ - MSG msg; - - while (PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } -} - -void OnCompress() -{ - u32 lsn; - u8 cdbuff[10 * 2352]; - char Zfile[256]; - int ret; - isoFile *src; - isoFile *dst; - - Edit_GetText(hIsoFile, IsoFile, 256); - UpdZmode(); - - if (Zmode == 1) { - sprintf(Zfile, "%s.Z2", IsoFile); - } else { - sprintf(Zfile, "%s.BZ2", IsoFile); - } - - src = isoOpen(IsoFile); - if (src == NULL) - return; - if (Zmode == 1) { - dst = isoCreate(Zfile, ISOFLAGS_Z2); - } else { - dst = isoCreate(Zfile, ISOFLAGS_BZ2); - } - if (dst == NULL) - return; - - isoSetFormat(dst, src->blockofs, src->blocksize, src->blocks); - Button_Enable(GetDlgItem(hDlg, IDC_COMPRESSISO), FALSE); - Button_Enable(GetDlgItem(hDlg, IDC_DECOMPRESSISO), FALSE); - stop = 0; - - for (lsn = 0; lsn < src->blocks; lsn++) { - //printf("block %d ", lsn); - //putchar(13); - //fflush(stdout); - ret = isoReadBlock(src, cdbuff, lsn); - if (ret == -1) - break; - ret = isoWriteBlock(dst, cdbuff, lsn); - if (ret == -1) - break; - - SendMessage(hProgress, PBM_SETPOS, (lsn * 100) / src->blocks, 0); - SysUpdate(); - if (stop) - break; - } - isoClose(src); - isoClose(dst); - - if (!stop) - Edit_SetText(hIsoFile, Zfile); - - Button_Enable(GetDlgItem(hDlg, IDC_COMPRESSISO), TRUE); - Button_Enable(GetDlgItem(hDlg, IDC_DECOMPRESSISO), TRUE); - - if (!stop) { - if (ret == -1) { - SysMessage("Error compressing iso image"); - } else { - SysMessage("Iso image compressed OK"); - } - } -} - -void OnDecompress() -{ - char file[256]; - u8 cdbuff[10 * 2352]; - u32 lsn; - isoFile *src; - isoFile *dst; - int ret; - - Edit_GetText(hIsoFile, IsoFile, 256); - - src = isoOpen(IsoFile); - if (src == NULL) - return; - - strcpy(file, IsoFile); - if (src->flags & ISOFLAGS_Z) { - file[strlen(file) - 2] = 0; - } else if (src->flags & ISOFLAGS_Z2) { - file[strlen(file) - 3] = 0; - } else if (src->flags & ISOFLAGS_BZ2) { - file[strlen(file) - 3] = 0; - } else { - SysMessage("%s is not a compressed image", IsoFile); - return; - } - - dst = isoCreate(file, 0); - if (dst == NULL) - return; - - isoSetFormat(dst, src->blockofs, src->blocksize, src->blocks); - Button_Enable(GetDlgItem(hDlg, IDC_COMPRESSISO), FALSE); - Button_Enable(GetDlgItem(hDlg, IDC_DECOMPRESSISO), FALSE); - stop = 0; - - for (lsn = 0; lsn < src->blocks; lsn++) { - printf("block %d ", lsn); - putchar(13); - fflush(stdout); - ret = isoReadBlock(src, cdbuff, lsn); - if (ret == -1) - break; - ret = isoWriteBlock(dst, cdbuff, lsn); - if (ret == -1) - break; - - SendMessage(hProgress, PBM_SETPOS, (lsn * 100) / src->blocks, 0); - SysUpdate(); - if (stop) - break; - } - if (!stop) - Edit_SetText(hIsoFile, file); - - isoClose(src); - isoClose(dst); - - Button_Enable(GetDlgItem(hDlg, IDC_COMPRESSISO), TRUE); - Button_Enable(GetDlgItem(hDlg, IDC_DECOMPRESSISO), TRUE); - - if (!stop) { - if (ret == -1) { - SysMessage("Error decompressing iso image"); - } else { - SysMessage("Iso image decompressed OK"); - } - } -} - -BOOL CALLBACK ConfigureDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - int i; - - switch (uMsg) { - case WM_INITDIALOG: - hDlg = hW; - LoadConf(); - - hProgress = GetDlgItem(hW, IDC_PROGRESS); - hIsoFile = GetDlgItem(hW, IDC_ISOFILE); - hMethod = GetDlgItem(hW, IDC_METHOD); - hBlockDump = GetDlgItem(hW, IDC_BLOCKDUMP); - - for (i = 0; methods[i] != NULL; i++) { - ComboBox_AddString(hMethod, methods[i]); - } - - Edit_SetText(hIsoFile, IsoFile); - ComboBox_SetCurSel(hMethod, 0); - /* if (strstr(IsoFile, ".Z") != NULL) - ComboBox_SetCurSel(hMethod, 1); - else ComboBox_SetCurSel(hMethod, 0);*/ - Button_SetCheck(hBlockDump, BlockDump); - - return TRUE; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDC_SELECTISO: - if (_OpenFile(FALSE) == 1) - Edit_SetText(hIsoFile, IsoFile); - return TRUE; - - case IDC_COMPRESSISO: - OnCompress(); - return TRUE; - - case IDC_DECOMPRESSISO: - OnDecompress(); - return TRUE; - - case IDC_STOP: - stop = 1; - return TRUE; - - case IDCANCEL: - EndDialog(hW, TRUE); - return TRUE; - - case IDOK: - Edit_GetText(hIsoFile, IsoFile, 256); - BlockDump = Button_GetCheck(hBlockDump); - - SaveConf(); - EndDialog(hW, FALSE); - return TRUE; - } - } - return FALSE; -} - -EXPORT_C_(void) -CDVDconfigure() -{ - DialogBox(hInst, - MAKEINTRESOURCE(IDD_CONFIG), - GetActiveWindow(), - (DLGPROC)ConfigureDlgProc); -} - -BOOL CALLBACK AboutDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch (uMsg) { - case WM_INITDIALOG: - return TRUE; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDOK: - EndDialog(hW, TRUE); - return FALSE; - } - } - return FALSE; -} - -EXPORT_C_(void) -CDVDabout() -{ - DialogBox(hInst, - MAKEINTRESOURCE(IDD_ABOUT), - GetActiveWindow(), - (DLGPROC)AboutDlgProc); -} - -BOOL APIENTRY DllMain(HANDLE hModule, // DLL INIT - DWORD dwReason, - LPVOID lpReserved) -{ - hInst = (HINSTANCE)hModule; - return TRUE; // very quick :) -} diff --git a/plugins/CDVDiso/src/Windows/resource.h b/plugins/CDVDiso/src/Windows/resource.h deleted file mode 100644 index 0aebd9c9e8..0000000000 --- a/plugins/CDVDiso/src/Windows/resource.h +++ /dev/null @@ -1,28 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by CDVDiso.rc -// -#define IDD_CONFDLG 101 -#define IDD_CONFIG 101 -#define IDD_ABOUT 103 -#define IDC_NAME 1000 -#define IDC_ISOFILE 1000 -#define IDC_SELECTISO 1001 -#define IDC_COMPRESSISO 1002 -#define IDC_DECOMPRESSISO 1003 -#define IDC_METHOD 1004 -#define IDC_PROGRESS 1005 -#define IDC_STOP 1006 -#define IDC_BLOCKDUMP 1007 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 105 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1008 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif - diff --git a/plugins/CDVDiso/src/libiso.cpp b/plugins/CDVDiso/src/libiso.cpp deleted file mode 100644 index f2deed51e3..0000000000 --- a/plugins/CDVDiso/src/libiso.cpp +++ /dev/null @@ -1,1051 +0,0 @@ -#define __USE_LARGEFILE64 -#define __USE_FILE_OFFSET64 -#define _FILE_OFFSET_BITS 64 - -#ifdef __GNUC__ -#ifndef _LARGEFILE_SOURCE -#define _LARGEFILE_SOURCE -#endif - -#ifndef _LARGEFILE64_SOURCE -#define _LARGEFILE64_SOURCE -#endif -#endif - -#ifdef _WIN32 -#include -#endif - -#include -#include -#include -#include -#include -#include - -#include "zlib.h" -#include "bzlib.h" - -#include "CDVDiso.h" -#include "libiso.h" - -/* some structs from libcdvd by Hiryu & Sjeep (C) 2002 */ - -#if defined(_WIN32) -#pragma pack(1) -#endif - -struct rootDirTocHeader -{ - u16 length; //+00 - u32 tocLBA; //+02 - u32 tocLBA_bigend; //+06 - u32 tocSize; //+0A - u32 tocSize_bigend; //+0E - u8 dateStamp[8]; //+12 - u8 reserved[6]; //+1A - u8 reserved2; //+20 - u8 reserved3; //+21 -#if defined(_WIN32) -}; //+22 -#else -} __attribute__((packed)); -#endif - -struct asciiDate -{ - char year[4]; - char month[2]; - char day[2]; - char hours[2]; - char minutes[2]; - char seconds[2]; - char hundreths[2]; - char terminator[1]; -#if defined(_WIN32) -}; -#else -} __attribute__((packed)); -#endif - -struct cdVolDesc -{ - u8 filesystemType; // 0x01 = ISO9660, 0x02 = Joliet, 0xFF = NULL - u8 volID[5]; // "CD001" - u8 reserved2; - u8 reserved3; - u8 sysIdName[32]; - u8 volName[32]; // The ISO9660 Volume Name - u8 reserved5[8]; - u32 volSize; // Volume Size - u32 volSizeBig; // Volume Size Big-Endian - u8 reserved6[32]; - u32 unknown1; - u32 unknown1_bigend; - u16 volDescSize; //+80 - u16 volDescSize_bigend; //+82 - u32 unknown3; //+84 - u32 unknown3_bigend; //+88 - u32 priDirTableLBA; // LBA of Primary Dir Table //+8C - u32 reserved7; //+90 - u32 secDirTableLBA; // LBA of Secondary Dir Table //+94 - u32 reserved8; //+98 - struct rootDirTocHeader rootToc; - u8 volSetName[128]; - u8 publisherName[128]; - u8 preparerName[128]; - u8 applicationName[128]; - u8 copyrightFileName[37]; - u8 abstractFileName[37]; - u8 bibliographyFileName[37]; - struct asciiDate creationDate; - struct asciiDate modificationDate; - struct asciiDate effectiveDate; - struct asciiDate expirationDate; - u8 reserved10; - u8 reserved11[1166]; -#if defined(_WIN32) -}; -#else -} __attribute__((packed)); -#endif - - -#ifdef _WIN32 -void *_openfile(const char *filename, int flags) -{ - HANDLE handle; - - // printf("_openfile %s, %d\n", filename, flags & O_RDONLY); - if (flags & O_WRONLY) { - int _flags = CREATE_NEW; - if (flags & O_CREAT) - _flags = CREATE_ALWAYS; - handle = CreateFile(filename, GENERIC_WRITE, 0, NULL, _flags, 0, NULL); - } else { - handle = CreateFile(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); - } - - return handle == INVALID_HANDLE_VALUE ? NULL : handle; -} - -u64 _tellfile(void *handle) -{ - u64 ofs; - PLONG _ofs = (LONG *)&ofs; - _ofs[1] = 0; - _ofs[0] = SetFilePointer(handle, 0, &_ofs[1], FILE_CURRENT); - return ofs; -} - -int _seekfile(void *handle, u64 offset, int whence) -{ - u64 ofs = (u64)offset; - PLONG _ofs = (LONG *)&ofs; - // printf("_seekfile %p, %d_%d\n", handle, _ofs[1], _ofs[0]); - if (whence == SEEK_SET) { - SetFilePointer(handle, _ofs[0], &_ofs[1], FILE_BEGIN); - } else { - SetFilePointer(handle, _ofs[0], &_ofs[1], FILE_END); - } - return 0; -} - -int _readfile(void *handle, void *dst, int size) -{ - DWORD ret; - - // printf("_readfile %p %d\n", handle, size); - ReadFile(handle, dst, size, &ret, NULL); - // printf("_readfile ret %d; %d\n", ret, GetLastError()); - return ret; -} - -int _writefile(void *handle, const void *src, int size) -{ - DWORD ret; - - // printf("_writefile %p, %d\n", handle, size); - // _seekfile(handle, _tellfile(handle)); - WriteFile(handle, src, size, &ret, NULL); - // printf("_writefile ret %d\n", ret); - return ret; -} - -void _closefile(void *handle) -{ - CloseHandle(handle); -} - -#else - -void *_openfile(const char *filename, int flags) -{ - printf("_openfile %s %x\n", filename, flags); - - if (flags & O_WRONLY) - return fopen64(filename, "wb"); - else - return fopen64(filename, "rb"); -} - -#include - -u64 _tellfile(void *handle) -{ - FILE *fp = (FILE *)handle; - s64 cursize = ftell(fp); - if (cursize == -1) { - // try 64bit - cursize = ftello64(fp); - if (cursize < -1) { - // zero top 32 bits - cursize &= 0xffffffff; - } - } - return cursize; -} - -int _seekfile(void *handle, u64 offset, int whence) -{ - int seekerr = fseeko64((FILE *)handle, offset, whence); - - if (seekerr == -1) - printf("failed to seek\n"); - - return seekerr; -} - -int _readfile(void *handle, void *dst, int size) -{ - return fread(dst, 1, size, (FILE *)handle); -} - -int _writefile(void *handle, const void *src, int size) -{ - return fwrite(src, 1, size, (FILE *)handle); -} - -void _closefile(void *handle) -{ - fclose((FILE *)handle); -} - -#endif - -int detect(isoFile *iso) -{ - u8 buf[2448]; - struct cdVolDesc *volDesc; - - if (isoReadBlock(iso, buf, 16) == -1) - return -1; - - volDesc = (struct cdVolDesc *)(buf + 24); - - if (strncmp((char *)volDesc->volID, "CD001", 5)) - return 0; - - if (volDesc->rootToc.tocSize == 2048) - iso->type = ISOTYPE_CD; - else - iso->type = ISOTYPE_DVD; - - return 1; -} - -int _isoReadZtable(isoFile *iso) -{ - void *handle; - char table[256]; - int size; - - sprintf(table, "%s.table", iso->filename); - handle = _openfile(table, O_RDONLY); - if (handle == NULL) { - printf("Error loading %s\n", table); - return -1; - } - - _seekfile(handle, 0, SEEK_END); - size = _tellfile(handle); - iso->Ztable = (char *)malloc(size); - - if (iso->Ztable == NULL) { - return -1; - } - - _seekfile(handle, 0, SEEK_SET); - _readfile(handle, iso->Ztable, size); - _closefile(handle); - - iso->blocks = size / 6; - - return 0; -} - -int _isoReadZ2table(isoFile *iso) -{ - void *handle; - char table[256]; - u32 *Ztable; - int ofs, size, i; - - sprintf(table, "%s.table", iso->filename); - handle = _openfile(table, O_RDONLY); - - if (handle == NULL) { - printf("Error loading %s\n", table); - return -1; - } - - _seekfile(handle, 0, SEEK_END); - size = _tellfile(handle); - Ztable = (u32 *)malloc(size); - - if (Ztable == NULL) { - return -1; - } - - _seekfile(handle, 0, SEEK_SET); - _readfile(handle, Ztable, size); - _closefile(handle); - - iso->Ztable = (char *)malloc(iso->blocks * 8); - - if (iso->Ztable == NULL) { - free(Ztable); - return -1; - } - - ofs = 16; - - for (i = 0; i < iso->blocks; i++) { - *(u32 *)&iso->Ztable[i * 8 + 0] = ofs; - *(u32 *)&iso->Ztable[i * 8 + 4] = Ztable[i]; - ofs += Ztable[i]; - } - - free(Ztable); - - return 0; -} - -int _isoReadBZ2table(isoFile *iso) -{ - void *handle; - char table[256]; - u32 *Ztable; - int ofs; - int size; - int i; - - sprintf(table, "%s.table", iso->filename); - handle = _openfile(table, O_RDONLY); - if (handle == NULL) { - printf("Error loading %s\n", table); - return -1; - } - - _seekfile(handle, 0, SEEK_END); - size = _tellfile(handle); - Ztable = (u32 *)malloc(size); - if (Ztable == NULL) - return -1; - - _seekfile(handle, 0, SEEK_SET); - _readfile(handle, Ztable, size); - _closefile(handle); - - iso->Ztable = (char *)malloc(iso->blocks * 8); - if (iso->Ztable == NULL) { - free(Ztable); - return -1; - } - - - ofs = 16; - - for (i = 0; i < iso->blocks / 16; i++) { - *(u32 *)&iso->Ztable[i * 8 + 0] = ofs; - *(u32 *)&iso->Ztable[i * 8 + 4] = Ztable[i]; - ofs += Ztable[i]; - } - - if (iso->blocks & 0xf) { - *(u32 *)&iso->Ztable[i * 8 + 0] = ofs; - *(u32 *)&iso->Ztable[i * 8 + 4] = Ztable[i]; - ofs += Ztable[i]; - } - - free(Ztable); - - return 0; -} - -int _isoReadDtable(isoFile *iso) -{ - int ret; - int i; - - _seekfile(iso->handle, 0, SEEK_END); - iso->dtablesize = (_tellfile(iso->handle) - 16) / (iso->blocksize + 4); - iso->dtable = (u32 *)malloc(iso->dtablesize * 4); - - for (i = 0; i < iso->dtablesize; i++) { - _seekfile(iso->handle, 16 + (iso->blocksize + 4) * i, SEEK_SET); - ret = _readfile(iso->handle, &iso->dtable[i], 4); - if (ret < 4) - return -1; - } - - return 0; -} - -int isoDetect(isoFile *iso) // based on florin's CDVDbin detection code :) -{ - char buf[32]; - int len; - - iso->type = ISOTYPE_ILLEGAL; - - len = strlen(iso->filename); - if (len >= 2) { - if (!strncmp(iso->filename + (len - 2), ".Z", 2)) { - iso->flags = ISOFLAGS_Z; - iso->blocksize = 2352; - _isoReadZtable(iso); - return detect(iso) == 1 ? 0 : -1; - } - } - - _seekfile(iso->handle, 0, SEEK_SET); - _readfile(iso->handle, buf, 4); - - if (strncmp(buf, "BDV2", 4) == 0) { - iso->flags = ISOFLAGS_BLOCKDUMP; - _readfile(iso->handle, &iso->blocksize, 4); - _readfile(iso->handle, &iso->blocks, 4); - _readfile(iso->handle, &iso->blockofs, 4); - _isoReadDtable(iso); - return detect(iso) == 1 ? 0 : -1; - } else if (strncmp(buf, "Z V2", 4) == 0) { - iso->flags = ISOFLAGS_Z2; - _readfile(iso->handle, &iso->blocksize, 4); - _readfile(iso->handle, &iso->blocks, 4); - _readfile(iso->handle, &iso->blockofs, 4); - _isoReadZ2table(iso); - return detect(iso) == 1 ? 0 : -1; - } else if (strncmp(buf, "BZV2", 4) == 0) { - iso->flags = ISOFLAGS_BZ2; - _readfile(iso->handle, &iso->blocksize, 4); - _readfile(iso->handle, &iso->blocks, 4); - _readfile(iso->handle, &iso->blockofs, 4); - iso->buflsn = -1; - iso->buffer = (u8 *)malloc(iso->blocksize * 16); - if (iso->buffer == NULL) - return -1; - _isoReadBZ2table(iso); - return detect(iso) == 1 ? 0 : -1; - } else { - iso->blocks = 16; - } - - // ISO 2048 - iso->blocksize = 2048; - iso->offset = 0; - iso->blockofs = 24; - if (detect(iso) == 1) - return 0; - - // RAW 2336 - iso->blocksize = 2336; - iso->offset = 0; - iso->blockofs = 16; - if (detect(iso) == 1) - return 0; - - // RAW 2352 - iso->blocksize = 2352; - iso->offset = 0; - iso->blockofs = 0; - if (detect(iso) == 1) - return 0; - - // RAWQ 2448 - iso->blocksize = 2448; - iso->offset = 0; - iso->blockofs = 0; - if (detect(iso) == 1) - return 0; - - // NERO ISO 2048 - iso->blocksize = 2048; - iso->offset = 150 * 2048; - iso->blockofs = 24; - if (detect(iso) == 1) - return 0; - - // NERO RAW 2352 - iso->blocksize = 2352; - iso->offset = 150 * 2048; - iso->blockofs = 0; - if (detect(iso) == 1) - return 0; - - // NERO RAWQ 2448 - iso->blocksize = 2448; - iso->offset = 150 * 2048; - iso->blockofs = 0; - if (detect(iso) == 1) - return 0; - - // ISO 2048 - iso->blocksize = 2048; - iso->offset = -8; - iso->blockofs = 24; - if (detect(iso) == 1) - return 0; - - // RAW 2352 - iso->blocksize = 2352; - iso->offset = -8; - iso->blockofs = 0; - if (detect(iso) == 1) - return 0; - - // RAWQ 2448 - iso->blocksize = 2448; - iso->offset = -8; - iso->blockofs = 0; - if (detect(iso) == 1) - return 0; - - iso->offset = 0; - iso->blocksize = 2352; - iso->type = ISOTYPE_AUDIO; - return 0; - - return -1; -} - -isoFile *isoOpen(const char *filename) -{ - isoFile *iso; - int i; - - iso = (isoFile *)malloc(sizeof(isoFile)); - if (iso == NULL) - return NULL; - - memset(iso, 0, sizeof(isoFile)); - strcpy(iso->filename, filename); - - iso->handle = _openfile(iso->filename, O_RDONLY); - if (iso->handle == NULL) { - printf("Error loading %s\n", iso->filename); - free(iso); - return NULL; - } - - if (isoDetect(iso) == -1) - return NULL; - - printf("detected blocksize = %d\n", iso->blocksize); - - if (strlen(iso->filename) > 3 && strncmp(iso->filename + (strlen(iso->filename) - 3), "I00", 3) == 0) { - _closefile(iso->handle); - iso->flags |= ISOFLAGS_MULTI; - iso->blocks = 0; - for (i = 0; i < 8; i++) { - iso->filename[strlen(iso->filename) - 1] = '0' + i; - iso->multih[i].handle = _openfile(iso->filename, O_RDONLY); - if (iso->multih[i].handle == NULL) { - break; - } - iso->multih[i].slsn = iso->blocks; - _seekfile(iso->multih[i].handle, 0, SEEK_END); - iso->blocks += (u32)((_tellfile(iso->multih[i].handle) - iso->offset) / - (iso->blocksize)); - iso->multih[i].elsn = iso->blocks - 1; - } - - if (i == 0) { - return NULL; - } - } - - if (iso->flags == 0) { - _seekfile(iso->handle, 0, SEEK_END); - iso->blocks = (u32)((_tellfile(iso->handle) - iso->offset) / - (iso->blocksize)); - } - - - printf("isoOpen: %s ok\n", iso->filename); - printf("offset = %d\n", iso->offset); - printf("blockofs = %d\n", iso->blockofs); - printf("blocksize = %d\n", iso->blocksize); - printf("blocks = %d\n", iso->blocks); - printf("type = %d\n", iso->type); - - return iso; -} - -isoFile *isoCreate(const char *filename, int flags) -{ - isoFile *iso; - char Zfile[256]; - - iso = (isoFile *)malloc(sizeof(isoFile)); - if (iso == NULL) - return NULL; - - memset(iso, 0, sizeof(isoFile)); - strcpy(iso->filename, filename); - iso->flags = flags; - iso->offset = 0; - iso->blockofs = 24; - iso->blocksize = CD_FRAMESIZE_RAW; - iso->blocksize = 2048; - - if (iso->flags & (ISOFLAGS_Z | ISOFLAGS_Z2 | ISOFLAGS_BZ2)) { - sprintf(Zfile, "%s.table", iso->filename); - iso->htable = _openfile(Zfile, O_WRONLY); - if (iso->htable == NULL) { - free(iso); - return NULL; - } - } - - iso->handle = _openfile(iso->filename, O_WRONLY | O_CREAT); - if (iso->handle == NULL) { - printf("Error loading %s\n", iso->filename); - free(iso); - return NULL; - } - printf("isoCreate: %s ok\n", iso->filename); - printf("offset = %d\n", iso->offset); - - return iso; -} - -int isoSetFormat(isoFile *iso, int blockofs, int blocksize, int blocks) -{ - iso->blocksize = blocksize; - iso->blocks = blocks; - iso->blockofs = blockofs; - printf("blockofs = %d\n", iso->blockofs); - printf("blocksize = %d\n", iso->blocksize); - printf("blocks = %d\n", iso->blocks); - if (iso->flags & ISOFLAGS_Z2) { - if (_writefile(iso->handle, "Z V2", 4) < 4) - return -1; - if (_writefile(iso->handle, &blocksize, 4) < 4) - return -1; - if (_writefile(iso->handle, &blocks, 4) < 4) - return -1; - if (_writefile(iso->handle, &blockofs, 4) < 4) - return -1; - } - if (iso->flags & ISOFLAGS_BZ2) { - if (_writefile(iso->handle, "BZV2", 4) < 4) - return -1; - if (_writefile(iso->handle, &blocksize, 4) < 4) - return -1; - if (_writefile(iso->handle, &blocks, 4) < 4) - return -1; - if (_writefile(iso->handle, &blockofs, 4) < 4) - return -1; - iso->buflsn = -1; - iso->buffer = (u8 *)malloc(iso->blocksize * 16); - if (iso->buffer == NULL) - return -1; - } - if (iso->flags & ISOFLAGS_BLOCKDUMP) { - if (_writefile(iso->handle, "BDV2", 4) < 4) - return -1; - if (_writefile(iso->handle, &blocksize, 4) < 4) - return -1; - if (_writefile(iso->handle, &blocks, 4) < 4) - return -1; - if (_writefile(iso->handle, &blockofs, 4) < 4) - return -1; - } - - return 0; -} - -s32 MSFtoLSN(u8 *Time) -{ - u32 lsn; - - lsn = Time[2]; - lsn += (Time[1] - 2) * 75; - lsn += Time[0] * 75 * 60; - return lsn; -} - -void LSNtoMSF(u8 *Time, s32 lsn) -{ - u8 m, s, f; - - lsn += 150; - m = lsn / 4500; // minuten - lsn = lsn - m * 4500; // minuten rest - s = lsn / 75; // sekunden - f = lsn - (s * 75); // sekunden rest - Time[0] = itob(m); - Time[1] = itob(s); - Time[2] = itob(f); -} - -int _isoReadBlock(isoFile *iso, u8 *dst, int lsn) -{ - u64 ofs = (u64)lsn * iso->blocksize + iso->offset; - int ret; - - // printf("_isoReadBlock %d, blocksize=%d, blockofs=%d\n", lsn, iso->blocksize, iso->blockofs); - memset(dst, 0, iso->blockofs); - _seekfile(iso->handle, ofs, SEEK_SET); - ret = _readfile(iso->handle, dst + iso->blockofs, iso->blocksize); - if (ret < iso->blocksize) { - printf("read error %d\n", ret); - return -1; - } - - return 0; -} - -int _isoReadBlockZ(isoFile *iso, u8 *dst, int lsn) -{ - u32 pos, p; - uLongf size; - u8 Zbuf[CD_FRAMESIZE_RAW * 2]; - int ret; - - // printf("_isoReadBlockZ %d, %d\n", lsn, iso->blocksize); - pos = *(unsigned long *)&iso->Ztable[lsn * 6]; - p = *(unsigned short *)&iso->Ztable[lsn * 6 + 4]; - // printf("%d, %d\n", pos, p); - _seekfile(iso->handle, pos, SEEK_SET); - ret = _readfile(iso->handle, Zbuf, p); - if (ret < p) { - printf("error reading block!!\n"); - return -1; - } - - size = CD_FRAMESIZE_RAW; - uncompress(dst, &size, Zbuf, p); - - return 0; -} - -int _isoReadBlockZ2(isoFile *iso, u8 *dst, int lsn) -{ - u32 pos, p; - uLongf size; - u8 Zbuf[16 * 1024]; - int ret; - - // printf("_isoReadBlockZ2 %d, %d\n", lsn, iso->blocksize); - pos = *(u32 *)&iso->Ztable[lsn * 8]; - p = *(u32 *)&iso->Ztable[lsn * 8 + 4]; - // printf("%d, %d\n", pos, p); - _seekfile(iso->handle, pos, SEEK_SET); - ret = _readfile(iso->handle, Zbuf, p); - if (ret < p) { - printf("error reading block!!\n"); - return -1; - } - - size = iso->blocksize; - uncompress(dst + iso->blockofs, &size, Zbuf, p); - - return 0; -} - -int _isoReadBlockBZ2(isoFile *iso, u8 *dst, int lsn) -{ - u32 pos, p; - u32 size; - u8 Zbuf[64 * 1024]; - int ret; - - if ((lsn / 16) == iso->buflsn) { - memset(dst, 0, iso->blockofs); - memcpy(dst + iso->blockofs, iso->buffer + (iso->blocksize * (lsn & 0xf)), iso->blocksize); - return 0; - } - - iso->buflsn = lsn / 16; - // printf("_isoReadBlockBZ2 %d, %d\n", lsn, iso->blocksize); - pos = *(u32 *)&iso->Ztable[(lsn / 16) * 8]; - p = *(u32 *)&iso->Ztable[(lsn / 16) * 8 + 4]; - // printf("%d, %d\n", pos, p); - _seekfile(iso->handle, pos, SEEK_SET); - ret = _readfile(iso->handle, Zbuf, p); - - if (ret < p) { - printf("error reading block!!\n"); - return -1; - } - - size = iso->blocksize * 64; - ret = BZ2_bzBuffToBuffDecompress((s8 *)iso->buffer, &size, (s8 *)Zbuf, p, 0, 0); - - if (ret != BZ_OK) { - printf("_isoReadBlockBZ2 %d, %d\n", lsn, iso->blocksize); - printf("%d, %d\n", pos, p); - printf("error on BZ2: %d\n", ret); - } - - memset(dst, 0, iso->blockofs); - memcpy(dst + iso->blockofs, iso->buffer + (iso->blocksize * (lsn & 0xf)), iso->blocksize); - - return 0; -} - -int _isoReadBlockD(isoFile *iso, u8 *dst, int lsn) -{ - int ret; - int i; - - // printf("_isoReadBlockD %d, blocksize=%d, blockofs=%d\n", lsn, iso->blocksize, iso->blockofs); - memset(dst, 0, iso->blockofs); - for (i = 0; i < iso->dtablesize; i++) { - if (iso->dtable[i] != lsn) - continue; - - _seekfile(iso->handle, 16 + i * (iso->blocksize + 4) + 4, SEEK_SET); - ret = _readfile(iso->handle, dst + iso->blockofs, iso->blocksize); - if (ret < iso->blocksize) - return -1; - - return 0; - } - printf("block %d not found in dump\n", lsn); - - return -1; -} - -int _isoReadBlockM(isoFile *iso, u8 *dst, int lsn) -{ - u64 ofs; - int ret; - int i; - - for (i = 0; i < 8; i++) { - if (lsn >= iso->multih[i].slsn && - lsn <= iso->multih[i].elsn) { - break; - } - } - if (i == 8) - return -1; - - ofs = (u64)(lsn - iso->multih[i].slsn) * iso->blocksize + iso->offset; - // printf("_isoReadBlock %d, blocksize=%d, blockofs=%d\n", lsn, iso->blocksize, iso->blockofs); - memset(dst, 0, iso->blockofs); - _seekfile(iso->multih[i].handle, ofs, SEEK_SET); - ret = _readfile(iso->multih[i].handle, dst + iso->blockofs, iso->blocksize); - - if (ret < iso->blocksize) { - printf("read error %d\n", ret); - return -1; - } - - return 0; -} - -int isoReadBlock(isoFile *iso, u8 *dst, int lsn) -{ - int ret; - - if (lsn > iso->blocks) { - printf("isoReadBlock: %d > %d\n", lsn, iso->blocks); - return -1; - } - - if (iso->flags & ISOFLAGS_Z) - ret = _isoReadBlockZ(iso, dst, lsn); - else if (iso->flags & ISOFLAGS_Z2) - ret = _isoReadBlockZ2(iso, dst, lsn); - else if (iso->flags & ISOFLAGS_BLOCKDUMP) - ret = _isoReadBlockD(iso, dst, lsn); - else if (iso->flags & ISOFLAGS_MULTI) - ret = _isoReadBlockM(iso, dst, lsn); - else if (iso->flags & ISOFLAGS_BZ2) - ret = _isoReadBlockBZ2(iso, dst, lsn); - else - ret = _isoReadBlock(iso, dst, lsn); - - if (ret == -1) - return ret; - - if (iso->type == ISOTYPE_CD) { - LSNtoMSF(dst + 12, lsn); - dst[15] = 2; - } - - return 0; -} - - -int _isoWriteBlock(isoFile *iso, u8 *src, int lsn) -{ - u64 ofs = (u64)lsn * iso->blocksize + iso->offset; - int ret; - - // printf("_isoWriteBlock %d (ofs=%d)\n", iso->blocksize, ofs); - _seekfile(iso->handle, ofs, SEEK_SET); - ret = _writefile(iso->handle, src + iso->blockofs, iso->blocksize); - // printf("_isoWriteBlock %d\n", ret); - if (ret < iso->blocksize) - return -1; - - return 0; -} - -int _isoWriteBlockZ(isoFile *iso, u8 *src, int lsn) -{ - u32 pos; - uLongf size; - u8 Zbuf[CD_FRAMESIZE_RAW]; - int ret; - - // printf("_isoWriteBlockZ %d\n", iso->blocksize); - size = 2352; - compress(Zbuf, &size, src, 2352); - // printf("_isoWriteBlockZ %d\n", size); - - pos = (u32)_tellfile(iso->handle); - ret = _writefile(iso->htable, &pos, 4); - if (ret < 4) - return -1; - ret = _writefile(iso->htable, &size, 2); - if (ret < 2) - return -1; - - ret = _writefile(iso->handle, Zbuf, size); - // printf("_isoWriteBlockZ %d\n", ret); - if (ret < size) { - printf("error writing block!!\n"); - return -1; - } - - return 0; -} - -int _isoWriteBlockZ2(isoFile *iso, u8 *src, int lsn) -{ - uLongf size; - u8 Zbuf[1024 * 16]; - int ret; - - // printf("_isoWriteBlockZ %d\n", iso->blocksize); - size = 1024 * 16; - compress(Zbuf, &size, src + iso->blockofs, iso->blocksize); - // printf("_isoWriteBlockZ %d\n", size); - - ret = _writefile(iso->htable, (u8 *)&size, 4); - if (ret < 4) - return -1; - ret = _writefile(iso->handle, Zbuf, size); - // printf("_isoWriteBlockZ %d\n", ret); - if (ret < size) { - printf("error writing block!!\n"); - return -1; - } - - return 0; -} - -int _isoWriteBlockD(isoFile *iso, u8 *src, int lsn) -{ - int ret; - - // printf("_isoWriteBlock %d (ofs=%d)\n", iso->blocksize, ofs); - ret = _writefile(iso->handle, &lsn, 4); - if (ret < 4) - return -1; - ret = _writefile(iso->handle, src + iso->blockofs, iso->blocksize); - // printf("_isoWriteBlock %d\n", ret); - if (ret < iso->blocksize) - return -1; - - return 0; -} - -int _isoWriteBlockBZ2(isoFile *iso, u8 *src, int lsn) -{ - u32 size; - u8 Zbuf[64 * 1024]; - int blocks; - int ret; - - memcpy(iso->buffer + (iso->blocksize * (lsn & 0xf)), src + iso->blockofs, iso->blocksize); - - if (lsn == (iso->blocks - 1)) { - blocks = (lsn & 0xf) + 1; - } else { - blocks = 16; - if ((lsn & 0xf) != 0xf) - return 0; - } - - // printf("_isoWriteBlockBZ2 %d\n", iso->blocksize); - size = 64 * 1024; - ret = BZ2_bzBuffToBuffCompress((s8 *)Zbuf, (u32 *)&size, (s8 *)iso->buffer, iso->blocksize * blocks, 9, 0, 30); - - if (ret != BZ_OK) { - printf("error on BZ2: %d\n", ret); - } - - // printf("_isoWriteBlockBZ2 %d\n", size); - - ret = _writefile(iso->htable, (u8 *)&size, 4); - if (ret < 4) - return -1; - ret = _writefile(iso->handle, Zbuf, size); - // printf("_isoWriteBlockZ %d\n", ret); - - if (ret < size) { - printf("error writing block!!\n"); - return -1; - } - - return 0; -} - -int isoWriteBlock(isoFile *iso, u8 *src, int lsn) -{ - int ret; - - if (iso->flags & ISOFLAGS_Z) - ret = _isoWriteBlockZ(iso, src, lsn); - else if (iso->flags & ISOFLAGS_Z2) - ret = _isoWriteBlockZ2(iso, src, lsn); - else if (iso->flags & ISOFLAGS_BLOCKDUMP) - ret = _isoWriteBlockD(iso, src, lsn); - else if (iso->flags & ISOFLAGS_BZ2) - ret = _isoWriteBlockBZ2(iso, src, lsn); - else - ret = _isoWriteBlock(iso, src, lsn); - - if (ret == -1) - return ret; - return 0; -} - -void isoClose(isoFile *iso) -{ - if (iso->handle) - _closefile(iso->handle); - if (iso->htable) - _closefile(iso->htable); - if (iso->buffer) - free(iso->buffer); - - free(iso); -} diff --git a/plugins/CDVDiso/src/libiso.h b/plugins/CDVDiso/src/libiso.h deleted file mode 100644 index e629e49942..0000000000 --- a/plugins/CDVDiso/src/libiso.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef __LIBISO_H__ -#define __LIBISO_H__ - -#ifdef _MSC_VER -#pragma warning(disable : 4018) -#endif - -#define ISOTYPE_ILLEGAL 0 -#define ISOTYPE_CD 1 -#define ISOTYPE_DVD 2 -#define ISOTYPE_AUDIO 3 - -#define ISOFLAGS_Z 0x0001 -#define ISOFLAGS_Z2 0x0002 -#define ISOFLAGS_BLOCKDUMP 0x0004 -#define ISOFLAGS_MULTI 0x0008 -#define ISOFLAGS_BZ2 0x0010 - -#define CD_FRAMESIZE_RAW 2352 -#define DATA_SIZE (CD_FRAMESIZE_RAW - 12) - -#define itob(i) ((i) / 10 * 16 + (i) % 10) /* u_char to BCD */ -#define btoi(b) ((b) / 16 * 10 + (b) % 16) /* BCD to u_char */ - -typedef struct -{ - u32 slsn; - u32 elsn; - void *handle; -} _multih; - -typedef struct -{ - char filename[256]; - u32 type; - u32 flags; - u32 offset; - u32 blockofs; - u32 blocksize; - u32 blocks; - void *handle; - void *htable; - char *Ztable; - u32 *dtable; - int dtablesize; - _multih multih[8]; - int buflsn; - u8 *buffer; -} isoFile; - - -isoFile *isoOpen(const char *filename); -isoFile *isoCreate(const char *filename, int mode); -int isoSetFormat(isoFile *iso, int blockofs, int blocksize, int blocks); -int isoDetect(isoFile *iso); -int isoReadBlock(isoFile *iso, u8 *dst, int lsn); -int isoWriteBlock(isoFile *iso, u8 *src, int lsn); -void isoClose(isoFile *iso); - -void *_openfile(const char *filename, int flags); -u64 _tellfile(void *handle); -int _seekfile(void *handle, u64 offset, int whence); -int _readfile(void *handle, void *dst, int size); -int _writefile(void *handle, const void *src, int size); -void _closefile(void *handle); - -#endif /* __LIBISO_H__ */ diff --git a/plugins/CDVDiso/src/mkiso/mkiso.cpp b/plugins/CDVDiso/src/mkiso/mkiso.cpp deleted file mode 100644 index 201cfea09b..0000000000 --- a/plugins/CDVDiso/src/mkiso/mkiso.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* CDVDiso - * Copyright (C) 2002-2004 CDVDiso Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include -#include -#include -#include -#include "string.h" - -#include "CDVDiso.h" - - -void Compress(char *filename, int mode) -{ - struct stat buf; - u32 lsn; - u8 cdbuff[1024 * 16]; - char Zfile[256]; - int ret = 0; - isoFile *src; - isoFile *dst; - - if (mode == 1) { - sprintf(Zfile, "%s.Z2", filename); - } else { - sprintf(Zfile, "%s.BZ2", filename); - } - - if (stat(Zfile, &buf) != -1) { - printf("'%s' already exists\n", Zfile); - return; - /* sprintf(str, "'%s' already exists, overwrite?", Zfile); - if (MessageBox(hDlg, str, "Question", MB_YESNO) != IDYES) { - return; - }*/ - } - - printf("src %s; dst %s\n", filename, Zfile); - src = isoOpen(filename); - if (src == NULL) - return; - - if (mode == 1) { - dst = isoCreate(Zfile, ISOFLAGS_Z2); - } else { - dst = isoCreate(Zfile, ISOFLAGS_BZ2); - } - isoSetFormat(dst, src->blockofs, src->blocksize, src->blocks); - if (dst == NULL) - return; - - for (lsn = 0; lsn < src->blocks; lsn++) { - printf("block %d ", lsn); - putchar(13); - fflush(stdout); - ret = isoReadBlock(src, cdbuff, lsn); - if (ret == -1) - break; - ret = isoWriteBlock(dst, cdbuff, lsn); - if (ret == -1) - break; - } - isoClose(src); - isoClose(dst); - - if (ret == -1) { - printf("Error compressing iso image\n"); - } else { - printf("Iso image compressed OK\n"); - } -} - -void Decompress(char *filename) -{ - struct stat buf; - char file[256]; - u8 cdbuff[10 * 2352]; - u32 lsn; - isoFile *src; - isoFile *dst; - int ret = 0; - - src = isoOpen(filename); - if (src == NULL) - return; - - strcpy(file, filename); - if (src->flags & ISOFLAGS_Z) - file[strlen(file) - 2] = 0; - else if (src->flags & ISOFLAGS_Z2) - file[strlen(file) - 3] = 0; - else if (src->flags & ISOFLAGS_BZ2) - file[strlen(file) - 3] = 0; - else { - printf("%s is not a compressed image\n", filename); - return; - } - - if (stat(file, &buf) != -1) { - char str[256]; - sprintf(str, "'%s' already exists", file); - isoClose(src); - return; - } - - dst = isoCreate(file, 0); - if (dst == NULL) - return; - isoSetFormat(dst, src->blockofs, src->blocksize, src->blocks); - - for (lsn = 0; lsn < src->blocks; lsn++) { - printf("block %d ", lsn); - putchar(13); - fflush(stdout); - ret = isoReadBlock(src, cdbuff, lsn); - if (ret == -1) - break; - ret = isoWriteBlock(dst, cdbuff, lsn); - if (ret == -1) - break; - } - - isoClose(src); - isoClose(dst); - - if (ret == -1) - printf("Error decompressing iso image\n"); - else - printf("Iso image decompressed OK\n"); -} - - -/*int main(int argc, char *argv[]) -{ - if (argc < 3) return 0; - - switch (argv[1][0]) - { - case 'c': - Compress(argv[2], 1); - break; - case 'C': - Compress(argv[2], 2); - break; - case 'd': - Decompress(argv[2]); - break; - default: break; - } - - return 0; -}*/ diff --git a/plugins/CDVDiso/src/mkiso/mkiso.dsp b/plugins/CDVDiso/src/mkiso/mkiso.dsp deleted file mode 100644 index 85e41361e0..0000000000 --- a/plugins/CDVDiso/src/mkiso/mkiso.dsp +++ /dev/null @@ -1,206 +0,0 @@ -# Microsoft Developer Studio Project File - Name="mkiso" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=mkiso - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "mkiso.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "mkiso.mak" CFG="mkiso - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "mkiso - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "mkiso - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "mkiso - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "../" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "__WIN32__" /D "__MSCW32__" /YX /FD /c -# ADD BASE RSC /l 0x2c0a /d "NDEBUG" -# ADD RSC /l 0x2c0a /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "mkiso - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "./" /I "../" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "__WIN32__" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x2c0a /d "_DEBUG" -# ADD RSC /l 0x2c0a /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib libbz2.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"msvcrt.lib" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "mkiso - Win32 Release" -# Name "mkiso - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\libiso.c -# End Source File -# Begin Source File - -SOURCE=.\mkiso.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# Begin Group "zlib" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\zlib\adler32.c -# End Source File -# Begin Source File - -SOURCE=..\zlib\compress.c -# End Source File -# Begin Source File - -SOURCE=..\zlib\crc32.c -# End Source File -# Begin Source File - -SOURCE=..\zlib\crc32.h -# End Source File -# Begin Source File - -SOURCE=..\zlib\deflate.c -# End Source File -# Begin Source File - -SOURCE=..\zlib\deflate.h -# End Source File -# Begin Source File - -SOURCE=..\zlib\gvmat32c.c -# End Source File -# Begin Source File - -SOURCE=..\zlib\gzio.c -# End Source File -# Begin Source File - -SOURCE=..\zlib\infback.c -# End Source File -# Begin Source File - -SOURCE=..\zlib\inffas8664.c -# End Source File -# Begin Source File - -SOURCE=..\zlib\inffast.c -# End Source File -# Begin Source File - -SOURCE=..\zlib\inffast.h -# End Source File -# Begin Source File - -SOURCE=..\zlib\inffixed.h -# End Source File -# Begin Source File - -SOURCE=..\zlib\inflate.c -# End Source File -# Begin Source File - -SOURCE=..\zlib\inflate.h -# End Source File -# Begin Source File - -SOURCE=..\zlib\inftrees.c -# End Source File -# Begin Source File - -SOURCE=..\zlib\inftrees.h -# End Source File -# Begin Source File - -SOURCE=..\zlib\trees.c -# End Source File -# Begin Source File - -SOURCE=..\zlib\trees.h -# End Source File -# Begin Source File - -SOURCE=..\zlib\uncompr.c -# End Source File -# Begin Source File - -SOURCE=..\zlib\zconf.h -# End Source File -# Begin Source File - -SOURCE=..\zlib\zlib.h -# End Source File -# Begin Source File - -SOURCE=..\zlib\zutil.c -# End Source File -# Begin Source File - -SOURCE=..\zlib\zutil.h -# End Source File -# End Group -# End Target -# End Project diff --git a/plugins/CDVDiso/src/mkiso/mkiso.dsw b/plugins/CDVDiso/src/mkiso/mkiso.dsw deleted file mode 100644 index 81430b0e7e..0000000000 --- a/plugins/CDVDiso/src/mkiso/mkiso.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "mkiso"=.\mkiso.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 952c71800a..d19d66b6ae 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -10,10 +10,6 @@ if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/cdvdGigaherz" AND cdvdGigaherz) add_subdirectory(cdvdGigaherz/src) endif() -if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/CDVDiso" AND CDVDiso) - add_subdirectory(CDVDiso/src) -endif() - # if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/CDVDisoEFP" AND CDVDisoEFP) # add_subdirectory(CDVDisoEFP) # endif()