|
|
1.1 root 1: /*
2: Hatari
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: Reset emulation state.
8: */
9: const char Reset_fileid[] = "Hatari reset.c : " __DATE__ " " __TIME__;
10:
11: #include "main.h"
12: #include "configuration.h"
13: #include "cycInt.h"
14: #include "m68000.h"
15: #include "reset.h"
16: #include "screen.h"
17: #include "nextMemory.h"
1.1.1.4 ! root 18: #include "tmc.h"
1.1 root 19: #include "video.h"
1.1.1.2 root 20: #include "debugcpu.h"
1.1.1.3 root 21: #include "scsi.h"
1.1.1.4 ! root 22: #include "mo.h"
1.1.1.3 root 23: #include "sysReg.h"
1.1.1.4 ! root 24: #include "rtcnvram.h"
1.1.1.3 root 25: #include "scc.h"
26: #include "ethernet.h"
1.1.1.4 ! root 27: #include "floppy.h"
! 28: #include "snd.h"
! 29: #include "printer.h"
! 30: #include "dsp.h"
1.1 root 31:
32:
33: /*-----------------------------------------------------------------------*/
34: /**
35: * Reset ST emulator states, chips, interrupts and registers.
36: * Return zero or negative TOS image load error code.
37: */
1.1.1.3 root 38: static const char* Reset_ST(bool bCold)
1.1 root 39: {
40: if (bCold)
41: {
1.1.1.3 root 42: const char* error_str;
43: error_str=memory_init(ConfigureParams.Memory.nMemoryBankSize);
44: if (error_str!=NULL) {
45: return error_str;
46: }
1.1 root 47: }
48: CycInt_Reset(); /* Reset interrupts */
49: Video_Reset(); /* Reset video */
1.1.1.4 ! root 50: TMC_Reset(); /* Reset TMC Registers */
! 51: SCR_Reset(); /* Reset System Control Registers */
! 52: nvram_init(); /* Reset NVRAM */
! 53: SCSI_Reset(); /* Reset SCSI disks */
! 54: MO_Reset(); /* Reset MO disks */
! 55: Floppy_Reset(); /* Reset Floppy disks */
! 56: SCC_Reset(2); /* Reset SCC */
! 57: Ethernet_Reset(true); /* Reset Ethernet */
! 58: Sound_Reset(); /* Reset Sound */
! 59: Printer_Reset(); /* Reset Printer */
1.1.1.3 root 60: Screen_Reset(); /* Reset screen */
1.1.1.4 ! root 61: DSP_Reset(); /* Reset DSP */
1.1 root 62: M68000_Reset(bCold); /* Reset CPU */
1.1.1.4 ! root 63: DebugCpu_SetDebugging(); /* Re-set debugging flag if needed */
1.1 root 64:
1.1.1.3 root 65: return NULL;
1.1 root 66: }
67:
68:
69: /*-----------------------------------------------------------------------*/
70: /**
71: * Cold reset ST (reset memory, all registers and reboot)
72: */
1.1.1.3 root 73: const char* Reset_Cold(void)
1.1 root 74: {
75: Main_WarpMouse(sdlscrn->w/2, sdlscrn->h/2); /* Set mouse pointer to the middle of the screen */
76:
77: return Reset_ST(true);
78: }
79:
80:
81: /*-----------------------------------------------------------------------*/
82: /**
83: * Warm reset ST (reset registers, leave in same state and reboot)
84: */
1.1.1.3 root 85: const char* Reset_Warm(void)
1.1 root 86: {
87: return Reset_ST(false);
88: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.