Core and frontend are no longer linked, header name fixed

This commit is contained in:
meepingsnesroms 2017-02-03 08:37:51 -08:00
parent 72e5be687a
commit f0bdfa0ce0
4 changed files with 32 additions and 23 deletions

View File

@ -2,6 +2,7 @@
#include "blipper.h"
#include <gambatte.h>
#include "gbcpalettes.h"
#include "bootloader.h"
#ifdef HAVE_NETWORK
#include "net_serial.h"
#endif
@ -18,8 +19,6 @@ extern "C" void* linearMemAlign(size_t size, size_t alignment);
extern "C" void linearFree(void* mem);
#endif
char systempath[4096];
retro_log_printf_t log_cb;
static retro_video_refresh_t video_cb;
static retro_input_poll_t input_poll_cb;
@ -584,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)systempath[0] = 0;
else strcpy(systempath,systemdirtmp);
if(!worked)set_bootrom_directory((char*)NULL);
else set_bootrom_directory((char*) systemdirtmp);
unsigned flags = 0;
struct retro_variable var = {0};

View File

@ -1,13 +1,10 @@
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <string>
#include "bootloader.h"
using std::string;
inline bool exist(const std::string& name){
FILE *file = fopen(name.c_str(), "r");
if(file){
@ -17,8 +14,7 @@ inline bool exist(const std::string& name){
return false;
}
extern char systempath[];
static char bootrompath[4096];
static uint8_t bootromswapspace[0x900];
static uint8_t rombackup[0x900];
static void* addrspace_start = NULL;
@ -30,17 +26,21 @@ static bool gbc_mode;
//this is the only retroarch specific function,everything else can just be copied over
static string get_bootloader_path(string bootloadername){
static std::string get_bootloader_path(std::string bootloadername){
std::string path;
path = systempath;
if(path == "")return "";
if(path[path.length() - 1] != '/')path += '/';
path += bootloadername;
if(bootrompath != NULL){
path = bootrompath;
if(path[path.length() - 1] != '/')path += '/';
path += bootloadername;
}
else{
path = "";
}
return path;
}
bool have_bootloader(bool isgbc){
string path;
std::string path;
if(isgbc)path = get_bootloader_path("gbc_bios.bin");
else path = get_bootloader_path("gb_bios.bin");
if(path == "")return false;
@ -49,7 +49,7 @@ bool have_bootloader(bool isgbc){
bool loadbootloader(bool isgbc){
unsigned int size;
string path;
std::string path;
int n = 0;
FILE *fp;
@ -90,6 +90,19 @@ void resetbootloader(){
using_bootloader = false;
}
void set_bootrom_directory(char* dir){
if(dir != NULL){
strcpy(bootrompath,dir);
}
else{
bootrompath[0] = 0;
}
}
void set_address_space_start(void* start){
addrspace_start = start;
}
void bootloader_choosebank(bool inbootloader){
//inbootloader = (state.mem.ioamhram.get()[0x150] != 0xFF);//do not uncomment this is just for reference
if(using_bootloader){
@ -105,10 +118,6 @@ void bootloader_choosebank(bool inbootloader){
}
}
void set_address_space_start(void* start){
addrspace_start = start;
}
void call_FF50(){
if(!has_called_FF50 && using_bootloader){
//put rom back in main memory when bootloader has finished

View File

@ -3,10 +3,11 @@ bool have_bootloader(bool isgbc);
bool loadbootloader(bool isgbc);
void resetbootloader();
void bootloader_choosebank(bool inbootloader);
void set_bootrom_directory(char* dir);
void set_address_space_start(void* start);
void bootloader_choosebank(bool inbootloader);
void call_FF50();
void uncall_FF50();

View File

@ -24,7 +24,7 @@
#include "bootloader.h"
#include <sstream>
#include "string.h"
#include <string.h>//for memset
namespace gambatte {
struct GB::Priv {