OSDN Git Service

[VM][COMMON_VM] Include IO:: class to common_vm.
[csp-qt/common_source_project-fm7.git] / source / src / vm / hd63484.h
1 /*
2         Skelton for retropc emulator
3
4         Origin : MAME HD63484
5         Author : Takeda.Toshiya
6         Date   : 2009.02.09 -
7
8         [ HD63484 ]
9 */
10
11 #ifndef _HD63484_H_
12 #define _HD63484_H_
13
14 //#include "vm.h"
15 //#include "../emu.h"
16 #include "device.h"
17
18 class VM;
19 class EMU;
20 class HD63484 : public DEVICE
21 {
22 private:
23         // vram
24         uint16_t* vram;
25         uint32_t vram_size;
26         
27         // fifo
28         int fifo_ptr;
29         uint16_t fifo[256], readfifo;
30         
31         // params
32         int ch, vpos;
33         uint16_t regs[128], pattern[16];
34         int org, org_dpd, rwp;
35         uint16_t cl0, cl1, ccmp, edg, mask;
36         uint16_t ppy, pzcy, ppx, pzcx, psy, psx, pey, pzy, pex, pzx;
37         uint16_t xmin, ymin, xmax, ymax, rwp_dn;
38         int16_t cpx, cpy;
39         
40         void process_cmd();
41         void __FASTCALL doclr16(int opcode, uint16_t fill, int *dst, int _ax, int _ay);
42         void __FASTCALL docpy16(int opcode, int src, int *dst, int _ax, int _ay);
43         int __FASTCALL org_first_pixel(int _org_dpd);
44         void __FASTCALL dot(int x, int y, int opm, uint16_t color);
45         int __FASTCALL get_pixel(int x, int y);
46         int __FASTCALL get_pixel_ptn(int x, int y);
47         void agcpy(int opcode, int src_x, int src_y, int dst_x, int dst_y, int16_t _ax, int16_t _ay);
48         void ptn(int opcode, int src_x, int src_y, int16_t _ax, int16_t _ay);
49         void line(int16_t sx, int16_t sy, int16_t ex, int16_t ey, int16_t col);
50         void paint(int sx, int sy, int col);
51         
52 public:
53         HD63484(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {
54                 set_device_name(_T("HD63484 ACRTC"));
55         }
56         ~HD63484() {}
57         
58         // common functions
59         void initialize();
60         void reset();
61         void __FASTCALL write_io8(uint32_t addr, uint32_t data);
62         uint32_t __FASTCALL read_io8(uint32_t addr);
63         void __FASTCALL write_io16(uint32_t addr, uint32_t data);
64         uint32_t __FASTCALL read_io16(uint32_t addr);
65         void event_vline(int v, int clock);
66         
67         // unique functions
68         void set_vram_ptr(uint16_t* ptr, uint32_t size)
69         {
70                 vram = ptr; vram_size = size;
71         }
72 };
73
74 #endif