From 9bc4e2db2bd267a5847e3f29cf8878195b85708b Mon Sep 17 00:00:00 2001 From: n-a-c-h <> Date: Tue, 21 Feb 2006 01:48:24 +0000 Subject: [PATCH] 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. --- zsnes/src/dos/dosintrf.asm | 3 --- zsnes/src/gui/gui.asm | 6 +++++- zsnes/src/gui/guimouse.inc | 16 +++++++++++++--- zsnes/src/linux/sdlintrf.asm | 6 ------ zsnes/src/linux/sdllink.c | 28 ++++++++++++++++++++-------- zsnes/src/win/winintrf.asm | 6 ------ zsnes/src/win/winlink.cpp | 6 ++++++ 7 files changed, 44 insertions(+), 27 deletions(-) diff --git a/zsnes/src/dos/dosintrf.asm b/zsnes/src/dos/dosintrf.asm index 435d8d30..82ed5dbf 100644 --- a/zsnes/src/dos/dosintrf.asm +++ b/zsnes/src/dos/dosintrf.asm @@ -1482,9 +1482,6 @@ NEWSYM Check60hz ; Call the timer update function here ret -NEWSYM GotoHomepage - ret - NEWSYM GetTimeInSeconds push es mov ax,[selc0040] diff --git a/zsnes/src/gui/gui.asm b/zsnes/src/gui/gui.asm index f0c949c7..e144c06f 100644 --- a/zsnes/src/gui/gui.asm +++ b/zsnes/src/gui/gui.asm @@ -94,7 +94,7 @@ EXTSYM Set_MouseYMax,Set_MousePosition,Get_MousePositionDisplacement,GUIInit EXTSYM GUIDeInit,SpecialLine,DrawWater,DrawBurn,SA1Enable,SA1RAMArea EXTSYM MMXCheck,SaveCombFile,showinfogui 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 NumVideoModes,cfgvolume,MusicVol,DSPMem,NumInputDevices,GUIInputNames EXTSYM GUIVideoModeNames,GUISLVID,GUIINVID,GUIEAVID,GUIIEVID,GUIFSVID,GUIWSVID @@ -153,6 +153,10 @@ EXTSYM initDirectDraw,reInitSound,CheckAlwaysOnTop,CheckPriority,CheckScreenSave EXTSYM dssel,SetInputDevice209,initvideo2 %endif +%ifndef __MSDOS__ +EXTSYM ZsnesPage,DocsPage +%endif + %include "gui/guitools.inc" %include "gui/guimisc.inc" %include "gui/guimouse.inc" diff --git a/zsnes/src/gui/guimouse.inc b/zsnes/src/gui/guimouse.inc index dc4ac338..bb6d12a0 100644 --- a/zsnes/src/gui/guimouse.inc +++ b/zsnes/src/gui/guimouse.inc @@ -735,10 +735,20 @@ ProcessMouseButtons: call AddCSCheatCode ; call InsertSearchDescription .noinsertscc +%ifndef __MSDOS__ cmp byte[GUICBHold],65 - jne .nohomepage - call GotoHomepage -.nohomepage + jne .nozsnespage + pushad + call ZsnesPage + popad +.nozsnespage + cmp byte[GUICBHold],66 + jne .nodocspage + pushad + call DocsPage + popad +.nodocspage +%endif mov byte[GUICBHold],0 ret .checkmenuboxclick diff --git a/zsnes/src/linux/sdlintrf.asm b/zsnes/src/linux/sdlintrf.asm index 0b0dc3c8..531f7edd 100644 --- a/zsnes/src/linux/sdlintrf.asm +++ b/zsnes/src/linux/sdlintrf.asm @@ -1257,12 +1257,6 @@ NEWSYM SetInputDevice mov dword[eax+44],46 ret -NEWSYM GotoHomepage - pushad - call ZsnesPage - popad - ret - EXTSYM SystemTimewHour EXTSYM SystemTimewMinute EXTSYM SystemTimewSecond diff --git a/zsnes/src/linux/sdllink.c b/zsnes/src/linux/sdllink.c index 827f2c88..136eda24 100644 --- a/zsnes/src/linux/sdllink.c +++ b/zsnes/src/linux/sdllink.c @@ -1300,13 +1300,13 @@ pid_t spc_fork() { 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); } -void ZsnesPage() +void LaunchURL(char *url) { if (spc_fork()) //If fork failed, or we are the parent { @@ -1318,15 +1318,27 @@ void ZsnesPage() //We are now the child proccess //If any of these LaunchBrowser() calls return that means it failed and we should try the next one - LaunchBrowser("mozilla"); - LaunchBrowser("mozilla-firefox"); - LaunchBrowser("konqueror"); - LaunchBrowser("lynx"); - LaunchBrowser("links"); + LaunchBrowser("mozilla", url); + LaunchBrowser("mozilla-firefox", url); + LaunchBrowser("firefox", url); + LaunchBrowser("konqueror", url); + LaunchBrowser("opera", url); + LaunchBrowser("lynx", url); + LaunchBrowser("links", url); _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 diff --git a/zsnes/src/win/winintrf.asm b/zsnes/src/win/winintrf.asm index fa23251f..1ae7f56f 100644 --- a/zsnes/src/win/winintrf.asm +++ b/zsnes/src/win/winintrf.asm @@ -1475,12 +1475,6 @@ NEWSYM SetInputDevice mov dword[eax+44],46 ret -NEWSYM GotoHomepage - pushad - call ZsnesPage - popad - ret - NEWSYM GetTimeInSeconds push dword SystemTime call [_imp__GetLocalTime@4] diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index 82e747ab..1eaa7125 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -3090,6 +3090,12 @@ void ZsnesPage() MouseY = 0; } +void DocsPage() +{ + ShellExecute(NULL, NULL, "http://zsnes-docs.sourceforge.net/", NULL, NULL, 0); + MouseX = 0; + MouseY = 0; +} extern "C" signed int NumberOfOpcodes;