mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-04 18:45:05 +01:00
f1febd91be
*Fixed Font loading. The font.ttf is loaded from the path with .thems if it exists there. When a Theme is loaded and a font.ttf file exists in the defined "Image-Folder:" than this font.ttf will override all others. This ensures support for themes with special fonts. *Fixed double count on playcount bug *Updated libext2fs to git snapshot 2010-12-24 *Added proper close of all file systems where the games are loaded from (FAT32/NTFS/EXT) *Fixed hang bug when reloading into the IOS set in the individual game settings with that (reload to 223, 224, 245, ...)
45 lines
802 B
C++
45 lines
802 B
C++
#include <ntfs.h>
|
|
#include <locale.h>
|
|
#include "wbfs_ntfs.h"
|
|
#include "usbloader/usbstorage2.h"
|
|
|
|
sec_t ntfs_wbfs_sec = 0;
|
|
|
|
s32 Wbfs_Ntfs::Open()
|
|
{
|
|
Close();
|
|
|
|
strcpy(wbfs_fs_drive, "NTFS:");
|
|
|
|
if (Mounted)
|
|
return 0;
|
|
|
|
Mounted = ntfsMount("NTFS", &__io_usbstorage2, lba, CACHE_SIZE, CACHED_SECTORS, NTFS_SHOW_HIDDEN_FILES | NTFS_RECOVER);
|
|
if (!Mounted)
|
|
return -2;
|
|
|
|
// ntfsInit() resets locals
|
|
// which breaks unicode in console
|
|
// so we change it back to C-UTF-8
|
|
setlocale(LC_CTYPE, "C-UTF-8");
|
|
setlocale(LC_MESSAGES, "C-UTF-8");
|
|
|
|
ntfs_wbfs_sec = lba;
|
|
|
|
return 0;
|
|
}
|
|
|
|
void Wbfs_Ntfs::Close()
|
|
{
|
|
if (hdd)
|
|
{
|
|
wbfs_close(hdd);
|
|
hdd = NULL;
|
|
}
|
|
|
|
ntfsUnmount("NTFS:/", true);
|
|
|
|
Mounted = false;
|
|
ntfs_wbfs_sec = 0;
|
|
}
|