Annotation of frontvm/hardware/reset.c, revision 1.1

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: 
        !            10: #include "main.h"
        !            11: #include "decode.h"
        !            12: #include "hostcall.h"
        !            13: #include "int.h"
        !            14: #include "m68000.h"
        !            15: #include "misc.h"
        !            16: #include "reset.h"
        !            17: #include "screen.h"
        !            18: #include "audio.h"
        !            19: #include "stMemory.h"
        !            20: #include "video.h"
        !            21: #include "loadfe2.h"
        !            22: #include "dialog.h"
        !            23: 
        !            24: unsigned long STRamEnd;                 /* End of ST Ram, above this address is no-mans-land and hardware vectors */
        !            25: 
        !            26: /*-----------------------------------------------------------------------*/
        !            27: /*
        !            28:   Set default memory configuration, connected floppies and memory size
        !            29: */
        !            30: void SetDefaultMemoryConfig(void)
        !            31: {
        !            32:   STMemory_WriteLong(0x42e, MEMORY_SIZE);          /* phys top */
        !            33:   
        !            34:   /* Set memory range */
        !            35:   STRamEnd = MEMORY_SIZE;  /* Set end of RAM */
        !            36: 
        !            37:   /* Initialize the memory banks: */
        !            38:   memory_uninit();
        !            39:   memory_init(STRamEnd, 0, MEMORY_SIZE);
        !            40: }
        !            41: 
        !            42: 
        !            43: /*-----------------------------------------------------------------------*/
        !            44: /*
        !            45:   Reset ST emulator states, chips, interrupts and registers
        !            46: */
        !            47: int Reset_VM ()
        !            48: {
        !            49:   STMemory_Clear(0x00000000, MEMORY_SIZE);   /* Clear First 4Mb */
        !            50: 
        !            51:   SetDefaultMemoryConfig();
        !            52:   LoadFE2 ();
        !            53:   STMemory_WriteLong(4, FE2BASE);        /* Set reset vector */
        !            54:   STMemory_WriteLong(0, MEMORY_SIZE);        /* And reset stack pointer */
        !            55:   
        !            56:   Int_Reset();                  /* Reset interrupts */
        !            57:   Video_Reset();                /* Reset video */
        !            58: 
        !            59:   GemDOS_Reset();               /* Reset GEMDOS emulation */
        !            60: 
        !            61:   Audio_Reset();                /* Reset Sound */
        !            62:   Screen_Reset();               /* Reset screen */
        !            63:   M68000_Reset(TRUE);          /* Reset CPU */
        !            64: 
        !            65:   /* And keyboard check for debugger */
        !            66: #ifdef USE_DEBUGGER
        !            67:   Int_AddAbsoluteInterrupt(CYCLES_DEBUGGER, INTERRUPT_DEBUGGER);
        !            68: #endif
        !            69: 
        !            70:   return 0;
        !            71: }

unix.superglobalmegacorp.com

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