--- previous/src/gui-sdl/dlgMemory.c 2018/04/24 19:28:23 1.1.1.2 +++ previous/src/gui-sdl/dlgMemory.c 2018/04/24 19:30:46 1.1.1.3 @@ -1,10 +1,10 @@ /* - Hatari - dlgMemory.c + Previous - dlgMemory.c This file is distributed under the GNU Public License, version 2 or at your option any later version. Read the file gpl.txt for details. */ -const char DlgMemory_fileid[] = "Hatari dlgMemory.c : " __DATE__ " " __TIME__; +const char DlgMemory_fileid[] = "Previous dlgMemory.c : " __DATE__ " " __TIME__; #include "main.h" #include "dialog.h" @@ -13,6 +13,7 @@ const char DlgMemory_fileid[] = "Hatari #include "file.h" #include "screen.h" +#define GUI_SAVE_MEMORY 0 #define DLGMEM_8MB 4 #define DLGMEM_16MB 5 @@ -26,13 +27,16 @@ const char DlgMemory_fileid[] = "Hatari #define DLGMEM_80NS 14 #define DLGMEM_60NS 15 +#if GUI_SAVE_MEMORY #define DLGMEM_FILENAME 19 #define DLGMEM_SAVE 20 #define DLGMEM_RESTORE 21 #define DLGMEM_AUTOSAVE 22 #define DLGMEM_EXIT 23 - +#else +#define DLGMEM_EXIT 16 +#endif void Dialog_MemDlgDraw(void); static char dlgSnapShotName[36+1]; @@ -41,7 +45,11 @@ char custom_memsize[16] = "Customize"; /* The memory dialog: */ static SGOBJ memorydlg[] = { +#if GUI_SAVE_MEMORY { SGBOX, 0, 0, 0,0, 41,28, NULL }, +#else + { SGBOX, 0, 0, 0,0, 41,18, NULL }, +#endif { SGTEXT, 0, 0, 14,1, 12,1, "Memory options" }, { SGBOX, 0, 0, 1,3, 19,10, NULL }, @@ -59,7 +67,9 @@ static SGOBJ memorydlg[] = { SGRADIOBUT, 0, 0, 23,7, 8,1, "100 ns" }, { SGRADIOBUT, 0, 0, 23,8, 7,1, "80 ns" }, { SGRADIOBUT, 0, 0, 23,9, 7,1, "60 ns" }, - + + { SGBUTTON, SG_DEFAULT, 0, 10,15, 23,1, "Back to system menu" }, +#if GUI_SAVE_MEMORY { SGBOX, 0, 0, 1,14, 39,10, NULL }, { SGTEXT, 0, 0, 2,15, 17,1, "Load/Save memory state (untested)" }, { SGTEXT, 0, 0, 2,17, 20,1, "Snap-shot file name:" }, @@ -67,8 +77,9 @@ static SGOBJ memorydlg[] = { SGBUTTON, 0, 0, 8,20, 10,1, "Save" }, { SGBUTTON, 0, 0, 22,20, 10,1, "Restore" }, { SGCHECKBOX, 0, 0, 2,22, 37,1, "Load/save state at start-up/exit" }, - - { SGBUTTON, SG_DEFAULT, 0, 10,26, 20,1, "Back to main menu" }, + + { SGBUTTON, SG_DEFAULT, 0, 10,26, 21,1, "Back to main menu" }, +#endif { -1, 0, 0, 0,0, 0,0, NULL } }; @@ -118,6 +129,19 @@ bool Dialog_MemDlg(void) memorydlg[DLGMEM_128MB] = disable_128mb_option; defsizecount = 8; } + + /* Display memory speed options depending on system type */ + if (ConfigureParams.System.bTurbo) { + memorydlg[DLGMEM_120NS].txt = "60 ns"; + memorydlg[DLGMEM_100NS].txt = "70 ns"; + memorydlg[DLGMEM_80NS].txt = "80 ns"; + memorydlg[DLGMEM_60NS].txt = "100 ns"; + } else { + memorydlg[DLGMEM_120NS].txt = "120 ns"; + memorydlg[DLGMEM_100NS].txt = "100 ns"; + memorydlg[DLGMEM_80NS].txt = "80 ns"; + memorydlg[DLGMEM_60NS].txt = "60 ns"; + } /* Draw dialog from actual values */ @@ -178,6 +202,7 @@ bool Dialog_MemDlg(void) Dialog_MemAdvancedDlg(ConfigureParams.Memory.nMemoryBankSize); Dialog_MemDlgDraw(); break; +#if GUI_SAVE_MEMORY case DLGMEM_SAVE: /* Save memory snap-shot */ if (SDLGui_FileConfSelect(dlgSnapShotName, ConfigureParams.Memory.szMemoryCaptureFileName, @@ -195,6 +220,7 @@ bool Dialog_MemDlg(void) return true; } break; +#endif } } while (but != DLGMEM_EXIT && but != SDLGUI_QUIT @@ -210,9 +236,9 @@ bool Dialog_MemDlg(void) ConfigureParams.Memory.nMemorySpeed = MEMORY_80NS; else ConfigureParams.Memory.nMemorySpeed = MEMORY_60NS; - +#if GUI_SAVE_MEMORY ConfigureParams.Memory.bAutoSave = (memorydlg[DLGMEM_AUTOSAVE].state & SG_SELECTED); - +#endif return false; } @@ -288,7 +314,7 @@ void Dialog_MemDlgDraw(void) { memorydlg[DLGMEM_100NS].state |= SG_SELECTED; break; } - +#if GUI_SAVE_MEMORY File_ShrinkName(dlgSnapShotName, ConfigureParams.Memory.szMemoryCaptureFileName, memorydlg[DLGMEM_FILENAME].w); @@ -296,4 +322,5 @@ void Dialog_MemDlgDraw(void) { memorydlg[DLGMEM_AUTOSAVE].state |= SG_SELECTED; else memorydlg[DLGMEM_AUTOSAVE].state &= ~SG_SELECTED; +#endif } \ No newline at end of file