|
|
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: static char rcsid[] = "Hatari $Id: hatari-glue.c,v 1.19 2003/06/20 13:13:22 thothy Exp $"; ! 11: ! 12: ! 13: #include <stdio.h> ! 14: ! 15: #include "../hardware/main.h" ! 16: #include "../hardware/int.h" ! 17: #include "../hardware/stMemory.h" ! 18: ! 19: #include "sysdeps.h" ! 20: #include "maccess.h" ! 21: #include "memory.h" ! 22: #include "newcpu.h" ! 23: ! 24: #ifndef FALSE ! 25: #define FALSE 0 ! 26: #define TRUE 1 ! 27: #endif ! 28: ! 29: ! 30: int illegal_mem = FALSE; ! 31: int address_space_24 = TRUE; ! 32: int cpu_level = 0; /* 68000 (default) */ ! 33: int cpu_compatible = FALSE; ! 34: ! 35: int requestedInterrupt = -1; ! 36: ! 37: ! 38: /* Reset custom chips */ ! 39: void customreset(void) ! 40: { ! 41: requestedInterrupt = -1; ! 42: } ! 43: ! 44: ! 45: /* Return interrupt number (1 - 7), -1 means no interrupt. */ ! 46: int intlev(void) ! 47: { ! 48: int ret = requestedInterrupt; ! 49: requestedInterrupt = -1; ! 50: ! 51: return ret; ! 52: } ! 53: ! 54: ! 55: /* Initialize 680x0 emulation */ ! 56: int Init680x0(void) ! 57: { ! 58: /* Note: memory_init() is now done in tos.c */ ! 59: ! 60: init_m68k(); ! 61: return TRUE; ! 62: } ! 63: ! 64: ! 65: /* Deinitialize 680x0 emulation */ ! 66: void Exit680x0(void) ! 67: { ! 68: memory_uninit(); ! 69: } ! 70: ! 71: ! 72: /* Reset and start 680x0 emulation */ ! 73: void Start680x0(void) ! 74: { ! 75: m68k_reset(); ! 76: m68k_go(TRUE); ! 77: } ! 78: ! 79: ! 80: /* Check if the CPU type has been changed */ ! 81: void check_prefs_changed_cpu(int new_level, int new_compatible) ! 82: { ! 83: if(cpu_level!=new_level || cpu_compatible!=new_compatible) ! 84: { ! 85: cpu_level = new_level; ! 86: cpu_compatible = new_compatible; ! 87: set_special(SPCFLAG_MODE_CHANGE); ! 88: if (table68k) ! 89: build_cpufunctbl (); ! 90: } ! 91: } ! 92: ! 93: ! 94:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.