Emuspeed keyb shortcuts bound, better handling of emu pause/frame increase while throttling, removed some unused EXTSYMs from recent changes, made average FPS calculation work with replay-to-record feature. TODO: fix fastmotion speed, currently 4 times what is asked -_-;

This commit is contained in:
grinvader
2005-05-19 19:46:02 +00:00
parent 42fe56748d
commit 4a3303231b
6 changed files with 48 additions and 27 deletions

View File

@@ -22,7 +22,7 @@
EXTSYM KeyRewind,statesaver,timer2upd,Voice0Status,UpdateDPage,MessageOn
EXTSYM MsgCount,Msgptr,StartGUI,cbitmode,debuggeron,romdata,initvideo,newgfx16b
EXTSYM cvidmode,vidbuffer,vidbufferofsa,disable65816sh,GUISaveVars,virqnodisable
EXTSYM cvidmode,vidbufferofsa,disable65816sh,GUISaveVars,virqnodisable
EXTSYM KeySaveState,KeyLoadState,KeyQuickExit,KeyQuickLoad,KeyQuickRst
EXTSYM GUIDoReset,GUIReset,KeyOnStA,KeyOnStB,ProcessKeyOn,C4Enable,KeyQuickClock
EXTSYM KeyQuickSaveSPC,TimerEnable,IRQHack,HIRQLoc,splitflags,joinflags
@@ -45,7 +45,7 @@ EXTSYM JoyBOrig,JoyBNow,JoyCOrig,JoyCNow,JoyDOrig,JoyDNow,JoyEOrig,JoyENow
EXTSYM SA1Message,MultiTapStat,idledetectspc,SA1Control,SA1Enable,SA1IRQEnable
EXTSYM SPC700read,SPC700write,numspcvblleft,spc700idle,SA1IRQExec,ForceNewGfxOff
EXTSYM LethEnData,GUIQuit,IRAM,SA1Ptr,SA1BWPtr,scrnon,scaddset,outofmemfix
EXTSYM yesoutofmemory,ProcessMovies,MovieStop,ppustatus,C4VBlank,copyvid
EXTSYM yesoutofmemory,ProcessMovies,MovieStop,ppustatus,C4VBlank
EXTSYM ReturnFromSPCStall,scanlines,smallscreenon,ScreenScale,MainLoop
EXTSYM NumberOfOpcodes,SfxCLSR,SfxSCMR,SfxPOR,sfx128lineloc,sfx160lineloc
EXTSYM sfx192lineloc,sfxobjlineloc,sfxclineloc,PLOTJmpa,PLOTJmpb,FxTable
@@ -55,8 +55,7 @@ EXTSYM fxbit67pcal,SfxSFR,nosprincr,cpucycle,switchtovirqdeb,switchtonmideb
EXTSYM MovieSeekBehind,SaveSramData,BackupCVFrame,RestoreCVFrame,loadstate
EXTSYM KeyInsrtChap,KeyNextChap,KeyPrevChap,MovieInsertChapter,MovieSeekAhead
EXTSYM ResetDuringMovie,EMUPauseKey,INCRFrameKey,MovieWaiting,NoInputRead
EXTSYM AllocatedRewindStates,SlowDownLock,FastForwardLock
EXTSYM PauseFrameMode,RestorePauseFrame,BackupPauseFrame
EXTSYM AllocatedRewindStates,PauseFrameMode,RestorePauseFrame,BackupPauseFrame
%ifdef __MSDOS__
EXTSYM dssel
@@ -1335,7 +1334,7 @@ NEWSYM cpuover
mov byte[NextNGDisplay],1
cmp byte[newengen],0
je .nonewgfx
cmp byte[curblank],0h
cmp byte[curblank],0
jne .nonewgfx
cmp byte[ForceNewGfxOff],0
jne .nonewgfx
@@ -1447,10 +1446,6 @@ NEWSYM cpuover
cmp byte[EMUPause],1
jne .noemupause
; prevents some random desyncs
mov byte[SlowDownLock],0
mov byte[FastForwardLock],0
cmp byte[PauseFrameMode],1
jne .nopauseframemode1
mov [tempedx],edx

View File

@@ -30,8 +30,8 @@ EXTSYM ZOpenFileName,ZFileSeekMode,ZFileSeekPos,ZFileSeekHandle,ZFileWriteHandle
EXTSYM ZFileWriteSize,ZFileWriteBlock,ZFileWrite,ZFileReadHandle,ZFileReadSize
EXTSYM ZFileReadBlock,ZFileRead,ZFileDelFName,ZFileDelete,ZCloseFileHandle
EXTSYM ZCloseFile,ZFileTellHandle,ZFileTell,GetTime,GetDate,ZFFTimeFName,ZFTime
EXTSYM ZFDate,ZFileGetFTime,ZFileMKDir,ZFileCHDir,ZFileRMDir,CHPath,MKPath
EXTSYM RMPath,ZFileGetDir,DirName,pressed,DTALoc,DTALocPos,ZFileFindATTRIB
EXTSYM ZFDate,ZFileGetFTime,ZFileCHDir,CHPath
EXTSYM ZFileGetDir,DirName,pressed,DTALoc,DTALocPos,ZFileFindATTRIB
EXTSYM ZFileFindFirst,ZFileFindNext,ZFileFindPATH,oldhand9s,oldhand9o,interror
EXTSYM oldhand8s,oldhand8o,oldhandSBs,oldhandSBo,NoSoundReinit,soundon
EXTSYM DSPDisable,SBInt,PICMaskP,SBIrq,SBHandler,InitSB,handler8h

View File

@@ -28,8 +28,8 @@ EXTSYM ZFileSeekPos,ZFileSeekHandle,ZFileWriteHandle,ZFileWriteSize
EXTSYM ZFileWriteBlock,ZFileWrite,ZFileReadHandle,ZFileReadSize,ZFileReadBlock
EXTSYM ZFileRead,ZFileDelFName,ZFileDelete,ZCloseFileHandle,ZCloseFile
EXTSYM ZFileTellHandle,ZFileTell,ZFFTimeFName,ZFTime,ZFDate,ZFileGetFTime
EXTSYM GetTime,GetDate,GUIkeydelay2,ZFileMKDir,ZFileCHDir,ZFileRMDir,CHPath
EXTSYM MKPath,RMPath,ZFileGetDir,DirName,DTALoc,DTALocPos,ZFileFindATTRIB
EXTSYM GetTime,GetDate,GUIkeydelay2,ZFileCHDir,CHPath
EXTSYM ZFileGetDir,DirName,DTALoc,DTALocPos,ZFileFindATTRIB
EXTSYM ZFileFindFirst,ZFileFindNext,ZFileFindPATH,soundon,DSPDisable,Start60HZ
EXTSYM pressed,RaisePitch,AdjustFrequency,vidbufferofsb,vidbuffer,clearwin
EXTSYM Stop60HZ,initwinvideo,vesa2_rpos,vesa2_gpos,vesa2_bpos,vesa2_rposng

View File

@@ -49,7 +49,8 @@ EXTSYM oamram,objhipr,objptr,objptrn,objsize1,objsize2,spritetablea,sprleftpr
EXTSYM sprlefttot,vcache4b,objadds1,objadds2,objmovs1,objmovs2,tltype4b
EXTSYM vidmemch4,vram,bgptr,bgptrc,bgptrd,curtileptr,vcache2b,vcache8b,vidmemch8
EXTSYM offsetmshl,NextLineCache,tltype2b,tltype8b,objwlrpos,snesinputdefault
EXTSYM cycleinputdevice,Change_Dir,LoadDrive,LoadDir,EmuSpeed
EXTSYM cycleinputdevice,Change_Dir,LoadDrive,LoadDir,EmuSpeed,SDRatio,FFRatio
EXTSYM KeyResetSpeed,KeyEmuSpeedUp,KeyEmuSpeedDown,EMUPause
; Process stuff & Cache sprites
@@ -74,8 +75,6 @@ mousecheck db 0
SECTION .text
%macro stateselcomp 3
mov eax,[%1]
test byte[pressed+eax],1
@@ -109,7 +108,6 @@ SECTION .text
%%nosdis
%endmacro
UpdateVolume:
pushad
xor eax,eax
@@ -178,7 +176,6 @@ ClockCounter:
.noclear
ret
NEWSYM dsp1teststuff
; /////////////////////////////
mov dword[dsp1ptr],0
@@ -303,6 +300,10 @@ NEWSYM cachevideo
mov dword[sramb4save],0
.nofocussave
; if emulation paused, don't alter timing
mov ax,1
cmp byte[EMUPause],1
je near .ttldone
; fast forward goes over all other throttles
cmp byte[FastFwdToggle],0
jne .ffmode2
@@ -338,10 +339,11 @@ NEWSYM cachevideo
je near .slowdwn
jmp .sdskip
.slowdwn
mov byte[SloMo],1 ; hardcoded /2 slowdown (for now)
mov al,[SDRatio] ; 0-28
inc al ; 1-29
mov [SloMo],al ; /2-/30 slowmotion
jmp .throttleskip
.sdskip
mov byte[SloMo],0
; now we can look at emuspeed
cmp byte[EmuSpeed],30 ; 0-28 slow, 29 normal, 30-58 skip
jb .noskipping
@@ -357,6 +359,7 @@ NEWSYM cachevideo
.throttleskip
mov ax,[SloMo]
inc ax ; total times frame is drawn
.ttldone
cmp byte[frameskip],0
jne near .frameskip
@@ -374,7 +377,6 @@ NEWSYM cachevideo
jb .noskip2
mov byte[curblank],40h
inc byte[fskipped]
mov al,40h
mov cl,[maxskip]
cmp byte[fskipped],cl
jbe near .nofrskip
@@ -386,7 +388,8 @@ NEWSYM cachevideo
.fastfor
inc byte[frskipper]
push ebx
mov bl,10 ; hardcoded 11x fastforward (for now)
mov bl,byte[FFRatio] ; 0-28
inc bl ; 1-29, 2x-30x fastmotion
jmp .fastforb
.frameskip
inc byte[frskipper]
@@ -397,7 +400,6 @@ NEWSYM cachevideo
pop ebx
jae .nofrskip
mov byte[curblank],40h
mov al,40h
jmp .frskip
.nofrskip
mov byte[frskipper],0
@@ -494,6 +496,28 @@ NEWSYM cachevideo
mov eax,[MsgCount]
mov [MessageOn],eax
.nodis5
mov eax,[KeyEmuSpeedDown]
test byte[pressed+eax],1
jz .nospeeddown
mov byte[pressed+eax],2
cmp byte[EmuSpeed],0
je .nospeeddown
dec byte[EmuSpeed]
.nospeeddown
mov eax,[KeyEmuSpeedUp]
test byte[pressed+eax],1
jz .nospeedup
mov byte[pressed+eax],2
cmp byte[EmuSpeed],58
je .nospeedup
inc byte[EmuSpeed]
.nospeedup
mov eax,[KeyResetSpeed]
test byte[pressed+eax],1
jz .nospeedreset
mov byte[pressed+eax],2
mov byte[EmuSpeed],29
.nospeedreset
mov eax,[KeyResetAll]
test byte[pressed+eax],1
je .nodis6

View File

@@ -30,8 +30,8 @@ EXTSYM ZFileSeekMode,ZFileSeekPos,ZFileSeekHandle,ZFileWriteHandle
EXTSYM ZFileWriteSize,ZFileWriteBlock,ZFileWrite,ZFileReadHandle,ZFileReadSize
EXTSYM ZFileReadBlock,ZFileRead,ZFileDelFName,ZFileDelete,ZCloseFileHandle
EXTSYM ZCloseFile,ZFileTellHandle,ZFileTell,ZFFTimeFName,ZFTime,ZFDate
EXTSYM ZFileGetFTime,GetTime,GetDate,GUIkeydelay2,_chdrive,ZFileMKDir,ZFileCHDir
EXTSYM ZFileRMDir,CHPath,MKPath,RMPath,ZFileGetDir,DirName,_getdrive,DTALoc
EXTSYM ZFileGetFTime,GetTime,GetDate,GUIkeydelay2,_chdrive,ZFileCHDir
EXTSYM CHPath,ZFileGetDir,DirName,_getdrive,DTALoc
EXTSYM DTALocPos,ZFileFindATTRIB,ZFileFindFirst,ZFileFindNext,ZFileFindPATH
EXTSYM soundon,DSPDisable,Start60HZ,pressed,RaisePitch,AdjustFrequency
EXTSYM vidbufferofsb,vidbuffer,clearwin,Stop60HZ,initwinvideo,vesa2_rpos

View File

@@ -888,7 +888,7 @@ static void zmv_create(char *filename)
zmv_vars.header.zst_size = cur_zst_size;
zmv_vars.header.zmv_flag.start_method = (enum zmv_start_methods)MovieStartMethod;
zmv_vars.header.zmv_flag.video_mode = romispal ? zmv_vm_pal : zmv_vm_ntsc;
zmv_vars.header.average_fps = romispal ? 250 : 240;
zmv_vars.header.initial_input = (pl1contrl ? BIT(0xF) : 0) |
(pl2contrl ? BIT(0xE) : 0) |
(pl3contrl ? BIT(0xD) : 0) |
@@ -1014,7 +1014,9 @@ static void zmv_record(bool pause, unsigned char combos_used, unsigned char slow
{
unsigned char flag = 0;
unsigned char press_buf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
static float average = 1.0f;
static float average = 0.0f;
if (!average) { average = (float)zmv_vars.header.average_fps/((romispal) ? 250.0f : 240.0f); }
size_t skip_bits = 0;
if (pause) { zmv_vars.header.incr_frames++; }