diff --git a/zsnes/src/gui/gui.asm b/zsnes/src/gui/gui.asm index 6145237a..d624148d 100644 --- a/zsnes/src/gui/gui.asm +++ b/zsnes/src/gui/gui.asm @@ -611,7 +611,14 @@ 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 16384 db '0' +NEWSYM SRAMPath, times 16384 db 0 +NEWSYM SnapPath, times 16384 db 0 +NEWSYM SPCPath, times 16384 db 0 +NEWSYM BSXPath, times 16384 db 0 +NEWSYM STPath, times 16384 db 0 +NEWSYM GNextPath, times 16384 db 0 +NEWSYM SGPath, times 16384 db 0 + GUIsave equ $-GUIRAdd diff --git a/zsnes/src/gui/guikeys.inc b/zsnes/src/gui/guikeys.inc index 7b0b5813..e7cfab30 100644 --- a/zsnes/src/gui/guikeys.inc +++ b/zsnes/src/gui/guikeys.inc @@ -406,6 +406,8 @@ GUIgetcurrentinput: je near GUIStateKeys cmp ebx,16 je near GUIComboKeys + cmp ebx,19 + je near GUIPathKeys cmp ebx,8 jne .notstartmenu cmp byte[CNetType],4 @@ -1462,6 +1464,81 @@ GUIEditStringLstb resd 1 ; if cursor is placed (set in main function) GUIEditStringcWin resd 1 ; 0 = no text window selected SECTION .text +GUIPathKeys: + cmp dh,0 + je .nokeypressed + + cmp dword[GUIInputBox],1 + jne .notBox1 + mov eax,SRAMPath + jmp .boxselected +.notBox1 + cmp dword[GUIInputBox],2 + jne .notBox2 + mov eax,SnapPath + jmp .boxselected +.notBox2 + cmp dword[GUIInputBox],3 + jne .notBox3 + mov eax,SPCPath + jmp .boxselected +.notBox3 + cmp dword[GUIInputBox],4 + jne .notBox4 + mov eax,BSXPath + jmp .boxselected +.notBox4 + cmp dword[GUIInputBox],5 + jne .notBox5 + mov eax,SGPath + jmp .boxselected +.notBox5 + cmp dword[GUIInputBox],6 + jne .notBox6 + mov eax,STPath + jmp .boxselected +.notBox6 + cmp dword[GUIInputBox],7 + jne .notBox7 + mov eax,GNextPath + jmp .boxselected +.notBox7 + +.boxselected + mov ecx,eax + + ;Find end of string +.findend + cmp byte[eax],0 + je .foundend + inc eax + jmp .findend +.foundend + + cmp dh,8 ;Backspace + jne .notbackspace + cmp eax,ecx + je .cantback + mov byte[eax-1],0 +.cantback + ret +.notbackspace + + ;check if we're at the end + add ecx,16383 + cmp eax,ecx + jne .stillroom + ret +.stillroom + mov byte[eax],dh + +.nokeypressed + ret + +SECTION .bss +GUIInputBox resd 1 +SECTION .text + GUIComboKeys: ; Calculate Position xor eax,eax diff --git a/zsnes/src/gui/guimouse.inc b/zsnes/src/gui/guimouse.inc index a90d3bae..c51245d2 100644 --- a/zsnes/src/gui/guimouse.inc +++ b/zsnes/src/gui/guimouse.inc @@ -1783,6 +1783,19 @@ SECTION .text %%noclick %endmacro +%macro GUITextBoxInputNach 5 + cmp eax,%1 + jl %%noclick + cmp edx,%2 + jl %%noclick + cmp eax,%3 + jg %%noclick + cmp edx,%4 + jg %%noclick + mov dword[GUIInputBox],%5 +%%noclick +%endmacro + %macro GUIPButtonHole 4 cmp eax,%1+1 jl %%noclick @@ -3239,13 +3252,14 @@ DisplayGUIChipClick ret DisplayGUIPathsClick - GUITextBoxInput 75,15,230,25,SRAMPath,16384 - ;GUITextBoxInput 75,35,230,45,,16384 - ;GUITextBoxInput 75,55,230,65,,16384 - ;GUITextBoxInput 8,95,100,105,,16384 - ;GUITextBoxInput 8,120,100,130,,16384 - ;GUITextBoxInput 135,95,235,105,,16384 - ;GUITextBoxInput 135,120,235,130,,16384 + GUITextBoxInputNach 75,15,230,25,1 ;SRAMPath + GUITextBoxInputNach 75,35,230,45,2 ;SnapPath + GUITextBoxInputNach 75,55,230,65,3 ;SPCPath + GUITextBoxInputNach 8,95,100,105,4 ;BSXPath + GUITextBoxInputNach 8,120,100,130,5 ;SGPath + GUITextBoxInputNach 135,95,235,105,6 ;STPath + GUITextBoxInputNach 135,120,235,130,7 ;GNextPath + ;GUITextBoxInput 8,155,100,165,,16384 ;GUITextBoxInput 8,180,100,190,,16384 ;GUITextBoxInput 135,155,235,165,,16384 diff --git a/zsnes/src/gui/guiwindp.inc b/zsnes/src/gui/guiwindp.inc index 6737f13b..fda217b0 100644 --- a/zsnes/src/gui/guiwindp.inc +++ b/zsnes/src/gui/guiwindp.inc @@ -6301,6 +6301,7 @@ GUIChipText3 db 'HARD',0 SECTION .text + DisplayGUIPaths: GUIDrawWindowBox 19,GUIPathsDisp sub byte[GUItextcolor],15 @@ -6334,9 +6335,9 @@ DisplayGUIPaths: GUIOuttextwin2 19,134,172,GUIPathsTextD ;Input boxes - alternate color - DrawGUIWinBox 19,74,14,231,26,177 - DrawGUIWinBox 19,74,34,231,46,177 - DrawGUIWinBox 19,74,54,231,66,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,101,106,177 DrawGUIWinBox 19,7,119,101,131,177 DrawGUIWinBox 19,134,94,236,106,177 @@ -6347,9 +6348,9 @@ DisplayGUIPaths: DrawGUIWinBox 19,134,179,236,191,177 ;Input boxes - DrawGUIWinBox 19,75,15,230,25,167 - DrawGUIWinBox 19,75,35,230,45,167 - DrawGUIWinBox 19,75,55,230,65,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,100,105,167 DrawGUIWinBox 19,8,120,100,130,167 DrawGUIWinBox 19,135,95,235,105,167 @@ -6358,6 +6359,14 @@ DisplayGUIPaths: DrawGUIWinBox 19,8,180,100,190,167 DrawGUIWinBox 19,135,155,235,165,167 DrawGUIWinBox 19,135,180,235,190,167 + + GUIOuttextwin2c 19,77,19,SRAMPath + GUIOuttextwin2c 19,77,39,SnapPath + GUIOuttextwin2c 19,77,59,SPCPath + GUIOuttextwin2c 19,10,99,BSXPath + GUIOuttextwin2c 19,10,124,SGPath + GUIOuttextwin2c 19,137,99,STPath + GUIOuttextwin2c 19,137,124,GNextPath ret SECTION .data