EmuSpeed setting saved in config file and bound to current code... fastmotion is a bit overpowered. -_-;

This commit is contained in:
grinvader
2005-05-18 00:36:00 +00:00
parent 9f4b0dc525
commit 190760d337
5 changed files with 59 additions and 45 deletions

View File

@@ -111,7 +111,7 @@ extern unsigned int newengen;
extern char SRAMDrive[2]; extern char SRAMDrive[2];
extern unsigned char DontSavePath; extern unsigned char DontSavePath;
extern unsigned char guioff; extern unsigned char guioff;
extern unsigned int frameskip; extern unsigned char frameskip;
extern unsigned char enterpress; extern unsigned char enterpress;
extern unsigned char cvidmode; extern unsigned char cvidmode;
extern unsigned char antienab; extern unsigned char antienab;

View File

@@ -105,7 +105,7 @@ EXTSYM JoyMaxX209,JoyMinY209,JoyMaxY209,GetCoords,GetCoords3,MultiTap,SFXEnable
EXTSYM RestoreSystemVars,GUIBIFIL,GUIHQ2X,GUIHQ3X,GUIHQ4X,firstsaveinc,nssdip1 EXTSYM RestoreSystemVars,GUIBIFIL,GUIHQ2X,GUIHQ3X,GUIHQ4X,firstsaveinc,nssdip1
EXTSYM nssdip2,nssdip3,nssdip4,nssdip5,nssdip6,SkipMovie,MovieStop,MoviePlay EXTSYM nssdip2,nssdip3,nssdip4,nssdip5,nssdip6,SkipMovie,MovieStop,MoviePlay
EXTSYM MovieRecord,MovieInsertChapter,MovieSeekAhead,MovieSeekBehind EXTSYM MovieRecord,MovieInsertChapter,MovieSeekAhead,MovieSeekBehind
EXTSYM ResetDuringMovie,MovieDumpRaw,EmuSpeed EXTSYM ResetDuringMovie,MovieDumpRaw
%ifdef __LINUX__ %ifdef __LINUX__
EXTSYM numlockptr EXTSYM numlockptr
@@ -604,6 +604,7 @@ NEWSYM INCRFrameKey, dd 0
NEWSYM PauseLoad, db 0 NEWSYM PauseLoad, db 0
NEWSYM PauseRewind, db 0 NEWSYM PauseRewind, db 0
NEWSYM KeyResetSpeed, dd 0 NEWSYM KeyResetSpeed, dd 0
NEWSYM EmuSpeed, db 29 ; 29 = 1x, 0 = /30 and 58 = 30x
;end NEWSYM end ;end NEWSYM end
GUIsave equ $-GUIRAdd GUIsave equ $-GUIRAdd

View File

@@ -6326,6 +6326,7 @@ DisplayGUISpeed: ;Speed Options
mov eax,dword[GUIwinposx+21*4] ;Slider mov eax,dword[GUIwinposx+21*4] ;Slider
mov ebx,dword[GUIwinposy+21*4] mov ebx,dword[GUIwinposy+21*4]
add eax,15
add ebx,31 add ebx,31
mov ecx,eax mov ecx,eax
add ecx,116 add ecx,116

View File

@@ -140,7 +140,6 @@ unsigned char *spc7110romptr;
unsigned char MusicRelVol = 75; unsigned char MusicRelVol = 75;
unsigned char MusicVol = 0; unsigned char MusicVol = 0;
unsigned char MMXextSupport = 0; unsigned char MMXextSupport = 0;
unsigned char EmuSpeed = 29; // 29 = 1x, 0 = /30 and 58 = 30x
void outofmemory(); void outofmemory();
void init(); void init();

View File

@@ -49,7 +49,7 @@ EXTSYM oamram,objhipr,objptr,objptrn,objsize1,objsize2,spritetablea,sprleftpr
EXTSYM sprlefttot,vcache4b,objadds1,objadds2,objmovs1,objmovs2,tltype4b EXTSYM sprlefttot,vcache4b,objadds1,objadds2,objmovs1,objmovs2,tltype4b
EXTSYM vidmemch4,vram,bgptr,bgptrc,bgptrd,curtileptr,vcache2b,vcache8b,vidmemch8 EXTSYM vidmemch4,vram,bgptr,bgptrc,bgptrd,curtileptr,vcache2b,vcache8b,vidmemch8
EXTSYM offsetmshl,NextLineCache,tltype2b,tltype8b,objwlrpos,snesinputdefault EXTSYM offsetmshl,NextLineCache,tltype2b,tltype8b,objwlrpos,snesinputdefault
EXTSYM cycleinputdevice,Change_Dir,LoadDrive,LoadDir EXTSYM cycleinputdevice,Change_Dir,LoadDrive,LoadDir,EmuSpeed
; Process stuff & Cache sprites ; Process stuff & Cache sprites
@@ -303,6 +303,7 @@ NEWSYM cachevideo
mov dword[sramb4save],0 mov dword[sramb4save],0
.nofocussave .nofocussave
; fast forward goes over all other throttles
cmp byte[FastFwdToggle],0 cmp byte[FastFwdToggle],0
jne .ffmode2 jne .ffmode2
mov eax,[KeyFastFrwrd] mov eax,[KeyFastFrwrd]
@@ -319,7 +320,7 @@ NEWSYM cachevideo
cmp byte[FastForwardLock],1 cmp byte[FastForwardLock],1
je near .fastfor je near .fastfor
.ffskip .ffskip
; next up, check for slowdown
cmp byte[FastFwdToggle],0 cmp byte[FastFwdToggle],0
jne .sdmode2 jne .sdmode2
mov eax,[KeySlowDown] mov eax,[KeySlowDown]
@@ -337,13 +338,25 @@ NEWSYM cachevideo
je near .slowdwn je near .slowdwn
jmp .sdskip jmp .sdskip
.slowdwn .slowdwn
mov byte[SloMo],1 ; hardcoded 50% slowdown mov byte[SloMo],1 ; hardcoded /2 slowdown (for now)
jmp .skipnoslowdown jmp .throttleskip
.sdskip .sdskip
mov byte[SloMo],0 mov byte[SloMo],0
.skipnoslowdown ; now we can look at emuspeed
cmp byte[EmuSpeed],30 ; 0-28 slow, 29 normal, 30-58 skip
jb .noskipping
inc byte[frskipper]
push ebx
mov bl,[EmuSpeed]
sub bl,29 ; 30-58 -> 1-29 frames to skip, 2x-30x speed
jmp .fastforb
.noskipping
mov byte[SloMo],29
mov al,[EmuSpeed]
sub byte[SloMo],al ; 0-29 -> repeat 29-0 times, /30-1x speed
.throttleskip
mov ax,[SloMo] mov ax,[SloMo]
inc ax ; total times frame is drawn inc ax ; total times frame is drawn
cmp byte[frameskip],0 cmp byte[frameskip],0
jne near .frameskip jne near .frameskip
@@ -373,7 +386,7 @@ NEWSYM cachevideo
.fastfor .fastfor
inc byte[frskipper] inc byte[frskipper]
push ebx push ebx
mov bl,10 ; hardcoded number of frames to skip mov bl,10 ; hardcoded 11x fastforward (for now)
jmp .fastforb jmp .fastforb
.frameskip .frameskip
inc byte[frskipper] inc byte[frskipper]