OSDN Git Service

b31bc78fad0d2152bfc0ab31ab2fdbed008ebd12
[csp-qt/common_source_project-fm7.git] / source / src / vm / ex80 / display.h
1 /*
2         TOSHIBA EX-80 Emulator 'eEX-80'
3
4         Author : Takeda.Toshiya
5         Date   : 2015.12.10-
6
7         [ display ]
8 */
9
10 #ifndef _DISPLAY_H_
11 #define _DISPLAY_H_
12
13 #include "../vm.h"
14 #include "../../emu.h"
15 #include "../device.h"
16
17 #define SIG_DISPLAY_DMA         0
18
19 class DISPLAY : public DEVICE
20 {
21 private:
22         DEVICE *d_cpu;
23         
24         uint8_t font[0x400];
25         uint8_t screen[8 * 29 * 2][8 * 12];
26         
27         uint8_t *ram;
28         int odd_even;
29         bool dma;
30         
31 public:
32         DISPLAY(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
33         {
34                 set_device_name(_T("Display"));
35         }
36         ~DISPLAY() {}
37         
38         // common functions
39         void initialize();
40         void write_signal(int id, uint32_t data, uint32_t mask);
41         void event_frame();
42         void event_vline(int v, int clock);
43         void event_callback(int event_id, int err);
44         void decl_state();
45         void save_state(FILEIO* state_fio);
46         bool load_state(FILEIO* state_fio);
47         
48         // unique functions
49         void set_context_cpu(DEVICE* device)
50         {
51                 d_cpu = device;
52         }
53         void set_ram_ptr(uint8_t* ptr)
54         {
55                 ram = ptr;
56         }
57         void draw_screen();
58 };
59
60 #endif
61