| 361 | } |
| 362 | |
| 363 | static void SetCurrentDir(const std::string & pathname) |
| 364 | { |
| 365 | // Due to the order HDDs/disks are inserted, then s7 insertions take priority over s6 & s5; and d2 takes priority over d1: |
| 366 | // . if -s6[dN] and -hN are specified, then g_sCurrentDir will be set to the HDD image's path |
| 367 | // . if -s5[dN] and -s6[dN] are specified, then g_sCurrentDir will be set to the s6 image's path |
| 368 | // . if -[sN]d1 and -[sN]d2 are specified, then g_sCurrentDir will be set to the d2 image's path |
| 369 | // This is purely dependent on the current order of InsertFloppyDisks() & InsertHardDisks() - ie. very brittle! |
| 370 | // . better to use -current-dir to be explicit |
| 371 | std::size_t found = pathname.find_last_of(PATH_SEPARATOR); |
| 372 | std::string path = pathname.substr(0, found); |
| 373 | SetCurrentImageDir(path); |
| 374 | } |
| 375 | |
| 376 | static bool DoDiskInsert(const UINT slot, const int nDrive, LPCSTR szFileName) |
| 377 | { |
no test coverage detected