summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2003-09-05 15:28:29 +0000
committerpixel <pixel>2003-09-05 15:28:29 +0000
commit23b21e9fa28cb317a86e2e8cfb1c8548d708f32f (patch)
tree87ee5ed995a74ad792a7c86392307e10ff13d75b
parent4a5e6ba6ba48ced51222dbda36a3d3dd99d75ec5 (diff)
Fixed more things... I'm starting to like MSVC! THAT'S NO GOOD!
-rw-r--r--MSVC/PSX-Bundle - library/PSX-Bundle - library.vcproj30
-rw-r--r--MSVC/Tools/master.mak2
-rw-r--r--cd-tool.cpp20
-rw-r--r--includes/cdutils.h6
-rw-r--r--lib/cdutils.cpp10
5 files changed, 56 insertions, 12 deletions
diff --git a/MSVC/PSX-Bundle - library/PSX-Bundle - library.vcproj b/MSVC/PSX-Bundle - library/PSX-Bundle - library.vcproj
index 44bfe6a..4baf4f4 100644
--- a/MSVC/PSX-Bundle - library/PSX-Bundle - library.vcproj
+++ b/MSVC/PSX-Bundle - library/PSX-Bundle - library.vcproj
@@ -155,6 +155,36 @@
RelativePath="..\..\psxdev\xadecode.h">
</File>
</Filter>
+ <Filter
+ Name="Documentation"
+ Filter="">
+ <File
+ RelativePath="..\..\FAQ.txt">
+ </File>
+ <Filter
+ Name="English"
+ Filter="">
+ <File
+ RelativePath="..\..\FAQ-cd.txt">
+ </File>
+ <File
+ RelativePath="..\..\FAQ-lzss.txt">
+ </File>
+ <File
+ RelativePath="..\..\FAQ-psx.txt">
+ </File>
+ </Filter>
+ <Filter
+ Name="French"
+ Filter="">
+ <File
+ RelativePath="..\..\EmuPatch-FAQ.txt">
+ </File>
+ <File
+ RelativePath="..\..\FAQ-cd-fr.txt">
+ </File>
+ </Filter>
+ </Filter>
</Files>
<Globals>
</Globals>
diff --git a/MSVC/Tools/master.mak b/MSVC/Tools/master.mak
index 3cef157..87b3aeb 100644
--- a/MSVC/Tools/master.mak
+++ b/MSVC/Tools/master.mak
@@ -82,7 +82,7 @@ _CLEANFILES=*.obj *.tlb *.reg
!ENDIF
#set some command C++ flags
-_CFLAGS=$(_CCFLAGS) /c
+_CFLAGS=$(_CCFLAGS) /c /EHsc
#set debug as the default for c++
_CDFLAGS=$(_CFLAGS) /Zi
diff --git a/cd-tool.cpp b/cd-tool.cpp
index 9facf0e..cf7578b 100644
--- a/cd-tool.cpp
+++ b/cd-tool.cpp
@@ -45,10 +45,14 @@ CODE_BEGINS
public:
Appli() : cdutil(0), iso_r(0), iso_w(0), file(0) {}
virtual ~Appli() {
- delete cdutil;
- delete iso_r;
- delete iso_w;
- delete file;
+ if (cdutil)
+ delete cdutil;
+ if (iso_r)
+ delete iso_r;
+ if (iso_w)
+ delete iso_w;
+ if (file)
+ delete file;
}
private:
@@ -102,7 +106,7 @@ virtual int startup() throw (GeneralException) {
if (argc == optind) {
showhelp();
printm(M_ERROR, "Need an iso filename to work on.\n");
- throw Exit(-1);
+ exit(-1);
}
iso_name = argv[optind++];
@@ -110,7 +114,7 @@ virtual int startup() throw (GeneralException) {
if (argc == optind) {
showhelp();
printm(M_ERROR, "Need a command to execute.\n");
- throw Exit(-1);
+ exit(-1);
}
iso_r = open_iso(iso_name);
@@ -118,7 +122,7 @@ virtual int startup() throw (GeneralException) {
cdutil = new cdutils(iso_r);
if (!cdutil->get_iso_infos())
- throw Exit(-1);
+ exit(-1);
if (!strcmp(argv[optind], "infos")) {
cdutil->show_iso_infos();
@@ -140,7 +144,7 @@ virtual int startup() throw (GeneralException) {
throw Exit(-1);
}
if (!(dir.Flags & 2)) {
- printm(M_ERROR, "Path %s design a file and not a directory.\n", arg1);
+ printm(M_ERROR, "Path %s is a file and not a directory.\n", arg1);
throw Exit(-1);
}
cdutil->show_head_entry();
diff --git a/includes/cdutils.h b/includes/cdutils.h
index 0fe4638..91bb54c 100644
--- a/includes/cdutils.h
+++ b/includes/cdutils.h
@@ -31,12 +31,16 @@ extern const long sec_sizes[];
extern const long sec_offsts[];
extern const String sec_modes[];
+#ifdef _WIN32
+#pragma pack(1)
+#endif
+
class cdutils : public Base {
public:
cdutils(Handle * f_iso_r, Handle * f_iso_w = 0);
virtual ~cdutils();
- struct DirEntry {
+ PPACKED struct DirEntry {
unsigned char R;
unsigned char NExt;
unsigned long Sector;
diff --git a/lib/cdutils.cpp b/lib/cdutils.cpp
index 9ac78e0..7130c87 100644
--- a/lib/cdutils.cpp
+++ b/lib/cdutils.cpp
@@ -335,6 +335,12 @@ int cdutils::show_entry(struct DirEntry * dir) {
strncpy(pbuf, (char *) &(dir->id), dir->N);
pbuf[dir->N] = 0;
+ if ((dir->N == 1) && (pbuf[0] == 0)) {
+ strcpy(pbuf, ".");
+ }
+ if ((dir->N == 1) && (pbuf[0] == 1)) {
+ strcpy(pbuf, "..");
+ }
printm(M_BARE, "%6i - %8i - %2i/%02i/%04i - %2i:%02i:%02i%+03.1f - %c%c%c%c%c%c%c%c - %s\n",
dir->Sector, dir->Size, dir->Day, dir->Month, dir->Year + 1900, dir->Hour, dir->Minute, dir->Second, ((float) dir->Offset) / 4,
@@ -463,8 +469,8 @@ int cdutils::show_iso_infos() {
printm(M_BARE, " 132 - 8- PSize : %li\n", *((long int *) &(buffer[132])));
printm(M_BARE, " 140 - 4- 1SLPath: %i\n", *((short int *) &(buffer[140])));
printm(M_BARE, " 144 - 4- 2SLPath: %i\n", *((short int *) &(buffer[144])));
- printm(M_BARE, " 148 - 4- 1SBPath: %i\n", swap_dword(*((short int *) &(buffer[148]))));
- printm(M_BARE, " 152 - 4- 2SBPath: %i\n", swap_dword(*((short int *) &(buffer[152]))));
+ printm(M_BARE, " 148 - 4- 1SBPath: %i\n", swap_word(*((short int *) &(buffer[150]))));
+ printm(M_BARE, " 152 - 4- 2SBPath: %i\n", swap_word(*((short int *) &(buffer[154]))));
memcpy(pbuff, buffer + 190, 128);
pbuff[128] = 0;
printm(M_BARE, " 190 - 128- VStId : %s\n", pbuff);