Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
matrix_mode.c
Go to the documentation of this file.
1 /* A work-in-progess MEGA65 (Commodore-65 clone origins) emulator
2  Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu
3  Copyright (C)2016-2022 LGB (Gábor Lénárt) <lgblgblgb@gmail.com>
4 
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
18 
19 
20 #include "xemu/emutools.h"
21 #include "matrix_mode.h"
22 
23 #include "xemu/emutools_hid.h"
24 #include "xemu/cpu65.h"
25 #include "hypervisor.h"
26 #include "vic4.h"
27 #include "mega65.h"
28 #include "io_mapper.h"
29 #include "memory_mapper.h"
30 
31 #include <ctype.h>
32 
33 
34 //#define DEBUGMATRIX DEBUGPRINT
35 //#define DEBUGMATRIX DEBUG
36 #define DEBUGMATRIX(...)
37 
38 
39 int in_the_matrix = 0;
40 
41 
42 // TODO: many inventions here eventlually should be moved into some common place as
43 // probably other emulators ("generic OSD console API"), and OSD GUI want to use them as well!
44 
45 // TODO: some code here (Xemu specific matrix commands ...) should share interfade with
46 // the uart_mon/umon, and in fact, that should be accessed from here, as on a real MEGA65!
47 
48 // to get charset
49 #include "rom.h"
50 
51 #define MATRIX(...) do { \
52  char _buf_for_msg_[4096]; \
53  CHECK_SNPRINTF(snprintf(_buf_for_msg_, sizeof _buf_for_msg_, __VA_ARGS__), sizeof _buf_for_msg_); \
54  matrix_write_string(_buf_for_msg_); \
55 } while(0)
56 
57 #define CURSOR_CHAR 0xDB
58 #define CURSOR_COLOUR 4
59 #define CLI_START_LINE 4
60 #define NORMAL_COLOUR 1
61 #define BANNER_COLOUR 2
62 
63 static const Uint8 console_colours[] = {
64  0x00, 0x00, 0x00, 0x80, // 0: for background shade of the console
65  0x00, 0xFF, 0x00, 0xFF, // 1: normal green colour of the console text
66  0xFF, 0xFF, 0x00, 0xFF, // 2: alternative yellow colour of the console text
67  0x00, 0x00, 0x00, 0x00, // 3: totally transparent stuff
68  0xFF, 0x00, 0x00, 0xFF // 4: red
69 };
70 static Uint32 colour_mappings[16];
71 static Uint8 current_colour;
72 
73 static int backend_xsize, backend_ysize;
74 static Uint32 *backend_pixels;
75 static int chrscreen_xsize, chrscreen_ysize;
76 static Uint8 *vmem = NULL;
77 static int current_x = 0, current_y = 0;
78 static const char *prompt = NULL;
79 static int need_update = 0;
80 static int reserve_top_lines = 0; // reserve this amount of top lines when scrolling
81 static int init_done = 0;
82 static Uint8 queued_input;
83 
84 
85 #define PARTIAL_OSD_TEXTURE_UPDATE
86 
87 
88 static void matrix_update ( void )
89 {
90  if (!need_update)
91  return;
92  Uint8 *vp = vmem;
93  need_update &= ~1;
94  int updated = 0;
95 #ifdef PARTIAL_OSD_TEXTURE_UPDATE
96  int region = 0, x_min[2] = { 1000, 1000 }, y_min[2] = { 1000, 1000 }, x_max[2] = { -1, -1 }, y_max[2] = { -1, -1 };
97 #endif
98  for (int y = 0; y < chrscreen_ysize; y++) {
99 #ifdef PARTIAL_OSD_TEXTURE_UPDATE
100  if (XEMU_UNLIKELY(y == reserve_top_lines))
101  region = 1;
102 #endif
103  for (int x = 0; x < chrscreen_xsize; x++, vp += 2)
104  if (need_update || (vp[1] & 0x80)) {
105  updated++;
106  const Uint8 *font = &vga_font_8x8[vp[0] << 3];
107  vp[1] &= 0x7F;
108  Uint32 *pix = backend_pixels + (y * 8) * backend_xsize + (x * 8);
109  for (int line = 0; line < 8; line++, font++, pix += backend_xsize - 8)
110  for (Uint8 bp = 0, data = *font; bp < 8; bp++, data <<= 1)
111  *pix++ = colour_mappings[(vp[1] >> ((data & 0x80) ? 0 : 4)) & 0xF];
112 #ifdef PARTIAL_OSD_TEXTURE_UPDATE
113  if (x < x_min[region]) x_min[region] = x;
114  if (x > x_max[region]) x_max[region] = x;
115  if (y < y_min[region]) y_min[region] = y;
116  if (y > y_max[region]) y_max[region] = y;
117 #endif
118  }
119  }
120  need_update = 0;
121  if (updated) {
122 #ifdef PARTIAL_OSD_TEXTURE_UPDATE
123  int area = 0;
124  for (int i = 0; i < 2; i++)
125  if (x_max[i] >= 0) {
126  const SDL_Rect rect = {
127  .x = x_min[i] * 8,
128  .y = y_min[i] * 8,
129  .w = (x_max[i] - x_min[i] + 1) * 8,
130  .h = (y_max[i] - y_min[i] + 1) * 8
131  };
132  DEBUGMATRIX("MATRIX: update rectangle region #%d is %dx%d character wide at %d,%d" NL, i, x_max[i] - x_min[i] + 1, y_max[i] - y_min[i] + 1, x_min[i], y_min[i]);
133  DEBUGMATRIX("MATRIX: update rectangle region #%d in pixels is %dx%d pixels at %d,%d" NL, i, rect.w, rect.h, rect.x, rect.y);
134  osd_texture_update(&rect);
135  area += rect.w * rect.h / 64;
136  }
137 #else
138  int area = chrscreen_xsize * chrscreen_ysize;
139  osd_texture_update(NULL);
140 #endif
141  DEBUGMATRIX("MATRIX: updated %d characters, %d OSD chars (=%.03f%%)" NL, updated, area, (double)(area * 100) / (double)(chrscreen_xsize * chrscreen_ysize));
142  }
143 }
144 
145 
146 static void write_char_raw ( const int x, const int y, const Uint8 ch, const Uint8 col )
147 {
148  if (XEMU_UNLIKELY(x < 0 || y < 0 || x >= chrscreen_xsize || y >= chrscreen_ysize))
149  return;
150  Uint8 *v = vmem + (chrscreen_xsize * y + x) * 2;
151  if (XEMU_LIKELY(v[0] != ch))
152  v[0] = ch, v[1] = col | 0x80;
153  else if (XEMU_UNLIKELY((v[1] ^ col) & 0x7F))
154  v[1] = col | 0x80;
155  need_update |= 1;
156 }
157 
158 
159 static void matrix_clear ( void )
160 {
161  for (Uint8 *vp = vmem, *ve = vmem + chrscreen_xsize * chrscreen_ysize * 2; vp < ve; vp += 2)
162  vp[0] = 0x20, vp[1] = current_colour;
163  need_update |= 2;
164 }
165 
166 
167 static void matrix_write_char ( const Uint8 c )
168 {
169  if (c == '\n' || c == '\r') {
170  current_x = 0;
171  current_y++;
172  } else if (c == 8) {
173  if (current_x > 0)
174  current_x--;
175  } else {
176  write_char_raw(current_x, current_y, c, current_colour);
177  current_x++;
178  if (current_x >= chrscreen_xsize) {
179  current_x = 0;
180  current_y++;
181  }
182  }
183  if (current_y >= chrscreen_ysize) {
184  current_y = chrscreen_ysize - 1;
185  DEBUGMATRIX("MATRIX: scrolling ... reserved=%d lines" NL, reserve_top_lines);
186  memmove(
187  vmem + 2 * chrscreen_xsize * reserve_top_lines,
188  vmem + 2 * chrscreen_xsize * (reserve_top_lines + 1),
189  chrscreen_xsize * (chrscreen_ysize - 1 - reserve_top_lines) * 2
190  );
191  for (Uint8 x = 0, *vp = vmem + (chrscreen_ysize - 1) * chrscreen_xsize * 2; x < chrscreen_xsize; x++, vp += 2)
192  vp[0] = 0x20, vp[1] = current_colour;
193  need_update |= 2;
194  }
195 }
196 
197 
198 static inline void matrix_write_string ( const char *s )
199 {
200  while (*s)
201  matrix_write_char(*s++);
202 }
203 
204 
205 static void dump_regs ( const char rot_fig )
206 {
207  static const Uint8 io_mode_xlat[4] = { 2, 3, 0, 4 };
208  const Uint8 pf = cpu65_get_pf();
209  MATRIX("PC:%04X A:%02X X:%02X Y:%02X Z:%02X SP:%04X B:%02X %c%c%c%c%c%c%c%c IO:%d (%c) %c %s %s ",
210  cpu65.pc, cpu65.a, cpu65.x, cpu65.y, cpu65.z,
211  cpu65.sphi + cpu65.s, cpu65.bphi >> 8,
212  (pf & CPU65_PF_N) ? 'N' : 'n',
213  (pf & CPU65_PF_V) ? 'V' : 'v',
214  (pf & CPU65_PF_E) ? 'E' : 'e',
215  '-',
216  (pf & CPU65_PF_D) ? 'D' : 'd',
217  (pf & CPU65_PF_I) ? 'I' : 'i',
218  (pf & CPU65_PF_Z) ? 'Z' : 'z',
219  (pf & CPU65_PF_C) ? 'C' : 'c',
220  io_mode_xlat[vic_iomode],
221  !!in_hypervisor ? 'H' : 'U',
222  rot_fig,
223  videostd_id ? "NTSC" : "PAL ",
225  );
226 }
227 
228 
229 /* COMMANDS */
230 
231 
232 static void cmd_off ( char *p )
233 {
235 }
236 
237 
238 static void cmd_uname ( char *p )
239 {
240  matrix_write_string(xemu_get_uname_string());
241 }
242 
243 
244 static void cmd_ver ( char *p )
245 {
247 }
248 
249 
250 static void cmd_reg ( char *p )
251 {
252  dump_regs(' ');
253 }
254 
255 
256 static Uint16 addr_hiword = 0, addr_loword = 0; // current dump/show/write address. hiword=$FFFF indicates _CPU_ address
257 static Uint8 data_byte;
258 
259 
260 static int mem_args ( const char *p, int need_data )
261 {
262  unsigned int addr, data;
263  int ret = sscanf((*p == '!' || *p == '?' || *p == '=') ? p + 1 : p, "%x %x", &addr , &data);
264  if (ret < 1) {
265  matrix_write_string("?MISSING ARG OR HEX SYNTAX ERROR");
266  return 0;
267  }
268  if (need_data && ret == 1) {
269  matrix_write_string("?MISSING SECOND ARG OR HEX SYNTAX ERROR");
270  return 0;
271  }
272  if (!need_data && ret > 1) {
273  matrix_write_string("?EXTRA UNKNOWN ARG");
274  return 0;
275  }
276  // Address part
277  if (*p == '!') {
278  if (addr > 0xFFFF) {
279  matrix_write_string("?CPU ADDRESS MUST BE 16-BIT");
280  return 0;
281  }
282  addr_hiword = 0xFFFF;
283  } else if (addr > 0xFFFF || *p == '=') {
284  if (addr >= 0xFFFFFFFU) {
285  matrix_write_string("?LINEAR ADDRESS MUST BE 28-BIT");
286  return 0;
287  }
288  addr_hiword = (addr >> 16) & 0xFFF;
289  }
290  addr_loword = addr & 0xFFFF;
291  if (*p == '?') {
292  if (addr > 0xFFF) {
293  matrix_write_string("?IO ADDRESS MUST BE 12-BIT");
294  return 0;
295  }
296  // M65 I/O is @ $FFD'3FFF
297  addr_loword = (addr_loword & 0xFFF) + 0x3000;
298  addr_hiword = 0xFFD;
299  }
300  // Data part
301  if (need_data) {
302  if (data > 0xFF) {
303  matrix_write_string("?DATA ARG MUST BE 8-BIT");
304  return 0;
305  }
306  data_byte = data & 0xFF;
307  return 2;
308  }
309  return 1;
310 }
311 
312 
313 static void cmd_log ( char *p )
314 {
315  DEBUGPRINT("USERLOG: %s" NL, *p ? p : "<EMPTY-TEXT>");
316 }
317 
318 
319 static void cmd_write ( char *p )
320 {
321  if (mem_args(p, 1) != 2)
322  return;
323  if (addr_hiword == 0xFFFF) {
324  cpu65_write_callback(addr_loword, data_byte);
325  return;
326  }
327  const Uint32 addr = ((Uint32)addr_hiword << 16) + (Uint32)addr_loword;
329 }
330 
331 
332 static void cmd_show ( char *p )
333 {
334  if (mem_args(p, 0) != 1)
335  return;
336  if (addr_hiword == 0xFFFF) {
337  MATRIX("[cpu:%04X] = %02X", addr_loword, cpu65_read_callback(addr_loword));
338  return;
339  }
340  const Uint32 addr = ((Uint32)addr_hiword << 16) + (Uint32)addr_loword;
341  MATRIX("[%03X:%04X] = %02X", addr_hiword, addr_loword, memory_debug_read_phys_addr(addr));
342 }
343 
344 
345 static void cmd_dump ( char *p )
346 {
347  if (*p && mem_args(p, 0) != 1)
348  return;
349  char chardump[79];
350  memset(chardump, 0, sizeof chardump);
351  for (int lines = 0; lines < 16; lines++) {
352  if (addr_hiword != 0xFFFF) {
353  // Clamp to 28 bit address space, unless hiword is $FFFF meaning CPU view, thus having a special meaning
354  addr_hiword &= 0xFFF;
355  sprintf(chardump + 1, "%03X:%04X", addr_hiword, addr_loword);
356  } else
357  sprintf(chardump + 1, "cpu:%04X", addr_loword);
358  for (int i = 0; i < 16; i++) {
359  Uint8 data;
360  if (addr_hiword == 0xFFFF)
361  data = cpu65_read_callback(addr_loword++);
362  else {
363  data = memory_debug_read_phys_addr(((Uint32)addr_hiword << 16) + (Uint32)addr_loword);
364  addr_loword++;
365  if (!addr_loword)
366  addr_hiword++;
367  }
368  sprintf(chardump + 12 + i * 3, "%02X", data);
369  chardump[61 + i] = data >= 32 ? data : '.';
370  }
371  for (int i = 0; i < sizeof(chardump) - 2; i++)
372  if (!chardump[i])
373  chardump[i] = 0x20;
374  chardump[sizeof(chardump) - 2] = '\n';
375  matrix_write_string(chardump);
376  }
377 }
378 
379 
380 static void cmd_help ( char *p );
381 
382 
383 static const struct command_tab_st {
384  const char *cmdname;
385  void (*cb)(char*);
386  const char *shortnames;
387 } command_tab[] = {
388  { "dump", cmd_dump, "d" },
389  { "exit", cmd_off, "x" },
390  { "help", cmd_help, "h?" },
391  { "log", cmd_log, NULL },
392  { "reg", cmd_reg, "r" },
393  { "show", cmd_show, "s" },
394  { "uname", cmd_uname, NULL },
395  { "ver", cmd_ver, NULL },
396  { "write", cmd_write, "w" },
397  { .cmdname = NULL },
398 };
399 
400 
401 static void cmd_help ( char *p )
402 {
403  matrix_write_string("Available commands:");
404  for (const struct command_tab_st *p = command_tab; p->cmdname; p++) {
405  MATRIX(" %s", p->cmdname);
406  if (p->shortnames)
407  MATRIX("(%s)", p->shortnames);
408  }
409 }
410 
411 
412 static void execute ( char *cmd )
413 {
414  char *sp = strchr(cmd, ' ');
415  if (sp)
416  *sp++ = '\0';
417  else
418  sp = "";
419  const int sname = !cmd[1] ? tolower(*cmd) : 1;
420  for (const struct command_tab_st *p = command_tab; p->cmdname; p++)
421  if ((p->shortnames && strchr(p->shortnames, sname)) || !strcasecmp(p->cmdname, cmd)) {
422  p->cb(sp);
423  return;
424  }
425  MATRIX("?SYNTAX ERROR IN \"%s\"", cmd);
426 }
427 
428 
429 static void input ( const char c )
430 {
431  static int start_x;
432  static Uint8 prev_char;
433  if (!current_x) {
434  matrix_write_string(prompt && *prompt ? prompt : "Xemu>");
435  start_x = current_x;
436  prev_char = 0;
437  if (!c)
438  return;
439  }
440  if (current_x < chrscreen_xsize - 1 && (c >= 33 || (c == 32 && current_x > start_x && prev_char != 32))) {
441  matrix_write_char(c);
442  prev_char = c;
443  } else if (current_x > start_x && c == 8) {
444  static const char backspace_seq_str[] = { 8, 32, 8, 0 };
445  matrix_write_string(backspace_seq_str);
446  } else if (c == '\r' || c == '\n') {
447  const int len = current_x - start_x;
448  char cmd[len + 1];
449  for (int i = 0, j = (current_y * chrscreen_xsize + start_x) << 1; i < len; i++, j += 2)
450  cmd[i] = vmem[j];
451  cmd[len - (prev_char == 32)] = 0;
452  matrix_write_char('\n');
453  if (*cmd)
454  execute(cmd);
455  if (current_x)
456  matrix_write_char('\n');
457  }
458 }
459 
460 
461 
462 
463 static void matrix_updater_callback ( void )
464 {
465  if (!in_the_matrix)
466  return; // should not happen, but ... (and can be a race condition with toggle function anyway!)
467  write_char_raw(current_x, current_y, ' ', current_colour); // delete cursor
468  const int saved_x = current_x, saved_y = current_y;
469  current_x = 0;
470  current_y = 1;
471  static const char rotator[4] = { '-', '\\', '|', '/' };
472  static Uint32 counter = 0;
473  dump_regs(rotator[(counter >> 3) & 3]);
474  current_x = saved_x;
475  current_y = saved_y;
476  if (queued_input) {
477  DEBUGMATRIX("MATRIX-INPUT: [%c] (%d)" NL, queued_input >= 32 ? queued_input : ' ', queued_input);
478  input(queued_input);
479  queued_input = 0;
480  } else if (current_x == 0)
481  input(0); // just to have some prompt by default
482  if (counter & 8)
483  write_char_raw(current_x, current_y, CURSOR_CHAR, CURSOR_COLOUR); // show cursor (gated with some bit of the "counter" to have blinking)
484  counter++;
485  matrix_update();
486 }
487 
488 // TODO+FIXME: though the theory to hijack keyboard input looks nice, we have some problems:
489 // * hotkeys does not work anymore
490 // * if in mouse grab mode, you don't even have your mouse to be able to close window, AND/OR use the menu system
491 
492 
493 // Async stuff as callbacks. Only updates "queued_input"
494 
495 static int kbd_cb_keyevent ( SDL_KeyboardEvent *ev )
496 {
497  if (ev->state == SDL_PRESSED && ev->keysym.sym > 0 && ev->keysym.sym < 32 && !queued_input) {
498  // Monitor alt-tab, as the main handler is defunct at this point, we "hijacked" it!
499  // So we must give up the matrix mode themselves here
500  if (ev->keysym.sym == 9 && (ev->keysym.mod & KMOD_RALT))
502  else
503  queued_input = ev->keysym.sym;
504  }
505  return 0; // do NOT execute further handlers!
506 }
507 
508 
509 static int kbd_cb_textevent ( SDL_TextInputEvent *ev )
510 {
511  const uint8_t c = ev->text[0];
512  if (c >= 32 && c < 128 && !queued_input)
513  queued_input = c;
514  return 0; // do NOT execute further handlers!
515 }
516 
517 
519 {
520  status = !!status;
521  if (status == !!in_the_matrix)
522  return;
524  static int saved_allow_mouse_grab;
525  if (in_the_matrix) {
526  D6XX_registers[0x72] |= 0x40; // be sure we're sync with the matrix bit!
527  osd_hijack(matrix_updater_callback, &backend_xsize, &backend_ysize, &backend_pixels);
528  if (!init_done) {
529  init_done = 1;
530  for (int i = 0; i < sizeof(console_colours) / 4; i++)
531  colour_mappings[i] = SDL_MapRGBA(sdl_pix_fmt, console_colours[i * 4], console_colours[i * 4 + 1], console_colours[i * 4 + 2], console_colours[i * 4 + 3]);
532  chrscreen_xsize = backend_xsize / 8;
533  chrscreen_ysize = backend_ysize / 8;
534  vmem = xemu_malloc(chrscreen_xsize * chrscreen_ysize * 2);
535  current_colour = NORMAL_COLOUR;
536  matrix_clear();
537  current_colour = BANNER_COLOUR;
538  static const char banner_msg[] = "*** Xemu's pre-matrix ... press right-ALT + TAB to exit ***";
539  current_x = (chrscreen_xsize - strlen(banner_msg)) >> 1;
540  matrix_write_string(banner_msg);
541  current_colour = NORMAL_COLOUR;
542  current_y = CLI_START_LINE;
543  current_x = 0;
544  reserve_top_lines = CLI_START_LINE;
545  matrix_write_string("INFO: Remember, there is no spoon.\nINFO: Hot-keys do not work in matrix mode!\nINFO: Matrix mode bypasses emulation keyboard mappings.\n");
546  }
547  need_update = 2;
548  matrix_update();
549  DEBUGPRINT("MATRIX: ON (%dx%d OSD texture pixels, %dx%d character resolution)" NL,
550  backend_xsize, backend_ysize, chrscreen_xsize, chrscreen_ysize
551  );
552  // "hijack" input for ourselves ...
555  queued_input = 0;
556  // give up mouse grab if matrix mode is selected, since in matrix mode no hotkeys works,
557  // thus user would also lose the chance to use the mouse at least to close, access menu, whatever ...
558  if (is_mouse_grab()) {
559  if (!current_x) // skip warning in this case, since probably command line editing is in effect thus we would break that ...
560  matrix_write_string("WARN: mouse grab/emu is released for matrix mode\n");
561  set_mouse_grab(SDL_FALSE, 0);
562  }
563  saved_allow_mouse_grab = allow_mouse_grab;
564  allow_mouse_grab = 0;
565  } else {
566  D6XX_registers[0x72] &= ~0x40; // be sure we're sync with the matrix bit!
567  osd_hijack(NULL, NULL, NULL, NULL);
568  DEBUGPRINT("MATRIX: OFF" NL);
569  // release our custom console events
572  allow_mouse_grab = saved_allow_mouse_grab;
573  }
574  clear_emu_events(); // cure problems, that triggering/switching-on/off matrix screen cause that ALT key remains latched etc ...
575 }
BANNER_COLOUR
#define BANNER_COLOUR
Definition: matrix_mode.c:61
TARGET_DESC
#define TARGET_DESC
Definition: xemu-target.h:2
vic4.h
CPU65_PF_E
#define CPU65_PF_E
Definition: cpu65.h:25
HID_CB_LEVEL_CONSOLE
#define HID_CB_LEVEL_CONSOLE
Definition: emutools_hid.h:72
emutools.h
NORMAL_COLOUR
#define NORMAL_COLOUR
Definition: matrix_mode.c:60
DEBUGMATRIX
#define DEBUGMATRIX(...)
Definition: matrix_mode.c:36
CPU65_PF_Z
#define CPU65_PF_Z
Definition: cpu65.h:29
CURSOR_CHAR
#define CURSOR_CHAR
Definition: matrix_mode.c:57
CLI_START_LINE
#define CLI_START_LINE
Definition: matrix_mode.c:59
vmem
Uint8 * vmem
Definition: tvc.c:52
CPU65_PF_D
#define CPU65_PF_D
Definition: cpu65.h:27
is_mouse_grab
SDL_bool is_mouse_grab(void)
Definition: emutools.c:145
io_mapper.h
addr
int addr
Definition: dma65.c:81
sdl_pix_fmt
SDL_PixelFormat * sdl_pix_fmt
Definition: emutools.c:80
set_mouse_grab
int set_mouse_grab(SDL_bool state, int force_allow)
Definition: emutools.c:131
XEMU_BUILDINFO_GIT
const char XEMU_BUILDINFO_GIT[]
Definition: emutools_basicdefs.h:251
cpu65_write_callback
void cpu65_write_callback(Uint16 addr, Uint8 data)
Definition: commodore_65.c:723
matrix_mode.h
memory_debug_read_phys_addr
Uint8 memory_debug_read_phys_addr(int addr)
Definition: memory_mapper.c:954
m65-memcontent-generator.data
data
Definition: m65-memcontent-generator.py:119
mega65.h
Uint32
uint32_t Uint32
Definition: fat32.c:49
vga_font_8x8
const Uint8 vga_font_8x8[2048]
xemu_get_uname_string
const char * xemu_get_uname_string(void)
Definition: emutools.c:468
Uint8
uint8_t Uint8
Definition: fat32.c:51
CPU65_PF_C
#define CPU65_PF_C
Definition: cpu65.h:30
cpu_clock_speed_string
const char * cpu_clock_speed_string
Definition: mega65.c:75
XEMU_BUILDINFO_CC
const char XEMU_BUILDINFO_CC[]
Definition: emutools_basicdefs.h:251
xemu_malloc
void * xemu_malloc(size_t size)
Definition: emutools.c:226
x
int x
Definition: console.c:27
DEBUGPRINT
#define DEBUGPRINT(...)
Definition: emutools_basicdefs.h:171
allow_mouse_grab
int allow_mouse_grab
Definition: emutools.c:118
memory_mapper.h
in_the_matrix
int in_the_matrix
Definition: matrix_mode.c:39
matrix_mode_toggle
void matrix_mode_toggle(int status)
Definition: matrix_mode.c:518
XEMU_LIKELY
#define XEMU_LIKELY(__x__)
Definition: emutools_basicdefs.h:124
MATRIX
#define MATRIX(...)
Definition: matrix_mode.c:51
videostd_id
Uint8 videostd_id
Definition: vic4.c:82
hid_register_sdl_textinput_event_callback
void hid_register_sdl_textinput_event_callback(const unsigned int level, hid_sdl_textinput_event_callback_t cb)
Definition: emutools_hid.c:631
NL
#define NL
Definition: fat32.c:37
CPU65_PF_V
#define CPU65_PF_V
Definition: cpu65.h:24
CPU65_PF_I
#define CPU65_PF_I
Definition: cpu65.h:28
hypervisor.h
rom.h
cpu65.h
cpu65_read_callback
Uint8 cpu65_read_callback(Uint16 addr)
Definition: commodore_65.c:711
XEMU_BUILDINFO_CDATE
const char XEMU_BUILDINFO_CDATE[]
Definition: emutools_basicdefs.h:251
CURSOR_COLOUR
#define CURSOR_COLOUR
Definition: matrix_mode.c:58
clear_emu_events
void clear_emu_events(void)
Definition: commodore_65.c:193
D6XX_registers
Uint8 D6XX_registers[0x100]
Definition: io_mapper.c:38
status
enum @26::@29 status
osd_hijack
void osd_hijack(void(*updater)(void), int *xsize_ptr, int *ysize_ptr, Uint32 **pixel_ptr)
Definition: osd.c:234
vic_iomode
int vic_iomode
Definition: vic4.c:44
cpu65_get_pf
Uint8 cpu65_get_pf(void)
Definition: cpu65.c:331
XEMU_BUILDINFO_ON
const char XEMU_BUILDINFO_ON[]
memory_debug_write_phys_addr
void memory_debug_write_phys_addr(int addr, Uint8 data)
Definition: memory_mapper.c:960
in_hypervisor
int in_hypervisor
Definition: hypervisor.c:40
y
int y
Definition: console.c:27
Uint16
uint16_t Uint16
Definition: fat32.c:50
emutools_hid.h
osd_texture_update
void osd_texture_update(const SDL_Rect *rect)
Definition: osd.c:87
hid_register_sdl_keyboard_event_callback
void hid_register_sdl_keyboard_event_callback(const unsigned int level, hid_sdl_keyboard_event_callback_t cb)
Definition: emutools_hid.c:621
XEMU_BUILDINFO_AT
const char XEMU_BUILDINFO_AT[]
Definition: emutools_basicdefs.h:251
CPU65_PF_N
#define CPU65_PF_N
Definition: cpu65.h:23
XEMU_UNLIKELY
#define XEMU_UNLIKELY(__x__)
Definition: emutools_basicdefs.h:125