From 4984ff4a7cdc181aa8d4ff913ddc4323e77f4bca Mon Sep 17 00:00:00 2001 From: Pixel Date: Sat, 16 May 2009 21:43:21 +0000 Subject: Adding cd/dvdabstract classes to the lua exports. --- includes/luacd.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'includes') diff --git a/includes/luacd.h b/includes/luacd.h index 1f7768f..baa4929 100644 --- a/includes/luacd.h +++ b/includes/luacd.h @@ -27,6 +27,8 @@ #include #include #include +#include +#include #define CD_PUSHSTATICS(L) { \ Luacdutils::pushstatics(L); \ @@ -34,6 +36,8 @@ LuaPVD::pushstatics(L); \ LuaDirTree::pushstatics(L); \ Luaisobuilder::pushstatics(L); \ + Luacdabstract::pushconstruct(L); \ + Luadvdabstract::pushconstruct(L); \ } class Luacdutils : public LuaObject { @@ -89,4 +93,20 @@ class Luaisobuilder : public LuaObject { isobuilder * iso; }; +class Luacdabstract : public LuaHandle { + public: + static void pushconstruct(Lua *); + Luacdabstract(Handle *); + protected: + virtual void pushmembers(Lua *); +}; + +class Luadvdabstract : public LuaHandle { + public: + static void pushconstruct(Lua *); + Luadvdabstract(dvdabstract *); + protected: + virtual void pushmembers(Lua *); +}; + #endif -- cgit v1.2.3 From 2f6b22ede60a89cced23d499cd77413b9301a16d Mon Sep 17 00:00:00 2001 From: Pixel Date: Mon, 25 May 2009 04:15:43 +0000 Subject: Adding the option to read or not the size in the lzss_decomp routine. --- includes/lzss.h | 2 +- lib/lzss.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'includes') diff --git a/includes/lzss.h b/includes/lzss.h index 14aa345..8ba3fb5 100644 --- a/includes/lzss.h +++ b/includes/lzss.h @@ -59,7 +59,7 @@ class lzss : public Base { int tolerate, blockb; int blk, bitmap_count; - unsigned int lzss_decomp(Handle * f_source, Handle * f_cible, int true_length = -1); + unsigned int lzss_decomp(Handle * f_source, Handle * f_cible, int true_length = -1, bool read_length = true); void lzss_comp(Handle * f_source, Handle * f_cible, int * delta = NULL); Byte swap_bits(Byte); diff --git a/lib/lzss.cpp b/lib/lzss.cpp index 1d7ecfb..7d86a32 100644 --- a/lib/lzss.cpp +++ b/lib/lzss.cpp @@ -105,7 +105,7 @@ void lzss::compute_limits(void) { printm(M_INFO, "Computed values: maxsize = %i, maxptr = 0x%06x\n", lzss_maxsize, lzss_maxptr); } -unsigned int lzss::lzss_decomp(Handle * f_source, Handle * f_cible, int true_length) +unsigned int lzss::lzss_decomp(Handle * f_source, Handle * f_cible, int true_length, bool read_length) { unsigned char bitmap, fbitmap; unsigned char valeur; @@ -125,7 +125,8 @@ unsigned int lzss::lzss_decomp(Handle * f_source, Handle * f_cible, int true_len compute_limits(); - f_source->read(&length, 4); + if (read_length) + f_source->read(&length, 4); if (true_length >= 0) { length = true_length; } -- cgit v1.2.3 From 07c79ea1a1b015c8c8f5ea4bb4b8b5c2aaf6f4b9 Mon Sep 17 00:00:00 2001 From: Pixel Date: Tue, 9 Jun 2009 18:42:24 -0700 Subject: Adding dvdmode to the dirtree object. --- includes/isobuilder.h | 2 ++ lib/isobuilder.cpp | 12 +++++++----- lib/luacd.cpp | 9 ++++++++- 3 files changed, 17 insertions(+), 6 deletions(-) (limited to 'includes') diff --git a/includes/isobuilder.h b/includes/isobuilder.h index 16a3a4d..88ab91a 100644 --- a/includes/isobuilder.h +++ b/includes/isobuilder.h @@ -63,12 +63,14 @@ class isobuilder : public Base { DirTree * Child(); DirTree * Brother(); DirTree * Find(const String &); + void setdvdmode(); private: int buildpath_r(int * n, Byte * data, int size, int current_level, int level_to_dump, bool bigendian) throw (GeneralException); int maxlevel(int current_level = 1); DirTree * father, * child, * brother; bool dir; int node; + bool dvdmode; }; isobuilder(Handle * w, int mode = MODE2_FORM1); ~isobuilder(); diff --git a/lib/isobuilder.cpp b/lib/isobuilder.cpp index 9bec34c..d3d9e1b 100644 --- a/lib/isobuilder.cpp +++ b/lib/isobuilder.cpp @@ -88,6 +88,8 @@ isobuilder::DirTree::DirTree(isobuilder::DirTree * _father, bool _dir) : mode(-1 if (!father) return; + + dvdmode = father->dvdmode; creation = father->creation; @@ -99,6 +101,10 @@ isobuilder::DirTree::DirTree(isobuilder::DirTree * _father, bool _dir) : mode(-1 } } +isobuilder::DirTree::setdvdmode() { + dvdmode = true; +} + isobuilder::DirTree::~DirTree() { while (child) { delete child; @@ -266,10 +272,6 @@ int isobuilder::DirTree::buildentry(Byte * buffer, int spaceleft, bool put_xa) { memset(pbuf, 0, 256); - if (name == "BM2.ELF") { - printm(M_INFO, "GRON"); - } - if (name == ".") { N = 1; pbuf[0] = 0; @@ -279,7 +281,7 @@ int isobuilder::DirTree::buildentry(Byte * buffer, int spaceleft, bool put_xa) { } else { strcpy(pbuf, name.to_charp()); N = name.strlen(); - if (!dir) { + if ((!dir) && !dvdmode) { N += 2; strcat(pbuf, ";1"); } diff --git a/lib/luacd.cpp b/lib/luacd.cpp index 881f5ae..6855b9a 100644 --- a/lib/luacd.cpp +++ b/lib/luacd.cpp @@ -1126,6 +1126,7 @@ enum DirTree_methods_t { DIRTREE_FROMDIR, DIRTREE_SETBASICSXA, DIRTREE_FIND, + DIRTREE_SETDVDMODE, }; enum DirTree_functions_t { @@ -1136,8 +1137,9 @@ struct lua_functypes_t DirTree_methods[] = { { DIRTREE_INDEX, "index", 1, 1, { BLUA_STRING } }, { DIRTREE_NEWINDEX, "newindex", 2, 2, { BLUA_STRING, BLUA_ANY } }, { DIRTREE_FROMDIR, "fromdir", 1, 1, { BLUA_OBJECT } }, - { DIRTREE_SETBASICSXA, "setbasicsxa", 0, 0, 0 }, + { DIRTREE_SETBASICSXA, "setbasicsxa", 0, 0, { } }, { DIRTREE_FIND, "find", 1, 1, { BLUA_STRING } }, + { DIRTREE_SETDVDMODE, "setdvdmode", 0, 0, { } }, { -1, 0, 0, 0, 0 } }; @@ -1153,6 +1155,7 @@ class sLua_DirTree : public Base { DECLARE_METHOD(DirTree, DIRTREE_FROMDIR); DECLARE_METHOD(DirTree, DIRTREE_SETBASICSXA); DECLARE_METHOD(DirTree, DIRTREE_FIND); + DECLARE_METHOD(DirTree, DIRTREE_SETDVDMODE); DECLARE_FUNCTION(DirTree, DIRTREE_NEWDIRTREE); private: @@ -1169,6 +1172,7 @@ void LuaDirTree::pushmembers(Lua * L) { PUSH_METHOD(DirTree, DIRTREE_FROMDIR); PUSH_METHOD(DirTree, DIRTREE_SETBASICSXA); PUSH_METHOD(DirTree, DIRTREE_FIND); + PUSH_METHOD(DirTree, DIRTREE_SETDVDMODE); } void LuaDirTree::pushstatics(Lua * L) throw (GeneralException) { @@ -1204,6 +1208,9 @@ int sLua_DirTree::DirTree_proceed(Lua * L, int n, DirTree * dir, int caller) { L->push(); } break; + case DIRTREE_SETDVDMODE: + dir->setdvdmode(); + break; case DIRTREE_INDEX: key = L->tostring(2); r = 1; -- cgit v1.2.3