|
|
1.1 root 1: /*
2: Hatari - hatari-glue.c
3:
4: This file is distributed under the GNU Public License, version 2 or at
5: your option any later version. Read the file gpl.txt for details.
6:
7: This file contains some code to glue the UAE CPU core to the rest of the
8: emulator and Hatari's "illegal" opcodes.
9: */
10: const char HatariGlue_fileid[] = "Hatari hatari-glue.c : " __DATE__ " " __TIME__;
11:
12:
13: #include <stdio.h>
14:
15: #include "main.h"
16: #include "configuration.h"
17: #include "video.h"
18:
19: #include "sysdeps.h"
20: #include "maccess.h"
21: #include "memory.h"
22: #include "newcpu.h"
23: #include "hatari-glue.h"
24:
25:
26: struct uae_prefs currprefs, changed_prefs;
27:
28: /**
29: * Initialize 680x0 emulation
30: */
1.1.1.4 root 31: int Init680x0(void) {
1.1 root 32: currprefs.cpu_level = changed_prefs.cpu_level = ConfigureParams.System.nCpuLevel;
33:
34: switch (currprefs.cpu_level) {
35: case 3 : currprefs.cpu_model = 68030; break;
36: case 4 : currprefs.cpu_model = 68040; break;
1.1.1.4 root 37: default: fprintf (stderr, "Init680x0() : Error, cpu_level not supported (%i)\n",currprefs.cpu_model);
1.1 root 38: }
1.1.1.3 root 39:
40: currprefs.fpu_model = changed_prefs.fpu_model = ConfigureParams.System.n_FPUType;
41: switch (currprefs.fpu_model) {
42: case 68881: currprefs.fpu_revision = 0x1f; break;
43: case 68882: currprefs.fpu_revision = 0x20; break;
44: case 68040:
45: if (ConfigureParams.System.bTurbo)
46: currprefs.fpu_revision = 0x41;
47: else
48: currprefs.fpu_revision = 0x40;
49: break;
50: default: fprintf (stderr, "Init680x0() : Error, fpu_model unknown\n");
51: }
1.1 root 52:
53: currprefs.cpu_compatible = changed_prefs.cpu_compatible = ConfigureParams.System.bCompatibleCpu;
54: currprefs.fpu_strict = changed_prefs.fpu_strict = ConfigureParams.System.bCompatibleFPU;
1.1.1.3 root 55: currprefs.mmu_model = changed_prefs.mmu_model = ConfigureParams.System.bMMU?changed_prefs.cpu_model:0;
56:
1.1.1.2 root 57: write_log("Init680x0() called\n");
1.1 root 58:
59: init_m68k();
60:
61: return true;
62: }
63:
64:
65: /**
66: * Deinitialize 680x0 emulation
67: */
68: void Exit680x0(void)
69: {
70: memory_uninit();
71:
72: free(table68k);
73: table68k = NULL;
74: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.