// SPDX-License-Identifier: GPL-3.0-or-later #include "../basic-disk-session.h" using namespace BasicDiskTests; int main(int argc, char** argv) { try { if (argc != 3) throw std::runtime_error("Usage: disk ROM_DIRECTORY LANDER.DSK"); for (auto cpu : {Processor::MC6809, Processor::HD6309}) { for (auto profile : {Profile::fd, Profile::rgbHD, Profile::sdc}) { Session session(argv[1], argv[2], cpu, profile); const auto reads = session.reads(), otherReads = session.otherReads(); session.type("LOADM\"LANDER\":EXEC\r"); session.frames(1000); // Allow disk spin-up, loading and both landscape draws. const auto preview = session.machine.debuggerGraphicsPreview(true, true, 0, DebugGraphicsMode::HSCREEN2); require(!preview.text && preview.width == 320 && preview.height == 192 && preview.pixelsPerByte == 2, "Disk launch did not enter 320 x 192 x 16: " + preview.modeName); session.type("Q"); session.until("FLIGHT ENDED"); session.verifyReturn(); require(session.reads() > reads && session.otherReads() == otherReads, "Unexpected route for LOADM"); session.verifyMedia(); const char* device = profile == Profile::fd ? "FD-502" : profile == Profile::sdc ? "SDC" : "RGB-DOS HD"; std::cout << "PASS " << (cpu == Processor::MC6809 ? "MC6809 " : "HD6309 ") << device << ": disk EXEC, graphics, Q, return to BASIC and intact media\n"; } } } catch (const std::exception& error) { std::cerr << error.what() << '\n'; return 1; } }