Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
716 | lvd | 1 | #pragma once |
2 | #include "sysdefs.h" |
||
3 | #include "z80/defs.h" |
||
4 | #include "sndrender/sndrender.h" |
||
5 | #include "savevid.h" |
||
6 | |||
7 | |||
8 | |||
9 | #define EMUL_DEBUG |
||
10 | #define TRASH_PAGE |
||
11 | |||
12 | #define PAGE 0x4000 |
||
13 | #define MAX_RAM_PAGES 256 // 4Mb RAM |
||
14 | #define MAX_CACHE_PAGES 2 // 32K cache |
||
15 | #define MAX_MISC_PAGES 1 // trash page |
||
16 | #define MAX_ROM_PAGES 64 // 1Mb |
||
17 | |||
18 | #define GS4MB //0.37.0 |
||
19 | #ifdef MOD_GSZ80 |
||
20 | #define MAX_GSROM_PAGES 32U // 512Kb |
||
21 | #ifdef GS4MB |
||
22 | #define MAX_GSRAM_PAGES 256U // for gs4mb |
||
23 | #else |
||
24 | #define MAX_GSRAM_PAGES 30U // for gs512 (last 32k unusable) |
||
25 | #endif |
||
26 | #else |
||
27 | #define MAX_GSROM_PAGES 0 |
||
28 | #define MAX_GSRAM_PAGES 0 |
||
29 | #endif |
||
30 | |||
31 | #define MAX_PAGES (MAX_RAM_PAGES + MAX_CACHE_PAGES + MAX_MISC_PAGES + MAX_ROM_PAGES + MAX_GSROM_PAGES + MAX_GSRAM_PAGES) |
||
32 | |||
33 | #define RAM_BASE_M memory |
||
34 | #define CACHE_M (RAM_BASE_M + MAX_RAM_PAGES*PAGE) |
||
35 | #define MISC_BASE_M (CACHE_M + MAX_CACHE_PAGES*PAGE) |
||
36 | #define ROM_BASE_M (MISC_BASE_M + MAX_MISC_PAGES*PAGE) |
||
37 | |||
38 | #ifdef MOD_GSZ80 |
||
39 | #define ROM_GS_M (ROM_BASE_M + MAX_ROM_PAGES*PAGE) |
||
40 | #define GSRAM_M (ROM_GS_M + MAX_GSROM_PAGES*PAGE) |
||
41 | #endif |
||
42 | |||
43 | #define TRASH_M (MISC_BASE_M+0*PAGE) |
||
44 | |||
45 | |||
46 | enum IDE_SCHEME |
||
47 | { |
||
48 | IDE_NONE = 0, |
||
49 | IDE_ATM, |
||
50 | IDE_NEMO, IDE_NEMO_A8, IDE_NEMO_DIVIDE, |
||
51 | IDE_SMUC, |
||
52 | IDE_PROFI, |
||
53 | IDE_DIVIDE |
||
54 | }; |
||
55 | |||
56 | enum MOUSE_WHEEL_MODE { MOUSE_WHEEL_NONE, MOUSE_WHEEL_KEYBOARD, MOUSE_WHEEL_KEMPSTON }; //0.36.6 from 0.35b2 |
||
57 | |||
58 | enum MEM_MODEL |
||
59 | { |
||
60 | MM_PENTAGON = 0, |
||
61 | MM_SCORP, MM_PROFSCORP, |
||
62 | MM_PROFI, |
||
63 | MM_ATM450, MM_ATM710, MM_ATM3, |
||
64 | MM_KAY, |
||
65 | MM_PLUS3, |
||
66 | MM_QUORUM, |
||
67 | N_MM_MODELS |
||
68 | }; |
||
69 | |||
70 | enum ROM_MODE { RM_NOCHANGE=0, RM_SOS, RM_DOS, RM_SYS, RM_128, RM_CACHE }; |
||
71 | |||
72 | const int RAM_128 = 128, RAM_256 = 256, RAM_512 = 512, RAM_1024 = 1024, RAM_4096 = 4096; |
||
73 | |||
74 | struct TMemModel |
||
75 | { |
||
76 | const char *fullname, *shortname; |
||
77 | MEM_MODEL Model; |
||
78 | unsigned defaultRAM; |
||
79 | unsigned availRAMs; |
||
80 | }; |
||
81 | |||
82 | typedef void (__fastcall *VOID_FUNC)(void); |
||
83 | typedef void (__fastcall *RENDER_FUNC)(unsigned char*,unsigned); |
||
84 | |||
85 | struct RENDER |
||
86 | { |
||
87 | const char *name; |
||
88 | RENDER_FUNC func; |
||
89 | const char *nick; |
||
90 | unsigned flags; |
||
91 | }; |
||
92 | |||
93 | struct IDE_CONFIG |
||
94 | { |
||
95 | char image[512]; |
||
96 | unsigned c,h,s,lba; |
||
97 | unsigned char readonly; |
||
98 | u8 cd; |
||
99 | }; |
||
100 | |||
101 | enum RSM_MODE { RSM_SIMPLE, RSM_FIR0, RSM_FIR1, RSM_FIR2 }; |
||
102 | |||
103 | enum SYNC_MODE { SM_SOUND, SM_TSC, SM_VIDEO }; |
||
104 | |||
105 | struct zxkeymap ; |
||
106 | |||
107 | struct CONFIG |
||
108 | { |
||
109 | unsigned paper; // start of paper |
||
110 | unsigned t_line; // t-states per line |
||
111 | unsigned frame; // t-states per frame |
||
112 | unsigned intfq; // usually 50Hz |
||
113 | unsigned intlen; // length of INT signal (for Z80) |
||
114 | unsigned nopaper;// hide paper |
||
115 | |||
116 | unsigned render, driver, fontsize; |
||
117 | |||
118 | unsigned soundbuffer, refresh; |
||
119 | |||
120 | unsigned char flashcolor, noflic, fast_sl, alt_nf; |
||
121 | unsigned char frameskip, frameskipmax; |
||
122 | unsigned char flip, fullscr; |
||
123 | |||
124 | unsigned char lockmouse; |
||
125 | unsigned char detect_video; |
||
126 | unsigned char tape_traps; |
||
127 | unsigned char tape_autostart; |
||
128 | int scrshot; |
||
129 | char scrshot_dir[FILENAME_MAX]; |
||
130 | |||
131 | unsigned char ch_size; |
||
132 | unsigned char EFF7_mask; |
||
133 | unsigned char reset_rom; |
||
134 | unsigned char use_romset; |
||
135 | |||
136 | unsigned char updateb, bordersize; |
||
137 | unsigned char even_M1, border_4T; |
||
138 | |||
139 | unsigned char floatbus, floatdos; |
||
140 | bool portff; |
||
141 | |||
142 | // border small |
||
143 | unsigned mcx_small; // Горизонтальный размер видимого экрана (pix) |
||
144 | unsigned mcy_small; // Вертикальный размер видимого экрана (lines) |
||
145 | unsigned b_top_small; // Число видимых строк верхнего бордюра |
||
146 | unsigned b_left_small; // Число видимых пикселей левого бордюра |
||
147 | |||
148 | // border full |
||
149 | unsigned mcx_full; // Горизонтальный размер видимого экрана pix |
||
150 | unsigned mcy_full; // Вертикальный размер видимого экрана lines |
||
151 | unsigned b_top_full; // Число видимых строк верхнего бордюра |
||
152 | unsigned b_left_full; // Число видимых пикселей левого бордюра |
||
153 | |||
154 | |||
155 | int modem_port; //, modem_scheme; |
||
156 | unsigned char fdd_noise; |
||
157 | |||
158 | unsigned char trdos_present, trdos_interleave; |
||
159 | unsigned char trdos_traps, wd93_nodelay; |
||
160 | unsigned char trdos_wp[4]; |
||
161 | |||
162 | unsigned char cache; |
||
163 | unsigned char cmos; |
||
164 | unsigned char smuc; |
||
165 | unsigned char ula_preset; |
||
166 | |||
167 | unsigned char gs_type; |
||
168 | unsigned char pixelscroll; |
||
169 | unsigned char sleepidle; |
||
170 | unsigned char rsrvd1_; |
||
171 | unsigned char ConfirmExit; |
||
172 | |||
173 | unsigned char highpriority; |
||
174 | SYNC_MODE SyncMode; |
||
175 | bool HighResolutionTimer; |
||
176 | unsigned char videoscale; |
||
177 | |||
178 | MEM_MODEL mem_model; |
||
179 | unsigned ramsize, romsize; |
||
180 | bool Sna128Lock; |
||
181 | |||
182 | IDE_SCHEME ide_scheme; |
||
183 | IDE_CONFIG ide[2]; |
||
184 | unsigned char ide_skip_real; |
||
185 | unsigned char cd_aspi; |
||
186 | |||
187 | unsigned char soundfilter; //Alone Coder (IDC_SOUNDFILTER) |
||
188 | unsigned char RejectDC; |
||
189 | struct |
||
190 | { |
||
191 | unsigned fq, ayfq, saa1099fq; |
||
192 | int covoxFB, covoxDD, sd, saa1099; |
||
193 | int beeper_vol, micout_vol, micin_vol, ay_vol, aydig_vol, |
||
194 | covoxFB_vol, covoxDD_vol, sd_vol, gs_vol, bass_vol; |
||
195 | VOID_FUNC do_sound; |
||
196 | unsigned char enabled, gsreset, dsprimary; |
||
197 | unsigned char ay_chip, ay_scheme, ay_stereo, ay_vols, ay_samples; |
||
198 | unsigned ay_stereo_tab[6], ay_voltab[32]; |
||
199 | } sound; |
||
200 | |||
201 | struct { |
||
202 | unsigned firenum; |
||
203 | unsigned char altlock, fire, firedelay; |
||
204 | unsigned char paste_hold, paste_release, paste_newline; |
||
205 | unsigned char mouse, mouseswap, kjoy, keymatrix, joymouse; |
||
206 | unsigned char keybpcmode; |
||
207 | signed char mousescale; |
||
208 | unsigned char mousewheel; // enum MOUSE_WHEEL_MODE //0.36.6 from 0.35b2 |
||
209 | zxkeymap *active_zxk; |
||
210 | unsigned JoyId; |
||
211 | } input; |
||
212 | |||
213 | struct { |
||
214 | unsigned char enabled; |
||
215 | unsigned char flash_ay_kbd; |
||
216 | unsigned char perf_t; |
||
217 | unsigned char reserved1; |
||
218 | unsigned bandBpp; |
||
219 | #define NUM_LEDS 7 |
||
220 | unsigned ay; |
||
221 | unsigned perf; |
||
222 | unsigned load; |
||
223 | unsigned input; |
||
224 | unsigned time; |
||
225 | unsigned osw; |
||
226 | unsigned memband; |
||
227 | } led; |
||
228 | |||
229 | struct { |
||
230 | unsigned char mem_swap; |
||
231 | unsigned char xt_kbd; |
||
232 | unsigned char reserved1; |
||
233 | } atm; |
||
234 | |||
235 | unsigned char use_comp_pal; |
||
236 | unsigned pal, num_pals; // selected palette and total number of pals |
||
237 | unsigned minres; // min. screen x-resolution |
||
238 | unsigned scanbright; // scanlines intensity |
||
239 | |||
240 | struct { |
||
241 | unsigned char mix_frames; |
||
242 | unsigned char mode; // RSM_MODE |
||
243 | } rsm; |
||
244 | |||
245 | char sos_rom_path[FILENAME_MAX]; |
||
246 | char dos_rom_path[FILENAME_MAX]; |
||
247 | char zx128_rom_path[FILENAME_MAX]; |
||
248 | char sys_rom_path[FILENAME_MAX]; |
||
249 | char atm1_rom_path[FILENAME_MAX]; |
||
250 | char atm2_rom_path[FILENAME_MAX]; |
||
251 | char atm3_rom_path[FILENAME_MAX]; |
||
252 | char scorp_rom_path[FILENAME_MAX]; |
||
253 | char prof_rom_path[FILENAME_MAX]; |
||
254 | char profi_rom_path[FILENAME_MAX]; |
||
255 | //[vv] char kay_rom_path[FILENAME_MAX]; |
||
256 | char plus3_rom_path[FILENAME_MAX]; |
||
257 | char quorum_rom_path[FILENAME_MAX]; |
||
258 | |||
259 | #ifdef MOD_GSZ80 |
||
260 | unsigned gs_ramsize; |
||
261 | char gs_rom_path[FILENAME_MAX]; |
||
262 | #endif |
||
263 | |||
264 | #ifdef MOD_MONITOR |
||
265 | char sos_labels_path[FILENAME_MAX]; |
||
266 | #endif |
||
267 | |||
268 | char ngs_sd_card_path[FILENAME_MAX]; |
||
269 | |||
270 | unsigned char zc; |
||
271 | char zc_sd_card_path[FILENAME_MAX]; |
||
272 | |||
273 | char atariset[64]; // preset for atari mode |
||
274 | char zxkeymap[64]; // name of ZX keys map |
||
275 | char keyset[64]; // short name of keyboard layout |
||
276 | char appendboot[FILENAME_MAX]; |
||
277 | char workdir[FILENAME_MAX]; |
||
278 | u8 profi_monochrome; |
||
279 | |||
280 | struct |
||
281 | { |
||
282 | char exec[VS_MAX_FFPATH]; // ffmpeg path/name |
||
283 | char parm[VS_MAX_FFPARM]; // enc. parameters for ffmpeg |
||
284 | char vout[VS_MAX_FFVOUT]; // output video file name |
||
285 | char newcons; // open new console for ffmpeg |
||
286 | } ffmpeg; |
||
287 | }; |
||
288 | |||
289 | struct TEMP |
||
290 | { |
||
291 | unsigned char win9x;// if we have old OS //Dexus |
||
292 | unsigned rflags; // render_func flags |
||
293 | unsigned border_add, border_and; // for scorpion 4T border update |
||
294 | unsigned char *base, *base_2; // pointers to Spectrum screen memory |
||
295 | unsigned char rom_mask, ram_mask; |
||
296 | unsigned char evenM1_C0; // C0 for scorpion, 00 for pentagon |
||
297 | unsigned char hi15; // 0 - 16bit color, 1 - 15bit color, 2 - YUY2 colorspace |
||
298 | unsigned snd_frame_samples; // samples / frame |
||
299 | unsigned snd_frame_ticks; // sound ticks / frame |
||
300 | unsigned cpu_t_at_frame_start; |
||
301 | |||
302 | unsigned gx, gy, gdx, gdy; // updating rectangle (used by GDI renderer) |
||
303 | RECT client; // updating rectangle (used by DD_blt renderer) |
||
304 | bool Minimized; // window is minimized |
||
305 | HDC gdidc; |
||
306 | unsigned ox, oy, obpp, ofq; // destination video format |
||
307 | unsigned scx, scy; // multicolor area (320x240 or 384x300), used in MCR renderer |
||
308 | unsigned odx, ody; // offset to border in surface, used only in flip() |
||
309 | unsigned rsx, rsy; // screen resolution |
||
310 | unsigned b_top, b_left, b_right, b_bottom; // border frame used to setup MCR |
||
311 | unsigned scale; // window scale (x1, x2, x3, x4) |
||
312 | unsigned mon_scale; // window scale in monitor mode(debugger) |
||
313 | |||
314 | unsigned ataricolors[0x100]; |
||
315 | unsigned shift_mask; // for 16/32 bit modes masks low bits of color components |
||
316 | |||
317 | struct { // led coords |
||
318 | unsigned char *ay; |
||
319 | unsigned char *perf; |
||
320 | unsigned char *load; |
||
321 | unsigned char *input; |
||
322 | unsigned char *time; |
||
323 | unsigned char *osw; |
||
324 | unsigned char *memband; |
||
325 | unsigned char *fdd; |
||
326 | |||
327 | __int64 tape_started; |
||
328 | } led; |
||
329 | unsigned char profrom_mask; |
||
330 | unsigned char comp_pal_changed; |
||
331 | |||
332 | // CPU features |
||
333 | unsigned char mmx, sse, sse2; |
||
334 | u64 cpufq; // x86 t-states per second |
||
335 | unsigned ticks_frame; // x86 t-states in frame |
||
336 | |||
337 | unsigned char vidblock, sndblock, inputblock, frameskip; |
||
338 | bool PngSupport; |
||
339 | bool ZlibSupport; |
||
340 | unsigned gsdmaaddr; |
||
341 | u8 gsdmaon; |
||
342 | u8 gs_ram_mask; |
||
343 | |||
344 | u8 offset_vscroll; |
||
345 | u8 offset_vscroll_prev; |
||
346 | u8 offset_hscroll; |
||
347 | u8 offset_hscroll_prev; |
||
348 | |||
349 | char RomDir[FILENAME_MAX]; |
||
350 | char SnapDir[FILENAME_MAX]; |
||
351 | char HddDir[FILENAME_MAX]; |
||
352 | char LastSnapName[FILENAME_MAX]; // Имя последнего загруженного файла без расширения |
||
353 | }; |
||
354 | |||
355 | extern TEMP temp; |
||
356 | extern unsigned sb_start_frame; |
||
357 | |||
358 | enum AY_SCHEME |
||
359 | { |
||
360 | AY_SCHEME_NONE = 0, |
||
361 | AY_SCHEME_SINGLE, |
||
362 | AY_SCHEME_PSEUDO, |
||
363 | AY_SCHEME_QUADRO, |
||
364 | AY_SCHEME_POS, |
||
365 | AY_SCHEME_CHRV, |
||
366 | AY_SCHEME_MAX |
||
367 | }; |
||
368 | |||
369 | #include "wd93.h" |
||
370 | #include "hddio.h" |
||
371 | #include "hdd.h" |
||
372 | #include "input.h" |
||
373 | #include "modem.h" |
||
374 | |||
375 | #if defined(MOD_GSZ80) || defined(MOD_GSBASS) |
||
376 | #include "bass.h" |
||
377 | #include "snd_bass.h" |
||
378 | #endif |
||
379 | |||
380 | #ifdef MOD_GSBASS |
||
381 | #include "gshlbass.h" |
||
382 | #include "gshle.h" |
||
383 | #endif |
||
384 | |||
385 | #define EFF7_4BPP 0x01 |
||
386 | #define EFF7_512 0x02 |
||
387 | #define EFF7_LOCKMEM 0x04 |
||
388 | #define EFF7_ROCACHE 0x08 |
||
389 | #define EFF7_GIGASCREEN 0x10 |
||
390 | #define EFF7_HWMC 0x20 |
||
391 | #define EFF7_384 0x40 |
||
392 | #define EFF7_CMOS 0x80 |
||
393 | |||
394 | // Биты порта 00 для кворума |
||
395 | static const u8 Q_F_RAM = 0x01; |
||
396 | static const u8 Q_RAM_8 = 0x08; |
||
397 | static const u8 Q_B_ROM = 0x20; |
||
398 | static const u8 Q_BLK_WR = 0x40; |
||
399 | static const u8 Q_TR_DOS = 0x80; |
||
400 | |||
401 | enum SNAP |
||
402 | { |
||
403 | snNOFILE, snUNKNOWN, snTOOLARGE, |
||
404 | snSP, snZ80, snSNA_48, snSNA_128, |
||
405 | snTAP, snTZX, snCSW, |
||
406 | snHOB, snSCL, snTRD, snFDI, snTD0, snUDI, snISD, snPRO |
||
407 | }; |
||
408 | |||
409 | struct NVRAM |
||
410 | { |
||
411 | enum EEPROM_STATE { IDLE = 0, RCV_CMD, RCV_ADDR, RCV_DATA, SEND_DATA, RD_ACK }; |
||
412 | unsigned address; |
||
413 | unsigned char datain, dataout, bitsin, bitsout; |
||
414 | unsigned char state; |
||
415 | unsigned char prev; |
||
416 | unsigned char out; |
||
417 | unsigned char out_z; |
||
418 | |||
419 | void write(unsigned char val); |
||
420 | }; |
||
421 | |||
422 | struct COMPUTER |
||
423 | { |
||
424 | unsigned char p7FFD, pFE, pEFF7, pXXXX; |
||
425 | unsigned char pDFFD, pFDFD, p1FFD, pFF77; |
||
426 | u8 p7EFD; // gmx |
||
427 | u8 p00, p80FD; // quorum |
||
428 | __int64 t_states; // inc with conf.frame by each frame |
||
429 | unsigned frame_counter; // inc each frame |
||
430 | unsigned char aFE, aFB; // ATM 4.50 system ports |
||
431 | unsigned pFFF7[8]; // ATM 7.10 / ATM3(4Mb) memory map |
||
432 | // |7ffd|rom|b7b6|b5..b0| b7b6 = 0 for atm2 |
||
433 | |||
434 | u8 wd_shadow[5]; // 2F, 4F, 6F, 8F, AF |
||
435 | |||
436 | unsigned aFF77; |
||
437 | unsigned active_ay; |
||
438 | u8 pBF; // ATM3 |
||
439 | u8 pBE; // ATM3 |
||
440 | |||
441 | unsigned char flags; |
||
442 | |||
443 | // Цвет бордюра (то, что выводится в порт бордюра, значение 0..7, или 0..F (для ATM, PROFI)) |
||
444 | // значение всегда должно быть < 0x10, т.к. для размножения цвета используется умножение на константу 0x11001100 |
||
445 | unsigned char border_attr; |
||
446 | unsigned char cmos_addr; |
||
447 | unsigned char pVD; |
||
448 | |||
449 | #ifdef MOD_VID_VD |
||
450 | unsigned char *vdbase; |
||
451 | #endif |
||
452 | |||
453 | unsigned char pFFBA, p7FBA; // SMUC |
||
454 | unsigned char res1, res2; |
||
455 | |||
456 | unsigned char p0F, p1F, p4F, p5F; // soundrive |
||
457 | struct WD1793 wd; |
||
458 | struct NVRAM nvram; |
||
459 | struct { |
||
460 | __int64 edge_change; |
||
461 | unsigned char *play_pointer; // or NULL if tape stopped |
||
462 | unsigned char *end_of_tape; // where to stop tape |
||
463 | unsigned index; // current tape block |
||
464 | unsigned tape_bit; |
||
465 | // SNDRENDER sound; //Alone Coder |
||
466 | } tape; |
||
467 | SNDRENDER tape_sound; //Alone Coder |
||
468 | unsigned char comp_pal[0x10]; |
||
469 | unsigned char ide_hi_byte_r, ide_hi_byte_w, ide_hi_byte_w1, ide_read, ide_write; // high byte in IDE i/o |
||
470 | unsigned char profrom_bank; |
||
471 | }; |
||
472 | |||
473 | // bits for COMPUTER::flags |
||
474 | #define CF_DOSPORTS 0x01 // tr-dos ports are accessible |
||
475 | #define CF_TRDOS 0x02 // DOSEN trigger |
||
476 | #define CF_SETDOSROM 0x04 // tr-dos ROM become active at #3Dxx |
||
477 | #define CF_LEAVEDOSRAM 0x08 // DOS ROM will be closed at executing RAM |
||
478 | #define CF_LEAVEDOSADR 0x10 // DOS ROM will be closed at pc>#4000 |
||
479 | #define CF_CACHEON 0x20 // cache active |
||
480 | #define CF_Z80FBUS 0x40 // unstable data bus |
||
481 | #define CF_PROFROM 0x80 // PROF-ROM active |
||
482 | |||
483 | #define TAPE_QUANTUM 64 |
||
484 | struct tzx_block |
||
485 | { |
||
486 | unsigned char *data; |
||
487 | unsigned datasize; // data size, in bytes |
||
488 | unsigned pause; |
||
489 | union { |
||
490 | struct { |
||
491 | unsigned pilot_t, s1_t, s2_t, zero_t, one_t; |
||
492 | unsigned pilot_len; |
||
493 | }; |
||
494 | struct { |
||
495 | unsigned numblocks, numpulses; |
||
496 | }; |
||
497 | unsigned param; |
||
498 | }; |
||
499 | unsigned char type; // 0-playable, 1-pulses, 10-20 - info, etc... |
||
500 | unsigned char crc; // xor of all bytes |
||
501 | char desc[128]; |
||
502 | }; |
||
503 | |||
504 | struct SNDVAL { |
||
505 | union { |
||
506 | unsigned data; |
||
507 | struct { |
||
508 | short left, right; |
||
509 | }; |
||
510 | }; |
||
511 | }; |
||
512 | |||
513 | struct virtkeyt { |
||
514 | const char *name; |
||
515 | unsigned short virtkey; |
||
516 | }; |
||
517 | |||
518 | struct keyports |
||
519 | { |
||
520 | volatile unsigned char *port1, *port2; |
||
521 | unsigned char mask1, mask2; |
||
522 | }; |
||
523 | |||
524 | struct zxkey { |
||
525 | const char *name; |
||
526 | volatile unsigned char * /*const*/ port; //Alone Coder |
||
527 | /*const*/ unsigned char mask; //Alone Coder |
||
528 | }; |
||
529 | |||
530 | struct zxkeymap { |
||
531 | const char *name; |
||
532 | zxkey *zxk; |
||
533 | unsigned zxk_size ; |
||
534 | } ; |
||
535 | |||
536 | struct action { |
||
537 | const char *name; |
||
538 | void (*func)(); |
||
539 | unsigned short k1, k2, k3, k4; |
||
540 | }; |
||
541 | |||
542 | typedef void (*TColorConverter)(u8 *dst, u8 *scrbuf, int dx); |
||
543 | void ConvBgr32ToBgr24(u8 *dst, u8 *scrbuf, int dx); |
||
544 | void ConvYuy2ToBgr24(u8 *dst, u8 *scrbuf, int dx); |
||
545 | void ConvRgb16ToBgr24(u8 *dst, u8 *scrbuf, int dx); |
||
546 | void ConvRgb15ToBgr24(u8 *dst, u8 *scrbuf, int dx); |
||
547 | void ConvPal8ToBgr24(u8 *dst, u8 *scrbuf, int dx); |
||
548 | extern TColorConverter ConvBgr24; |
||
549 | // flags for video filters |
||
550 | // misc options |
||
551 | #define RF_BORDER 0x00000002 // no multicolor painter, read directly from spectrum memory |
||
552 | #define RF_MON 0x00000004 // not-flippable surface, show mouse cursor |
||
553 | #define RF_DRIVER 0x00000008 // use options from driver |
||
554 | //#define RF_VSYNC 0x00000010 // force VSYNC |
||
555 | #define RF_D3D 0x00000010 // use d3d for windowed mode |
||
556 | #define RF_GDI 0x00000020 // output to window |
||
557 | #define RF_CLIP 0x00000040 // use DirectDraw clipper for windowed mode |
||
558 | #define RF_OVR 0x00000080 // output to overlay |
||
559 | |||
560 | // main area size |
||
561 | #define RF_1X 0x00000000 // 256x192,320x240 with border (default) |
||
562 | #define RF_2X 0x00000100 // default x2 |
||
563 | #define RF_3X 0x00000001 // default x3 |
||
564 | #define RF_4X 0x00000200 // default x4 |
||
565 | #define RF_64x48 0x00000400 // 64x48 (for chunky 4x4) |
||
566 | #define RF_128x96 0x00000800 // 128x96 (for chunky 2x2) |
||
567 | |||
568 | #define RF_8 0x00000000 // 8 bit (default) |
||
569 | #define RF_8BPCH 0x00001000 // 8-bit per color channel. GDI mode => 32-bit surface. 8-bit mode => grayscale palette |
||
570 | #define RF_YUY2 0x00002000 // pixel format: 16bit, YUY2 |
||
571 | #define RF_16 0x00004000 // hicolor mode (RGB555/RGB565) |
||
572 | #define RF_32 0x00008000 // true color |
||
573 | |||
574 | #define RF_USEC32 0x00010000 // use c32tab |
||
575 | #define RF_USE32AS16 0x0020000 // c32tab contain hi-color WORDS |
||
576 | #define RF_USEFONT 0x00040000 // use font_tables |
||
577 | #define RF_PALB 0x00080000 // palette for bilinear filter |
||
578 | #define RF_COMPPAL 0x00100000 // use palette from ATM palette registers |
||
579 | #define RF_GRAY 0x00200000 // grayscale palette |
||
580 | #define RF_D3DE 0x00400000 // use d3d for full screen mode |
||
581 | |||
582 | #define RF_MONITOR (RF_MON | RF_GDI | RF_2X) |
||
583 | |||
584 | extern unsigned frametime; |
||
585 | extern int nmi_pending; |
||
586 | |||
587 | bool ConfirmExit(); |
||
588 | BOOL WINAPI ConsoleHandler(DWORD CtrlType); |
||
589 | void showhelp(const char *anchor = 0); |