1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-25 18:30:21 +00:00

Merge pull request #578 from TomHarte/SMSBIOSFallback

Attempts to carry on even if no BIOS is found.
This commit is contained in:
Thomas Harte 2018-10-26 21:20:43 -04:00 committed by GitHub
commit 4af0b74a42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,7 @@
#include "../../Analyser/Static/Sega/Target.hpp" #include "../../Analyser/Static/Sega/Target.hpp"
#include <algorithm> #include <algorithm>
#include <iostream>
namespace { namespace {
const int sn76489_divider = 2; const int sn76489_divider = 2;
@ -132,11 +133,13 @@ class ConcreteMachine:
if(has_bios()) { if(has_bios()) {
const auto roms = rom_fetcher("MasterSystem", {"bios.sms"}); const auto roms = rom_fetcher("MasterSystem", {"bios.sms"});
if(!roms[0]) { if(!roms[0]) {
throw ROMMachine::Error::MissingROMs; // No BIOS found; attempt to boot as though it has already disabled itself.
memory_control_ |= 0x08;
std::cerr << "No BIOS found; attempting to start cartridge directly" << std::endl;
} else {
roms[0]->resize(8*1024);
memcpy(&bios_, roms[0]->data(), roms[0]->size());
} }
roms[0]->resize(8*1024);
memcpy(&bios_, roms[0]->data(), roms[0]->size());
} }
// Map RAM. // Map RAM.