configure disks; rp06

This commit is contained in:
Folkert van Heusden 2024-06-12 23:11:03 +02:00
parent 68539ac29f
commit 19a41b3b35
Signed by untrusted user who does not match committer: folkert
GPG key ID: 30190E8C1F28D8AE
3 changed files with 28 additions and 25 deletions

1
bus.h
View file

@ -120,6 +120,7 @@ public:
rl02 *getRL02() { return rl02_; } rl02 *getRL02() { return rl02_; }
dc11 *getDC11() { return dc11_; } dc11 *getDC11() { return dc11_; }
tm_11 *getTM11() { return tm11; } tm_11 *getTM11() { return tm11; }
rp06 *getRP06() { return rp06_; }
uint16_t read(const uint16_t a, const word_mode_t word_mode, const rm_selection_t mode_selection, const bool peek_only=false, const d_i_space_t s = i_space); uint16_t read(const uint16_t a, const word_mode_t word_mode, const rm_selection_t mode_selection, const bool peek_only=false, const d_i_space_t s = i_space);
uint8_t read_byte(const uint16_t a) override { return read(a, wm_byte, rm_cur); } uint8_t read_byte(const uint16_t a) override { return read(a, wm_byte, rm_cur); }

View file

@ -137,7 +137,7 @@ void set_boot_loader(bus *const b, const bootloader_t which)
bl = rl02_code; bl = rl02_code;
} }
else if (which == BL_RP6) { else if (which == BL_RP06) {
start = offset = 01000; start = offset = 01000;
static const uint16_t rp06_code[] = { static const uint16_t rp06_code[] = {

View file

@ -316,9 +316,9 @@ void help()
printf("-P when serializing state to file (in the debugger), include an overlay: changes to disk-files are then non-persistent, they only exist in the state-dump\n"); printf("-P when serializing state to file (in the debugger), include an overlay: changes to disk-files are then non-persistent, they only exist in the state-dump\n");
printf("-T t.bin load file as a binary tape file (like simh \"load\" command), also for .BIC files\n"); printf("-T t.bin load file as a binary tape file (like simh \"load\" command), also for .BIC files\n");
printf("-B run tape file as a unit test (for .BIC files)\n"); printf("-B run tape file as a unit test (for .BIC files)\n");
printf("-R d.rk load file as a RK05 disk device\n"); printf("-r d.img load file as a disk device\n");
printf("-r d.rl load file as a RL02 disk device\n"); printf("-N host:port use NBD-server as disk device (like -r)");
printf("-N host:port:type use NBD-server as disk device, type being either \"rk05\" or \"rl02\"\n"); printf("-R x select disk type (rk05, rl02 or rp06)\n");
printf("-p 123 set CPU start pointer to decimal(!) value\n"); printf("-p 123 set CPU start pointer to decimal(!) value\n");
printf("-b enable bootloader (builtin)\n"); printf("-b enable bootloader (builtin)\n");
printf("-n ncurses UI\n"); printf("-n ncurses UI\n");
@ -338,8 +338,8 @@ int main(int argc, char *argv[])
{ {
//setlocale(LC_ALL, ""); //setlocale(LC_ALL, "");
std::vector<disk_backend *> rk05_files; std::vector<disk_backend *> disk_files;
std::vector<disk_backend *> rl02_files; std::string disk_type = "rk05";
bool run_debugger = false; bool run_debugger = false;
@ -443,26 +443,21 @@ int main(int argc, char *argv[])
break; break;
case 'R': case 'R':
rk05_files.push_back(new disk_backend_file(optarg)); disk_type = optarg;
if (disk_type != "rk05" && disk_type != "rl02" && disk_type != "rp06")
error_exit(false, "Disk type not known");
break; break;
case 'r': case 'r':
rl02_files.push_back(new disk_backend_file(optarg)); disk_files.push_back(new disk_backend_file(optarg));
break; break;
case 'N': { case 'N': {
auto parts = split(optarg, ":"); auto parts = split(optarg, ":");
if (parts.size() != 3) if (parts.size() != 2)
error_exit(false, "-N: parameter missing"); error_exit(false, "-N: parameter missing");
disk_backend *temp_d = new disk_backend_nbd(parts.at(0), atoi(parts.at(1).c_str())); disk_files.push_back(new disk_backend_nbd(parts.at(0), std::stoi(parts.at(1))));
if (parts.at(2) == "rk05")
rk05_files.push_back(temp_d);
else if (parts.at(2) == "rl02")
rl02_files.push_back(temp_d);
else
error_exit(false, "\"%s\" is not recognized as a disk type", parts.at(2).c_str());
} }
break; break;
@ -513,9 +508,7 @@ int main(int argc, char *argv[])
DOLOG(info, true, "Built on: " __DATE__ " " __TIME__); DOLOG(info, true, "Built on: " __DATE__ " " __TIME__);
start_disk_devices(rk05_files, disk_snapshots); start_disk_devices(disk_files, disk_snapshots);
start_disk_devices(rl02_files, disk_snapshots);
#if defined(_WIN32) #if defined(_WIN32)
cnsl = new console_posix(&event); cnsl = new console_posix(&event);
@ -552,19 +545,28 @@ int main(int argc, char *argv[])
rl02_dev->begin(); rl02_dev->begin();
b->add_rl02(rl02_dev); b->add_rl02(rl02_dev);
if (rk05_files.empty() == false) { auto rp06_dev = new rp06(b, cnsl->get_disk_read_activity_flag(), cnsl->get_disk_write_activity_flag());
rp06_dev->begin();
b->add_RP06(rp06_dev);
if (disk_type == "rk05") {
bootloader = BL_RK05; bootloader = BL_RK05;
for(auto & file: rk05_files) for(auto & file: disk_files)
rk05_dev->access_disk_backends()->push_back(file); rk05_dev->access_disk_backends()->push_back(file);
} }
else if (disk_type == "rl02") {
if (rl02_files.empty() == false) {
bootloader = BL_RL02; bootloader = BL_RL02;
for(auto & file: rl02_files) for(auto & file: disk_files)
rl02_dev->access_disk_backends()->push_back(file); rl02_dev->access_disk_backends()->push_back(file);
} }
else if (disk_type == "rp06") {
bootloader = BL_RP06;
for(auto & file: disk_files)
rp06_dev->access_disk_backends()->push_back(file);
}
if (enable_bootloader) if (enable_bootloader)
set_boot_loader(b, bootloader); set_boot_loader(b, bootloader);