Custom path support (#1333)

also including:
* getting rid of shitty strings
* all new, cleaner ROM handling code
* base for DSi savestates
* GBA slot addons (for now, memory cart)
This commit is contained in:
Arisotura
2022-01-07 14:00:43 +01:00
committed by GitHub
parent c4cd9da674
commit e665e25bd3
64 changed files with 3606 additions and 2662 deletions

View File

@ -21,100 +21,12 @@
#include "types.h"
#include <string>
#include <vector>
namespace Frontend
{
enum
{
ROMSlot_NDS = 0,
ROMSlot_GBA,
ROMSlot_MAX
};
enum
{
Load_OK = 0,
Load_BIOS9Missing,
Load_BIOS9Bad,
Load_BIOS7Missing,
Load_BIOS7Bad,
Load_FirmwareMissing,
Load_FirmwareBad,
Load_FirmwareNotBootable,
Load_DSiBIOS9Missing,
Load_DSiBIOS9Bad,
Load_DSiBIOS7Missing,
Load_DSiBIOS7Bad,
Load_DSiNANDMissing,
Load_DSiNANDBad,
// TODO: more precise errors for ROM loading
Load_ROMLoadError,
};
extern char ROMPath [ROMSlot_MAX][1024];
extern char SRAMPath[ROMSlot_MAX][1024];
extern bool SavestateLoaded;
// Stores type of nds rom i.e. nds/srl/dsi. Should be updated everytime an NDS rom is loaded from an archive
extern char NDSROMExtension[4];
// initialize the ROM handling utility
void Init_ROM();
// deinitialize the ROM handling utility
void DeInit_ROM();
// load the BIOS/firmware and boot from it
int LoadBIOS();
// load a ROM file to the specified cart slot
// note: loading a ROM to the NDS slot resets emulation
int LoadROM(const char* file, int slot);
int LoadROM(const u8 *romdata, u32 romlength, const char *archivefilename, const char *romfilename, const char *sramfilename, int slot);
// unload the ROM loaded in the specified cart slot
// simulating ejection of the cartridge
void UnloadROM(int slot);
void ROMIcon(u8 (&data)[512], u16 (&palette)[16], u32* iconRef);
void AnimatedROMIcon(u8 (&data)[8][512], u16 (&palette)[8][16], u16 (&sequence)[64], u32 (&animatedTexRef)[32 * 32 * 64], std::vector<int> &animatedSequenceRef);
// reset execution of the current ROM
int Reset();
// get the filename associated with the given savestate slot (1-8)
void GetSavestateName(int slot, char* filename, int len);
// determine whether the given savestate slot does contain a savestate
bool SavestateExists(int slot);
// load the given savestate file
// if successful, emulation will continue from the savestate's point
bool LoadState(const char* filename);
// save the current emulator state to the given file
bool SaveState(const char* filename);
// undo the latest savestate load
void UndoStateLoad();
// imports savedata from an external file. Returns the difference between the filesize and the SRAM size
int ImportSRAM(const char* filename);
// enable or disable cheats
void EnableCheats(bool enable);
// setup the display layout based on the provided display size and parameters
// * screenWidth/screenHeight: size of the host display
// * screenLayout: how the DS screens are laid out