wip:libdragon
This commit is contained in:
parent
895fb075c3
commit
6218568cc5
2 changed files with 47 additions and 3 deletions
14
Makefile
14
Makefile
|
@ -434,6 +434,20 @@ else ifeq ($(platform), ps2)
|
||||||
CPU_ARCH := mips
|
CPU_ARCH := mips
|
||||||
STATIC_LINKING = 1
|
STATIC_LINKING = 1
|
||||||
|
|
||||||
|
# Nintendo 64
|
||||||
|
else ifeq ($(platform), n64)
|
||||||
|
TARGET := $(TARGET_NAME)_libretro_$(platform).a
|
||||||
|
CC = $(N64_INST)/bin/mips64-elf-gcc$(EXE_EXT)
|
||||||
|
CXX = $(N64_INST)/bin/mips64-elf-g++$(EXE_EXT)
|
||||||
|
AR = $(N64_INST)/bin/mips64-elf-ar$(EXE_EXT)
|
||||||
|
CFLAGS += -fomit-frame-pointer -ffast-math
|
||||||
|
CFLAGS += -DNINTENDO64 -DUSE_XBGR1555_FORMAT -DSMALL_TRANSLATION_CACHE -DROM_BUFFER_SIZE=4
|
||||||
|
CFLAGS += -I$(N64_INST)/include/
|
||||||
|
HAVE_DYNAREC = 1
|
||||||
|
CPU_ARCH := mips
|
||||||
|
STATIC_LINKING = 1
|
||||||
|
FRONTEND_SUPPORTS_RGB565 = 0
|
||||||
|
|
||||||
# emscripten
|
# emscripten
|
||||||
else ifeq ($(platform), emscripten)
|
else ifeq ($(platform), emscripten)
|
||||||
TARGET := $(TARGET_NAME)_libretro_$(platform).bc
|
TARGET := $(TARGET_NAME)_libretro_$(platform).bc
|
||||||
|
|
|
@ -51,9 +51,12 @@
|
||||||
# if defined(PSP)
|
# if defined(PSP)
|
||||||
# include <pspiofilemgr.h>
|
# include <pspiofilemgr.h>
|
||||||
# endif
|
# endif
|
||||||
|
# if defined(NINTENDO64)
|
||||||
|
# include <libdragon.h>
|
||||||
|
# endif
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# include <sys/stat.h>
|
# include <sys/stat.h>
|
||||||
# if !defined(VITA)
|
# if !defined(VITA) && !defined(NINTENDO64)
|
||||||
# include <dirent.h>
|
# include <dirent.h>
|
||||||
# endif
|
# endif
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
|
@ -75,7 +78,9 @@
|
||||||
# endif
|
# endif
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# include <sys/stat.h>
|
# include <sys/stat.h>
|
||||||
# include <dirent.h>
|
# if !defined(NINTENDO64)
|
||||||
|
# include <dirent.h>
|
||||||
|
# endif
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -615,7 +620,7 @@ int64_t retro_vfs_file_truncate_impl(libretro_vfs_implementation_file *stream, i
|
||||||
stream->size = length;
|
stream->size = length;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#elif !defined(VITA) && !defined(PSP) && !defined(PS2) && !defined(ORBIS) && (!defined(SWITCH) || defined(HAVE_LIBNX))
|
#elif !defined(VITA) && !defined(PSP) && !defined(PS2) && !defined(ORBIS) && (!defined(SWITCH) || defined(HAVE_LIBNX)) && !defined(NINTENDO64)
|
||||||
if (stream && ftruncate(fileno(stream->fp), (off_t)length) == 0)
|
if (stream && ftruncate(fileno(stream->fp), (off_t)length) == 0)
|
||||||
{
|
{
|
||||||
stream->size = length;
|
stream->size = length;
|
||||||
|
@ -1021,6 +1026,9 @@ int retro_vfs_mkdir_impl(const char *dir)
|
||||||
free(dir_buf);
|
free(dir_buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#elif defined(NINTENDO64)
|
||||||
|
int ret = 0;
|
||||||
|
return -1;
|
||||||
#else
|
#else
|
||||||
int ret = mkdir(dir, 0750);
|
int ret = mkdir(dir, 0750);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1053,6 +1061,10 @@ struct libretro_vfs_implementation_dir
|
||||||
int error;
|
int error;
|
||||||
int directory;
|
int directory;
|
||||||
sysFSDirent entry;
|
sysFSDirent entry;
|
||||||
|
#elif defined(NINTENDO64)
|
||||||
|
bool directory;
|
||||||
|
unsigned flags;
|
||||||
|
char path[1024];
|
||||||
#else
|
#else
|
||||||
DIR *directory;
|
DIR *directory;
|
||||||
const struct dirent *entry;
|
const struct dirent *entry;
|
||||||
|
@ -1128,6 +1140,11 @@ libretro_vfs_implementation_dir *retro_vfs_opendir_impl(
|
||||||
rdir->entry = NULL;
|
rdir->entry = NULL;
|
||||||
#elif defined(__PSL1GHT__) || defined(__PS3__)
|
#elif defined(__PSL1GHT__) || defined(__PS3__)
|
||||||
rdir->error = sysFsOpendir(name, &rdir->directory);
|
rdir->error = sysFsOpendir(name, &rdir->directory);
|
||||||
|
#elif defined(NINTENDO64)
|
||||||
|
if (dfs_chdir(name) != DFS_ESUCCESS) return NULL;
|
||||||
|
rdir->flags = 0xff;
|
||||||
|
rdir->directory = true;
|
||||||
|
rdir->path[0] = 0;
|
||||||
#else
|
#else
|
||||||
rdir->directory = opendir(name);
|
rdir->directory = opendir(name);
|
||||||
rdir->entry = NULL;
|
rdir->entry = NULL;
|
||||||
|
@ -1165,6 +1182,13 @@ bool retro_vfs_readdir_impl(libretro_vfs_implementation_dir *rdir)
|
||||||
uint64_t nread;
|
uint64_t nread;
|
||||||
rdir->error = sysFsReaddir(rdir->directory, &rdir->entry, &nread);
|
rdir->error = sysFsReaddir(rdir->directory, &rdir->entry, &nread);
|
||||||
return (nread != 0);
|
return (nread != 0);
|
||||||
|
#elif defined(NINTENDO64)
|
||||||
|
if (rdir->flags == 0xff) {
|
||||||
|
rdir->flags = dfs_dir_findfirst(".", rdir->path);
|
||||||
|
} else {
|
||||||
|
rdir->flags = dfs_dir_findnext(rdir->path);
|
||||||
|
}
|
||||||
|
return rdir->flags != FLAGS_EOF;
|
||||||
#else
|
#else
|
||||||
return ((rdir->entry = readdir(rdir->directory)) != NULL);
|
return ((rdir->entry = readdir(rdir->directory)) != NULL);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1185,6 +1209,8 @@ const char *retro_vfs_dirent_get_name_impl(libretro_vfs_implementation_dir *rdir
|
||||||
return (char*)rdir->entry.cFileName;
|
return (char*)rdir->entry.cFileName;
|
||||||
#elif defined(VITA) || defined(__PSL1GHT__) || defined(__PS3__)
|
#elif defined(VITA) || defined(__PSL1GHT__) || defined(__PS3__)
|
||||||
return rdir->entry.d_name;
|
return rdir->entry.d_name;
|
||||||
|
#elif defined(NINTENDO64)
|
||||||
|
return rdir->path;
|
||||||
#else
|
#else
|
||||||
if (!rdir || !rdir->entry)
|
if (!rdir || !rdir->entry)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1203,6 +1229,8 @@ bool retro_vfs_dirent_is_dir_impl(libretro_vfs_implementation_dir *rdir)
|
||||||
#elif defined(__PSL1GHT__) || defined(__PS3__)
|
#elif defined(__PSL1GHT__) || defined(__PS3__)
|
||||||
sysFSDirent *entry = (sysFSDirent*)&rdir->entry;
|
sysFSDirent *entry = (sysFSDirent*)&rdir->entry;
|
||||||
return (entry->d_type == FS_TYPE_DIR);
|
return (entry->d_type == FS_TYPE_DIR);
|
||||||
|
#elif defined(NINTENDO64)
|
||||||
|
return rdir->flags & FLAGS_DIR;
|
||||||
#else
|
#else
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
char path[PATH_MAX_LENGTH];
|
char path[PATH_MAX_LENGTH];
|
||||||
|
@ -1234,6 +1262,8 @@ int retro_vfs_closedir_impl(libretro_vfs_implementation_dir *rdir)
|
||||||
sceIoDclose(rdir->directory);
|
sceIoDclose(rdir->directory);
|
||||||
#elif defined(__PSL1GHT__) || defined(__PS3__)
|
#elif defined(__PSL1GHT__) || defined(__PS3__)
|
||||||
rdir->error = sysFsClosedir(rdir->directory);
|
rdir->error = sysFsClosedir(rdir->directory);
|
||||||
|
#elif defined(NINTENDO64)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
if (rdir->directory)
|
if (rdir->directory)
|
||||||
closedir(rdir->directory);
|
closedir(rdir->directory);
|
||||||
|
|
Loading…
Add table
Reference in a new issue