2 Skelton for retropc emulator
4 Author : Takeda.Toshiya
17 #define SIG_MC6847_AG 0
18 #define SIG_MC6847_AS 1
19 #define SIG_MC6847_INTEXT 2
20 #define SIG_MC6847_GM 3
21 #define SIG_MC6847_CSS 4
22 #define SIG_MC6847_INV 5
23 #define SIG_MC6847_ENABLE 6
24 #define SIG_MC6847_DISABLE 7
26 class MC6847_BASE : public DEVICE
32 outputs_t outputs_vsync;
33 outputs_t outputs_hsync;
35 uint8_t extfont[256 * 16];
38 uint8_t screen[192][256];
41 scrntype_t palette_pc[16];
48 bool vsync, hsync, disp;
52 void set_vsync(bool val);
53 void set_hsync(bool val);
54 void set_disp(bool val);
55 void draw_cg(int xofs, int yofs);
56 void draw_rg(int xofs, int yofs);
57 virtual void draw_alpha();
60 MC6847_BASE(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
63 ag = as = intext = css = inv = false;
65 initialize_output_signals(&outputs_vsync);
66 initialize_output_signals(&outputs_hsync);
67 set_device_name(_T("MC6847 VIDEO DISPLAY CONTOROLLER"));
72 virtual void initialize();
74 void write_signal(int id, uint32_t data, uint32_t mask);
75 void event_vline(int v, int clock);
76 void event_callback(int event_id, int err);
77 void update_timing(int new_clocks, double new_frames_per_sec, int new_lines_per_frame);
79 void save_state(FILEIO* state_fio);
80 bool load_state(FILEIO* state_fio);
82 void set_context_cpu(DEVICE* device)
86 void set_context_vsync(DEVICE* device, int id, uint32_t mask)
88 register_output_signal(&outputs_vsync, device, id, mask);
90 void set_context_hsync(DEVICE* device, int id, uint32_t mask)
92 register_output_signal(&outputs_hsync, device, id, mask);
94 void set_vram_ptr(uint8_t* ptr, int size)
96 vram_ptr = ptr; vram_size = size;
98 void load_font_image(const _TCHAR *file_path);
102 class MC6847 : public MC6847_BASE
107 MC6847(VM* parent_vm, EMU* parent_emu) : MC6847_BASE(parent_vm, parent_emu)