OSDN Git Service

[INITIAL] Import 20141226 version of http://homepage3.nifty.com/takeda-toshiya/common...
[csp-qt/common_source_project-fm7.git] / source / src / vm / multi8 / display.h
1 /*\r
2         MITSUBISHI Electric MULTI8 Emulator 'EmuLTI8'\r
3 \r
4         Author : Takeda.Toshiya\r
5         Date   : 2007.02.08 -\r
6 \r
7         [ display ]\r
8 */\r
9 \r
10 #ifndef _DISPLAY_H_\r
11 #define _DISPLAY_H_\r
12 \r
13 #include "../vm.h"\r
14 #include "../../emu.h"\r
15 #include "../device.h"\r
16 \r
17 #define SIG_DISPLAY_I8255_B     0\r
18 \r
19 class DISPLAY : public DEVICE\r
20 {\r
21 private:\r
22         uint8* regs;\r
23         uint8 pal[8];\r
24         bool text_wide, text_color;\r
25         uint8 graph_color, graph_page;\r
26         uint16 cursor, cblink;\r
27         bool hsync, vsync, display, blink;\r
28         \r
29         uint8 screen[200][640];\r
30         uint8 font[0x800];\r
31         uint8* vram_b;\r
32         uint8* vram_r;\r
33         uint8* vram_g;\r
34         uint8* vram_t;\r
35         uint8* vram_a;\r
36         scrntype palette_pc[8];\r
37         bool scanline;\r
38         \r
39         void draw_graph_color();\r
40         void draw_graph_mono();\r
41         void draw_text_wide();\r
42         void draw_text_normal();\r
43         \r
44 public:\r
45         DISPLAY(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {}\r
46         ~DISPLAY() {}\r
47         \r
48         // common functions\r
49         void initialize();\r
50         void update_config();\r
51         \r
52         void write_io8(uint32 addr, uint32 data);\r
53         uint32 read_io8(uint32 addr);\r
54         void write_signal(int id, uint32 data, uint32 mask);\r
55         void event_frame();\r
56         \r
57         // unique function\r
58         void set_vram_ptr(uint8* ptr)\r
59         {\r
60                 vram_b = ptr + 0x0000;\r
61                 vram_r = ptr + 0x4000;\r
62                 vram_g = ptr + 0x8000;\r
63                 vram_t = ptr + 0xc000;\r
64                 vram_a = ptr + 0xc800;\r
65         }\r
66         void set_regs_ptr(uint8* ptr)\r
67         {\r
68                 regs = ptr;\r
69         }\r
70         void draw_screen();\r
71 };\r
72 \r
73 #endif\r
74 \r