OSDN Git Service

[VM][General] Merge Upstream 2021-05-06. Some variants of PC-6001 are temporally...
[csp-qt/common_source_project-fm7.git] / source / src / vm / bx1 / printer.h
1 /*
2         CANON BX-1 Emulator 'eBX-1'
3
4         Author : Takeda.Toshiya
5         Date   : 2021.02.06-
6
7         [ printer ]
8 */
9
10 #ifndef _PRINTER_H_
11 #define _PRINTER_H_
12
13 #include "../vm_template.h"
14 #include "../../emu_template.h"
15 #include "../device.h"
16
17 class FILEIO;
18
19 namespace BX1 {
20         
21 class PRINTER : public DEVICE
22 {
23 private:
24         uint8_t *ram;
25         FILEIO *fio;
26         uint8_t column, htab;
27         uint8_t strobe, outdata;
28         
29         void output(uint8_t);
30         
31 public:
32         PRINTER(VM_TEMPLATE* parent_vm, EMU_TEMPLATE* parent_emu) : DEVICE(parent_vm, parent_emu)
33         {
34                 set_device_name(_T("Printer"));
35         }
36         ~PRINTER() {}
37         
38         // common functions
39         void initialize();
40         void release();
41         void reset();
42         void event_vline(int v, int clock);
43         void __FASTCALL write_io8(uint32_t addr, uint32_t data);
44         uint32_t __FASTCALL read_io8(uint32_t addr);
45         bool process_state(FILEIO* state_fio, bool loading);
46         
47         // unique functions
48         void set_context_ram(uint8_t* ptr)
49         {
50                 ram = ptr;
51         }
52         void __FASTCALL key_down(int code);
53         void __FASTCALL key_up(int code);
54 };
55 }
56
57 #endif
58