Removed homepage code from DOS port. Removed needless routes for browser opening through assembly. Cleaned up Linux code for browser opening. Linux browser opening can now launch FireFox if called 'firefox' and opera. Documentation button functional.

This commit is contained in:
n-a-c-h
2006-02-21 01:48:24 +00:00
parent 3f9cfe3f1c
commit 9bc4e2db2b
7 changed files with 44 additions and 27 deletions

View File

@@ -1482,9 +1482,6 @@ NEWSYM Check60hz
; Call the timer update function here ; Call the timer update function here
ret ret
NEWSYM GotoHomepage
ret
NEWSYM GetTimeInSeconds NEWSYM GetTimeInSeconds
push es push es
mov ax,[selc0040] mov ax,[selc0040]

View File

@@ -94,7 +94,7 @@ EXTSYM Set_MouseYMax,Set_MousePosition,Get_MousePositionDisplacement,GUIInit
EXTSYM GUIDeInit,SpecialLine,DrawWater,DrawBurn,SA1Enable,SA1RAMArea EXTSYM GUIDeInit,SpecialLine,DrawWater,DrawBurn,SA1Enable,SA1RAMArea
EXTSYM MMXCheck,SaveCombFile,showinfogui EXTSYM MMXCheck,SaveCombFile,showinfogui
EXTSYM ErrorPointer,MessageOn,GetTime,sndrot,regsbackup,GetScreen EXTSYM ErrorPointer,MessageOn,GetTime,sndrot,regsbackup,GetScreen
EXTSYM GUITBWVID,Clear2xSaIBuffer,MouseWindow,GotoHomepage,cfgcvidmode EXTSYM GUITBWVID,Clear2xSaIBuffer,MouseWindow,cfgcvidmode
EXTSYM ExitFromGUI,GUIWFVID,cfgvsync,newgfx16b,cfgscanline,cfginterp EXTSYM ExitFromGUI,GUIWFVID,cfgvsync,newgfx16b,cfgscanline,cfginterp
EXTSYM NumVideoModes,cfgvolume,MusicVol,DSPMem,NumInputDevices,GUIInputNames EXTSYM NumVideoModes,cfgvolume,MusicVol,DSPMem,NumInputDevices,GUIInputNames
EXTSYM GUIVideoModeNames,GUISLVID,GUIINVID,GUIEAVID,GUIIEVID,GUIFSVID,GUIWSVID EXTSYM GUIVideoModeNames,GUISLVID,GUIINVID,GUIEAVID,GUIIEVID,GUIFSVID,GUIWSVID
@@ -153,6 +153,10 @@ EXTSYM initDirectDraw,reInitSound,CheckAlwaysOnTop,CheckPriority,CheckScreenSave
EXTSYM dssel,SetInputDevice209,initvideo2 EXTSYM dssel,SetInputDevice209,initvideo2
%endif %endif
%ifndef __MSDOS__
EXTSYM ZsnesPage,DocsPage
%endif
%include "gui/guitools.inc" %include "gui/guitools.inc"
%include "gui/guimisc.inc" %include "gui/guimisc.inc"
%include "gui/guimouse.inc" %include "gui/guimouse.inc"

View File

@@ -735,10 +735,20 @@ ProcessMouseButtons:
call AddCSCheatCode call AddCSCheatCode
; call InsertSearchDescription ; call InsertSearchDescription
.noinsertscc .noinsertscc
%ifndef __MSDOS__
cmp byte[GUICBHold],65 cmp byte[GUICBHold],65
jne .nohomepage jne .nozsnespage
call GotoHomepage pushad
.nohomepage call ZsnesPage
popad
.nozsnespage
cmp byte[GUICBHold],66
jne .nodocspage
pushad
call DocsPage
popad
.nodocspage
%endif
mov byte[GUICBHold],0 mov byte[GUICBHold],0
ret ret
.checkmenuboxclick .checkmenuboxclick

View File

@@ -1257,12 +1257,6 @@ NEWSYM SetInputDevice
mov dword[eax+44],46 mov dword[eax+44],46
ret ret
NEWSYM GotoHomepage
pushad
call ZsnesPage
popad
ret
EXTSYM SystemTimewHour EXTSYM SystemTimewHour
EXTSYM SystemTimewMinute EXTSYM SystemTimewMinute
EXTSYM SystemTimewSecond EXTSYM SystemTimewSecond

View File

@@ -1300,13 +1300,13 @@ pid_t spc_fork() {
return 0; return 0;
} }
void LaunchBrowser(char *browser) void LaunchBrowser(char *browser, char *url)
{ {
char *arglist[] = { browser, "http://www.zsnes.com/", 0 }; char *const arglist[] = { browser, url, 0 };
execvp(browser, arglist); execvp(browser, arglist);
} }
void ZsnesPage() void LaunchURL(char *url)
{ {
if (spc_fork()) //If fork failed, or we are the parent if (spc_fork()) //If fork failed, or we are the parent
{ {
@@ -1318,15 +1318,27 @@ void ZsnesPage()
//We are now the child proccess //We are now the child proccess
//If any of these LaunchBrowser() calls return that means it failed and we should try the next one //If any of these LaunchBrowser() calls return that means it failed and we should try the next one
LaunchBrowser("mozilla"); LaunchBrowser("mozilla", url);
LaunchBrowser("mozilla-firefox"); LaunchBrowser("mozilla-firefox", url);
LaunchBrowser("konqueror"); LaunchBrowser("firefox", url);
LaunchBrowser("lynx"); LaunchBrowser("konqueror", url);
LaunchBrowser("links"); LaunchBrowser("opera", url);
LaunchBrowser("lynx", url);
LaunchBrowser("links", url);
_exit(0); //All browser launches failed, oh well _exit(0); //All browser launches failed, oh well
} }
void ZsnesPage()
{
LaunchURL("http://www.zsnes.com/");
}
void DocsPage()
{
LaunchURL("http://zsnes-docs.sourceforge.net/");
}
/* /*
Functions for battery power for Linux by Nach Functions for battery power for Linux by Nach

View File

@@ -1475,12 +1475,6 @@ NEWSYM SetInputDevice
mov dword[eax+44],46 mov dword[eax+44],46
ret ret
NEWSYM GotoHomepage
pushad
call ZsnesPage
popad
ret
NEWSYM GetTimeInSeconds NEWSYM GetTimeInSeconds
push dword SystemTime push dword SystemTime
call [_imp__GetLocalTime@4] call [_imp__GetLocalTime@4]

View File

@@ -3090,6 +3090,12 @@ void ZsnesPage()
MouseY = 0; MouseY = 0;
} }
void DocsPage()
{
ShellExecute(NULL, NULL, "http://zsnes-docs.sourceforge.net/", NULL, NULL, 0);
MouseX = 0;
MouseY = 0;
}
extern "C" signed int NumberOfOpcodes; extern "C" signed int NumberOfOpcodes;