OSDN Git Service

[VM][WIP] Use namespace to devices per VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / j3100 / display.h
1 /*
2         TOSHIBA J-3100GT Emulator 'eJ-3100GT'
3         TOSHIBA J-3100SL Emulator 'eJ-3100SL'
4
5         Author : Takeda.Toshiya
6         Date   : 2011.08.16-
7
8         [ display ]
9 */
10
11 #ifndef _DISPLAY_H_
12 #define _DISPLAY_H_
13
14 #include "../vm.h"
15 #include "../../emu.h"
16 #include "../device.h"
17
18 #define SIG_DISPLAY_ENABLE      0
19 #define SIG_DISPLAY_VBLANK      1
20 #define SIG_DISPLAY_PIO         2
21
22 namespace J3100 {
23         class MEMORY;
24 }
25 namespace J3100 {
26         
27 class DISPLAY : public DEVICE
28 {
29 private:
30         uint8_t mode;
31         uint8_t status;
32         uint8_t* regs;
33         uint8_t* vram;
34         
35         uint8_t screen[400][640];
36         uint8_t font[0x800];
37         scrntype_t palette_pc[2];
38         int cblink;
39         
40         void draw_alpha();
41         void draw_graph_320x200();
42         void draw_graph_640x200();
43         void draw_graph_640x400();
44         
45 public:
46         DISPLAY(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
47         {
48                 set_device_name(_T("Display"));
49         }
50         ~DISPLAY() {}
51         
52         // common functions
53         void initialize();
54         void reset();
55         void write_io8(uint32_t addr, uint32_t data);
56         uint32_t read_io8(uint32_t addr);
57         void write_signal(int id, uint32_t data, uint32_t mask);
58         void event_frame();
59         
60         // unique functions
61         void set_regs_ptr(uint8_t* ptr)
62         {
63                 regs = ptr;
64         }
65         void set_vram_ptr(uint8_t* ptr)
66         {
67                 vram = ptr;
68         }
69         void draw_screen();
70 };
71
72 }
73 #endif
74