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