diff --git a/zsnes/src/Makefile.in b/zsnes/src/Makefile.in index 1c9ce927..f17a7215 100644 --- a/zsnes/src/Makefile.in +++ b/zsnes/src/Makefile.in @@ -24,7 +24,6 @@ DOSDIR=dos GUIDIR=gui VIDEODIR=video WINDIR=linux -OBJDIR=obj NETDIR=net ZIPDIR=zip EFFECTSDIR=effects @@ -101,13 +100,13 @@ ${EFFECTSDIR}/smoke.o: ${EFFECTSDIR}/smoke.c ${EFFECTSDIR}/burn.o: ${EFFECTSDIR}/burn.c ${VIDEODIR}/procvid.o: ${VIDEODIR}/procvid.asm macros.mac ${VIDEODIR}/copyvid.inc ${VIDEODIR}/2xsaimmx.inc ${VIDEODIR}/procvidc.o: ${VIDEODIR}/procvidc.c -${VIDEODIR}/sw_draw.obj: ${VIDEODIR}/sw_draw.asm macros.mac -${VIDEODIR}/hq2x16.obj: ${VIDEODIR}/hq2x16.asm macros.mac -${VIDEODIR}/hq2x32.obj: ${VIDEODIR}/hq2x32.asm macros.mac -${VIDEODIR}/hq3x16.obj: ${VIDEODIR}/hq3x16.asm macros.mac -${VIDEODIR}/hq3x32.obj: ${VIDEODIR}/hq3x32.asm macros.mac -${VIDEODIR}/hq4x16.obj: ${VIDEODIR}/hq4x16.asm macros.mac -${VIDEODIR}/hq4x32.obj: ${VIDEODIR}/hq4x32.asm macros.mac +${VIDEODIR}/sw_draw.o: ${VIDEODIR}/sw_draw.asm macros.mac +${VIDEODIR}/hq2x16.o: ${VIDEODIR}/hq2x16.asm macros.mac +${VIDEODIR}/hq2x32.o: ${VIDEODIR}/hq2x32.asm macros.mac +${VIDEODIR}/hq3x16.o: ${VIDEODIR}/hq3x16.asm macros.mac +${VIDEODIR}/hq3x32.o: ${VIDEODIR}/hq3x32.asm macros.mac +${VIDEODIR}/hq4x16.o: ${VIDEODIR}/hq4x16.asm macros.mac +${VIDEODIR}/hq4x32.o: ${VIDEODIR}/hq4x32.asm macros.mac ${CHIPDIR}/dsp1proc.o: ${CHIPDIR}/dsp1proc.asm macros.mac ${CHIPDIR}/sa1regs.o: ${CHIPDIR}/sa1regs.asm macros.mac\ ${CPUDIR}/regs.mac ${CPUDIR}/regsw.mac diff --git a/zsnes/src/cpu/dspproc.asm b/zsnes/src/cpu/dspproc.asm index d039ba2e..3bf922f1 100644 --- a/zsnes/src/cpu/dspproc.asm +++ b/zsnes/src/cpu/dspproc.asm @@ -21,7 +21,7 @@ %include "macros.mac" EXTSYM spcRam, spcPCRam, spcRamDP, spcS, spcX, MovieProcessing -EXTSYM CNetType, soundon, RevStereo +EXTSYM soundon, RevStereo EXTSYM PitchModEn,SoundNoiseDis EXTSYM DosExit,Invalidopcode,RSPCRegF0,RSPCRegF1,RSPCRegF2,RSPCRegF3 EXTSYM RSPCRegF4,RSPCRegF5,RSPCRegF6,RSPCRegF7,RSPCRegF8,RSPCRegF9 diff --git a/zsnes/src/cpu/execute.asm b/zsnes/src/cpu/execute.asm index ea0c3b29..d97cc7e9 100644 --- a/zsnes/src/cpu/execute.asm +++ b/zsnes/src/cpu/execute.asm @@ -48,10 +48,6 @@ EXTSYM OSExit,DosExit,InitDir,InitDrive,createnewcfg,fnames,gotoroot,previdmode EXTSYM ramsize,sfxramdata,setaramdata,SETAEnable,sram,SRAMChdir ; EXTSYM tempstore EXTSYM printhex -%ifdef __MSDOS__ -EXTSYM ModemInitStat, DeInitModem -EXTSYM deinitipx -%endif EXTSYM deinitvideo EXTSYM BRRBuffer,DSPMem,PrepareSaveState,ResetState,SFXEnable,PHdspsave EXTSYM fnamest,sndrot,spcRam,spcRamDP,tableA,vram,wramdata @@ -84,17 +80,7 @@ EXTSYM ForceNewGfxOff,LethEnData,C4Pause,GUIQuit EXTSYM IRAM,SA1Ptr,SA1BWPtr EXTSYM scrnon,scaddset EXTSYM outofmemfix,yesoutofmemory -EXTSYM CNetType,Latency,LatencyLeft,NetSwap -; EXTSYM vesa2selec -EXTSYM RemoteSendChar,RemoteGetChar,pl1neten,pl2neten,pl3neten,pl4neten -EXTSYM pl5neten,RemoteSendEAX,prevp1net,prevp2net,prevp3net,prevp4net -EXTSYM RemoteGetEAX,cnetplaybuf,netdelayed,cnetptrtail,cnetptrhead -EXTSYM ChatProgress,RecvProgress,chatTL,WritetochatBuffer,NetAddChar -EXTSYM PreparePacket,SendPacket,NoInputRead,RemoteDisconnect -EXTSYM SendPacketUDP,ChatNick -EXTSYM JoyRead,ChatType2,chatstrR2,chatstrR3,chatstrR4,chatstrR5 -EXTSYM chatRTL2,chatRTL3,chatRTL4,chatRTL5 -EXTSYM NetLoadState,ProcessMovies,MovieStop +EXTSYM ProcessMovies,MovieStop EXTSYM ioportval,ppustatus EXTSYM C4VBlank,dsp1teststuff EXTSYM ReturnFromSPCStall,SPCStallSetting,cycpb268,cycpb358,HIRQSkip,scanlines @@ -106,10 +92,10 @@ EXTSYM SfxPBR,SCBRrel,SfxSCBR,SfxCOLR,hdmaearlstart,SFXCounter EXTSYM fxbit01,fxbit01pcal,fxbit23,fxbit23pcal,fxbit45,fxbit45pcal,fxbit67,fxbit67pcal EXTSYM SfxSFR,nosprincr EXTSYM cpucycle,debstop,switchtovirqdeb,debstop3,switchtonmideb -EXTSYM NetPlayNoMore,MovieSeekBehind +EXTSYM MovieSeekBehind EXTSYM statefileloc,CHIPBATT,SaveSramData,BackupCVFrame,RestoreCVFrame,loadstate EXTSYM KeyInsrtChap,KeyNextChap,KeyPrevChap,MovieInsertChapter,MovieSeekAhead,ResetDuringMovie -EXTSYM EMUPauseKey,INCRFrameKey,MovieWaiting +EXTSYM EMUPauseKey,INCRFrameKey,MovieWaiting,NoInputRead EXTSYM copyvid %ifdef __MSDOS__ @@ -119,172 +105,15 @@ EXTSYM dssel SECTION .data NEWSYM CBackupPos, dd 0 NEWSYM PBackupPos, dd 0 -NEWSYM PPValue, dd 0 ; Previous PValue -NEWSYM DPValue, dd 0 ; Destination PValue -NEWSYM CurRecv, dd 0 ; Set to 1 if Recovery mode is on -; if CurRecv=1, then do not send tcp/ip data, always frame skip, do not -; draw to screen, do not key on, restore previous local key presses, -; when disabling key ons, divert dspmem write/read to a different -; array temporarly, then re-copy back in when finished -NEWSYM PPContrl, times 16 dd 0 ; Previous Controller 1 Data -NEWSYM PPContrl2, times 16 dd 0 ; Previous Controller 2 Data -NEWSYM PPContrl3, times 16 dd 0 ; Previous Controller 3 Data -NEWSYM PPContrl4, times 16 dd 0 ; Previous Controller 4 Data -NEWSYM PPContrl5, times 16 dd 0 ; Previous Controller 5 Data NEWSYM tempedx, dd 0 NEWSYM tempesi, dd 0 NEWSYM tempedi, dd 0 NEWSYM tempebp, dd 0 -NEWSYM NetSent2, dd 0 -NEWSYM NetQuitter, dd 0 -NEWSYM NetQuit, db 0 -NEWSYM QBackupPos, dd 0 -NEWSYM LatencyV, times 256 db 0 -NEWSYM LatencyRecvPtr, dd 0 -NEWSYM LatencySendPtr, dd 0 -NEWSYM latencytimer, dd 0 -NEWSYM BackState, db 1 -NEWSYM BackStateSize, dd 6 -NEWSYM nojoystickpoll, dd 0 -NEWSYM RemoteLValue, db 0 -NEWSYM LocalLValue, db 0 -NEWSYM chatstrLt, times 15 db 0 NEWSYM RewindOldPos, dd 0 NEWSYM RewindPos, dd 0 NEWSYM RewindTimer, dd 0 -NEWSYM ResendTimer, dd 60 -NEWSYM valuea, dd 0 -NEWSYM valueb, dd 0 -NEWSYM valuet, dd 0 - -SECTION .text - -NEWSYM SplitStringChat - push ebx - push eax - push ecx - mov eax,chatstrR - call StringLength - cmp ecx,42 - jbe near .noneed - mov eax,42 -.next2 - cmp byte[chatstrR+eax],' ' - je near .space - cmp eax,33 - jb .dontclipearly - dec eax - jmp .next2 -.space - inc eax - jmp .processclip -.dontclipearly - mov eax,42 -.processclip - push eax - mov ebx,[chatRTL4] - mov [chatRTL5],ebx - mov ebx,[chatRTL3] - mov [chatRTL4],ebx - mov ebx,[chatRTL2] - mov [chatRTL3],ebx - mov ebx,[chatRTL] - mov [chatRTL2],ebx - xor ecx,ecx -.chatcpyloop - mov al,[chatstrR4+ecx] - mov [chatstrR5+ecx],al - mov al,[chatstrR3+ecx] - mov [chatstrR4+ecx],al - mov al,[chatstrR2+ecx] - mov [chatstrR3+ecx],al - mov al,[chatstrR+ecx] - mov [chatstrR2+ecx],al - inc ecx - cmp ecx,100 - jnz .chatcpyloop - pop eax - push eax - xor ecx,ecx - mov byte[chatstrR],' ' - inc ecx -.next - mov bl,[chatstrR2+eax] - mov [chatstrR+ecx],bl - inc eax - inc ecx - or bl,bl - jnz .next - pop eax - mov byte[chatstrR2+eax],0 -.noneed - pop ecx - pop eax - pop ebx - ret - -NEWSYM MoveStringChat - mov ebx,[chatRTL4] - mov [chatRTL5],ebx - mov ebx,[chatRTL3] - mov [chatRTL4],ebx - mov ebx,[chatRTL2] - mov [chatRTL3],ebx - mov ebx,[chatRTL] - mov [chatRTL2],ebx - push eax - push ecx - xor ecx,ecx -.chatcpyloop - mov al,[chatstrR4+ecx] - mov [chatstrR5+ecx],al - mov al,[chatstrR3+ecx] - mov [chatstrR4+ecx],al - mov al,[chatstrR2+ecx] - mov [chatstrR3+ecx],al - mov al,[chatstrR+ecx] - mov [chatstrR2+ecx],al - inc ecx - cmp ecx,100 - jnz .chatcpyloop - pop ecx - pop eax - ret - -NEWSYM GenLatencyDisplay - call Get_Time - mov [.temp],eax - mov ebx,16 - xor eax,eax - xor edx,edx - mov al,[valuea] - mov al,[.temp] - div ebx - add al,48 - add dl,48 - mov byte[chatstrLt+2],32 - cmp al,9 - jbe .bel9 -; sub al,10 -.bel9 - mov [chatstrLt+1],dl - mov [chatstrLt],al - mov ebx,16 - xor eax,eax - xor edx,edx - mov al,[.temp+1] - div ebx - add al,48 - add dl,48 - cmp al,9 - jbe .bel9b -; sub al,10 -.bel9b - mov [chatstrLt+4],dl - mov [chatstrLt+3],al - ret -SECTION .bss -.temp resd 1 +NEWSYM BackState, db 1 +NEWSYM BackStateSize, dd 6 SECTION .text NEWSYM ResetExecStuff @@ -304,14 +133,9 @@ NEWSYM ResetExecStuff ret NEWSYM ProcessRewind - cmp byte[CNetType],20 - jb .okay -.notokayb - ret -.okay mov eax,dword[KeyRewind] cmp byte[pressed+eax],1 - jne .notokayb + jne near .notokay mov byte[pressed+eax],2 mov eax,[RewindOldPos] cmp [RewindPos],eax @@ -354,15 +178,13 @@ NEWSYM ProcessRewind ret NEWSYM UpdateRewind -%ifndef __MSDOS__ push eax cmp dword[KeyRewind],0 je .notftimer call ProcessRewind dec dword[RewindTimer] jnz .notftimer - cmp byte[CNetType],20 - jb .okay + jmp .okay .notftimer pop eax ret @@ -385,7 +207,6 @@ NEWSYM UpdateRewind and dword[RewindOldPos],0Fh .noteq pop eax -%endif ret SECTION .data @@ -419,102 +240,6 @@ VoiceStartMute: pop eax ret -NetSaveState: - call joinflags - ; de-init variables (copy to variables) - mov [spcPCRam],ebp - mov [Curtableaddr],edi - mov [xp],dl - mov [curcyc],dh - mov eax,[initaddrl] - sub esi,eax ; subtract program counter by address - mov [xpc],si - call ResetTripleBuf - mov eax,[KeySaveState] - cmp byte[CNetType],20 - je .skipsoundreinit - test byte[pressed+eax],1 - jnz .soundreinit - mov eax,[KeyLoadState] - test byte[pressed+eax],1 - jz .skipsoundreinit -.soundreinit - mov byte[NoSoundReinit],1 - mov byte[csounddisable],1 -.skipsoundreinit - - pushad - call statesaver - popad - - ; initialize variables (Copy from variables) - call UpdateDPage - call SA1UpdateDPage - call Makemode7Table - cmp byte[SFXEnable],0 - je .nosfxud - call UpdateSFX -.nosfxud - xor eax,eax - xor ebx,ebx - xor ecx,ecx - xor edx,edx - mov bl,[xpb] - mov ax,[xpc] - test ax,8000h - jz .loweraddr - mov esi,[snesmmap+ebx*4] - jmp .skiplower -.loweraddr - cmp ax,4300h - jb .lower - cmp dword[memtabler8+ebx*4],regaccessbankr8 - je .dma -.lower - mov esi,[snesmap2+ebx*4] - jmp .skiplower -.dma - mov esi,dmadata-4300h -.skiplower - mov [initaddrl],esi - add esi,eax ; add program counter to address - mov dl,[xp] ; set flags - mov dh,[curcyc] ; set cycles - - mov bl,dl -; cmp byte[CNetType],20 -; je .skipmovie -; cmp byte[CNetType],21 -; je .skipmovie -; jmp .skipmovie -; cmp byte[MovieProcessing],0 -; jne .movie -;.skipmovie - cmp byte[spcon],0 - je .nosoundta - mov edi,[tableadc+ebx*4] - or byte[curexecstate],2 - jmp .soundta -.nosoundta - mov edi,[tableadb+ebx*4] - and byte[curexecstate],0FDh -.soundta - jmp .nomovie -.movie - mov edi,[tableadc+ebx*4] - test byte[curexecstate],2 - jnz .nomovie - mov edi,[tableadb+ebx*4] -.nomovie - - mov ebp,[spcPCRam] - - mov byte[NoSoundReinit],0 - mov byte[csounddisable],0 - mov byte[NextNGDisplay],0 - - call splitflags - ret %macro stim 0 %ifdef __MSDOS__ @@ -522,12 +247,6 @@ NetSaveState: %endif %endmacro -%macro clim 0 -%ifdef __MSDOS__ - cli -%endif -%endmacro - %macro ProcessIRQStuffB 0 ; check for VIRQ/HIRQ/NMI test dl,04h @@ -821,14 +540,6 @@ reexecuteb2: mov dh,[curcyc] ; set cycles mov bl,dl -; cmp byte[CNetType],20 -; je .skipmovie -; cmp byte[CNetType],21 -; je .skipmovie -; jmp .skipmovie -; cmp byte[MovieProcessing],0 -; jne .movie -;.skipmovie cmp byte[spcon],0 je .nosoundta mov edi,[tableadc+ebx*4] @@ -851,7 +562,6 @@ reexecuteb2: mov byte[NoSoundReinit],0 mov byte[csounddisable],0 mov byte[NextNGDisplay],0 - mov byte[NetPlayNoMore],1 call splitflags @@ -878,8 +588,6 @@ reexecuteb2: call ResetTripleBuf mov eax,[KeySaveState] - cmp byte[CNetType],20 - je .skipsoundreinit test byte[pressed+eax],1 jnz .soundreinit mov eax,[KeyLoadState] @@ -920,8 +628,6 @@ reexecuteb2: cmp byte[ReturnFromSPCStall],1 je near .activatereset mov eax,[KeySaveState] - cmp byte[CNetType],20 - je near .net test byte[pressed+eax],1 jnz near savestate mov eax,[KeyLoadState] @@ -973,7 +679,6 @@ reexecuteb2: test byte[pressed+59],1 jne near showmenu mov eax,[KeyQuickRst] -.net test byte[pressed+eax],1 jz .noreset .activatereset @@ -1018,14 +723,6 @@ NEWSYM endprog mov ebx,InitDir call Change_Dir -%ifdef __MSDOS__ - ; Deinit modem if necessary - cmp byte[ModemInitStat],0 - je .nodeinitmodem - call DeInitModem -.nodeinitmodem - call deinitipx -%endif jmp OSExit NEWSYM interror @@ -1316,60 +1013,6 @@ Donextlinecache: mov byte[NextLineCache],0 ret -%macro NetHelpExecSend 1 - cmp byte[pl1neten+%1],1 - jne %%nopl - mov eax,[ecx] - mov [cnetplaybuf+ebx],al - inc ebx - and ebx,1FFh - mov [cnetplaybuf+ebx],ah - inc ebx - and ebx,1FFh - ror eax,16 - mov [cnetplaybuf+ebx],al - inc ebx - and ebx,1FFh - mov [cnetplaybuf+ebx],ah - inc ebx - and ebx,1FFh - ror eax,16 - call RemoteSendEAX - add ecx,4 -%%nopl -%endmacro - -%macro NetHelpExecRecv 1 - cmp byte[pl1neten+%1],2 - jne %%nopl - call RemoteGetEAX - mov [ecx],eax -%%nopl - add ecx,4 -%endmacro - -%macro NetHelpExecRecv2 1 - cmp byte[pl1neten+%1],1 - jne %%nopl - mov al,[cnetplaybuf+ebx] - inc ebx - and ebx,1FFh - mov ah,[cnetplaybuf+ebx] - inc ebx - and ebx,1FFh - ror eax,16 - mov al,[cnetplaybuf+ebx] - inc ebx - and ebx,1FFh - mov ah,[cnetplaybuf+ebx] - inc ebx - and ebx,1FFh - ror eax,16 - mov [ecx],eax -%%nopl - add ecx,4 -%endmacro - ;******************************************************* ; 65816 execution ;******************************************************* @@ -1829,20 +1472,11 @@ NEWSYM cpuover .nmi mov byte[irqon],80h mov byte[doirqnext],0 - inc dword[NetSent] cmp byte[yesoutofmemory],1 jne .noout call outofmemfix .noout -; pushad -; call GenLatencyDisplay -; popad - - - ; NetCommand : bit 0 = Okay (should be 1), bit 1 = control update, - ; bit 2 = print update, bit 3 = quit, bit 4 = reset - dec word[curypos] mov [tempdh],dh xor dh,dh @@ -1853,15 +1487,6 @@ NEWSYM cpuover call exechdma call exechdma -; push es -; cmp byte[cbitmode],1 -; jne .nodisptest -; mov es,[vesa2selec] -; mov word[es:10+640],1111111111111111b -;.nodisptest -; pop es - - mov byte[NetCommand],0 mov byte[NextNGDisplay],1 cmp byte[newengen],0 je .nonewgfx @@ -1873,10 +1498,6 @@ NEWSYM cpuover ; je .nonewgfx call StartDrawNewGfx .nonewgfx - cmp byte[chaton],1 - je near .nonet - cmp byte[CNetType],20 - je near .net cmp byte[GUIQuit],1 je near endprog mov eax,dword[KeyQuickSnapShot] @@ -1959,28 +1580,8 @@ NEWSYM cpuover je .returntoloop dec byte[ExecExitOkay] .returntoloop - jmp .nonet -.net - test byte[pressed+1],01h - jz .nonetexit - or byte[NetCommand],08h -.nonetexit - mov eax,[KeySaveState] - test byte[pressed+eax],01h - jz .notnetsave - mov byte[pressed+eax],2 - call NetSaveState -.notnetsave - mov eax,[KeyLoadState] - test byte[pressed+eax],01h - jz .notnetload - or byte[NetCommand],88h -.notnetload -.nonet mov dh,[tempdh] inc word[curypos] - cmp byte[CurRecv],1 - je .noinputread cmp byte[NoInputRead],1 je .noinputread call ReadInputDevice @@ -2020,763 +1621,12 @@ NEWSYM cpuover call UpdateRewind - mov byte[NetQuit],0 - cmp byte[CNetType],20 - jne near .nozerons - test byte[NetSwap],1 - jnz near .noonens - - cmp byte[CurRecv],1 - je near .noreceiveb2 - - mov eax,[JoyAOrig] - cmp eax,[prevp1net] - je .nochange1 - or byte[NetCommand],02h - mov [prevp1net],eax -.nochange1 - mov eax,[JoyBOrig] - cmp eax,[prevp2net] - je .nochange2 - or byte[NetCommand],02h - mov [prevp2net],eax -.nochange2 - mov eax,[JoyCOrig] - cmp eax,[prevp3net] - je .nochange3 - or byte[NetCommand],02h - mov [prevp3net],eax -.nochange3 - mov eax,[JoyDOrig] - cmp eax,[prevp4net] - je .nochange4 - or byte[NetCommand],02h - mov [prevp4net],eax -.nochange4 - test byte[NetCommand],02h - jz .nochangeatall - mov dword[ResendTimer],60 - jmp .yeschanged -.nochangeatall - dec dword[ResendTimer] - jnz .yeschanged - or byte[NetCommand],02h - mov dword[ResendTimer],60 -.yeschanged - ; Send command & store command - call PreparePacket - push ebx - push ecx - mov al,[NetCommand] - mov ebx,[cnetptrhead] - mov [cnetplaybuf+ebx],al - call RemoteSendChar - ; ################## - ; Send latency value -%ifndef __MSDOS__ - cmp byte[BackState],1 - jne .nolatencysend - mov ebx,[LatencySendPtr] - and ebx,0FFh - inc dword[LatencySendPtr] - mov byte[LatencyV+ebx],0 - mov ebx,[PBackupPos] - mov al,[LocalLValue] -; inc al - call RemoteSendChar -%endif -.nolatencysend - mov ebx,[cnetptrhead] - mov ecx,JoyAOrig - inc ebx - and ebx,1FFh - test byte[NetCommand],02h - jz near .nosendextra - NetHelpExecSend 0 - NetHelpExecSend 1 - NetHelpExecSend 2 - NetHelpExecSend 3 - NetHelpExecSend 4 -.nosendextra - mov [cnetptrhead],ebx - - call SendPacketUDP - - cmp byte[chaton],0 - jne .nosendchats - cmp byte[chatstrL],0 - je .nosendchats - cmp dword[chatTL],0 - jne .nosendchats - mov byte[NetCommand],04h -.nosendchats - - ; send chat string - test byte[NetCommand],04h - jz near .nosendchatsend - call PreparePacket - mov al,04h - call RemoteSendChar - - call MoveStringChat - - push esi - mov esi,chatstrR - -%ifdef __MSDOS__ - mov byte[esi],'L' - mov byte[esi+1],'>' - add esi,2 -%else - ;jmp .skipsendnick -;.notwin32b - cmp dword[chatstrL+1],'/ME ' - jne .noaction - mov al,'*' - push ebx - push eax - mov [esi],al - inc esi - call RemoteSendChar - pop eax - pop ebx -.noaction - mov ebx,ChatNick -.nextchatc2 - mov al,[ebx] - cmp al,0 - je .nonextchat - push ebx - push eax - mov [esi],al - inc esi - call RemoteSendChar - pop eax - pop ebx - inc ebx - cmp byte[ebx-1],0 - jne .nextchatc2 -.nonextchat - mov al,'>' - cmp dword[chatstrL+1],'/ME ' - jne .noaction2 - mov al,' ' -.noaction2 - push ebx - push eax - mov [esi],al - inc esi - call RemoteSendChar - pop eax - pop ebx -%endif -.skipsendnick - mov ebx,chatstrL+1 -%ifndef __MSDOS__ - cmp dword[chatstrL+1],'/ME ' - jne .noaction3 - mov ebx,chatstrL+5 -%endif -.noaction3 -.nextchatc - mov al,[ebx] - push ebx - push eax - mov [esi],al - inc esi - call RemoteSendChar - pop eax - pop ebx - inc ebx - cmp byte[ebx-1],0 - jne .nextchatc - mov byte[esi],0 - pop esi - mov ecx,45 - mov ebx,chatstrL -.chatsendloop - mov al,[ebx+1] - mov [ebx],al - inc ebx - dec ecx - jnz .chatsendloop - mov byte[chatstrL],0 - mov dword[chatTL],10 - mov dword[chatRTL],8*60 - call SplitStringChat - call SendPacket -.nosendchatsend - pop ecx - pop ebx - jmp .noreceiveb3 -.noreceiveb2 -.noreceiveb3 - - mov dword[JoyAOrig],0 - mov dword[JoyBOrig],0 - mov dword[JoyCOrig],0 - mov dword[JoyDOrig],0 - mov dword[JoyEOrig],0 - - cmp byte[LatencyLeft],0 - jne near .latencyleft - - mov [tempedx],edx - mov [tempesi],esi - mov [tempedi],edi - mov [tempebp],ebp - - push ecx - push ebx -%ifndef __MSDOS__ - cmp byte[BackState],1 - jne .nobackstate - pushad - call BackupCVFrame - popad -.nobackupcvframe - mov ebx,[CBackupPos] - inc ebx - and ebx,0Fh - mov [CBackupPos],ebx -%endif -.nobackstate - pop ebx - pop ecx - - push ebx - push ecx - - cmp dword[CurRecv],1 - je .yesreceive2 - xor ebx,ebx -.latencyloop - add dword[LatencyV+ebx*4],01010101h - inc ebx - cmp ebx,64 - jne .latencyloop -.yesreceive2 - - cmp dword[CurRecv],1 - jne near .notreceive - mov ebx,[PPValue] - inc ebx - and ebx,0Fh - mov [PPValue],ebx - cmp ebx,[DPValue] - jne near .notreceive - mov dword[CurRecv],0 - call VoiceEndMute - cmp byte[t1cc],4 - jbe .noframesskippedb - mov byte[t1cc],4 -.noframesskippedb - jmp .received -.notreceive -.received - pop ecx - pop ebx - - ; Receive command from net and process - push ebx - push ecx - - cmp byte[CurRecv],1 - je near .nocrupdate3b - - xor bl,bl - mov cx,[t1cc] - add cx,60*15 -.notfoundchar -.onlychatchar - call RemoteGetChar -; cmp [t1cc],cx -; jne .notor - jmp .notor -.netquit2 - or byte[NetQuit],80h - mov byte[RemoteDisconnect],1 - jmp .skipallnet -.notor - cmp dh,0 - jne .foundchar -%ifndef __MSDOS__ - push ebx - cmp byte[BackState],1 - jne .nobackstate2 - mov ebx,[CBackupPos] - dec ebx - sub ebx,[PBackupPos] - sub ebx,[BackStateSize] - and ebx,0Fh -; inc ebx -; and ebx,0Fh -; cmp ebx,[PBackupPos] - jne near .nocrupdate3 ; ************************* -.nobackstate2 - pop ebx - - pushad - mov byte[nojoystickpoll],1 - call JoyRead - mov byte[nojoystickpoll],0 -; call ChatType2 - popad - cmp word[t1cc],4*60 - jb .notwin32 - cmp byte[pressed+1],1 - je .netquit2 -%endif -.notwin32 - mov bl,1 - jmp .notfoundchar -.foundchar - cmp dl,04h - jne .notchatchar - jmp .recvchats -.notchatchar - cmp byte[t1cc],4 - jbe .noframesskipped - mov byte[t1cc],4 -.noframesskipped - - inc byte[netdelayed] - cmp bl,0 - jne .yesdelay - mov byte[netdelayed],0 -.yesdelay - cmp byte[netdelayed],10 - jne .nodelayfix - mov byte[netdelayed],0 - cmp byte[t1cc],0 - je .nodelayfix - dec byte[t1cc] -.nodelayfix - mov [NetCommand],dl - - pushad - ; Receive latency value - ; ##################### -%ifndef __MSDOS__ - cmp byte[BackState],1 - jne near .nolatencyrecv2 -.tryagainlatency - call RemoteGetChar ; ********** - cmp byte[RemoteDisconnect],1 - je near .netquit - cmp dh,0 - je .tryagainlatency - mov ebx,[LatencyRecvPtr] - and ebx,0FFh - inc dword[LatencyRecvPtr] - mov al,[LatencyV+ebx] - mov [RemoteLValue],dl - mov [LocalLValue],al - cmp al,dl - jbe .nolatencyrecv3 - ; incr t1cc -> make local speed faster if local latency > remote - inc dword[latencytimer] - cmp dword[latencytimer],5 - jb .nolatencyrecv2 - mov dword[latencytimer],0 - cmp byte[t1cc],0 - je .nolatencyrecv2 - dec byte[t1cc] - jmp .nolatencyrecv2 -.nolatencyrecv3 - cmp al,dl - je .nolatencyrecv2 - inc dword[latencytimer] - cmp dword[latencytimer],5 - jb .nolatencyrecv2 - mov dword[latencytimer],0 - inc byte[t1cc] -%endif -.nolatencyrecv2 - popad - inc dword[NetSent2] - - test dl,01h - jnz near .netfailed - test dl,070h - jnz near .netfailed - - cmp dword[NetQuitter],0 - je .noforcequit - mov ebx,[PBackupPos] - inc ebx - and ebx,0Fh - cmp ebx,[QBackupPos] - je .forcequit -.noforcequit - test dl,08h - jz .noquit -.forcequit - test dl,80h - jz .noloadstate - mov byte[NetLoadState],1 -.noloadstate - or byte[NetQuit],1 - cmp byte[BackState],1 - jne .noquit - push edx - mov ebx,[PBackupPos] - inc ebx - and ebx,0Fh - cmp ebx,[CBackupPos] - je .noquit2 - pushad - call RestoreCVFrame - popad - mov esi,[tempesi] - mov edi,[tempedi] - mov ebp,[tempebp] - add dword[NetSent],1000 -.noquit2 - pop edx -.noquit - test dl,02h - jz near .nocrupdate2 - -%ifndef __MSDOS__ - cmp byte[BackState],1 - jne .notwin32d - push edx - mov ebx,[PBackupPos] - inc ebx - and ebx,0Fh - cmp ebx,[CBackupPos] - je .noupdate - pushad - call RestoreCVFrame - popad - mov esi,[tempesi] - mov edi,[tempedi] - mov ebp,[tempebp] - mov ebx,[PBackupPos] ; ***************** - inc ebx - and ebx,0Fh - mov [PPValue],ebx - mov ebx,[CBackupPos] - mov [DPValue],ebx - mov ebx,[PPValue] - mov [CBackupPos],ebx - mov dword[CurRecv],1 ; ***************** - call VoiceStartMute -.noupdate - mov ebx,[PBackupPos] - inc ebx - and ebx,0Fh - mov [PBackupPos],ebx - pop edx -%endif -.notwin32d - mov ecx,JoyAOrig - NetHelpExecRecv 0 - NetHelpExecRecv 1 - NetHelpExecRecv 2 - NetHelpExecRecv 3 - NetHelpExecRecv 4 - jmp .donecrupdate -.nocrupdate3 - pop ebx -.nocrupdate3b - mov byte[NetCommand],0 - jmp .nocrupdate -.nocrupdate2 - mov ebx,[PBackupPos] - inc ebx - and ebx,0Fh - mov [PBackupPos],ebx -.nocrupdate - cmp byte[pl1neten],2 - jne .nopl1recv - mov eax,[JoyABack] - mov [JoyAOrig],eax -.nopl1recv - cmp byte[pl2neten],2 - jne .nopl2recv - mov eax,[JoyBBack] - mov [JoyBOrig],eax -.nopl2recv - cmp byte[pl3neten],2 - jne .nopl3recv - mov eax,[JoyCBack] - mov [JoyCOrig],eax -.nopl3recv - cmp byte[pl4neten],2 - jne .nopl4recv - mov eax,[JoyDBack] - mov [JoyDOrig],eax -.nopl4recv - cmp byte[pl5neten],2 - jne .nopl5recv - mov eax,[JoyEBack] - mov [JoyEOrig],eax -.nopl5recv -.donecrupdate - - jmp .norecvchats -.recvchats - push ebx - - call MoveStringChat - - mov ebx,chatstrR - push edx -.nextchatcr - push ebx - push ecx - mov cx,[t1cc] - add cx,60*10 -.tryagainchatc - call RemoteGetChar ; ********** - cmp byte[RemoteDisconnect],1 - je .netquit - cmp [t1cc],cx - jne .noto -.netquit - or byte[NetQuit],80h - mov dh,1 -.noto - cmp dh,0 - je .tryagainchatc ; ********* - pop ecx - pop ebx - mov [ebx],dl - inc ebx - cmp dl,0 - jne .nextchatcr ; ********* - pop edx - pushad -%ifdef __MSDOS__ - mov dl,'R' - call NetAddChar - mov dl,'>' - call NetAddChar -%endif -.notwin32e - mov esi,chatstrR - call WritetochatBuffer - mov dl,13 - call NetAddChar - mov dl,10 - call NetAddChar - popad - mov dword[chatRTL],60*8 - call SplitStringChat - pop ebx - jmp .onlychatchar -.norecvchats - - jmp .skipfailed -.netfailed - or byte[NetQuit],80h -.skipfailed - - cmp byte[CurRecv],1 - je near .noreceiveb - ; Process previous command from buffer - mov ebx,[cnetptrtail] - mov ecx,JoyAOrig - mov dl,[cnetplaybuf+ebx] - inc ebx - and ebx,1FFh - test dl,08h - jz .noquit2b - push ebx - mov ebx,[PBackupPos] - cmp ebx,[CBackupPos] - je .yesquit - cmp dword[NetQuitter],1 - je .quitlater - test dl,80h - jz .noloadstateb - mov byte[NetLoadState],2 -.noloadstateb - mov dword[NetQuitter],1 - mov ebx,[CBackupPos] - mov [QBackupPos],ebx - jmp .quitlater -.yesquit - test dl,80h - jz .noloadstateb2 - mov byte[NetLoadState],2 -.noloadstateb2 - or byte[NetQuit],1 -.quitlater - pop ebx -.noquit2b - test dl,02h - jz near .nocrupdate2b - NetHelpExecRecv2 0 - NetHelpExecRecv2 1 - NetHelpExecRecv2 2 - NetHelpExecRecv2 3 - NetHelpExecRecv2 4 - jmp .donecrupdate2 -.nocrupdate2b - cmp byte[pl1neten],1 - jne .nopl1recv2 - mov eax,[JoyABack] - mov [JoyAOrig],eax -.nopl1recv2 - cmp byte[pl2neten],1 - jne .nopl2recv2 - mov eax,[JoyBBack] - mov [JoyBOrig],eax -.nopl2recv2 - cmp byte[pl3neten],1 - jne .nopl3recv2 - mov eax,[JoyCBack] - mov [JoyCOrig],eax -.nopl3recv2 - cmp byte[pl4neten],1 - jne .nopl4recv2 - mov eax,[JoyDBack] - mov [JoyDOrig],eax -.nopl4recv2 - cmp byte[pl5neten],1 - jne .nopl5recv2 - mov eax,[JoyEBack] - mov [JoyEOrig],eax -.nopl5recv2 -.donecrupdate2 - mov [cnetptrtail],ebx -.noreceiveb - - ; backup keyboard presses if recv=1 (delayed by 1 frame) - ; else restore - ; Restore previous keys if CurRecv = 1 - ; ************************************ - cmp byte[CurRecv],1 - je near .noreceive - ; backup keypresses - mov ebx,[CBackupPos] - dec ebx - and ebx,0Fh - mov ecx,[JoyAOrig] - mov [PPContrl+ebx*4],ecx - mov ecx,[JoyBOrig] - mov [PPContrl2+ebx*4],ecx - mov ecx,[JoyCOrig] - mov [PPContrl3+ebx*4],ecx - mov ecx,[JoyDOrig] - mov [PPContrl4+ebx*4],ecx - mov ecx,[JoyEBack] - mov [PPContrl4+ebx*4],ecx - jmp .yesreceive -.noreceive - mov ebx,[PPValue] - dec ebx - and ebx,0Fh - cmp byte[pl1neten],1 - jne .nopl1recv3 - mov ecx,[PPContrl+ebx*4] - mov [JoyAOrig],ecx -.nopl1recv3 - cmp byte[pl2neten],1 - jne .nopl2recv3 - mov ecx,[PPContrl2+ebx*4] - mov [JoyBOrig],ecx -.nopl2recv3 - cmp byte[pl3neten],1 - jne .nopl3recv3 - mov ecx,[PPContrl3+ebx*4] - mov [JoyCOrig],ecx -.nopl3recv3 - cmp byte[pl4neten],1 - jne .nopl4recv3 - mov ecx,[PPContrl4+ebx*4] - mov [JoyDOrig],ecx -.nopl4recv3 - cmp byte[pl5neten],1 - jne .nopl5recv3 - mov ecx,[PPContrl5+ebx*4] - mov [JoyEOrig],ecx -.nopl5recv3 -.yesreceive - -.skipallnet - pop ecx - pop ebx - mov edx,[tempedx] - xor ebx,ebx - jmp .donelatency -.latencyleft - dec byte[LatencyLeft] -.donelatency - mov eax,[JoyAOrig] - mov [JoyABack],eax - mov eax,[JoyBOrig] - mov [JoyBBack],eax - mov eax,[JoyCOrig] - mov [JoyCBack],eax - mov eax,[JoyDOrig] - mov [JoyDBack],eax - mov eax,[JoyEOrig] - mov [JoyEBack],eax - jmp .reprocjoy -.noonens - test byte[NetSwap],1 - jz .nozerons - ; copy previous frame values into JoyxOrig and JoyxNow - mov eax,[JoyABack] - mov [JoyAOrig],eax - mov eax,[JoyBBack] - mov [JoyBOrig],eax - mov eax,[JoyCBack] - mov [JoyCOrig],eax - mov eax,[JoyDBack] - mov [JoyDOrig],eax - mov eax,[JoyEBack] - mov [JoyEOrig],eax -.reprocjoy - mov eax,[JoyAOrig] - rol eax,16 - mov [JoyANow],eax - mov eax,[JoyBOrig] - rol eax,16 - mov [JoyBNow],eax - mov eax,[JoyCOrig] - rol eax,16 - mov [JoyCNow],eax - mov eax,[JoyDOrig] - mov [JoyDNow],eax - mov eax,[JoyEOrig] - mov [JoyENow],eax -.nozerons - cmp byte[snesmouse],4 jne .nolethalen mov eax,[LethEnData] mov [JoyBNow],eax .nolethalen - xor byte[NetSwap],1 - - cmp byte[NetQuit],0 - je .noquitb - pushad - mov esi,[wramdata] - mov ecx,65536*2 - xor eax,eax - xor ebx,ebx -.quitloop - mov al,[esi] - add bx,ax - inc esi - dec ecx - jnz .quitloop - mov [valuea],bx - popad - add [valuea],dh - - mov byte[ExecExitOkay],0 - mov byte[pressed+1],01h - jmp exitloop -.noquitb - test byte[INTEnab],1 jz .noresetjoy mov eax,[JoyAOrig] diff --git a/zsnes/src/dos/dosintrf.asm b/zsnes/src/dos/dosintrf.asm index 9eb5cd73..4d3fa2f0 100644 --- a/zsnes/src/dos/dosintrf.asm +++ b/zsnes/src/dos/dosintrf.asm @@ -1614,7 +1614,7 @@ NEWSYM TCPIPStartServer jnz .failed mov byte[TCPIPStatus],1 ; StartServer(unsigned short port) - mov ax,[TCPIPPortNum] +; mov ax,[TCPIPPortNum] push ax ; call StartServer add esp,2 @@ -1635,7 +1635,7 @@ NEWSYM TCPIPInitConnectToServer jnz .failed mov byte[TCPIPStatus],1 ; Convert TCPIPAddress to IPAddrStr - mov ebx,TCPIPAddress +; mov ebx,TCPIPAddress mov edx,IPAddrStr .notend mov al,[ebx] @@ -1648,7 +1648,7 @@ NEWSYM TCPIPInitConnectToServer cmp al,0 jne .notend ; int ConnectServer(char *servername, unsigned short port) - mov ax,[TCPIPPortNum] +; mov ax,[TCPIPPortNum] push ax mov eax,IPAddrStr push eax diff --git a/zsnes/src/gui/gui.asm b/zsnes/src/gui/gui.asm index a2bd9451..fc1e46a6 100644 --- a/zsnes/src/gui/gui.asm +++ b/zsnes/src/gui/gui.asm @@ -68,7 +68,7 @@ %include "macros.mac" EXTSYM curblank,vidpastecopyscr,frameskip,newengen,vsyncon -EXTSYM cvidmode,antienab, smallscreenon, smallscreence,NetQuit +EXTSYM cvidmode,antienab, smallscreenon, smallscreence EXTSYM soundon,StereoSound,SoundQuality,MusicRelVol EXTSYM endprog,continueprog,spcBuffera,spcRamcmp,cbitmode,makepal EXTSYM t1cc,LoadDir,LoadDrive,SRAMDir,SRAMChdir,SRAMDirCurDir,initsnes @@ -104,7 +104,7 @@ EXTSYM GUIFName,GUICName EXTSYM printnum EXTSYM MMXCheck EXTSYM SaveCombFile -EXTSYM NetSent,valuea +EXTSYM valuea EXTSYM showinfogui EXTSYM BackupCVFrame, tempedx, tempesi, tempedi, tempebp EXTSYM Wait1SecWin,ClearUDPStuff @@ -113,7 +113,7 @@ EXTSYM BackStateSize EXTSYM ResetExecStuff EXTSYM RestoreCVFrame EXTSYM clearSPCRAM -EXTSYM CurRecv,BackState,CBackupPos,PBackupPos,PPValue,DPValue,NetQuitter +EXTSYM CurRecv,BackState,CBackupPos,PBackupPos,PPValue,DPValue EXTSYM LatencyV EXTSYM LatencyRecvPtr,LatencySendPtr EXTSYM NumofBanks @@ -199,15 +199,6 @@ EXTSYM PreparePacketIPX,SendPacketIPX,ipxgetchar,ipxsendchar SECTION .data - -; ProcessRemoteCommand -; NetLoadStuff ; Send 14 to initiate, Send 15 to cancel (either way) -; call PreparePacket -; mov al,253 -; call RemoteSendChar -; call SendPacket -; NetAddChar - NEWSYM WaterOn, db 1 ; Things to do : @@ -667,20 +658,10 @@ NEWSYM ForceHiLoROM, resb 1 NEWSYM CombinDataGlob, resb 3300 ; 20-name, 42-combo, 2-key#, 1-P#, 1-ff NEWSYM CombinDataLocl, resb 3300 -section .data -NEWSYM CmdLineNetPlay, db 0 -NEWSYM CmdLineTCPIPAddress, times 29 db 0 -section .bss - GUIwinorder resb 18 GUIwinpos resb 18 GUIwinactiv resb 18 -DialNumber resb 40 ViewBuffer resb 50*32 -NEWSYM ModemInitStat, resb 1 -ModemProcess resb 1 ; Shows current dial/answer process -ModemPTimer resd 1 ; Timer for modem process -ModemOKStat resb 1 ; OK is detected on modem status SECTION .data ; Window sizes and positions ; LOAD STAT INPT OPT VID SND CHT NET GMKEY GUIOP ABT RSET SRC STCN MOVE CMBO ADDO CHIP PATH SAVE @@ -747,12 +728,6 @@ NEWSYM CheatBDoor, resb 1 NEWSYM ShowTimer, resb 1 NEWSYM MousePRClick, resb 1 NEWSYM MouseDis, resb 1 -NEWSYM NetPlayNoMore, resb 1 -NEWSYM NetChatFirst, resb 1 -NEWSYM NetServer, resb 1 -NEWSYM NetQuitAfter, resb 1 -NEWSYM NetNewNick, resb 16 -NEWSYM NetFilename, resb 512 NEWSYM CheatOn, resd 1 NEWSYM NumCheats, resd 1 @@ -769,28 +744,7 @@ NEWSYM numdrives, dd 26 SubPalTable times 256 db 1 ; Corresponding Gray Scale Color SECTION .bss -WhichRemote resd 1 ; Modem = 1, IPX = 2, TCP/IP = 4 -Connected resd 1 -IDCheckPos resd 1 -NEWSYM pl1neten, resb 1 -NEWSYM pl2neten, resb 1 -NEWSYM pl3neten, resb 1 -NEWSYM pl4neten, resb 1 -NEWSYM pl5neten, resb 1 -NEWSYM cnetplaybuf, resb 512 -NEWSYM cnetptrhead, resd 1 -NEWSYM cnetptrtail, resd 1 -NEWSYM prevp1net, resd 1 -NEWSYM prevp2net, resd 1 -NEWSYM prevp3net, resd 1 -NEWSYM prevp4net, resd 1 -NEWSYM prevp5net, resd 1 -NEWSYM netdelayed, resb 1 -NEWSYM ChatProgress,resd 1 -NEWSYM RecvProgress,resd 1 -NEWSYM IPXInfoStr, resw 1 -NEWSYM IPXInfoStrR, resw 1 NEWSYM GUICMessage, resd 1 NEWSYM GUICTimer, resd 1 NEWSYM GUIOn, resb 1 @@ -801,9 +755,6 @@ NEWSYM MotionBlur, resb 1 NEWSYM StartLL, resd 1 NEWSYM StartLR, resd 1 -NEWSYM LatencyVal, resb 32 - -NEWSYM NetLoadState, resb 1 NEWSYM TRVal, resw 1 NEWSYM TGVal, resw 1 @@ -996,20 +947,6 @@ NEWSYM GUIRestoreVars mov [smallscreenon],al mov al,[GUIScreenScale] mov [ScreenScale],al - cmp byte[CmdLineNetPlay],0 - je .nocmdlinenetplay - mov ecx,28/4 - mov esi,CmdLineTCPIPAddress - mov edi,TCPIPAddress -.netplayloop - mov eax,[esi] - add esi,byte 4 - mov [edi],eax - add edi,byte 4 - dec ecx - jnz .netplayloop - xor eax,eax -.nocmdlinenetplay call CalcChecksum cmp byte[TimeChecker],bl jne .nottimer @@ -1145,10 +1082,6 @@ NEWSYM GUIinit36_4hz NEWSYM GUI36hzcall inc dword[GUIt1cc] inc dword[SnowMover] - cmp dword[ModemPTimer],0 - je .nodec5 - dec dword[ModemPTimer] -.nodec5 cmp dword[GUIEditStringLTxt],0 je .nodec dec dword[GUIEditStringLTxt] @@ -1177,8 +1110,6 @@ NEWSYM GUI36hzcall and byte[GUICCFlash],0Fh inc byte[GUILDFlash] and byte[GUILDFlash],0Fh - inc byte[GUINetTextm2+2] - and byte[GUINetTextm2+2],0Fh ret %ifdef __MSDOS__ @@ -1309,21 +1240,8 @@ LoadDetermine: mov byte[GUICheatMenuData+14],1 mov byte[GUICheatMenuData+14*2],1 mov byte[GUIMiscMenuData+14*2],1 - cmp byte[CheatBDoor],1 - je .nomodem - cmp byte[CNetType],21 - je .modem - cmp byte[CNetType],22 - je .modem - cmp byte[CNetType],20 - jne .nomodem -.modem - mov byte[GUICheatMenuData],2 - mov byte[GUICheatMenuData+14],2 - mov byte[GUICheatMenuData+14*2],2 -.nomodem cmp byte[romloadskip],0 - je .noromloaded2 + je .noromloaded mov byte[GUIGameMenuData+14],2 mov byte[GUIGameMenuData+14*2],2 mov byte[GUIGameMenuData+14*4],2 @@ -1333,7 +1251,6 @@ LoadDetermine: mov byte[GUICheatMenuData+14],2 mov byte[GUICheatMenuData+14*2],2 mov byte[GUIMiscMenuData+14*2],2 -.noromloaded2 .noromloaded ret @@ -1601,28 +1518,6 @@ section .text div ebx %endmacro -NEWSYM TestSent - mov eax,[NetSent] - xor edx,edx - mov ebx,16 - div ebx - ProcessOneDigit 3 - ProcessOneDigit 2 - ProcessOneDigit 1 - ProcessOneDigit 0 - - mov eax,[valuea] - xor edx,edx - mov ebx,16 - div ebx - ProcessOneDigit 8 - ProcessOneDigit 7 - ProcessOneDigit 6 - ProcessOneDigit 5 - - mov dword[GUICMessage],.message - mov dword[GUICTimer],100000 - ret SECTION .data .message db 0,0,0,0,' ',0,0,0,0,0,0,0 SECTION .text @@ -1858,84 +1753,6 @@ NEWSYM StartGUI mov ebx,LoadDir call Change_Dir - cmp byte[NetFilename],0 - je near .nofilenamenet - cmp byte[NetChatFirst],0 - je near .filenamenetb - mov ebx,NetFilename - xor ecx,ecx -.fnetloop - cmp byte[ebx],'\' - jne .fnetloopb - mov ecx,ebx -.fnetloopb - inc ebx - cmp byte[ebx],0 - jne .fnetloop - or ecx,ecx - jz near .nofilenamenet - mov byte[ecx],0 - push ecx - mov dl,[LoadDrive] - cmp byte[NetFilename+1],':' - jne .nodrivenetb - mov dl,[NetFilename] - sub dl,'A' -.nodrivenetb - mov ebx,NetFilename - call Change_Dir - pop ecx - mov ebx,NetFilename - inc ecx -.nextnetl - mov al,[ecx] - mov [ebx],al - inc ecx - inc ebx - or al,al - jnz .nextnetl - jmp .nofilenamenet -.filenamenetb - mov dl,[LoadDrive] - cmp byte[NetFilename+1],':' - jne .nodrivenet - mov dl,[NetFilename] - sub dl,'A' -.nodrivenet - mov ebx,NetFilename - call Change_Dir - mov byte[NetFilename],0 -.nofilenamenet - cmp byte[NetServer],0 - je .noserverclient - mov byte[CNetType],15 - mov byte[ModemProcess],40 - cmp byte[NetServer],2 - jne .noclient - mov byte[ModemProcess],41 -.noclient - mov byte[NetServer],0 - mov byte[WhichRemote],4 - mov byte[GUIcmenupos],0 - mov byte[GUIcrowpos],0 - call loadnetopen -.noserverclient - cmp byte[NetNewNick],0 - je .nonewnick - mov ebx,NetNewNick - mov ecx,ChatNick -.nickloop - mov al,[ebx] - mov [ecx],al - inc ebx - inc ecx - or al,al - jnz .nickloop - mov byte[NetNewNick],0 -.nonewnick - - cmp byte[CNetType],20 - je near .noautostate cmp byte[AutoState],0 je .noautostate cmp byte[romloadskip],0 @@ -1945,106 +1762,6 @@ NEWSYM StartGUI GUIInitIRQs - cmp byte[CNetType],20 - jne near .nostat20 - test byte[NetQuit],80h - jnz near .nostat20 - mov byte[GUIcmenupos],0 - mov byte[GUIcrowpos],0 - call loadnetopen -%ifdef __MSDOS__ - cmp byte[WhichRemote],1 - jne .yesdcd - call ModemCheckDCD - cmp al,1 - jne near .nostat20 -.yesdcd -%endif - - mov byte[RestoreValues],1 - mov [tempedx],edx - mov [tempesi],esi - mov [tempedi],edi - mov [tempebp],ebp - pushad - mov dword[CBackupPos],0 - call BackupCVFrame - popad - - call DisableSUDPPacket - call Wait1SecWin - ; sync - call PreparePacket - mov al,254 - call RemoteSendChar - call SendPacket - call PreparePacket - mov al,254 - call RemoteSendChar - call SendPacket - call PreparePacket - mov al,254 - call RemoteSendChar - call SendPacket - call PreparePacket - mov al,254 - call RemoteSendChar - call SendPacket - mov dword[ModemPTimer],4*32 -.nochar - pushad - call JoyRead - popad - call RemoteGetChar - cmp dword[ModemPTimer],0 - je near .nostat20 - cmp dh,0 - je .nochar - cmp dl,254 - jne .nochar - call PreparePacket - mov al,253 - call RemoteSendChar - call SendPacket -.nocharc - pushad - call JoyRead - popad - call RemoteGetChar - cmp dword[ModemPTimer],0 - je near .nostat20 - cmp dh,0 - je .nocharc - cmp dl,253 - jne .nocharc - call PreparePacket - mov al,1 - call RemoteSendChar - call SendPacket - call ClearUDPStuff - - mov byte[RemoteCommand],1 - mov byte[HoldCommand],1 - cmp byte[NetLoadState],1 - jne .notreceive - mov byte[CNetType],22 -.noreceivestate - pushad - call JoyRead - popad - call RemoteGetChar - cmp dh,0 - je .noreceivestate - cmp dl,14 - jne .noreceivestate - call loadstaterecvinit -.notreceive - cmp byte[NetLoadState],2 - jne .notsend - call NetLoadStuff -.notsend -.nostat20 - cmp byte[GUIwinptr],0 jne .nomenuopen cmp byte[lastcursres],1 @@ -2100,13 +1817,6 @@ NEWSYM StartGUI mov byte[GUIQuit],0 .nokey - cmp byte[CNetType],21 - je .noquit - cmp byte[CNetType],22 - jne .yesquit -.noquit - mov byte[GUIQuit],0 -.yesquit cmp byte[GUIQuit],2 je near .exit cmp byte[GUIQuit],1 @@ -2121,12 +1831,6 @@ NEWSYM StartGUI .notrouble .mousedis2 call GUIUnBuffer - cmp byte[CNetType],20 - je .nowater - cmp byte[CNetType],21 - je .nowater - cmp byte[CNetType],22 - je .nowater cmp byte[GUIEffect],1 jne .nosnow call DrawSnow @@ -2144,99 +1848,6 @@ NEWSYM StartGUI ; call DrawSmoke call DrawBurn .nosmoke -; call TestSent - cmp byte[CNetType],20 - jne .noreceive - - cmp byte[NetChatFirst],0 - je .noloadbeforechat - mov eax,NetFilename - call GUIloadfilename.nocnettype - mov byte[sramsavedis],1 - call transfersram - mov byte[NetChatFirst],0 -.noloadbeforechat - - cmp byte[GUIcmenupos],0 - jne .nomenuout2 - cmp byte[GUIwinptr],0 - jne .nomenuout2 - cmp byte[netlastloaded],1 - je .openmenu - mov byte[GUIcmenupos],2 - mov byte[GUIcrowpos],0 - jmp .nomenuout2 -.openmenu - mov byte[netlastloaded],0 - call loadnetopen -.nomenuout2 - call RemoteGetChar - cmp dh,0 - jne .received - mov dl,1 -.received - call ProcessRemoteCommand - jmp .noreceive2 -.noreceive - mov byte[HoldCommand],0 -.noreceive2 - - cmp byte[CNetType],21 - jne .noloadstatesend - call loadstatesend -.noloadstatesend - cmp byte[CNetType],22 - jne .noloadstaterecv - call loadstaterecv -.noloadstaterecv - - cmp byte[CNetType],15 - je .modem - cmp byte[CNetType],12 - je .modem - cmp byte[CNetType],11 - je .modem - cmp byte[CNetType],10 - jne near .nomodem -.modem - call ProcessModem -%ifdef __MSDOS__ - cmp byte[Connected],1 - je near .nomodem - call ModemGetChar - cmp dh,0 - je .nomodem - cmp byte[ModemOKStat],0 - jne .foundokay - mov byte[ModemOKStat],1 - jmp .skipstat -.foundokay - cmp byte[ModemOKStat],1 - jne .nostat0 - cmp dl,13 - jne .nostat0 - inc byte[ModemOKStat] - jmp .skipstat -.nostat0 - cmp byte[ModemOKStat],2 - jne .nostat1 - cmp dl,'O' - jne .nostat1 - inc byte[ModemOKStat] - jmp .skipstat -.nostat1 - cmp byte[ModemOKStat],3 - jne .nostat2 - cmp dl,'K' - jne .nostat2 - inc byte[ModemOKStat] - jmp .skipstat -.nostat2 -.skipstat - mov dh,0 - call NetAddChar -%endif -.nomodem cmp dword[GUIEditStringcWin],0 je .noblink @@ -2281,24 +1892,7 @@ NEWSYM StartGUI call vidpastecopyscr call GUIgetcurrentinput jmp .nokey - .exitgui - cmp byte[CNetType],20 - jne near .nostat20b2 - call PreparePacket - mov al,255 - call RemoteSendChar - call SendPacket - call PreparePacket - mov al,255 - call RemoteSendChar - call SendPacket - call PreparePacket - mov al,255 - call RemoteSendChar - call SendPacket -.nostat20b2 - GUIDeInitIRQs mov ax,[PrevResoln] @@ -2321,178 +1915,6 @@ NEWSYM StartGUI .nomakepal mov word[t1cc],1 - mov byte[chaton],0 - mov dword[chatstrL],0 - mov dword[chatLpos],0 - mov dword[chatstrR],0 - mov dword[chatRTL],0 - - cmp byte[CNetType],20 - jne near .nostat20b - - mov al,10 - sub al,[Latency] - cmp byte[Latency],4 - jb .nolatency - mov al,7 -.nolatency - mov [BackStateSize],al - - call ResetExecStuff - - mov byte[MultiTap],1 - cmp byte[pl3neten],0 - jne .mtap - cmp byte[pl4neten],0 - jne .mtap - cmp byte[pl5neten],0 - jne .mtap -.nomtap - mov byte[MultiTap],0 -.mtap - - cmp byte[RestoreValues],1 - jne .norestoreval - pushad - mov dword[PBackupPos],0 - call RestoreCVFrame - popad - mov esi,[tempesi] - mov edi,[tempedi] - mov ebp,[tempebp] -.norestoreval - - mov dword[nmiprevaddrl],0 - mov dword[nmiprevaddrh],0 - mov dword[nmirept],0 - mov dword[nmiprevline],224 - mov dword[nmistatus],0 - mov dword[spcnumread],0 - mov dword[spchalted],-1 - mov byte[NextLineCache],0 - mov byte[DSPMem+08h],0 - mov byte[DSPMem+18h],0 - mov byte[DSPMem+28h],0 - mov byte[DSPMem+38h],0 - mov byte[DSPMem+48h],0 - mov byte[DSPMem+58h],0 - mov byte[DSPMem+68h],0 - mov byte[DSPMem+78h],0 - - mov byte[netdelayed],0 - mov dword[cnetptrhead],0 - mov dword[cnetptrtail],0 - mov dword[prevp1net],0 - mov dword[prevp2net],0 - mov dword[prevp3net],0 - mov dword[prevp4net],0 - mov dword[prevp5net],0 - mov byte[BackState],1 - mov dword[CBackupPos],0 - mov dword[PBackupPos],0 - mov dword[PPValue],0 - mov dword[DPValue],0 - mov byte[CurRecv],0 - mov dword[NetQuitter],0 - mov dword[LatencyV],0 - mov dword[LatencyV+4],0 - mov dword[LatencyV+8],0 - mov dword[LatencyV+12],0 - mov dword[LatencyRecvPtr],0 - mov dword[LatencySendPtr],0 - - mov eax,cnetplaybuf - mov ecx,512 -.loop20 - mov byte[eax],0 - inc eax - dec ecx - jnz .loop20 - mov al,[Latency] - mov [LatencyLeft],al - mov byte[NetSwap],0 - - mov dword[CBackupPos],0 - mov dword[PBackupPos],0 - - mov ebx,[romdata] - mov ecx,[NumofBanks] - shl ecx,15 - xor eax,eax - or ecx,ecx - jz .nocsumloop -.csumloop - add al,[ebx] - adc ah,0 - inc ebx - dec ecx - jnz .csumloop -.nocsumloop - mov [CheckSumVal],eax - - mov ebx,eax - ; sync with modem - call PreparePacket - mov al,30 - call RemoteSendChar - mov al,230 - call RemoteSendChar - mov al,[CheckSumVal] - call RemoteSendChar - mov al,[CheckSumVal+1] - call RemoteSendChar - call SendPacket -.nocharb - pushad - call JoyRead - popad -; cmp byte[pressed+1],1 -; je near .faileda - - call RemoteGetChar - cmp dh,0 - je .nocharb - cmp dl,230 - jne .nocharb -.nocharb2 - call RemoteGetChar - cmp dh,0 - je .nocharb2 - cmp dl,[CheckSumVal] - jne .wrongcs -.nocharb3 - call RemoteGetChar - cmp dh,0 - je .nocharb3 - cmp dl,[CheckSumVal+1] - je .okaychat -.wrongcs - mov esi,WrongCheckSum - call WritetochatBuffer - jmp StartGUI -.okaychat - call PreparePacket - mov al,229 - call RemoteSendChar - call SendPacket -.nocharb5 - pushad - call JoyRead - popad -; cmp byte[pressed+1],1 -; je near .failedb - - call RemoteGetChar - cmp dh,0 - je .nocharb5 - cmp dl,229 - jne .nocharb5 -.nostat20b - call EnableSUDPPacket - - mov byte[ChatProgress],0 - mov dword[RecvProgress],0 - ; get LoadDrive/LoadDir mov ebx,LoadDir mov edx,LoadDrive @@ -2583,7 +2005,6 @@ NEWSYM StartGUI mov byte[GUIReset],0 mov dword[StartLL],0 mov dword[StartLR],0 - mov byte[NetLoadState],0 jmp continueprog .faileda @@ -3207,19 +2628,11 @@ GUITryMenuItem: .dontquit ret .norun - cmp byte[CNetType],21 - je near .noreset - cmp byte[CNetType],22 - je near .noreset GUICheckMenuItem 12, 2 ; Reset cmp byte[GUIcrowpos],2 jne .noreset mov byte[GUICResetPos],1 .noreset - cmp byte[CNetType],21 - je near .noromloaded - cmp byte[CNetType],22 - je near .noromloaded cmp byte[GUIcrowpos],4 jne .nosavestate mov byte[GUIStatesText5],0 @@ -3293,15 +2706,6 @@ GUITryMenuItem: .noconfig cmp byte[romloadskip],0 jne near .nocheat - cmp byte[CheatBDoor],1 - je .yescheat - cmp byte[CNetType],20 - je near .nocheat - cmp byte[CNetType],21 - je near .nocheat - cmp byte[CNetType],22 - je near .nocheat -.yescheat cmp byte[GUIcmenupos],4 jne near .nocheat GUICheckMenuItem 7, 0 @@ -3319,30 +2723,13 @@ GUITryMenuItem: cmp byte[GUIcmenupos],5 jne near .nonet %ifdef __MSDOS__ - cmp byte[CNetType],10 - jae .nomod - mov byte[CNetType],0 -.nomod GUICheckMenuItem 8, 0 GUICheckMenuItem 8, 1 - cmp byte[CNetType],10 - jae near .nonet - cmp byte[GUIcrowpos],1 - jne .noipx - mov byte[CNetType],7 -.noipx - cmp byte[GUIcrowpos],0 - jne near .nonet - mov byte[CNetType],1 - jmp .nonet %endif ;.win32 GUICheckMenuItem 8, 0 - cmp byte[CNetType],10 - jae near .nonet cmp byte[GUIcrowpos],0 jne near .nonet - mov byte[CNetType],4 call GetHostName .nonet cmp byte[GUIcmenupos],6 @@ -3546,11 +2933,6 @@ GUIProcStates: popad jmp .changedir .loadstate - cmp byte[CNetType],20 - jne .notnet - call NetLoadStuff - jmp .changedir -.notnet pushad call loadstate2 popad @@ -3602,13 +2984,6 @@ GUIProcReset: call GUIDoReset .movieendif popad - cmp byte[CNetType],20 - jne .noreset - call PreparePacket - mov al,40 - call RemoteSendChar - call SendPacket - mov byte[GUIQuit],0 .noreset mov byte[GUICBHold],0 xor eax,eax diff --git a/zsnes/src/gui/guikeys.inc b/zsnes/src/gui/guikeys.inc index 4e4d5877..0c3355e1 100644 --- a/zsnes/src/gui/guikeys.inc +++ b/zsnes/src/gui/guikeys.inc @@ -138,10 +138,6 @@ UseExtKey resb 1 SECTION .text GUIgetcurrentinput: - cmp byte[HoldCommand],2 - jne .nohold - ret -.nohold mov byte[UseExtKey],0 xor ch,ch xor cl,cl @@ -321,56 +317,6 @@ GUIgetcurrentinput: dec eax xor ebx,ebx mov bl,[GUIwinorder+eax] - cmp ebx,8 - jne near .nonetwin - cmp byte[CNetType],12 - jne .noprocess7 - cmp byte[ModemProcess],7 - jne .noprocess7 - cmp dh,13 - je .ret - cmp dh,32 - jb .noprocess7 -.ret -%ifdef __MSDOS__ - mov al,dh - call ModemSendChar -%endif - ret -.noprocess7 - cmp dl,27 - jne .nonetwin - cmp byte[CNetType],2 - je .yesnetwin - cmp byte[CNetType],3 - je .yesnetwin - cmp byte[CNetType],10 - je .yesnetwin - cmp byte[CNetType],11 - je .yesnetwin - cmp byte[CNetType],12 - je .yesnetwin - cmp byte[CNetType],15 - je .yesnet15 - jmp .nonetwin -.yesnet15 - mov byte[CNetType],0 -%ifdef __MSDOS__ - call deinitipx -.nodeinitipx -%endif - jmp .closewin -.yesnetwin -%ifdef __MSDOS__ - cmp byte[ModemInitStat],0 - je .nodeinitmodem - call DeInitModemC - mov byte[ModemInitStat],0 -.nodeinitmodem -%endif - mov byte[CNetType],1 - ret -.nonetwin cmp ebx,13 jne .notcskeys cmp byte[CheatWinMode],1 @@ -408,16 +354,6 @@ GUIgetcurrentinput: je near GUIPathKeys cmp ebx,20 je near GUISaveKeys - cmp ebx,8 - jne .notstartmenu - cmp byte[CNetType],4 - jne .notcpip - jmp GUITCPIPKeys -.notcpip - cmp byte[CNetType],1 - jne .notstartmenu - jmp GUINetMenuKeys1 -.notstartmenu cmp ebx,8 je near GUIGetInputLine ret @@ -650,163 +586,8 @@ GUIgetcurrentinput: ret GUITCPIPKeys: - cmp byte[GUINetTextm2],1 - je near .section2 - mov edi,TCPIPAddress - mov esi,26 - cmp byte[GUINetTextm2],2 - jne .notsecondstring - mov edi,ChatNick - mov esi,9 -.notsecondstring - mov ebx,edi -.next - cmp byte[ebx],0 - je .done2 - inc ebx - jmp .next -.done2 - sub ebx,edi - mov [GUINetTextm2+1],bl - xor eax,eax - mov al,[GUINetTextm2+1] - shl al,2 - add al,2 - cmp dh,32 - jbe .notnum2 - cmp byte[GUINetTextm2],0 - je .notsecondstringb - cmp dh,'_' - je .notsecondstringb - cmp dh,'-' - je .notsecondstringb - cmp dh,'^' - je .notsecondstringb - cmp dh,'=' - je .notsecondstringb - cmp dh,'+' - je .notsecondstringb - cmp dh,'[' - je .notsecondstringb - cmp dh,']' - je .notsecondstringb - cmp dh,'0' - jb .notnum2 - cmp dh,'9' - jbe .notsecondstringb - cmp dh,'A' - jb .notnum2 - cmp dh,'Z' - jbe .notsecondstringb - cmp dh,'a' - jb .notnum2 - cmp dh,'z' - jbe .notsecondstringb -.notsecondstringb - cmp ebx,esi - jae near .donesection1 - add ebx,edi - mov byte[ebx],dh - jmp .donesection1 -.notnum2 - cmp dh,8 - jne .notbacksp - or ebx,ebx - jz near .donesection1 - add ebx,edi - mov byte[ebx-1],0 - jmp .donesection1 -.notbacksp - cmp dh,'c' - je .yesc - cmp dh,'C' - jne .noc -.yesc -; mov byte[CNetType],15 -; mov byte[ModemProcess],41 -; mov byte[WhichRemote],4 -.noc - cmp dh,'s' - je .yess - cmp dh,'S' - jne .nos -.yess -; mov byte[CNetType],15 -; mov byte[ModemProcess],40 -; mov byte[WhichRemote],4 -.nos -.donesection1 ret -.section2 - mov ebx,GUINetTextl2 -.loopz - cmp byte[ebx],0 - je .donez - inc ebx - jmp .loopz -.donez - cmp byte[GUINetTextl2],'0' - jne .notzerob - cmp byte[GUINetTextl2+1],0 - jne .notzerob - dec ebx -.notzerob - cmp dh,'0' - jb .notnum - cmp dh,'9' - ja .notnum - mov byte[ebx],dh - mov byte[ebx+1],0 - push ebx - call .convert - pop ebx - cmp ecx,65536 - jb .donenumb - mov byte[ebx],0 -.donenumb - jmp .donenum -.notnum - cmp dh,8 - jne .donenum - cmp byte[GUINetTextl2],0 - je .donenum - mov byte[ebx-1],0 -.donenum - call .convert - cmp ecx,0 - jne .notzero - mov byte[GUINetTextl2],'0' - mov byte[GUINetTextl2+1],0 -.notzero - mov [TCPIPPortNum],ecx - ret -.convert - mov ebx,GUINetTextl2 - xor ecx,ecx -.loop - cmp byte[ebx],0 - je .done - mov eax,ecx - push ebx - mov ebx,10 - mul ebx - pop ebx - mov ecx,eax - xor eax,eax - mov al,[ebx] - sub eax,48 - add ecx,eax - inc ebx - jmp .loop -.done - ret - - -SECTION .data -NEWSYM TCPIPPortNum, dd 7845 -SECTION .text - GUIOptionKeys: cmp dh,'a' jb .nocap @@ -1569,116 +1350,9 @@ SECTION .data SECTION .text GUINetMenuKeys1: - cmp dh,'a' - jb .nocap - cmp dh,'z' - ja .nocap - sub dh,'z'-'Z' -.nocap - cmp dh,'C' - jne .notconfig - mov byte[CNetType],2 -.notconfig - cmp dh,'D' - jne .notdial - mov byte[CNetType],3 -.notdial - cmp dh,'M' - jne .notmanual - mov byte[CNetType],12 - mov byte[ModemProcess],0 -%ifdef __MSDOS__ - cmp byte[ModemInitStat],1 - je .noinit - call InitModem - mov byte[ModemInitStat],1 -.noinit -%endif - ret -.notmanual - cmp dh,'W' - jne .notwait - mov byte[CNetType],10 - mov byte[ModemProcess],0 -%ifdef __MSDOS__ - cmp byte[ModemInitStat],1 - je .noinit2 - call InitModem - mov byte[ModemInitStat],1 -.noinit2 -%endif - ret -.notwait ret GUIGetInputLine: - cmp ebx,8 - jne .nodial - cmp byte[CNetType],20 - jne .nochat - cmp dh,13 - jne .nochat - mov byte[RemoteCommand],2 - ret -.nochat - cmp byte[CNetType],3 - jne .nodial - cmp dh,13 - jne .nodial - mov byte[CNetType],11 - mov byte[ModemProcess],0 -%ifdef __MSDOS__ - cmp byte[ModemInitStat],1 - je .noinit - call InitModem - mov byte[ModemInitStat],1 -%endif -.noedit - ret -.noinit -.nodial - ; search string for 0, record length of string - cmp dword[GUIEditString],0 - je .noedit - mov eax,[GUIEditString] - xor ecx,ecx - dec ecx -.next - mov bl,[eax] - inc eax - inc ecx - cmp bl,0 - jne .next - cmp byte[GUIEditStringcWin],0 - je near .blinkstuff - cmp ecx,0 - je .nodel - cmp dh,8 - jne .nodel - mov byte[eax-2],0 - dec eax - jmp .blinkstuff -.nodel - cmp ecx,[GUIEditStringmLen] - jne .notend - jmp .blinkstuff -.notend - cmp dh,'a' - jb .nocap - cmp dh,'z' - ja .nocap - sub dh,'z'-'Z' -.nocap - cmp dh,32 - jb .noinsert - mov [eax-1],dh - mov byte[eax],0 - inc eax -.noinsert - jmp .blinkstuff -.blinkstuff - dec eax - mov [GUIEditStringcLen],eax ret SECTION .bss diff --git a/zsnes/src/gui/guiload.inc b/zsnes/src/gui/guiload.inc index 97e7980f..5d9e6661 100644 --- a/zsnes/src/gui/guiload.inc +++ b/zsnes/src/gui/guiload.inc @@ -174,46 +174,6 @@ netlastloaded resb 1 SECTION .text GUIloadfilename: - cmp byte[CNetType],15 - je .noload - cmp byte[CNetType],12 - je .noload - cmp byte[CNetType],11 - je .noload - cmp byte[CNetType],10 - je .noload - cmp byte[CNetType],21 - je .noload - cmp byte[CNetType],22 - jne .yesload -.noload - ret -.yesload - cmp byte[CNetType],20 - jne near .nocnettype - mov byte[netlastloaded],1 - cmp byte[GUIcmenupos],1 - jne .nomenuout - mov byte[GUIcmenupos],0 -.nomenuout - mov esi,FileNameMod -.nextfnc - mov cl,[eax] - mov [esi],cl - inc eax - inc esi - cmp cl,0 - jne .nextfnc - mov byte[RemoteCommand],10 - pushad - call GUIQuickLoadUpdate - popad - ret -.nocnettype - cmp byte[CNetType],20 - je .okay20 -; ret -.okay20 mov esi,eax ; find length of string & copy filename xor cl,cl @@ -318,8 +278,6 @@ GUIloadfilename: call GUIQuickLoadUpdate cmp byte[AutoLoadCht],0 je .nocheatload - cmp byte[CNetType],20 - je .nocheatload ; change dir to LoadDrive/LoadDir mov dl,[LoadDrive] mov ebx,LoadDir diff --git a/zsnes/src/gui/guimouse.inc b/zsnes/src/gui/guimouse.inc index 0997fa1d..9d3076a1 100644 --- a/zsnes/src/gui/guimouse.inc +++ b/zsnes/src/gui/guimouse.inc @@ -698,73 +698,6 @@ ProcessMouseButtons: call AddCSCheatCode ; call InsertSearchDescription .noinsertscc - cmp byte[GUICBHold],21 - jne .nomodem1 - mov byte[CNetType],3 -.nomodem1 - cmp byte[GUICBHold],22 - jne .nomodem2 - mov byte[CNetType],10 - mov byte[ModemProcess],0 -.nomodem2 - cmp byte[GUICBHold],23 - jne .nomodem3 - mov byte[CNetType],2 -.nomodem3 - cmp byte[GUICBHold],24 - jne .nomodem4 - mov byte[CNetType],12 - mov byte[ModemProcess],0 -.nomodem4 - cmp byte[GUICBHold],25 - jne .nomodem4b - mov byte[CNetType],15 - mov byte[ModemProcess],40 - mov byte[WhichRemote],4 -.nomodem4b - cmp byte[GUICBHold],26 - jne .nomodem4c - mov byte[CNetType],15 - mov byte[ModemProcess],41 - mov byte[WhichRemote],4 -.nomodem4c - cmp byte[GUICBHold],27 - jne .noinit - cmp byte[CNetType],20 - jne near .nostat20b2 - call PreparePacket - mov al,255 - call RemoteSendChar - call SendPacket - call PreparePacket - mov al,255 - call RemoteSendChar - call SendPacket - call PreparePacket - mov al,255 - call RemoteSendChar - call SendPacket - cmp byte[NetQuitAfter],0 - je .nostat20b2 - mov byte[GUIQuit],1 -.nostat20b2 - call RemoteDeInit -.noinit - cmp byte[GUICBHold],28 - jne .nomodem5 - mov byte[CNetType],11 - mov byte[ModemProcess],0 -.nomodem5 - cmp byte[GUICBHold],34 - jne .noipx1 - mov byte[WhichRemote],2 - mov byte[ModemProcess],30 - mov byte[CNetType],15 -.noipx1 - cmp byte[GUICBHold],64 - jne .nostatecancel - mov byte[NetStateQuit],1 -.nostatecancel cmp byte[GUICBHold],65 jne .nohomepage call GotoHomepage @@ -2634,96 +2567,6 @@ DisplayGUICheatClick: ret DisplayNetOptnsClick: - cmp byte[CNetType],1 - jne near .nomodem - GUIPHoldbutton 5,15,89,26,21 - GUIPHoldbutton 5,30,89,41,22 - GUIPHoldbutton 5,45,89,56,23 - GUIPHoldbutton 5,60,89,71,24 -.nomodem - cmp byte[CNetType],2 - jne near .nomodemc - GUIPButtonHole2 9,25,byte[ComNum],1,byte[ComIRQ],4 - GUIPButtonHole2 9,35,byte[ComNum],2,byte[ComIRQ],3 - GUIPButtonHole2 9,45,byte[ComNum],3,byte[ComIRQ],4 - GUIPButtonHole2 9,55,byte[ComNum],4,byte[ComIRQ],3 - GUIPButtonHole 94,25,byte[BaudRate],0 - GUIPButtonHole 94,35,byte[BaudRate],1 - GUIPButtonHole 94,45,byte[BaudRate],2 - GUIPButtonHole 94,55,byte[BaudRate],3 - GUIPButtonHole 94,65,byte[BaudRate],4 - GUIPButtonHole 94,75,byte[BaudRate],5 - GUIPButtonHole 94,85,byte[BaudRate],6 - GUIPButtonHole 9,85,byte[GUIDialSt+3],'T' - GUIPButtonHole 9,95,byte[GUIDialSt+3],'P' - GUIPHoldbutton2 55,69,63,79,25,byte[ComIRQ],1,15 - GUIPHoldbutton2 66,69,74,79,26,byte[ComIRQ],-1,2 - GUITextBoxInput 21,125,175,133,GUIInitSt1,24 - GUITextBoxInput 21,136,175,144,GUIInitSt2,24 - GUIClickCButton 12,147,byte[FossilUse] -.nomodemc - cmp byte[CNetType],3 - jne near .nomodemd - GUIPHoldbutton 141,38,175,49,28 -.nomodemd - cmp byte[CNetType],4 - jne near .notcpip - cmp byte[NetPlayNoMore],1 - je near .notcpip - GUIPHoldbutton 5,35,129,46,25 - GUIPHoldbutton 5,70,129,81,26 - GUITextBoxInputB 55,13,95,21,1 - GUITextBoxInputB 26,58,191,66,0 - GUITextBoxInputB 55,24,119,32,2 - - GUIClickCButton 5,93,byte[UDPConfig] -.notcpip - cmp byte[CNetType],10 - je .init - cmp byte[CNetType],11 - je .init - cmp byte[CNetType],15 - je .init - cmp byte[CNetType],12 - jne near .noinit -.init - GUIPHoldbutton 120,135,181,146,27 -.noinit - cmp byte[CNetType],7 - jne near .noipx - GUIPHoldbutton 53,48,87,59,34 -.noipx - cmp byte[CNetType],20 - jne near .nochat - GUIPHoldbutton 111,169,181,180,27 - GUIClickCButtonN 7,135,byte[RemoteCommand],3 - GUIClickCButtonN 32,135,byte[RemoteCommand],4 - GUIClickCButtonN 57,135,byte[RemoteCommand],5 - GUIClickCButtonN 7,145,byte[RemoteCommand],6 - GUIClickCButtonN 32,145,byte[RemoteCommand],7 - GUIClickCButtonN 7,175,byte[RemoteCommand],8 - - GUIClickCButtonN 111,135,byte[RemoteCommand],50 - GUIClickCButtonN 111,145,byte[RemoteCommand],41 - GUIClickCButtonN 111,155,byte[RemoteCommand],42 - GUIPHoldbutton2 79,156,87,166,29,byte[Latencytochange],1,19 - GUIPHoldbutton2 90,156,98,166,30,byte[Latencytochange],-1,1 -; DrawSlideBarWin 8,181,15,[GUIcurrentvideoviewloc],[TViewLoc],12,97,GUINCStA -; GUISlidebarImpl 181,15,188,112,GUINCStA,12,GUIcurrentcheatviewloc,TViewCLoc,TViewLoc,12 - - mov al,[Latency] - cmp byte[Latencytochange],al - je .nochat - mov byte[RemoteCommand],20 -.nochat - - cmp byte[CNetType],22 - je .yesstate - cmp byte[CNetType],21 - jne near .nostate -.yesstate - GUIPHoldbutton 73,48,127,59,64 -.nostate ret guipresstest: diff --git a/zsnes/src/gui/guinetpl.inc b/zsnes/src/gui/guinetpl.inc index 4d4e1bb2..f2de7c7d 100644 --- a/zsnes/src/gui/guinetpl.inc +++ b/zsnes/src/gui/guinetpl.inc @@ -22,1838 +22,57 @@ ; GUI NetPlay Routines (Modem,IPX,UDP+TCP/IP) ProcessModem: -%ifndef __MSDOS__ - cmp byte[ModemProcess],40 - jne near .noprocess40 - cmp byte[maxskip],3 - jae .okaymf - mov byte[maxskip],3 -.okaymf - mov byte[frameskip],0 - mov byte[Latencytochange],3 - mov byte[Latency],3 -; mov byte[IPXSearchval],0 - mov byte[RemoteDisconnect],0 - mov byte[HoldCommand],1 - mov byte[RemoteCommand],1 - ; Clear Screen Buffer - mov eax,ViewBuffer - mov ecx,50*32 -.clooptcpip - mov byte[eax],0 - inc eax - dec ecx - jnz .clooptcpip - mov dword[CCursLoc],0 - mov dword[CViewLoc],0 - mov dword[NViewLoc],0 - mov esi,.tcpipinit - call .writestr - mov esi,.tcpipport - call .writestr - mov esi,GUINetTextl2 - call .writestr - mov esi,.tcpipret - call .writestr - mov esi,.tcpipportt - cmp byte[UDPConfig],0 - je .notudp - mov esi,.tcpipportu -.notudp - call .writestr - mov esi,.tcpipret - call .writestr - mov esi,.tcpipserv - call .writestr - mov byte[ModemProcess],42 ret -SECTION .data -.tcpipdones db 'DONE',13,10,13,10,'WAITING FOR CLIENT...',0 -.tcpipdonec db 'DONE',13,10,13,10,'CONNECTING TO SERVER...',0 -.tcpipdones2 db 13,10,13,10,'FOUND CLIENT.',0 -.tcpipdonec2 db 13,10,13,10,'CONNECTION SUCCESSFUL.',0 -.tcpiperror db 'FAILED',13,10,13,10,'ERROR: ',0 -.tcpipip db 'IP : ',0 -.tcpipip2 db 'SIP : ',0 -.tcpipport db 'PORT : ',0 -.tcpipportu db 'PROTOCOL: UDP',13,10,0 -.tcpipportt db 'PROTOCOL: TCP/IP',13,10,0 -.tcpipret db 13,10,0 -.errorinit db 'FAILED NET INIT',0 -.errorinit2 db 'CANNOT START SERVER',0 -.errorinit3 db 'CANNOT CONNECT',0 -SECTION .text - -.noprocess40 - cmp byte[ModemProcess],41 - jne near .noprocess41 - cmp byte[maxskip],3 - jae .okaymf2 - mov byte[maxskip],3 -.okaymf2 - mov byte[frameskip],0 - mov byte[Latencytochange],3 - mov byte[Latency],3 -; mov byte[IPXSearchval],0 - mov byte[RemoteDisconnect],0 - mov byte[HoldCommand],1 - mov byte[RemoteCommand],1 - ; Clear Screen Buffer - mov eax,ViewBuffer - mov ecx,50*32 -.clooptcpip2 - mov byte[eax],0 - inc eax - dec ecx - jnz .clooptcpip2 - mov dword[CCursLoc],0 - mov dword[CViewLoc],0 - mov dword[NViewLoc],0 - mov esi,.tcpipinit - call .writestr - mov esi,.tcpipport - call .writestr - mov esi,GUINetTextl2 - call .writestr - mov esi,.tcpipret - call .writestr - mov esi,.tcpipportt - cmp byte[UDPConfig],0 - je .notudp2 - mov esi,.tcpipportu -.notudp2 - call .writestr - mov esi,.tcpipip2 - call .writestr - mov esi,TCPIPAddress - call .writestr - mov esi,.tcpipret - call .writestr - mov esi,.tcpipret - call .writestr - mov esi,.tcpipclie - call .writestr - mov byte[ModemProcess],43 - ret -.noprocess41 - cmp byte[ModemProcess],42 - jne near .noprocess42 - call TCPIPStartServer - or eax,eax - jnz .tcpfailed - mov esi,.tcpipdones - call .writestr - mov byte[ModemProcess],44 - ret -.tcpfailed - mov esi,.tcpiperror - call .writestr - mov esi,.errorinit - call .writestr - mov byte[ModemProcess],255 - ret -.noprocess42 - cmp byte[ModemProcess],43 - jne near .noprocess43 - call TCPIPInitConnectToServer - or eax,eax - jnz .tcpfailed2 - mov esi,.tcpipdonec - call .writestr - mov byte[ModemProcess],45 - ret -.tcpfailed2 - mov esi,.tcpiperror - call .writestr - mov esi,.errorinit - call .writestr - mov byte[ModemProcess],255 - ret -.noprocess43 - cmp byte[ModemProcess],44 - jne near .noprocess44 - call TCPIPWaitForConnection - cmp eax,1 - je .successb - or eax,eax - jnz .tcpfailed3 - ret -.successb - mov esi,.tcpipdones2 - call .writestr - mov byte[ModemProcess],46 - ret -.tcpfailed3 -; add al,'Z' -; mov byte[.tcpiperror],al - mov esi,.tcpiperror - call .writestr - mov esi,.errorinit2 - call .writestr - mov byte[ModemProcess],255 - ret -.noprocess44 - cmp byte[ModemProcess],45 - jne near .noprocess45 - call TCPIPConnectToServer - or eax,eax - jnz .tcpfailed4 - mov byte[ModemProcess],47 - ret -.tcpfailed4 -; add al,'Z' -; mov [.errorinit3],al - mov esi,.tcpiperror - call .writestr - mov esi,.errorinit3 - call .writestr - mov byte[ModemProcess],255 - ret -.noprocess45 - cmp byte[ModemProcess],46 - jne near .noprocess46 - mov byte[pl2neten],2 - mov byte[pl1neten],1 - mov byte[UseRemoteSRAMData],1 - mov byte[ModemProcess],66 - ret -.noprocess46 - cmp byte[ModemProcess],47 - jne near .noprocess47 - call TCPIPConnectToServerW - or eax,eax - jnz .connected - ret -.connected - mov esi,.tcpipdonec2 - call .writestr - mov byte[pl2neten],1 - mov byte[pl1neten],2 - mov byte[UseRemoteSRAMData],2 - mov byte[ModemProcess],66 - ret -.noprocess47 -%endif -%ifdef __MSDOS__ - cmp byte[ModemProcess],30 - jne near .noprocess30 - mov byte[Latencytochange],2 - mov byte[Latency],2 - mov byte[IPXSearchval],0 - ; Clear Screen Buffer - mov eax,ViewBuffer - mov ecx,50*32 -.cloopipx - mov byte[eax],0 - inc eax - dec ecx - jnz .cloopipx - mov dword[CCursLoc],0 - mov dword[CViewLoc],0 - mov dword[NViewLoc],0 - mov esi,.initc - call .writestr - mov esi,.localid - call .writestr - push es - mov es,[selc0040] - mov ax,[es:108] - mov [IPXInfoStr],ax - pop es - call .writehex - ; ipx - call initipx -.noinitipx - cmp ax,0 - je .success - mov byte[ModemProcess],255 - mov esi,.noipx - call .writestr - ret -.success - mov byte[ModemProcess],31 - mov dword[ModemPTimer],36 - mov esi,.yesipx - call .writestr - ret -.noprocess30 - cmp byte[ModemProcess],31 - jne .noprocess31 - ; Wait for remote - cmp dword[ModemPTimer],0 - jne .nolookforconnect - mov dword[ModemPTimer],36 - call ipxlookforconnect -.noipxlook - cmp byte[IPXSearchval],0 - je .nolookforconnect - mov esi,.connectest - call .writestr - mov esi,.remoteid - call .writestr - mov ax,[IPXInfoStrR] - call .writehex - mov byte[ModemProcess],64 - mov byte[Connected],1 - mov byte[WhichRemote],2 -.nolookforconnect - ret -.noprocess31 - cmp byte[ModemProcess],0 - jne near .noprocess0 - mov byte[Latencytochange],2 - mov byte[Latency],2 - cmp byte[ModemInitStat],1 - je .nomodeminit - call InitModem - mov byte[ModemInitStat],1 -.nomodeminit - mov byte[Connected],0 - ; Clear Screen Buffer - mov eax,ViewBuffer - mov ecx,50*32 -.cloop - mov byte[eax],0 - inc eax - dec ecx - jnz .cloop - mov dword[CCursLoc],0 - mov dword[CViewLoc],0 - mov dword[NViewLoc],0 - mov esi,.init - call .writestr - mov esi,.uart0 - cmp byte[UartType],0 - je .nouart0 - mov esi,.uart1 - cmp byte[UartType],1 - je .nouart0 - mov esi,.uart2 -.nouart0 - call .writestr - mov esi,.initb - call .writestr - mov byte[ModemProcess],8 - mov dword[ModemPTimer],36 - mov byte[InitStr1Done],0 - mov byte[ModemOKStat],0 - cmp byte[cantinitmodem],0 - je .okayinit - mov esi,.unableinit - call .writestr - mov byte[ModemProcess],255 -.okayinit - ret -.noprocess0 - cmp byte[ModemProcess],8 - jne .noprocess8 - cmp dword[ModemPTimer],0 - jne .skipnext8 - mov dword[ModemPTimer],18 - mov byte[ModemProcess],1 - cmp byte[CNetType],12 - jne .nomanual - mov byte[ModemProcess],7 - mov dword[ModemPTimer],0 -.nomanual - mov al,13 - call ModemSendChar - mov al,13 - call ModemSendChar -.skipnext8 - ret -.noprocess8 - cmp byte[ModemProcess],1 - jne .noprocess1 - cmp dword[ModemPTimer],0 - jne .skipnext - mov byte[ModemProcess],2 - call ModemClearBuffer -.skipnext - ret -.noprocess1 - cmp byte[ModemProcess],2 - jne .noprocess2 - mov byte[ModemProcess],3 - mov dword[ModemPTimer],36*5 - mov esi,GUIInitSt1 - cmp byte[InitStr1Done],0 - je .notinit2 - mov esi,GUIInitSt2 -.notinit2 - call ModemSendStr - mov al,13 - call ModemSendChar - ret -.noprocess2 - cmp byte[ModemProcess],3 - jne .noprocess3 - cmp byte[ModemOKStat],0 - je .norecv - mov byte[ModemProcess],9 -.norecv - cmp dword[ModemPTimer],0 - jne .notimeout - mov esi,.tout - call .writestr - mov byte[ModemProcess],255 -.notimeout - ret -.noprocess3 - cmp byte[ModemProcess],9 - jne .noprocess9 - cmp dword[ModemPTimer],0 - je .timeout - cmp byte[ModemOKStat],4 - jne .notcomplete -.timeout - mov byte[ModemProcess],4 -.notcomplete - ret -.noprocess9 - cmp byte[ModemProcess],4 - jne .noprocess4 - inc byte[InitStr1Done] - cmp byte[InitStr1Done],2 - je .noinit2 - cmp byte[GUIInitSt2],0 - je .noinit2 - mov byte[ModemProcess],1 - mov dword[ModemPTimer],18 - mov byte[ModemOKStat],0 - ret -.noinit2 - mov byte[ModemProcess],5 - mov dword[ModemPTimer],18 - ret -.noprocess4 - cmp byte[ModemProcess],5 - jne .noprocess5 - cmp dword[ModemPTimer],0 - jne .finishtimer - - ; ***** - Comment the following 4 lines -; mov byte[ModemProcess],64 -; mov byte[Connected],1 -; mov byte[WhichRemote],1 -; ret - - ; dial, wait for ring, etc. - cmp byte[CNetType],11 ; dial - jne .nodial - mov esi,GUIDialSt - call ModemSendStr - mov esi,DialNumber - call ModemSendStr - mov al,13 - call ModemSendChar - mov byte[ModemProcess],7 - ret -.nodial - cmp byte[CNetType],10 ; wait for ring - jne .noanswer - mov esi,.rdet - call .writestr - mov byte[ModemProcess],6 - ret -.noanswer - mov byte[ModemProcess],7 - ret -.finishtimer -.noprocess5 - cmp byte[ModemProcess],6 - jne .noprocess6 - call ModemCheckRing - cmp al,1 - jne .noprocess6 - mov esi,.ata - call ModemSendStr - mov byte[ModemProcess],7 -.noprocess6 - cmp byte[ModemProcess],7 - jne .noprocess7 - call ModemCheckDCD - cmp al,1 - jne .nocdc7 - mov esi,.cdet - call .writestr - mov byte[ModemProcess],64 - mov byte[WhichRemote],1 -.nocdc7 - ret -.noprocess7 -%endif - - ; Connect initialization - cmp byte[ModemProcess],64 - jne .noprocess64 - mov dword[ModemPTimer],72 ;36 - mov byte[ModemProcess],65 - mov byte[Connected],1 - ret -.noprocess64 - cmp byte[ModemProcess],65 - jne .noprocess65 - cmp dword[ModemPTimer],0 - je .okay65 - ret -.okay65 - mov byte[ModemProcess],66 - ret -.noprocess65 - cmp byte[ModemProcess],69 - jne .noprocess69 - cmp dword[ModemPTimer],0 - jne .notimer69 - mov dword[ModemPTimer],90 ; 2.5s - call PreparePacket - mov al,228 - call RemoteSendChar - call SendPacket -.notimer69 - call RemoteGetChar - cmp dh,0 - je .doneprocess69 - cmp dl,228 - jne .doneprocess69 - mov byte[ModemProcess],66 -.doneprocess69 - ret -.noprocess69 - cmp byte[ModemProcess],66 - jne .noprocess66 - ; Send ID and version # - call PreparePacket - mov al,'I' - call RemoteSendChar - mov al,'D' - call RemoteSendChar - mov al,222 - call RemoteSendChar - mov al,[versionNumber] - call RemoteSendChar - mov al,[versionNumber+1] - call RemoteSendChar - mov al,[versionNumber+2] - call RemoteSendChar - mov al,[versionNumber+3] - call RemoteSendChar - mov al,[soundon] - call RemoteSendChar - cmp al,byte[CNetType] - call RemoteSendChar - call SendPacket - mov byte[ModemProcess],67 - mov byte[IDCheckPos],0 - ret - ; Check if versions are the same -.noprocess66 - cmp byte[ModemProcess],67 - jne near .noprocess67 - call RemoteGetChar - cmp dh,0 - je near .doneprocess - cmp dl,'I' - jne .noI - mov byte[IDCheckPos],1 - ret -.noI - cmp byte[IDCheckPos],1 - jne .nocheck2 - cmp dl,'D' - jne .noD - mov byte[IDCheckPos],2 - ret -.noD - mov byte[IDCheckPos],0 - ret -.nocheck2 - cmp byte[IDCheckPos],2 - jne .nocheck3 - cmp dl,222 - jne .no222 - mov byte[IDCheckPos],3 - ret -.no222 - mov byte[IDCheckPos],0 - ret -.nocheck3 - cmp byte[IDCheckPos],3 - jne .nocheck4 - cmp dl,[versionNumber] - jne near .invversion - mov byte[IDCheckPos],4 - ret -.nocheck4 - cmp byte[IDCheckPos],4 - jne .nocheck5 - cmp dl,[versionNumber+1] - jne near .invversion - mov byte[IDCheckPos],5 - ret -.nocheck5 - cmp byte[IDCheckPos],5 - jne .nocheck6 - cmp dl,[versionNumber+2] - jne .invversion - mov byte[IDCheckPos],6 - ret -.nocheck6 - cmp byte[IDCheckPos],6 - jne .nocheck7 - cmp dl,[versionNumber+3] - jne .invversion - mov byte[IDCheckPos],9 - ret -.nocheck7 - cmp byte[IDCheckPos],9 - jne .nocheck10 - cmp dl,[soundon] - jne .invsound - mov byte[IDCheckPos],7 - ret -.nocheck10 - cmp byte[IDCheckPos],7 - jne .nocheck8 - mov [RemCNetType],dl - mov byte[IDCheckPos],0 - mov byte[ModemProcess],80 - cmp byte[WhichRemote],4 - jne .nocheck8 - mov byte[ModemProcess],81 -.nocheck8 - ret -.invversion - mov esi,.invver - call .writestr - mov byte[IDCheckPos],8 - ret -.invsound - mov esi,.invsnd - call .writestr - mov byte[IDCheckPos],8 - ret -.doneprocess - ret -.noprocess67 - cmp byte[ModemProcess],81 - je near .nonetpl - cmp byte[ModemProcess],80 - jne near .noprocess80 - mov dword[pl1neten],0 - mov byte[pl5neten],0 - mov byte[UseRemoteSRAMData],0 - cmp byte[CNetType],10 - jne .noans - mov byte[pl2neten],2 - mov byte[pl1neten],1 -.noans - cmp byte[RemCNetType],10 - jne .noans2 - mov byte[pl2neten],1 - mov byte[pl1neten],2 -.noans2 - cmp byte[CNetType],11 - jne .noans3 - mov byte[pl2neten],1 - mov byte[pl1neten],2 -.noans3 - cmp byte[RemCNetType],11 - jne .noans4 - mov byte[pl2neten],2 - mov byte[pl1neten],1 -.noans4 - cmp byte[CNetType],15 - jne near .nonetpl - mov bx,[IPXInfoStr] - mov ax,[IPXInfoStrR] -.nextpldet - push eax - push ebx - xor ax,bx - test ax,1 - jz .nochipx - test bx,1 - jz .pl2 - mov byte[pl2neten],2 - mov byte[pl1neten],1 - jmp .skipipxpl -.pl2 - mov byte[pl2neten],1 - mov byte[pl1neten],2 - jmp .skipipxpl -.nochipx - pop ebx - pop eax - shr eax,1 - shr ebx,1 - jmp .nextpldet -.skipipxpl - pop ebx - pop eax - mov byte[UseRemoteSRAMData],0 -.nonetpl - mov eax,ViewBuffer - mov ecx,50*32 -.cloop2 - mov byte[eax],0 - inc eax - dec ecx - jnz .cloop2 - mov dword[CCursLoc],0 - mov dword[CViewLoc],0 - mov dword[NViewLoc],0 - mov byte[CNetType],20 - mov dword[ChatString],0 - mov byte[RemoteCommand],1 - mov byte[romloadskip],1 - call LoadDetermine - call PreparePacket - mov al,1 - call RemoteSendChar - call SendPacket -.noprocess80 - ret -.writestr - mov dh,1 -.loop - mov dl,[esi] - or dl,dl - jz .nomore - call NetAddChar - inc esi - jmp .loop -.nomore - ret -.writehex - mov dx,ax - shr dx,12 - and edx,0Fh - mov dl,[.hexval+edx] - push eax - call NetAddChar - pop eax - mov dx,ax - shr dx,8 - and edx,0Fh - mov dl,[.hexval+edx] - push eax - call NetAddChar - pop eax - mov dx,ax - shr dx,4 - and edx,0Fh - mov dl,[.hexval+edx] - push eax - call NetAddChar - pop eax - mov dx,ax - and edx,0Fh - mov dl,[.hexval+edx] - call NetAddChar - ret -SECTION .data -.hexval db '0123456789ABCDEF' -%ifdef __MSDOS__ -.unableinit db 'CANNOT INIT DRIVER!',13,10,0 -.init db 'ZSNES MODEM TERMINAL',13,10,0 -.initb db 13,10,'INITIALIZING MODEM :',13,10,13,10,0 -.initc db 'ZSNES IPX TERMINAL',13,10,13,10,0 -.uart0 db 'USING 8250 UART',13,10,0 -.uart1 db 'USING 16550A UART',13,10,0 -.uart2 db 'USING FOSSIL DRIVER',13,10,0 -.tout db 'MODEM RESPONSE TIMEOUT',13,10,0 -.ata db 'ATA',13,0 -.cdet db 'CARRIER DETECTED',13,10,0 -.rdet db 'WAITING FOR RING...',13,10,0 -.noipx db 13,10,13,10,'UNABLE TO INIT IPX!',13,10,0 -.yesipx db 13,10,13,10,'IPX INITIALIZED.',13,10,13,10,'WAITING FOR REMOTE',13,10,0 -.localid db 'LOCAL ID : ',0 -.remoteid db 'REMOTE ID : ',0 -.connectest db 'CONNECTION ESTABLISHED',13,10,0 -%endif -.invver db 13,10,'INCOMPATIBLE VERSION!',13,10,0 -.invsnd db 'INVALID SOUND SETTING!',13,10,0 -%ifndef __MSDOS__ -.tcpipinit db 'ZSNES NET INTERFACE',13,10,13,10,0 -.tcpipserv db 'INIT SERVER ... ',0 -.tcpipclie db 'INIT CLIENT ... ',0 -%endif -SECTION .bss -InitStr1Done resb 1 -SECTION .text NEWSYM PreparePacket -%ifdef __MSDOS__ - call PreparePacketIPX -%endif - cmp byte[WhichRemote],4 - jne .nottcpip - call TCPIPPreparePacket -.nottcpip ret NEWSYM SendPacket -%ifdef __MSDOS__ - call SendPacketIPX -%endif - cmp byte[WhichRemote],4 - jne .nottcpip - call TCPIPSendPacket -.nottcpip ret NEWSYM SendPacketUDP -%ifdef __MSDOS__ - call SendPacketIPX -%endif - cmp byte[WhichRemote],4 - jne .nottcpip - call TCPIPSendPacketUDP -.nottcpip ret NEWSYM WritetochatBuffer - ; 28 characters - mov dh,1 -.loop - mov dl,[esi] - or dl,dl - jz .nomore - call NetAddChar - inc esi - jmp .loop -.nomore ret -SECTION .bss -NEWSYM RemoteCommand, resb 1 -HoldCommand resb 1 -SECTION .text - RemoteDeInit: -%ifdef __MSDOS__ - cmp byte[ModemInitStat],0 - je .nodeinitmodem - call DeInitModemC - mov byte[ModemInitStat],0 -.nodeinitmodem -%endif - mov byte[CNetType],1 - cmp byte[WhichRemote],2 - jne .noipx - mov byte[CNetType],0 -.noipx - cmp byte[WhichRemote],4 - jne .notcpip - cmp byte[TCPIPStatus],0 - je .nottcpipinit - call TCPIPDisconnect - mov byte[TCPIPStatus],0 -.nottcpipinit - mov byte[CNetType],4 -.notcpip ret Checkfileexist: - mov edx,FileNameMod - call Open_File - jc .failed - mov bx,ax - mov ecx,1 - mov edx,.temp - call Read_File - jc .failed2 - call Close_File - jc .failed - xor eax,eax ret -.failed2 - call Close_File -.failed - mov eax,1 - ret -SECTION .bss -.temp resb 1 -SECTION .text ProcessRemoteCommand: -%ifdef __MSDOS__ - cmp byte[WhichRemote],1 - jne .notmodem - push edx - call ModemCheckDCD - pop edx - cmp al,1 - jne near .nomulti -.notmodem -%endif - cmp byte[RemoteDisconnect],1 - je near .nomulti - call ProcRewind - ; 1 = Idle, 2 = Chat String, 3..7 = Player Select - ; 10 = Load Game, 11 = Proceed Load, 12 = Load failed, 13 = File not Found - ; 20 = Send Controls - cmp dl,1 - je near .finish - cmp dl,2 - je near .chatstr - cmp dl,10 - je near .loadstr - cmp dl,11 - je near .startloading - cmp dl,12 - je near .loadfail ; *************************** - cmp dl,13 - je near .loadfnf - cmp dl,14 - je near .loadstate - cmp dl,15 - je near .skipstate - cmp dl,20 - je near .latencychange - cmp dl,30 - je near .quitgui - cmp dl,40 - je near .guireset - cmp dl,8 - ja near .nomulti - cmp [HoldCommand],dl - je near .forgetcommand - cmp dl,3 - jne .nopl1 - cmp byte[pl1neten],1 - je .nopl1 - xor byte[pl1neten],2 -.nopl1 - cmp dl,4 - jne .nopl2 - cmp byte[pl2neten],1 - je .nopl2 - xor byte[pl2neten],2 -.nopl2 - cmp dl,5 - jne .nopl3 - cmp byte[pl3neten],1 - je .nopl3 - xor byte[pl3neten],2 -.nopl3 - cmp dl,6 - jne .nopl4 - cmp byte[pl4neten],1 - je .nopl4 - xor byte[pl4neten],2 -.nopl4 - cmp dl,7 - jne .nopl5 - cmp byte[pl5neten],1 - je .nopl5 - xor byte[pl5neten],2 -.nopl5 - cmp dl,8 - jne .nobackstate - xor byte[BackState],1 - cmp byte[BackState],0 - jne .notbstate0 - mov byte[Latency],10 - mov byte[Latencytochange],10 -.notbstate0 - cmp byte[BackState],1 - jne .notbstate1 - mov byte[Latency],3 - mov byte[Latencytochange],3 -.notbstate1 -.nobackstate - jmp .finish -.forgetcommand - mov byte[HoldCommand],1 - jmp .finish -.nomulti - cmp dl,50 - jne .nosramnone - cmp byte[HoldCommand],41 - je .forgetcommand - cmp byte[HoldCommand],42 - je .forgetcommand - mov byte[UseRemoteSRAMData],0 - jmp .finish -.nosramnone - cmp dl,41 - jne .nosramlocal - cmp byte[HoldCommand],40 - je .forgetcommand - cmp byte[HoldCommand],41 - je .forgetcommand - mov byte[UseRemoteSRAMData],2 - jmp .finish -.nosramlocal - cmp dl,42 - jne .nosramremote - cmp byte[HoldCommand],40 - je .forgetcommand - cmp byte[HoldCommand],42 - je .forgetcommand - mov byte[UseRemoteSRAMData],1 - jmp .finish -.nosramremote - cmp byte[NetQuitAfter],0 - je .noguiquit - mov byte[GUIQuit],1 -.noguiquit - ; error - call RemoteDeInit ret -.loadfail - cmp dword[TCPIPAddress],'127.' - jne .nonum - cmp dword[TCPIPAddress+4],'0.0.' - jne .nonum - cmp byte[TCPIPAddress+8],'1' - je near .startloadingb -.nonum - mov esi,.filenotu - call ProcessModem.writestr - jmp .finish -.startloadingb - mov byte[UseRemoteSRAMData],0 - jmp .startloading -.loadfnf - mov esi,.filenotfr - call ProcessModem.writestr - jmp .finish -.loadstate - mov byte[CNetType],22 - call loadstaterecvinit -.skipstate - jmp .finish -.latencychange - cmp [HoldCommand],dl - je near .invlatencych -.keepgoinglc - call RemoteGetChar - cmp dh,0 - je .keepgoinglc - mov [Latency],dl - mov [Latencytochange],dl - jmp .finish -.quitgui - mov byte[GUIQuit],2 - jmp .finsend -.guireset - call GUIDoReset - jmp .finsend -.invlatencych - mov al,[Latency] - mov [Latencytochange],al - jmp .finsend -.loadstr - push edx - mov esi,.loading - call ProcessModem.writestr - xor ebx,ebx -.keepgoing2 - push ebx - call RemoteGetChar - pop ebx - cmp dh,0 - je .keepgoing2 - mov [FileNameMod+ebx],dl - inc ebx - or dl,dl - je .doneload - jmp .keepgoing2 -.doneload - mov esi,FileNameMod - call ProcessModem.writestr - mov dl,13 - call NetAddChar - mov dl,10 - call NetAddChar - pop edx - cmp byte[HoldCommand],11 - je .loadfailed - cmp [HoldCommand],dl - jne .okayload - ; ***** - Add comment -; jmp .okayload ; ************ -.loadfailed - ; load failed - mov esi,.filenotu - call ProcessModem.writestr - mov byte[RemoteCommand],12 - jmp .finish -.loadfailednf - ; File Not Found - mov esi,.filenotf - call ProcessModem.writestr - mov byte[RemoteCommand],13 - jmp .finish -.okayload - call Checkfileexist - cmp eax,0 - jne .loadfailednf - mov byte[RemoteCommand],11 -.trynext - cmp byte[GUIwinptr],0 - je near .noclose - xor eax,eax - mov al,[GUIwinptr] - dec eax - xor ebx,ebx - mov bl,[GUIwinorder+eax] - ; close window - mov byte[GUIwinorder+eax],0 - mov byte[GUIwinactiv+ebx],0 - dec byte[GUIwinptr] - cmp byte[GUIwinptr],0 - jne .noclose - mov al,[GUIpmenupos] - mov [GUIcmenupos],al - jmp .trynext -.noclose - jmp .finish -.chatstr - ; Keep receiving and printing characters until 0 is found -; mov dl,'R' -; call NetAddChar -; mov dl,'>' -; call NetAddChar -.keepgoing - call RemoteGetChar - cmp dh,0 - je .keepgoing - or dl,dl - je .finishst - call NetAddChar - jmp .keepgoing -.finishst - mov dl,13 - call NetAddChar - mov dl,10 - call NetAddChar -.finish - mov al,[HoldCommand] - cmp al,2 - jne .noprintst - mov dl,'L' -; call NetAddChar - mov dl,'>' -; call NetAddChar - xor ebx,ebx -.next - mov dl,[ChatString+ebx] - cmp dl,0 - je .donenac - push ebx -; call NetAddChar - pop ebx - inc ebx - jmp .next -.donenac - mov dl,13 -; call NetAddChar - mov dl,10 -; call NetAddChar - mov dword[ChatString],0 - jmp .skipcommand -.noprintst - cmp al,20 - jne .nolatencyc - mov al,[Latencytochange] - mov [Latency],al - jmp .skipcommand -.nolatencyc - cmp al,3 - jne .nopl1b - cmp byte[pl1neten],2 - je .nopl1b - xor byte[pl1neten],1 -.nopl1b - cmp al,4 - jne .nopl2b - cmp byte[pl2neten],2 - je .nopl2b - xor byte[pl2neten],1 -.nopl2b - cmp al,5 - jne .nopl3b - cmp byte[pl3neten],2 - je .nopl3b - xor byte[pl3neten],1 -.nopl3b - cmp al,6 - jne .nopl4b - cmp byte[pl4neten],2 - je .nopl4b - xor byte[pl4neten],1 -.nopl4b - cmp al,7 - jne .nopl5b - cmp byte[pl5neten],2 - je .nopl5b - xor byte[pl5neten],1 -.nopl5b - cmp al,8 - jne .nobackstateb - xor byte[BackState],1 - cmp byte[BackState],0 - jne .notbstate0b - mov byte[Latency],10 - mov byte[Latencytochange],10 -.notbstate0b - cmp byte[BackState],1 - jne .notbstate1b - mov byte[Latency],3 - mov byte[Latencytochange],3 -.notbstate1b -.nobackstateb - cmp al,50 - jne .nosramnoneb - mov byte[UseRemoteSRAMData],0 -.nosramnoneb - cmp al,41 - jne .nosramlocalb - mov byte[UseRemoteSRAMData],1 -.nosramlocalb - cmp al,42 - jne .nosramremoteb - mov byte[UseRemoteSRAMData],2 -.nosramremoteb - cmp al,11 - jne .noload -.startloading - mov byte[HoldCommand],1 - mov byte[RemoteCommand],1 - mov eax,FileNameMod - call GUIloadfilename.nocnettype - mov byte[sramsavedis],1 - call transfersram - ret -.noload -.skipcommand - mov al,[RemoteCommand] - mov [HoldCommand],al - cmp al,2 - jne near .nosendstcheck - cmp byte[ChatString],0 - jne .nosendstcheck - mov byte[RemoteCommand],1 - mov byte[HoldCommand],1 - mov al,1 -.nosendstcheck - cmp al,1 - je near .finsend - call PreparePacket - call RemoteSendChar -.nosend - mov al,[RemoteCommand] - cmp al,2 - jne near .nosendst - - push eax - ; Capitalize ChatString - mov eax,ChatString -.nextletter - cmp byte[eax],0 - je .doneletter - cmp byte[eax],'a' - jb .noletter - cmp byte[eax],'z' - jb .noletter - sub byte[eax],'a'-'A' -.noletter - inc eax - jmp .nextletter -.doneletter - cmp dword[ChatString],'/ME ' - je .action - cmp dword[ChatString],'/NIC' - jne .notaction - cmp word[ChatString+4],'K ' - je near .nickchange -.notaction - mov eax,.chatinitial - mov ebx,ChatString - call ConcatString - mov eax,ChatNick - mov ebx,ChatString - call ConcatString - jmp .noaction -.action - mov eax,ChatString - mov ebx,4 - call ClipString - mov eax,.actinitial2 - mov ebx,ChatString - call ConcatString - mov eax,ChatNick - mov ebx,ChatString - call ConcatString - mov eax,.actinitial - mov ebx,ChatString - call ConcatString - jmp .noaction -.nickchange - mov eax,ChatString - mov ebx,6 - call ClipString - ; Valid String? - mov eax,ChatString - xor ebx,ebx -.loopnickcheck - cmp byte[eax],0 - je .donestcheck - cmp byte[eax],'-' - je .okaystring - cmp byte[eax],'_' - je .okaystring - cmp byte[eax],'^' - je .okaystring - cmp byte[eax],'=' - je .okaystring - cmp byte[eax],'+' - je .okaystring - cmp byte[eax],'[' - je .okaystring - cmp byte[eax],']' - je .okaystring - cmp byte[eax],'0' - jb .notokaystring - cmp byte[eax],'9' - jbe .okaystring - cmp byte[eax],'A' - jb .notokaystring - cmp byte[eax],'Z' - jbe .okaystring - jmp .notokaystring -.okaystring - inc eax - inc ebx - jmp .loopnickcheck -.donestcheck - cmp ebx,9 - ja .notokaystringb - mov eax,ChatString - mov ebx,.tempnick - call CopyString - mov eax,.nickchangeb - mov ebx,ChatString - call ConcatString - mov eax,ChatNick - mov ebx,ChatString - call ConcatString - mov eax,.tempnick - mov ebx,ChatNick - call CopyString - jmp .noaction -.notokaystring - mov esi,.strinvalid - call WritetochatBuffer - pop eax - jmp .finsend -.notokaystringb - mov esi,.strtoolong - call WritetochatBuffer - pop eax - jmp .finsend -.noaction - pop eax - - xor ebx,ebx -.next2 - mov al,[ChatString+ebx] - push ebx - push eax - call RemoteSendChar - pop eax - pop ebx - inc ebx - cmp al,0 - jne .next2 - mov esi,ChatString - call WritetochatBuffer - mov dl,13 - call NetAddChar - mov dl,10 - call NetAddChar - jmp .finsend2 -.nosendst - cmp al,20 - jne .nolatencych - mov al,[Latencytochange] - call RemoteSendChar - jmp .finsend2 -.nolatencych - cmp al,10 - jne .nosendfn - xor ebx,ebx -.next3 - mov al,[FileNameMod+ebx] - push ebx - push eax - call RemoteSendChar - pop eax - pop ebx - inc ebx - cmp al,0 - jne .next3 - jmp .finsend2 -.nosendfn -.finsend2 - call SendPacket -.finsend - mov byte[RemoteCommand],1 - ret - -SECTION .data -.chatinitial db '>',0 -.actinitial db '*',0 -.actinitial2 db ' ',0 -.loading db 'LOADING ',0 -.filenotf db 'FILE NOT FOUND!',13,10,0 -.filenotfr db 'FILE NOT FOUND AT REMOTE!',13,10,0 -.filenotu db 'UNABLE TO LOAD!',13,10,0 -.tempnick times 16 db 0 -.strinvalid db '** INVALID NICK **',13,10,0 -.strtoolong db '** NICK IS TOO LONG **',13,10,0 -.nickchangeb db ' IS NOW KNOWN AS ',0 -SECTION .text transfersram: - ;Do players want SRAM sent? - cmp byte[UseRemoteSRAMData],0 - je .nosram - - cmp dword[ramsize],0 - je .nosram - - mov ebx,[sram] - cmp byte[SFXEnable],1 - jne .notsfx - mov ebx,[sfxramdata] -.notsfx - cmp byte[SA1Enable],1 - jne .notsa1 - mov ebx,[SA1RAMArea] -.notsa1 - cmp byte[SETAEnable],1 - jne .notseta - mov ebx,[setaramdata] -.notseta - cmp ebx,[sram] - je .notspecial - cmp byte[CHIPBATT],0 - je .nosram -.notspecial - push ebx ;Save .srm register - cmp byte[UseRemoteSRAMData],1 - je .uselocal - cmp byte[UseRemoteSRAMData],2 - je near .useremote -.nosram - call clearsram - ret - - -.uselocal - call PreparePacket - mov al,233 - call RemoteSendChar - call SendPacket -.notimer - pushad - call JoyRead - popad - call RemoteGetChar - cmp dh,0 - je .notimer - cmp dl,234 - jne .notimer - - ; send sram - mov ecx,[ramsize] - pop ebx ;Restore .srm register - xor esi,esi -.loop - push ebx - push ecx - mov ebx,esi - and ebx,0FFh - cmp ebx,0 - jne .notzero - call PreparePacket -.notzero - pop ecx - pop ebx - mov al,[ebx] - push ebx - push ecx - call RemoteSendChar - pop ecx - mov ebx,esi - and ebx,0FFh - cmp ebx,0FFh - jne .notsend - call SendPacket -.notsend - pop ebx - inc esi - inc ebx - dec ecx - jnz .loop - mov byte[sramsavedis],0 - ret - -.useremote - call PreparePacket - mov al,234 - call RemoteSendChar - call SendPacket -.notimerb - pushad - call JoyRead - popad - call RemoteGetChar - cmp dh,0 - je .notimerb - cmp dl,233 - jne .notimerb - - ; receive sram - mov ecx,[ramsize] - pop ebx ;Restore .srm register -.loopb -.getnext - pushad - call JoyRead - popad - call RemoteGetChar - cmp dh,0 - je .getnext - mov [ebx],dl - inc ebx - dec ecx - jnz .loopb ret NEWSYM RemoteSendEAX -; call RemoteSendChar - shr eax,8 - call RemoteSendChar - shr eax,8 - call RemoteSendChar - shr eax,8 - call RemoteSendChar ret NEWSYM RemoteGetEAX -;.getnext -; call RemoteGetChar -; cmp dh,0 -; je .getnext -; mov bl,dl - xor ebx,ebx -; shl ebx,8 -.getnext2 - call RemoteGetChar - cmp dh,0 - je .getnext2 - mov bl,dl - shl ebx,8 -.getnext3 - call RemoteGetChar - cmp dh,0 - je .getnext3 - mov bl,dl - shl ebx,8 -.getnext4 - call RemoteGetChar - cmp dh,0 - je .getnext4 - mov bl,dl - bswap ebx - mov eax,ebx ret - NEWSYM RemoteSendChar -%ifdef __MSDOS__ - cmp byte[WhichRemote],1 - jne .nomodem - call ModemSendChar -.nomodem - cmp byte[WhichRemote],2 - jne .noipx - call ipxsendchar -.noipx -%endif - cmp byte[WhichRemote],4 - jne .notcpip - call TCPIPStoreByte -.notcpip ret NEWSYM RemoteGetChar -%ifdef __MSDOS - cmp byte[WhichRemote],1 - jne .nomodem - call ModemGetChar -.nomodem - cmp byte[WhichRemote],2 - jne .noipx - call ipxgetchar -.noipx -%endif - cmp byte[WhichRemote],4 - jne .notcpip - call TCPIPGetByte -.notcpip ret %ifdef __MSDOS__ ModemSendStr: -.loop - mov al,[esi] - or al,al - jz .nomore - call ModemSendChar - inc esi - jmp .loop -.nomore ret %endif -SECTION .bss -NetLoadHandle resw 1 -NetStateSize resd 1 -NetStateTotal resd 1 -NetStateQuit resb 1 -NetStateBuffer resb 2048 -SECTION .data -NEWSYM Netfname, db 'nettemp.zst',0 -SECTION .text - NetLoadStuff: - call loadnetopen - mov byte[NetStateQuit],0 - mov edx,fnamest+1 - call Open_File - jc .nostate - mov bx,ax - mov cx,0 - mov dx,0 - call File_Seek_End - shl edx,16 - mov dx,ax - mov [NetStateSize],edx - mov [NetStateTotal],edx - call Close_File - mov byte[CNetType],21 - call PreparePacket - mov al,14 - call RemoteSendChar - mov al,[NetStateSize] - call RemoteSendChar - mov al,[NetStateSize+1] - call RemoteSendChar - mov al,[NetStateSize+2] - call RemoteSendChar - call SendPacket - pushad - call SRAMChdir - popad - mov edx,fnamest+1 - call Open_File - mov [NetLoadHandle],ax - call ChangetoLOADdir -.nostate ret loadstaterecvinit: - mov byte[NetStateQuit],0 - mov dword[NetStateSize],0 -.noreceive - pushad - call JoyRead - popad - call RemoteGetChar - cmp dh,0 - je .noreceive - mov [NetStateSize],dl -.noreceive1 - call RemoteGetChar - cmp dh,0 - je .noreceive1 - mov [NetStateSize+1],dl -.noreceive2 - call RemoteGetChar - cmp dh,0 - je .noreceive2 - mov [NetStateSize+2],dl - pushad - call SRAMChdir - popad - mov edx,Netfname - call Create_File - mov edx,[NetStateSize] - mov [NetStateTotal],edx - mov [NetLoadHandle],ax - call ChangetoLOADdir ret loadstatesend: - call RemoteGetChar - cmp dh,0 - je .noreceived - cmp dl,15 - je .finished - call ProcessRemoteCommand -.noreceived - cmp byte[NetStateQuit],0 - je .noquit -.finished - call PreparePacket - mov al,15 - call RemoteSendChar - call SendPacket - mov byte[CNetType],20 - mov esi,StateLoadedFail - call ProcessModem.writestr - mov bx,[NetLoadHandle] - call Close_File - cmp byte[NetLoadState],0 - je .norun - mov byte[GUIQuit],2 -.norun - ret -.noquit - call PreparePacket - mov al,1 - call RemoteSendChar - mov ecx,[NetStateSize] - cmp ecx,2047 - jbe .notsmaller - mov ecx,2047 -.notsmaller - sub [NetStateSize],ecx - mov bx,[NetLoadHandle] - mov edx,NetStateBuffer - push ecx - call Read_File - pop ecx - mov edx,NetStateBuffer -.loop - mov al,[edx] - push edx - push ecx - call RemoteSendChar - pop ecx - pop edx - inc edx - dec ecx - jnz .loop - call SendPacket - cmp dword[NetStateSize],0 - jne .notzero - pushad - pushad - call loadstate2 - popad - mov byte[RestoreValues],0 - mov bx,[NetLoadHandle] - call Close_File - mov byte[CNetType],20 - mov esi,StateLoadedOk - call ProcessModem.writestr - cmp byte[NetLoadState],0 - je .norun2 - mov byte[GUIQuit],2 -.norun2 - popad -.notzero ret loadstaterecv: - cmp byte[NetStateQuit],0 - je .noquit2 - mov byte[NetStateQuit],0 - call PreparePacket - mov al,15 - call RemoteSendChar - call SendPacket -.noquit2 - call RemoteGetChar - cmp dh,0 - jne .received ret -.received - cmp dl,1 - je .noquit - mov byte[CNetType],20 - mov esi,StateLoadedFail - call ProcessModem.writestr - cmp byte[NetLoadState],0 - je .norun - mov byte[GUIQuit],2 -.norun - mov bx,[NetLoadHandle] - call Close_File - ret -.noquit - mov ecx,[NetStateSize] - cmp ecx,2047 - jbe .notsmaller - mov ecx,2047 -.notsmaller - sub [NetStateSize],ecx - mov edx,NetStateBuffer - push ecx -.loop - push edx - push ecx -.notrecv - call RemoteGetChar - cmp dh,0 - je .notrecv - mov al,dl - pop ecx - pop edx - mov [edx],al - inc edx - dec ecx - jnz .loop - pop ecx - mov bx,[NetLoadHandle] - mov edx,NetStateBuffer - call Write_File - cmp dword[NetStateSize],0 - jne .notzero - pushad - mov bx,[NetLoadHandle] - call Close_File - pushad - call SRAMChdir - popad - mov edx,Netfname - mov byte[RestoreValues],0 - pushad - call loadstate3 - popad - call ChangetoLOADdir - cmp byte[NetLoadState],0 - je .norun2 - mov byte[GUIQuit],2 -.norun2 - mov byte[CNetType],20 - mov esi,StateLoadedOk - call ProcessModem.writestr - popad -.notzero - ret - -SECTION .data -StateLoadedOk db 10,13,'STATE LOADED.',10,13,10,13,0 -StateLoadedFail db 10,13,'LOAD FAILED.',10,13,10,13,0 -SECTION .text - - diff --git a/zsnes/src/gui/guiwindp.inc b/zsnes/src/gui/guiwindp.inc index abff59f8..4ac688f5 100644 --- a/zsnes/src/gui/guiwindp.inc +++ b/zsnes/src/gui/guiwindp.inc @@ -3719,1031 +3719,23 @@ GUICSrcTextV db 'ENTER NEW VALUE:',0 GUICSrcTextW db 'ENTER CHEAT DESCRIPTION:',0 GUICSrcTextX db 'PAR CODE EQUIVALENT:',0 GUICSrcTextY db 'USE ONLY UPPER BYTE',0 -SECTION .text - -NEWSYM NetAddChar ; dl = color, dh = char - mov eax,ViewBuffer - add eax,[CCursLoc] - mov ebx,[CCursLoc] - sub ebx,[CViewLoc] - cmp ebx,32*12 - jbe .okay - mov ebx,[CCursLoc] - sub ebx,32*11 - and ebx,0FFE0h - mov [CViewLoc],ebx -.okay - cmp dword[CCursLoc],32*48 - jb .notbottom - call .movelistup - mov ebx,[CCursLoc] - sub ebx,32*12 - and ebx,0FFE0h - mov [CViewLoc],ebx - jmp NetAddChar -.notbottom - test dword[CCursLoc],1Fh - jnz .nobeginning - cmp dl,' ' - je near .skipaddchar - mov byte[eax],dh - inc dword[CCursLoc] - inc eax -.nobeginning - mov ebx,[CCursLoc] - and ebx,1Fh - cmp ebx,1Eh - jne near .noend - add dword[CCursLoc],2 - cmp dword[CCursLoc],32*48 - jb .notbottom2 - call .movelistup -.notbottom2 - mov ebx,[CCursLoc] - add ebx,ViewBuffer - sub ebx,3 - mov eax,12 - cmp byte[ebx],' ' - je .notfoundspace -.loop3 - cmp byte[ebx],' ' - je .foundspace - dec ebx - dec eax - jnz .loop3 - jmp .notfoundspace -.foundspace - mov ecx,[CCursLoc] - add ecx,ViewBuffer - inc ebx - cmp byte[ebx],0 - je .notfoundspace - mov [ecx],dh - inc ecx - mov byte[ecx],' ' - inc ecx - add dword[CCursLoc],2 -.loop2 - cmp byte[ebx],0 - je .skipaddingspace - mov al,[ebx] - mov [ecx],al - mov byte[ecx+1],0 - mov byte[ebx],' ' - inc ebx - inc ecx - inc dword[CCursLoc] - jmp .loop2 - jmp .skipaddingspace -.notfoundspace - mov ecx,[CCursLoc] - add ecx,ViewBuffer - mov [ecx],dh - inc ecx - mov byte[ecx],' ' - inc ecx - add dword[CCursLoc],2 -.skipaddingspace - jmp NetAddChar -.noend - cmp dl,13 - je .ret - cmp dl,10 - je .next - mov byte[eax],dl - mov byte[eax+1],0 - inc dword[CCursLoc] - ret -.next - add dword[CCursLoc],32 -.ret - and dword[CCursLoc],0FFE0h -.skipaddchar - mov ebx,[CViewLoc] - shr ebx,5 - mov [NViewLoc],ebx - ret - -.movelistup - ; move list up by 32 spaces - mov ebx,ViewBuffer - mov ecx,32*47 -.loop - mov al,[ebx+32] - mov [ebx],al - inc ebx - dec ecx - jnz .loop - and dword[CCursLoc],0FFE0h - mov dword[ViewBuffer+32*47],0 - sub dword[CCursLoc],32 - ret - - -section .bss +SECTION .bss CCursLoc resd 1 CViewLoc resd 1 NViewLoc resd 1 TViewLoc resd 1 -section .text - -DisplayNetOptns: - - mov dword[GUIwinsizex+8*4],7*16 - mov dword[GUIwinsizey+8*4],57 - mov dword[GUINetDisp],'IPX ' - mov dword[GUINetDisp+4],' ' - mov byte[GUINetDisp+8],0 - cmp byte[per2exec],100 - je .netokay - mov dword[GUIwinsizex+8*4],7*16 - mov dword[GUIwinsizey+8*4],40 - mov dword[GUINetDisp],'ERRO' - mov dword[GUINetDisp+4],'R! ' - jmp .nomodem -.netokay -%ifdef __MSDOS__ - cmp byte[CNetType],8 - jne .noipxinvalid - mov dword[GUIwinsizex+8*4],7*16 - mov dword[GUIwinsizey+8*4],30 - mov dword[GUINetDisp],'ERRO' - mov dword[GUINetDisp+4],'R! ' -.noipxinvalid -%endif - - cmp byte[CNetType],22 - je .yesstate - cmp byte[CNetType],21 - jne .nostate -.yesstate - mov dword[GUIwinsizex+8*4],150 - mov dword[GUIwinsizey+8*4],59 - mov dword[GUINetDisp],'STAT' - mov dword[GUINetDisp+4],'E TR' - mov dword[GUINetDisp+8],'ANSF' - mov dword[GUINetDisp+12],'ER ' - mov dword[GUINetDisp+14],0 -.nostate - - cmp byte[CNetType],20 - jne .nochat - mov dword[GUIwinsizex+8*4],188 - mov dword[GUIwinsizey+8*4],179 - mov dword[GUINetDisp],'CHAT' - mov dword[GUINetDisp+4],0 -.nochat - cmp byte[CNetType],15 - je .yesterm - cmp byte[CNetType],12 - je .yesterm - cmp byte[CNetType],11 - je .yesterm - cmp byte[CNetType],10 - jne .noterm -.yesterm - mov dword[GUIwinsizex+8*4],188 - mov dword[GUIwinsizey+8*4],144 - mov dword[GUINetDisp],'TERM' - mov dword[GUINetDisp+4],'INAL' - mov byte[GUINetDisp+8],0 -.noterm - cmp byte[CNetType],4 - jne .notcpip - ; Your IP: - ; Start as Server - ; Client Options: - ; IP : - ; Port: - ; Connect - mov dword[GUIwinsizex+8*4],201 - mov dword[GUIwinsizey+8*4],98 - mov dword[GUINetDisp],'INTE' - mov dword[GUINetDisp+4],'RNET' - mov byte[GUINetDisp+8],0 - cmp byte[NetPlayNoMore],1 - jne .notcpip - mov dword[GUIwinsizex+8*4],201 - mov dword[GUIwinsizey+8*4],48 -.notcpip -%ifdef __MSDOS__ - cmp byte[CNetType],3 - je .yesmodem - cmp byte[CNetType],1 - jne .nomodem2 - jmp .skipmodem3 -.yesmodem - mov dword[GUIwinsizex+8*4],188 - mov dword[GUIwinsizey+8*4],45 - jmp .skipmodem2 -.skipmodem3 - mov dword[GUIwinsizex+8*4],95 - mov dword[GUIwinsizey+8*4],70 -.skipmodem2 - mov dword[GUINetDisp],'MODE' - mov dword[GUINetDisp+4],'M ' - mov byte[GUINetDisp+8],0 -.nomodem2 - cmp byte[CNetType],2 - jne .nomodem - mov dword[GUIwinsizex+8*4],188 - mov dword[GUIwinsizey+8*4],154 - mov dword[GUINetDisp],'MODE' - mov dword[GUINetDisp+4],'M SE' - mov dword[GUINetDisp+8],'TTIN' - mov word[GUINetDisp+12],'GS' - mov byte[GUINetDisp+14],0 -%endif -.nomodem - GUIDrawWindowBox 8,GUINetDisp - cmp byte[per2exec],100 - jne near DisplayNetOptnsInvalid - - cmp byte[CNetType],22 - je near DisplayNetTCPIPState - cmp byte[CNetType],21 - je near DisplayNetTCPIPState - -%ifdef __MSDOS__ - cmp byte[CNetType],1 - je near DisplayNetOptnsModem - cmp byte[CNetType],2 - je near DisplayNetOptnsModemConfig - cmp byte[CNetType],3 - je near DisplayNetOptnsModemDial -%endif - cmp byte[CNetType],4 - je near DisplayNetOptnsTCPIP - cmp byte[CNetType],10 - je near DisplayNetOptnsModemTerm - cmp byte[CNetType],11 - je near DisplayNetOptnsModemTerm - cmp byte[CNetType],12 - je near DisplayNetOptnsModemTerm - cmp byte[CNetType],15 - je near DisplayNetOptnsModemTerm - cmp byte[CNetType],20 - je near DisplayNetOptnsChatWindow -%ifdef __MSDOS__ - cmp byte[CNetType],7 - je near DisplayNetIPXStart - cmp byte[CNetType],8 - je near DisplayNetIPXInvalid - - jmp DisplayNetIPXStart - - cmp ax,0 - je .ipxokay - mov byte[CNetType],8 - jmp DisplayNetIPXInvalid -.ipxokay - cmp byte[CNetType],7 - jmp DisplayNetIPXStart - - mov byte[GUItextcolor],217 - cmp byte[GUIWincoladd],0 - je .zero - mov byte[GUItextcolor],211 -.zero - mov dword[GUIEditStringcWin],0 - sub byte[GUItextcolor],15 - GUIOuttextwin2 8,6,16,GUINetText1 - GUIOuttextwin2 8,6,26,GUINetText2 - add byte[GUItextcolor],15 - GUIOuttextwin2 8,5,15,GUINetText1 - GUIOuttextwin2 8,5,25,GUINetText2 - ret -%endif - -DisplayNetTCPIPState: - DrawGUIButton 8,73,48,127,59,GUITCPStateText3,64,0,0 - cmp byte[CNetType],22 - je near .receive - sub byte[GUItextcolor],15 - GUIOuttextwin2 8,6,16,GUITCPStateText1 - add byte[GUItextcolor],15 - GUIOuttextwin2 8,5,15,GUITCPStateText1 - jmp .send -.receive - sub byte[GUItextcolor],15 - GUIOuttextwin2 8,6,16,GUITCPStateText2 - add byte[GUItextcolor],15 - GUIOuttextwin2 8,5,15,GUITCPStateText2 -.send - DrawGUIWinBox 8,10,30,120,40,167 - cmp dword[NetStateTotal],0 - je near .nobox - mov eax,[NetStateTotal] - sub eax,[NetStateSize] - mov ebx,110 - mul ebx - mov ebx,[NetStateTotal] - div ebx - add eax,10 - cmp eax,10 - je near .nobox - push eax - inc eax - DrawGUIWinBox3 8,10,30,eax,40,226 - pop eax - DrawGUIWinBox3 8,10,30,eax,40,224 -.nobox - - mov dl,[GUIWincol] - DrawGUIWinBox 8,10,29,120,29,dl - mov dl,[GUIWincol] - add dl,1 - DrawGUIWinBox 8,9,30,8,40,dl - mov dl,[GUIWincol] - add dl,4 - DrawGUIWinBox 8,10,41,120,41,dl ; 0,1,0,1 - mov dl,[GUIWincol] - add dl,3 - DrawGUIWinBox 8,122,30,121,40,dl ; 2,0,1,0 - ret - -SECTION .data -GUITCPStateText1 db 'SENDING STATUS',0 -GUITCPStateText2 db 'RECEIVING STATUS',0 -GUITCPStateText3 db 'CANCEL',0 SECTION .text -%ifdef __MSDOS__ -DisplayNetIPXStart: - DrawGUIButton 8,53,48,87,59,GUINetTextZ,34,0,0 - sub byte[GUItextcolor],15 - GUIOuttextwin2 8,6,16,GUINetText1c - GUIOuttextwin2 8,6,26,GUINetText2c - GUIOuttextwin2 8,6,36,GUINetText3c - add byte[GUItextcolor],15 - GUIOuttextwin2 8,5,15,GUINetText1c - GUIOuttextwin2 8,5,25,GUINetText2c - GUIOuttextwin2 8,5,35,GUINetText3c - ret - -DisplayNetIPXInvalid: - ret -%endif - -DisplayNetOptnsTCPIP: - ; Your IP: - ; Port: - ; Start as Server - ; Client Options: - ; IP : - ; Connect - - mov byte[GUItextcolor],217 - cmp byte[GUIWincoladd],0 - je .zero - mov byte[GUItextcolor],211 -.zero - sub byte[GUItextcolor],15 - - cmp byte[NetPlayNoMore],1 - jne near .tcpip - GUIOuttextwin2 8,6,16,GUINetTextr1 - GUIOuttextwin2 8,6,36,GUINetTextr2 - GUIOuttextwin2 8,6,46,GUINetTextr3 - add byte[GUItextcolor],15 - GUIOuttextwin2 8,5,15,GUINetTextr1 - GUIOuttextwin2 8,5,35,GUINetTextr2 - GUIOuttextwin2 8,5,45,GUINetTextr3 - ret -.tcpip - GUIOuttextwin2 8,6,16,GUINetTextf2 - GUIOuttextwin2 8,6,26,GUINetTextf3 - GUIOuttextwin2 8,6,51,GUINetTexth2 - GUIOuttextwin2 8,6,61,GUINetTexti2 - GUIOuttextwin2 8,18,98,GUINetTextp2 - GUIOuttextwin2 8,6,88,hostname - add byte[GUItextcolor],15 - GUIOuttextwin2 8,5,15,GUINetTextf2 - GUIOuttextwin2 8,5,25,GUINetTextf3 - DrawGUIButton 8,5,35,129,46,GUINetTextg2,25,0,0 - GUIOuttextwin2 8,5,50,GUINetTexth2 - GUIOuttextwin2 8,5,60,GUINetTexti2 - DrawGUIButton 8,5,70,129,81,GUINetTextj2,26,0,0 - DrawGUIWinBox 8,55,13,95,21,167 - DrawGUIWinBox 8,55,24,119,32,167 - DrawGUIWinBox 8,26,58,191,66,167 - GUIOuttextwin2 8,17,97,GUINetTextp2 - GUIOuttextwin2 8,5,87,hostname - - mov byte[GUItextcolor],223 - GUIOuttextwin2 8,60,16,GUINetTextl2 - GUIOuttextwin2 8,31,61,TCPIPAddress - GUIOuttextwin2 8,60,27,ChatNick - mov byte[GUItextcolor],221 - cmp byte[GUIWincoladd],0 - je .zero2 - mov byte[GUItextcolor],222 -.zero2 - GUIOuttextwin2 8,59,15,GUINetTextl2 - GUIOuttextwin2 8,30,60,TCPIPAddress - GUIOuttextwin2 8,59,26,ChatNick - mov byte[GUINetTextn2],'_' - test byte[GUINetTextm2+2],8 - jz .yesus - mov byte[GUINetTextn2],' ' -.yesus - xor eax,eax - mov al,[GUINetTextm2+1] - mov ebx,6 - mul ebx - cmp byte[GUINetTextm2],1 - je near .cursor2 - cmp byte[GUINetTextm2],2 - je near .cursor3 - add eax,30 - GUIOuttextwin2 8,eax,61,GUINetTextn2 - jmp .cursor1 -.cursor2 - xor eax,eax - mov ebx,GUINetTextl2 -.loopc - cmp byte[ebx],0 - je .donec - inc ebx - add eax,6 - jmp .loopc -.donec - add eax,59 - GUIOuttextwin2 8,eax,16,GUINetTextn2 - jmp .cursor1 -.cursor3 - xor eax,eax - mov ebx,ChatNick -.loopc2 - cmp byte[ebx],0 - je .donec2 - inc ebx - add eax,6 - jmp .loopc2 -.donec2 - add eax,59 - GUIOuttextwin2 8,eax,27,GUINetTextn2 -.cursor1 - - mov dword[GUITemp],GUIIconDataCheckBoxUC - cmp byte[UDPConfig],1 - jne .nocheckm - mov dword[GUITemp],GUIIconDataCheckBoxC -.nocheckm - GUIDisplayIconWin 8,5,93,[GUITemp] - ; Draw borders - mov dword[GUIWincol],148+10 - cmp byte[cwindrawn],1 - jne .noone3 - mov dword[GUIWincol],148+5 -.noone3 - cmp byte[cwindrawn],0 - jne .nozero3 - mov dword[GUIWincol],148 -.nozero3 - mov dl,[GUIWincol] ; Port - DrawGUIWinBox 8,55,12,95,12,dl - mov dl,[GUIWincol] - add dl,1 - DrawGUIWinBox 8,54,13,53,21,dl - mov dl,[GUIWincol] - add dl,4 - DrawGUIWinBox 8,55,22,95,22,dl - mov dl,[GUIWincol] - add dl,3 - DrawGUIWinBox 8,97,13,96,21,dl - mov dl,[GUIWincol] ; Nickname - DrawGUIWinBox 8,55,23,119,23,dl - mov dl,[GUIWincol] - add dl,1 - DrawGUIWinBox 8,54,24,53,32,dl - mov dl,[GUIWincol] - add dl,4 - DrawGUIWinBox 8,55,33,119,33,dl - mov dl,[GUIWincol] - add dl,3 - DrawGUIWinBox 8,121,24,120,32,dl - mov dl,[GUIWincol] ; IP - DrawGUIWinBox 8,26,57,191,57,dl - mov dl,[GUIWincol] - add dl,1 - DrawGUIWinBox 8,25,58,24,66,dl - mov dl,[GUIWincol] - add dl,4 - DrawGUIWinBox 8,26,67,191,67,dl - mov dl,[GUIWincol] - add dl,3 - DrawGUIWinBox 8,193,58,192,66,dl - ; End draw borders - ret - -DisplayNetOptnsInvalid: - mov byte[CNetType],255 - mov byte[GUItextcolor],217 - cmp byte[GUIWincoladd],0 - je .zero - mov byte[GUItextcolor],211 -.zero - mov dword[GUIEditStringcWin],0 - sub byte[GUItextcolor],15 - GUIOuttextwin2 8,6,16,GUINetText1b - GUIOuttextwin2 8,6,26,GUINetText2b - GUIOuttextwin2 8,6,36,GUINetText3b - add byte[GUItextcolor],15 - GUIOuttextwin2 8,5,15,GUINetText1b - GUIOuttextwin2 8,5,25,GUINetText2b - GUIOuttextwin2 8,5,35,GUINetText3b - ret -%ifdef __MSDOS__ -DisplayNetOptnsModem: - mov dword[GUIEditStringcWin],0 - DrawGUIButton 8,5,15,89,26,GUINetTextG,21,0,0 - DrawGUIButton 8,5,30,89,41,GUINetTextH,22,0,0 - DrawGUIButton 8,5,45,89,56,GUINetTexth,23,0,0 - DrawGUIButton 8,5,60,89,71,GUINetTextI,24,0,0 - ret -DisplayNetOptnsModemConfig: - cmp byte[ModemInitStat],0 - je .nodeinitmodem -; call DeInitModem - mov byte[ModemInitStat],0 -.nodeinitmodem - DrawGUIWinBox 8,31,70,50,78,167 - DrawGUIWinBox 8,21,125,175,133,167 - DrawGUIWinBox 8,21,136,175,144,167 - mov byte[GUINetText8],'0' - mov al,[ComIRQ] - cmp byte[ComIRQ],10 - jb .no10 - mov byte[GUINetText8],'1' - sub al,10 -.no10 - add al,'0' - mov [GUINetText8+1],al - sub byte[GUItextcolor],15 - GUIOuttextwin2 8,21,28,GUINetText3 - GUIOuttextwin2 8,21,38,GUINetText4 - GUIOuttextwin2 8,21,48,GUINetText5 - GUIOuttextwin2 8,21,58,GUINetText6 - GUIOuttextwin2 8,6,73,GUINetText7 - GUIOuttextwin2 8,21,88,GUINetTextC - GUIOuttextwin2 8,21,98,GUINetTextD - GUIOuttextwin2 8,106,28,GUINetTextJ - GUIOuttextwin2 8,106,38,GUINetTextK - GUIOuttextwin2 8,106,48,GUINetTextL - GUIOuttextwin2 8,106,58,GUINetTextM - GUIOuttextwin2 8,106,68,GUINetTextN - GUIOuttextwin2 8,106,78,GUINetTextO - GUIOuttextwin2 8,106,88,GUINetTextP - GUIOuttextwin2 8,6,128,GUINetTexte - GUIOuttextwin2 8,6,139,GUINetTextf - GUIOuttextwin2 8,26,152,GUINetTextX - add byte[GUItextcolor],15 - GUIOuttextwin2 8,20,27,GUINetText3 - GUIOuttextwin2 8,20,37,GUINetText4 - GUIOuttextwin2 8,20,47,GUINetText5 - GUIOuttextwin2 8,20,57,GUINetText6 - GUIOuttextwin2 8,5,72,GUINetText7 - GUIOuttextwin2 8,20,87,GUINetTextC - GUIOuttextwin2 8,20,97,GUINetTextD - GUIOuttextwin2 8,105,27,GUINetTextJ - GUIOuttextwin2 8,105,37,GUINetTextK - GUIOuttextwin2 8,105,47,GUINetTextL - GUIOuttextwin2 8,105,57,GUINetTextM - GUIOuttextwin2 8,105,67,GUINetTextN - GUIOuttextwin2 8,105,77,GUINetTextO - GUIOuttextwin2 8,105,87,GUINetTextP - GUIOuttextwin2 8,5,127,GUINetTexte - GUIOuttextwin2 8,5,138,GUINetTextf - GUIOuttextwin2 8,25,151,GUINetTextX - DrawGUIButton 8,55,69,63,79,GUINetText9,25,-2,0 - DrawGUIButton 8,66,69,74,79,GUINetTextA,26,-2,0 - mov al,[GUIWincol] - mov byte[GUItextcolor],al - GUIOuttextwin2 8,6,16,GUINetTextR - GUIOuttextwin2 8,6,113,GUINetTextE - GUIOuttextwin2 8,91,16,GUINetTextQ - mov byte[GUItextcolor],163 - cmp byte[GUIWincoladd],0 - je .zero - mov byte[GUItextcolor],164 -.zero - GUIOuttextwin2 8,5,15,GUINetTextR - GUIOuttextwin2 8,5,112,GUINetTextE - GUIOuttextwin2 8,90,15,GUINetTextQ - mov byte[GUItextcolor],223 - GUIOuttextwin2 8,36,73,GUINetText8 - GUIOuttextwin2 8,25,128,GUIInitSt1 - GUIOuttextwin2 8,25,139,GUIInitSt2 - mov byte[GUItextcolor],221 - cmp byte[GUIWincoladd],0 - je .zero3 - mov byte[GUItextcolor],222 -.zero3 - GUIOuttextwin2 8,35,72,GUINetText8 - GUIOuttextwin2 8,24,127,GUIInitSt1 - GUIOuttextwin2 8,24,138,GUIInitSt2 - GUIDisplayButtonHole 8,9,25,byte[ComNum],1 - GUIDisplayButtonHole 8,9,35,byte[ComNum],2 - GUIDisplayButtonHole 8,9,45,byte[ComNum],3 - GUIDisplayButtonHole 8,9,55,byte[ComNum],4 - GUIDisplayButtonHole 8,94,25,byte[BaudRate],0 - GUIDisplayButtonHole 8,94,35,byte[BaudRate],1 - GUIDisplayButtonHole 8,94,45,byte[BaudRate],2 - GUIDisplayButtonHole 8,94,55,byte[BaudRate],3 - GUIDisplayButtonHole 8,94,65,byte[BaudRate],4 - GUIDisplayButtonHole 8,94,75,byte[BaudRate],5 - GUIDisplayButtonHole 8,94,85,byte[BaudRate],6 - GUIDisplayButtonHole 8,9,85,byte[GUIDialSt+3],'T' - GUIDisplayButtonHole 8,9,95,byte[GUIDialSt+3],'P' - mov dword[GUITemp],GUIIconDataCheckBoxUC - cmp byte[FossilUse],1 - jne .nocheckm - mov dword[GUITemp],GUIIconDataCheckBoxC -.nocheckm - GUIDisplayIconWin 8,12,147,[GUITemp] - ret -DisplayNetOptnsModemDial: - DrawGUIWinBox 8,5,25,175,33,167 - DrawGUIButton 8,141,38,175,49,GUINetTextT,28,0,0 - sub byte[GUItextcolor],15 - GUIOuttextwin2 8,6,14,GUINetTextF - add byte[GUItextcolor],15 - GUIOuttextwin2 8,5,13,GUINetTextF - mov byte[GUItextcolor],223 - GUIOuttextwin2 8,9,28,DialNumber - mov byte[GUItextcolor],221 - cmp byte[GUIWincoladd],0 - je .zero3 - mov byte[GUItextcolor],222 -.zero3 - GUIOuttextwin2 8,8,27,DialNumber - mov dword[GUIEditString],DialNumber - mov dword[GUIEditStringmLen],27 -; mov dword[GUIEditStringmLenM],27 - mov dword[GUIEditStringcWin],1 - ret -%endif -DisplayNetOptnsModemTerm: - DrawGUIWinBox 8,6,15,181,127,167 - ; draw borders - mov dl,[GUIWincol] - DrawGUIWinBox 8,6,14,181,14,dl - mov dl,[GUIWincol] - add dl,1 - DrawGUIWinBox 8,5,15,4,127,dl - mov dl,[GUIWincol] - add dl,4 - DrawGUIWinBox 8,6,128,181,128,dl - mov dl,[GUIWincol] - add dl,3 - DrawGUIWinBox 8,183,15,182,127,dl - - ; cancel button - DrawGUIButton 8,120,135,181,146,GUINetTextS,27,0,0 - ; draw text - mov dword[CurCStringPos],ViewBuffer+1 - mov ebx,[CViewLoc] - add dword[CurCStringPos],ebx - mov byte[GUItextcolor],223 - GUIOuttextwin2 8,9,28-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,36-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,44-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,52-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,60-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,68-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,76-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,84-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,92-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,100-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,108-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,116-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,124-5,[CurCStringPos] - add dword[CurCStringPos],32 - mov byte[GUItextcolor],221 - cmp byte[GUIWincoladd],0 - je .zero3 - mov byte[GUItextcolor],222 -.zero3 - mov dword[CurCStringPos],ViewBuffer+1 - mov ebx,[CViewLoc] - add dword[CurCStringPos],ebx - GUIOuttextwin2 8,8,27-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,35-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,43-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,51-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,59-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,67-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,75-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,83-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,91-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,99-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,107-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,115-5,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,123-5,[CurCStringPos] - add dword[CurCStringPos],32 - ret - -%macro NetChatWindowHelp 3 - mov dword[GUITemp],GUIIconDataCheckBoxUC - cmp byte[%3],1 - jne %%nocheck - mov dword[GUITemp],GUIIconDataCheckBoxC -%%nocheck - cmp byte[%3],2 - jne %%nocheckb - mov dword[GUITemp],GUIIconDataCheckBoxX -%%nocheckb - GUIDisplayIconWin 8,%1,%2,[GUITemp] -%endmacro - -DisplayNetOptnsChatWindow: - mov byte[GUINetText8],'0' - mov al,[Latency] - cmp byte[Latency],10 - jb .no10b - mov byte[GUINetText8],'1' - sub al,10 -.no10b - add al,'0' - mov [GUINetText8+1],al - - DrawGUIWinBox 8,55,157,74,165,167 - - GUIDisplayButtonHole 8,111,137,byte[UseRemoteSRAMData],0 - GUIDisplayButtonHole 8,111,147,byte[UseRemoteSRAMData],1 - GUIDisplayButtonHole 8,111,157,byte[UseRemoteSRAMData],2 - NetChatWindowHelp 7,135,pl1neten - NetChatWindowHelp 32,135,pl2neten - NetChatWindowHelp 57,135,pl3neten - NetChatWindowHelp 7,145,pl4neten - NetChatWindowHelp 32,145,pl5neten - NetChatWindowHelp 7,175,BackState - - sub byte[GUItextcolor],15 - GUIOuttextwin2 8,21,140,GUINetTextW - GUIOuttextwin2 8,46,140,GUINetTextW+2 - GUIOuttextwin2 8,71,140,GUINetTextW+4 - GUIOuttextwin2 8,21,150,GUINetTextW+6 - GUIOuttextwin2 8,46,150,GUINetTextW+8 - GUIOuttextwin2 8,10,160,GUINetTextY - GUIOuttextwin2 8,124,140,GUINetTextb - GUIOuttextwin2 8,124,150,GUINetTextc - GUIOuttextwin2 8,124,160,GUINetTextd - GUIOuttextwin2 8,21,180,GUINetTexto2 - add byte[GUItextcolor],15 - GUIOuttextwin2 8,20,139,GUINetTextW - GUIOuttextwin2 8,45,139,GUINetTextW+2 - GUIOuttextwin2 8,70,139,GUINetTextW+4 - GUIOuttextwin2 8,20,149,GUINetTextW+6 - GUIOuttextwin2 8,45,149,GUINetTextW+8 - GUIOuttextwin2 8,9,159,GUINetTextY - GUIOuttextwin2 8,123,139,GUINetTextb - GUIOuttextwin2 8,123,149,GUINetTextc - GUIOuttextwin2 8,123,159,GUINetTextd - GUIOuttextwin2 8,20,179,GUINetTexto2 - - DrawGUIWinBox 8,6,15,181,112,167 - ; draw borders - mov dl,[GUIWincol] - DrawGUIWinBox 8,6,14,181,14,dl - mov dl,[GUIWincol] - add dl,1 - DrawGUIWinBox 8,5,15,4,112,dl - mov dl,[GUIWincol] - add dl,4 - DrawGUIWinBox 8,6,113,181,113,dl - mov dl,[GUIWincol] - add dl,3 - DrawGUIWinBox 8,183,15,182,112,dl - DrawGUIWinBox 8,6,117,181,125,167 - ; disconnect button - DrawGUIButton 8,111,169,181,180,GUINetTextU,27,0,0 - - DrawGUIButton 8,79,156,87,166,GUINetText9,29,-2,0 - DrawGUIButton 8,90,156,98,166,GUINetTextA,30,-2,0 - - - mov byte[GUItextcolor],223 - mov dword[CurCStringPos],ViewBuffer+1 - mov ebx,[CViewLoc] - add dword[CurCStringPos],ebx - GUIOuttextwin2 8,9,36-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,44-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,52-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,60-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,68-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,76-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,84-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,92-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,100-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,108-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,116-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,9,124-18,[CurCStringPos] - mov byte[GUItextcolor],221 - cmp byte[GUIWincoladd],0 - je .zero3b - mov byte[GUItextcolor],222 -.zero3b - mov dword[CurCStringPos],ViewBuffer+1 - mov ebx,[CViewLoc] - add dword[CurCStringPos],ebx - GUIOuttextwin2 8,8,35-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,43-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,51-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,59-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,67-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,75-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,83-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,91-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,99-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,107-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,115-18,[CurCStringPos] - add dword[CurCStringPos],32 - GUIOuttextwin2 8,8,123-18,[CurCStringPos] - - ; Determine ChatString Position - push ecx - mov ebx,ChatString - mov ecx,[GUIEditStringcLen] - sub ecx,ebx - cmp ecx,26 - jb .nostring - cmp ecx,255 - ja .nostring - sub ecx,26 - add ebx,ecx -.nostring - mov [CurCStringPos],ebx - pop ecx - - mov byte[GUItextcolor],223 - GUIOuttextwin2 8,10,120,[CurCStringPos] - GUIOuttextwin2 8,60,160,GUINetText8 - mov byte[GUItextcolor],221 - cmp byte[GUIWincoladd],0 - je .zero3 - mov byte[GUItextcolor],222 -.zero3 - GUIOuttextwin2 8,9,119,[CurCStringPos] - GUIOuttextwin2 8,59,159,GUINetText8 - mov dword[GUIEditString],ChatString - mov dword[GUIEditStringmLen],200 -; mov dword[GUIEditStringmLenM],26 - mov dword[GUIEditStringcWin],1 - mov al,[GUIWincol] - mov byte[GUItextcolor],al - GUIOuttextwin2 8,7,131,GUINetTextV - GUIOuttextwin2 8,111,131,GUINetTexta - mov byte[GUItextcolor],163 - cmp byte[GUIWincoladd],0 - je .zero - mov byte[GUItextcolor],164 -.zero - GUIOuttextwin2 8,6,130,GUINetTextV - GUIOuttextwin2 8,110,130,GUINetTexta +DisplayNetOptns: ret SECTION .bss NEWSYM GUINCStA, resd 3 -NEWSYM CNetType, resb 1 -SECTION .data -NEWSYM Latency, db 2 -NEWSYM Latencytochange, db 2 -NEWSYM LatencyLeft, db 2 -SECTION .bss -NEWSYM NetSwap, resb 1 -RemCNetType resb 1 -NEWSYM UseRemoteSRAMData, resb 1 -ChatString resb 276 FileNameMod resb 512 CurCStringPos resd 1 -SECTION .data -%ifdef __MSDOS__ -GUINetText1 db 'IPX HAS NOT BEEN',0 -GUINetText2 db 'IMPLEMENTED YET',0 -%endif -GUINetText1b db 'PLEASE SET THE',0 -GUINetText2b db 'PERCENTAGE OF',0 -GUINetText3b db 'EXECUTION TO 100',0 -%ifdef __MSDOS__ -GUINetText1c db 'IPX IS IN BETA',0 -GUINetText2c db 'STAGES. IT MAY',0 -GUINetText3c db 'NOT WORK RIGHT!',0 -GUINetText3 db 'COM1 (3F8)',0 -GUINetText4 db 'COM2 (2F8)',0 -GUINetText5 db 'COM3 (3E8)',0 -GUINetText6 db 'COM4 (2E8)',0 -GUINetText7 db 'IRQ ',0 -%endif -GUINetText8 db '00',0 -GUINetText9 db '+',0 -GUINetTextA db '-',0 -%ifdef __MSDOS__ -GUINetTextC db 'TONE (ATDT)',0 -GUINetTextD db 'PULSE (ATDP)',0 -GUINetTextE db 'INIT STRINGS :',0 -GUINetTexte db '1.',0 -GUINetTextf db '2.',0 -GUINetTextF db 'ENTER NUMBER TO DIAL :',0 -GUINetTextG db 'DIAL NUMBER',0 -GUINetTextH db 'WAIT FOR RING',0 -GUINetTexth db 'CONFIG MODEM',0 -GUINetTextI db 'MANUAL',0 -GUINetTextJ db '9600',0 -GUINetTextK db '14400',0 -GUINetTextL db '19200',0 -GUINetTextM db '28800',0 -GUINetTextN db '38400',0 -GUINetTextO db '57600',0 -GUINetTextP db '115200',0 -GUINetTextQ db 'BAUDRATE (BPS) :',0 -GUINetTextR db 'COMPORT :',0 -%endif -GUINetTextS db 'CANCEL',0 -%ifdef __MSDOS__ -GUINetTextT db 'DIAL',0 -%endif -GUINetTextU db 'DISCONNECT',0 -GUINetTextV db 'PLAYER SELECT :',0 -GUINetTextW db '1',0,'2',0,'3',0,'4',0,'5',0 -%ifdef __MSDOS__ -GUINetTextX db 'USE FOSSIL DRIVER',0 -%endif -GUINetTextY db 'LATENCY',0 -GUINetTextZ db 'OKAY',0 -GUINetTexta db 'SAVE DATA :',0 -GUINetTextb db 'NONE',0 -GUINetTextc db 'LOCAL',0 -GUINetTextd db 'REMOTE',0 -GUINetTexte2 db 'YOUR IP:',0 -GUINetTextf2 db 'PORT',0 -GUINetTextf3 db 'NICKNAME',0 -GUINetTextg2 db 'START AS SERVER',0 -GUINetTexth2 db 'CLIENT OPTIONS:',0 -GUINetTexti2 db 'IP:',0 -GUINetTextj2 db 'CONNECT TO SERVER',0 -GUINetTextl2 db '7845',0,0,0 -GUINetTextm2 db 0,0,0 -GUINetTextn2 db '_',0 -GUINetTexto2 db 'BACK BUFFER',0 -GUINetTextp2 db 'USE UDP INSTEAD OF TCP',0 -GUINetTextr1 db 'PLEASE RESTART ZSNES',0 -GUINetTextr2 db 'BEFORE STARTING A NEW',0 -GUINetTextr3 db 'NETPLAY SESSION',0 - -%ifdef __MSDOS__ -BaudVal dd 9600,14400,19200,28800,38400,57600,115200 -%endif - SECTION .text DisplayGameOptns: diff --git a/zsnes/src/init.asm b/zsnes/src/init.asm index b265fcf0..53896b8e 100644 --- a/zsnes/src/init.asm +++ b/zsnes/src/init.asm @@ -26,7 +26,7 @@ EXTSYM showinfogui EXTSYM filefound,inittable,SA1inittable EXTSYM MessageOn,Msgptr,MsgCount,sndrot,SnowTimer EXTSYM inittableb,inittablec,newgfx16b,cfgreinittime -EXTSYM Open_File,Read_File,Write_File,Close_File,Output_Text,Get_Key,CNetType +EXTSYM Open_File,Read_File,Write_File,Close_File,Output_Text,Get_Key EXTSYM Delete_File,Get_First_Entry,Get_Next_Entry,Change_Dir,InitDSP EXTSYM Remove_Dir,Change_Single_Dir,Create_Dir,Get_Memfree,Create_File EXTSYM SPCDisable,osm2dis,CurRecv,BackupSystemVars @@ -34,7 +34,6 @@ EXTSYM SnowData,SnowVelDist EXTSYM cvidmode,newengen,cfgnewgfx,GUI16VID,NewEngEnForce EXTSYM PrintChar,TextFile EXTSYM Setper2exec,per2exec -EXTSYM chaton EXTSYM JoyRead,JoyReadControl,joy4218,joy4219,joy421A,joy421B,pressed EXTSYM pl3Ak,pl3Bk,pl3Lk,pl3Rk,pl3Xk,pl1p209,pl2p209,pl3p209,pl4p209 EXTSYM pl3Yk,pl3contrl,pl3downk,pl3leftk,pl3rightk,pl3selk,pl3startk @@ -50,7 +49,7 @@ EXTSYM pl1ULk,pl1URk,pl1DLk,pl1DRk,pl2ULk,pl2URk,pl2DLk,pl2DRk EXTSYM pl3ULk,pl3URk,pl3DLk,pl3DRk,pl4ULk,pl4URk,pl4DLk,pl4DRk EXTSYM pl5ULk,pl5URk,pl5DLk,pl5DRk,pl5Xtk,pl5Ytk,pl5Atk,pl5Btk EXTSYM pl1Ltk,pl1Rtk,pl2Ltk,pl2Rtk,pl3Ltk,pl3Rtk,pl4Ltk,pl4Rtk,pl5Ltk,pl5Rtk -EXTSYM Turbo30hz,nojoystickpoll +EXTSYM Turbo30hz EXTSYM NumComboLocl,ComboBlHeader,ComboHeader,CombinDataLocl EXTSYM CombinDataGlob,NumCombo,GUIComboGameSpec EXTSYM mousexloc,mouseyloc @@ -527,11 +526,6 @@ SECTION .text %macro PlayerDeviceHelp 3 mov eax,[%1] - cmp byte[chaton],0 - je %%okay - cmp eax,40h - jb %%no -%%okay cmp byte[pressed+eax],1 jne %%no or dword[%2],%3 @@ -568,8 +562,6 @@ SECTION .text %macro ProcessKeyComb 2 cmp dword[NumCombo],0 je near %%nocomb - cmp byte[CNetType],20 - je near %%nocomb mov eax,CombinDataGlob cmp byte[GUIComboGameSpec],0 je %%local @@ -751,9 +743,7 @@ NEWSYM ReadInputDevice mov byte[TurboCB],02h .noturbo30 ; Read External Devices (Joystick, PPort, etc.) - mov byte[nojoystickpoll],1 call JoyRead - mov byte[nojoystickpoll],0 ; Process Data mov dword[JoyAOrig],0 ; Get Player1 input device diff --git a/zsnes/src/linux/sdlintrf.asm b/zsnes/src/linux/sdlintrf.asm index 031394f5..808ec5a1 100644 --- a/zsnes/src/linux/sdlintrf.asm +++ b/zsnes/src/linux/sdlintrf.asm @@ -1453,7 +1453,7 @@ NEWSYM TCPIPStartServer mov byte[TCPIPStatus],1 ; StartServer(unsigned short port) xor eax,eax - mov ax,[TCPIPPortNum] +; mov ax,[TCPIPPortNum] push eax call StartServerCycle add esp,4 @@ -1499,7 +1499,7 @@ NEWSYM TCPIPInitConnectToServer jnz .failed mov byte[TCPIPStatus],1 ; Convert TCPIPAddress to IPAddrStr - mov ebx,TCPIPAddress +; mov ebx,TCPIPAddress mov edx,IPAddrStr .notend mov al,[ebx] @@ -1523,7 +1523,7 @@ NEWSYM TCPIPConnectToServer ; int ConnectServer(char *servername, unsigned short port) pushad xor eax,eax - mov ax,[TCPIPPortNum] +; mov ax,[TCPIPPortNum] push eax mov eax,IPAddrStr push eax diff --git a/zsnes/src/makefile.ms b/zsnes/src/makefile.ms index 080f20a0..318c753e 100644 --- a/zsnes/src/makefile.ms +++ b/zsnes/src/makefile.ms @@ -43,7 +43,6 @@ GUIDIR=gui VIDEODIR=video WINDIR=win NETDIR=net -OBJDIR=obj ZIPDIR=zip EFFECTSDIR=effects JMADIR=jma @@ -175,9 +174,6 @@ WINOBJ=${WINDIR}/copyvwin${OE} ${DRESOBJ}\ NETOBJ=${NETDIR}/ztcp${OE} -#only used on DOS -PREOBJ=${OBJDIR}/dosbuff.o ${OBJDIR}/ipx.o ${OBJDIR}/zipx.o - ZIPOBJ=${ZIPDIR}/unzip${OE} ${ZIPDIR}/zpng${OE} EFFECTSOBJ=${EFFECTSDIR}/burn${OE} ${EFFECTSDIR}/water${OE} ${EFFECTSDIR}/smoke${OE} @@ -198,7 +194,7 @@ OBJSORIG=${CHIPSOBJ} ${CPUOBJ} ${GUIOBJ} ${VIDEOBJ} ${MAINOBJ} ${ZIPOBJ} ${EFFEC ifeq (${OS},__MSDOS__) DOSOBJ=${DOSOBJORIG} ${DOSDIR}/dosintrf${OE} ${DOSDIR}/sound${OE} ${DOSDIR}/zfile${OE} -OBJS=${OBJSORIG} ${DOSOBJ} ${PREOBJ} +OBJS=${OBJSORIG} ${DOSOBJ} DELETEOBJS=${OBJSORIG} ${DOSOBJ} endif @@ -383,6 +379,7 @@ clean: ${DELETECOMMAND} ${DOSDIR}${SLASH}*${OE} ${TRUTH} ${DELETECOMMAND} ${WINDIR}${SLASH}*${OE} ${TRUTH} ${DELETECOMMAND} ${GUIDIR}${SLASH}*${OE} ${TRUTH} + ${DELETECOMMAND} ${NETDIR}${SLASH}*${OE} ${TRUTH} else #else no ENV specified help: diff --git a/zsnes/src/obj/dosbuff.o b/zsnes/src/obj/dosbuff.o deleted file mode 100644 index 242f4e1a..00000000 Binary files a/zsnes/src/obj/dosbuff.o and /dev/null differ diff --git a/zsnes/src/obj/ipx.o b/zsnes/src/obj/ipx.o deleted file mode 100644 index b2ee8218..00000000 Binary files a/zsnes/src/obj/ipx.o and /dev/null differ diff --git a/zsnes/src/obj/zipx.o b/zsnes/src/obj/zipx.o deleted file mode 100644 index 6f1eccb7..00000000 Binary files a/zsnes/src/obj/zipx.o and /dev/null differ diff --git a/zsnes/src/vcache.asm b/zsnes/src/vcache.asm index 7d64f7dd..44469b97 100644 --- a/zsnes/src/vcache.asm +++ b/zsnes/src/vcache.asm @@ -43,10 +43,7 @@ EXTSYM WindowDisables,scanlines,romispal EXTSYM MusicRelVol,MusicVol,WDSPReg0C,WDSPReg1C EXTSYM DSPOp02,Op02AAS,Op02AZS,Op02CX,Op02CY,Op02FX,Op02FY EXTSYM Op02FZ,Op02LES,Op02LFE,Op02VOF,Op02VVA -EXTSYM CurRecv -EXTSYM CNetType EXTSYM KeySlowDown -EXTSYM chaton EXTSYM genfulladdtab EXTSYM KeyFRateDown,KeyFRateUp,KeyVolUp,KeyVolDown,KeyDisplayFPS,FPSOn,pl12s34 EXTSYM bg1ptr,bg2ptr,bg3ptr,bg4ptr,cachebg1,resolutn @@ -270,9 +267,6 @@ NEWSYM cachevideo dec dword[WindowDisables] .nowindis - cmp byte[CurRecv],1 - je near .fskipall - call ClockCounter cmp byte[mode7hiresen],0 @@ -317,9 +311,6 @@ NEWSYM cachevideo mov dword[sramb4save],0 .nofocussave - cmp byte[CNetType],20 - je near .sdskip - cmp byte[FastFwdToggle],0 jne .ffmode2 mov eax,[KeyFastFrwrd] @@ -404,7 +395,6 @@ NEWSYM cachevideo cmp byte[frskipper],bl pop ebx jae .nofrskip -.fskipall mov byte[curblank],40h mov al,40h jmp .frskip @@ -438,8 +428,6 @@ NEWSYM cachevideo shl al,cl mov [cachedmode],al ; disable all necessary backgrounds - cmp byte[chaton],1 - je near .finishchatskip mov eax,[KeyBGDisble0] test byte[pressed+eax],1 je .nodis1 @@ -556,13 +544,6 @@ NEWSYM cachevideo mov [MessageOn],eax call Get_MousePositionDisplacement .nodis7 - cmp byte[CNetType],20 - jne .nonet - cmp byte[snesmouse],0 - je .nonet - mov byte[snesmouse],0 - mov dword[MessageOn],0 -.nonet mov eax,[KeyNewGfxSwt] test byte[pressed+eax],1 je near .nodis8 @@ -813,7 +794,6 @@ NEWSYM cachevideo soundselcomp KeyDisableSC6,Voice6Disable,Voice6Status,'7' soundselcomp KeyDisableSC7,Voice7Disable,Voice7Status,'8' -.finishchatskip cmp byte[curblank],0h jne near yesblank ; Swap video addresses diff --git a/zsnes/src/video/procvid.asm b/zsnes/src/video/procvid.asm index 470516c4..03231bf5 100644 --- a/zsnes/src/video/procvid.asm +++ b/zsnes/src/video/procvid.asm @@ -50,11 +50,9 @@ EXTSYM objptrn,nglogicval,bgtilesz,C4values EXTSYM curexecstate,TempVidInfo,LatestBank,C4ObjSelec EXTSYM BGMS1,scadsng,winenabm,winenabs,vidbright EXTSYM genfulladdtab,genfulladdtabng -EXTSYM KeyQuickChat,CNetType,WritetochatBuffer,NetAddChar,TimerEnable,ShowTimer +EXTSYM TimerEnable,ShowTimer EXTSYM ClearScreenSkip,debugdisble,cmovietimeint -EXTSYM ChatNick EXTSYM StringLength -EXTSYM chatstrLt EXTSYM GUIOn,FilteredGUI,HalfTrans EXTSYM SmallMsgText EXTSYM ClearScreen @@ -63,7 +61,7 @@ EXTSYM GUICPC, newgfx16b EXTSYM vesa2_clbitng,vesa2_clbitng2,vesa2_clbitng3 EXTSYM granadd,CSStatus,CSStatus2,CSStatus3 EXTSYM SpecialLine -EXTSYM Clear2xSaIBuffer +EXTSYM Clear2xSaIBuffer,vidbufferofsb ;EXTSYM Super2xSaI EXTSYM HalfTransB,HalfTransC @@ -3211,291 +3209,12 @@ NEWSYM waitvsync SECTION .data NEWSYM prevengval, db 10 -SECTION .bss -NEWSYM chaton, resb 1 -NEWSYM chatstrL, resb 140 -NEWSYM chatLpos, resd 1 -NEWSYM chatstrR, resb 140 -NEWSYM chatstrR2, resb 140 -NEWSYM chatstrR3, resb 140 -NEWSYM chatstrR4, resb 140 -NEWSYM chatstrR5, resb 140 -NEWSYM chatRTL, resd 1 -NEWSYM chatRTL2, resd 1 -NEWSYM chatRTL3, resd 1 -NEWSYM chatRTL4, resd 1 -NEWSYM chatRTL5, resd 1 -NEWSYM chatTL, resd 1 - -SECTION .data -NEWSYM chatreqtable - db 0 ,2 ,'1','2','3','4','5','6','7','8','9','0','-','=',8 ,0 - db 'Q','W','E','R','T','Y','U','I','O','P','[',']',13 ,0 ,'A','S' - db 'D','F','G','H','J','K','L',';',27h,'`',1 ,'\','Z','X','C','V' - db 'B','N','M',',','.','/',1 ,0 ,0 ,' ',0 ,0 ,0 ,0 ,0 ,0 - ; Shift Key Presses - db 0 ,2 ,'!','@','#','$','%','^','&','*','(',')','_','+',8 ,0 - db 'Q','W','E','R','T','Y','U','I','O','P','{','}',13 ,0 ,'A','S' - db 'D','F','G','H','J','K','L',':','"','~',1 ,'|','Z','X','C','V' - db 'B','N','M','<','>','?',1 ,0 ,0 ,' ',0 ,0 ,0 ,0 ,0 ,0 SECTION .text -; Letters transferred & string cleared when chatstrL[0]!=0 and chaton=0 -; Disable all transfers when chaton=1 (except joysticks and upper keyboard -; in input devices) - -NEWSYM ChatType2 - jmp ChatType.skipchatdisp -NEWSYM ChatType - cmp dword[chatTL],0 - jne near .chatdisplayed - cmp byte[chatstrL],0 - jne near .processchat - jmp .skipchatdisp -.chatdisplayed - dec dword[chatTL] - cmp dword[chatTL],0 - jne .skipchatdisp - mov dword[chatstrL],0 -.skipchatdisp - - mov eax,[KeyQuickChat] - cmp byte[chaton],0 - jne .nosendchats - cmp byte[chatstrL],0 - je .nosendchats - cmp dword[chatTL],0 - jne .nosendchats - mov byte[pressed+eax],0 -.nosendchats - - cmp byte[pressed+eax],1 - jne .noqchat - - mov dword[chatTL],0 - mov byte[pressed+eax],2 - mov byte[chaton],1 - mov dword[chatLpos],0 - mov byte[chatstrL],'>' - mov byte[chatstrL+1],'_' - mov byte[chatstrL+2],0 -.noqchat - jmp .skipall -.processchat - cmp byte[chaton],0 - je near .skipall - mov eax,63 -.notof - cmp byte[chatreqtable+eax],1 - jbe near .skipthis - cmp byte[pressed+eax],1 - jne near .skipthis - mov byte[pressed+eax],2 - push eax - cmp byte[pressed+42],1 - je .shift - cmp byte[pressed+54],1 - je .shift - mov al,[chatreqtable+eax] - jmp .noshift -.shift - mov al,[chatreqtable+eax+64] -.noshift - cmp al,8 - je .delete - cmp al,13 - je .enter - cmp al,2 - je near .cancel - cmp dword[chatLpos],32+30 - jae near .skipoutput - mov ebx,[chatLpos] - mov [chatstrL+ebx+1],al - mov byte[chatstrL+ebx+2],'_' - mov byte[chatstrL+ebx+3],0 - inc dword[chatLpos] - jmp .skipoutput -.delete - mov byte[pressed+0Eh],2 - cmp dword[chatLpos],0 - je near .skipoutput - dec dword[chatLpos] - mov ebx,[chatLpos] - mov byte[chatstrL+ebx+1],'_' - mov byte[chatstrL+ebx+2],0 - jmp .skipoutput -.enter - mov byte[pressed+1Ch],2 - mov byte[chaton],0 - cmp dword[chatLpos],0 - jne .noskipoutput - mov byte[chatstrL],0 - jmp .skipoutput -.noskipoutput - mov ebx,[chatLpos] - mov byte[chatstrL+ebx+1],0 - pushad - mov dl,'L' -%ifndef __MSDOS__ - cmp dword[chatstrL+1],'/ME ' - je .action -%endif -;.dos - mov esi,ChatNick - call WritetochatBuffer - mov esi,chatstrL - call WritetochatBuffer - jmp .noaction -.action - mov dl,'*' - call NetAddChar - mov esi,ChatNick - call WritetochatBuffer - mov dl,' ' - call NetAddChar - mov esi,chatstrL+5 - call WritetochatBuffer -.noaction - mov dl,13 - call NetAddChar - mov dl,10 - call NetAddChar - popad - jmp .skipoutput -.cancel - mov byte[chatstrL],0 - mov byte[chaton],0 - mov byte[pressed+1],2 -.skipoutput - pop eax -.skipthis - dec eax - jns near .notof -.skipall - ret - -%macro RemoteStringPrint 1 - cmp byte[%1],0 - je %%nostringremote - mov edi,%1 - mov esi,[vidbuffer] - cmp byte[cbitmode],1 - je %%do16b3 - mov byte[ngfont],1 - add esi,194*288+20 - add esi,[.sdrawptr] - cmp byte[%1],' ' - jne %%nospace - inc edi - add esi,6 -%%nospace - add dword[.sdrawptr],288*6 - call OutputGraphicString5x5.no16bit - jmp %%nostringremote -%%do16b3 - add esi,194*288*2+20*2 - add esi,[.sdrawptr] - cmp byte[%1],' ' - jne %%nospaceb - inc edi - add esi,6 -%%nospaceb - add dword[.sdrawptr],288*6*2 - call OutputGraphicString16b5x52 -%%nostringremote -%endmacro - - NEWSYM copyvid - cmp byte[CNetType],20 - jne .nonet - call ChatType -.nonet mov byte[ngfont],0 - cmp byte[chatstrL],0 - je .nostringlocal - mov eax,chatstrL - call StringLength - sub ecx,42 - cmp ecx,0 - jge .notover - xor ecx,ecx -.notover - mov edi,chatstrL - add edi,ecx - mov esi,[vidbuffer] - cmp byte[cbitmode],1 - je .do16b2 -.no16b2 - mov byte[ngfont],1 - add esi,188*288+20 - call OutputGraphicString5x5.no16bit - jmp .nostringlocal -.do16b2 - add esi,188*288*2+20*2 - call OutputGraphicString16b5x52 -.nostringlocal - - cmp byte[chatstrLt],0 - je .nostringtemp - mov edi,chatstrLt - mov esi,[vidbuffer] - cmp byte[cbitmode],1 - je .do16b2temp -.no16b2temp - mov byte[ngfont],1 - add esi,182*288+20 - call OutputGraphicString5x5.no16bit - jmp .nostringtemp -.do16b2temp - add esi,182*288*2+20*2 - call OutputGraphicString16b5x52 -.nostringtemp - mov dword[.sdrawptr],0 - RemoteStringPrint chatstrR5 - RemoteStringPrint chatstrR4 - RemoteStringPrint chatstrR3 - RemoteStringPrint chatstrR2 - RemoteStringPrint chatstrR - - cmp dword[chatRTL],0 - je .nortl - dec dword[chatRTL] - cmp dword[chatRTL],0 - jne .nortl - mov dword[chatstrR],0 -.nortl - cmp dword[chatRTL2],0 - je .nortl2 - dec dword[chatRTL2] - cmp dword[chatRTL2],0 - jne .nortl2 - mov dword[chatstrR2],0 -.nortl2 - cmp dword[chatRTL3],0 - je .nortl3 - dec dword[chatRTL3] - cmp dword[chatRTL3],0 - jne .nortl3 - mov dword[chatstrR3],0 -.nortl3 - cmp dword[chatRTL4],0 - je .nortl4 - dec dword[chatRTL4] - cmp dword[chatRTL4],0 - jne .nortl4 - mov dword[chatstrR4],0 -.nortl4 - cmp dword[chatRTL5],0 - je .nortl5 - dec dword[chatRTL5] - cmp dword[chatRTL5],0 - jne .nortl5 - mov dword[chatstrR5],0 -.nortl5 - ; Test if add table needs updating cmp byte[cbitmode],0 je .notatud diff --git a/zsnes/src/win/winintrf.asm b/zsnes/src/win/winintrf.asm index aa3a3e06..bc5c83bb 100644 --- a/zsnes/src/win/winintrf.asm +++ b/zsnes/src/win/winintrf.asm @@ -1757,7 +1757,7 @@ NEWSYM TCPIPStartServer mov byte[TCPIPStatus],1 ; StartServer(unsigned short port) xor eax,eax - mov ax,[TCPIPPortNum] +; mov ax,[TCPIPPortNum] push eax call StartServerCycle add esp,4 @@ -1803,7 +1803,7 @@ NEWSYM TCPIPInitConnectToServer jnz .failed mov byte[TCPIPStatus],1 ; Convert TCPIPAddress to IPAddrStr - mov ebx,TCPIPAddress +; mov ebx,TCPIPAddress mov edx,IPAddrStr .notend mov al,[ebx] @@ -1827,7 +1827,7 @@ NEWSYM TCPIPConnectToServer ; int ConnectServer(char *servername, unsigned short port) pushad xor eax,eax - mov ax,[TCPIPPortNum] +; mov ax,[TCPIPPortNum] push eax mov eax,IPAddrStr push eax diff --git a/zsnes/src/zloader.c b/zsnes/src/zloader.c index 3f222cf1..cf9cd832 100644 --- a/zsnes/src/zloader.c +++ b/zsnes/src/zloader.c @@ -218,27 +218,16 @@ static void handle_params(int argc, char *argv[]) int i; #ifndef __MSDOS__ - NetServer=0; - NetChatFirst=0; - NetQuitAfter=0; if (argc >= 5 && argv[1][0] == '/' && strlen(argv[1]) == 6) { size_t i = 0, j = 0; - char *strp, *p; + char *strp; if (toupper(argv[1][1]) == 'T') UDPConfig=0; - if (toupper(argv[1][2]) == 'S') NetServer=1; - if (toupper(argv[1][2]) == 'C') NetServer=2; - if (toupper(argv[1][3]) == 'C') NetChatFirst=0; - if (toupper(argv[1][3]) == 'L') NetChatFirst=1; - if (toupper(argv[1][4]) == 'N') NetQuitAfter=0; - if (toupper(argv[1][4]) == 'Q') NetQuitAfter=1; + //Next should be # of connections - - strp = &NetNewNick; - while (argv[2][i]!=0) { switch (argv[2][i]) @@ -273,26 +262,6 @@ static void handle_params(int argc, char *argv[]) } strp[j] = 0; - strncpy(NetFilename, argv[3], 512); - NetFilename[511] = 0; - if (NetServer == 2) - { - if (argc < 5) - { - NetServer = 0; - } - else - { - CmdLineNetPlay = 1; - strp = &CmdLineTCPIPAddress; - strncpy(strp, argv[4], 28); - } - } - - for (p = NetFilename+strlen(NetFilename)-1; (p > (char *)NetFilename) && (*p != DIR_SLASH); p--); - *p = 0; - chdir(NetFilename); - *p = DIR_SLASH; } #endif diff --git a/zsnes/src/zstate.c b/zsnes/src/zstate.c index e6ebefd9..fb01264f 100755 --- a/zsnes/src/zstate.c +++ b/zsnes/src/zstate.c @@ -785,10 +785,3 @@ void loadstate2() { stateloader(fnamest+1, 0, 1); } - -extern unsigned char Netfname[11]; - -void loadstate3() -{ - stateloader(Netfname, 0, 1); -}