OSDN Git Service

[VM][FMTOWNS][MEMORY] Fix setup around memory banks by I/O 0404h and 0480h.
[csp-qt/common_source_project-fm7.git] / source / src / vm / mz2500 / mz2500.cpp
1 /*
2         SHARP MZ-2500 Emulator 'EmuZ-2500'
3
4         Author : Takeda.Toshiya
5         Date   : 2006.11.24 -
6
7         [ virtual machine ]
8 */
9
10 #include "mz2500.h"
11 #include "../../emu.h"
12 #include "../device.h"
13 #include "../event.h"
14
15 #include "../datarec.h"
16 #include "../disk.h"
17 #include "../harddisk.h"
18 #include "../i8253.h"
19 #include "../i8255.h"
20 #include "../io.h"
21 #include "../mb8877.h"
22 #include "../mz1p17.h"
23 #include "../noise.h"
24 #include "../pcm1bit.h"
25 //#include "../pcpr201.h"
26 #include "../prnfile.h"
27 #include "../rp5c01.h"
28 #include "../scsi_hdd.h"
29 #include "../scsi_host.h"
30 #include "../w3100a.h"
31 #include "../ym2203.h"
32 #include "../z80.h"
33 #include "../z80pio.h"
34 #include "../z80sio.h"
35
36 #ifdef USE_DEBUGGER
37 #include "../debugger.h"
38 #endif
39
40 #include "calendar.h"
41 #include "cmt.h"
42 #include "crtc.h"
43 #include "floppy.h"
44 #include "interrupt.h"
45 #include "joystick.h"
46 #include "keyboard.h"
47 #include "./memory.h"
48 #include "mouse.h"
49 #include "mz1e26.h"
50 #include "mz1e30.h"
51 #include "mz1r13.h"
52 #include "mz1r37.h"
53 #include "printer.h"
54 #include "serial.h"
55 #include "timer.h"
56
57 using MZ2500::CALENDAR;
58 using MZ2500::CMT;
59 using MZ2500::CRTC;
60 using MZ2500::FLOPPY;
61 using MZ2500::INTERRUPT;
62 using MZ2500::JOYSTICK;
63 using MZ2500::KEYBOARD;
64 using MZ2500::MEMORY;
65 using MZ2500::MOUSE;
66 using MZ2500::MZ1E26;
67 using MZ2500::MZ1E30;
68 using MZ2500::MZ1R13;
69 using MZ2500::MZ1R37;
70 using MZ2500::PRINTER;
71 using MZ2500::SERIAL;
72 using MZ2500::TIMER;
73
74 // ----------------------------------------------------------------------------
75 // initialize
76 // ----------------------------------------------------------------------------
77
78 VM::VM(EMU_TEMPLATE* parent_emu) : VM_TEMPLATE(parent_emu)
79 {
80         // create devices
81         first_device = last_device = NULL;
82         dummy = new DEVICE(this, emu);  // must be 1st device
83         event = new EVENT(this, emu);   // must be 2nd device
84         dummy->set_device_name(_T("1st Dummy"));
85
86         drec = new DATAREC(this, emu);
87         drec->set_context_noise_play(new NOISE(this, emu));
88         drec->set_context_noise_stop(new NOISE(this, emu));
89         drec->set_context_noise_fast(new NOISE(this, emu));
90         pit = new I8253(this, emu);
91         pio_i = new I8255(this, emu);
92         io = new IO(this, emu);
93         io->space = 0x100;
94         fdc = new MB8877(this, emu);
95         fdc->set_context_noise_seek(new NOISE(this, emu));
96         fdc->set_context_noise_head_down(new NOISE(this, emu));
97         fdc->set_context_noise_head_up(new NOISE(this, emu));
98 #ifdef USE_DEBUGGER
99 //      fdc->set_context_debugger(new DEBUGGER(this, emu));
100 #endif
101         pcm = new PCM1BIT(this, emu);
102 #ifdef USE_DEBUGGER
103 //      pcm->set_context_debugger(new DEBUGGER(this, emu));
104 #endif
105         rtc = new RP5C01(this, emu);    // RP-5C15
106         sasi_host = new SCSI_HOST(this, emu);
107         sasi_hdd = new SASI_HDD(this, emu);
108         sasi_hdd->set_device_name(_T("SASI Hard Disk Drive"));
109         sasi_hdd->scsi_id = 0;
110 //      sasi_hdd->bytes_per_sec = 32 * 1024; // 32KB/s
111         sasi_hdd->bytes_per_sec = 3600 / 60 * 256 * 33; // 3600rpm, 256bytes x 33sectors in track (thanks Mr.Sato)
112         for(int i = 0; i < USE_HARD_DISK; i++) {
113                 sasi_hdd->set_disk_handler(i, new HARDDISK(emu));
114         }
115         sasi_hdd->set_context_interface(sasi_host);
116         sasi_host->set_context_target(sasi_hdd);
117         w3100a = new W3100A(this, emu);
118         opn = new YM2203(this, emu);
119 #ifdef USE_DEBUGGER
120         opn->set_context_debugger(new DEBUGGER(this, emu));
121 #endif
122         cpu = new Z80(this, emu);
123         pio = new Z80PIO(this, emu);
124         sio = new Z80SIO(this, emu);
125
126         pio_i->set_device_name(_T("i8255 PIO(CMT/CRTC)"));
127         pio->set_device_name(_T("Z80 PIO(KEYBOARD/CRTC)"));
128         sio->set_device_name(_T("Z80 SIO(MOUSE)"));
129
130
131         calendar = new CALENDAR(this, emu);
132         cmt = new CMT(this, emu);
133         crtc = new CRTC(this, emu);
134         floppy = new FLOPPY(this, emu);
135         interrupt = new INTERRUPT(this, emu);
136         joystick = new JOYSTICK(this, emu);
137         keyboard = new KEYBOARD(this, emu);
138         memory = new MEMORY(this, emu);
139         mouse = new MOUSE(this, emu);
140         mz1e26 = new MZ1E26(this, emu);
141         mz1e30 = new MZ1E30(this, emu);
142         mz1r13 = new MZ1R13(this, emu);
143         mz1r37 = new MZ1R37(this, emu);
144         printer = new PRINTER(this, emu);
145         serial = new SERIAL(this, emu);
146         timer = new TIMER(this, emu);
147         // set contexts
148         event->set_context_cpu(cpu, config.boot_mode ? CPU_CLOCKS_LOW : CPU_CLOCKS);
149         event->set_context_sound(opn);
150         event->set_context_sound(pcm);
151         event->set_context_sound(drec);
152         event->set_context_sound(fdc->get_context_noise_seek());
153         event->set_context_sound(fdc->get_context_noise_head_down());
154         event->set_context_sound(fdc->get_context_noise_head_up());
155         event->set_context_sound(drec->get_context_noise_play());
156         event->set_context_sound(drec->get_context_noise_stop());
157         event->set_context_sound(drec->get_context_noise_fast());
158
159         drec->set_context_ear(cmt, SIG_CMT_OUT, 1);
160         drec->set_context_remote(cmt, SIG_CMT_REMOTE, 1);
161         drec->set_context_end(cmt, SIG_CMT_END, 1);
162         drec->set_context_top(cmt, SIG_CMT_TOP, 1);
163
164         pit->set_context_ch0(interrupt, SIG_INTERRUPT_I8253, 1);
165         pit->set_context_ch0(pit, SIG_I8253_CLOCK_1, 1);
166         pit->set_context_ch1(pit, SIG_I8253_CLOCK_2, 1);
167         pit->set_constant_clock(0, 31250);
168         pio_i->set_context_port_a(cmt, SIG_CMT_PIO_PA, 0xff, 0);
169         pio_i->set_context_port_c(cmt, SIG_CMT_PIO_PC, 0xff, 0);
170         pio_i->set_context_port_a(crtc, SIG_CRTC_REVERSE, 0x10, 0);
171         pio_i->set_context_port_c(crtc, SIG_CRTC_MASK, 0x01, 0);
172         pio_i->set_context_port_c(pcm, SIG_PCM1BIT_SIGNAL, 0x04, 0);
173         // Sound:: Force realtime rendering. This is temporally fix. 20161024 K.O
174         //pcm->set_realtime_render(true);
175
176
177         rtc->set_context_alarm(interrupt, SIG_INTERRUPT_RP5C15, 1);
178         rtc->set_context_pulse(opn, SIG_YM2203_PORT_B, 8);
179         sasi_host->set_context_irq(mz1e30, SIG_MZ1E30_IRQ, 1);
180         sasi_host->set_context_drq(mz1e30, SIG_MZ1E30_DRQ, 1);
181         opn->set_context_port_a(floppy, SIG_FLOPPY_REVERSE, 0x02, 0);
182         opn->set_context_port_a(crtc, SIG_CRTC_PALLETE, 0x04, 0);
183         opn->set_context_port_a(mouse, SIG_MOUSE_SEL, 0x08, 0);
184         pio->set_context_port_a(crtc, SIG_CRTC_COLUMN_SIZE, 0x20, 0);
185         pio->set_context_port_a(keyboard, SIG_KEYBOARD_COLUMN, 0x1f, 0);
186         pio->set_context_port_a(memory, SIG_MEMORY_VRAM_SEL, 0xc0, 0);
187         sio->set_context_dtr(1, mouse, SIG_MOUSE_DTR, 1);
188
189         calendar->set_context_rtc(rtc);
190         cmt->set_context_pio(pio_i);
191         cmt->set_context_drec(drec);
192         crtc->set_context_mem(memory);
193         crtc->set_context_int(interrupt);
194         crtc->set_context_pio(pio_i);
195         crtc->set_vram_ptr(memory->get_vram());
196         crtc->set_tvram_ptr(memory->get_tvram());
197         crtc->set_kanji_ptr(memory->get_kanji());
198         crtc->set_pcg_ptr(memory->get_pcg());
199         floppy->set_context_fdc(fdc);
200         keyboard->set_context_pio_i(pio_i);
201         keyboard->set_context_pio(pio);
202         memory->set_context_cpu(cpu);
203         memory->set_context_crtc(crtc);
204         mouse->set_context_sio(sio);
205         mz1e30->set_context_host(sasi_host);
206         if(config.printer_type == 0) {
207                 printer->set_context_prn(new PRNFILE(this, emu));
208         } else if(config.printer_type == 1) {
209                 MZ1P17 *mz1p17 = new MZ1P17(this, emu);
210                 mz1p17->mode = MZ1P17_MODE_MZ1;
211                 printer->set_context_prn(mz1p17);
212 //      } else if(config.printer_type == 2) {
213 //              printer->set_context_prn(new PCPR201(this, emu));
214         } else {
215                 printer->set_context_prn(dummy);
216         }
217         serial->set_context_sio(sio);
218         timer->set_context_pit(pit);
219
220         // cpu bus
221         cpu->set_context_mem(memory);
222         cpu->set_context_io(io);
223         cpu->set_context_intr(pio);
224 #ifdef USE_DEBUGGER
225         cpu->set_context_debugger(new DEBUGGER(this, emu));
226 #endif
227
228         // z80 family daisy chain
229         pio->set_context_intr(cpu, 0);
230         pio->set_context_child(sio);
231         sio->set_context_intr(cpu, 1);
232         sio->set_context_child(interrupt);
233         interrupt->set_context_intr(cpu, 2);
234
235         // i/o bus
236         io->set_iomap_range_rw(0x60, 0x63, w3100a);
237         io->set_iomap_range_rw(0xa0, 0xa3, serial);
238         io->set_iomap_range_rw(0xa4, 0xa5, mz1e30);
239         io->set_iomap_range_rw(0xa8, 0xa9, mz1e30);
240         io->set_iomap_range_rw(0xac, 0xad, mz1r37);
241         io->set_iomap_single_w(0xae, crtc);
242         io->set_iomap_range_rw(0xb0, 0xb3, serial);
243         io->set_iomap_range_rw(0xb4, 0xb5, memory);
244         io->set_iomap_single_w(0xb7, memory);
245         io->set_iomap_range_rw(0xb8, 0xb9, mz1r13);
246         io->set_iomap_range_rw(0xbc, 0xbf, crtc);
247         io->set_iomap_range_w(0xc6, 0xc7, interrupt);
248         io->set_iomap_range_rw(0xc8, 0xc9, opn);
249         io->set_iomap_single_rw(0xca, mz1e26);
250         io->set_iomap_single_rw(0xcc, calendar);
251         io->set_iomap_single_w(0xcd, serial);
252         io->set_iomap_range_w(0xce, 0xcf, memory);
253         io->set_iomap_range_rw(0xd8, 0xdb, fdc);
254         io->set_iomap_range_w(0xdc, 0xdd, floppy);
255         io->set_iomap_range_rw(0xe0, 0xe3, pio_i);
256         io->set_iomap_range_rw(0xe4, 0xe7, pit);
257         io->set_iomap_range_rw(0xe8, 0xeb, pio);
258         io->set_iomap_single_rw(0xef, joystick);
259         io->set_iomap_range_w(0xf0, 0xf3, timer);
260         io->set_iomap_range_rw(0xf4, 0xf7, crtc);
261         io->set_iomap_range_rw(0xfe, 0xff, printer);
262
263         if(config.boot_mode == 0) {
264                 io->set_iowait_range_rw(0xd8, 0xdf, 1); // nfdcs
265                 io->set_iowait_range_rw(0xe8, 0xeb, 1); // npioc
266         }
267         io->set_iowait_range_rw(0xc8, 0xc9, 1); // nopnc
268         io->set_iowait_single_rw(0xcc, 3);      // nrtcs
269
270         // initialize all devices
271 #if defined(__GIT_REPO_VERSION)
272         set_git_repo_version(__GIT_REPO_VERSION);
273 #endif
274         initialize_devices();
275
276         for(int drv = 0; drv < MAX_DRIVE; drv++) {
277 //              if(config.drive_type) {
278 //                      fdc->set_drive_type(drv, DRIVE_TYPE_2D);
279 //              } else {
280                         fdc->set_drive_type(drv, DRIVE_TYPE_2DD);
281 //              }
282         }
283         for(int drv = 0; drv < USE_HARD_DISK; drv++) {
284                 if(!(config.last_hard_disk_path[drv][0] != _T('\0') && FILEIO::IsFileExisting(config.last_hard_disk_path[drv]))) {
285                         create_local_path(config.last_hard_disk_path[drv], _MAX_PATH, _T("SASI%d.DAT"), drv);
286                 }
287         }
288         boot_mode = config.boot_mode;
289         monitor_type = config.monitor_type;
290 }
291
292 VM::~VM()
293 {
294         // delete all devices
295         for(DEVICE* device = first_device; device;) {
296                 DEVICE *next_device = device->next_device;
297                 device->release();
298                 delete device;
299                 device = next_device;
300         }
301 }
302
303 DEVICE* VM::get_device(int id)
304 {
305         for(DEVICE* device = first_device; device; device = device->next_device) {
306                 if(device->this_device_id == id) {
307                         return device;
308                 }
309         }
310         return NULL;
311 }
312
313 // ----------------------------------------------------------------------------
314 // drive virtual machine
315 // ----------------------------------------------------------------------------
316
317 void VM::reset()
318 {
319         // reset all devices
320         for(DEVICE* device = first_device; device; device = device->next_device) {
321                 device->reset();
322         }
323
324         // set initial port status
325         uint8_t port_b = 0x37;
326         if(boot_mode == 1) {
327                 port_b &= ~0x10;
328         } else if(boot_mode == 2) {
329                 port_b &= ~0x20;
330         }
331         if(monitor_type & 2) {
332                 port_b |= 0x40;
333         }
334         opn->write_signal(SIG_YM2203_PORT_B, port_b, 0xff);
335 }
336
337 void VM::special_reset(int num)
338 {
339         // reset all devices
340 //      for(DEVICE* device = first_device; device; device = device->next_device) {
341 //              device->special_reset();
342 //      }
343         memory->special_reset(num);
344         cpu->special_reset(num);
345 }
346
347 void VM::run()
348 {
349         event->drive();
350 }
351
352 double VM::get_frame_rate()
353 {
354         return event->get_frame_rate();
355 }
356
357 // ----------------------------------------------------------------------------
358 // debugger
359 // ----------------------------------------------------------------------------
360
361 #ifdef USE_DEBUGGER
362 DEVICE *VM::get_cpu(int index)
363 {
364         if(index == 0) {
365                 return cpu;
366         }
367         return NULL;
368 }
369 #endif
370
371 // ----------------------------------------------------------------------------
372 // draw screen
373 // ----------------------------------------------------------------------------
374
375 void VM::draw_screen()
376 {
377         crtc->draw_screen();
378 }
379
380 // ----------------------------------------------------------------------------
381 // soud manager
382 // ----------------------------------------------------------------------------
383
384 void VM::initialize_sound(int rate, int samples)
385 {
386         // init sound manager
387         event->initialize_sound(rate, samples);
388
389         // init sound gen
390         opn->initialize_sound(rate, 2000000, samples, 0, -8);
391         pcm->initialize_sound(rate, 4096);
392 }
393
394 uint16_t* VM::create_sound(int* extra_frames)
395 {
396         return event->create_sound(extra_frames);
397 }
398
399 int VM::get_sound_buffer_ptr()
400 {
401         return event->get_sound_buffer_ptr();
402 }
403
404 #ifdef USE_SOUND_VOLUME
405 void VM::set_sound_device_volume(int ch, int decibel_l, int decibel_r)
406 {
407         if(ch == 0) {
408                 opn->set_volume(0, decibel_l, decibel_r);
409         } else if(ch == 1) {
410                 opn->set_volume(1, decibel_l, decibel_r);
411         } else if(ch == 2) {
412                 pcm->set_volume(0, decibel_l, decibel_r);
413         } else if(ch == 3) {
414                 drec->set_volume(0, decibel_l, decibel_r);
415         } else if(ch == 4) {
416                 drec->set_volume(1, decibel_l, decibel_r);
417         } else if(ch == 5) {
418                 fdc->get_context_noise_seek()->set_volume(0, decibel_l, decibel_r);
419                 fdc->get_context_noise_head_down()->set_volume(0, decibel_l, decibel_r);
420                 fdc->get_context_noise_head_up()->set_volume(0, decibel_l, decibel_r);
421         } else if(ch == 6) {
422                 drec->get_context_noise_play()->set_volume(0, decibel_l, decibel_r);
423                 drec->get_context_noise_stop()->set_volume(0, decibel_l, decibel_r);
424                 drec->get_context_noise_fast()->set_volume(0, decibel_l, decibel_r);
425         }
426 }
427 #endif
428
429 // ----------------------------------------------------------------------------
430 // socket
431 // ----------------------------------------------------------------------------
432
433 void VM::notify_socket_connected(int ch)
434 {
435         w3100a->notify_connected(ch);
436 }
437
438 void VM::notify_socket_disconnected(int ch)
439 {
440         w3100a->notify_disconnected(ch);
441 }
442
443 uint8_t* VM::get_socket_send_buffer(int ch, int* size)
444 {
445         return w3100a->get_send_buffer(ch, size);
446 }
447
448 void VM::inc_socket_send_buffer_ptr(int ch, int size)
449 {
450         w3100a->inc_send_buffer_ptr(ch, size);
451 }
452
453 uint8_t* VM::get_socket_recv_buffer0(int ch, int* size0, int* size1)
454 {
455         return w3100a->get_recv_buffer0(ch, size0, size1);
456 }
457
458 uint8_t* VM::get_socket_recv_buffer1(int ch)
459 {
460         return w3100a->get_recv_buffer1(ch);
461 }
462
463 void VM::inc_socket_recv_buffer_ptr(int ch, int size)
464 {
465         w3100a->inc_recv_buffer_ptr(ch, size);
466 }
467
468 // ----------------------------------------------------------------------------
469 // user interface
470 // ----------------------------------------------------------------------------
471
472 void VM::open_floppy_disk(int drv, const _TCHAR* file_path, int bank)
473 {
474         fdc->open_disk(drv, file_path, bank);
475
476         if(fdc->get_media_type(drv) == MEDIA_TYPE_2DD) {
477                 if(fdc->get_drive_type(drv) == DRIVE_TYPE_2D) {
478                         fdc->set_drive_type(drv, DRIVE_TYPE_2DD);
479                 }
480         } else if(fdc->get_media_type(drv) == MEDIA_TYPE_2D) {
481                 if(fdc->get_drive_type(drv) == DRIVE_TYPE_2DD) {
482                         fdc->set_drive_type(drv, DRIVE_TYPE_2D);
483                 }
484         }
485 }
486
487 void VM::close_floppy_disk(int drv)
488 {
489         fdc->close_disk(drv);
490 }
491
492 bool VM::is_floppy_disk_inserted(int drv)
493 {
494         return fdc->is_disk_inserted(drv);
495 }
496
497 void VM::is_floppy_disk_protected(int drv, bool value)
498 {
499         fdc->is_disk_protected(drv, value);
500 }
501
502 bool VM::is_floppy_disk_protected(int drv)
503 {
504         return fdc->is_disk_protected(drv);
505 }
506
507 uint32_t VM::is_floppy_disk_accessed()
508 {
509         return fdc->read_signal(0);
510 }
511
512 void VM::open_hard_disk(int drv, const _TCHAR* file_path)
513 {
514         if(drv < USE_HARD_DISK) {
515                 sasi_hdd->open(drv, file_path, 256);
516         }
517 }
518
519 void VM::close_hard_disk(int drv)
520 {
521         if(drv < USE_HARD_DISK) {
522                 sasi_hdd->close(drv);
523         }
524 }
525
526 bool VM::is_hard_disk_inserted(int drv)
527 {
528         if(drv < USE_HARD_DISK) {
529                 return sasi_hdd->mounted(drv);
530         }
531         return false;
532 }
533
534 uint32_t VM::is_hard_disk_accessed()
535 {
536         uint32_t status = 0;
537
538         for(int drv = 0; drv < USE_HARD_DISK; drv++) {
539                 if(sasi_hdd->accessed(drv)) {
540                         status |= 1 << drv;
541                 }
542         }
543         return status;
544 }
545
546 void VM::play_tape(int drv, const _TCHAR* file_path)
547 {
548         bool remote = drec->get_remote();
549         bool opened = drec->play_tape(file_path);
550
551         if(opened && remote) {
552                 // if machine already sets remote on, start playing now
553                 push_play(drv);
554         }
555         cmt->close_tape();
556         cmt->play_tape(opened);
557 }
558
559 void VM::rec_tape(int drv, const _TCHAR* file_path)
560 {
561         bool remote = drec->get_remote();
562         bool opened = drec->rec_tape(file_path);
563
564         if(opened && remote) {
565                 // if machine already sets remote on, start recording now
566                 push_play(drv);
567         }
568         cmt->close_tape();
569         cmt->rec_tape(opened);
570 }
571
572 void VM::close_tape(int drv)
573 {
574         emu->lock_vm();
575         drec->close_tape();
576         emu->unlock_vm();
577         drec->set_remote(false);
578         cmt->close_tape();
579 }
580
581 bool VM::is_tape_inserted(int drv)
582 {
583         return drec->is_tape_inserted();
584 }
585
586 bool VM::is_tape_playing(int drv)
587 {
588         return drec->is_tape_playing();
589 }
590
591 bool VM::is_tape_recording(int drv)
592 {
593         return drec->is_tape_recording();
594 }
595
596 int VM::get_tape_position(int drv)
597 {
598         return drec->get_tape_position();
599 }
600
601 const _TCHAR* VM::get_tape_message(int drv)
602 {
603         return drec->get_message();
604 }
605
606 void VM::push_play(int drv)
607 {
608         drec->set_remote(false);
609         drec->set_ff_rew(0);
610         drec->set_remote(true);
611 }
612
613 void VM::push_stop(int drv)
614 {
615         drec->set_remote(false);
616 }
617
618 void VM::push_fast_forward(int drv)
619 {
620         drec->set_remote(false);
621         drec->set_ff_rew(1);
622         drec->set_remote(true);
623 }
624
625 void VM::push_fast_rewind(int drv)
626 {
627         drec->set_remote(false);
628         drec->set_ff_rew(-1);
629         drec->set_remote(true);
630 }
631
632 bool VM::is_frame_skippable()
633 {
634         return event->is_frame_skippable();
635 }
636
637 void VM::update_config()
638 {
639         for(DEVICE* device = first_device; device; device = device->next_device) {
640                 device->update_config();
641         }
642 }
643
644 double VM::get_current_usec()
645 {
646         if(event == NULL) return 0.0;
647         return event->get_current_usec();
648 }
649
650 uint64_t VM::get_current_clock_uint64()
651 {
652                 if(event == NULL) return (uint64_t)0;
653                 return event->get_current_clock_uint64();
654 }
655
656 #define STATE_VERSION   9
657
658 bool VM::process_state(FILEIO* state_fio, bool loading)
659 {
660         if(!(VM_TEMPLATE::process_state_core(state_fio, loading, STATE_VERSION))) {
661                 return false;
662         }
663         // Machine specified.
664         state_fio->StateValue(boot_mode);
665         state_fio->StateValue(monitor_type);
666         return true;
667 }