foxygit / fake-08-xbox360 Log in
commit e1bc46fbe831ee10fbf16f28420b0b6ffae671af
Author:     DPS2004 <dpsophinos@gmail.com>
AuthorDate: Wed Mar 9 10:31:46 2022 -0500
Commit:     DPS2004 <dpsophinos@gmail.com>
CommitDate: Mon May 2 09:37:37 2022 -0400

    windows + 3ds platform fixes
---
 platform/3ds/Makefile                   |  1 +
 platform/windows/Makefile               |  5 ++++-
 platform/windows/source/WindowsHost.cpp | 23 +++++++++++++++++++----
 source/hostCommonFunctions.cpp          |  2 +-
 source/main.cpp                         |  1 +
 5 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/platform/3ds/Makefile b/platform/3ds/Makefile
index dadcdea..97fbe29 100644
--- a/platform/3ds/Makefile
+++ b/platform/3ds/Makefile
@@ -73,6 +73,7 @@ CFLAGS	:=	-g -Wall -Ofast -mword-relocations \
 CFLAGS	+=	$(INCLUDE) -DARM11 -D_3DS -DVER_STR=\"$(APP_VERSION)\"

 # enable pack in games with this platform
+
 # CFLAGS  +=  -DLOAD_PACK_INS

 CXXFLAGS	:= $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++17
diff --git a/platform/windows/Makefile b/platform/windows/Makefile
index 13892b0..6a0beff 100644
--- a/platform/windows/Makefile
+++ b/platform/windows/Makefile
@@ -21,7 +21,10 @@ CFLAGS	:=	-g -Wall -Wno-deprecated -ffunction-sections -std=c++17 \

 CFLAGS	+=	$(INCLUDE) -DVER_STR=\"$(APP_VERSION)\"

-CXXFLAGS	:= $(CFLAGS) -fno-rtti -fno-exceptions
+# enable pack in games with this platform
+CFLAGS  +=  -DLOAD_PACK_INS
+
+CXXFLAGS	:= $(CFLAGS) -fno-rtti -fexceptions
 #-std=gnu++11 was used before... not sure of difference

 LIBS	:= -lSDL2
diff --git a/platform/windows/source/WindowsHost.cpp b/platform/windows/source/WindowsHost.cpp
index fd8b18e..9397ce3 100644
--- a/platform/windows/source/WindowsHost.cpp
+++ b/platform/windows/source/WindowsHost.cpp
@@ -32,11 +32,15 @@ using namespace std;

 #define KB_ENABLED true

+
+
+
+
 SDL_Event event;

 string _windowsAppData = SDL_GetPrefPath("FAKE-08", "FAKE-08");
 string _desktopSdl2SettingsDir = _windowsAppData;
-string _desktopSdl2SettingsPrefix = _windowsAppData + "/";
+string _desktopSdl2SettingsPrefix = _windowsAppData;
 string _desktopSdl2customBiosLua = "cartpath = \"AppData\"\n"
         "selectbtn = \"z\"\n"
         "pausebtn = \"esc\"\n"
@@ -56,19 +60,26 @@ Host::Host()
         res = mkdir(_desktopSdl2SettingsDir.c_str(), 0777);
     }

+
     string cartdatadir = _desktopSdl2SettingsPrefix + "cdata";
-    if (res == 0 && stat(cartdatadir.c_str(), &st) == -1) {
+
+    if (stat(cartdatadir.c_str(), &st) == -1) {
         res = mkdir(cartdatadir.c_str(), 0777);
     }

+	string cartdir = _desktopSdl2SettingsPrefix + "p8carts";
+	if (stat(cartdir.c_str(), &st) == -1) {
+        res = mkdir(cartdir.c_str(), 0777);
+    }
+
 	#if KB_ENABLED
 	SDL_StartTextInput();
 	#endif

     std::string home = _windowsAppData; // C:\Users\(username)\AppData\Roaming\FAKE-08\FAKE-08\p8carts

-    std::string fullCartDir = home + "/p8carts";
-
+    std::string fullCartDir = cartdir + "\\";
+	//fprintf( stderr, "hello" );
     setPlatformParams(
         WINDOW_SIZE_X,
         WINDOW_SIZE_Y,
@@ -182,6 +193,10 @@ InputState_t Host::scanInput(){
     if(keystate[SDL_SCANCODE_C]){
         currKHeld |= P8_KEY_X;
     }
+
+	//keyboard stuff
+
+

     return InputState_t {
         currKDown,
diff --git a/source/hostCommonFunctions.cpp b/source/hostCommonFunctions.cpp
index 52c55f1..63e5963 100644
--- a/source/hostCommonFunctions.cpp
+++ b/source/hostCommonFunctions.cpp
@@ -68,7 +68,7 @@ Color* Host::GetPaletteColors(){
 }

 void Host::unpackCarts(){
-
+
 	#if LOAD_PACK_INS
 	if(packinloaded == Unloaded){
 		Logger_Write("unzipping pack in carts to p8carts\n");
diff --git a/source/main.cpp b/source/main.cpp
index 7af2cae..6fffa7a 100644
--- a/source/main.cpp
+++ b/source/main.cpp
@@ -32,6 +32,7 @@ int main(int argc, char* argv[])
 	host->oneTimeSetup(audio);

 	#if LOAD_PACK_INS
+
 	host->unpackCarts();
 	#endif