Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
cpu.c
Go to the documentation of this file.
1 /* Minimalistic Enterprise-128 emulator with focus on "exotic" hardware
2  Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu
3  Copyright (C)2015-2016,2020-2021 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 "xemu/emutools_hid.h"
22 #include "enterprise128.h"
23 #include "cpu.h"
24 #include "apu.h"
25 #include "z180.h"
26 #include "dave.h"
27 #include "nick.h"
28 #include "rtc.h"
29 #include "printer.h"
30 #include "zxemu.h"
31 #include "primoemu.h"
32 #include "epnet.h"
33 #include "roms.h"
34 #include "input_devices.h"
35 #include "emu_rom_interface.h"
36 #include "sdext.h"
37 #include "exdos_wd.h"
38 #include <time.h>
39 
41 static int memsegs[4] VARALIGN;
42 Uint8 memory[0x400000] VARALIGN;
43 Uint8 ports[0x100] VARALIGN;
44 const char *memory_segment_map[0x100];
45 static Uint8 is_ram_seg[0x100] VARALIGN;
46 static int mem_ws_all, mem_ws_m1;
47 int nmi_pending = 0;
49 
50 
51 const char ROM_SEGMENT[] = "ROM";
52 const char XEPROM_SEGMENT[] = "XEPROM";
53 const char RAM_SEGMENT[] = "RAM";
54 const char VRAM_SEGMENT[] = "VRAM";
55 const char SRAM_SEGMENT[] = "SRAM";
56 const char UNUSED_SEGMENT[] = "unused";
57 
58 char *mem_desc = NULL;
59 
60 
61 // TODO: this should be written ... it's called when VRAM access, or $80...$8F I/O ports are accessed
62 #define nick_clock_align()
63 
64 
65 
66 void xep_rom_write_support ( int towrite )
67 {
68  if (xep_rom_seg > 0) {
69  is_ram_seg[xep_rom_seg] = towrite;
70  }
71 }
72 
73 
74 void set_ep_cpu ( int type )
75 {
76 #ifdef CONFIG_Z180
77  z80ex.internal_int_disable = 0;
78 #endif
79  switch (type) {
80  case CPU_Z80:
81  z80ex.nmos = 1;
82 #ifdef CONFIG_Z180
83  z80ex.z180 = 0;
84 #endif
85  break;
86  case CPU_Z80C:
87  z80ex.nmos = 0;
88 #ifdef CONFIG_Z180
89  z80ex.z180 = 0;
90 #endif
91  break;
92 #ifdef CONFIG_Z180
93  case CPU_Z180:
94  z80ex.nmos = 0;
95  z80ex.z180 = 1;
96  z180_port_start = 0;
97  break;
98 #endif
99  default:
100  FATAL("FATAL: Unknown CPU type was requested: %d", type);
101  break;
102  }
103  DEBUG("CPU: set to %s %s" NL,
104 #ifdef CONFIG_Z180
105  z80ex.z180 ? "Z180" : "Z80",
106 #else
107  "Z80",
108 #endif
109  z80ex.nmos ? "NMOS" : "CMOS"
110  );
111 }
112 
113 
114 
115 static inline void add_ram_segs ( int seg, int seg_end, const char *type )
116 {
117  while (seg <= seg_end) {
119  memory_segment_map[seg] = type;
120  if (type == SRAM_SEGMENT)
122  } else
123  DEBUGPRINT("CONFIG: RAM: segment %02Xh cannot be defined as %s since it's already %s" NL, seg, type, memory_segment_map[seg]);
124  seg++;
125  }
126 }
127 
128 
129 
130 
131 int ep_set_ram_config ( const char *spec )
132 {
133  int a;
134  for (a = 0; a < 0xFC; a++) {
135  if (memory_segment_map[a] == SRAM_SEGMENT) {
136  sram_save_segment(a); // that is, we *HAD* configured SRAM before, so save it, before drop it ...
138  }
142  memset(memory + (a << 14), 0xFF, 0x4000);
143  }
144  if (*spec == '@') { // segment list format is requested ...
145  while (spec && *spec) {
146  int sb, se;
147  const char *type;
148  spec++;
149  if (*spec == '=') {
150  type = SRAM_SEGMENT;
151  spec++;
152  } else
153  type = RAM_SEGMENT;
154  switch (sscanf(spec, "%x-%x,", &sb, &se)) {
155  case 1:
156  DEBUG("CONFIG: RAM: requesting single segment %02Xh as %s" NL, sb, type);
157  if (sb >= 0 && sb < 0x100)
158  add_ram_segs(sb, sb, type);
159  else
160  DEBUGPRINT("CONFIG: RAM: WARNING: ignoring bad single %s segment definition %02X" NL, type, sb);
161  break;
162  case 2:
163  DEBUG("CONFIG: RAM: requesting segment range %02Xh-%02Xh as %s" NL, sb, se, type);
164  if (se >= sb && sb >= 0 && se < 0x100)
165  add_ram_segs(sb, se, type);
166  else
167  DEBUGPRINT("CONFIG: RAM: WARNING: ignoring bad %s segment range definition %02X-%02X" NL, type, sb, se);
168  break;
169  }
170  spec = strchr(spec, ',');
171  }
172  } else {
173  int es = (atoi(spec) - 64) >> 4;
174  if (es < 0)
175  es = 0;
176  else if (es > 252)
177  es = 252;
178  DEBUG("CONFIG: RAM: requesting simple memory range as RAM for %d segments" NL, es);
179  if (es)
180  add_ram_segs(0xFC - es, 0xFB, RAM_SEGMENT);
181  }
182  return ep_init_ram();
183 }
184 
185 
186 void ep_clear_ram ( void )
187 {
188  for (int a = 0; a < 0x100; a++)
190  memset(memory + (a << 14), 0xFF, 0x4000);
191 }
192 
193 
194 int ep_init_ram ( void )
195 {
196  int a, sum = 0, from = 0;
197  const char *type = NULL;
198  char dbuf[PATH_MAX + 80];
199  if (mem_desc)
200  *mem_desc = '\0';
201  for (a = 0; a < 0x100; a++) {
202  int is_sram = (memory_segment_map[a] == SRAM_SEGMENT);
203  is_ram_seg[a] = (memory_segment_map[a] == RAM_SEGMENT || memory_segment_map[a] == VRAM_SEGMENT || is_sram);
204  if (is_ram_seg[a]) {
205  if (!is_sram)
206  memset(memory + (a << 14), 0xFF, 0x4000);
207  sum++;
208  }
209  if (a == 0xFF || type != memory_segment_map[a] || rom_name_tab[a]) {
210  if (type) {
211  const char *name = rom_name_tab[from];
212  int s = (a == 0xFF) ? a : a - 1;
213  if (memory_segment_map[from] == ROM_SEGMENT && !name)
214  name = "(last ROM continues)";
215  snprintf(dbuf, sizeof dbuf, "%02X-%02X %s %s", from, s, type, name ? name : "");
216  DEBUGPRINT("CONFIG: MEM: %s" NL, dbuf);
217  strcat(dbuf, "\n");
218  s = mem_desc ? strlen(mem_desc) : 0;
219  mem_desc = xemu_realloc(mem_desc, s + strlen(dbuf) + 256);
220  if (!s)
221  *mem_desc = '\0';
222  strcat(mem_desc, dbuf);
223  }
224  type = memory_segment_map[a];
225  from = a;
226  }
227  }
228  snprintf(dbuf, sizeof dbuf, "RAM: %d segments (%d Kbytes)", sum, sum << 4);
229  strcat(mem_desc, dbuf);
230  DEBUGPRINT("CONFIG: MEM: found %s" NL, dbuf);
231 #ifdef CONFIG_SDEXT_SUPPORT
232  sdext_clear_ram();
233 #endif
234  return sum;
235 }
236 
237 
238 
239 
241  register int phys = memsegs[addr >> 14] + addr;
242  //DEBUG("M1 state at PC=%04Xh Phys=%08Xh seg=%02Xh" NL, addr, phys, ports[0xB0 | (addr >> 14)]);
243  if (phys >= 0x3F0000) { // VRAM access, no "$BF port" wait states ever, BUT TODO: Nick CPU clock strechting ...
245  return memory[phys];
246  }
247  if (mem_ws_all || (m1_state && mem_ws_m1))
249 #ifdef CONFIG_SDEXT_SUPPORT
250  if ((phys & 0x3F0000) == sdext_cart_enabler)
251  return sdext_read_cart(phys & 0xFFFF);
252  else
253 #endif
254  return memory[phys];
255 }
256 
257 
259 {
260  return memory[memsegs[addr >> 14] + addr];
261 }
262 
263 
265 {
266  return memory[(segmap[addr >> 14] << 14) | (addr & 0x3FFF)];
267 }
268 
269 
271 {
272  int seg = segmap[addr >> 14];
273  if (is_ram_seg[seg])
274  memory[(seg << 14) | (addr & 0x3FFF)] = data;
275 }
276 
277 
279  register int phys = memsegs[addr >> 14] + addr;
280  if (phys >= 0x3F0000) { // VRAM access, no "$BF port" wait states ever, BUT TODO: Nick CPU clock strechting ...
282  memory[phys] = value;
283  if (zxemu_on && phys >= 0x3f9800 && phys <= 0x3f9aff)
284  zxemu_attribute_memory_write(phys & 0xFFFF, value);
285  return;
286  }
287  if (mem_ws_all)
289  //if (phys >= ram_start)
290  if (is_ram_seg[phys >> 14])
291  memory[phys] = value;
292 #ifdef CONFIG_SDEXT_SUPPORT
293  else if ((phys & 0x3F0000) == sdext_cart_enabler)
294  sdext_write_cart(phys & 0xFFFF, value);
295 #endif
296  else
297  DEBUG("WRITE to NON-decoded memory area %08X" NL, phys);
298 }
299 
300 
301 
303  Uint8 port;
304 #ifdef CONFIG_Z180
305  if (z80ex.z180 && (port16 & 0xFFC0) == z180_port_start) {
306  if (z180_port_start == 0x80)
307  FATAL("FATAL: Z180 internal ports configured from 0x80. This conflicts with Dave/Nick, so EP is surely unusable.");
308  return z180_port_read(port16 & 0x3F);
309  }
310 #endif
311  port = port16 & 0xFF;
312  if (port < primo_on)
313  return primo_read_io(port);
314  switch (port) {
315 #ifdef CONFIG_EPNET_SUPPORT
316  case EPNET_IO_BASE + 0x0:
317  case EPNET_IO_BASE + 0x1:
318  case EPNET_IO_BASE + 0x2:
319  case EPNET_IO_BASE + 0x3:
320  case EPNET_IO_BASE + 0x4:
321  case EPNET_IO_BASE + 0x5:
322  case EPNET_IO_BASE + 0x6:
323  case EPNET_IO_BASE + 0x7:
324  return epnet_read_cpu_port(port - EPNET_IO_BASE);
325  case EPNET_IO_BASE + 0x8:
326  case EPNET_IO_BASE + 0x9:
327  case EPNET_IO_BASE + 0xA:
328  case EPNET_IO_BASE + 0xB:
329  case EPNET_IO_BASE + 0xC:
330  case EPNET_IO_BASE + 0xD:
331  case EPNET_IO_BASE + 0xE:
332  case EPNET_IO_BASE + 0xF:
333  // return epnet_cf_read_cpu_port(port - EPNET_IO_BASE - 8);
334  return 0xFF;
335 #endif
336  /* EXDOS/WD registers */
337 #ifdef CONFIG_EXDOS_SUPPORT
338  case 0x10:
339  case 0x14:
340  return wd_read_status();
341  case 0x11:
342  case 0x15:
343  return wd_track;
344  case 0x12:
345  case 0x16:
346  return wd_sector;
347  case 0x13:
348  case 0x17:
349  return wd_read_data();
350  case 0x18: case 0x19: case 0x1A: case 0x1B: case 0x1C: case 0x1D: case 0x1E: case 0x1F:
351  return wd_read_exdos_status();
352 #else
353  case 0x10: case 0x14: case 0x11: case 0x15: case 0x12: case 0x16: case 0x13: case 0x17:
354  case 0x18: case 0x19: case 0x1A: case 0x1B: case 0x1C: case 0x1D: case 0x1E: case 0x1F:
355  DEBUG("EXDOS: not compiled with support, port read %02X" NL, port);
356  return 0xFF;
357 #endif
358  /* ZX Spectrum emulator */
359  case 0x40: case 0x41: case 0x42: case 0x43: case 0x44:
360  DEBUG("ZXEMU: reading port %02Xh" NL, port);
361  return ports[port];
362 
363  case 0x50:
364  return apu_read_data();
365  case 0x51:
366  return apu_read_status();
367 
368  /* RTC registers */
369  case 0x7F:
370  return rtc_read_reg();
371  /* NICK registers */
372  case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87:
373  case 0x88: case 0x89: case 0x8A: case 0x8B: case 0x8C: case 0x8D: case 0x8E: case 0x8F:
375  return nick_get_last_byte();
376  /* DAVE registers */
377  case 0xB0: case 0xB1: case 0xB2: case 0xB3:
378  return ports[port];
379  case 0xB4:
380  return dave_int_read;
381  case 0xB5:
382  return (kbd_selector == -1) ? 0xFF : kbd_matrix[kbd_selector];
383  case 0xB6:
384  return read_control_port_bits() | PORT_B6_READ_OTHERS; // used for control ports (joystick/mouse) but also some misc features as input (tape in, printer status in, serial in)
385  case 0xFE:
386  return zxemu_read_ula(IO16_HI_BYTE(port16));
387  }
388  DEBUGPRINT("IO: READ: unhandled port %02Xh read" NL, port);
389  return 0xFF;
390  //return ports[port];
391 }
392 
393 
394 
395 
397  //Z80EX_BYTE old_value;
398  Uint8 port;
399 #ifdef CONFIG_Z180
400  if (z80ex.z180 && (port16 & 0xFFC0) == z180_port_start) {
401  if (z180_port_start == 0x80)
402  FATAL("FATAL: Z180 internal ports configured from 0x80. This conflicts with Dave/Nick, so EP is surely unusable.");
403  z180_port_write(port16 & 0x3F, value);
404  return;
405  }
406 #endif
407  port = port16 & 0xFF;
408  if (port < primo_on)
409  return primo_write_io(port, value);
410  //old_value = ports[port];
411  ports[port] = value;
412  //DEBUG("IO: WRITE: OUT (%02Xh),%02Xh" NL, port, value);
413  switch (port) {
414 #ifdef CONFIG_EPNET_SUPPORT
415  case EPNET_IO_BASE + 0x0:
416  case EPNET_IO_BASE + 0x1:
417  case EPNET_IO_BASE + 0x2:
418  case EPNET_IO_BASE + 0x3:
419  case EPNET_IO_BASE + 0x4:
420  case EPNET_IO_BASE + 0x5:
421  case EPNET_IO_BASE + 0x6:
422  case EPNET_IO_BASE + 0x7:
423  epnet_write_cpu_port(port - EPNET_IO_BASE, value);
424  break;
425  case EPNET_IO_BASE + 0x8:
426  case EPNET_IO_BASE + 0x9:
427  case EPNET_IO_BASE + 0xA:
428  case EPNET_IO_BASE + 0xB:
429  case EPNET_IO_BASE + 0xC:
430  case EPNET_IO_BASE + 0xD:
431  case EPNET_IO_BASE + 0xE:
432  case EPNET_IO_BASE + 0xF:
433  //epnet_cf_write_cpu_port(port - EPNET_IO_BASE - 8, value);
434  break;
435 #endif
436  /* EXDOS/WD registers */
437 #ifdef CONFIG_EXDOS_SUPPORT
438  case 0x10:
439  case 0x14:
441  break;
442  case 0x11:
443  case 0x15:
444  wd_track = value;
445  break;
446  case 0x12:
447  case 0x16:
448  wd_sector = value;
449  break;
450  case 0x13:
451  case 0x17:
453  break;
454  case 0x18: case 0x19: case 0x1A: case 0x1B: case 0x1C: case 0x1D: case 0x1E: case 0x1F:
456  break;
457 #else
458  case 0x10: case 0x14: case 0x11: case 0x15: case 0x12: case 0x16: case 0x13: case 0x17:
459  case 0x18: case 0x19: case 0x1A: case 0x1B: case 0x1C: case 0x1D: case 0x1E: case 0x1F:
460  DEBUG("EXDOS: not compiled with support, port write %02X with value %02X" NL, port, value);
461  break;
462 #endif
463  case 0x32:
464  case 0x3F:
465  DEBUG("Z180: ignored <no Z180 emulation is active> for writing port = %02Xh, data = %02Xh." NL, port, value);
466  break;
467 
468  case 0x44:
470  break;
471  case 0x45:
473  break;
474 
475  case 0x50:
477  break;
478  case 0x51:
480  break;
481 
482  /* RTC registers */
483  case 0x7E:
485  break;
486  case 0x7F:
488  break;
489 
490  /* DAVE audio etc related registers */
491  case 0xA0: case 0xA1: case 0xA2: case 0xA3: case 0xA4: case 0xA5: case 0xA6: case 0xA7:
492  case 0xA8: case 0xA9: case 0xAA: case 0xAB: case 0xAC: case 0xAD: case 0xAE: case 0xAF:
494  break;
495 
496  /* DAVE registers */
497  case 0xB0:
498  memsegs[0] = value << 14;
499  break;
500  case 0xB1:
501  memsegs[1] = (value << 14) - 0x4000;
502  break;
503  case 0xB2:
504  memsegs[2] = (value << 14) - 0x8000;
505  break;
506  case 0xB3:
507  memsegs[3] = (value << 14) - 0xC000;
508  break;
509  case 0xB4:
511  break;
512  case 0xB5:
513  kbd_selector = ((value & 15) < 10) ? (value & 15) : -1;
514  /*if ((old_value & 16) != (value & 16))
515  DEBUG("PRINTER STROBE: %d -> %d" NL, old_value & 16, value & 16);*/
516  //if ((old_value & 16) && (!(value & 16)))
518  // printer_send_data(ports[0xB6]);
519  //printer_port_strobe((old_value & 16) != (value & 16)); // storbe event
520  break;
521  case 0xB6:
522  // DEBUG("PRINTER DATA: %d" NL, value);
524  break;
525  case 0xB7:
527  break;
528  case 0xBF:
529  // Note: 16K/64K RAM config is not implemented!
530  value &= 0xC;
531  if (value == 0) {
532  mem_ws_all = 1;
533  mem_ws_m1 = 0;
534  } else if (value == 4) {
535  mem_ws_all = 0;
536  mem_ws_m1 = 1;
537  } else {
538  mem_ws_all = 0;
539  mem_ws_m1 = 0;
540  }
541  dave_set_clock();
542  DEBUG("DAVE: BF register is written -> W_ALL=%d W_M1=%d CLOCK=%dMHz" NL, mem_ws_all, mem_ws_m1, (value & 2) ? 12 : 8);
543  break;
544  /* NICK registers */
545  case 0x80: case 0x84: case 0x88: case 0x8C:
548  break;
549  case 0x81: case 0x85: case 0x89: case 0x8D:
552  break;
553  case 0x82: case 0x86: case 0x8A: case 0x8E:
556  break;
557  case 0x83: case 0x87: case 0x8B: case 0x8F:
560  break;
561  /* DTM DAC 4 channel */
562  case 0xF0: case 0xF1: case 0xF2: case 0xF3:
563  printer_disable_covox(); // disable COVOX mode, if any
565  break;
566  /* ZXemu card */
567  case 0xFE:
569  break;
570  default:
571  DEBUGPRINT("IO: WRITE: unhandled port %02Xh write with data %02Xh" NL, port, value);
572  break;
573  }
574 }
575 
576 
578  return 0xFF; // hmmm.
579 }
580 
581 
582 void z80ex_reti_cb ( void ) {
583 }
584 
585 
587 {
588  if (Z80_PC >= 0xC000 && ports[0xB3] == xep_rom_seg) {
589  xep_rom_trap(Z80_PC, opcode);
590  return 1; // handled in XEP
591  }
592  return 0; // unhandled ED op!
593 }
594 
595 
596 
597 void z80_reset ( void )
598 {
599  memset(ports, 0xFF, 0x100);
600  ports[0xB5] = 0; // for printer strobe signal not to trigger output a character on reset or so?
601  //set_ep_cpu(CPU_Z80);
602  z80ex_reset();
603 #ifdef CONFIG_Z180
604  z180_internal_reset();
605 #endif
606  Z80_AF = rand() & 0xFFFF;
607  Z80_BC = rand() & 0xFFFF;
608  Z80_DE = rand() & 0xFFFF;
609  Z80_HL = rand() & 0xFFFF;
610  Z80_IX = rand() & 0xFFFF;
611  Z80_IY = rand() & 0xFFFF;
612  Z80_SP = rand() & 0xFFFF;
613  Z80_AF_ = rand() & 0xFFFF;
614  Z80_BC_ = rand() & 0xFFFF;
615  Z80_DE_ = rand() & 0xFFFF;
616  Z80_HL_ = rand() & 0xFFFF;
617  DEBUG("Z80: reset" NL);
618 }
619 
620 
621 void ep_reset ( void )
622 {
623  if (primo_on)
625  z80_reset();
626  dave_reset();
627  rtc_reset();
628  mouse_reset();
629  apu_reset();
630 #ifdef CONFIG_EXDOS_SUPPORT
631  wd_exdos_reset();
632 #endif
633  primo_switch(0);
634  nmi_pending = 0;
635 }
sram_save_segment
int sram_save_segment(int seg)
Definition: roms.c:73
Z80_DE
#define Z80_DE
Definition: z80ex.h:85
Z80_AF
#define Z80_AF
Definition: z80ex.h:77
z80ex_ed_cb
int z80ex_ed_cb(Z80EX_BYTE opcode)
Definition: cpu.c:586
Z80_AF_
#define Z80_AF_
Definition: z80ex.h:93
zxemu.h
read_control_port_bits
Uint8 read_control_port_bits(void)
Definition: input_devices.c:416
rom_name_tab
const char * rom_name_tab[0x100]
Definition: roms.c:36
zxemu_write_ula
void zxemu_write_ula(Uint8 hiaddr, Uint8 data)
Definition: zxemu.c:52
xep_rom_seg
int xep_rom_seg
Definition: roms.c:33
kbd_selector
int kbd_selector
Definition: dave.c:35
nick_set_bias
void nick_set_bias(Uint8 value)
Definition: nick.c:171
sdext.h
ep_reset
void ep_reset(void)
Definition: cpu.c:621
UNUSED_SEGMENT
const char UNUSED_SEGMENT[]
Definition: cpu.c:56
wd_sector
Uint8 wd_sector
Definition: exdos_wd.c:44
read_cpu_byte
Uint8 read_cpu_byte(Uint16 addr)
Definition: cpu.c:258
z80ex_w_states
void z80ex_w_states(unsigned w_states)
Definition: z80ex.c:307
xep_rom_write_support
void xep_rom_write_support(int towrite)
Definition: cpu.c:66
_z80_cpu_context::nmos
int nmos
Definition: z80ex.h:175
printer_port_check_strobe
void printer_port_check_strobe(int level)
Definition: printer.c:117
primoemu.h
zxemu_attribute_memory_write
void zxemu_attribute_memory_write(Uint16 address, Uint8 data)
Definition: zxemu.c:78
z80_reset
void z80_reset(void)
Definition: cpu.c:597
emutools.h
z80ex_pwrite_cb
void z80ex_pwrite_cb(Z80EX_WORD port16, Z80EX_BYTE value)
Definition: cpu.c:396
nick_set_lpth
void nick_set_lpth(Uint8 value)
Definition: nick.c:190
Z80_SP
#define Z80_SP
Definition: z80ex.h:117
nick_set_border
void nick_set_border(Uint8 bcol)
Definition: nick.c:164
wd_exdos_reset
void wd_exdos_reset(void)
Definition: exdos_wd.c:163
apu_write_data
void apu_write_data(Uint8 data)
Definition: apu.c:113
seg
Uint8 seg
Definition: roms.c:41
wd_read_status
Uint8 wd_read_status(void)
Definition: exdos_wd.c:225
sram_load_segment
int sram_load_segment(int seg)
Definition: roms.c:80
zxemu_read_ula
Uint8 zxemu_read_ula(Uint8 hiaddr)
Definition: zxemu.c:64
Z80_HL_
#define Z80_HL_
Definition: z80ex.h:105
z80ex_mwrite_cb
void z80ex_mwrite_cb(Z80EX_WORD addr, Z80EX_BYTE value)
Definition: cpu.c:278
audio_source
int audio_source
Definition: dave.c:40
Z80_HL
#define Z80_HL
Definition: z80ex.h:89
set_ep_cpu
void set_ep_cpu(int type)
Definition: cpu.c:74
zxemu_on
int zxemu_on
Definition: zxemu.c:27
z80ex_pread_cb
Z80EX_BYTE z80ex_pread_cb(Z80EX_WORD port16)
Definition: cpu.c:302
primo_emulator_exit
void primo_emulator_exit(void)
Definition: primoemu.c:192
emu_rom_interface.h
addr
int addr
Definition: dma65.c:81
rtc_read_reg
Uint8 rtc_read_reg(void)
Definition: rtc.c:110
DEFAULT_CPU_CLOCK
#define DEFAULT_CPU_CLOCK
Definition: enterprise128.h:34
rtc_reset
void rtc_reset(void)
Definition: rtc.c:96
ep_init_ram
int ep_init_ram(void)
Definition: cpu.c:194
Z80_IY
#define Z80_IY
Definition: z80ex.h:113
CONFIG_Z180
#define CONFIG_Z180
Definition: xemu-target.h:3
m65-memcontent-generator.data
data
Definition: m65-memcontent-generator.py:119
Z80EX_WORD
unsigned short Z80EX_WORD
Definition: z80ex.h:51
z80ex_reset
void z80ex_reset(void)
Definition: z80ex.c:156
mem_desc
char * mem_desc
Definition: cpu.c:58
apu_read_data
Uint8 apu_read_data()
Definition: apu.c:99
Uint8
uint8_t Uint8
Definition: fat32.c:51
epnet.h
SRAM_SEGMENT
const char SRAM_SEGMENT[]
Definition: cpu.c:55
_z80_cpu_context
Definition: z80ex.h:143
dave_configure_interrupts
void dave_configure_interrupts(Uint8 n)
Definition: dave.c:332
write_cpu_byte_by_segmap
void write_cpu_byte_by_segmap(Uint16 addr, Uint8 *segmap, Uint8 data)
Definition: cpu.c:270
nick_set_lptl
void nick_set_lptl(Uint8 value)
Definition: nick.c:183
wd_send_command
void wd_send_command(Uint8 value)
Definition: exdos_wd.c:252
VARALIGN
Z80EX_CONTEXT z80ex VARALIGN
Definition: cpu.c:40
CPU_Z180
#define CPU_Z180
Definition: cpu.h:26
memory_segment_map
const char * memory_segment_map[0x100]
Definition: cpu.c:44
DEBUGPRINT
#define DEBUGPRINT(...)
Definition: emutools_basicdefs.h:171
XEPROM_SEGMENT
const char XEPROM_SEGMENT[]
Definition: cpu.c:52
roms.h
apu.h
wd_write_data
void wd_write_data(Uint8 value)
Definition: exdos_wd.c:318
printer.h
CPU_Z80
#define CPU_Z80
Definition: cpu.h:24
dave_reset
void dave_reset(void)
Definition: dave.c:206
Z80EX_BYTE
unsigned char Z80EX_BYTE
Definition: z80ex.h:49
wd_track
Uint8 wd_track
Definition: exdos_wd.c:44
wd_set_exdos_control
void wd_set_exdos_control(Uint8 value)
Definition: exdos_wd.c:325
CPU_Z80C
#define CPU_Z80C
Definition: cpu.h:25
apu_reset
void apu_reset(void)
Definition: apu.c:66
Z80_BC_
#define Z80_BC_
Definition: z80ex.h:97
apu_write_command
void apu_write_command(Uint8 cmd)
Definition: apu.c:290
cpu.h
NL
#define NL
Definition: fat32.c:37
z180.h
memory
Uint8 memory[0x100000]
Definition: commodore_65.c:43
IO16_HI_BYTE
#define IO16_HI_BYTE(port16)
Definition: zxemu.h:22
VRAM_SEGMENT
const char VRAM_SEGMENT[]
Definition: cpu.c:54
dave.h
nick_clock_align
#define nick_clock_align()
Definition: cpu.c:62
printer_disable_covox
void printer_disable_covox(void)
Definition: printer.c:136
mouse_check_data_shift
void mouse_check_data_shift(Uint8 val)
Definition: input_devices.c:463
Z80_DE_
#define Z80_DE_
Definition: z80ex.h:101
Z80_BC
#define Z80_BC
Definition: z80ex.h:81
CPU_CLOCK
int CPU_CLOCK
Definition: cpu.c:48
input_devices.h
kbd_matrix
Uint8 kbd_matrix[16]
Definition: dave.c:30
z80ex_reti_cb
void z80ex_reti_cb(void)
Definition: cpu.c:582
dave_set_clock
void dave_set_clock(void)
Definition: dave.c:182
Z80_IX
#define Z80_IX
Definition: z80ex.h:109
dave_write_audio_register
void dave_write_audio_register(Uint8 port, Uint8 value)
Definition: dave.c:341
Z80_PC
#define Z80_PC
Definition: z80ex.h:121
primo_switch
void primo_switch(Uint8 data)
Definition: primoemu.c:110
AUDIO_SOURCE_DTM_DAC4
#define AUDIO_SOURCE_DTM_DAC4
Definition: dave.h:24
zxemu_switch
void zxemu_switch(Uint8 data)
Definition: zxemu.c:32
primo_read_io
Uint8 primo_read_io(Uint8 port)
Definition: primoemu.c:137
z80ex_intread_cb
Z80EX_BYTE z80ex_intread_cb(void)
Definition: cpu.c:577
mouse_reset
void mouse_reset(void)
Definition: input_devices.c:378
value
int value
Definition: dma65.c:90
Uint16
uint16_t Uint16
Definition: fat32.c:50
exdos_wd.h
emutools_hid.h
wd_read_exdos_status
Uint8 wd_read_exdos_status(void)
Definition: exdos_wd.c:245
read_cpu_byte_by_segmap
Uint8 read_cpu_byte_by_segmap(Uint16 addr, Uint8 *segmap)
Definition: cpu.c:264
rtc.h
xep_rom_trap
void xep_rom_trap(Uint16 pc, Uint8 opcode)
Definition: emu_rom_interface.c:195
printer_port_set_data
void printer_port_set_data(Uint8 data)
Definition: printer.c:74
name
const char * name
Definition: joystick.c:46
enterprise128.h
ep_clear_ram
void ep_clear_ram(void)
Definition: cpu.c:186
z80ex
Z80EX_CONTEXT z80ex
Definition: primo.c:37
DEBUG
#define DEBUG(...)
Definition: emutools_basicdefs.h:167
xemu_realloc
void * xemu_realloc(void *p, size_t size)
Definition: emutools.c:235
rtc_set_reg
void rtc_set_reg(Uint8 val)
Definition: rtc.c:34
mem_wait_states
int mem_wait_states
Definition: dave.c:37
z80ex_mread_cb
Z80EX_BYTE z80ex_mread_cb(Z80EX_WORD addr, int m1_state)
Definition: cpu.c:240
RAM_SEGMENT
const char RAM_SEGMENT[]
Definition: cpu.c:53
rtc_write_reg
void rtc_write_reg(Uint8 val)
Definition: rtc.c:41
FATAL
#define FATAL(...)
Definition: xep128.h:117
ep_set_ram_config
int ep_set_ram_config(const char *spec)
Definition: cpu.c:131
primo_write_io
void primo_write_io(Uint8 port, Uint8 data)
Definition: primoemu.c:149
primo_on
int primo_on
Definition: primoemu.c:30
ROM_SEGMENT
const char ROM_SEGMENT[]
Definition: cpu.c:51
apu_read_status
Uint8 apu_read_status(void)
Definition: apu.c:74
dave_int_read
Uint8 dave_int_read
Definition: dave.c:29
nick_get_last_byte
Uint8 nick_get_last_byte(void)
Definition: nick.c:157
nick.h
PORT_B6_READ_OTHERS
#define PORT_B6_READ_OTHERS
Definition: cpu.h:28
wd_read_data
Uint8 wd_read_data(void)
Definition: exdos_wd.c:233
nmi_pending
int nmi_pending
Definition: cpu.c:47