mirror of https://github.com/mgba-emu/mgba.git
3DS: Clean out unnecessary abstraction in VFS
This commit is contained in:
parent
4b5822a8ec
commit
da3c45a0e7
|
@ -33,19 +33,9 @@ struct VFile* VFileOpen3DS(FS_archive archive, const char* path, int flags) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int newFlags = 0;
|
||||
if (flags & O_RDONLY) {
|
||||
newFlags |= FS_OPEN_READ;
|
||||
}
|
||||
if (flags & O_WRONLY) {
|
||||
newFlags |= FS_OPEN_WRITE;
|
||||
}
|
||||
if (flags & O_CREAT) {
|
||||
newFlags |= FS_OPEN_CREATE;
|
||||
}
|
||||
|
||||
FS_path lowPath = FS_makePath(PATH_CHAR, path);
|
||||
if (FSUSER_OpenFileDirectly(0, &vf3d->handle, archive, lowPath, newFlags, FS_ATTRIBUTE_NONE)) {
|
||||
FS_path newPath = FS_makePath(PATH_CHAR, path);
|
||||
Result res = FSUSER_OpenFile(0, &vf3d->handle, archive, newPath, flags, FS_ATTRIBUTE_NONE);
|
||||
if (res & 0xFFFC03FF) {
|
||||
free(vf3d);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -41,9 +41,10 @@ int main() {
|
|||
(FS_path) { PATH_EMPTY, 1, (u8*)"" },
|
||||
0, 0
|
||||
};
|
||||
|
||||
struct VFile* rom = VFileOpen3DS(sdmcArchive, "/rom.gba", O_RDONLY);
|
||||
struct VFile* save = VFileOpen3DS(sdmcArchive, "/rom.sav", O_RDWR | O_CREAT);
|
||||
FSUSER_OpenArchive(0, &sdmcArchive);
|
||||
|
||||
struct VFile* rom = VFileOpen3DS(sdmcArchive, "/rom.gba", FS_OPEN_READ);
|
||||
struct VFile* save = VFileOpen3DS(sdmcArchive, "/rom.sav", FS_OPEN_WRITE | FS_OPEN_CREATE);
|
||||
|
||||
GBACreate(gba);
|
||||
ARMSetComponents(cpu, &gba->d, 0, 0);
|
||||
|
|
Loading…
Reference in New Issue