1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-11 04:28:58 +00:00

Attempts to carry on even if no BIOS is found.

This commit is contained in:
Thomas Harte 2018-10-26 21:19:16 -04:00
parent 4f0d324a6b
commit d1fc39d6e5

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.