OSDN Git Service

[VM][WIP] Use namespace to devices per VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / mz2500 / printer.cpp
1 /*
2         SHARP MZ-80B Emulator 'EmuZ-80B'
3         SHARP MZ-2200 Emulator 'EmuZ-2200'
4         SHARP MZ-2500 Emulator 'EmuZ-2500'
5
6         Author : Takeda.Toshiya
7         Date   : 2015.12.28-
8
9         [ printer ]
10 */
11
12 #include "printer.h"
13
14 namespace MZ2500 {
15
16 void PRINTER::write_io8(uint32_t addr, uint32_t data)
17 {
18         switch(addr & 0xff) {
19         case 0xfe:
20                 d_prn->write_signal(SIG_PRINTER_STROBE, data, 0x80);
21                 d_prn->write_signal(SIG_PRINTER_RESET, data, 0x40);
22                 break;
23         case 0xff:
24                 d_prn->write_signal(SIG_PRINTER_DATA, data, 0xff);
25                 break;
26         }
27 }
28
29 uint32_t PRINTER::read_io8(uint32_t addr)
30 {
31         switch(addr & 0xff) {
32         case 0xfe:
33                 return 0xf2 | (d_prn->read_signal(SIG_PRINTER_BUSY) ? 1 : 0);
34         }
35         return 0xff;
36 }
37
38 }