summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMakefile4
-rw-r--r--crypto-search.cpp7
-rw-r--r--includes/cdreader.h2
-rwxr-xr-xlib/Makefile2
-rw-r--r--lib/cdreader.cpp2
-rw-r--r--lib/lzss.cpp10
-rw-r--r--str-player.cpp11
-rw-r--r--tile-convert.cpp2
8 files changed, 28 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index bb0d857..2bd7f57 100755
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
#!/usr/bin/make -f
CPPFLAGS=-Wall -g -O3 -mcpu=i686 -Werror -Iincludes `sdl-config --cflags` -DHAVE_ZLIB
-LDFLAGS=-lz `sdl-config --libs` -lGL -lGLU -L/usr/X11/lib -lefence
+LDFLAGS=-lz `sdl-config --libs` -lGL -lGLU -L/usr/X11/lib
CXX=g++
SUBDIRS = psxdev generic lib Xenogears VP MegamanX5 mogltk ToD
@@ -37,7 +37,7 @@ bgrep: bgrep.o includes/generic.h generic/generic.a Makefile
${CXX} bgrep.o generic/generic.a -o bgrep ${LDFLAGS}
tile-convert: tile-convert.o generic/generic.a Makefile
- ${CXX} tile-convert.o generic/generic.a -o ffx-convert ${LDFLAGS}
+ ${CXX} tile-convert.o generic/generic.a -o tile-convert ${LDFLAGS}
gltest: gltest.o mogltk/mogltk.a generic/generic.a Makefile
${CXX} gltest.o mogltk/mogltk.a generic/generic.a -o gltest ${LDFLAGS}
diff --git a/crypto-search.cpp b/crypto-search.cpp
index 4ece311..d08efc2 100644
--- a/crypto-search.cpp
+++ b/crypto-search.cpp
@@ -24,8 +24,10 @@
#include <unistd.h>
#include "generic.h"
#include "Input.h"
+#include "Main.h"
-int main(int argc, char ** argv) {
+CODE_BEGINS
+int startup(void) throw (GeneralException) {
int size, mind, maxd, delta, len, i, j;
char * buffer, * str;
Handle * h;
@@ -89,4 +91,7 @@ int main(int argc, char ** argv) {
}
delete h;
+
+ return 0;
}
+CODE_ENDS
diff --git a/includes/cdreader.h b/includes/cdreader.h
index 1909fe2..2dd76ca 100644
--- a/includes/cdreader.h
+++ b/includes/cdreader.h
@@ -9,7 +9,7 @@
class cdreader : public Handle {
public:
- cdreader(const String & = "/dev/cdrom") throw (GeneralException);
+ cdreader(const String &) throw (GeneralException);
cdreader(const cdreader &);
virtual ~cdreader() {}
virtual bool CanWrite() const;
diff --git a/lib/Makefile b/lib/Makefile
index 3c9cef6..24c068e 100755
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -1,6 +1,6 @@
#!/usr/bin/make -f
-CPPFLAGS=-Wall -g -O3 -mcpu=i686 -Werror -I../includes -DHAVE_ZLIB -DUSE_CDREADER
+CPPFLAGS=-Wall -g -O3 -mcpu=i686 -Werror -I../includes -DHAVE_ZLIB -DUSE_CDREADER -DDEBUG
CXX=g++
OBJECTS = cdutils.o lzss.o yazedc.o dteutils.o cdreader.o cdabstract.o
diff --git a/lib/cdreader.cpp b/lib/cdreader.cpp
index 77b14f9..a95980c 100644
--- a/lib/cdreader.cpp
+++ b/lib/cdreader.cpp
@@ -80,7 +80,7 @@ cdreader::cdreader(const String & no) throw (GeneralException) :
Handle(open(no.to_charp(), O_RDONLY)), n(no), sector(0) {
#ifdef DEBUG
- fprintf(stderr, "Opening cdrom device %s\n", no.to_charp(), this);
+ printm(M_ERROR, "Opening cdrom device " + no + "\n");
#endif
if (GetHandle() < 0) {
diff --git a/lib/lzss.cpp b/lib/lzss.cpp
index a991f07..d74c33e 100644
--- a/lib/lzss.cpp
+++ b/lib/lzss.cpp
@@ -30,6 +30,16 @@ lzss::lzss() : tolerate(1), blockb(0), scheme(schemes[0]), lzss_maxsize(18), lzs
compute_limits();
}
+/*
+
+Valkyrie Profile V2:
+
+JJJJJJJJ LLLLJJJJ
+VVVVVVVV 1111RRRR
+RRRRRRRR 11110000 VVVVVVVV
+
+*/
+
const lzss::scheme_t lzss::schemes[] = {
/* Nom 1 I J O N 16 P F W Lm1 Ls1 Lm2 Ls2 Jm1 Js1 Jm2 Js2 Fm1 Fs1 Fm2 Fs2 Vm1 Vs1 Vm2 Vs2 */
{"Xenogears", 1, 0, 0, 1, 0, 0, 0, 0, 0, 0x00, 0, 0xf0, -4, 0xff, 0, 0x0f, 8, 0x00, 0, 0x00, 0, 0x00, 0, 0x00, 0},
diff --git a/str-player.cpp b/str-player.cpp
index caff4b9..3343881 100644
--- a/str-player.cpp
+++ b/str-player.cpp
@@ -73,18 +73,19 @@ void process_one_sector(Handle * f) {
f->read(sector, 2336);
h = (STR_Header *) ((Byte *) sector + 8);
+/*
printm(M_INFO, "SubHeader: FN = %x, CN = %x, SM = %x, CI = %x: ", sector[0], sector[1], sector[2], sector[3]);
printm(M_BARE, "SubHeader FN : %x\n", sector[0]);
printm(M_BARE, "SubHeader CN : %x\n", sector[1]);
printm(M_BARE, "SubHeader SM : %x\n", sector[2]);
printm(M_BARE, "SubHeader CI : %x\n", sector[3]);
-
+*/
if ((channel != -1) && (channel != sector[1]))
return;
if ((sector[2] == 0x48) || (sector[2] == 0x42)) {
- printm(M_BARE, "Video sector\n");
+/* printm(M_BARE, "Video sector\n");
printm(M_BARE, "Status : %04x\n", h->StSTATUS);
printm(M_BARE, "Type : %04x\n", h->StTYPE);
printm(M_BARE, "Sector Offset: %i\n", h->StSECTOR_OFFSET);
@@ -95,7 +96,7 @@ void process_one_sector(Handle * f) {
printm(M_BARE, "Movie Height : %i\n", h->StMOVIE_HEIGHT);
printm(M_BARE, "Movie HeadM : %08x\n", h->StMOVIE_HEADM);
printm(M_BARE, "Movie HeadV : %08x\n", h->StMOVIE_HEADV);
- printm(M_BARE, "Channels : %04x\n", h->Channels);
+ printm(M_BARE, "Channels : %04x\n", h->Channels); */
if (h->StSECTOR_OFFSET == 0) {
video = (Byte *) malloc(h->StSECTOR_SIZE * 2016);
if (!screen) {
@@ -137,9 +138,9 @@ void process_one_sector(Handle * f) {
int locked = 0;
SoundSector * buffer = (SoundSector *) sector;
- printm(M_BARE, "Audio sector\n");
+/* printm(M_BARE, "Audio sector\n");
printm(M_BARE, "Frequency: %i\n", xahalfhz(buffer) ? 18900 : 37800);
- printm(M_BARE, "Channels : %s\n", xastereo(buffer) ? "stereo" : "mono");
+ printm(M_BARE, "Channels : %s\n", xastereo(buffer) ? "stereo" : "mono"); */
// fwrite(sector + 8, 1, 2324, stdout);
while (audio_len > 0) {
diff --git a/tile-convert.cpp b/tile-convert.cpp
index fc1cf69..86d6612 100644
--- a/tile-convert.cpp
+++ b/tile-convert.cpp
@@ -120,7 +120,7 @@ virtual int startup() throw (GeneralException) {
Output * tga = new Output(argv[optind + 1]);
Image * img = new Image(IMG_SX, IMG_SY);
- char buffer[131072];
+ char * buffer = (char *) malloc(IMG_SX * IMG_SY);
Byte b;