Annotation of previous/src/reset.c, revision 1.1.1.3

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.1.3 ! root       21: #include "scsi.h"
        !            22: #include "sysReg.h"
        !            23: #include "scc.h"
        !            24: #include "ethernet.h"
1.1       root       25: 
                     26: 
                     27: /*-----------------------------------------------------------------------*/
                     28: /**
                     29:  * Reset ST emulator states, chips, interrupts and registers.
                     30:  * Return zero or negative TOS image load error code.
                     31:  */
1.1.1.3 ! root       32: static const char* Reset_ST(bool bCold)
1.1       root       33: {
                     34:        if (bCold)
                     35:        {
1.1.1.3 ! root       36:                const char* error_str;
        !            37:                error_str=memory_init(ConfigureParams.Memory.nMemoryBankSize);
        !            38:                if (error_str!=NULL) {
        !            39:                        return error_str;
        !            40:                }
1.1       root       41:        }
                     42:        CycInt_Reset();               /* Reset interrupts */
                     43:        Video_Reset();                /* Reset video */
1.1.1.3 ! root       44:     SCR_Reset();                  /* Reset System Control Registers */
        !            45:     nvram_init();                 /* Reset NVRAM */
        !            46:     SCSI_Reset();                 /* Reset SCSI disks */
        !            47:     SCC_Reset();                  /* Reset SCC */
        !            48:     Ethernet_Reset();             /* Reset Ethernet */
        !            49:        Screen_Reset();               /* Reset screen */
1.1       root       50:        M68000_Reset(bCold);          /* Reset CPU */
1.1.1.3 ! root       51:        DebugCpu_SetDebugging();      /* Re-set debugging flag if needed */
1.1       root       52: 
1.1.1.3 ! root       53:        return NULL;
1.1       root       54: }
                     55: 
                     56: 
                     57: /*-----------------------------------------------------------------------*/
                     58: /**
                     59:  * Cold reset ST (reset memory, all registers and reboot)
                     60:  */
1.1.1.3 ! root       61: const char* Reset_Cold(void)
1.1       root       62: {
                     63:        Main_WarpMouse(sdlscrn->w/2, sdlscrn->h/2);  /* Set mouse pointer to the middle of the screen */
                     64: 
                     65:        return Reset_ST(true);
                     66: }
                     67: 
                     68: 
                     69: /*-----------------------------------------------------------------------*/
                     70: /**
                     71:  * Warm reset ST (reset registers, leave in same state and reboot)
                     72:  */
1.1.1.3 ! root       73: const char* Reset_Warm(void)
1.1       root       74: {
                     75:        return Reset_ST(false);
                     76: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.