Speed slider size and value display ok. TODO: make the mouse hold work, save EmuSpeed setting in config file and bind it to current code.

This commit is contained in:
grinvader
2005-05-14 13:39:55 +00:00
parent 5bb6f33d5c
commit af7dacccf7
3 changed files with 217 additions and 232 deletions

View File

@@ -55,15 +55,17 @@ ProcessMouse:
mov edx,223 mov edx,223
call Set_MouseYMax call Set_MouseYMax
.nohold1 .nohold1
cmp byte[GUIHold],5 cmp byte[GUIHold],5 ; Sound Slider
je .dohold5 je .dohold5
cmp byte[GUIHold],2 cmp byte[GUIHold],6 ; Speed Slider
je .dohold5
cmp byte[GUIHold],2 ; Colour Slider
jne .nohold2m jne .nohold2m
.dohold5 .dohold5
mov ecx,[GUIHoldXlimL] mov ecx,[GUIHoldXlimL] ; Sets min/max move range for mouse
mov edx,[GUIHoldXlimR] mov edx,[GUIHoldXlimR] ; once holding slider
call Set_MouseXMax call Set_MouseXMax
mov ecx,[GUIHoldYlim] mov ecx,[GUIHoldYlim] ; Locks pointer on slider
mov edx,[GUIHoldYlim] mov edx,[GUIHoldYlim]
call Set_MouseYMax call Set_MouseYMax
.nohold2m .nohold2m
@@ -121,6 +123,7 @@ ProcessMouse:
mov word[GUImouseposy],100 mov word[GUImouseposy],100
.nowrapdown .nowrapdown
jmp ProcessMouseButtons jmp ProcessMouseButtons
ProcessMouseWrap: ProcessMouseWrap:
call Get_MousePositionDisplacement call Get_MousePositionDisplacement
add word[GUImouseposx],cx add word[GUImouseposx],cx
@@ -417,7 +420,7 @@ ProcessMouseButtons:
mov byte[GUICBHold],0 mov byte[GUICBHold],0
ret ret
.hold5 .hold5
; Slide Bar Hold ; Sound Slide Bar Hold
mov eax,[GUIHoldYlim] mov eax,[GUIHoldYlim]
mov [GUImouseposy],eax mov [GUImouseposy],eax
mov ebx,[GUImouseposx] mov ebx,[GUImouseposx]
@@ -3171,7 +3174,7 @@ DisplayGUIAddOnClick:
GUIPButtonHole 9,55,byte[snesmouse],4 GUIPButtonHole 9,55,byte[snesmouse],4
ret ret
DisplayGUIChipClick DisplayGUIChipClick:
GUIClickCButton 9,43,byte[nssdip1] GUIClickCButton 9,43,byte[nssdip1]
GUIClickCButton 59,43,byte[nssdip2] GUIClickCButton 59,43,byte[nssdip2]
GUIClickCButton 109,43,byte[nssdip3] GUIClickCButton 109,43,byte[nssdip3]
@@ -3180,7 +3183,7 @@ DisplayGUIChipClick
GUIClickCButton 109,53,byte[nssdip6] GUIClickCButton 109,53,byte[nssdip6]
ret ret
DisplayGUIPathsClick DisplayGUIPathsClick:
GUITextBoxInputNach 75,15,230,25,1,1024 ;SRAMDir GUITextBoxInputNach 75,15,230,25,1,1024 ;SRAMDir
GUITextBoxInputNach 75,35,230,45,2,1024 ;SnapPath GUITextBoxInputNach 75,35,230,45,2,1024 ;SnapPath
GUITextBoxInputNach 75,55,230,65,3,1024 ;SPCPath GUITextBoxInputNach 75,55,230,65,3,1024 ;SPCPath
@@ -3224,52 +3227,34 @@ DisplayGUISaveClick:
DGOptnsProcBox 8+38,157,[KeyRewind] DGOptnsProcBox 8+38,157,[KeyRewind]
ret ret
DisplayGUISpeedClick DisplayGUISpeedClick:
DGOptnsProcBox 100,28,[KeyFastFrwrd] DGOptnsProcBox 100,28,[KeyFastFrwrd]
DGOptnsProcBox 100,38,[KeySlowDown] DGOptnsProcBox 100,38,[KeySlowDown]
DGOptnsProcBox 100,48,[KeyResetSpeed] DGOptnsProcBox 100,48,[KeyResetSpeed]
cmp eax,15 cmp eax,15
jl near .nomovebar jl near .nomovebar
cmp eax,15+60 cmp eax,15+116
jg near .nomovebar jg near .nomovebar
sub eax,15
shr eax,1
cmp edx,89 cmp edx,89
jl near .nomovebar jl near .nomovebar
cmp edx,93 cmp edx,93
jg near .nomovebar jg near .nomovebar
sub eax,15
mov [EmuSpeed],al mov [EmuSpeed],al
; mov [cfgvolume],al mov byte[GUIHold],6
mov byte[GUIHold],5
mov eax,[GUIwinposy+21*4] mov eax,[GUIwinposy+21*4]
add eax,91 add eax,91
mov [GUIHoldYlim],eax mov [GUIHoldYlim],eax
xor eax,eax
xor edx,edx
mov al,[EmuSpeed]
shl eax,7
mov ebx,100
div ebx
cmp al,127
jb .noof
mov al,127
.noof
; mov [MusicVol],al
; mov al,[DSPMem+0Ch]
; call WDSPReg0C
; mov al,[DSPMem+1Ch]
; call WDSPReg1C
mov eax,[GUIwinposx+21*4] mov eax,[GUIwinposx+21*4]
add eax,15 add eax,15
mov [GUIHoldXlimL],eax mov [GUIHoldXlimL],eax
add eax,100 add eax,116
mov [GUIHoldXlimR],eax mov [GUIHoldXlimR],eax
.nomovebar .nomovebar
ret ret
DrawMouse: DrawMouse:
mov edi,[vidbuffer] mov edi,[vidbuffer]
add edi,16 add edi,16
@@ -3348,6 +3333,3 @@ DrawMouse:
dec edx dec edx
jnz near .next2 jnz near .next2
ret ret

View File

@@ -6342,9 +6342,8 @@ DisplayGUISave: ;Save & Rewind options/Hotkeys
DrawGUIButton 20,184,17,192,25,GUISaveTextZ2,71,-2,-1 ; - Rewind States DrawGUIButton 20,184,17,192,25,GUISaveTextZ2,71,-2,-1 ; - Rewind States
DrawGUIButton 20,173,29,181,37,GUISaveTextZ1,72,-2,-1 ; + Second/Rewind DrawGUIButton 20,173,29,181,37,GUISaveTextZ1,72,-2,-1 ; + Second/Rewind
DrawGUIButton 20,184,29,192,37,GUISaveTextZ2,73,-2,-1 ; - Second/Rewind DrawGUIButton 20,184,29,192,37,GUISaveTextZ2,73,-2,-1 ; - Second/Rewind
ret
ret
SECTION .data SECTION .data
GUISaveTextA1 db '# OF REWIND STATES',0 GUISaveTextA1 db '# OF REWIND STATES',0
GUISaveTextA2 db '1/5 SECONDS PER REWIND',0 GUISaveTextA2 db '1/5 SECONDS PER REWIND',0
@@ -6388,31 +6387,29 @@ DisplayGUISpeed: ;Speed Options
GUIOuttextwin2 21,7,38,GUISpeedTextA2 GUIOuttextwin2 21,7,38,GUISpeedTextA2
GUIOuttextwin2 21,7,48,GUISpeedTextA3 GUIOuttextwin2 21,7,48,GUISpeedTextA3
mov al,[GUIWincol] ;Yellow Shadow mov al,[GUIWincol] ;Yellow Shadow
mov [GUIGameOptnsColA],al mov [GUIGameOptnsColA],al
mov byte[GUIGameOptnsColB],202 mov byte[GUIGameOptnsColB],202
cmp byte[GUIWincoladd],0 cmp byte[GUIWincoladd],0
je .zero3 je .zero1
mov byte[GUIGameOptnsColB],196 mov byte[GUIGameOptnsColB],196
.zero3 .zero1
mov al,byte[GUIGameOptnsColA] mov al,byte[GUIGameOptnsColA]
mov byte[GUItextcolor],al mov byte[GUItextcolor],al
GUIOuttextwin2 21,8,19,GUISpeedTextA GUIOuttextwin2 21,8,19,GUISpeedTextA
GUIOuttextwin2 21,21,79,GUISpeedTextB GUIOuttextwin2 21,16,79,GUISpeedTextB
mov byte[GUIGameOptnsColA],163 ;Yellow Text mov byte[GUIGameOptnsColA],163 ;Yellow Text
mov byte[GUIGameOptnsColB],217 mov byte[GUIGameOptnsColB],217
cmp byte[GUIWincoladd],0 cmp byte[GUIWincoladd],0
je .zero8 je .zero3
mov byte[GUIGameOptnsColA],164 mov byte[GUIGameOptnsColA],164
mov byte[GUIGameOptnsColB],211 mov byte[GUIGameOptnsColB],211
.zero8 .zero3
mov al,byte[GUIGameOptnsColA] mov al,byte[GUIGameOptnsColA]
mov byte[GUItextcolor],al mov byte[GUItextcolor],al
GUIOuttextwin2 21,7,18,GUISpeedTextA GUIOuttextwin2 21,7,18,GUISpeedTextA
GUIOuttextwin2 21,20,78,GUISpeedTextB GUIOuttextwin2 21,15,78,GUISpeedTextB
DDrawBox 21,100,28,[KeyFastFrwrd] ;Shortcut Boxes DDrawBox 21,100,28,[KeyFastFrwrd] ;Shortcut Boxes
@@ -6424,11 +6421,11 @@ DisplayGUISpeed: ;Speed Options
DGOptnsBorderBox 21,99,47 DGOptnsBorderBox 21,99,47
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]
mov ecx,eax mov ecx,eax
add eax,15 add eax,15
add ecx,15+60 add ecx,15+116
add ebx,91 add ebx,91
xor edx,edx xor edx,edx
mov dl,215 mov dl,215
@@ -6440,21 +6437,27 @@ DisplayGUISpeed: ;Speed Options
DrawGUILine DrawGUILine
xor eax,eax xor eax,eax
mov al,[EmuSpeed] mov al,[EmuSpeed]
mov dword[GUITemp],11 shl eax,1
mov dword[GUITemp],12
add [GUITemp],eax add [GUITemp],eax
GUIDisplayIconWin 21,[GUITemp],87,GUIIconDataSlideBar GUIDisplayIconWin 21,[GUITemp],87,GUIIconDataSlideBar
mov dword[GUISpeedTextB1],' ' mov dword[GUISpeedTextB1],0
mov esi,GUISpeedTextB1+2 mov esi,GUISpeedTextB1+2
xor eax,eax xor eax,eax ; currently emuspeed ranges from 0 to 58
mov al,[EmuSpeed] mov al,[EmuSpeed] ; this turns it into '/30' to '30x'
mov ebx,10 cmp al,29
div bl jb .slowmo
add ah,48 mov byte[esi],'x' ; adds 'x' after the ff value
mov [esi],ah
cmp al,0
je .nomore
dec esi dec esi
xor ah,ah sub al,28
jmp .asciilp
.slowmo
mov byte[GUISpeedTextB1],1 ; slomo indicator
mov bl,30
sub bl,al
mov al,bl
.asciilp ; turns decimal into ascii
mov bl,10
div bl div bl
add ah,48 add ah,48
mov [esi],ah mov [esi],ah
@@ -6466,19 +6469,22 @@ DisplayGUISpeed: ;Speed Options
add ah,48 add ah,48
mov [esi],ah mov [esi],ah
.nomore .nomore
cmp byte[GUISpeedTextB1],1
jne .convdone
dec esi
mov byte[esi],'/' ; adds '/' before the slomo value
.convdone
mov [GUITemp],esi mov [GUITemp],esi
mov byte[GUItextcolor],223 mov byte[GUItextcolor],223
GUIOuttextwin2 21,119,89,[GUITemp] GUIOuttextwin2 21,63,79,[GUITemp]
mov byte[GUItextcolor],221 mov byte[GUItextcolor],221
cmp byte[GUIWincoladd],0 cmp byte[GUIWincoladd],0
je .zero5 je .zero4
mov byte[GUItextcolor],222 mov byte[GUItextcolor],222
.zero5 .zero4
GUIOuttextwin2 21,118,88,[GUITemp] GUIOuttextwin2 21,62,78,[GUITemp]
ret ret
SECTION .data SECTION .data
GUISpeedTextA db 'SHORTCUTS : ',0 GUISpeedTextA db 'SHORTCUTS : ',0
GUISpeedTextA1 db 'FAST FORWARD',0 GUISpeedTextA1 db 'FAST FORWARD',0
@@ -6488,9 +6494,6 @@ GUISpeedTextA3 db 'RESET SPEED',0
GUISpeedTextB db 'SPEED : ',0 GUISpeedTextB db 'SPEED : ',0
GUISpeedTextB1 db '---',0 GUISpeedTextB1 db '---',0
;General data ;General data
GUILoadDisp db 'LOAD GAME',0 GUILoadDisp db 'LOAD GAME',0
GUIResetDisp db 'RESET GAME',0 GUIResetDisp db 'RESET GAME',0

View File

@@ -140,7 +140,7 @@ 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 = 15; unsigned char EmuSpeed = 29; // 29 = 1x, 0 = /30 and 58 = 30x
void outofmemory(); void outofmemory();
void init(); void init();