Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
tvc.c
Go to the documentation of this file.
1 /* Test-case for a very simple and inaccurate Videoton TV computer
2  (a Z80 based 8 bit computer) emulator.
3 
4  Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu
5  Copyright (C)2015-2017,2020-2021 LGB (Gábor Lénárt) <lgblgblgb@gmail.com>
6 
7  This emulator is HIGHLY inaccurate and unusable.
8 
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
22 
23 #include "xemu/emutools.h"
24 #include "xemu/emutools_files.h"
25 #include "xemu/emutools_hid.h"
26 #include "xemu/emutools_config.h"
27 #include "xemu/z80.h"
28 #include "tvc.h"
29 #include "sdext.h"
30 
31 
32 #define CLOCKS_PER_FRAME (CPU_CLOCK / 50)
33 #define VIRTUAL_SHIFT_POS 0x63
34 
35 extern const struct KeyMappingDefault tvc_key_map[];
36 
37 // The Z80 emulation context itself
39 
40 // Misc. system level stuffs
41 static Uint8 io_port_values[0x100];
42 static int colour_mode;
43 static int keyboard_row;
44 static int interrupt_active;
45 
46 // Memory emulation related stuffs
47 typedef void (*memcbwr_type)(int, Uint8);
48 typedef Uint8 (*memcbrd_type)(int);
49 static struct {
53  Uint8 user_ram [0x10000];
54  Uint8 video_ram[0x10000];
55  Uint8 sys_rom [0x04000];
56  Uint8 ext_rom [0x04000]; // the first 8K is not used from this, currently ...
57 } mem;
58 
59 // CRTC "internal" related stuffs
60 const Uint8 crtc_write_masks[18] = {
61  0xFF /* R0 */, 0xFF /* R1 */, 0xFF /* R2 */, 0xFF /* R3 */, 0x7F /* R4 */, 0x1F /* R5 */,
62  0x7F /* R6 */, 0x7F /* R7 */, 0xFF /* R8 */, 0x1F /* R9 */, 0x7F /* R10*/, 0x1F /*R11 */,
63  0x3F /* R12 */, 0xFF /* R13 */, 0x3F /* R14 */, 0xFF /* R15 */, 0xFF /* R16 */, 0xFF /* R17 */
64 };
65 static struct {
66  Uint8 *vmem;
68  int regsel;
69 } crtc;
70 
71 // Palette related, contains "SDL-ready" values!
72 static Uint32 tvc_palette_rgb[16];
73 static Uint32 tvc_palette_bw [16];
74 static Uint32 palette[4];
75 static Uint32 palette_col16_pixel1[0x100];
76 static Uint32 palette_col16_pixel2[0x100];
77 static Uint32 border_colour;
78 
79 static int frameskip = 0;
80 
81 static struct {
82  int sdext;
83  char *sdimg;
84  char *sdrom;
86 } configdb;
87 
88 
89 
90 
91 static XEMU_INLINE Uint32 TVC_COLOUR_BYTE_TO_SDL ( Uint8 c )
92 {
93  return tvc_palette_rgb[(c & 1) | ((c >> 1) & 2) | ((c >> 2) & 4) | ((c >> 3) & 8)];
94 }
95 
96 
97 static void crtc_write_register ( int reg, Uint8 data )
98 {
99  if (XEMU_LIKELY(reg < 16)) {
100  data &= crtc_write_masks[reg]; // this will chop unused bits off for the given register
101  DEBUG("CRTC: register %02Xh is written with data %02Xh" NL, reg, data);
102  crtc.registers[reg] = data;
103  }
104 }
105 
106 
107 static Uint8 crtc_read_register ( int reg )
108 {
109  if (XEMU_LIKELY(reg >= 12 && reg <= 17))
110  return crtc.registers[reg];
111  return 0xFF;
112 }
113 
114 
115 
116 static void memcbwr_ram_u0 ( int addr, Uint8 data ) { mem.user_ram[addr ] = data; }
117 static void memcbwr_ram_u1 ( int addr, Uint8 data ) { mem.user_ram[addr + 0x4000] = data; }
118 static void memcbwr_ram_u2 ( int addr, Uint8 data ) { mem.user_ram[addr + 0x8000] = data; }
119 static void memcbwr_ram_u3 ( int addr, Uint8 data ) { mem.user_ram[addr + 0xC000] = data; }
120 static Uint8 memcbrd_ram_u0 ( int addr ) { return mem.user_ram[addr ]; }
121 static Uint8 memcbrd_ram_u1 ( int addr ) { return mem.user_ram[addr + 0x4000]; }
122 static Uint8 memcbrd_ram_u2 ( int addr ) { return mem.user_ram[addr + 0x8000]; }
123 static Uint8 memcbrd_ram_u3 ( int addr ) { return mem.user_ram[addr + 0xC000]; }
124 static void memcbwr_ram_video ( int addr, Uint8 data ) { mem.vmem[addr] = data; }
125 static Uint8 memcbrd_ram_video ( int addr ) { return mem.vmem[addr]; }
126 static Uint8 memcbrd_rom_sys ( int addr ) { return mem.sys_rom[addr]; }
127 static Uint8 memcbrd_rom_ext ( int addr ) { return mem.ext_rom[addr]; }
128 static void memcbwr_nowrite ( int addr, Uint8 data ) { }
129 
130 #ifdef CONFIG_SDEXT_SUPPORT
131 #define memcbrd_rom_cart sdext_read_cart
132 #define memcbwr_rom_cart sdext_write_cart
133 #else
134 static Uint8 memcbrd_rom_cart ( int addr ) { return 0xFF; }
135 static void memcbwr_rom_cart ( int addr, Uint8 data ) { }
136 #endif
137 
138 static const memcbrd_type memory_rd_selectors_for_page3[4] = { memcbrd_rom_cart, memcbrd_rom_sys, memcbrd_ram_u3, memcbrd_rom_ext };
139 static const memcbwr_type memory_wr_selectors_for_page3[4] = { memcbwr_rom_cart, memcbwr_nowrite, memcbwr_ram_u3, memcbwr_nowrite };
140 static const memcbrd_type memory_rd_selectors_for_page0[4] = { memcbrd_rom_sys, memcbrd_rom_cart, memcbrd_ram_u0, memcbrd_ram_u3 };
141 static const memcbwr_type memory_wr_selectors_for_page0[4] = { memcbwr_nowrite, memcbwr_rom_cart, memcbwr_ram_u0, memcbwr_ram_u3 };
142 
143 
144 
146 {
147  return (mem.rd_selector[addr >> 14])(addr & 0x3FFF);
148 }
149 
150 
151 
153 {
154  (mem.wr_selector[addr >> 14])(addr & 0x3FFF, value);
155 }
156 
157 
158 
160 {
161  port16 &= 0xFF;
162  DEBUG("IO: reading I/O port %02Xh" NL, port16);
163  switch (port16) {
164  case 0x58: case 0x5C:
165  DEBUG("Reading keyboard (row=%d, result=$%02X)!" NL, keyboard_row, kbd_matrix[keyboard_row]);
166  return keyboard_row < 10 ? kbd_matrix[keyboard_row] : 0xFF;
167  case 0x59: case 0x5D:
168  return interrupt_active ? 0xEF: 0xFF;
169  case 0x70:
170  return crtc.regsel;
171  case 0x71:
172  return crtc_read_register(crtc.regsel);
173  }
174  return 0xFF;
175 }
176 
177 
178 
180 {
181  port16 &= 0xFF;
182  io_port_values[port16] = value;
183  if (port16 != 2) // to avoid flooding ...
184  DEBUG("IO: writing I/O port %02Xh with data %02Xh" NL, port16, value);
185  switch (port16) {
186  case 0x00:
187  border_colour = TVC_COLOUR_BYTE_TO_SDL(value >> 1);
188  break;
189  case 0x02:
190  // page 3
191  mem.rd_selector[3] = memory_rd_selectors_for_page3[value >> 6];
192  mem.wr_selector[3] = memory_wr_selectors_for_page3[value >> 6];
193  // page 2
194  if (value & 32) {
195  mem.rd_selector[2] = memcbrd_ram_u2;
196  mem.wr_selector[2] = memcbwr_ram_u2;
197  } else {
198  mem.rd_selector[2] = memcbrd_ram_video;
199  mem.wr_selector[2] = memcbwr_ram_video;
200  }
201  // page 0
202  mem.rd_selector[0] = memory_rd_selectors_for_page0[(value >> 3) & 3];
203  mem.wr_selector[0] = memory_wr_selectors_for_page0[(value >> 3) & 3];
204  // page 1
205  if (!(value & 4)) {
206  mem.rd_selector[1] = memcbrd_ram_u1;
207  mem.wr_selector[1] = memcbwr_ram_u1;
208  } else {
209  mem.rd_selector[1] = memcbrd_ram_video;
210  mem.wr_selector[1] = memcbwr_ram_video;
211  }
212  break;
213  case 0x03:
214  // z80ex_pwrite_cb(2, io_port_values[2]); // TODO: we need this later with expansion mem paging!
215  keyboard_row = value & 0xF; // however the lower 4 bits are for selecting row
216  break;
217  case 0x05:
218  DEBUG("Enabled_SoundIT=%d Enabled_CursorIT=%d" NL, value & 32 ? 1 : 0, value & 16 ? 1 : 0);
219  break;
220  case 0x06:
221  colour_mode = value & 3;
222  if (colour_mode == 3)
223  colour_mode = 2;
224  DEBUG("VIDEO: colour mode is %d" NL, colour_mode);
225  break;
226  case 0x07:
227  // clear cursor/sound IT. FIXME: any write would do it?!
228  interrupt_active = 0;
229  break;
230  case 0x0C: case 0x0D: case 0x0E: case 0x0F:
231  crtc.vmem = mem.video_ram + ((value & 0x30) << 10);
232  mem.vmem = mem.video_ram + ((value & 0x03) << 14);
233  break;
234  case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67:
235  case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F:
236  palette[port16 & 3] = TVC_COLOUR_BYTE_TO_SDL(value);
237  break;
238  case 0x70: case 0x72: case 0x74: case 0x76: case 0x78: case 0x7A: case 0x7C: case 0x7E:
239  crtc.regsel = value & 31;
240  break;
241  case 0x71: case 0x73: case 0x75: case 0x77: case 0x79: case 0x7B: case 0x7D: case 0x7F:
242  crtc_write_register(crtc.regsel, value);
243  break;
244  }
245 }
246 
247 
248 
250 {
251  return 0xFF;
252 }
253 
254 
255 void z80ex_reti_cb ( void )
256 {
257 }
258 
259 
260 void clear_emu_events ( void )
261 {
262  hid_reset_events(1);
263 }
264 
265 
266 // Well :) It's just an ugly hack to render one frame at once.
267 // There is "some CRTC emulation", though far from being all
268 // features are expected to work!
269 // Note: though the selected 16K (TVC64+ is emulated!) is used ...
270 static inline void render_tvc_screen ( void )
271 {
272  int tail, y;
274  int ma = (crtc.registers[12] << 8) | crtc.registers[13]; // CRTC MA signals, 14 bit
275  int ra = 0; // CRTC RA signals
276  int start_line, limit_line, start_cpos, limit_cpos;
277  //DEBUG("CRTCINFO: start addr = $%04X" NL, ma);
278  //for (y = 0; y < sizeof crtc.registers; y++)
279  // DEBUG("CRTCINFO: R%02d=%d" NL, y, crtc.registers[y]);
280  start_line = (SCREEN_HEIGHT - (crtc.registers[6] * (crtc.registers[9] + 1))) >> 1;
281  limit_line = SCREEN_HEIGHT - start_line;
282  start_cpos = ((SCREEN_WIDTH >> 3) - crtc.registers[1]) >> 1;
283  limit_cpos = (SCREEN_WIDTH >> 3) - start_cpos;
284  for (y = 0; y < SCREEN_HEIGHT; y++) {
285  int x;
286  if (y >= start_line && y < limit_line) { // active content!
287  int addr = (ma & 63) | (ra << 6) | ((ma & 0xFC0) << 2);
288  for (x = 0; x < (SCREEN_WIDTH >> 3); x++) {
289  if (x >= start_cpos && x < limit_cpos) {
290  Uint8 b = crtc.vmem[(addr++) & 0x3FFF];
291  switch (colour_mode) {
292  case 0: // 2-colours mode
293  pix[0] = palette[(b >> 7) & 1];
294  pix[1] = palette[(b >> 6) & 1];
295  pix[2] = palette[(b >> 5) & 1];
296  pix[3] = palette[(b >> 4) & 1];
297  pix[4] = palette[(b >> 3) & 1];
298  pix[5] = palette[(b >> 2) & 1];
299  pix[6] = palette[(b >> 1) & 1];
300  pix[7] = palette[ b & 1];
301  break;
302  case 1: // 4-colours mode
303  pix[0] = pix[1] = palette[((b & 0x80) >> 7) | ((b & 0x08) >> 2)];
304  pix[2] = pix[3] = palette[((b & 0x40) >> 6) | ((b & 0x04) >> 1)];
305  pix[4] = pix[5] = palette[((b & 0x20) >> 5) | (b & 0x02) ];
306  pix[6] = pix[7] = palette[((b & 0x10) >> 4) | ((b & 0x01) << 1)];
307  break;
308  case 2: // 16-colours mode
309  pix[0] = pix[1] = pix[2] = pix[3] = palette_col16_pixel1[b];
310  pix[4] = pix[5] = pix[6] = pix[7] = palette_col16_pixel2[b];
311  break;
312  }
313  } else // sider border
314  pix[0] = pix[1] = pix[2] = pix[3] = pix[4] = pix[5] = pix[6] = pix[7] = border_colour;
315  pix += 8;
316  }
317  if (ra == crtc.registers[9]) {
318  ra = 0;
319  ma += crtc.registers[1];
320  } else
321  ra++;
322  } else // top or bottom border ...
323  for (x = 0; x < SCREEN_WIDTH; x++)
324  *pix++ = border_colour;
325  pix += tail;
326  }
328 }
329 
330 
331 
332 // HID needs this to be defined, it's up to the emulator if it uses or not ...
333 int emu_callback_key ( int pos, SDL_Scancode key, int pressed, int handled )
334 {
335  return 0;
336 }
337 
338 
339 
340 static void update_emulator ( void )
341 {
342  // FIXME: Ugly trick, we generate IRQ here, not by CRTC cursor stuff, what would do it for real on TVC!
343  // This means, that TVC uses the cursor info of CRTC "abused" to be used an a periodic interrupt source. Tricky!
344  // However, this implementation of mine if very wrong, and the exact time for the IRQ should depend on CRTC reg settings
345  // I THINK ... :-D
346  if (io_port_values[5] & 16) { // if enabled at all!
347  interrupt_active = 1;
348  DEBUG("Cursor interrupt!" NL);
349  }
350  // Rest of the update stuff, but only at 25Hz rate ...
351  if (!frameskip) {
352  render_tvc_screen();
354  xemu_timekeeping_delay(40000); // number: the time needed (real-time) for a "full frame"
355  }
356 }
357 
358 
359 static void init_tvc ( void )
360 {
361  int a;
362  // Initialize colours (TODO: B&W mode is not used currently!)
363  for (a = 0; a < 16; a++) {
364  int red = (a & 2) ? ((a & 8) ? 0xFF : 0x80) : 0;
365  int green = (a & 4) ? ((a & 8) ? 0xFF : 0x80) : 0;
366  int blue = (a & 1) ? ((a & 8) ? 0xFF : 0x80) : 0;
367  int y = 0.299 * red + 0.587 * green + 0.114 * blue;
368  tvc_palette_rgb[a] = SDL_MapRGBA(sdl_pix_fmt, red, green, blue, 0xFF);
369  tvc_palette_bw [a] = SDL_MapRGBA(sdl_pix_fmt, y, y, y, 0xFF);
370  }
371  // Initialize helper tables for 16 colours mode
372  // 16 colour mode does not use the 4 element palette register, but layout is not "TVC colour byte" ...
373  // TVC "colour byte is": -I-G-R-B
374  // Format in 16 col mode:
375  // * first pixel: I-G-R-B-
376  // * second pixel: -I-G-R-B (this matches the colour byte layout, btw!)
377  for (a = 0; a < 256; a++) {
378  palette_col16_pixel1[a] = TVC_COLOUR_BYTE_TO_SDL(a >> 1);
379  palette_col16_pixel2[a] = TVC_COLOUR_BYTE_TO_SDL(a);
380  }
381  // I/O, ROM and RAM intialization ...
382  memset(&mem, 0xFF, sizeof mem);
383  memset(&io_port_values, 0x00, 0x100); // some I/O handlers re-calls itself with other values, so we zero the stuff first
384  memset(crtc.registers, 0x00, sizeof crtc.registers);
385  for (a = 0; a < 0x100; a++) // ... and now use the callback which sets our variables for some initial value ...
386  z80ex_pwrite_cb(a, 0);
387  for (a = 0; a < sizeof crtc.registers; a++)
388  crtc_write_register(a, 0);
389  if (xemu_load_file("#tvc22_d6_64k.rom", mem.sys_rom + 0x0000, 0x2000, 0x2000, NULL) < 0 ||
390  xemu_load_file("#tvc22_d4_64k.rom", mem.sys_rom + 0x2000, 0x2000, 0x2000, NULL) < 0 ||
391  xemu_load_file("#tvc22_d7_64k.rom", mem.ext_rom + 0x2000, 0x2000, 0x2000, NULL) < 0
392  )
393  FATAL("Cannot load ROM(s).");
394 #ifdef CONFIG_SDEXT_SUPPORT
395  if (configdb.sdext)
396  sdext_init(configdb.sdimg, configdb.sdrom);
397 #endif
398 }
399 
400 
401 static int cycles;
402 
403 
404 static void emulation_loop ( void )
405 {
406  for (;;) { // our emulation loop ...
407  if (interrupt_active) {
408  int a = z80ex_int();
409  if (a)
410  cycles += a;
411  else
412  cycles += z80ex_step();
413  } else
414  cycles += z80ex_step();
415  if (cycles >= CLOCKS_PER_FRAME) {
416  update_emulator();
417  frameskip = !frameskip;
418  cycles -= CLOCKS_PER_FRAME;
419  return;
420  }
421  }
422 }
423 
424 
425 int main ( int argc, char **argv )
426 {
427  xemu_pre_init(APP_ORG, TARGET_NAME, "The Careless Videoton TV Computer emulator from LGB");
428 #ifdef CONFIG_SDEXT_SUPPORT
429  xemucfg_define_switch_option("sdext", "Enables SD-ext", &configdb.sdext);
430  xemucfg_define_str_option("sdimg", "@sdcard.img", "SD-card image filename / path", &configdb.sdimg);
431  xemucfg_define_str_option("sdrom", "#tvc_sddos.rom", "SD-card cartridge ROM image path", &configdb.sdrom);
432 #endif
433  xemucfg_define_switch_option("fullscreen", "Start in fullscreen mode", &configdb.fullscreen_requested);
434  xemucfg_define_switch_option("syscon", "Keep system console open (Windows-specific effect only)", &configdb.syscon);
435  xemucfg_define_num_option("sdlrenderquality", RENDER_SCALE_QUALITY, "Setting SDL hint for scaling method/quality on rendering (0, 1, 2)", &configdb.sdlrenderquality, 0, 2);
436  if (xemucfg_parse_all(argc, argv))
437  return 1;
438  /* Initiailize SDL - note, it must be before loading ROMs, as it depends on path info from SDL! */
439  if (xemu_post_init(
440  TARGET_DESC APP_DESC_APPEND, // window title
441  1, // resizable window
442  SCREEN_WIDTH, SCREEN_HEIGHT, // texture sizes
443  SCREEN_WIDTH, SCREEN_HEIGHT * 2, // logical size (width is doubled for somewhat correct aspect ratio)
444  SCREEN_WIDTH, SCREEN_HEIGHT * 2, // window size (tripled in size, original would be too small)
445  SCREEN_FORMAT, // pixel format
446  0, // custom palette init. Later, in init_tvc()
447  NULL, // -- "" --
448  NULL, // -- "" --
449  configdb.sdlrenderquality, // render scaling quality
450  USE_LOCKED_TEXTURE, // 1 = locked texture access
451  NULL // no emulator specific shutdown function
452  ))
453  return 1;
454  hid_init(
455  tvc_key_map,
457  SDL_DISABLE // no joystick HID events
458  );
459  init_tvc();
460  // Continue with initializing ...
461  clear_emu_events(); // also resets the keyboard
462  z80ex_init();
463  cycles = 0;
464  interrupt_active = 0;
465  if (!configdb.syscon)
466  sysconsole_close(NULL);
468  xemu_timekeeping_start(); // we must call this once, right before the start of the emulation
469  XEMU_MAIN_LOOP(emulation_loop, 25, 1);
470  return 0;
471 }
xemu_pre_init
void xemu_pre_init(const char *app_organization, const char *app_name, const char *slogan)
Definition: emutools.c:651
z80ex_intread_cb
Z80EX_BYTE z80ex_intread_cb(void)
Definition: tvc.c:249
z80ex_init
void z80ex_init(void)
Definition: z80ex.c:175
xemucfg_define_str_option
void xemucfg_define_str_option(const char *optname, const char *defval, const char *help, char **storage)
VIRTUAL_SHIFT_POS
#define VIRTUAL_SHIFT_POS
Definition: tvc.c:33
USE_LOCKED_TEXTURE
#define USE_LOCKED_TEXTURE
Definition: commodore_65.h:26
TARGET_DESC
#define TARGET_DESC
Definition: xemu-target.h:2
sdext.h
configdb_st::fullscreen_requested
int fullscreen_requested
Definition: configdb.h:35
xemu_timekeeping_delay
void xemu_timekeeping_delay(int td_em)
Definition: emutools.c:405
emutools.h
sysconsole_close
void sysconsole_close(const char *waitmsg)
Definition: emutools.c:1393
tvc.h
XEMU_MAIN_LOOP
#define XEMU_MAIN_LOOP(func, p1, p2)
Definition: emutools.h:58
syscon
int syscon
Definition: tvc.c:85
clear_emu_events
void clear_emu_events(void)
Definition: tvc.c:260
z80ex_step
int z80ex_step(void)
Definition: z80ex.c:47
registers
Uint8 registers[18]
Definition: tvc.c:67
SCREEN_WIDTH
#define SCREEN_WIDTH
Definition: vic3.h:29
z80ex_mwrite_cb
void z80ex_mwrite_cb(Z80EX_WORD addr, Z80EX_BYTE value)
Definition: tvc.c:152
vmem
Uint8 * vmem
Definition: tvc.c:52
xemucfg_define_num_option
void xemucfg_define_num_option(const char *optname, const int defval, const char *help, int *storage, int min, int max)
xemu_update_screen
void xemu_update_screen(void)
Definition: emutools.c:1184
addr
int addr
Definition: dma65.c:81
sdl_pix_fmt
SDL_PixelFormat * sdl_pix_fmt
Definition: emutools.c:80
hid_handle_all_sdl_events
void hid_handle_all_sdl_events(void)
Definition: emutools_hid.c:613
xemucfg_parse_all
int xemucfg_parse_all(int argc, char **argv)
user_ram
Uint8 user_ram[0x10000]
Definition: tvc.c:53
XEMU_INLINE
#define XEMU_INLINE
Definition: emutools_basicdefs.h:126
m65-memcontent-generator.data
data
Definition: m65-memcontent-generator.py:119
z80ex_int
int z80ex_int(void)
Definition: z80ex.c:225
wr_selector
memcbwr_type wr_selector[4]
Definition: tvc.c:50
Uint32
uint32_t Uint32
Definition: fat32.c:49
Z80EX_WORD
unsigned short Z80EX_WORD
Definition: z80ex.h:51
main
int main(int argc, char **argv)
Definition: tvc.c:425
hid_init
void hid_init(const struct KeyMappingDefault *key_map_in, Uint8 virtual_shift_pos_in, int joy_enable)
Definition: emutools_hid.c:300
emu_callback_key
int emu_callback_key(int pos, SDL_Scancode key, int pressed, int handled)
Definition: tvc.c:333
hid_reset_events
void hid_reset_events(int burn)
Definition: emutools_hid.c:170
Uint8
uint8_t Uint8
Definition: fat32.c:51
xemu_set_full_screen
void xemu_set_full_screen(int setting)
Definition: emutools.c:311
_z80_cpu_context
Definition: z80ex.h:143
configdb_st::sdlrenderquality
int sdlrenderquality
Definition: configdb.h:35
palette
Uint32 * palette
Definition: vic4_palette.c:33
TARGET_NAME
#define TARGET_NAME
Definition: xemu-target.h:1
emutools_files.h
z80.h
APP_ORG
#define APP_ORG
Definition: emutools.h:50
x
int x
Definition: console.c:27
xemu_start_pixel_buffer_access
Uint32 * xemu_start_pixel_buffer_access(int *texture_tail)
Definition: emutools.c:1153
regsel
int regsel
Definition: tvc.c:68
video_ram
Uint8 video_ram[0x10000]
Definition: tvc.c:54
memcbrd_type
Uint8(* memcbrd_type)(int)
Definition: tvc.c:48
Z80EX_BYTE
unsigned char Z80EX_BYTE
Definition: z80ex.h:49
XEMU_LIKELY
#define XEMU_LIKELY(__x__)
Definition: emutools_basicdefs.h:124
NL
#define NL
Definition: fat32.c:37
emutools_config.h
configdb
struct configdb_st configdb
Definition: configdb.c:34
KeyMappingDefault
Definition: emutools_hid.h:24
xemu_post_init
int xemu_post_init(const char *window_title, int is_resizable, int texture_x_size, int texture_y_size, int logical_x_size, int logical_y_size, int win_x_size, int win_y_size, Uint32 pixel_format, int n_colours, const Uint8 *colours, Uint32 *store_palette, int render_scale_quality, int locked_texture_update, void(*shutdown_callback)(void))
Definition: emutools.c:908
xemu_load_file
int xemu_load_file(const char *filename, void *store_to, int min_size, int max_size, const char *cry)
Definition: emutools_files.c:674
xemu_timekeeping_start
void xemu_timekeeping_start(void)
Definition: emutools.c:1122
configdb_st::syscon
int syscon
Definition: configdb.h:34
kbd_matrix
Uint8 kbd_matrix[16]
Definition: dave.c:30
SCREEN_HEIGHT
#define SCREEN_HEIGHT
Definition: vic3.h:30
tvc_key_map
const struct KeyMappingDefault tvc_key_map[]
Definition: tvc_keymatrix.c:26
CLOCKS_PER_FRAME
#define CLOCKS_PER_FRAME
Definition: tvc.c:32
SCREEN_FORMAT
#define SCREEN_FORMAT
Definition: commodore_65.h:25
ext_rom
Uint8 ext_rom[0x04000]
Definition: tvc.c:56
RENDER_SCALE_QUALITY
#define RENDER_SCALE_QUALITY
Definition: commodore_65.h:27
y
int y
Definition: console.c:27
configdb_st::sdimg
char * sdimg
Definition: configdb.h:45
value
int value
Definition: dma65.c:90
APP_DESC_APPEND
#define APP_DESC_APPEND
Definition: emutools.h:52
sdimg
char * sdimg
Definition: tvc.c:83
emutools_hid.h
fullscreen_requested
int fullscreen_requested
Definition: tvc.c:85
z80ex
Z80EX_CONTEXT z80ex
Definition: tvc.c:38
rd_selector
memcbrd_type rd_selector[4]
Definition: tvc.c:51
xemucfg_define_switch_option
void xemucfg_define_switch_option(const char *optname, const char *help, int *storage)
sys_rom
Uint8 sys_rom[0x04000]
Definition: tvc.c:55
DEBUG
#define DEBUG(...)
Definition: emutools_basicdefs.h:167
z80ex_pread_cb
Z80EX_BYTE z80ex_pread_cb(Z80EX_WORD port16)
Definition: tvc.c:159
sdext
int sdext
Definition: tvc.c:82
FATAL
#define FATAL(...)
Definition: xep128.h:117
crtc_write_masks
const Uint8 crtc_write_masks[18]
Definition: tvc.c:60
sdlrenderquality
int sdlrenderquality
Definition: tvc.c:85
z80ex_mread_cb
Z80EX_BYTE z80ex_mread_cb(Z80EX_WORD addr, int m1_state)
Definition: tvc.c:145
z80ex_pwrite_cb
void z80ex_pwrite_cb(Z80EX_WORD port16, Z80EX_BYTE value)
Definition: tvc.c:179
frameskip
int frameskip
Definition: vic3.c:75
sdrom
char * sdrom
Definition: tvc.c:84
memcbwr_type
void(* memcbwr_type)(int, Uint8)
Definition: tvc.c:47
z80ex_reti_cb
void z80ex_reti_cb(void)
Definition: tvc.c:255