Code cleanup. Save location can now be edited in GUI. *nix can now correctly save in a location other than ~/.zsnes

This commit is contained in:
n-a-c-h
2005-01-10 02:21:51 +00:00
parent bcff1629aa
commit 1b62e9286f
16 changed files with 154 additions and 169 deletions

View File

@@ -73,7 +73,7 @@ EXTSYM curblank, vidpastecopyscr, frameskip, newengen, vsyncon
EXTSYM cvidmode, antienab, smallscreenon, smallscreence,NetQuit
EXTSYM soundon, StereoSound, SoundQuality, MusicRelVol
EXTSYM endprog, continueprog, spcBuffera, spcRamcmp, cbitmode, makepal
EXTSYM t1cc, LoadDir, SRAMDir, LoadDrive,SRAMDrive, initsnes, romloadskip
EXTSYM t1cc, LoadDir, LoadDrive, SRAMDir, SRAMChdir, SRAMDirCurDir, initsnes, romloadskip
EXTSYM fname, makeextension, sram, loadfileGUI, GUIloadfailed
EXTSYM SetupROM,CheckROMType, romdata, ForcePal, ramsize, ramsizeand, curromsize
EXTSYM romispal, totlines, cfgloadsdir, init65816, procexecloop
@@ -630,7 +630,6 @@ NEWSYM hqFilter, db 0
NEWSYM reserved, db 0
NEWSYM scale2xFilter, db 0
NEWSYM st010difficulty, db 0 ; place holder till we commit the other Seta 10 file
NEWSYM SRAMPath, times 1024 db 0
NEWSYM SnapPath, times 1024 db 0
NEWSYM SPCPath, times 1024 db 0
NEWSYM BSXPath, times 1024 db 0
@@ -1473,9 +1472,9 @@ SECTION .text
NEWSYM SaveSramData
; change to sram dir
mov dl,[SRAMDrive]
mov ebx,SRAMDir
call Change_Dir
pushad
call SRAMChdir
popad
cmp byte[sramsavedis],1
je .savesramdone
@@ -1834,9 +1833,9 @@ NEWSYM StartGUI
call SaveSramData
; change to sram dir
mov dl,[SRAMDrive]
mov ebx,SRAMDir
call Change_Dir
pushad
call SRAMChdir
popad
call GUIQuickLoadUpdate
call LoadDetermine
@@ -2060,9 +2059,9 @@ NEWSYM StartGUI
cmp byte[CheatWinMode],0
je near .csskip
; change to sram dir
mov dl,[SRAMDrive]
mov ebx,SRAMDir
call Change_Dir
pushad
call SRAMChdir
popad
; Load Cheat Search File
mov edx,cstempfname
@@ -2488,9 +2487,9 @@ NEWSYM StartGUI
call GUISaveVars
; change dir to SRAMDrive/SRAMDir
mov dl,[SRAMDrive]
mov ebx,SRAMDir
call Change_Dir
pushad
call SRAMChdir
popad
mov byte[MousePRClick],1
mov byte[prevbright],0
@@ -2587,9 +2586,9 @@ SRAMDirc:
mov edx,LoadDrive
call Get_Dir
; change to sram dir
mov dl,[SRAMDrive]
mov ebx,SRAMDir
call Change_Dir
pushad
call SRAMChdir
popad
ret
LOADDir:
@@ -3123,7 +3122,9 @@ MoviePlay:
mov dword[fnamest+ebx-3],'.zmv'
mov al,[CMovieExt]
mov byte[fnamest+ebx],al
call ChangetoSRAMdir
pushad
call SRAMChdir
popad
mov dword[Totalbyteloaded],0
call loadstate2
mov edx,fnamest+1
@@ -3644,14 +3645,6 @@ DisplayBoxes:
.nomore
ret
ChangetoSRAMdir:
mov dl,[SRAMDrive]
mov ebx,SRAMDir
call Change_Dir
ret
ChangetoLOADdir:
mov dl,[LoadDrive]
mov ebx,LoadDir
@@ -3671,8 +3664,9 @@ GUIProcStates:
ret
.yesstate
mov byte[GUICBHold],0
; change dir to SRAMDrive/SRAMDir
call ChangetoSRAMdir
pushad
call SRAMChdir
popad
cmp byte[GUIStatesText5],1
je .loadstate
call statesaver
@@ -3690,8 +3684,9 @@ GUIProcStates:
ret
SaveSecondState:
; change dir to SRAMDrive/SRAMDir
call ChangetoSRAMdir
pushad
call SRAMChdir
popad
mov ebx,[statefileloc]
mov al,[fnamest+ebx]
mov byte[fnamest+ebx],'s'
@@ -3704,7 +3699,9 @@ SaveSecondState:
ret
LoadSecondState:
call ChangetoSRAMdir
pushad
call SRAMChdir
popad
mov ebx,[statefileloc]
mov al,[fnamest+ebx]
mov byte[fnamest+ebx],'s'

View File

@@ -1651,7 +1651,7 @@ GUIPathKeys:
cmp dword[GUIInputBox],1
jne .notBox1
mov eax,SRAMPath
mov eax,SRAMDir
jmp .boxselected
.notBox1
cmp dword[GUIInputBox],2

View File

@@ -248,9 +248,9 @@ GUIloadfilename:
%ifndef __LINUX__
cmp byte[cfgloadsdir],0
jne .nosdrive
mov ebx,SRAMDir
mov edx,SRAMDrive
call Get_Dir
pushad
call SRAMDirCurDir
popad
%endif
.nosdrive

View File

@@ -58,7 +58,9 @@ MovieRecord:
mov dword[CFWriteStart],64
.nocheckit
mov byte[MovieRecordWinVal],0
call ChangetoSRAMdir
pushad
call SRAMChdir
popad
mov byte[NoPictureSave],1
cmp byte[MovieProcessing],0
jne .nostatesaver

View File

@@ -3241,7 +3241,7 @@ DisplayGUIChipClick
ret
DisplayGUIPathsClick
GUITextBoxInputNach 75,15,230,25,1,1024 ;SRAMPath
GUITextBoxInputNach 75,15,230,25,1,1024 ;SRAMDir
GUITextBoxInputNach 75,35,230,45,2,1024 ;SnapPath
GUITextBoxInputNach 75,55,230,65,3,1024 ;SPCPath
GUITextBoxInputNach 8,95,100,105,4,1024 ;BSXPath

View File

@@ -1661,7 +1661,9 @@ NetLoadStuff:
mov al,[NetStateSize+2]
call RemoteSendChar
call SendPacket
call ChangetoSRAMdir
pushad
call SRAMChdir
popad
mov edx,fnamest+1
call Open_File
mov [NetLoadHandle],ax
@@ -1690,7 +1692,9 @@ loadstaterecvinit:
cmp dh,0
je .noreceive2
mov [NetStateSize+2],dl
call ChangetoSRAMdir
pushad
call SRAMChdir
popad
mov edx,Netfname
call Create_File
mov edx,[NetStateSize]
@@ -1827,7 +1831,9 @@ loadstaterecv:
pushad
mov bx,[NetLoadHandle]
call Close_File
call ChangetoSRAMdir
pushad
call SRAMChdir
popad
mov edx,Netfname
mov byte[RestoreValues],0
call loadstate3

View File

@@ -6322,7 +6322,7 @@ BlinkCursorCheck:
.checkboxes
cmp dword[GUIInputBox],1
jne .notBox1
mov ebx,SRAMPath
mov ebx,SRAMDir
ret
.notBox1
cmp dword[GUIInputBox],2
@@ -6380,7 +6380,7 @@ BlinkCursorCheck:
DisplayGUIPaths:
GUIDrawWindowBox 19,GUIPathsDisp
sub byte[GUItextcolor],15
;GUIOuttextwin2 19,8,18,GUIPathsText1
GUIOuttextwin2 19,8,18,GUIPathsText1
GUIOuttextwin2 19,8,38,GUIPathsText2
GUIOuttextwin2 19,8,58,GUIPathsText3
GUIOuttextwin2 19,60,78,GUIPathsText4
@@ -6395,7 +6395,7 @@ DisplayGUIPaths:
GUIOuttextwin2 19,135,173,GUIPathsTextD
add byte[GUItextcolor],15
;GUIOuttextwin2 19,7,17,GUIPathsText1
GUIOuttextwin2 19,7,17,GUIPathsText1
GUIOuttextwin2 19,7,37,GUIPathsText2
GUIOuttextwin2 19,7,57,GUIPathsText3
GUIOuttextwin2 19,59,77,GUIPathsText4
@@ -6410,7 +6410,7 @@ DisplayGUIPaths:
GUIOuttextwin2 19,134,172,GUIPathsTextD
;Input boxes - alternate color
;DrawGUIWinBox 19,74,14,232,26,177
DrawGUIWinBox 19,74,14,232,26,177
DrawGUIWinBox 19,74,34,232,46,177
DrawGUIWinBox 19,74,54,232,66,177
DrawGUIWinBox 19,7,94,107,106,177
@@ -6423,7 +6423,7 @@ DisplayGUIPaths:
DrawGUIWinBox 19,134,179,236,191,177
;Input boxes
;DrawGUIWinBox 19,75,15,231,25,167
DrawGUIWinBox 19,75,15,231,25,167
DrawGUIWinBox 19,75,35,231,45,167
DrawGUIWinBox 19,75,55,231,65,167
DrawGUIWinBox 19,8,95,106,105,167
@@ -6435,7 +6435,7 @@ DisplayGUIPaths:
DrawGUIWinBox 19,135,155,235,165,167
DrawGUIWinBox 19,135,180,235,190,167
;GUIOuttextwin2d 19,77,19,SRAMPath,25
GUIOuttextwin2d 19,77,19,SRAMDir,25
GUIOuttextwin2d 19,77,39,SnapPath,25
GUIOuttextwin2d 19,77,59,SPCPath,25
GUIOuttextwin2d 19,10,99,BSXPath,15

View File

@@ -38,7 +38,7 @@ EXTSYM Clear2xSaIBuffer
EXTSYM romdata,romtype,ScreenShotFormat
EXTSYM Voice0Disable,Voice1Disable,Voice2Disable,Voice3Disable
EXTSYM Voice4Disable,Voice5Disable,Voice6Disable,Voice7Disable
EXTSYM SRAMDrive, SRAMDir, SPCPath, SnapPath, Change_Dir, CHPath, ZFileCHDir
EXTSYM SRAMChdir, SPCPath, SnapPath, Change_Dir, CHPath, ZFileCHDir
%ifndef NO_PNG
EXTSYM Grab_PNG_Data
%endif
@@ -56,9 +56,7 @@ EXTSYM Grab_PNG_Data
%macro ChangeDirSRAM 0
pushad
mov dl,[SRAMDrive]
mov ebx,SRAMDir
call Change_Dir
call SRAMChdir
popad
%endmacro