OSDN Git Service

5614a34beb276f1704b7229f7867f37e3c0665c1
[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 e210, e211;
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_frame();
43         void event_vline(int v, int clock);
44         void __FASTCALL write_io8(uint32_t addr, uint32_t data);
45         uint32_t __FASTCALL read_io8(uint32_t addr);
46         bool process_state(FILEIO* state_fio, bool loading);
47         
48         // unique functions
49         void set_context_ram(uint8_t* ptr)
50         {
51                 ram = ptr;
52         }
53         void __FASTCALL key_down(int code);
54         void __FASTCALL key_up(int code);
55 };
56 }
57
58 #endif
59