From 197747a6e8773ead222dbca357f922d97b417515 Mon Sep 17 00:00:00 2001 From: n-a-c-h <> Date: Mon, 18 Apr 2005 02:40:59 +0000 Subject: [PATCH] Remove some more netplay junk. --- zsnes/src/Makefile.in | 5 +- zsnes/src/dos/dosintrf.asm | 196 ----------------------- zsnes/src/gui/gui.asm | 13 +- zsnes/src/gui/guinetpl.inc | 78 --------- zsnes/src/linux/sdlintrf.asm | 301 +--------------------------------- zsnes/src/linux/sdllink.c | 20 +-- zsnes/src/makefile.ms | 5 +- zsnes/src/win/winintrf.asm | 302 +---------------------------------- zsnes/src/win/winlink.cpp | 12 -- zsnes/src/zloader.c | 2 + 10 files changed, 16 insertions(+), 918 deletions(-) delete mode 100644 zsnes/src/gui/guinetpl.inc diff --git a/zsnes/src/Makefile.in b/zsnes/src/Makefile.in index 38a548b7..0b826225 100644 --- a/zsnes/src/Makefile.in +++ b/zsnes/src/Makefile.in @@ -61,7 +61,8 @@ WINOBJ=${WINDIR}/copyvwin.o \ WINDOSOBJ=${DOSDIR}/debug.o ${DOSDIR}/joy.o ${DOSDIR}/vesa2.o\ ${DOSDIR}/initvid.o ${DOSDIR}/sw.o ${DOSDIR}/gppro.o ${DOSDIR}/vesa12.o -NETOBJ=${NETDIR}/ztcp.o +NETOBJ= +#${NETDIR}/ztcp.o JMAOBJ=${JMADIR}/7zlzma.o ${JMADIR}/crc32.o ${JMADIR}/iiostrm.o\ ${JMADIR}/inbyte.o ${JMADIR}/jma.o ${JMADIR}/lzma.o ${JMADIR}/lzmadec.o\ @@ -185,7 +186,7 @@ ${DOSDIR}/joy.o: ${DOSDIR}/joy.asm macros.mac ${DOSDIR}/sw.o: ${DOSDIR}/sw.asm macros.mac ${GUIDIR}/gui.o: ${GUIDIR}/gui.asm ${GUIDIR}/guitools.inc\ ${GUIDIR}/guimisc.inc ${GUIDIR}/guimouse.inc ${GUIDIR}/guiwindp.inc\ - ${GUIDIR}/guinetpl.inc ${GUIDIR}/guikeys.inc ${GUIDIR}/guicheat.inc\ + ${GUIDIR}/guikeys.inc ${GUIDIR}/guicheat.inc\ ${GUIDIR}/guicombo.inc ${GUIDIR}/guiload.inc macros.mac ${GUIDIR}/menu.o: ${GUIDIR}/menu.asm macros.mac ${VIDEODIR}/newgfx.o:${VIDEODIR}/newgfx.asm ${VIDEODIR}/vidmacro.mac\ diff --git a/zsnes/src/dos/dosintrf.asm b/zsnes/src/dos/dosintrf.asm index 4f7a34c1..9b3dcbfb 100644 --- a/zsnes/src/dos/dosintrf.asm +++ b/zsnes/src/dos/dosintrf.asm @@ -1560,205 +1560,9 @@ NEWSYM Check60hz ; TCP/IP Stuff ; **************************** -SECTION .bss - -NEWSYM TCPIPStatus, resb 1 -NEWSYM PacketSendSize, resd 1 -NEWSYM PacketRecvSize, resd 1 -NEWSYM PacketRecvPtr, resd 1 -NEWSYM PacketSendArray, resb 256 -NEWSYM PacketRecvArray, resb 256 -NEWSYM IPAddrStr, resb 20 -NEWSYM RemoteDisconnect, resb 1 - - SECTION .text -NEWSYM TCPIPStartServer - mov dword[PacketSendSize],0 - mov dword[PacketRecvSize],0 -; call InitTCP - or eax,eax - jnz .failed - mov byte[TCPIPStatus],1 -; StartServer(unsigned short port) -; mov ax,[TCPIPPortNum] - push ax -; call StartServer - add esp,2 - or eax,eax - jnz .noserver - mov byte[TCPIPStatus],2 -.noserver - ret -.failed - mov eax,1 - ret - -NEWSYM TCPIPInitConnectToServer - mov dword[PacketSendSize],0 - mov dword[PacketRecvSize],0 -; call InitTCP - or eax,eax - jnz .failed - mov byte[TCPIPStatus],1 - ; Convert TCPIPAddress to IPAddrStr -; mov ebx,TCPIPAddress - mov edx,IPAddrStr -.notend - mov al,[ebx] - cmp al,' ' - je .dontinclude - mov [edx],al - inc edx -.dontinclude - inc ebx - cmp al,0 - jne .notend -; int ConnectServer(char *servername, unsigned short port) -; mov ax,[TCPIPPortNum] - push ax - mov eax,IPAddrStr - push eax -; call ConnectServer - add esp,6 - or eax,eax - jnz .noclient - mov byte[TCPIPStatus],3 -.noclient - xor eax,eax - ret -.failed - mov eax,1 - ret - -NEWSYM TCPIPStoreByte - ; Store al into the array - cmp dword[PacketSendSize],256 - je .packeterror - push ebx - mov ebx,[PacketSendSize] - mov [PacketSendArray+ebx],al - pop ebx - inc dword[PacketSendSize] - ret -.packeterror - jmp OSExit - -NEWSYM TCPIPGetByte - ; dh = 0 : No bytes in buffer - ; dl = resulting character - cmp dword[PacketRecvSize],0 - jne .bytereceived - mov dword[PacketRecvPtr],0 - call TCPIPRecvPacket - cmp dword[PacketRecvSize],0 - jne .bytereceived - xor dh,dh - ret -.bytereceived - push eax - mov eax,[PacketRecvPtr] - mov dl,[PacketRecvArray+eax] - mov dh,1 - inc dword[PacketRecvPtr] - mov eax,[PacketRecvPtr] - cmp [PacketRecvSize],eax - jne .notequal - mov dword[PacketRecvSize],0 -.notequal - pop eax - ret - -NEWSYM TCPIPSendPacket - cmp dword[PacketSendSize],0 - je .nopacket - pushad - ; Send PacketSendArray with size of PacketSendSize - ; SendData(int dsize,char *dptr) - mov eax,PacketSendArray - push eax - mov eax,[PacketSendSize] - push eax -; call SendData - or eax,eax - jnz .failed - add esp,8 - popad -.nopacket - ret -.failed - add esp,8 - popad - call TCPIPDisconnect - jmp OSExit - -NEWSYM TCPIPRecvPacket - pushad - ; Store packet to PacketRecvArray, size at PacketRecvSize - ; int GetData(int dsize,char *dptr) - mov eax,PacketRecvArray - push eax - mov eax,256 - push eax -; call GetData - cmp eax,-1 - je .failed - mov [PacketRecvSize],eax - add esp,8 - popad - ret -.failed - add esp,8 - popad - call TCPIPDisconnect - jmp OSExit - -NEWSYM TCPIPDisconnect -; call DeInitTCP - cmp byte[TCPIPStatus],3 - jne .notserver -; call StopServer -.notserver - cmp byte[TCPIPStatus],3 - jne .notclient -; call Disconnect -.notclient - ret - -NEWSYM TCPIPPreparePacket - mov dword[PacketSendSize],0 - ret - -NEWSYM TCPIPConnectToServer - ret - -NEWSYM TCPIPWaitForConnection - ret - -NEWSYM TCPIPSendPacketUDP - ret - -NEWSYM TCPIPConnectToServerW - ret - -NEWSYM GetHostName - ret - -NEWSYM hostname -NEWSYM UDPConfig - -SECTION .bss - -NEWSYM tcperr, resd 1 - - -SECTION .text - -NEWSYM ClearUDPStuff NEWSYM Wait1SecWin -NEWSYM EnableSUDPPacket -NEWSYM DisableSUDPPacket NEWSYM WinErrorA NEWSYM WinErrorB NEWSYM GotoHomepage diff --git a/zsnes/src/gui/gui.asm b/zsnes/src/gui/gui.asm index f907809a..21c3b721 100644 --- a/zsnes/src/gui/gui.asm +++ b/zsnes/src/gui/gui.asm @@ -52,7 +52,6 @@ ; Quick Searches : ; DisplayMenu - routines to display top menu bar ; Incomp - Search for start of modem processing -; ProcessModem ; GUIgetcurrentinput ; GUITryMenuItem - Processes the menu item when user clicks item ; Mouseimplementation @@ -92,8 +91,8 @@ EXTSYM spchalted,NextLineCache,ResetTripleBuf,GUINGVID,ScanCodeListing EXTSYM AdjustFrequency,GUISaveVars,Init_Mouse,Get_MouseData,Set_MouseXMax EXTSYM Set_MouseYMax,Set_MousePosition,Get_MousePositionDisplacement,GUIInit EXTSYM GUIDeInit,SpecialLine,DrawWater,DrawBurn,SA1Enable,SA1RAMArea,GUIFName -EXTSYM GUICName,MMXCheck,SaveCombFile,showinfogui,WinErrorA,WinErrorB -EXTSYM ErrorPointer,MessageOn,GetHostName,GetTime,sndrot,regsbackup,GetScreen +EXTSYM GUICName,MMXCheck,SaveCombFile,showinfogui +EXTSYM ErrorPointer,MessageOn,GetTime,sndrot,regsbackup,GetScreen EXTSYM GUITBWVID,Clear2xSaIBuffer,MouseWindow,GotoHomepage,cfgcvidmode EXTSYM ExitFromGUI,GUIWFVID,cfgvsync,newgfx16b,cfgscanline,cfginterp EXTSYM NumVideoModes,cfgvolume,MusicVol,DSPMem,NumInputDevices,GUIInputNames @@ -122,7 +121,6 @@ EXTSYM dssel %include "gui/guimisc.inc" %include "gui/guimouse.inc" %include "gui/guiwindp.inc" -%include "gui/guinetpl.inc" %include "gui/guikeys.inc" %include "gui/guicheat.inc" %include "gui/guicombo.inc" @@ -1938,12 +1936,6 @@ NEWSYM StartGUI mov dword[StartLR],0 jmp continueprog -.faileda - call WinErrorA - jmp continueprog -.failedb - call WinErrorB - jmp continueprog SECTION .bss CheckSumVal resd 1 @@ -2661,7 +2653,6 @@ GUITryMenuItem: GUICheckMenuItem 8, 0 cmp byte[GUIcrowpos],0 jne near .nonet - call GetHostName .nonet cmp byte[GUIcmenupos],6 jne near .nomisc diff --git a/zsnes/src/gui/guinetpl.inc b/zsnes/src/gui/guinetpl.inc deleted file mode 100644 index f2de7c7d..00000000 --- a/zsnes/src/gui/guinetpl.inc +++ /dev/null @@ -1,78 +0,0 @@ -;Copyright (C) 1997-2005 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach ) -; -;http://www.zsnes.com -;http://sourceforge.net/projects/zsnes -; -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either -;version 2 of the License, or (at your option) any later -;version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - -; GUI NetPlay Routines (Modem,IPX,UDP+TCP/IP) - -ProcessModem: - ret - -NEWSYM PreparePacket - ret - -NEWSYM SendPacket - ret - -NEWSYM SendPacketUDP - ret - -NEWSYM WritetochatBuffer - ret - -RemoteDeInit: - ret - -Checkfileexist: - ret - -ProcessRemoteCommand: - ret - -transfersram: - ret - -NEWSYM RemoteSendEAX - ret - -NEWSYM RemoteGetEAX - ret - -NEWSYM RemoteSendChar - ret - -NEWSYM RemoteGetChar - ret - -%ifdef __MSDOS__ -ModemSendStr: - ret -%endif - -NetLoadStuff: - ret - -loadstaterecvinit: - ret - -loadstatesend: - ret - -loadstaterecv: - ret diff --git a/zsnes/src/linux/sdlintrf.asm b/zsnes/src/linux/sdlintrf.asm index 0f439ba5..c6455773 100644 --- a/zsnes/src/linux/sdlintrf.asm +++ b/zsnes/src/linux/sdlintrf.asm @@ -41,11 +41,8 @@ EXTSYM ngrposng,nggposng,ngbposng,HalfTransB,HalfTransC,UpdateVFrame,GetMouseX EXTSYM GetMouseY,GetMouseMoveX,GetMouseMoveY,GetMouseButton,T36HZEnabled EXTSYM MouseButton,Start36HZ,Stop36HZ,BufferSizeW,BufferSizeB,ProcessSoundBuffer EXTSYM CheckTimers,vesa2_rfull,vesa2_rtrcl,vesa2_rtrcla,vesa2_gfull,vesa2_gtrcl -EXTSYM vesa2_gtrcla,vesa2_bfull,vesa2_btrcl,vesa2_btrcla,Init_2xSaIMMXW,InitTCP -EXTSYM StartServerCycle,ServerCheckNewClient,acceptzuser,ConnectServer -EXTSYM WaitForServer,SendDataNop,SendDataUDPNop,GetDataNop,DeInitTCP,StopServer -EXTSYM Disconnect,UDPDisableMode,UDPEnableMode,UDPClearVars,UDPWait1Sec -EXTSYM WinErrorA2,WinErrorB2,WinErrorC2,GetLocalTime,V8Mode,GrayscaleMode +EXTSYM vesa2_gtrcla,vesa2_bfull,vesa2_btrcl,vesa2_btrcla,Init_2xSaIMMXW +EXTSYM GetLocalTime,V8Mode,GrayscaleMode EXTSYM PrevWinMode,PrevFSMode,sem_sleep,ZsnesPage ; NOTE: For timing, Game60hzcall should be called at 50hz or 60hz (depending @@ -1349,300 +1346,6 @@ NEWSYM SetInputDevice mov dword[eax+44],46 ret -; **************************** -; TCP/IP Stuff -; **************************** - -; TCPIPPortNum -SECTION .data -ALIGN32 - -NEWSYM TCPIPStatus, db 0 -NEWSYM PacketSendSize, dd 0 -NEWSYM PacketRecvSize, dd 0 -NEWSYM PacketRecvPtr, dd 0 -NEWSYM PacketSendArray, times 2048+256 db 0 -NEWSYM PacketRecvArray, times 2048+256 db 0 -NEWSYM IPAddrStr, times 20 db 0 -NEWSYM RemoteDisconnect, db 0 -SECTION .text -NEWSYM TCPIPStartServer - mov byte[RemoteDisconnect],0 - pushad - mov dword[PacketSendSize],0 - mov dword[PacketRecvSize],0 - call InitTCP - or eax,eax - jnz .failed - mov byte[TCPIPStatus],1 -; StartServer(unsigned short port) - xor eax,eax -; mov ax,[TCPIPPortNum] - push eax - call StartServerCycle - add esp,4 - or eax,eax - jnz .failed - mov byte[TCPIPStatus],2 - popad - xor eax,eax - ret -.failed - popad - mov eax,-1 - ret - -NEWSYM TCPIPWaitForConnection - mov byte[RemoteDisconnect],0 - pushad - call ServerCheckNewClient - mov [.temp],eax - cmp eax,1 - jne .notwaiting - call acceptzuser - or eax,eax - jnz .failed -.notwaiting - popad - mov eax,[.temp] - ret -.failed - popad - mov eax,-1 - ret -SECTION .data -.temp dd 0 -SECTION .text - -NEWSYM TCPIPInitConnectToServer - pushad - mov dword[PacketSendSize],0 - mov dword[PacketRecvSize],0 - call InitTCP - or eax,eax - jnz .failed - mov byte[TCPIPStatus],1 - ; Convert TCPIPAddress to IPAddrStr -; mov ebx,TCPIPAddress - mov edx,IPAddrStr -.notend - mov al,[ebx] - cmp al,' ' - je .dontinclude - mov [edx],al - inc edx -.dontinclude - inc ebx - cmp al,0 - jne .notend - popad - xor eax,eax - ret -.failed - popad - mov eax,1 - ret - -NEWSYM TCPIPConnectToServer -; int ConnectServer(char *servername, unsigned short port) - pushad - xor eax,eax -; mov ax,[TCPIPPortNum] - push eax - mov eax,IPAddrStr - push eax - xor eax,eax - call ConnectServer - add esp,8 - or eax,eax - jnz .noclient - mov byte[TCPIPStatus],3 - popad - xor eax,eax - ret -.noclient - mov [.temp],eax - popad - mov eax,[.temp] - ret -SECTION .data -.temp dd 0 -SECTION .text - -NEWSYM TCPIPConnectToServerW -; int ConnectServer(char *servername, unsigned short port) - pushad - xor eax,eax - call WaitForServer - or eax,eax - jnz .foundclient - mov byte[TCPIPStatus],3 - popad - xor eax,eax - ret -.foundclient - mov [.temp],eax - popad - mov eax,[.temp] - ret -SECTION .data -.temp dd 0 -SECTION .text - -NEWSYM TCPIPStoreByte - ; Store al into the array -; cmp dword[PacketSendSize],2048 -; je .packeterror - push ebx - mov ebx,[PacketSendSize] - mov [PacketSendArray+ebx],al - pop ebx - inc dword[PacketSendSize] - ret -.packeterror - mov byte[RemoteDisconnect],1 - ret - -NEWSYM TCPIPGetByte - ; dh = 0 : No bytes in buffer - ; dl = resulting character - cmp dword[PacketRecvSize],0 - jne .bytereceived - mov dword[PacketRecvPtr],0 - call TCPIPRecvPacket - cmp dword[PacketRecvSize],0 - jne .bytereceived - xor dh,dh - ret -.bytereceived - push eax - mov eax,[PacketRecvPtr] - mov dl,[PacketRecvArray+eax] - mov dh,1 - inc dword[PacketRecvPtr] - mov eax,[PacketRecvPtr] - cmp [PacketRecvSize],eax - jne .notequal - mov dword[PacketRecvSize],0 -.notequal - pop eax - ret - -NEWSYM TCPIPSendPacket - cmp dword[PacketSendSize],0 - je .nopacket - pushad - ; Send PacketSendArray with size of PacketSendSize - ; SendData(int [PacketSendSize],char *PacketSendArray) - push eax ; required pushes to get correct stack - push eax - call SendDataNop - or eax,eax - jnz .failed - add esp,8 - popad -.nopacket - ret -.failed - add esp,8 - popad - call TCPIPDisconnect - mov byte[RemoteDisconnect],1 - ret - -NEWSYM TCPIPSendPacketUDP - cmp dword[PacketSendSize],0 - je .nopacket - pushad - ; Send PacketSendArray with size of PacketSendSize - ; SendData(int [PacketSendSize],char *PacketSendArray) - push eax ; required pushes to get correct stack - push eax - call SendDataUDPNop - or eax,eax - jnz .failed - add esp,8 - popad -.nopacket - ret -.failed - add esp,8 - popad - call TCPIPDisconnect - mov byte[RemoteDisconnect],1 - ret - -NEWSYM TCPIPRecvPacket - pushad - ; Store packet to PacketRecvArray, size at PacketRecvSize - ; int GetData(int 2048,char *PacketRecvArray) - push eax ; required pushes to get correct stack - push eax - call GetDataNop - cmp eax,-1 - je .failed - mov [PacketRecvSize],eax - add esp,8 - popad - ret -.failed - add esp,8 - popad - call TCPIPDisconnect - mov byte[RemoteDisconnect],1 - ret - -NEWSYM TCPIPDisconnect - call DeInitTCP - cmp byte[TCPIPStatus],2 - jne .notserver - call StopServer -.notserver - cmp byte[TCPIPStatus],3 - jne .notclient - call Disconnect -.notclient - mov byte[TCPIPStatus],0 - ret - -NEWSYM TCPIPPreparePacket - mov dword[PacketSendSize],0 - ret - -NEWSYM ClearUDPStuff - pushad - call UDPClearVars - popad - ret - -NEWSYM Wait1SecWin - pushad - call UDPWait1Sec - popad - ret - -NEWSYM EnableSUDPPacket - pushad - call UDPEnableMode - popad - ret - -NEWSYM DisableSUDPPacket - pushad - call UDPDisableMode - popad - ret - -NEWSYM WinErrorA - call WinErrorA2 - ret -NEWSYM WinErrorB - call WinErrorB2 - ret -NEWSYM WinErrorC - call WinErrorC2 - ret - NEWSYM GotoHomepage pushad call ZsnesPage diff --git a/zsnes/src/linux/sdllink.c b/zsnes/src/linux/sdllink.c index d798a3c8..4005d3cd 100644 --- a/zsnes/src/linux/sdllink.c +++ b/zsnes/src/linux/sdllink.c @@ -35,6 +35,8 @@ typedef unsigned long DWORD; typedef Uint32 UINT32; typedef long long _int64; typedef long long LARGE_INTEGER; +#define QueryPerformanceCounter(x) asm volatile("rdtsc" : "=a"(((unsigned int *)(x))[0]),"=d"(((unsigned int *)x)[1])) + typedef enum { FALSE = 0, TRUE = 1 } BOOL; typedef enum vidstate_e { vid_null, vid_none, vid_soft, vid_gl } vidstate_t; @@ -52,12 +54,6 @@ extern BYTE StereoSound; extern DWORD SoundQuality; extern int DSPBuffer[]; -/* NETWORK RELATED VARIABLES */ -extern int packettimeleft[256]; -extern int PacketCounter; -extern int CounterA; -extern int CounterB; - /* VIDEO VARIABLES */ SDL_Surface *surface; int SurfaceLocking = 0; @@ -913,18 +909,6 @@ void CheckTimers(void) while ((end2 - start2) >= update_ticks_pc2) { - if (CounterA > 0) - CounterA--; - if (CounterB > 0) - CounterB--; - if (PacketCounter) - { - for (i = 0; i < 256; i++) - { - if (packettimeleft[i] > 0) - packettimeleft[i]--; - } - } start2 += update_ticks_pc2; } diff --git a/zsnes/src/makefile.ms b/zsnes/src/makefile.ms index 25eb79ae..9f785c0f 100644 --- a/zsnes/src/makefile.ms +++ b/zsnes/src/makefile.ms @@ -171,7 +171,8 @@ WINVIDOBJ=${VIDEODIR}/sw_draw${OE} ${VIDEODIR}/hq2x16${OE} ${VIDEODIR}/hq2x32${O WINOBJ=${WINDIR}/copyvwin${OE} ${DRESOBJ}\ ${WINDIR}/winintrf${OE} ${WINDIR}/winlink${OE} ${WINDIR}/zfilew${OE} -NETOBJ=${NETDIR}/ztcp${OE} +NETOBJ= +#${NETDIR}/ztcp${OE} ZIPOBJ=${ZIPDIR}/unzip${OE} ${ZIPDIR}/zpng${OE} @@ -312,7 +313,7 @@ ${CHIPDIR}/dsp4emu${OE}: $< ${GUIDIR}/gui${OE}: $< ${GUIDIR}/guitools.inc\ ${GUIDIR}/guimisc.inc ${GUIDIR}/guimouse.inc ${GUIDIR}/guiwindp.inc\ - ${GUIDIR}/guinetpl.inc ${GUIDIR}/guikeys.inc ${GUIDIR}/guicheat.inc\ + ${GUIDIR}/guikeys.inc ${GUIDIR}/guicheat.inc\ ${GUIDIR}/guicombo.inc ${GUIDIR}/guiload.inc macros.mac ${GUIDIR}/menu${OE}: $< macros.mac diff --git a/zsnes/src/win/winintrf.asm b/zsnes/src/win/winintrf.asm index dad8f005..8c7f97dc 100644 --- a/zsnes/src/win/winintrf.asm +++ b/zsnes/src/win/winintrf.asm @@ -40,15 +40,12 @@ EXTSYM vesa2_clbit,vesa2_clbitng,vesa2_clbitng2,vesa2_clbitng3,vesa2red10,res640 EXTSYM res480,cbitmode,cvidmode,vesa2_bits,vesa2_x,vesa2_y,genfulladdtab,GUICPC EXTSYM drawscreenwin,ConvertToAFormat,UnusedBit,HalfTrans,UnusedBitXor,UnusedBit EXTSYM ngrposng,nggposng,ngbposng,HalfTransB,HalfTransC -EXTSYM WinUpdateDevices,UpdateVFrame,GetMouseX,GetMouseY,InitTCP,GetMouseMoveX +EXTSYM WinUpdateDevices,UpdateVFrame,GetMouseX,GetMouseY,GetMouseMoveX EXTSYM GetMouseMoveY,GetMouseButton,SetMouseMinX,SetMouseMaxX,SetMouseMinY EXTSYM SetMouseMaxY,SetMouseX,SetMouseY,T36HZEnabled,MouseButton,Start36HZ EXTSYM Stop36HZ,BufferSizeW,BufferSizeB,ProcessSoundBuffer,CheckTimers EXTSYM vesa2_rfull,vesa2_rtrcl,vesa2_rtrcla,vesa2_gfull,vesa2_gtrcl,vesa2_gtrcla -EXTSYM vesa2_bfull,vesa2_btrcl,vesa2_btrcla,Init_2xSaIMMXW,StartServerCycle -EXTSYM ServerCheckNewClient,acceptzuser,ConnectServer,WaitForServer,SendDataNop -EXTSYM SendDataUDPNop,GetDataNop,DeInitTCP,StopServer,Disconnect,UDPDisableMode -EXTSYM UDPEnableMode,UDPClearVars,UDPWait1Sec,WinErrorA2,WinErrorB2,WinErrorC2 +EXTSYM vesa2_bfull,vesa2_btrcl,vesa2_btrcla,Init_2xSaIMMXW EXTSYM ZsnesPage,V8Mode,GrayscaleMode,PrevWinMode,PrevFSMode,FrameSemaphore EXTSYM _imp__GetLocalTime@4 @@ -1555,301 +1552,6 @@ NEWSYM SetInputDevice mov dword[eax+44],46 ret - -SECTION .data -ALIGN32 -; **************************** -; TCP/IP Stuff -; **************************** - -; TCPIPPortNum -NEWSYM TCPIPStatus, db 0 -NEWSYM PacketSendSize, dd 0 -NEWSYM PacketRecvSize, dd 0 -NEWSYM PacketRecvPtr, dd 0 -NEWSYM PacketSendArray, times 2048+256 db 0 -NEWSYM PacketRecvArray, times 2048+256 db 0 -NEWSYM IPAddrStr, times 20 db 0 -NEWSYM RemoteDisconnect, db 0 -SECTION .text - -NEWSYM TCPIPStartServer - mov byte[RemoteDisconnect],0 - pushad - mov dword[PacketSendSize],0 - mov dword[PacketRecvSize],0 - call InitTCP - or eax,eax - jnz .failed - mov byte[TCPIPStatus],1 -; StartServer(unsigned short port) - xor eax,eax -; mov ax,[TCPIPPortNum] - push eax - call StartServerCycle - add esp,4 - or eax,eax - jnz .failed - mov byte[TCPIPStatus],2 - popad - xor eax,eax - ret -.failed - popad - mov eax,-1 - ret - -NEWSYM TCPIPWaitForConnection - mov byte[RemoteDisconnect],0 - pushad - call ServerCheckNewClient - mov [.temp],eax - cmp eax,1 - jne .notwaiting - call acceptzuser - or eax,eax - jnz .failed -.notwaiting - popad - mov eax,[.temp] - ret -.failed - popad - mov eax,-1 - ret -SECTION .data -.temp dd 0 -SECTION .text - -NEWSYM TCPIPInitConnectToServer - pushad - mov dword[PacketSendSize],0 - mov dword[PacketRecvSize],0 - call InitTCP - or eax,eax - jnz .failed - mov byte[TCPIPStatus],1 - ; Convert TCPIPAddress to IPAddrStr -; mov ebx,TCPIPAddress - mov edx,IPAddrStr -.notend - mov al,[ebx] - cmp al,' ' - je .dontinclude - mov [edx],al - inc edx -.dontinclude - inc ebx - cmp al,0 - jne .notend - popad - xor eax,eax - ret -.failed - popad - mov eax,1 - ret - -NEWSYM TCPIPConnectToServer -; int ConnectServer(char *servername, unsigned short port) - pushad - xor eax,eax -; mov ax,[TCPIPPortNum] - push eax - mov eax,IPAddrStr - push eax - xor eax,eax - call ConnectServer - add esp,8 - or eax,eax - jnz .noclient - mov byte[TCPIPStatus],3 - popad - xor eax,eax - ret -.noclient - mov [.temp],eax - popad - mov eax,[.temp] - ret -SECTION .data -.temp dd 1 -SECTION .text - -NEWSYM TCPIPConnectToServerW -; int ConnectServer(char *servername, unsigned short port) - pushad - xor eax,eax - call WaitForServer - or eax,eax - jnz .foundclient - mov byte[TCPIPStatus],3 - popad - xor eax,eax - ret -.foundclient - mov [.temp],eax - popad - mov eax,[.temp] - ret -SECTION .data -.temp dd 0 -SECTION .text - -NEWSYM TCPIPStoreByte - ; Store al into the array -; cmp dword[PacketSendSize],2048 -; je .packeterror - push ebx - mov ebx,[PacketSendSize] - mov [PacketSendArray+ebx],al - pop ebx - inc dword[PacketSendSize] - ret -.packeterror - mov byte[RemoteDisconnect],1 - ret - -NEWSYM TCPIPGetByte - ; dh = 0 : No bytes in buffer - ; dl = resulting character - cmp dword[PacketRecvSize],0 - jne .bytereceived - mov dword[PacketRecvPtr],0 - call TCPIPRecvPacket - cmp dword[PacketRecvSize],0 - jne .bytereceived - xor dh,dh - ret -.bytereceived - push eax - mov eax,[PacketRecvPtr] - mov dl,[PacketRecvArray+eax] - mov dh,1 - inc dword[PacketRecvPtr] - mov eax,[PacketRecvPtr] - cmp [PacketRecvSize],eax - jne .notequal - mov dword[PacketRecvSize],0 -.notequal - pop eax - ret - -NEWSYM TCPIPSendPacket - cmp dword[PacketSendSize],0 - je .nopacket - pushad - ; Send PacketSendArray with size of PacketSendSize - ; SendData(int [PacketSendSize],char *PacketSendArray) - push eax ; required pushes to get correct stack - push eax - call SendDataNop - or eax,eax - jnz .failed - add esp,8 - popad -.nopacket - ret -.failed - add esp,8 - popad - call TCPIPDisconnect - mov byte[RemoteDisconnect],1 - ret - -NEWSYM TCPIPSendPacketUDP - cmp dword[PacketSendSize],0 - je .nopacket - pushad - ; Send PacketSendArray with size of PacketSendSize - ; SendData(int [PacketSendSize],char *PacketSendArray) - push eax ; required pushes to get correct stack - push eax - call SendDataUDPNop - or eax,eax - jnz .failed - add esp,8 - popad -.nopacket - ret -.failed - add esp,8 - popad - call TCPIPDisconnect - mov byte[RemoteDisconnect],1 - ret - -NEWSYM TCPIPRecvPacket - pushad - ; Store packet to PacketRecvArray, size at PacketRecvSize - ; int GetData(int 2048,char *PacketRecvArray) - push eax ; required pushes to get correct stack - push eax - call GetDataNop - cmp eax,-1 - je .failed - mov [PacketRecvSize],eax - add esp,8 - popad - ret -.failed - add esp,8 - popad - call TCPIPDisconnect - mov byte[RemoteDisconnect],1 - ret - -NEWSYM TCPIPDisconnect - call DeInitTCP - cmp byte[TCPIPStatus],2 - jne .notserver - call StopServer -.notserver - cmp byte[TCPIPStatus],3 - jne .notclient - call Disconnect -.notclient - mov byte[TCPIPStatus],0 - ret - -NEWSYM TCPIPPreparePacket - mov dword[PacketSendSize],0 - ret - -NEWSYM ClearUDPStuff - pushad - call UDPClearVars - popad - ret - -NEWSYM Wait1SecWin - pushad - call UDPWait1Sec - popad - ret - -NEWSYM EnableSUDPPacket - pushad - call UDPEnableMode - popad - ret - -NEWSYM DisableSUDPPacket - pushad - call UDPDisableMode - popad - ret - -NEWSYM WinErrorA - call WinErrorA2 - ret -NEWSYM WinErrorB - call WinErrorB2 - ret -NEWSYM WinErrorC - call WinErrorC2 - ret - NEWSYM GotoHomepage pushad call ZsnesPage diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index dbefdd21..928310a7 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -2125,10 +2125,6 @@ DWORD ScreenPtr; DWORD ScreenPtr2; extern void GUI36hzcall(void); extern void Game60hzcall(void); -extern int packettimeleft[256]; -extern int PacketCounter; -extern int CounterA; -extern int CounterB; void CheckTimers(void) { @@ -2140,14 +2136,6 @@ void CheckTimers(void) while ((end2 - start2) >= update_ticks_pc2) { - if (CounterA>0) CounterA--; - if (CounterB>0) CounterB--; - if (PacketCounter){ - for (int i=0;i<256;i++){ - if (packettimeleft[i]>0) - packettimeleft[i]--; - } - } start2 += update_ticks_pc2; } diff --git a/zsnes/src/zloader.c b/zsnes/src/zloader.c index 94440f19..02709d89 100644 --- a/zsnes/src/zloader.c +++ b/zsnes/src/zloader.c @@ -221,6 +221,7 @@ static void handle_params(int argc, char *argv[]) #ifndef __MSDOS__ + /* if (argc >= 5 && argv[1][0] == '/' && strlen(argv[1]) == 6) { size_t i = 0, j = 0; @@ -265,6 +266,7 @@ static void handle_params(int argc, char *argv[]) strp[j] = 0; } + */ #endif for (i = 1; i < argc; i++)