mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-23 03:32:32 +00:00
Switched to std::ostringstream
to avoid the need to make a string length count (and I was one off when loading a disk).
This commit is contained in:
parent
5998123868
commit
6a37a02eee
@ -13,6 +13,8 @@
|
|||||||
#include "Disk.hpp"
|
#include "Disk.hpp"
|
||||||
#include "../../Storage/Cartridge/Encodings/CommodoreROM.hpp"
|
#include "../../Storage/Cartridge/Encodings/CommodoreROM.hpp"
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
using namespace StaticAnalyser::Commodore;
|
using namespace StaticAnalyser::Commodore;
|
||||||
|
|
||||||
static std::list<std::shared_ptr<Storage::Cartridge::Cartridge>>
|
static std::list<std::shared_ptr<Storage::Cartridge::Cartridge>>
|
||||||
@ -75,15 +77,15 @@ void StaticAnalyser::Commodore::AddTargets(
|
|||||||
|
|
||||||
if(files.size()) {
|
if(files.size()) {
|
||||||
target.vic20.memory_model = Vic20MemoryModel::Unexpanded;
|
target.vic20.memory_model = Vic20MemoryModel::Unexpanded;
|
||||||
if(files.front().is_basic()) {
|
std::ostringstream string_stream;
|
||||||
char command[16];
|
string_stream << "LOAD\"" << (is_disk ? "*" : "") << "\"," << device << ",";
|
||||||
snprintf(command, 16, "LOAD\"%s\",%d,0\nRUN\n", is_disk ? "*" : "", device);
|
if(files.front().is_basic()) {
|
||||||
target.loadingCommand = command;
|
string_stream << "0";
|
||||||
} else {
|
} else {
|
||||||
char command[16];
|
string_stream << "1";
|
||||||
snprintf(command, 16, "LOAD\"%s\",%d,1\nRUN\n", is_disk ? "*" : "", device);
|
|
||||||
target.loadingCommand = command;
|
|
||||||
}
|
}
|
||||||
|
string_stream << "\nRUN\n";
|
||||||
|
target.loadingCommand = string_stream.str();
|
||||||
|
|
||||||
// make a first guess based on loading address
|
// make a first guess based on loading address
|
||||||
switch(files.front().starting_address) {
|
switch(files.front().starting_address) {
|
||||||
|
Loading…
Reference in New Issue
Block a user