Split overly large loaded_rom constructor

This commit is contained in:
Ilari Liusvaara 2015-04-11 20:31:23 +03:00
parent 2842b76907
commit a1b96d75da
2 changed files with 10 additions and 0 deletions

View file

@ -216,6 +216,9 @@ private:
* ROM original region (this is the region ROM is loaded as).
*/
core_region* orig_region;
//Handle bundle load case.
void load_bundle(const std::string& file, std::istream& spec, const std::string& tmpprefer)
throw(std::bad_alloc, std::runtime_error);
};
/**

View file

@ -321,6 +321,13 @@ loaded_rom::loaded_rom(const std::string& file, const std::string& tmpprefer) th
throw std::runtime_error("Required ROM images missing");
return;
}
load_bundle(file, spec, tmpprefer);
}
void loaded_rom::load_bundle(const std::string& file, std::istream& spec, const std::string& tmpprefer) throw(std::bad_alloc,
std::runtime_error)
{
std::string s;
load_filename = file;
std::vector<std::string> lines;
while(std::getline(spec, s))