2 NEC PC-9801 Emulator 'ePC-9801'
3 NEC PC-9801E/F/M Emulator 'ePC-9801E'
4 NEC PC-9801U Emulator 'ePC-9801U'
5 NEC PC-9801VF Emulator 'ePC-9801VF'
6 NEC PC-9801VM Emulator 'ePC-9801VM'
7 NEC PC-9801VX Emulator 'ePC-9801VX'
8 NEC PC-9801RA Emulator 'ePC-9801RA'
9 NEC PC-98XA Emulator 'ePC-98XA'
10 NEC PC-98XL Emulator 'ePC-98XL'
11 NEC PC-98RL Emulator 'ePC-98RL'
12 NEC PC-98DO Emulator 'ePC-98DO'
14 Author : Takeda.Toshiya
24 #include "../../emu.h"
25 #include "../device.h"
29 class DISPLAY : public DEVICE
33 UPD7220 *d_gdc_chr, *d_gdc_gfx;
35 uint8_t *ra_gfx, *cs_gfx;
37 uint8_t tvram[0x4000];
38 #if !defined(SUPPORT_HIRESO)
39 #if defined(SUPPORT_2ND_VRAM)
40 uint8_t vram[0x40000];
42 uint8_t vram[0x20000];
45 uint8_t vram[0x80000];
48 #if defined(SUPPORT_2ND_VRAM) && !defined(SUPPORT_HIRESO)
49 uint8_t vram_disp_sel;
50 uint8_t vram_draw_sel;
55 #if defined(SUPPORT_16_COLORS)
60 scrntype_t palette_chr[8];
61 scrntype_t palette_gfx8[8];
63 #if defined(SUPPORT_16_COLORS)
64 scrntype_t palette_gfx16[16];
65 uint8_t anapal[16][3], anapal_sel;
71 #if defined(SUPPORT_16_COLORS)
72 uint8_t modereg2[128];
74 #if defined(SUPPORT_GRCG)
75 uint8_t grcg_mode, grcg_tile_ptr, grcg_tile[4];
77 #if defined(SUPPORT_EGC)
97 egcquad_t egc_lastvram;
111 egcword_t egc_srcmask;
114 uint8_t egc_sft8bitl;
115 uint8_t egc_sft8bitr;
116 uint8_t egc_buf[528]; /* 4096/8 + 4*4 */
117 egcquad_t egc_vram_src;
118 egcquad_t egc_vram_data;
121 #if !defined(SUPPORT_HIRESO)
124 #define FONT_HEIGHT 16
127 #define FONT_WIDTH 14
128 #define FONT_HEIGHT 24
130 #define KANJI_2ND_OFS (FONT_SIZE * 0x80)
131 #define KANJI_FONT_SIZE (FONT_SIZE * 2)
132 #define ANK_FONT_OFS (KANJI_FONT_SIZE * 0x4000)
134 uint8_t font[ANK_FONT_OFS + FONT_SIZE * 0x400];
139 uint8_t screen_chr[SCREEN_HEIGHT][SCREEN_WIDTH + 1];
140 uint8_t screen_gfx[SCREEN_HEIGHT][SCREEN_WIDTH];
142 #if !defined(SUPPORT_HIRESO)
143 void kanji_copy(uint8_t *dst, uint8_t *src, int from, int to);
145 void ank_copy(int code, uint8_t *pattern);
146 void kanji_copy(int first, int second, uint8_t *pattern);
148 #if defined(SUPPORT_GRCG)
149 void grcg_writeb(uint32_t addr1, uint32_t data);
150 void grcg_writew(uint32_t addr1, uint32_t data);
151 uint32_t grcg_readb(uint32_t addr1);
152 uint32_t grcg_readw(uint32_t addr1);
154 #if defined(SUPPORT_EGC)
156 void egc_sftb_upn_sub(uint32_t ext);
157 void egc_sftb_dnn_sub(uint32_t ext);
158 void egc_sftb_upr_sub(uint32_t ext);
159 void egc_sftb_dnr_sub(uint32_t ext);
160 void egc_sftb_upl_sub(uint32_t ext);
161 void egc_sftb_dnl_sub(uint32_t ext);
162 void egc_sftb_upn0(uint32_t ext);
163 void egc_sftw_upn0();
164 void egc_sftb_dnn0(uint32_t ext);
165 void egc_sftw_dnn0();
166 void egc_sftb_upr0(uint32_t ext);
167 void egc_sftw_upr0();
168 void egc_sftb_dnr0(uint32_t ext);
169 void egc_sftw_dnr0();
170 void egc_sftb_upl0(uint32_t ext);
171 void egc_sftw_upl0();
172 void egc_sftb_dnl0(uint32_t ext);
173 void egc_sftw_dnl0();
174 void egc_sftb(int func, uint32_t ext);
175 void egc_sftw(int func);
176 void egc_shiftinput_byte(uint32_t ext);
177 void egc_shiftinput_incw();
178 void egc_shiftinput_decw();
179 uint64_t egc_ope_00(uint8_t ope, uint32_t addr);
180 uint64_t egc_ope_0f(uint8_t ope, uint32_t addr);
181 uint64_t egc_ope_c0(uint8_t ope, uint32_t addr);
182 uint64_t egc_ope_f0(uint8_t ope, uint32_t addr);
183 uint64_t egc_ope_fc(uint8_t ope, uint32_t addr);
184 uint64_t egc_ope_ff(uint8_t ope, uint32_t addr);
185 uint64_t egc_ope_nd(uint8_t ope, uint32_t addr);
186 uint64_t egc_ope_np(uint8_t ope, uint32_t addr);
187 uint64_t egc_ope_xx(uint8_t ope, uint32_t addr);
188 uint64_t egc_opefn(uint32_t func, uint8_t ope, uint32_t addr);
189 uint64_t egc_opeb(uint32_t addr, uint8_t value);
190 uint64_t egc_opew(uint32_t addr, uint16_t value);
191 uint32_t egc_readb(uint32_t addr1);
192 uint32_t egc_readw(uint32_t addr1);
193 void egc_writeb(uint32_t addr1, uint8_t value);
194 void egc_writew(uint32_t addr1, uint16_t value);
196 void draw_chr_screen();
197 void draw_gfx_screen();
200 DISPLAY(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
202 memset(tvram, 0, sizeof(tvram));
203 set_device_name(_T("Display"));
212 void write_io8(uint32_t addr, uint32_t data);
213 uint32_t read_io8(uint32_t addr);
214 void write_memory_mapped_io8(uint32_t addr, uint32_t data);
215 void write_memory_mapped_io16(uint32_t addr, uint32_t data);
216 uint32_t read_memory_mapped_io8(uint32_t addr);
217 uint32_t read_memory_mapped_io16(uint32_t addr);
218 void write_dma_io8(uint32_t addr, uint32_t data);
219 void write_dma_io16(uint32_t addr, uint32_t data);
220 uint32_t read_dma_io8(uint32_t addr);
221 uint32_t read_dma_io16(uint32_t addr);
222 bool process_state(FILEIO* state_fio, bool loading);
225 void set_context_pic(DEVICE *device)
229 void set_context_gdc_chr(UPD7220 *device, uint8_t *ra)
234 void set_context_gdc_gfx(UPD7220 *device, uint8_t *ra, uint8_t *cs)
237 ra_gfx = ra; cs_gfx = cs;