mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-23 22:52:34 +01:00
byuu says: Changelog: - SMS: added cartridge ROM/RAM mirroring (fixes Alex Kidd) - SMS: fixed 8x16 sprite mode (fixes Wonder Boy, Ys graphics) - Z80: emulated "ex (sp),hl" instruction - Z80: fixed INx NF (should be set instead of cleared) - Z80: fixed loop condition check for CPxR, INxR, LDxR, OTxR (fixes walking in Wonder Boy) - SFC: removed Debugger and sfc/debugger.hpp - icarus: connected MS, GG, MD importing to the scan dialog - PCE: added emulation skeleton to higan and icarus At this point, Master System games are fairly highly compatible, sans audio. Game Gear games are running, but I need to crop the resolution and support the higher color palette that they can utilize. It's really something else the way they handled the resolution shrink on that thing. The last change is obviously going to be the biggest news. I'm very well aware it's not an ideal time to start on a new emulation core, with the MS and MD cores only just now coming to life with no audio support. But, for whatever reason, my heart's really set on working on the PC Engine. I wanted to write the final higan skeleton core, and get things ready so that whenever I'm in the mood to work on the PCE, I can do so. The skeleton is far and away the most tedious and obnoxious part of the emulator development, because it's basically all just lots of boilerplate templated code, lots of new files to create, etc. I really don't know how things are going to proceed ... but I can say with 99.9% certainty that this will be the final brand new core ever added to higan -- at least one written by me, that is. This was basically the last system from my childhood that I ever cared about. It's the last 2D system with games that I really enjoy playing. No other system is worth dividing my efforts and reducing the quality and amount of time to work on the systems I have. In the future, there will be potential for FDS, Mega CD and PCE-CD support. But those will all be add-ons, and they'll all be really difficult and challenge the entire design of higan's UI (it's entirely cartridge-driven at this time.) None of them will be entirely new cores like this one.
99 lines
4.4 KiB
C++
99 lines
4.4 KiB
C++
Icarus::Icarus() {
|
|
database.famicom = BML::unserialize(string::read(locate("Database/Famicom.bml")));
|
|
database.superFamicom = BML::unserialize(string::read(locate("Database/Super Famicom.bml")));
|
|
database.masterSystem = BML::unserialize(string::read(locate("Database/Master System.bml")));
|
|
database.megaDrive = BML::unserialize(string::read(locate("Database/Mega Drive.bml")));
|
|
database.pcEngine = BML::unserialize(string::read(locate("Database/PC Engine.bml")));
|
|
database.gameBoy = BML::unserialize(string::read(locate("Database/Game Boy.bml")));
|
|
database.gameBoyColor = BML::unserialize(string::read(locate("Database/Game Boy Color.bml")));
|
|
database.gameBoyAdvance = BML::unserialize(string::read(locate("Database/Game Boy Advance.bml")));
|
|
database.gameGear = BML::unserialize(string::read(locate("Database/Game Gear.bml")));
|
|
database.wonderSwan = BML::unserialize(string::read(locate("Database/WonderSwan.bml")));
|
|
database.wonderSwanColor = BML::unserialize(string::read(locate("Database/WonderSwan Color.bml")));
|
|
database.bsMemory = BML::unserialize(string::read(locate("Database/BS Memory.bml")));
|
|
database.sufamiTurbo = BML::unserialize(string::read(locate("Database/Sufami Turbo.bml")));
|
|
}
|
|
|
|
auto Icarus::error() const -> string {
|
|
return errorMessage;
|
|
}
|
|
|
|
auto Icarus::success(string location) -> string {
|
|
errorMessage = "";
|
|
return location;
|
|
}
|
|
|
|
auto Icarus::failure(string message) -> string {
|
|
errorMessage = message;
|
|
return {};
|
|
}
|
|
|
|
auto Icarus::manifest(string location) -> string {
|
|
location.transform("\\", "/").trimRight("/").append("/");
|
|
if(!directory::exists(location)) return "";
|
|
|
|
auto type = Location::suffix(location).downcase();
|
|
if(type == ".fc") return famicomManifest(location);
|
|
if(type == ".sfc") return superFamicomManifest(location);
|
|
if(type == ".ms") return masterSystemManifest(location);
|
|
if(type == ".md") return megaDriveManifest(location);
|
|
if(type == ".pce") return pcEngineManifest(location);
|
|
if(type == ".gb") return gameBoyManifest(location);
|
|
if(type == ".gbc") return gameBoyColorManifest(location);
|
|
if(type == ".gba") return gameBoyAdvanceManifest(location);
|
|
if(type == ".gg") return gameGearManifest(location);
|
|
if(type == ".ws") return wonderSwanManifest(location);
|
|
if(type == ".wsc") return wonderSwanColorManifest(location);
|
|
if(type == ".bs") return bsMemoryManifest(location);
|
|
if(type == ".st") return sufamiTurboManifest(location);
|
|
|
|
return "";
|
|
}
|
|
|
|
auto Icarus::import(string location) -> string {
|
|
location.transform("\\", "/").trimRight("/");
|
|
if(!file::exists(location)) return failure("file does not exist");
|
|
if(!file::readable(location)) return failure("file is unreadable");
|
|
|
|
auto name = Location::prefix(location);
|
|
auto type = Location::suffix(location).downcase();
|
|
if(!name || !type) return failure("invalid file name");
|
|
|
|
auto buffer = file::read(location);
|
|
if(!buffer) return failure("file is empty");
|
|
|
|
if(type == ".zip") {
|
|
Decode::ZIP zip;
|
|
if(!zip.open(location)) return failure("ZIP archive is invalid");
|
|
if(!zip.file) return failure("ZIP archive is empty");
|
|
|
|
name = Location::prefix(zip.file[0].name);
|
|
type = Location::suffix(zip.file[0].name).downcase();
|
|
buffer = zip.extract(zip.file[0]);
|
|
}
|
|
|
|
if(type == ".fc" || type == ".nes") return famicomImport(buffer, location);
|
|
if(type == ".sfc" || type == ".smc") return superFamicomImport(buffer, location);
|
|
if(type == ".ms" || type == ".sms") return masterSystemImport(buffer, location);
|
|
if(type == ".md" || type == ".smd" || type == ".gen") return megaDriveImport(buffer, location);
|
|
if(type == ".pce") return pcEngineImport(buffer, location);
|
|
if(type == ".gb") return gameBoyImport(buffer, location);
|
|
if(type == ".gbc") return gameBoyColorImport(buffer, location);
|
|
if(type == ".gba") return gameBoyAdvanceImport(buffer, location);
|
|
if(type == ".gg") return gameGearImport(buffer, location);
|
|
if(type == ".ws") return wonderSwanImport(buffer, location);
|
|
if(type == ".wsc") return wonderSwanColorImport(buffer, location);
|
|
if(type == ".bs") return bsMemoryImport(buffer, location);
|
|
if(type == ".st") return sufamiTurboImport(buffer, location);
|
|
|
|
return failure("unrecognized file extension");
|
|
}
|
|
|
|
auto Icarus::concatenate(vector<uint8_t>& output, string location) -> void {
|
|
if(auto input = file::read(location)) {
|
|
auto size = output.size();
|
|
output.resize(size + input.size());
|
|
memory::copy(output.data() + size, input.data(), input.size());
|
|
}
|
|
}
|