OSDN Git Service

[VM][General] Merge upstream 2016-03-01. (Pahse 1).
[csp-qt/common_source_project-fm7.git] / source / src / vm / multi8 / display.h
1 /*
2         MITSUBISHI Electric MULTI8 Emulator 'EmuLTI8'
3
4         Author : Takeda.Toshiya
5         Date   : 2007.02.08 -
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_I8255_B     0
18
19 class DISPLAY : public DEVICE
20 {
21 private:
22         uint8_t* regs;
23         uint8_t pal[8];
24         bool text_wide, text_color;
25         uint8_t graph_color, graph_page;
26         uint16_t cursor, cblink;
27         bool hsync, vsync, display, blink;
28         
29         uint8_t screen[200][640];
30         uint8_t font[0x800];
31         uint8_t* vram_b;
32         uint8_t* vram_r;
33         uint8_t* vram_g;
34         uint8_t* vram_t;
35         uint8_t* vram_a;
36         scrntype_t palette_pc[8];
37         
38         void draw_graph_color();
39         void draw_graph_mono();
40         void draw_text_wide();
41         void draw_text_normal();
42         
43 public:
44         DISPLAY(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {}
45         ~DISPLAY() {}
46         
47         // common functions
48         void initialize();
49         void write_io8(uint32_t addr, uint32_t data);
50         uint32_t read_io8(uint32_t addr);
51         void write_signal(int id, uint32_t data, uint32_t mask);
52         void event_frame();
53         void save_state(FILEIO* state_fio);
54         bool load_state(FILEIO* state_fio);
55         
56         // unique functions
57         void set_vram_ptr(uint8_t* ptr)
58         {
59                 vram_b = ptr + 0x0000;
60                 vram_r = ptr + 0x4000;
61                 vram_g = ptr + 0x8000;
62                 vram_t = ptr + 0xc000;
63                 vram_a = ptr + 0xc800;
64         }
65         void set_regs_ptr(uint8_t* ptr)
66         {
67                 regs = ptr;
68         }
69         void draw_screen();
70 };
71
72 #endif
73