From a7c35a65b4bb2399dd5080f1f96926fed203a356 Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Sat, 19 Jan 2013 22:23:42 +1100 Subject: [PATCH] Update to ananke v01r01 release. This version fixes a problem where ananke would leave out the 'information' section (that is, the game name) when converting a game to a game folder, resulting in a folder named " (!)". It also includes the latest version of nall. --- ananke/bsx-satellaview.cpp | 2 ++ ananke/game-boy-advance.cpp | 2 ++ ananke/game-boy.cpp | 2 ++ ananke/nall/nall.hpp | 1 + ananke/nall/thread.hpp | 46 +++++++++++++++++++++++++++++++++++++ ananke/sufami-turbo.cpp | 2 ++ ananke/super-famicom.cpp | 2 ++ 7 files changed, 57 insertions(+) create mode 100644 ananke/nall/thread.hpp diff --git a/ananke/bsx-satellaview.cpp b/ananke/bsx-satellaview.cpp index 559fcd3c..8e37925f 100644 --- a/ananke/bsx-satellaview.cpp +++ b/ananke/bsx-satellaview.cpp @@ -64,5 +64,7 @@ string Ananke::syncBsxSatellaview(const string &pathname) { if(buffer.size() == 0) return ""; directory::remove(pathname); + information.path = pathname; + information.name = notdir(string{pathname}.rtrim<1>("/")); return openBsxSatellaview(buffer); } diff --git a/ananke/game-boy-advance.cpp b/ananke/game-boy-advance.cpp index af55a40f..b78112d4 100644 --- a/ananke/game-boy-advance.cpp +++ b/ananke/game-boy-advance.cpp @@ -47,6 +47,8 @@ string Ananke::syncGameBoyAdvance(const string &pathname) { if(rtc.size() == 0) rtc = file::read({pathname, "rtc.rwm"}); directory::remove(pathname); + information.path = pathname; + information.name = notdir(string{pathname}.rtrim<1>("/")); string outputPath = openGameBoyAdvance(buffer); if(save.size()) file::write({outputPath, "save.ram"}, save); diff --git a/ananke/game-boy.cpp b/ananke/game-boy.cpp index a06b2234..c52d9107 100644 --- a/ananke/game-boy.cpp +++ b/ananke/game-boy.cpp @@ -49,6 +49,8 @@ string Ananke::syncGameBoy(const string &pathname) { if(rtc.size() == 0) rtc = file::read({pathname, "rtc.rwm"}); directory::remove(pathname); + information.path = pathname; + information.name = notdir(string{pathname}.rtrim<1>("/")); string outputPath = openGameBoy(buffer); if(save.size()) file::write({outputPath, "save.ram"}, save); diff --git a/ananke/nall/nall.hpp b/ananke/nall/nall.hpp index 06040fac..a7887695 100644 --- a/ananke/nall/nall.hpp +++ b/ananke/nall/nall.hpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include diff --git a/ananke/nall/thread.hpp b/ananke/nall/thread.hpp new file mode 100644 index 00000000..8517726b --- /dev/null +++ b/ananke/nall/thread.hpp @@ -0,0 +1,46 @@ +#ifndef NALL_THREAD_HPP +#define NALL_THREAD_HPP + +#include +#include +#include + +#if defined(PLATFORM_X) || defined(PLATFORM_OSX) + #include +#elif defined(PLATFORM_WIN) + +//TDM/GCC 4.7 does not support std::thread +//implement an extremely lightweight wrapper + +namespace std { + inline DWORD WINAPI thread_entry_point(LPVOID parameter); + + struct thread { + bool joinable() const { + return active == false; + } + + void join() { + while(active) usleep(1); + } + + thread(function entryPoint) : entryPoint(entryPoint), active(true) { + CreateThread(NULL, 0, thread_entry_point, (void*)this, 0, NULL); + } + + private: + function entryPoint; + bool active; + friend DWORD WINAPI thread_entry_point(LPVOID); + }; + + inline DWORD WINAPI thread_entry_point(LPVOID parameter) { + thread *context = (thread*)parameter; + context->entryPoint(); + context->active = false; + return 0; + } +} +#endif + +#endif diff --git a/ananke/sufami-turbo.cpp b/ananke/sufami-turbo.cpp index 722d2847..44f9f48b 100644 --- a/ananke/sufami-turbo.cpp +++ b/ananke/sufami-turbo.cpp @@ -78,6 +78,8 @@ string Ananke::syncSufamiTurbo(const string &pathname) { if(save.size() == 0) save = file::read({pathname, "save.rwm"}); directory::remove(pathname); + information.path = pathname; + information.name = notdir(string{pathname}.rtrim<1>("/")); string outputPath = openSufamiTurbo(buffer); if(save.size()) file::write({outputPath, "save.ram"}, save); diff --git a/ananke/super-famicom.cpp b/ananke/super-famicom.cpp index 89872fb7..4446d7af 100644 --- a/ananke/super-famicom.cpp +++ b/ananke/super-famicom.cpp @@ -201,6 +201,8 @@ string Ananke::syncSuperFamicom(const string &pathname) { if(rtc.size() == 0) rtc= file::read({pathname, "rtc.rwm"}); directory::remove(pathname); + information.path = pathname; + information.name = notdir(string{pathname}.rtrim<1>("/")); string outputPath = openSuperFamicom(buffer); if(save.size()) file::write({outputPath, "save.ram"}, save);