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