OSDN Git Service

[VM][I286] Save cpustate without StateBuffer().
[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_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
45         {
46                 set_device_name(_T("Display"));
47         }
48         ~DISPLAY() {}
49         
50         // common functions
51         void initialize();
52         void write_io8(uint32_t addr, uint32_t data);
53         uint32_t read_io8(uint32_t addr);
54         void write_signal(int id, uint32_t data, uint32_t mask);
55         void event_frame();
56         bool process_state(FILEIO* state_fio, bool loading);
57         
58         // unique functions
59         void set_vram_ptr(uint8_t* ptr)
60         {
61                 vram_b = ptr + 0x0000;
62                 vram_r = ptr + 0x4000;
63                 vram_g = ptr + 0x8000;
64                 vram_t = ptr + 0xc000;
65                 vram_a = ptr + 0xc800;
66         }
67         void set_regs_ptr(uint8_t* ptr)
68         {
69                 regs = ptr;
70         }
71         void draw_screen();
72 };
73
74 #endif
75