Fixes for non GEKKO platforms

This commit is contained in:
fabio.olimpieri 2012-02-18 14:12:40 +00:00
parent 285d304f01
commit f5bb1fb7ed
3 changed files with 13 additions and 6 deletions

View File

@ -56,7 +56,7 @@ C64::C64()
c64_ctor1(); c64_ctor1();
// Open display // Open display
printf("ssof1 %d:%d\n", printf("ssof1 %zd:%zd\n",
sizeof(C64Display), sizeof(C64)); sizeof(C64Display), sizeof(C64));
TheDisplay = new C64Display(this); TheDisplay = new C64Display(this);

View File

@ -109,8 +109,10 @@ Gui::Gui()
this->theme_base_path = THEME_ROOT_PATH; this->theme_base_path = THEME_ROOT_PATH;
this->metadata_base_path = METADATA_ROOT_PATH; this->metadata_base_path = METADATA_ROOT_PATH;
this->game_base_path = GAME_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_usb = GAME_ROOT_PATH_USB;
this->game_base_path_smb = GAME_ROOT_PATH_SMB; this->game_base_path_smb = GAME_ROOT_PATH_SMB;
#endif
this->tmp_path = TMP_ROOT_PATH; this->tmp_path = TMP_ROOT_PATH;
this->save_game_path = SAVE_GAME_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)) if (ferror(fp))
warning("Write error on %s\n", new_name); warning("Write error on %s\n", new_name);
else if ((size_t)n != sz) 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); n, sz, new_name);
fclose(fp); fclose(fp);
} }

View File

@ -47,11 +47,12 @@ extern void CloseShare (bool silent);
C64 *TheC64 = NULL; // Global C64 object C64 *TheC64 = NULL; // Global C64 object
char AppDirPath[1024]; // Path of application directory char AppDirPath[1024]; // Path of application directory
bool usbismount = false; bool usbismount = false;
bool networkisinit = false;
bool smbismount = false; bool smbismount = false;
#ifndef GEKKO #ifndef GEKKO
networkisinit = true; bool networkisinit = true;
#else
bool networkisinit = false;
#endif #endif
// ROM file names // ROM file names
@ -101,7 +102,11 @@ bool InitUSB()
bool isMounted = fatMountSimple("usb", &__io_usbstorage); bool isMounted = fatMountSimple("usb", &__io_usbstorage);
bool isInserted = __io_usbstorage.isInserted(); 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" // USB Drive may be "sleeeeping"
// We need to try Mounting a few times to wake it up // 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"); printf("Getting IP address via DHCP...\n\n");
if (if_config(myIP, NULL, NULL, true) < 0) { if (if_config(myIP, NULL, NULL, true) < 0) {
printf("No DHCP reply\n"); printf("No DHCP reply\n\n");
return false; return false;
} }
printf("Got an address: %s\n",myIP); printf("Got an address: %s\n",myIP);