Skip to content

Instantly share code, notes, and snippets.

@uyjulian
Created March 31, 2018 05:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uyjulian/2081c3a569d98f8718371dedafc067f9 to your computer and use it in GitHub Desktop.
Save uyjulian/2081c3a569d98f8718371dedafc067f9 to your computer and use it in GitHub Desktop.
diff -burN uae/build68k.c bas/build68k.c
--- uae/build68k.c 1999-10-22 03:57:49.000000000 -0500
+++ bas/build68k.c 2017-09-06 06:37:51.000000000 -0500
@@ -6,14 +6,11 @@
* Copyright 1995,1996 Bernd Schmidt
*/
-#include "sysconfig.h"
-#include "sysdeps.h"
-
#include <assert.h>
#include <ctype.h>
+#include <stdio.h>
-#include "config.h"
-#include "options.h"
+#include "sysdeps.h"
#include "readcpu.h"
static FILE *tablef;
@@ -58,10 +55,7 @@
{
int no_insns = 0;
- printf ("#include \"sysconfig.h\"\n");
printf ("#include \"sysdeps.h\"\n");
- printf ("#include \"config.h\"\n");
- printf ("#include \"options.h\"\n");
printf ("#include \"readcpu.h\"\n");
printf ("struct instr_def defs68k[] = {\n");
#if 0
diff -burN uae/cpuopti.c bas/cpuopti.c
--- uae/cpuopti.c 1998-12-21 09:41:36.000000000 -0600
+++ bas/cpuopti.c 2017-09-04 20:34:16.000000000 -0500
@@ -7,11 +7,11 @@
* Copyright 1996 Bernd Schmidt
*/
-#include "sysconfig.h"
-#include "sysdeps.h"
#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
-#include "options.h"
+#include "sysdeps.h"
struct line {
struct line *next, *prev;
@@ -26,7 +26,7 @@
static void oops(void)
{
- fprintf(stderr, "Corrupted assembly file!\n");
+ fprintf(stderr, "Don't know how to optimize this file.\n");
abort();
}
@@ -80,6 +80,8 @@
l = f->last_line;
fl = f->first_line;
+ if (match(l,".LFE"))
+ l = l->prev;
if (!match(l,"ret"))
oops();
diff -burN uae/fpp.cpp bas/fpp.cpp
--- uae/fpp.cpp 1999-10-22 12:27:18.000000000 -0500
+++ bas/fpp.cpp 2017-09-09 14:21:08.000000000 -0500
@@ -7,18 +7,13 @@
*/
#include <math.h>
+#include <stdio.h>
-#include "sysconfig.h"
#include "sysdeps.h"
-#include "config.h"
-#include "options.h"
#include "memory.h"
-#include "custom.h"
#include "readcpu.h"
#include "newcpu.h"
-#include "ersatz.h"
-#include "md-fpp.h"
#if 1
@@ -32,6 +27,124 @@
/* E = MAX & F # 0 -> NotANumber */
/* E = biased by 127 (single) ,1023 (double) ,16383 (extended) */
+STATIC_INLINE double to_single (uae_u32 value)
+{
+ double frac;
+
+ if ((value & 0x7fffffff) == 0)
+ return (0.0);
+ frac = (double) ((value & 0x7fffff) | 0x800000) / 8388608.0;
+ if (value & 0x80000000)
+ frac = -frac;
+ return (ldexp (frac, ((value >> 23) & 0xff) - 127));
+}
+
+STATIC_INLINE uae_u32 from_single (double src)
+{
+ int expon;
+ uae_u32 tmp;
+ double frac;
+
+ if (src == 0.0)
+ return 0;
+ if (src < 0) {
+ tmp = 0x80000000;
+ src = -src;
+ } else {
+ tmp = 0;
+ }
+ frac = frexp (src, &expon);
+ frac += 0.5 / 16777216.0;
+ if (frac >= 1.0) {
+ frac /= 2.0;
+ expon++;
+ }
+ return (tmp | (((expon + 127 - 1) & 0xff) << 23) |
+ (((int) (frac * 16777216.0)) & 0x7fffff));
+}
+
+STATIC_INLINE double to_exten(uae_u32 wrd1, uae_u32 wrd2, uae_u32 wrd3)
+{
+ double frac;
+
+ if ((wrd1 & 0x7fff0000) == 0 && wrd2 == 0 && wrd3 == 0)
+ return 0.0;
+ frac = (double) wrd2 / 2147483648.0 +
+ (double) wrd3 / 9223372036854775808.0;
+ if (wrd1 & 0x80000000)
+ frac = -frac;
+ return ldexp (frac, ((wrd1 >> 16) & 0x7fff) - 16383);
+}
+
+STATIC_INLINE void from_exten(double src, uae_u32 * wrd1, uae_u32 * wrd2, uae_u32 * wrd3)
+{
+ int expon;
+ double frac;
+
+ if (src == 0.0) {
+ *wrd1 = 0;
+ *wrd2 = 0;
+ *wrd3 = 0;
+ return;
+ }
+ if (src < 0) {
+ *wrd1 = 0x80000000;
+ src = -src;
+ } else {
+ *wrd1 = 0;
+ }
+ frac = frexp (src, &expon);
+ frac += 0.5 / 18446744073709551616.0;
+ if (frac >= 1.0) {
+ frac /= 2.0;
+ expon++;
+ }
+ *wrd1 |= (((expon + 16383 - 1) & 0x7fff) << 16);
+ *wrd2 = (uae_u32) (frac * 4294967296.0);
+ *wrd3 = (uae_u32) (frac * 18446744073709551616.0 - *wrd2 * 4294967296.0);
+}
+
+STATIC_INLINE double to_double(uae_u32 wrd1, uae_u32 wrd2)
+{
+ double frac;
+
+ if ((wrd1 & 0x7fffffff) == 0 && wrd2 == 0)
+ return 0.0;
+ frac = (double) ((wrd1 & 0xfffff) | 0x100000) / 1048576.0 +
+ (double) wrd2 / 4503599627370496.0;
+ if (wrd1 & 0x80000000)
+ frac = -frac;
+ return ldexp (frac, ((wrd1 >> 20) & 0x7ff) - 1023);
+}
+
+STATIC_INLINE void from_double(double src, uae_u32 * wrd1, uae_u32 * wrd2)
+{
+ int expon;
+ int tmp;
+ double frac;
+
+ if (src == 0.0) {
+ *wrd1 = 0;
+ *wrd2 = 0;
+ return;
+ }
+ if (src < 0) {
+ *wrd1 = 0x80000000;
+ src = -src;
+ } else {
+ *wrd1 = 0;
+ }
+ frac = frexp (src, &expon);
+ frac += 0.5 / 9007199254740992.0;
+ if (frac >= 1.0) {
+ frac /= 2.0;
+ expon++;
+ }
+ tmp = (uae_u32) (frac * 2097152.0);
+ *wrd1 |= (((expon + 1023 - 1) & 0x7ff) << 20) | (tmp & 0xfffff);
+ *wrd2 = (uae_u32) (frac * 9007199254740992.0 - tmp * 4294967296.0);
+}
+
STATIC_INLINE double to_pack(uae_u32 wrd1, uae_u32 wrd2, uae_u32 wrd3)
{
double d;
@@ -996,28 +1109,11 @@
switch (extra & 0x7f) {
case 0x00: /* FMOVE */
regs.fp[reg] = src;
- /* Brian King was here. <ea> to register needs FPSR updated.
- * See page 3-73 in Motorola 68K programmers reference manual.
- * %%%FPU */
- regs.fpsr = (regs.fp[reg] == 0 ? 0x4000000 : 0) |
- (regs.fp[reg] < 0 ? 0x8000000 : 0);
break;
case 0x01: /* FINT */
- /* need to take the current rounding mode into account */
- switch ((regs.fpcr >> 4) & 0x3) {
- case 0:
regs.fp[reg] = (int) (src + 0.5);
- break;
- case 1:
- regs.fp[reg] = (int) src;
- break;
- case 2:
- regs.fp[reg] = floor (src);
- break;
- case 3:
- regs.fp[reg] = ceil (src);
- break;
- }
+ regs.fpsr = (regs.fp[reg] == 0 ? 0x4000000 : 0) |
+ (regs.fp[reg] < 0 ? 0x8000000 : 0);
break;
case 0x02: /* FSINH */
regs.fp[reg] = sinh (src);
diff -burN uae/gencpu.c bas/gencpu.c
--- uae/gencpu.c 2017-09-04 20:36:25.000000000 -0500
+++ bas/gencpu.c 2017-09-09 14:23:11.000000000 -0500
@@ -16,12 +16,12 @@
* Copyright 1995, 1996 Bernd Schmidt
*/
-#include "sysconfig.h"
-#include "sysdeps.h"
#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
-#include "config.h"
-#include "options.h"
+#include "sysdeps.h"
#include "readcpu.h"
#define BOOL_TYPE "int"
@@ -38,11 +38,6 @@
* are done with that opcode. */
static int next_cpu_level;
-void write_log (const char *s, ...)
-{
- fprintf (stderr, "%s", s);
-}
-
static int *opcode_map;
static int *opcode_next_clev;
static int *opcode_last_postfix;
@@ -1334,7 +1329,6 @@
genastore ("regs.usp", curi->smode, "srcreg", curi->size, "src");
break;
case i_RESET:
- printf ("\tcustomreset();\n");
break;
case i_NOP:
break;
@@ -2296,12 +2290,9 @@
static void generate_includes (FILE * f)
{
- fprintf (f, "#include \"sysconfig.h\"\n");
fprintf (f, "#include \"sysdeps.h\"\n");
- fprintf (f, "#include \"config.h\"\n");
- fprintf (f, "#include \"options.h\"\n");
+ fprintf (f, "#include \"m68k.h\"\n");
fprintf (f, "#include \"memory.h\"\n");
- fprintf (f, "#include \"custom.h\"\n");
fprintf (f, "#include \"readcpu.h\"\n");
fprintf (f, "#include \"newcpu.h\"\n");
fprintf (f, "#include \"compiler.h\"\n");
diff -burN uae/memory.cpp bas/memory.cpp
--- uae/memory.cpp 2017-09-04 20:36:24.000000000 -0500
+++ bas/memory.cpp 2017-09-09 14:11:03.000000000 -0500
@@ -6,28 +6,20 @@
* (c) 1995 Bernd Schmidt
*/
-#include "sysconfig.h"
+#include <stdio.h>
+#include <stdlib.h>
+
#include "sysdeps.h"
-#include "config.h"
-#include "options.h"
-#include "uae.h"
+#include "cpu_emulation.h"
+#include "m68k.h"
#include "memory.h"
-#include "ersatz.h"
-#include "zfile.h"
-
-#ifdef USE_MAPPED_MEMORY
-#include <sys/mman.h>
-#endif
-
-int ersatzkickfile = 0;
+#include "readcpu.h"
+#include "newcpu.h"
+#include "main.h"
+#include "video.h"
-uae_u32 allocated_chipmem;
-uae_u32 allocated_fastmem;
-uae_u32 allocated_bogomem;
-uae_u32 allocated_gfxmem;
-uae_u32 allocated_z3fastmem;
-uae_u32 allocated_a3000mem;
+static bool illegal_mem = false;
#ifdef SAVE_MEMORY_BANKS
addrbank *mem_banks[65536];
@@ -62,21 +54,19 @@
}
#endif
-uae_u32 chipmem_mask, kickmem_mask, bogomem_mask, a3000mem_mask;
-
/* A dummy bank that only contains zeros */
-static uae_u32 dummy_lget (uaecptr) REGPARAM;
-static uae_u32 dummy_wget (uaecptr) REGPARAM;
-static uae_u32 dummy_bget (uaecptr) REGPARAM;
-static void dummy_lput (uaecptr, uae_u32) REGPARAM;
-static void dummy_wput (uaecptr, uae_u32) REGPARAM;
-static void dummy_bput (uaecptr, uae_u32) REGPARAM;
-static int dummy_check (uaecptr addr, uae_u32 size) REGPARAM;
+static uae_u32 REGPARAM2 dummy_lget (uaecptr) REGPARAM;
+static uae_u32 REGPARAM2 dummy_wget (uaecptr) REGPARAM;
+static uae_u32 REGPARAM2 dummy_bget (uaecptr) REGPARAM;
+static void REGPARAM2 dummy_lput (uaecptr, uae_u32) REGPARAM;
+static void REGPARAM2 dummy_wput (uaecptr, uae_u32) REGPARAM;
+static void REGPARAM2 dummy_bput (uaecptr, uae_u32) REGPARAM;
+static int REGPARAM2 dummy_check (uaecptr addr, uae_u32 size) REGPARAM;
uae_u32 REGPARAM2 dummy_lget (uaecptr addr)
{
- if (currprefs.illegal_mem)
+ if (illegal_mem)
write_log ("Illegal lget at %08lx\n", addr);
return 0;
@@ -84,7 +74,7 @@
uae_u32 REGPARAM2 dummy_wget (uaecptr addr)
{
- if (currprefs.illegal_mem)
+ if (illegal_mem)
write_log ("Illegal wget at %08lx\n", addr);
return 0;
@@ -92,7 +82,7 @@
uae_u32 REGPARAM2 dummy_bget (uaecptr addr)
{
- if (currprefs.illegal_mem)
+ if (illegal_mem)
write_log ("Illegal bget at %08lx\n", addr);
return 0;
@@ -100,483 +90,406 @@
void REGPARAM2 dummy_lput (uaecptr addr, uae_u32 l)
{
- if (currprefs.illegal_mem)
+ if (illegal_mem)
write_log ("Illegal lput at %08lx\n", addr);
}
void REGPARAM2 dummy_wput (uaecptr addr, uae_u32 w)
{
- if (currprefs.illegal_mem)
+ if (illegal_mem)
write_log ("Illegal wput at %08lx\n", addr);
}
void REGPARAM2 dummy_bput (uaecptr addr, uae_u32 b)
{
- if (currprefs.illegal_mem)
+ if (illegal_mem)
write_log ("Illegal bput at %08lx\n", addr);
}
int REGPARAM2 dummy_check (uaecptr addr, uae_u32 size)
{
- if (currprefs.illegal_mem)
+ if (illegal_mem)
write_log ("Illegal check at %08lx\n", addr);
return 0;
}
-/* A3000 "motherboard resources" bank. */
-static uae_u32 mbres_lget (uaecptr) REGPARAM;
-static uae_u32 mbres_wget (uaecptr) REGPARAM;
-static uae_u32 mbres_bget (uaecptr) REGPARAM;
-static void mbres_lput (uaecptr, uae_u32) REGPARAM;
-static void mbres_wput (uaecptr, uae_u32) REGPARAM;
-static void mbres_bput (uaecptr, uae_u32) REGPARAM;
-static int mbres_check (uaecptr addr, uae_u32 size) REGPARAM;
+/* Mac RAM (32 bit addressing) */
-static int mbres_val = 0;
+static uae_u32 REGPARAM2 ram_lget(uaecptr) REGPARAM;
+static uae_u32 REGPARAM2 ram_wget(uaecptr) REGPARAM;
+static uae_u32 REGPARAM2 ram_bget(uaecptr) REGPARAM;
+static void REGPARAM2 ram_lput(uaecptr, uae_u32) REGPARAM;
+static void REGPARAM2 ram_wput(uaecptr, uae_u32) REGPARAM;
+static void REGPARAM2 ram_bput(uaecptr, uae_u32) REGPARAM;
+static int REGPARAM2 ram_check(uaecptr addr, uae_u32 size) REGPARAM;
+static uae_u8 *REGPARAM2 ram_xlate(uaecptr addr) REGPARAM;
-uae_u32 REGPARAM2 mbres_lget (uaecptr addr)
-{
- if (currprefs.illegal_mem)
- write_log ("Illegal lget at %08lx\n", addr);
+static uae_u32 RAMBaseDiff; // RAMBaseHost - RAMBaseMac
- return 0;
+uae_u32 REGPARAM2 ram_lget(uaecptr addr)
+{
+ uae_u32 *m;
+ m = (uae_u32 *)(RAMBaseDiff + addr);
+ return do_get_mem_long(m);
}
-uae_u32 REGPARAM2 mbres_wget (uaecptr addr)
+uae_u32 REGPARAM2 ram_wget(uaecptr addr)
{
- if (currprefs.illegal_mem)
- write_log ("Illegal wget at %08lx\n", addr);
-
- return 0;
+ uae_u16 *m;
+ m = (uae_u16 *)(RAMBaseDiff + addr);
+ return do_get_mem_word(m);
}
-uae_u32 REGPARAM2 mbres_bget (uaecptr addr)
+uae_u32 REGPARAM2 ram_bget(uaecptr addr)
{
- if (currprefs.illegal_mem)
- write_log ("Illegal bget at %08lx\n", addr);
-
- return (addr & 0xFFFF) == 3 ? mbres_val : 0;
+ return (uae_u32)*(uae_u8 *)(RAMBaseDiff + addr);
}
-void REGPARAM2 mbres_lput (uaecptr addr, uae_u32 l)
+void REGPARAM2 ram_lput(uaecptr addr, uae_u32 l)
{
- if (currprefs.illegal_mem)
- write_log ("Illegal lput at %08lx\n", addr);
+ uae_u32 *m;
+ m = (uae_u32 *)(RAMBaseDiff + addr);
+ do_put_mem_long(m, l);
}
-void REGPARAM2 mbres_wput (uaecptr addr, uae_u32 w)
+
+void REGPARAM2 ram_wput(uaecptr addr, uae_u32 w)
{
- if (currprefs.illegal_mem)
- write_log ("Illegal wput at %08lx\n", addr);
+ uae_u16 *m;
+ m = (uae_u16 *)(RAMBaseDiff + addr);
+ do_put_mem_word(m, w);
}
-void REGPARAM2 mbres_bput (uaecptr addr, uae_u32 b)
-{
- if (currprefs.illegal_mem)
- write_log ("Illegal bput at %08lx\n", addr);
- if ((addr & 0xFFFF) == 3)
- mbres_val = b;
+void REGPARAM2 ram_bput(uaecptr addr, uae_u32 b)
+{
+ *(uae_u8 *)(RAMBaseDiff + addr) = b;
}
-int REGPARAM2 mbres_check (uaecptr addr, uae_u32 size)
+int REGPARAM2 ram_check(uaecptr addr, uae_u32 size)
{
- if (currprefs.illegal_mem)
- write_log ("Illegal check at %08lx\n", addr);
-
- return 0;
+ return (addr - RAMBaseMac + size) < RAMSize;
}
-/* Chip memory */
+uae_u8 *REGPARAM2 ram_xlate(uaecptr addr)
+{
+ return (uae_u8 *)(RAMBaseDiff + addr);
+}
-uae_u8 *chipmemory;
+/* Mac RAM (24 bit addressing) */
-static uae_u32 chipmem_lget (uaecptr) REGPARAM;
-static uae_u32 chipmem_wget (uaecptr) REGPARAM;
-static uae_u32 chipmem_bget (uaecptr) REGPARAM;
-static void chipmem_lput (uaecptr, uae_u32) REGPARAM;
-static void chipmem_wput (uaecptr, uae_u32) REGPARAM;
-static void chipmem_bput (uaecptr, uae_u32) REGPARAM;
-static int chipmem_check (uaecptr addr, uae_u32 size) REGPARAM;
-static uae_u8 *chipmem_xlate (uaecptr addr) REGPARAM;
+static uae_u32 REGPARAM2 ram24_lget(uaecptr) REGPARAM;
+static uae_u32 REGPARAM2 ram24_wget(uaecptr) REGPARAM;
+static uae_u32 REGPARAM2 ram24_bget(uaecptr) REGPARAM;
+static void REGPARAM2 ram24_lput(uaecptr, uae_u32) REGPARAM;
+static void REGPARAM2 ram24_wput(uaecptr, uae_u32) REGPARAM;
+static void REGPARAM2 ram24_bput(uaecptr, uae_u32) REGPARAM;
+static int REGPARAM2 ram24_check(uaecptr addr, uae_u32 size) REGPARAM;
+static uae_u8 *REGPARAM2 ram24_xlate(uaecptr addr) REGPARAM;
-uae_u32 REGPARAM2 chipmem_lget (uaecptr addr)
+uae_u32 REGPARAM2 ram24_lget(uaecptr addr)
{
uae_u32 *m;
- addr -= chipmem_start & chipmem_mask;
- addr &= chipmem_mask;
- m = (uae_u32 *)(chipmemory + addr);
- return do_get_mem_long (m);
+ m = (uae_u32 *)(RAMBaseDiff + (addr & 0xffffff));
+ return do_get_mem_long(m);
}
-uae_u32 REGPARAM2 chipmem_wget (uaecptr addr)
+uae_u32 REGPARAM2 ram24_wget(uaecptr addr)
{
uae_u16 *m;
- addr -= chipmem_start & chipmem_mask;
- addr &= chipmem_mask;
- m = (uae_u16 *)(chipmemory + addr);
- return do_get_mem_word (m);
+ m = (uae_u16 *)(RAMBaseDiff + (addr & 0xffffff));
+ return do_get_mem_word(m);
}
-uae_u32 REGPARAM2 chipmem_bget (uaecptr addr)
+uae_u32 REGPARAM2 ram24_bget(uaecptr addr)
{
- addr -= chipmem_start & chipmem_mask;
- addr &= chipmem_mask;
- return chipmemory[addr];
+ return (uae_u32)*(uae_u8 *)(RAMBaseDiff + (addr & 0xffffff));
}
-void REGPARAM2 chipmem_lput (uaecptr addr, uae_u32 l)
+void REGPARAM2 ram24_lput(uaecptr addr, uae_u32 l)
{
uae_u32 *m;
- addr -= chipmem_start & chipmem_mask;
- addr &= chipmem_mask;
- m = (uae_u32 *)(chipmemory + addr);
- do_put_mem_long (m, l);
+ m = (uae_u32 *)(RAMBaseDiff + (addr & 0xffffff));
+ do_put_mem_long(m, l);
}
-void REGPARAM2 chipmem_wput (uaecptr addr, uae_u32 w)
+void REGPARAM2 ram24_wput(uaecptr addr, uae_u32 w)
{
uae_u16 *m;
- addr -= chipmem_start & chipmem_mask;
- addr &= chipmem_mask;
- m = (uae_u16 *)(chipmemory + addr);
- do_put_mem_word (m, w);
+ m = (uae_u16 *)(RAMBaseDiff + (addr & 0xffffff));
+ do_put_mem_word(m, w);
}
-void REGPARAM2 chipmem_bput (uaecptr addr, uae_u32 b)
+void REGPARAM2 ram24_bput(uaecptr addr, uae_u32 b)
{
- addr -= chipmem_start & chipmem_mask;
- addr &= chipmem_mask;
- chipmemory[addr] = b;
+ *(uae_u8 *)(RAMBaseDiff + (addr & 0xffffff)) = b;
}
-int REGPARAM2 chipmem_check (uaecptr addr, uae_u32 size)
+int REGPARAM2 ram24_check(uaecptr addr, uae_u32 size)
{
- addr -= chipmem_start & chipmem_mask;
- addr &= chipmem_mask;
- return (addr + size) <= allocated_chipmem;
+ return ((addr & 0xffffff) - RAMBaseMac + size) < RAMSize;
}
-uae_u8 REGPARAM2 *chipmem_xlate (uaecptr addr)
+uae_u8 *REGPARAM2 ram24_xlate(uaecptr addr)
{
- addr -= chipmem_start & chipmem_mask;
- addr &= chipmem_mask;
- return chipmemory + addr;
+ return (uae_u8 *)(RAMBaseDiff + (addr & 0xffffff));
}
-/* Slow memory */
+/* Mac ROM (32 bit addressing) */
-static uae_u8 *bogomemory;
+static uae_u32 REGPARAM2 rom_lget(uaecptr) REGPARAM;
+static uae_u32 REGPARAM2 rom_wget(uaecptr) REGPARAM;
+static uae_u32 REGPARAM2 rom_bget(uaecptr) REGPARAM;
+static void REGPARAM2 rom_lput(uaecptr, uae_u32) REGPARAM;
+static void REGPARAM2 rom_wput(uaecptr, uae_u32) REGPARAM;
+static void REGPARAM2 rom_bput(uaecptr, uae_u32) REGPARAM;
+static int REGPARAM2 rom_check(uaecptr addr, uae_u32 size) REGPARAM;
+static uae_u8 *REGPARAM2 rom_xlate(uaecptr addr) REGPARAM;
-static uae_u32 bogomem_lget (uaecptr) REGPARAM;
-static uae_u32 bogomem_wget (uaecptr) REGPARAM;
-static uae_u32 bogomem_bget (uaecptr) REGPARAM;
-static void bogomem_lput (uaecptr, uae_u32) REGPARAM;
-static void bogomem_wput (uaecptr, uae_u32) REGPARAM;
-static void bogomem_bput (uaecptr, uae_u32) REGPARAM;
-static int bogomem_check (uaecptr addr, uae_u32 size) REGPARAM;
-static uae_u8 *bogomem_xlate (uaecptr addr) REGPARAM;
+static uae_u32 ROMBaseDiff; // ROMBaseHost - ROMBaseMac
-uae_u32 REGPARAM2 bogomem_lget (uaecptr addr)
+uae_u32 REGPARAM2 rom_lget(uaecptr addr)
{
uae_u32 *m;
- addr -= bogomem_start & bogomem_mask;
- addr &= bogomem_mask;
- m = (uae_u32 *)(bogomemory + addr);
- return do_get_mem_long (m);
+ m = (uae_u32 *)(ROMBaseDiff + addr);
+ return do_get_mem_long(m);
}
-uae_u32 REGPARAM2 bogomem_wget (uaecptr addr)
+uae_u32 REGPARAM2 rom_wget(uaecptr addr)
{
uae_u16 *m;
- addr -= bogomem_start & bogomem_mask;
- addr &= bogomem_mask;
- m = (uae_u16 *)(bogomemory + addr);
- return do_get_mem_word (m);
+ m = (uae_u16 *)(ROMBaseDiff + addr);
+ return do_get_mem_word(m);
}
-uae_u32 REGPARAM2 bogomem_bget (uaecptr addr)
+uae_u32 REGPARAM2 rom_bget(uaecptr addr)
{
- addr -= bogomem_start & bogomem_mask;
- addr &= bogomem_mask;
- return bogomemory[addr];
+ return (uae_u32)*(uae_u8 *)(ROMBaseDiff + addr);
}
-void REGPARAM2 bogomem_lput (uaecptr addr, uae_u32 l)
+void REGPARAM2 rom_lput(uaecptr addr, uae_u32 b)
{
- uae_u32 *m;
- addr -= bogomem_start & bogomem_mask;
- addr &= bogomem_mask;
- m = (uae_u32 *)(bogomemory + addr);
- do_put_mem_long (m, l);
+ if (illegal_mem)
+ write_log ("Illegal ROM lput at %08lx\n", addr);
}
-void REGPARAM2 bogomem_wput (uaecptr addr, uae_u32 w)
+void REGPARAM2 rom_wput(uaecptr addr, uae_u32 b)
{
- uae_u16 *m;
- addr -= bogomem_start & bogomem_mask;
- addr &= bogomem_mask;
- m = (uae_u16 *)(bogomemory + addr);
- do_put_mem_word (m, w);
+ if (illegal_mem)
+ write_log ("Illegal ROM wput at %08lx\n", addr);
}
-void REGPARAM2 bogomem_bput (uaecptr addr, uae_u32 b)
+void REGPARAM2 rom_bput(uaecptr addr, uae_u32 b)
{
- addr -= bogomem_start & bogomem_mask;
- addr &= bogomem_mask;
- bogomemory[addr] = b;
+ if (illegal_mem)
+ write_log ("Illegal ROM bput at %08lx\n", addr);
}
-int REGPARAM2 bogomem_check (uaecptr addr, uae_u32 size)
+int REGPARAM2 rom_check(uaecptr addr, uae_u32 size)
{
- addr -= bogomem_start & bogomem_mask;
- addr &= bogomem_mask;
- return (addr + size) <= allocated_bogomem;
+ return (addr - ROMBaseMac + size) < ROMSize;
}
-uae_u8 REGPARAM2 *bogomem_xlate (uaecptr addr)
+uae_u8 *REGPARAM2 rom_xlate(uaecptr addr)
{
- addr -= bogomem_start & bogomem_mask;
- addr &= bogomem_mask;
- return bogomemory + addr;
+ return (uae_u8 *)(ROMBaseDiff + addr);
}
-/* A3000 motherboard fast memory */
-
-static uae_u8 *a3000memory;
+/* Mac ROM (24 bit addressing) */
-static uae_u32 a3000mem_lget (uaecptr) REGPARAM;
-static uae_u32 a3000mem_wget (uaecptr) REGPARAM;
-static uae_u32 a3000mem_bget (uaecptr) REGPARAM;
-static void a3000mem_lput (uaecptr, uae_u32) REGPARAM;
-static void a3000mem_wput (uaecptr, uae_u32) REGPARAM;
-static void a3000mem_bput (uaecptr, uae_u32) REGPARAM;
-static int a3000mem_check (uaecptr addr, uae_u32 size) REGPARAM;
-static uae_u8 *a3000mem_xlate (uaecptr addr) REGPARAM;
+static uae_u32 REGPARAM2 rom24_lget(uaecptr) REGPARAM;
+static uae_u32 REGPARAM2 rom24_wget(uaecptr) REGPARAM;
+static uae_u32 REGPARAM2 rom24_bget(uaecptr) REGPARAM;
+static int REGPARAM2 rom24_check(uaecptr addr, uae_u32 size) REGPARAM;
+static uae_u8 *REGPARAM2 rom24_xlate(uaecptr addr) REGPARAM;
-uae_u32 REGPARAM2 a3000mem_lget (uaecptr addr)
+uae_u32 REGPARAM2 rom24_lget(uaecptr addr)
{
uae_u32 *m;
- addr -= a3000mem_start & a3000mem_mask;
- addr &= a3000mem_mask;
- m = (uae_u32 *)(a3000memory + addr);
- return do_get_mem_long (m);
+ m = (uae_u32 *)(ROMBaseDiff + (addr & 0xffffff));
+ return do_get_mem_long(m);
}
-uae_u32 REGPARAM2 a3000mem_wget (uaecptr addr)
+uae_u32 REGPARAM2 rom24_wget(uaecptr addr)
{
uae_u16 *m;
- addr -= a3000mem_start & a3000mem_mask;
- addr &= a3000mem_mask;
- m = (uae_u16 *)(a3000memory + addr);
- return do_get_mem_word (m);
+ m = (uae_u16 *)(ROMBaseDiff + (addr & 0xffffff));
+ return do_get_mem_word(m);
}
-uae_u32 REGPARAM2 a3000mem_bget (uaecptr addr)
+uae_u32 REGPARAM2 rom24_bget(uaecptr addr)
{
- addr -= a3000mem_start & a3000mem_mask;
- addr &= a3000mem_mask;
- return a3000memory[addr];
+ return (uae_u32)*(uae_u8 *)(ROMBaseDiff + (addr & 0xffffff));
}
-void REGPARAM2 a3000mem_lput (uaecptr addr, uae_u32 l)
+int REGPARAM2 rom24_check(uaecptr addr, uae_u32 size)
+{
+ return ((addr & 0xffffff) - ROMBaseMac + size) < ROMSize;
+}
+
+uae_u8 *REGPARAM2 rom24_xlate(uaecptr addr)
+{
+ return (uae_u8 *)(ROMBaseDiff + (addr & 0xffffff));
+}
+
+/* Frame buffer */
+
+static uae_u32 REGPARAM2 frame_direct_lget(uaecptr) REGPARAM;
+static uae_u32 REGPARAM2 frame_direct_wget(uaecptr) REGPARAM;
+static uae_u32 REGPARAM2 frame_direct_bget(uaecptr) REGPARAM;
+static void REGPARAM2 frame_direct_lput(uaecptr, uae_u32) REGPARAM;
+static void REGPARAM2 frame_direct_wput(uaecptr, uae_u32) REGPARAM;
+static void REGPARAM2 frame_direct_bput(uaecptr, uae_u32) REGPARAM;
+
+static uae_u32 REGPARAM2 frame_host_555_lget(uaecptr) REGPARAM;
+static uae_u32 REGPARAM2 frame_host_555_wget(uaecptr) REGPARAM;
+static void REGPARAM2 frame_host_555_lput(uaecptr, uae_u32) REGPARAM;
+static void REGPARAM2 frame_host_555_wput(uaecptr, uae_u32) REGPARAM;
+
+static uae_u32 REGPARAM2 frame_host_565_lget(uaecptr) REGPARAM;
+static uae_u32 REGPARAM2 frame_host_565_wget(uaecptr) REGPARAM;
+static void REGPARAM2 frame_host_565_lput(uaecptr, uae_u32) REGPARAM;
+static void REGPARAM2 frame_host_565_wput(uaecptr, uae_u32) REGPARAM;
+
+static uae_u32 REGPARAM2 frame_host_888_lget(uaecptr) REGPARAM;
+static void REGPARAM2 frame_host_888_lput(uaecptr, uae_u32) REGPARAM;
+
+static int REGPARAM2 frame_check(uaecptr addr, uae_u32 size) REGPARAM;
+static uae_u8 *REGPARAM2 frame_xlate(uaecptr addr) REGPARAM;
+
+static uae_u32 FrameBaseDiff; // MacFrameBaseHost - MacFrameBaseMac
+
+uae_u32 REGPARAM2 frame_direct_lget(uaecptr addr)
{
uae_u32 *m;
- addr -= a3000mem_start & a3000mem_mask;
- addr &= a3000mem_mask;
- m = (uae_u32 *)(a3000memory + addr);
- do_put_mem_long (m, l);
+ m = (uae_u32 *)(FrameBaseDiff + addr);
+ return do_get_mem_long(m);
}
-void REGPARAM2 a3000mem_wput (uaecptr addr, uae_u32 w)
+uae_u32 REGPARAM2 frame_direct_wget(uaecptr addr)
{
uae_u16 *m;
- addr -= a3000mem_start & a3000mem_mask;
- addr &= a3000mem_mask;
- m = (uae_u16 *)(a3000memory + addr);
- do_put_mem_word (m, w);
+ m = (uae_u16 *)(FrameBaseDiff + addr);
+ return do_get_mem_word(m);
}
-void REGPARAM2 a3000mem_bput (uaecptr addr, uae_u32 b)
+uae_u32 REGPARAM2 frame_direct_bget(uaecptr addr)
{
- addr -= a3000mem_start & a3000mem_mask;
- addr &= a3000mem_mask;
- a3000memory[addr] = b;
+ return (uae_u32)*(uae_u8 *)(FrameBaseDiff + addr);
}
-int REGPARAM2 a3000mem_check (uaecptr addr, uae_u32 size)
+void REGPARAM2 frame_direct_lput(uaecptr addr, uae_u32 l)
{
- addr -= a3000mem_start & a3000mem_mask;
- addr &= a3000mem_mask;
- return (addr + size) <= allocated_a3000mem;
+ uae_u32 *m;
+ m = (uae_u32 *)(FrameBaseDiff + addr);
+ do_put_mem_long(m, l);
}
-uae_u8 REGPARAM2 *a3000mem_xlate(uaecptr addr)
+void REGPARAM2 frame_direct_wput(uaecptr addr, uae_u32 w)
{
- addr -= a3000mem_start & a3000mem_mask;
- addr &= a3000mem_mask;
- return a3000memory + addr;
+ uae_u16 *m;
+ m = (uae_u16 *)(FrameBaseDiff + addr);
+ do_put_mem_word(m, w);
}
-/* Kick memory */
+void REGPARAM2 frame_direct_bput(uaecptr addr, uae_u32 b)
+{
+ *(uae_u8 *)(FrameBaseDiff + addr) = b;
+}
-uae_u8 *kickmemory;
+uae_u32 REGPARAM2 frame_host_555_lget(uaecptr addr)
+{
+ uae_u32 *m, l;
+ m = (uae_u32 *)(FrameBaseDiff + addr);
+ l = *m;
+ return (l >> 16) | (l << 16);
+}
-static uae_u32 kickmem_lget (uaecptr) REGPARAM;
-static uae_u32 kickmem_wget (uaecptr) REGPARAM;
-static uae_u32 kickmem_bget (uaecptr) REGPARAM;
-static void kickmem_lput (uaecptr, uae_u32) REGPARAM;
-static void kickmem_wput (uaecptr, uae_u32) REGPARAM;
-static void kickmem_bput (uaecptr, uae_u32) REGPARAM;
-static int kickmem_check (uaecptr addr, uae_u32 size) REGPARAM;
-static uae_u8 *kickmem_xlate (uaecptr addr) REGPARAM;
+uae_u32 REGPARAM2 frame_host_555_wget(uaecptr addr)
+{
+ uae_u16 *m;
+ m = (uae_u16 *)(FrameBaseDiff + addr);
+ return *m;
+}
-uae_u32 REGPARAM2 kickmem_lget (uaecptr addr)
+void REGPARAM2 frame_host_555_lput(uaecptr addr, uae_u32 l)
{
uae_u32 *m;
- addr -= kickmem_start & kickmem_mask;
- addr &= kickmem_mask;
- m = (uae_u32 *)(kickmemory + addr);
- return do_get_mem_long (m);
+ m = (uae_u32 *)(FrameBaseDiff + addr);
+ *m = (l >> 16) | (l << 16);
}
-uae_u32 REGPARAM2 kickmem_wget (uaecptr addr)
+void REGPARAM2 frame_host_555_wput(uaecptr addr, uae_u32 w)
{
uae_u16 *m;
- addr -= kickmem_start & kickmem_mask;
- addr &= kickmem_mask;
- m = (uae_u16 *)(kickmemory + addr);
- return do_get_mem_word (m);
+ m = (uae_u16 *)(FrameBaseDiff + addr);
+ *m = w;
}
-uae_u32 REGPARAM2 kickmem_bget (uaecptr addr)
+uae_u32 REGPARAM2 frame_host_565_lget(uaecptr addr)
{
- addr -= kickmem_start & kickmem_mask;
- addr &= kickmem_mask;
- return kickmemory[addr];
+ uae_u32 *m, l;
+ m = (uae_u32 *)(FrameBaseDiff + addr);
+ l = *m;
+ l = (l & 0x001f001f) | ((l >> 1) & 0x7fe07fe0);
+ return (l >> 16) | (l << 16);
}
-void REGPARAM2 kickmem_lput (uaecptr addr, uae_u32 b)
+uae_u32 REGPARAM2 frame_host_565_wget(uaecptr addr)
{
- if (currprefs.illegal_mem)
- write_log ("Illegal kickmem lput at %08lx\n", addr);
+ uae_u16 *m, w;
+ m = (uae_u16 *)(FrameBaseDiff + addr);
+ w = *m;
+ return (w & 0x1f) | ((w >> 1) & 0x7fe0);
}
-void REGPARAM2 kickmem_wput (uaecptr addr, uae_u32 b)
+void REGPARAM2 frame_host_565_lput(uaecptr addr, uae_u32 l)
{
- if (currprefs.illegal_mem)
- write_log ("Illegal kickmem wput at %08lx\n", addr);
+ uae_u32 *m;
+ m = (uae_u32 *)(FrameBaseDiff + addr);
+ l = (l & 0x001f001f) | ((l << 1) & 0xffc0ffc0);
+ *m = (l >> 16) | (l << 16);
}
-void REGPARAM2 kickmem_bput (uaecptr addr, uae_u32 b)
+void REGPARAM2 frame_host_565_wput(uaecptr addr, uae_u32 w)
{
- if (currprefs.illegal_mem)
- write_log ("Illegal kickmem lput at %08lx\n", addr);
+ uae_u16 *m;
+ m = (uae_u16 *)(FrameBaseDiff + addr);
+ *m = (w & 0x1f) | ((w << 1) & 0xffc0);
}
-int REGPARAM2 kickmem_check (uaecptr addr, uae_u32 size)
+uae_u32 REGPARAM2 frame_host_888_lget(uaecptr addr)
{
- addr -= kickmem_start & kickmem_mask;
- addr &= kickmem_mask;
- return (addr + size) <= kickmem_size;
+ uae_u32 *m, l;
+ m = (uae_u32 *)(FrameBaseDiff + addr);
+ return *m;
}
-uae_u8 REGPARAM2 *kickmem_xlate (uaecptr addr)
+void REGPARAM2 frame_host_888_lput(uaecptr addr, uae_u32 l)
{
- addr -= kickmem_start & kickmem_mask;
- addr &= kickmem_mask;
- return kickmemory + addr;
+ uae_u32 *m;
+ m = (uae_u32 *)(MacFrameBaseHost + addr - MacFrameBaseMac);
+ *m = l;
}
-/* Default memory access functions */
-
-int REGPARAM2 default_check (uaecptr a, uae_u32 b)
+int REGPARAM2 frame_check(uaecptr addr, uae_u32 size)
{
- return 0;
+ return (addr - MacFrameBaseMac + size) < MacFrameSize;
}
-uae_u8 REGPARAM2 *default_xlate (uaecptr a)
+uae_u8 *REGPARAM2 frame_xlate(uaecptr addr)
{
- write_log ("Your Amiga program just did something terribly stupid\n");
- uae_reset();
- return kickmem_xlate (get_long (0xF80000)); /* So we don't crash. */
-}
-
-static int load_kickstart (void)
-{
- int i;
- uae_u32 cksum = 0, prevck = 0;
- unsigned char buffer[20];
-
- FILE *f = zfile_open (currprefs.romfile, "rb");
-
- if (f == NULL) {
- write_log ("No Kickstart ROM found.\n");
-#if defined AMIGA || defined __POS__
-#define USE_UAE_ERSATZ "USE_UAE_ERSATZ"
- if (!getenv (USE_UAE_ERSATZ)) {
- fprintf (stderr, "Using current ROM. (create ENV:%s to "
- "use uae's ROM replacement)\n", USE_UAE_ERSATZ);
- memcpy (kickmemory, (char*)0x1000000 - kickmem_size, kickmem_size);
- goto chk_sum;
- }
-#endif
- return 0;
- }
+ return (uae_u8 *)(FrameBaseDiff + addr);
+}
- i = fread (buffer, 1, 11, f);
- if (strncmp ((char *)buffer, "AMIROMTYPE1", 11) != 0)
- fseek (f, 0, SEEK_SET);
-
- i = fread (kickmemory, 1, kickmem_size, f);
- if (i == kickmem_size/2) {
- memcpy (kickmemory + kickmem_size/2, kickmemory, kickmem_size/2);
- } else if (i != kickmem_size) {
- write_log ("Error while reading Kickstart.\n");
- return 0;
- }
- zfile_close (f);
+/* Default memory access functions */
- cloanto_rom = 0;
- if (strncmp ((char *)buffer, "AMIROMTYPE1", 11) == 0) {
- FILE *keyf;
- uae_u8 *p;
- long size, cnt, t;
-
- cloanto_rom = 1;
- write_log ("ROM image is an encrypted \"Amiga Forever\" ROM file.\n");
- if (strlen (currprefs.keyfile) == 0) {
- write_log ("No filename given for ROM key file.\n");
- return 0;
- }
- keyf = zfile_open (currprefs.keyfile, "rb");
- if (keyf == 0) {
- write_log ("Could not find ROM key file.\n");
+int REGPARAM2 default_check (uaecptr a, uae_u32 b)
+{
return 0;
- }
- p = (uae_u8 *)malloc (524288);
- size = fread (p, 1, 524288, keyf);
-
- for (t = cnt = 0; cnt < kickmem_size; cnt++, t = (t + 1) % size) {
- kickmemory[cnt] ^= p[t];
- if (i == cnt+1)
- t = size-1;
- }
- fclose (keyf);
- free (p);
- }
-#if defined(AMIGA)
- chk_sum:
-#endif
+}
- for (i = 0; i < kickmem_size; i+=4) {
- uae_u32 data = kickmemory[i]*65536*256 + kickmemory[i+1]*65536 + kickmemory[i+2]*256 + kickmemory[i+3];
- cksum += data;
- if (cksum < prevck)
- cksum++;
- prevck = cksum;
- }
- if (cksum != 0xFFFFFFFFul) {
- write_log ("Kickstart checksum incorrect. You probably have a corrupted ROM image.\n");
- }
- return 1;
+uae_u8 *REGPARAM2 default_xlate (uaecptr a)
+{
+ write_log("Your Mac program just did something terribly stupid\n");
+ return NULL;
}
/* Address banks */
@@ -587,156 +500,98 @@
default_xlate, dummy_check
};
-addrbank mbres_bank = {
- mbres_lget, mbres_wget, mbres_bget,
- mbres_lput, mbres_wput, mbres_bput,
- default_xlate, mbres_check
+addrbank ram_bank = {
+ ram_lget, ram_wget, ram_bget,
+ ram_lput, ram_wput, ram_bput,
+ ram_xlate, ram_check
};
-addrbank chipmem_bank = {
- chipmem_lget, chipmem_wget, chipmem_bget,
- chipmem_lput, chipmem_wput, chipmem_bput,
- chipmem_xlate, chipmem_check
+addrbank ram24_bank = {
+ ram24_lget, ram24_wget, ram24_bget,
+ ram24_lput, ram24_wput, ram24_bput,
+ ram24_xlate, ram24_check
};
-addrbank bogomem_bank = {
- bogomem_lget, bogomem_wget, bogomem_bget,
- bogomem_lput, bogomem_wput, bogomem_bput,
- bogomem_xlate, bogomem_check
+addrbank rom_bank = {
+ rom_lget, rom_wget, rom_bget,
+ rom_lput, rom_wput, rom_bput,
+ rom_xlate, rom_check
};
-addrbank a3000mem_bank = {
- a3000mem_lget, a3000mem_wget, a3000mem_bget,
- a3000mem_lput, a3000mem_wput, a3000mem_bput,
- a3000mem_xlate, a3000mem_check
+addrbank rom24_bank = {
+ rom24_lget, rom24_wget, rom24_bget,
+ rom_lput, rom_wput, rom_bput,
+ rom24_xlate, rom24_check
};
-addrbank kickmem_bank = {
- kickmem_lget, kickmem_wget, kickmem_bget,
- kickmem_lput, kickmem_wput, kickmem_bput,
- kickmem_xlate, kickmem_check
+addrbank frame_direct_bank = {
+ frame_direct_lget, frame_direct_wget, frame_direct_bget,
+ frame_direct_lput, frame_direct_wput, frame_direct_bput,
+ frame_xlate, frame_check
};
-char *address_space, *good_address_map;
-int good_address_fd;
+addrbank frame_host_555_bank = {
+ frame_host_555_lget, frame_host_555_wget, frame_direct_bget,
+ frame_host_555_lput, frame_host_555_wput, frame_direct_bput,
+ frame_xlate, frame_check
+};
-static void init_mem_banks (void)
-{
- int i;
- for (i = 0; i < 65536; i++)
- put_mem_bank (i<<16, &dummy_bank);
-}
+addrbank frame_host_565_bank = {
+ frame_host_565_lget, frame_host_565_wget, frame_direct_bget,
+ frame_host_565_lput, frame_host_565_wput, frame_direct_bput,
+ frame_xlate, frame_check
+};
+
+addrbank frame_host_888_bank = {
+ frame_host_888_lget, frame_direct_wget, frame_direct_bget,
+ frame_host_888_lput, frame_direct_wput, frame_direct_bput,
+ frame_xlate, frame_check
+};
-#define MAKE_USER_PROGRAMS_BEHAVE 1
void memory_init (void)
{
char buffer[4096];
char *nam;
int i, fd;
- int custom_start;
-
- allocated_chipmem = currprefs.chipmem_size;
- allocated_bogomem = currprefs.bogomem_size;
- allocated_a3000mem = currprefs.a3000mem_size;
-
-#ifdef USE_MAPPED_MEMORY
- fd = open ("/dev/zero", O_RDWR);
- good_address_map = mmap (NULL, 1 << 24, PROT_READ, MAP_PRIVATE, fd, 0);
- /* Don't believe USER_PROGRAMS_BEHAVE. Otherwise, we'd segfault as soon
- * as a decrunch routine tries to do color register hacks. */
- address_space = mmap (NULL, 1 << 24, PROT_READ | (USER_PROGRAMS_BEHAVE || MAKE_USER_PROGRAMS_BEHAVE? PROT_WRITE : 0), MAP_PRIVATE, fd, 0);
- if ((int)address_space < 0 || (int)good_address_map < 0) {
- write_log ("Your system does not have enough virtual memory - increase swap.\n");
- abort ();
- }
-#ifdef MAKE_USER_PROGRAMS_BEHAVE
- memset (address_space + 0xDFF180, 0xFF, 32*2);
-#else
- /* Likewise. This is mostly for mouse button checks. */
- if (USER_PROGRAMS_BEHAVE)
- memset (address_space + 0xA00000, 0xFF, 0xF00000 - 0xA00000);
-#endif
- chipmemory = mmap (address_space, 0x200000, PROT_READ|PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0);
- kickmemory = mmap (address_space + 0xF80000, 0x80000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, fd, 0);
- close(fd);
+ for(i=0; i<65536; i++)
+ put_mem_bank(i<<16, &dummy_bank);
- good_address_fd = open (nam = tmpnam (NULL), O_CREAT|O_RDWR, 0600);
- memset (buffer, 1, sizeof(buffer));
- write (good_address_fd, buffer, sizeof buffer);
- unlink (nam);
-
- for (i = 0; i < allocated_chipmem; i += 4096)
- mmap (good_address_map + i, 4096, PROT_READ, MAP_FIXED | MAP_PRIVATE,
- good_address_fd, 0);
- for (i = 0; i < kickmem_size; i += 4096)
- mmap (good_address_map + i + 0x1000000 - kickmem_size, 4096, PROT_READ,
- MAP_FIXED | MAP_PRIVATE, good_address_fd, 0);
+ // Limit RAM size to not overlap ROM
+#if REAL_ADDRESSING
+ uint32 ram_size = RAMSize;
#else
- kickmemory = (uae_u8 *)malloc (kickmem_size);
- chipmemory = (uae_u8 *)malloc (allocated_chipmem);
-
- while (! chipmemory && allocated_chipmem > 512*1024) {
- allocated_chipmem >>= 1;
- chipmemory = (uae_u8 *)malloc (allocated_chipmem);
- if (chipmemory)
- fprintf (stderr, "Reducing chipmem size to %dkb\n", allocated_chipmem >> 10);
- }
- if (! chipmemory) {
- write_log ("virtual memory exhausted (chipmemory)!\n");
- abort ();
- }
+ uint32 ram_size = RAMSize > ROMBaseMac ? ROMBaseMac : RAMSize;
#endif
- do_put_mem_long ((uae_u32 *)(chipmemory + 4), 0);
- init_mem_banks ();
-
- /* Map the chipmem into all of the lower 16MB */
- map_banks (&chipmem_bank, 0x00, 256);
- custom_start = 0xC0;
-
- map_banks (&custom_bank, custom_start, 0xE0-custom_start);
- map_banks (&cia_bank, 0xA0, 32);
- map_banks (&clock_bank, 0xDC, 1);
-
- /* @@@ Does anyone have a clue what should be in the 0x200000 - 0xA00000
- * range on an Amiga without expansion memory? */
- custom_start = allocated_chipmem >> 16;
- if (custom_start < 0x20)
- custom_start = 0x20;
- map_banks (&dummy_bank, custom_start, 0xA0 - custom_start);
- /*map_banks (&mbres_bank, 0xDE, 1);*/
-
- if (allocated_bogomem > 0)
- bogomemory = (uae_u8 *)malloc (allocated_bogomem);
- if (bogomemory != 0)
- map_banks (&bogomem_bank, 0xC0, allocated_bogomem >> 16);
- else
- allocated_bogomem = 0;
-
- if (allocated_a3000mem > 0)
- a3000memory = (uae_u8 *)malloc (allocated_a3000mem);
- if (a3000memory != 0)
- map_banks (&a3000mem_bank, a3000mem_start >> 16, allocated_a3000mem >> 16);
- else
- allocated_a3000mem = 0;
-
- map_banks (&rtarea_bank, 0xF0, 1);
- if (! load_kickstart ()) {
- init_ersatz_rom (kickmemory);
- ersatzkickfile = 1;
+ RAMBaseDiff = (uae_u32)RAMBaseHost - (uae_u32)RAMBaseMac;
+ ROMBaseDiff = (uae_u32)ROMBaseHost - (uae_u32)ROMBaseMac;
+ FrameBaseDiff = (uae_u32)MacFrameBaseHost - (uae_u32)MacFrameBaseMac;
+
+ // Map RAM and ROM
+ if (TwentyFourBitAddressing) {
+ map_banks(&ram24_bank, RAMBaseMac >> 16, ram_size >> 16);
+ map_banks(&rom24_bank, ROMBaseMac >> 16, ROMSize >> 16);
+ } else {
+ map_banks(&ram_bank, RAMBaseMac >> 16, ram_size >> 16);
+ map_banks(&rom_bank, ROMBaseMac >> 16, ROMSize >> 16);
+ }
+
+ // Map frame buffer
+ switch (MacFrameLayout) {
+ case FLAYOUT_DIRECT:
+ map_banks(&frame_direct_bank, MacFrameBaseMac >> 16, (MacFrameSize >> 16) + 1);
+ break;
+ case FLAYOUT_HOST_555:
+ map_banks(&frame_host_555_bank, MacFrameBaseMac >> 16, (MacFrameSize >> 16) + 1);
+ break;
+ case FLAYOUT_HOST_565:
+ map_banks(&frame_host_565_bank, MacFrameBaseMac >> 16, (MacFrameSize >> 16) + 1);
+ break;
+ case FLAYOUT_HOST_888:
+ map_banks(&frame_host_888_bank, MacFrameBaseMac >> 16, (MacFrameSize >> 16) + 1);
+ break;
}
- map_banks (&kickmem_bank, 0xF8, 8);
- map_banks (&expamem_bank, 0xE8, 1);
-
- if (cloanto_rom)
- map_banks (&kickmem_bank, 0xE0, 8);
-
- chipmem_mask = allocated_chipmem- 1;
- kickmem_mask = kickmem_size - 1;
- bogomem_mask = allocated_bogomem - 1;
- a3000mem_mask = allocated_a3000mem - 1;
-
}
void map_banks (addrbank *bank, int start, int size)
@@ -749,9 +604,7 @@
put_mem_bank (bnr << 16, bank);
return;
}
- /* Some '020 Kickstarts apparently require a 24 bit address space... */
- if (currprefs.address_space_24)
- endhioffs = 0x10000;
+ if (TwentyFourBitAddressing) endhioffs = 0x10000;
for (hioffs = 0; hioffs < endhioffs; hioffs += 0x100)
for (bnr = start; bnr < start+size; bnr++)
put_mem_bank ((bnr + hioffs) << 16, bank);
diff -burN uae/memory.h bas/memory.h
--- uae/memory.h 1999-10-22 05:19:40.000000000 -0500
+++ bas/memory.h 2017-09-09 14:25:06.000000000 -0500
@@ -15,23 +15,12 @@
#define SAVE_MEMORY_BANKS
#endif
-typedef uae_u32 (*mem_get_func)(uaecptr) REGPARAM;
-typedef void (*mem_put_func)(uaecptr, uae_u32) REGPARAM;
-typedef uae_u8 *(*xlate_func)(uaecptr) REGPARAM;
-typedef int (*check_func)(uaecptr, uae_u32) REGPARAM;
-
-extern char *address_space, *good_address_map;
-extern uae_u8 *chipmemory;
-
-extern uae_u32 allocated_chipmem;
-extern uae_u32 allocated_fastmem;
-extern uae_u32 allocated_bogomem;
-extern uae_u32 allocated_gfxmem;
-extern uae_u32 allocated_z3fastmem;
-extern uae_u32 allocated_a3000mem;
+typedef uae_u32 (REGPARAM2 *mem_get_func)(uaecptr) REGPARAM;
+typedef void (REGPARAM2 *mem_put_func)(uaecptr, uae_u32) REGPARAM;
+typedef uae_u8 *(REGPARAM2 *xlate_func)(uaecptr) REGPARAM;
+typedef int (REGPARAM2 *check_func)(uaecptr, uae_u32) REGPARAM;
#undef DIRECT_MEMFUNCS_SUCCESSFUL
-#include "machdep/maccess.h"
#ifndef CAN_MAP_MEMORY
#undef USE_COMPILER
@@ -41,15 +30,6 @@
#define USE_MAPPED_MEMORY
#endif
-#define kickmem_size 0x080000
-
-#define chipmem_start 0x00000000
-#define bogomem_start 0x00C00000
-#define a3000mem_start 0x07000000
-#define kickmem_start 0x00F80000
-
-extern int ersatzkickfile;
-
typedef struct {
/* These ones should be self-explanatory... */
mem_get_func lget, wget, bget;
@@ -68,30 +48,14 @@
extern uae_u8 filesysory[65536];
-extern addrbank chipmem_bank;
-extern addrbank kickmem_bank;
-extern addrbank custom_bank;
-extern addrbank clock_bank;
-extern addrbank cia_bank;
-extern addrbank rtarea_bank;
-extern addrbank expamem_bank;
-extern addrbank fastmem_bank;
-extern addrbank gfxmem_bank;
-
-extern void rtarea_init (void);
-extern void rtarea_setup (void);
-extern void expamem_init (void);
-extern void expamem_reset (void);
-
-extern uae_u32 gfxmem_start;
-extern uae_u8 *gfxmemory;
-extern uae_u32 gfxmem_mask;
-extern int address_space_24;
+extern addrbank ram_bank; // Mac RAM
+extern addrbank rom_bank; // Mac ROM
+extern addrbank frame_bank; // Frame buffer
/* Default memory access functions */
-extern int default_check(uaecptr addr, uae_u32 size) REGPARAM;
-extern uae_u8 *default_xlate(uaecptr addr) REGPARAM;
+extern int REGPARAM2 default_check(uaecptr addr, uae_u32 size) REGPARAM;
+extern uae_u8 *REGPARAM2 default_xlate(uaecptr addr) REGPARAM;
#define bankindex(addr) (((uaecptr)(addr)) >> 16)
diff -burN uae/newcpu.cpp bas/newcpu.cpp
--- uae/newcpu.cpp 1999-10-22 14:10:26.000000000 -0500
+++ bas/newcpu.cpp 2017-09-09 14:19:39.000000000 -0500
@@ -6,22 +6,27 @@
* (c) 1995 Bernd Schmidt
*/
-#include "sysconfig.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "sysdeps.h"
-#include "config.h"
-#include "options.h"
-#include "events.h"
-#include "uae.h"
+#include "cpu_emulation.h"
+#include "main.h"
+#include "emul_op.h"
+
+extern int intlev(void); // From baisilisk_glue.cpp
+
+#include "m68k.h"
#include "memory.h"
-#include "custom.h"
#include "readcpu.h"
#include "newcpu.h"
-#include "autoconf.h"
-#include "ersatz.h"
-#include "debug.h"
#include "compiler.h"
-#include "gui.h"
+
+int quit_program = 0;
+int debugging = 0;
+struct flag_struct regflags;
/* Opcode of faulting instruction */
uae_u16 last_op_for_exception_3;
@@ -109,15 +114,12 @@
{
int i;
unsigned long opcode;
- struct cputbl *tbl = (currprefs.cpu_level == 3 ? op_smalltbl_0
- : currprefs.cpu_level == 2 ? op_smalltbl_1
- : currprefs.cpu_level == 1 ? op_smalltbl_2
- : currprefs.cpu_compatible ? op_smalltbl_4
+ int cpu_level = (FPUType ? 3 : CPUType >= 2 ? 2 : CPUType == 1 ? 1 : 0);
+ struct cputbl *tbl = (cpu_level == 3 ? op_smalltbl_0
+ : cpu_level == 2 ? op_smalltbl_1
+ : cpu_level == 1 ? op_smalltbl_2
: op_smalltbl_3);
- write_log ("Building CPU function table (%d %d %d).\n",
- currprefs.cpu_level, currprefs.cpu_compatible, currprefs.address_space_24);
-
for (opcode = 0; opcode < 65536; opcode++)
cpufunctbl[opcode] = op_illg_1;
for (i = 0; tbl[i].handler != NULL; i++) {
@@ -127,7 +129,7 @@
for (opcode = 0; opcode < 65536; opcode++) {
cpuop_func *f;
- if (table68k[opcode].mnemo == i_ILLG || table68k[opcode].clev > currprefs.cpu_level)
+ if (table68k[opcode].mnemo == i_ILLG || table68k[opcode].clev > cpu_level)
continue;
if (table68k[opcode].handler != -1) {
@@ -143,39 +145,10 @@
}
}
-unsigned long cycles_mask, cycles_val;
-
-static void update_68k_cycles (void)
-{
- cycles_mask = 0;
- cycles_val = currprefs.m68k_speed;
- if (currprefs.m68k_speed < 1) {
- cycles_mask = 0xFFFFFFFF;
- cycles_val = 0;
- }
-}
-
-void check_prefs_changed_cpu (void)
-{
- if (currprefs.cpu_level != changed_prefs.cpu_level
- || currprefs.cpu_compatible != changed_prefs.cpu_compatible) {
- currprefs.cpu_level = changed_prefs.cpu_level;
- currprefs.cpu_compatible = changed_prefs.cpu_compatible;
- build_cpufunctbl ();
- }
- if (currprefs.m68k_speed != changed_prefs.m68k_speed) {
- currprefs.m68k_speed = changed_prefs.m68k_speed;
- reset_frame_rate_hack ();
- update_68k_cycles ();
- }
-}
-
void init_m68k (void)
{
int i;
- update_68k_cycles ();
-
for (i = 0 ; i < 256 ; i++) {
int j;
for (j = 0 ; j < 8 ; j++) {
@@ -210,32 +183,9 @@
}
}
#endif
- write_log ("Building CPU table for configuration: 68");
- if (currprefs.address_space_24 && currprefs.cpu_level > 1)
- write_log ("EC");
- switch (currprefs.cpu_level) {
- case 1:
- write_log ("010");
- break;
- case 2:
- write_log ("020");
- break;
- case 3:
- write_log ("020/881");
- break;
- default:
- write_log ("000");
- break;
- }
- if (currprefs.cpu_compatible)
- write_log (" (compatible mode)");
- write_log ("\n");
-
read_table68k ();
do_merges ();
- write_log ("%d CPU functions\n", nr_cpuop_funcs);
-
build_cpufunctbl ();
}
@@ -633,7 +583,7 @@
SET_ZFLG ((regs.sr >> 2) & 1);
SET_VFLG ((regs.sr >> 1) & 1);
SET_CFLG (regs.sr & 1);
- if (currprefs.cpu_level >= 2) {
+ if (CPUType >= 2) {
if (olds != regs.s) {
if (olds) {
if (oldm)
@@ -679,13 +629,13 @@
MakeSR();
if (!regs.s) {
regs.usp = m68k_areg(regs, 7);
- if (currprefs.cpu_level >= 2)
+ if (CPUType >= 2)
m68k_areg(regs, 7) = regs.m ? regs.msp : regs.isp;
else
m68k_areg(regs, 7) = regs.isp;
regs.s = 1;
}
- if (currprefs.cpu_level > 0) {
+ if (CPUType > 0) {
if (nr == 2 || nr == 3) {
int i;
/* @@@ this is probably wrong (?) */
@@ -755,7 +705,7 @@
void m68k_move2c (int regno, uae_u32 *regp)
{
- if (currprefs.cpu_level == 1 && (regno & 0x7FF) > 1)
+ if (CPUType == 1 && (regno & 0x7FF) > 1)
op_illg (0x4E7B);
else
switch (regno) {
@@ -775,7 +725,7 @@
void m68k_movec2 (int regno, uae_u32 *regp)
{
- if (currprefs.cpu_level == 1 && (regno & 0x7FF) > 1)
+ if (CPUType == 1 && (regno & 0x7FF) > 1)
op_illg (0x4E7A);
else
switch (regno) {
@@ -1050,8 +1000,8 @@
void m68k_reset (void)
{
- m68k_areg (regs, 7) = get_long (0x00f80000);
- m68k_setpc (get_long (0x00f80004));
+ m68k_areg (regs, 7) = 0x2000;
+ m68k_setpc (ROMBaseMac + 0x2a);
fill_prefetch_0 ();
regs.kick_mask = 0xF80000;
regs.s = 1;
@@ -1074,56 +1024,52 @@
{
uaecptr pc = m68k_getpc ();
- if (cloanto_rom && (opcode & 0xF100) == 0x7100) {
- m68k_dreg (regs, (opcode >> 9) & 7) = (uae_s8)(opcode & 0xFF);
- m68k_incpc (2);
- fill_prefetch_0 ();
- return 4;
- }
-
compiler_flush_jsr_stack ();
- if (opcode == 0x4E7B && get_long (0x10) == 0 && (pc & 0xF80000) == 0xF80000) {
- write_log ("Your Kickstart requires a 68020 CPU. Giving up.\n");
- broken_in = 1;
+
+ if ((opcode & 0xFF00) == 0x7100) {
+ struct M68kRegisters r;
+ int i;
+
+ // Return from Execute68k()?
+ if (opcode == M68K_EXEC_RETURN) {
regs.spcflags |= SPCFLAG_BRK;
quit_program = 1;
- }
- if (opcode == 0xFF0D) {
- if ((pc & 0xF80000) == 0xF80000) {
- /* This is from the dummy Kickstart replacement */
- uae_u16 arg = get_iword (2);
- m68k_incpc (4);
- ersatz_perform (arg);
- fill_prefetch_0 ();
- return 4;
- } else if ((pc & 0xF80000) == 0xF00000) {
- /* User-mode STOP replacement */
- m68k_setstopped (1);
return 4;
}
- }
- if ((opcode & 0xF000) == 0xA000 && (pc & 0xF80000) == 0xF00000) {
- /* Calltrap. */
+ // Call EMUL_OP opcode
+ for (i=0; i<8; i++) {
+ r.d[i] = m68k_dreg(regs, i);
+ r.a[i] = m68k_areg(regs, i);
+ }
+ MakeSR();
+ r.sr = regs.sr;
+ EmulOp(opcode, &r);
+ for (i=0; i<8; i++) {
+ m68k_dreg(regs, i) = r.d[i];
+ m68k_areg(regs, i) = r.a[i];
+ }
+ regs.sr = r.sr;
+ MakeFromSR();
m68k_incpc(2);
- call_calltrap (opcode & 0xFFF);
fill_prefetch_0 ();
return 4;
}
- if ((opcode & 0xF000) == 0xF000) {
- Exception(0xB,0);
- return 4;
- }
if ((opcode & 0xF000) == 0xA000) {
- if ((pc & 0xF80000) == 0xF00000) {
- /* Calltrap. */
- call_calltrap (opcode & 0xFFF);
- }
Exception(0xA,0);
return 4;
}
+
+// write_log ("Illegal instruction: %04x at %08lx\n", opcode, pc);
+
+ if ((opcode & 0xF000) == 0xF000) {
+ Exception(0xB,0);
+ return 4;
+ }
+
write_log ("Illegal instruction: %04x at %08lx\n", opcode, pc);
+
Exception (4,0);
return 4;
}
@@ -1181,19 +1127,11 @@
static int do_specialties (void)
{
/*n_spcinsns++;*/
- while (regs.spcflags & SPCFLAG_BLTNASTY) {
- do_cycles (4);
- if (regs.spcflags & SPCFLAG_DISK)
- do_disk ();
- }
run_compiled_code();
if (regs.spcflags & SPCFLAG_DOTRACE) {
Exception (9,last_trace_ad);
}
while (regs.spcflags & SPCFLAG_STOP) {
- do_cycles (4);
- if (regs.spcflags & SPCFLAG_DISK)
- do_disk ();
if (regs.spcflags & (SPCFLAG_INT | SPCFLAG_DOINT)){
int intr = intlev ();
regs.spcflags &= ~(SPCFLAG_INT | SPCFLAG_DOINT);
@@ -1207,9 +1145,6 @@
if (regs.spcflags & SPCFLAG_TRACE)
do_trace ();
- if (regs.spcflags & SPCFLAG_DISK)
- do_disk ();
-
if (regs.spcflags & SPCFLAG_DOINT) {
int intr = intlev ();
regs.spcflags &= ~SPCFLAG_DOINT;
@@ -1229,78 +1164,11 @@
return 0;
}
-/* It's really sad to have two almost identical functions for this, but we
- do it all for performance... :( */
static void m68k_run_1 (void)
{
for (;;) {
- int cycles;
- uae_u32 opcode = get_iword_prefetch (0);
-#if 0
- if (get_ilong (0) != do_get_mem_long (&regs.prefetch)) {
- debugging = 1;
- return;
- }
-#endif
- /* assert (!regs.stopped && !(regs.spcflags & SPCFLAG_STOP)); */
-/* regs_backup[backup_pointer = (backup_pointer + 1) % 16] = regs;*/
-#if COUNT_INSTRS == 2
- if (table68k[opcode].handler != -1)
- instrcount[table68k[opcode].handler]++;
-#elif COUNT_INSTRS == 1
- instrcount[opcode]++;
-#endif
-#if defined X86_ASSEMBLY
- __asm__ __volatile__("\tcall *%%ebx"
- : "=&a" (cycles) : "b" (cpufunctbl[opcode]), "0" (opcode)
- : "%edx", "%ecx",
- "%esi", "%edi", "%ebp", "memory", "cc");
-#else
- cycles = (*cpufunctbl[opcode])(opcode);
-#endif
- /*n_insns++;*/
- cycles &= cycles_mask;
- cycles |= cycles_val;
- do_cycles (cycles);
- if (regs.spcflags) {
- if (do_specialties ())
- return;
- }
- }
-}
-
-/* Same thing, but don't use prefetch to get opcode. */
-static void m68k_run_2 (void)
-{
- for (;;) {
- int cycles;
uae_u32 opcode = get_iword (0);
-#if 0
- if (get_ilong (0) != do_get_mem_long (&regs.prefetch)) {
- debugging = 1;
- return;
- }
-#endif
- /* assert (!regs.stopped && !(regs.spcflags & SPCFLAG_STOP)); */
-/* regs_backup[backup_pointer = (backup_pointer + 1) % 16] = regs;*/
-#if COUNT_INSTRS == 2
- if (table68k[opcode].handler != -1)
- instrcount[table68k[opcode].handler]++;
-#elif COUNT_INSTRS == 1
- instrcount[opcode]++;
-#endif
-#if defined X86_ASSEMBLY
- __asm__ __volatile__("\tcall *%%ebx"
- : "=&a" (cycles) : "b" (cpufunctbl[opcode]), "0" (opcode)
- : "%edx", "%ecx",
- "%esi", "%edi", "%ebp", "memory", "cc");
-#else
- cycles = (*cpufunctbl[opcode])(opcode);
-#endif
- /*n_insns++;*/
- cycles &= cycles_mask;
- cycles |= cycles_val;
- do_cycles (cycles);
+ (*cpufunctbl[opcode])(opcode);
if (regs.spcflags) {
if (do_specialties ())
return;
@@ -1308,29 +1176,19 @@
}
}
-#ifdef X86_ASSEMBLY
-STATIC_INLINE void m68k_run1 (func)
-{
- /* Work around compiler bug: GCC doesn't push %ebp in m68k_run_1. */
- __asm__ __volatile__ ("pushl %%ebp\n\tcall *%0\n\tpopl %%ebp"
- : : "r" (func) : "%eax", "%edx", "%ecx", "memory", "cc");
-}
-#else
-#define m68k_run1(F) F
-#endif
+#define m68k_run1 m68k_run_1
int in_m68k_go = 0;
void m68k_go (int may_quit)
{
+// m68k_go() must be reentrant for Execute68k() and Execute68kTrap() to work
+/*
if (in_m68k_go || !may_quit) {
write_log ("Bug! m68k_go is not reentrant.\n");
abort ();
}
-
- reset_frame_rate_hack ();
- update_68k_cycles ();
-
+*/
in_m68k_go++;
for (;;) {
if (quit_program > 0) {
@@ -1338,12 +1196,13 @@
break;
quit_program = 0;
m68k_reset ();
- reset_all_systems ();
- customreset ();
}
- if (debugging)
- debug ();
- m68k_run1 (currprefs.cpu_compatible ? m68k_run_1 : m68k_run_2);
+ m68k_run1();
+ }
+ if (debugging) {
+ uaecptr nextpc;
+ m68k_dumpstate(&nextpc);
+ exit(1);
}
in_m68k_go--;
}
@@ -1463,8 +1322,6 @@
(regs.fpsr & 0x4000000) != 0,
(regs.fpsr & 0x2000000) != 0,
(regs.fpsr & 0x1000000) != 0);
- if (currprefs.cpu_compatible)
- printf ("prefetch %08lx\n", (unsigned long)do_get_mem_long(&regs.prefetch));
m68k_disasm(m68k_getpc (), nextpc, 1);
if (nextpc)
diff -burN uae/newcpu.h bas/newcpu.h
--- uae/newcpu.h 1999-10-22 12:27:18.000000000 -0500
+++ bas/newcpu.h 2017-09-09 14:19:43.000000000 -0500
@@ -6,7 +6,17 @@
* Copyright 1995 Bernd Schmidt
*/
-#include <machdep/m68k.h>
+#define SPCFLAG_STOP 2
+#define SPCFLAG_DISK 4
+#define SPCFLAG_INT 8
+#define SPCFLAG_BRK 16
+#define SPCFLAG_EXTRA_CYCLES 32
+#define SPCFLAG_TRACE 64
+#define SPCFLAG_DOTRACE 128
+#define SPCFLAG_DOINT 256
+#define SPCFLAG_BLTNASTY 512
+#define SPCFLAG_EXEC 1024
+#define SPCFLAG_MODE_CHANGE 8192
#ifndef SET_CFLG
@@ -224,6 +234,7 @@
extern void m68k_dumpstate (uaecptr *);
extern void m68k_disasm (uaecptr, uaecptr *, int);
extern void m68k_reset (void);
+extern void m68k_enter_debugger(void);
extern void mmu_op (uae_u32, uae_u16);
diff -burN uae/readcpu.cpp bas/readcpu.cpp
--- uae/readcpu.cpp 2017-09-04 20:36:24.000000000 -0500
+++ bas/readcpu.cpp 2017-09-04 20:40:37.000000000 -0500
@@ -6,12 +6,12 @@
* Copyright 1995,1996 Bernd Schmidt
*/
-#include "sysconfig.h"
-#include "sysdeps.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <ctype.h>
-#include "config.h"
-#include "options.h"
+#include "sysdeps.h"
#include "readcpu.h"
int nr_cpuop_funcs;
@neozeed
Copy link

neozeed commented Sep 23, 2018

What version is the UAE CPU? I never could find one that was anywhere near this close to match.

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment