From c515f088ae213ff6585639752865d69e10a74c09 Mon Sep 17 00:00:00 2001 From: pagefault <> Date: Sun, 23 Dec 2001 01:48:31 +0000 Subject: [PATCH] Lots of changes, moved some code around --- zsnes/src/gui/gui.asm | 17 +++++++++++++++++ zsnes/src/init.asm | 12 ------------ zsnes/src/ui.asm | 20 -------------------- zsnes/src/win/winlink.cpp | 8 ++++++++ 4 files changed, 25 insertions(+), 32 deletions(-) diff --git a/zsnes/src/gui/gui.asm b/zsnes/src/gui/gui.asm index 3b95a3a8..6eb3ff64 100644 --- a/zsnes/src/gui/gui.asm +++ b/zsnes/src/gui/gui.asm @@ -913,6 +913,9 @@ CalcChecksum: or bl,80h ret +NEWSYM CmdLineNetPlay, db 0 +NEWSYM CmdLineTCPIPAddress, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + NEWSYM GUIRestoreVars mov edx,GUIFName call Open_File @@ -927,6 +930,20 @@ 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 diff --git a/zsnes/src/init.asm b/zsnes/src/init.asm index 3c40e79d..720d59a1 100644 --- a/zsnes/src/init.asm +++ b/zsnes/src/init.asm @@ -1656,18 +1656,6 @@ NEWSYM headerhack mov byte[opexec358cph],47 .notclocktower - mov esi,[romdata] - add esi,07FC0h - cmp dword[esi],'EQUI' - jne .notequinox - cmp dword[esi+4],'NOX ' - jne .notequinox - mov byte[opexec268],243 - mov byte[opexec358],234 - mov byte[opexec268cph],58 - mov byte[opexec358cph],58 -.notequinox - mov esi,[romdata] add esi,07FC0h cmp dword[esi],'DRAG' diff --git a/zsnes/src/ui.asm b/zsnes/src/ui.asm index 013c7977..54bd33a2 100644 --- a/zsnes/src/ui.asm +++ b/zsnes/src/ui.asm @@ -55,11 +55,6 @@ NEWSYM UIAsmStart ; Search for CMDLINE= for commandline entry - -NEWSYM CmdLineNetPlay, db 0 -NEWSYM CmdLineTCPIPAddress, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -EXTSYM TCPIPAddress - SECTION .text NEWSYM zstart @@ -75,21 +70,6 @@ NEWSYM zstart cld ;clear direction flag - 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 - %ifndef __MSDOS__ cmp byte[FirstTimeData],1 je .nofirsttime diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index 79c98bd4..5c8216b6 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -1255,6 +1255,7 @@ int InitDirectDraw() if (pDirectDrawCreateEx(NULL, (void **)&lpDD, IID_IDirectDraw7, NULL) != DD_OK) { MessageBox(NULL, "DirectDrawCreateEx failed.", "DirectDraw Error", MB_ICONERROR); + return FALSE; } if (FullScreen == 1) @@ -1262,10 +1263,12 @@ int InitDirectDraw() if (lpDD->SetCooperativeLevel(hMainWindow, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE | DDSCL_ALLOWREBOOT) != DD_OK) { MessageBox(NULL, "IDirectDraw7::SetCooperativeLevel failed.", "DirectDraw Error", MB_ICONERROR); + return FALSE; } if (lpDD->SetDisplayMode(WindowWidth, WindowHeight, 16, 0, 0) != DD_OK) { MessageBox(NULL, "IDirectDraw7::SetDisplayMode failed.\nMake sure your video card supports this mode.", "DirectDraw Error", MB_ICONERROR); + return FALSE; } } else @@ -1273,6 +1276,7 @@ int InitDirectDraw() if (lpDD->SetCooperativeLevel(hMainWindow, DDSCL_NORMAL) != DD_OK) { MessageBox(NULL, "IDirectDraw7::SetCooperativeLevel failed.", "DirectDraw Error", MB_ICONERROR); + return FALSE; } CheckAlwaysOnTop(); } @@ -1292,6 +1296,7 @@ int InitDirectDraw() if (lpDD->CreateSurface(&ddsd2, &DD_Primary, NULL) != DD_OK) { MessageBox(NULL, "IDirectDraw7::CreateSurface failed.", "DirectDraw Error", MB_ICONERROR); + return FALSE; } if (FullScreen == 1) @@ -1300,6 +1305,7 @@ int InitDirectDraw() if (DD_Primary->GetAttachedSurface(&ddsd2.ddsCaps, &DD_BackBuffer) != DD_OK) { MessageBox(NULL, "IDirectDrawSurface7::GetAttachedSurface failed.", "DirectDraw Error", MB_ICONERROR); + return FALSE; } } else @@ -1329,6 +1335,7 @@ int InitDirectDraw() if (DD_Primary->GetPixelFormat(&format) != DD_OK) { MessageBox(NULL, "IDirectDrawSurface7::GetPixelFormat failed.", "DirectDraw Error", MB_ICONERROR); + return FALSE; } BitDepth=format.dwRGBBitCount; @@ -1352,6 +1359,7 @@ int InitDirectDraw() if (lpDD->CreateSurface(&ddsd2, &DD_CFB, NULL) != DD_OK) { MessageBox(NULL, "IDirectDraw7::CreateSurface failed.", "DirectDraw Error", MB_ICONERROR); + return FALSE; } return TRUE;