|
|
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 "cart.h"
14: #include "cycInt.h"
15: #include "m68000.h"
16: #include "reset.h"
17: #include "screen.h"
18: #include "nextMemory.h"
19: #include "video.h"
1.1.1.2 ! root 20: #include "debugcpu.h"
1.1 root 21:
22:
23: /*-----------------------------------------------------------------------*/
24: /**
25: * Reset ST emulator states, chips, interrupts and registers.
26: * Return zero or negative TOS image load error code.
27: */
28: static int Reset_ST(bool bCold)
29: {
30: if (bCold)
31: {
32: int ret;
33: memory_init(8*1024*1024);
34:
35: }
36: CycInt_Reset(); /* Reset interrupts */
37: Video_Reset(); /* Reset video */
38:
39: Screen_Reset(); /* Reset screen */
40: M68000_Reset(bCold); /* Reset CPU */
1.1.1.2 ! root 41: DebugCpu_SetDebugging(); /* Re-set debugging flag if needed */
1.1 root 42:
43: return 0;
44: }
45:
46:
47: /*-----------------------------------------------------------------------*/
48: /**
49: * Cold reset ST (reset memory, all registers and reboot)
50: */
51: int Reset_Cold(void)
52: {
53: Main_WarpMouse(sdlscrn->w/2, sdlscrn->h/2); /* Set mouse pointer to the middle of the screen */
54:
55: return Reset_ST(true);
56: }
57:
58:
59: /*-----------------------------------------------------------------------*/
60: /**
61: * Warm reset ST (reset registers, leave in same state and reboot)
62: */
63: int Reset_Warm(void)
64: {
65: return Reset_ST(false);
66: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.