After a hefty load of hours without eating, movie replay/record is now ported to C, movies/states compatibility is finally restored, uic.c now has a real port of zstart, and video modes have now more room. Now gimme a kitten.

This commit is contained in:
grinvader
2005-02-19 22:11:38 +00:00
parent 7dfd9a321d
commit c4fee427ee
16 changed files with 1787 additions and 658 deletions

View File

@@ -167,6 +167,7 @@ EXTSYM GUIHQ3X
EXTSYM GUIHQ4X
EXTSYM firstsaveinc
EXTSYM nssdip1,nssdip2,nssdip3,nssdip4,nssdip5,nssdip6
EXTSYM SkipMovie,MovieStop,MoviePlay,MovieRecord
%ifdef __LINUX__
EXTSYM numlockptr
@@ -719,7 +720,7 @@ vbuflimbot resd 1
GUIScrolTim1 resd 1
GUIScrolTim2 resd 1
GUICHold resd 1
GUICBHold resd 1
NEWSYM GUICBHold, resd 1
GUICBHold2 resd 1
GUIDClickTL resd 1
GUIDClCWin resd 1
@@ -2346,6 +2347,9 @@ NEWSYM StartGUI
mov dword[PBackupPos],0
call RestoreCVFrame
popad
mov esi,[tempesi]
mov edi,[tempedi]
mov ebp,[tempebp]
.norestoreval
mov dword[nmiprevaddrl],0
@@ -3061,103 +3065,103 @@ ManualStatus resb 1
NEWSYM MovieCounter, resd 1
SECTION .data
UnableMovie2 db 'MUST PLAY WITH SOUND OFF',0
UnableMovie3 db 'MUST PLAY WITH SOUND ON',0
SECTION .text
MoviePlay:
cmp byte[CNetType],20
je near .dontplay
mov byte[GUICBHold],0
mov dword[MovieCounter],0
cmp byte[MovieProcessing],0
jne near .dontplay
mov byte[GUIQuit],2
mov ebx,[statefileloc]
mov eax,[fnamest+ebx-3]
push eax
mov dword[fnamest+ebx-3],'.zmv'
mov al,[CMovieExt]
mov byte[fnamest+ebx],al
pushad
call SRAMChdir
popad
mov dword[Totalbyteloaded],0
pushad
call loadstate2
popad
mov edx,fnamest+1
call Open_File
jc near .notexist
mov bx,ax
mov [MovieFileHand],bx
mov cx,[Totalbyteloaded+2]
mov dx,[Totalbyteloaded]
call File_Seek
mov edx,RecData
mov ecx,16
call Read_File
cmp byte[RecData+2],1
jne .noextra
mov eax,[RecData+3]
mov [timer2upd],eax
mov eax,[RecData+7]
mov [curexecstate],eax
mov dword[nmiprevaddrl],0
mov dword[nmiprevaddrh],0
mov dword[nmirept],0
mov dword[nmiprevline],224
mov dword[nmistatus],0
mov dword[spcnumread],0
mov dword[spchalted],-1
mov byte[NextLineCache],0
.noextra
mov al,[RecData]
cmp al,[soundon]
jne near .soundisoff
cmp dword[ramsize],0
je .noram
mov edx,[sram]
mov ecx,[ramsize]
call Read_File
.noram
mov byte[MovieProcessing],1
.skip
mov dword[PJoyAOrig],0
mov dword[PJoyBOrig],0
mov dword[PJoyCOrig],0
mov dword[PJoyDOrig],0
mov dword[PJoyEOrig],0
mov byte[sramsavedis],1
mov byte[UseRemoteSRAMData],0
mov byte[DSPMem+08h],0
mov byte[DSPMem+18h],0
mov byte[DSPMem+28h],0
mov byte[DSPMem+38h],0
mov byte[DSPMem+48h],0
mov byte[DSPMem+58h],0
mov byte[DSPMem+68h],0
mov byte[DSPMem+78h],0
.notexist
call ChangetoLOADdir
pop eax
mov ebx,[statefileloc]
mov [fnamest+ebx-3],eax
.dontplay
ret
.soundisoff
mov dword[Msgptr],UnableMovie2
cmp byte[soundon],0
jne .soundon
mov dword[Msgptr],UnableMovie3
.soundon
mov eax,[MsgCount]
mov [MessageOn],eax
call Close_File
pop eax
ret
NEWSYM UnableMovie2, db 'MUST PLAY WITH SOUND OFF',0
NEWSYM UnableMovie3, db 'MUST PLAY WITH SOUND ON',0
;SECTION .text
;
;MoviePlay:
; cmp byte[CNetType],20
; je near .dontplay
; mov byte[GUICBHold],0
; mov dword[MovieCounter],0
; cmp byte[MovieProcessing],0
; jne near .dontplay
; mov byte[GUIQuit],2
; mov ebx,[statefileloc]
; mov eax,[fnamest+ebx-3]
; push eax
; mov dword[fnamest+ebx-3],'.zmv'
; mov al,[CMovieExt]
; mov byte[fnamest+ebx],al
; pushad
; call SRAMChdir
; popad
; mov dword[Totalbyteloaded],0
; pushad
; call loadstate2
; popad
; mov edx,fnamest+1
; call Open_File
; jc near .notexist
; mov bx,ax
; mov [MovieFileHand],bx
; mov cx,[Totalbyteloaded+2]
; mov dx,[Totalbyteloaded]
; call File_Seek
; mov edx,RecData
; mov ecx,16
; call Read_File
; cmp byte[RecData+2],1
; jne .noextra
; mov eax,[RecData+3]
; mov [timer2upd],eax
; mov eax,[RecData+7]
; mov [curexecstate],eax
; mov dword[nmiprevaddrl],0
; mov dword[nmiprevaddrh],0
; mov dword[nmirept],0
; mov dword[nmiprevline],224
; mov dword[nmistatus],0
; mov dword[spcnumread],0
; mov dword[spchalted],-1
; mov byte[NextLineCache],0
;.noextra
; mov al,[RecData]
; cmp al,[soundon]
; jne near .soundisoff
; cmp dword[ramsize],0
; je .noram
; mov edx,[sram]
; mov ecx,[ramsize]
; call Read_File
;.noram
; mov byte[MovieProcessing],1
;.skip
; mov dword[PJoyAOrig],0
; mov dword[PJoyBOrig],0
; mov dword[PJoyCOrig],0
; mov dword[PJoyDOrig],0
; mov dword[PJoyEOrig],0
; mov byte[sramsavedis],1
; mov byte[UseRemoteSRAMData],0
; mov byte[DSPMem+08h],0
; mov byte[DSPMem+18h],0
; mov byte[DSPMem+28h],0
; mov byte[DSPMem+38h],0
; mov byte[DSPMem+48h],0
; mov byte[DSPMem+58h],0
; mov byte[DSPMem+68h],0
; mov byte[DSPMem+78h],0
;.notexist
; call ChangetoLOADdir
; pop eax
; mov ebx,[statefileloc]
; mov [fnamest+ebx-3],eax
;.dontplay
; ret
;.soundisoff
; mov dword[Msgptr],UnableMovie2
; cmp byte[soundon],0
; jne .soundon
; mov dword[Msgptr],UnableMovie3
;.soundon
; mov eax,[MsgCount]
; mov [MessageOn],eax
; call Close_File
; pop eax
; ret
;
SECTION .bss
NEWSYM Totalbyteloaded, resd 1
NEWSYM sramsavedis, resb 1
@@ -3605,7 +3609,7 @@ DisplayBoxes:
.nomore
ret
ChangetoLOADdir:
NEWSYM ChangetoLOADdir
mov dl,[LoadDrive]
mov ebx,LoadDir
call Change_Dir

View File

@@ -22,145 +22,15 @@
; Movie, Joystick setting (display) routines, SNES Reset Function
MovieRecord:
mov byte[GUICBHold],0
cmp byte[MovieProcessing],0
jne near .dontrecord
;jne .noreset
mov dword[MovieCounter],0
.noreset
; check if movie exists already
mov ebx,[statefileloc]
mov eax,[fnamest+ebx-3]
push eax
mov dword[fnamest+ebx-3],'.zmv'
mov al,[CMovieExt]
mov byte[fnamest+ebx],al
; check if file exists
cmp byte[MovieRecordWinVal],1
je .nocheck
mov edx,fnamest+1
call Open_File
jc .nocheck
mov bx,ax
call Close_File
mov byte[MovieRecordWinVal],1
jmp .skipstate
.nocheck
cmp byte[MovieProcessing],0
jne near .nocheckit
mov dword[CFWriteHead],0
mov dword[CReadHead],0
mov dword[ReadHead],0
mov dword[CFWriteStart],64
.nocheckit
mov byte[MovieRecordWinVal],0
pushad
call SRAMChdir
popad
mov byte[NoPictureSave],1
cmp byte[MovieProcessing],0
jne .nostatesaver
pushad
call statesaver
popad
.nostatesaver
mov byte[NoPictureSave],0
mov edx,fnamest+1
call Open_File_Write
mov bx,ax
mov [MovieFileHand],bx
mov cx,0
mov dx,0
call File_Seek_End
cmp byte[MovieProcessing],0
je .noappend
mov byte[MovieProcessing],2
jmp .netstuff
.noappend
mov al,[soundon]
mov [RecData],al
mov eax,[versionNumber]
mov [RecData+1],eax
mov byte[RecData+2],1
mov eax,[timer2upd]
mov [RecData+3],eax
mov eax,[curexecstate]
mov [RecData+7],eax
mov edx,RecData
mov ecx,16
call Write_File
cmp dword[ramsize],0
je .noram
mov edx,[sram]
mov ecx,[ramsize]
call Write_File
.noram
mov byte[MovieProcessing],2
mov dword[MovieBuffSize],0
mov dword[MovieBuffFrame],0
mov byte[RepeatFrame],0
cmp byte[CNetType],20
je near .netstuff
cmp byte[CNetType],21
je near .netstuff
mov dword[nmiprevaddrl],0
mov dword[nmiprevaddrh],0
mov dword[nmirept],0
mov dword[nmiprevline],224
mov dword[nmistatus],0
mov dword[spcnumread],0
mov dword[spchalted],-1
mov byte[NextLineCache],0
mov dword[PJoyAOrig],0
mov dword[PJoyBOrig],0
mov dword[PJoyCOrig],0
mov dword[PJoyDOrig],0
mov dword[PJoyEOrig],0
mov byte[DSPMem+08h],0
mov byte[DSPMem+18h],0
mov byte[DSPMem+28h],0
mov byte[DSPMem+38h],0
mov byte[DSPMem+48h],0
mov byte[DSPMem+58h],0
mov byte[DSPMem+68h],0
mov byte[DSPMem+78h],0
.netstuff
mov byte[MovieProcessing],2
call ChangetoLOADdir
.skipstate
pop eax
mov ebx,[statefileloc]
mov [fnamest+ebx-3],eax
.dontrecord
ret
SECTION .bss
MovieRecordWinVal resb 1
NEWSYM MovieRecordWinVal, resb 1
NEWSYM MovieProcessing, resb 1
NEWSYM MovieFileHand, resw 1
NEWSYM RepeatFrame, resb 1
NEWSYM RecData, resb 16
NEWSYM NoPictureSave, resb 1
SECTION .text
SkipMovie:
mov byte[MovieRecordWinVal],0
mov byte[GUICBHold],0
ret
MovieStop:
mov byte[GUICBHold],0
cmp byte[MovieProcessing],0
je .skipfileend
mov bx,[MovieFileHand]
mov byte[MovieProcessing],0
call Close_File
.skipfileend
ret
CalibrateDispA:
xor ebx,ebx
mov ecx,256
@@ -495,13 +365,8 @@ NEWSYM GUIDoReset
; mov byte[NetPlayNoMore],1
mov byte[RestoreValues],0
cmp byte[MovieProcessing],0
je .skipfileend
mov bx,[MovieFileHand]
mov byte[MovieProcessing],0
call Close_File
.skipfileend
pushad
call MovieStop
call RestoreSystemVars
popad

View File

@@ -567,15 +567,41 @@ ProcessMouseButtons:
cmp byte[GUICBHold],15
je near CalibrateDev1
cmp byte[GUICBHold],16
je near MoviePlay
jne .notMoviePlay
pushad
call MoviePlay
popad
ret
.notMoviePlay
cmp byte[GUICBHold],17
je near MovieRecord
jne .notMovieRecord0
pushad
call MovieRecord
popad
ret
.notMovieRecord0
cmp byte[GUICBHold],18
je near MovieStop
jne .notMovieStop
mov byte[GUICBHold],0
pushad
call MovieStop
popad
ret
.notMovieStop
cmp byte[GUICBHold],19
je near MovieRecord
jne .notMovieRecord1
pushad
call MovieRecord
popad
ret
.notMovieRecord1
cmp byte[GUICBHold],20
je near SkipMovie
jne .notSkipMovie
pushad
call SkipMovie
popad
ret
.notSkipMovie
cmp byte[GUICBHold],40
je near SetAllKeys
cmp byte[GUICBHold],50

View File

@@ -530,15 +530,14 @@ SECTION .text
call RemoteSendChar
mov al,222
call RemoteSendChar
; Dan - Change this from looking into the welcome message forthe version.
mov al,[versionNumber + 0]
call RemoteSendChar
mov al,[versionNumber + 1]
call RemoteSendChar
mov al,[versionNumber + 2]
call RemoteSendChar
mov al,[versionNumber + 3]
call RemoteSendChar
mov al,[versionNumber]
call RemoteSendChar
mov al,[versionNumber+1]
call RemoteSendChar
mov al,[versionNumber+2]
call RemoteSendChar
mov al,[versionNumber+3]
call RemoteSendChar
mov al,[soundon]
call RemoteSendChar
cmp al,byte[CNetType]
@@ -581,28 +580,28 @@ SECTION .text
.nocheck3
cmp byte[IDCheckPos],3
jne .nocheck4
cmp dl,[versionNumber + 0]
cmp dl,[versionNumber]
jne near .invversion
mov byte[IDCheckPos],4
ret
.nocheck4
cmp byte[IDCheckPos],4
jne .nocheck5
cmp dl,[versionNumber + 1]
cmp dl,[versionNumber+1]
jne near .invversion
mov byte[IDCheckPos],5
ret
.nocheck5
cmp byte[IDCheckPos],5
jne .nocheck6
cmp dl,[versionNumber + 2]
cmp dl,[versionNumber+2]
jne .invversion
mov byte[IDCheckPos],6
ret
.nocheck6
cmp byte[IDCheckPos],6
jne .nocheck7
cmp dl,[versionNumber + 3]
cmp dl,[versionNumber+3]
jne .invversion
mov byte[IDCheckPos],9
ret

View File

@@ -1921,13 +1921,13 @@ DisplayGUIVideo:
sub byte[GUItextcolor],15
%ifndef __MSDOS__
GUIOuttextwin2 5,12,76,GUIVideoTextw0
GUIOuttextwin2 5,12,83,GUIVideoTextw1
GUIOuttextwin2 5,12,90,GUIVideoTextw2
GUIOuttextwin2 5,12,97,GUIVideoTextw3
GUIOuttextwin2 5,8,76,GUIVideoTextw0
GUIOuttextwin2 5,10,85,GUIVideoTextw1
GUIOuttextwin2 5,10,92,GUIVideoTextw2
GUIOuttextwin2 5,10,99,GUIVideoTextw3
%endif
%ifdef __LINUX__
GUIOuttextwin2 5,12,104,GUIVideoTextw4
GUIOuttextwin2 5,10,106,GUIVideoTextw4
%endif
xor eax,eax
mov al,[cvidmode]
@@ -2057,13 +2057,13 @@ DisplayGUIVideo:
add byte[GUItextcolor],15
%ifndef __MSDOS__
GUIOuttextwin2 5,11,75,GUIVideoTextw0
GUIOuttextwin2 5,11,82,GUIVideoTextw1
GUIOuttextwin2 5,11,89,GUIVideoTextw2
GUIOuttextwin2 5,11,96,GUIVideoTextw3
GUIOuttextwin2 5,7,75,GUIVideoTextw0
GUIOuttextwin2 5,9,84,GUIVideoTextw1
GUIOuttextwin2 5,9,91,GUIVideoTextw2
GUIOuttextwin2 5,9,98,GUIVideoTextw3
%endif
%ifdef __LINUX__
GUIOuttextwin2 5,11,103,GUIVideoTextw4
GUIOuttextwin2 5,9,105,GUIVideoTextw4
%endif
xor eax,eax
mov al,[cvidmode]
@@ -2531,10 +2531,11 @@ GUIVideoText8 db 'SET',0 ; set button
GUIVideoText9 db 'VSYNC',0 ; -c
GUIVideoTextH db 'MODE : ',0
GUIVideoTextw0 db 'LEGEND:',0
GUIVideoTextw1 db ' S = SCALED TO FIT SCREEN',0
GUIVideoTextw2 db ' R = MATCHED SCREEN RATIO',0
GUIVideoTextw3 db ' D = ALLOW 2XSAI,HIRES,ETC',0
GUIVideoTextw4 db ' O = OPENGL MODE',0
GUIVideoTextw1 db 'S = STRETCH R = KEEP RATIO',0
GUIVideoTextw2 db ' D = ALLOW SPECIAL FILTERS',0
GUIVideoTextw3 db ' W = WIN F = FULL',0
GUIVideoTextw4 db ' O = USES OPENGL',0
SECTION .bss
GUIVStA resd 3
@@ -4825,7 +4826,7 @@ NEWSYM LatencyLeft, db 2
SECTION .bss
NEWSYM NetSwap, resb 1
RemCNetType resb 1
UseRemoteSRAMData resb 1
NEWSYM UseRemoteSRAMData, resb 1
ChatString resb 276
FileNameMod resb 512
CurCStringPos resd 1
@@ -5648,7 +5649,7 @@ DisplayGUIAbout:
ret
SECTION .data
GUIGUIAboutText1 db 'ZSNES ',ZVERSION,' ',0 ;Need room for date
GUIGUIAboutText1 db 'ZSNES V',ZVERSION,' ',0 ;Need room for date
GUIGUIAboutText2 db 'CODED BY : ',0
GUIGUIAboutText3 db ' ZSKNIGHT _DEMO_',0
GUIGUIAboutText4 db ' PAGEFAULT NACH',0
@@ -5793,7 +5794,7 @@ GUIMovieText7 db 'OKAY TO OVERWRITE?',0
GUIMovieText8 db 'YES',0
GUIMovieText9 db 'NO',0
GUIMovieTextA db 'STATUS : ',0
CMovieExt db 'v'
NEWSYM CMovieExt, db 'v'
SECTION .text