Added auto save state increment feature

This commit is contained in:
pagefault
2001-08-23 05:30:00 +00:00
parent 901ed64319
commit 0a3e7c4a8b
6 changed files with 75 additions and 23 deletions

View File

@@ -33,7 +33,7 @@ EXTSYM frameskip,initvideo,newgfx16b,oldhandSBo,oldhandSBs,soundon,cvidmode
EXTSYM vidbuffer,vidbufferofsa,vidbufferofsb,disable65816sh,GUISaveVars,virqnodisable EXTSYM vidbuffer,vidbufferofsa,vidbufferofsb,disable65816sh,GUISaveVars,virqnodisable
EXTSYM KeySaveState,KeyLoadState,KeyQuickExit,KeyQuickLoad,KeyQuickRst,GUIDoReset EXTSYM KeySaveState,KeyLoadState,KeyQuickExit,KeyQuickLoad,KeyQuickRst,GUIDoReset
EXTSYM KeyOnStA,KeyOnStB,ProcessKeyOn,printnum,sramsavedis,DSPDisable,C4Enable EXTSYM KeyOnStA,KeyOnStB,ProcessKeyOn,printnum,sramsavedis,DSPDisable,C4Enable
EXTSYM KeyQuickClock,KeyQuickMinimize,TimerEnable EXTSYM KeyQuickClock,KeyQuickMinimize,TimerEnable,AutoIncSaveSlot
EXTSYM IRQHack,HIRQLoc,Offby1line,splitflags,joinflags,KeyQuickSnapShot EXTSYM IRQHack,HIRQLoc,Offby1line,splitflags,joinflags,KeyQuickSnapShot
EXTSYM csounddisable,videotroub,Open_File,Close_File,Read_File,ResetTripleBuf EXTSYM csounddisable,videotroub,Open_File,Close_File,Read_File,ResetTripleBuf
EXTSYM Write_File,Output_Text,Create_File,Check_Key,Get_Key,Change_Dir,InitPreGame EXTSYM Write_File,Output_Text,Create_File,Check_Key,Get_Key,Change_Dir,InitPreGame
@@ -1498,18 +1498,53 @@ NEWSYM sramsave
.savesrmmsg1 db 'SRAM DATA SAVED.',0 .savesrmmsg1 db 'SRAM DATA SAVED.',0
.savesrmmsg2 db 'NO SRAM DATA.',0 .savesrmmsg2 db 'NO SRAM DATA.',0
NEWSYM firstsaveinc, db 0
NEWSYM statesaver NEWSYM statesaver
clim clim
sub dword[Curtableaddr],tableA sub dword[Curtableaddr],tableA
sub dword[spcPCRam],spcRam sub dword[spcPCRam],spcRam
sub dword[spcRamDP],spcRam sub dword[spcRamDP],spcRam
call PrepareSaveState call PrepareSaveState
call unpackfunct call unpackfunct
call initrevst call initrevst
; Auto increment save state slot
cmp byte[AutoIncSaveSlot],0
je .donesaveinc
cmp byte[firstsaveinc],1
je .clearfirstinc
mov eax,[statefileloc]
mov dh,[fnamest+eax]
%ifndef __LINUX__
cmp dh,'T'
%else
cmp dh,'t'
%endif
je .secondstate
cmp dh,'9'
je .jumptofirststate
inc dh
jmp .donextstate
.secondstate
mov dh,'1'
jmp .donextstate
.jumptofirststate
%ifndef __LINUX__
mov dh,'T'
%else
mov dh,'t'
%endif
.donextstate
mov byte[fnamest+eax],dh
xor dh,dh
jmp .donesaveinc
.clearfirstinc
mov byte[firstsaveinc],0
.donesaveinc
; jmp .skipsaves ; jmp .skipsaves
; Save State ; Save State
%ifdef __LINUX__ %ifdef __LINUX__
@@ -1636,6 +1671,7 @@ NEWSYM statesaver
mov eax,[MsgCount] mov eax,[MsgCount]
mov [MessageOn],eax mov [MessageOn],eax
ret ret
.nosavestuff .nosavestuff
add dword[Curtableaddr],tableA add dword[Curtableaddr],tableA
add dword[spcPCRam],spcRam add dword[spcPCRam],spcRam

View File

@@ -170,6 +170,7 @@ EXTSYM DeInitModemC
EXTSYM ipxgetchar,ipxsendchar,TCPIPStoreByte EXTSYM ipxgetchar,ipxsendchar,TCPIPStoreByte
EXTSYM TCPIPGetByte,GUIBIFIL EXTSYM TCPIPGetByte,GUIBIFIL
EXTSYM ModemSendChar EXTSYM ModemSendChar
EXTSYM firstsaveinc
%ifdef __LINUX__ %ifdef __LINUX__
EXTSYM numlockptr EXTSYM numlockptr
%endif %endif
@@ -584,6 +585,7 @@ NEWSYM DisableScreenSaver, db 0
NEWSYM TrapMouseCursor, db 1 NEWSYM TrapMouseCursor, db 1
NEWSYM KeyQuickClock, dd 0 NEWSYM KeyQuickClock, dd 0
NEWSYM KeyQuickMinimize, dd 0 NEWSYM KeyQuickMinimize, dd 0
NEWSYM AutoIncSaveSlot, db 0
GUIsave equ $-GUIRAdd GUIsave equ $-GUIRAdd

View File

@@ -826,12 +826,11 @@ GUIOptionKeys:
mov [cfgnewgfx],al mov [cfgnewgfx],al
.invalidng .invalidng
.nonewgfx .nonewgfx
; cmp dh,'V' cmp dh,'T'
; jne .novsync jne .noautoincsave
; xor byte[vsyncon],1 xor byte[AutoIncSaveSlot],1
; mov al,[vsyncon] mov byte[firstsaveinc],1
; mov [cfgvsync],al .noautoincsave
;.novsync
cmp dh,'M' cmp dh,'M'
jne .nommxcopy jne .nommxcopy
xor byte[FPUCopy],2 xor byte[FPUCopy],2

View File

@@ -1332,6 +1332,20 @@ GUIWinClicked:
%%noclick %%noclick
%endmacro %endmacro
%macro GUIClickCButtonAS 3
cmp eax,%1+1
jl %%noclick
cmp edx,%2+3
jl %%noclick
cmp eax,%1+6
jg %%noclick
cmp edx,%2+8
jg %%noclick
xor %3,1
mov byte[firstsaveinc],1
%%noclick
%endmacro
%macro GUISlidebarPostImpl 13 ; x1,y1,x2,y2,upjump,downjump,holdpos,scsize,view,cur,listsize %macro GUISlidebarPostImpl 13 ; x1,y1,x2,y2,upjump,downjump,holdpos,scsize,view,cur,listsize
cmp dword[%11],0 cmp dword[%11],0
je near %%nolower je near %%nolower
@@ -2153,7 +2167,7 @@ DisplayGUIOptionClick:
jne near .invalidng jne near .invalidng
GUIClickCButton2 11,36,byte[newengen],byte[cfgnewgfx],1 GUIClickCButton2 11,36,byte[newengen],byte[cfgnewgfx],1
.invalidng .invalidng
; GUIClickCButton2 11,46,byte[vsyncon],byte[cfgvsync],1 GUIClickCButtonAS 11,46,byte[AutoIncSaveSlot]
GUIClickCButtonMMX 11,56,byte[FPUCopy] GUIClickCButtonMMX 11,56,byte[FPUCopy]
GUIClickCButtonM 11,66,byte[pl12s34] GUIClickCButtonM 11,66,byte[pl12s34]
%ifdef __MSDOS__ %ifdef __MSDOS__

View File

@@ -1391,7 +1391,7 @@ DisplayGUIOption:
GUIOuttextwin2 4,6,16,[GUITemp] GUIOuttextwin2 4,6,16,[GUITemp]
GUIOuttextwin2u 4,26,31,GUIOptionText2,0 GUIOuttextwin2u 4,26,31,GUIOptionText2,0
GUIOuttextwin2u 4,26,41,GUIOptionText4,0 GUIOuttextwin2u 4,26,41,GUIOptionText4,0
; GUIOuttextwin2u 4,26,51,GUIOptionText5,0 GUIOuttextwin2u 4,26,51,GUIOptionText5,2
GUIOuttextwin2u 4,26,61,GUIOptionText6,0 GUIOuttextwin2u 4,26,61,GUIOptionText6,0
GUIOuttextwin2u 4,26,71,GUIOptionText7,0 GUIOuttextwin2u 4,26,71,GUIOptionText7,0
%ifdef __MSDOS__ %ifdef __MSDOS__
@@ -1417,7 +1417,7 @@ DisplayGUIOption:
GUIOuttextwin2 4,5,15,[GUITemp] GUIOuttextwin2 4,5,15,[GUITemp]
GUIOuttextwin2 4,25,30,GUIOptionText2 GUIOuttextwin2 4,25,30,GUIOptionText2
GUIOuttextwin2 4,25,40,GUIOptionText4 GUIOuttextwin2 4,25,40,GUIOptionText4
; GUIOuttextwin2 4,25,50,GUIOptionText5 GUIOuttextwin2 4,25,50,GUIOptionText5
GUIOuttextwin2 4,25,60,GUIOptionText6 GUIOuttextwin2 4,25,60,GUIOptionText6
GUIOuttextwin2 4,25,70,GUIOptionText7 GUIOuttextwin2 4,25,70,GUIOptionText7
%ifdef __MSDOS__ %ifdef __MSDOS__
@@ -1458,12 +1458,12 @@ DisplayGUIOption:
mov dword[GUITemp],GUIIconDataCheckBoxC mov dword[GUITemp],GUIIconDataCheckBoxC
.nocheckbox1 .nocheckbox1
GUIDisplayIconWin 4,11,36,[GUITemp] GUIDisplayIconWin 4,11,36,[GUITemp]
; mov dword[GUITemp],GUIIconDataCheckBoxUC mov dword[GUITemp],GUIIconDataCheckBoxUC
; cmp byte[vsyncon],0 cmp byte[AutoIncSaveSlot],0
; je .nocheckbox2 je .nocheckbox2
; mov dword[GUITemp],GUIIconDataCheckBoxC mov dword[GUITemp],GUIIconDataCheckBoxC
;.nocheckbox2 .nocheckbox2
; GUIDisplayIconWin 4,11,46,[GUITemp] GUIDisplayIconWin 4,11,46,[GUITemp]
mov dword[GUITemp],GUIIconDataCheckBoxUC mov dword[GUITemp],GUIIconDataCheckBoxUC
cmp byte[FPUCopy],2 cmp byte[FPUCopy],2
jne .nocheckbox3 jne .nocheckbox3
@@ -1602,7 +1602,7 @@ GUIOptionText1 db 'FRAME RATE',0
GUIOptionText2 db 'AUTO FRAME RATE',0 GUIOptionText2 db 'AUTO FRAME RATE',0
GUIOptionText3 db 'MAX FRAME SKIP',0 GUIOptionText3 db 'MAX FRAME SKIP',0
GUIOptionText4 db 'NEW GFX ENGINE',0 GUIOptionText4 db 'NEW GFX ENGINE',0
;GUIOptionText5 db 'VSYNC',0 GUIOptionText5 db 'AUTO INCRMNT SAVE SLOT',0
GUIOptionText6 db 'MMX SUPPORT',0 GUIOptionText6 db 'MMX SUPPORT',0
GUIOptionText7 db 'USE PL3/4 AS PL1/2',0 GUIOptionText7 db 'USE PL3/4 AS PL1/2',0
GUIOptionTextA db 'SIDEWINDER FIX',0 GUIOptionTextA db 'SIDEWINDER FIX',0

View File

@@ -30,7 +30,7 @@ EXTSYM StateBackup
EXTSYM ADSRGAINSwitch,FPUCopy,ScreenScale,SoundQuality EXTSYM ADSRGAINSwitch,FPUCopy,ScreenScale,SoundQuality
EXTSYM debugger,pl1contrl,pl2contrl,romtype,smallscreence EXTSYM debugger,pl1contrl,pl2contrl,romtype,smallscreence
EXTSYM smallscreenon,spcon EXTSYM smallscreenon,spcon
EXTSYM statefileloc,LatestSave EXTSYM statefileloc,LatestSave,firstsaveinc
EXTSYM Create_File,Delete_File,Open_File,Get_File_Date,Close_File,Change_Dir,Get_Dir EXTSYM Create_File,Delete_File,Open_File,Get_File_Date,Close_File,Change_Dir,Get_Dir
EXTSYM romloadskip EXTSYM romloadskip
EXTSYM cfgloadgdir,cfgloadsdir EXTSYM cfgloadgdir,cfgloadsdir
@@ -1228,6 +1228,7 @@ NEWSYM makeextension
call GetFilename call GetFilename
popad popad
%endif %endif
mov byte[firstsaveinc],1
cmp byte[LatestSave],1 cmp byte[LatestSave],1
je .latestsave je .latestsave
ret ret