fork of PCE focusing on macplus, supporting DaynaPort SCSI network emulation
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

rc759: Add command line option '-b' to set the boot device

+68 -6
+7 -1
src/arch/rc759/main.c
··· 5 5 /***************************************************************************** 6 6 * File name: src/arch/rc759/main.c * 7 7 * Created: 2012-06-29 by Hampa Hug <hampa@hampa.ch> * 8 - * Copyright: (C) 2012-2022 Hampa Hug <hampa@hampa.ch> * 8 + * Copyright: (C) 2012-2025 Hampa Hug <hampa@hampa.ch> * 9 9 *****************************************************************************/ 10 10 11 11 /***************************************************************************** ··· 45 45 46 46 const char *par_terminal = NULL; 47 47 const char *par_video = NULL; 48 + const char *par_boot = NULL; 48 49 49 50 monitor_t par_mon; 50 51 ··· 57 58 58 59 static pce_option_t opts[] = { 59 60 { '?', 0, "help", NULL, "Print usage information" }, 61 + { 'b', 1, "boot", "string", "Set the boot device [none]" }, 60 62 { 'c', 1, "config", "string", "Set the config file name [none]" }, 61 63 { 'd', 1, "path", "string", "Add a directory to the search path" }, 62 64 { 'g', 1, "video", "string", "Set the video device" }, ··· 249 251 case 'V': 250 252 print_version(); 251 253 return (0); 254 + 255 + case 'b': 256 + par_boot = optarg[0]; 257 + break; 252 258 253 259 case 'c': 254 260 cfg = optarg[0];
+3 -2
src/arch/rc759/main.h
··· 5 5 /***************************************************************************** 6 6 * File name: src/arch/rc759/main.h * 7 7 * Created: 2012-06-29 by Hampa Hug <hampa@hampa.ch> * 8 - * Copyright: (C) 2012-2015 Hampa Hug <hampa@hampa.ch> * 8 + * Copyright: (C) 2012-2025 Hampa Hug <hampa@hampa.ch> * 9 9 *****************************************************************************/ 10 10 11 11 /***************************************************************************** ··· 15 15 * * 16 16 * This program is distributed in the hope that it will be useful, but * 17 17 * WITHOUT ANY WARRANTY, without even the implied warranty of * 18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * 18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * 19 19 * Public License for more details. * 20 20 *****************************************************************************/ 21 21 ··· 29 29 30 30 extern const char *par_terminal; 31 31 extern const char *par_video; 32 + extern const char *par_boot; 32 33 33 34 34 35 void sim_stop (void);
+19 -1
src/arch/rc759/pce-rc759.1
··· 1 - .TH PCE-RC759 1 "2012-07-08" "HH" "pce" 1 + .TH PCE-RC759 1 "2025-04-22" "HH" "pce" 2 2 \ 3 3 .SH NAME 4 4 pce-rc759 \- RC759 Piccoline emulator ··· 11 11 is an RC759 Piccoline emulator. 12 12 \ 13 13 .SH OPTIONS 14 + .TP 15 + .BI "-b, --boot " device 16 + Set the boot device in the NVM before starting the emulation. Valid 17 + boot devices are: 18 + .RS 19 + .TP 20 + .B a 21 + The first floppy disk drive (A:) 22 + .TP 23 + .B b 24 + The second floppy disk drive (B:) 25 + .TP 26 + .B net 27 + Network 28 + .TP 29 + .B prom 30 + Boot into PROM 31 + .RE 14 32 .TP 15 33 .BI "-c, --config " file 16 34 Set the config file name.
+5
src/arch/rc759/pce-rc759.cfg.in
··· 64 64 # and the NVM checksum is set correctly. 65 65 sanitize_nvm = 1 66 66 67 + # Update the boot device in the NVM. 68 + # 69 + # Valid boot devices are "a", "b", "prom" and "net". 70 + boot = "prom" 71 + 67 72 # The local parallel port 68 73 parport1 = "stdio:file=parport1.out:flush=1" 69 74
+34 -2
src/arch/rc759/rc759.c
··· 371 371 static 372 372 void rc759_setup_nvm (rc759_t *sim, ini_sct_t *ini) 373 373 { 374 - const char *nvm; 374 + const char *nvm, *boot; 375 375 int sanitize; 376 376 ini_sct_t *sct; 377 377 378 378 sct = ini_next_sct (ini, NULL, "system"); 379 379 380 380 ini_get_string (sct, "nvm", &nvm, "nvm.dat"); 381 + ini_get_string (sct, "boot", &boot, ""); 381 382 ini_get_bool (sct, "sanitize_nvm", &sanitize, 0); 382 383 384 + if (par_boot != NULL) { 385 + boot = par_boot; 386 + } 387 + 383 388 pce_log_tag (MSG_INF, "NVM:", 384 - "file=%s sanitize=%d\n", nvm, sanitize 389 + "file=%s boot=%s sanitize=%d\n", nvm, boot, sanitize 385 390 ); 386 391 387 392 rc759_nvm_init (&sim->nvm); ··· 391 396 pce_log (MSG_ERR, "*** error loading the NVM (%s)\n", 392 397 (nvm != NULL) ? nvm : "<none>" 393 398 ); 399 + } 400 + 401 + if (*boot != 0) { 402 + unsigned val = 0; 403 + 404 + if (strcmp (boot, "a") == 0) { 405 + val = 0x41; 406 + } 407 + else if (strcmp (boot, "b") == 0) { 408 + val = 0x42; 409 + } 410 + else if (strcmp (boot, "prom") == 0) { 411 + val = 0x4d; 412 + } 413 + else if (strcmp (boot, "net") == 0) { 414 + val = 0x4e; 415 + } 416 + else { 417 + pce_log (MSG_ERR, "*** unknown boot device (%s)\n", 418 + boot 419 + ); 420 + } 421 + 422 + if (val != 0) { 423 + rc759_nvm_set_uint8 (&sim->nvm, 0x19, val); 424 + rc759_nvm_fix_checksum (&sim->nvm); 425 + } 394 426 } 395 427 396 428 if (sanitize) {