From f5bb1fb7ed0779b84a574ac7b0c235c735d3281a Mon Sep 17 00:00:00 2001 From: "fabio.olimpieri" Date: Sat, 18 Feb 2012 14:12:40 +0000 Subject: [PATCH] Fixes for non GEKKO platforms --- Src/C64.cpp | 2 +- Src/gui/gui.cpp | 4 +++- Src/main.cpp | 13 +++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Src/C64.cpp b/Src/C64.cpp index c9b61e0..b5c4a34 100644 --- a/Src/C64.cpp +++ b/Src/C64.cpp @@ -56,7 +56,7 @@ C64::C64() c64_ctor1(); // Open display - printf("ssof1 %d:%d\n", + printf("ssof1 %zd:%zd\n", sizeof(C64Display), sizeof(C64)); TheDisplay = new C64Display(this); diff --git a/Src/gui/gui.cpp b/Src/gui/gui.cpp index 66182bd..8a689a0 100644 --- a/Src/gui/gui.cpp +++ b/Src/gui/gui.cpp @@ -109,8 +109,10 @@ Gui::Gui() this->theme_base_path = THEME_ROOT_PATH; this->metadata_base_path = METADATA_ROOT_PATH; this->game_base_path = GAME_ROOT_PATH; + #if defined(GEKKO) this->game_base_path_usb = GAME_ROOT_PATH_USB; this->game_base_path_smb = GAME_ROOT_PATH_SMB; + #endif this->tmp_path = TMP_ROOT_PATH; this->save_game_path = SAVE_GAME_ROOT_PATH; @@ -562,7 +564,7 @@ void Gui::saveGameInfo(const char *base_path, const char *name) if (ferror(fp)) warning("Write error on %s\n", new_name); else if ((size_t)n != sz) - warning("Could only write %d bytes of %d for %s\n", + warning("Could only write %d bytes of %zd for %s\n", n, sz, new_name); fclose(fp); } diff --git a/Src/main.cpp b/Src/main.cpp index 35d01d9..d992a49 100644 --- a/Src/main.cpp +++ b/Src/main.cpp @@ -47,11 +47,12 @@ extern void CloseShare (bool silent); C64 *TheC64 = NULL; // Global C64 object char AppDirPath[1024]; // Path of application directory bool usbismount = false; -bool networkisinit = false; bool smbismount = false; #ifndef GEKKO -networkisinit = true; +bool networkisinit = true; +#else +bool networkisinit = false; #endif // ROM file names @@ -101,7 +102,11 @@ bool InitUSB() bool isMounted = fatMountSimple("usb", &__io_usbstorage); bool isInserted = __io_usbstorage.isInserted(); - if (!isInserted) return false; + if (!isInserted) + { + printf("USB device not found\n\n"); + return false; + } // USB Drive may be "sleeeeping" // We need to try Mounting a few times to wake it up @@ -129,7 +134,7 @@ bool InitNetwork() printf("Getting IP address via DHCP...\n\n"); if (if_config(myIP, NULL, NULL, true) < 0) { - printf("No DHCP reply\n"); + printf("No DHCP reply\n\n"); return false; } printf("Got an address: %s\n",myIP);