Switch to std::string only

This commit is contained in:
meepingsnesroms 2017-02-03 11:36:19 -08:00
parent e4abf1dbcc
commit 301f4bd42f
3 changed files with 8 additions and 12 deletions

View File

@ -583,8 +583,8 @@ bool retro_load_game(const struct retro_game_info *info)
//get bootloader dir
const char* systemdirtmp = NULL;
bool worked = environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY,&systemdirtmp);
if(!worked)set_bootrom_directory((char*)NULL);
else set_bootrom_directory((char*) systemdirtmp);
if(!worked)set_bootrom_directory("");
else set_bootrom_directory(systemdirtmp);
unsigned flags = 0;
struct retro_variable var = {0};

View File

@ -14,7 +14,7 @@ inline bool exist(const std::string& name){
return false;
}
static char bootrompath[4096];
static std::string bootrompath;
static uint8_t bootromswapspace[0x900];
static uint8_t rombackup[0x900];
static void* addrspace_start = NULL;
@ -35,7 +35,7 @@ static void patch_gbc_to_gba_mode(){
//this is the only retroarch specific function,everything else can just be copied over
static std::string get_bootloader_path(std::string bootloadername){
std::string path;
if(bootrompath[0] != 0){
if(bootrompath != ""){
path = bootrompath;
if(path[path.length() - 1] != '/')path += '/';
path += bootloadername;
@ -102,13 +102,8 @@ void resetbootloader(){
gbc_mode = false;
}
void set_bootrom_directory(char* dir){
if(dir != NULL){
strcpy(bootrompath,dir);
}
else{
bootrompath[0] = 0;
}
void set_bootrom_directory(std::string dir){
bootrompath = dir;
}
void set_address_space_start(void* start){

View File

@ -1,9 +1,10 @@
#include <string>
//load the rom then call the loadbootloader() function before execution starts
bool have_bootloader(bool isgbc);
bool loadbootloader(bool isgbc,bool isgba);
void resetbootloader();
void set_bootrom_directory(char* dir);
void set_bootrom_directory(std::string dir);
void set_address_space_start(void* start);
void bootloader_choosebank(bool inbootloader);