Publish VCC Plus OSS source distribution for 3.6.2 build 60
This commit is contained in:
commit
c652a5276d
1192 files changed
+272368
No files matched your search
@@ -0,0 +1,686 @@
|
||||
//#define USE_LOGGING
|
||||
//======================================================================
|
||||
// This file is part of VCC (Virtual Color Computer).
|
||||
// Vcc is Copyright 2015 by Joseph Forgione
|
||||
//
|
||||
// VCC (Virtual Color Computer) is free software, you can redistribute
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// VCC (Virtual Color Computer) is distributed in the hope that it will
|
||||
// be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with VCC (Virtual Color Computer). If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
//======================================================================
|
||||
|
||||
#define _WINSOCK_DEPRECATED_NO_WARNINGS
|
||||
|
||||
#include <WinSock2.h>
|
||||
#include <Windows.h>
|
||||
#include <process.h>
|
||||
#include <stdio.h>
|
||||
#include "becker.h"
|
||||
#include "resource.h"
|
||||
#include <vcc/bus/cpak_cartridge_definitions.h>
|
||||
#include <vcc/util/limits.h>
|
||||
#include <vcc/util/logger.h>
|
||||
#include <vcc/util/FileOps.h>
|
||||
#include <vcc/util/DialogOps.h>
|
||||
#include <vcc/bus/cartridge_menu.h>
|
||||
#include <vcc/util/settings.h>
|
||||
|
||||
// socket
|
||||
static SOCKET dwSocket = 0;
|
||||
|
||||
// vcc stuff
|
||||
static HINSTANCE gModuleInstance;
|
||||
slot_id_type gSlotId {};
|
||||
static PakAssertCartridgeLineHostCallback PakSetCart = nullptr;
|
||||
LRESULT CALLBACK Config(HWND, UINT, WPARAM, LPARAM);
|
||||
static unsigned char HDBRom[8192];
|
||||
static bool DWTCPEnabled = false;
|
||||
|
||||
static HWND g_hConfigDlg;
|
||||
|
||||
// are we retrying tcp conn
|
||||
static bool retry = false;
|
||||
|
||||
// circular buffer for socket io
|
||||
static char InBuffer[BUFFER_SIZE];
|
||||
static int InReadPos = 0;
|
||||
static int InWritePos = 0;
|
||||
|
||||
// statistics
|
||||
static int BytesWrittenSince = 0;
|
||||
static int BytesReadSince = 0;
|
||||
static DWORD LastStats;
|
||||
static float ReadSpeed = 0;
|
||||
static float WriteSpeed = 0;
|
||||
|
||||
// hostname and port
|
||||
|
||||
static char dwaddress[MAX_PATH];
|
||||
static unsigned short dwsport = 65504;
|
||||
static char curaddress[MAX_PATH];
|
||||
static unsigned short curport = 65504;
|
||||
|
||||
//thread handle
|
||||
static HANDLE hDWTCPThread;
|
||||
|
||||
// scratchpad for msgs
|
||||
char msg[MAX_PATH];
|
||||
|
||||
// log lots of stuff...
|
||||
static boolean logging = false;
|
||||
|
||||
//unsigned char LoadExtRom(const char *);
|
||||
void SetDWTCPConnectionEnable(unsigned int enable);
|
||||
int dw_setaddr(const char *bufdwaddr);
|
||||
int dw_setport(const char *bufdwport);
|
||||
void LoadConfig();
|
||||
void SaveConfig();
|
||||
|
||||
static VCC::Bus::cartridge_menu BeckerMenu {};
|
||||
bool get_menu_item(menu_item_entry* item, size_t index);
|
||||
|
||||
// Access the settings object
|
||||
static VCC::Util::settings* gpSettings = nullptr;
|
||||
VCC::Util::settings& Setting() {return *gpSettings;}
|
||||
|
||||
// dll entry hook
|
||||
BOOL APIENTRY DllMain( HINSTANCE hinstDLL,
|
||||
DWORD reason,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
switch (reason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
// init
|
||||
gModuleInstance = hinstDLL;
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
// Clean up here
|
||||
CloseCartDialog(g_hConfigDlg);
|
||||
break;
|
||||
|
||||
// not used by Vcc
|
||||
case DLL_THREAD_ATTACH:
|
||||
case DLL_THREAD_DETACH:
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// coco checks for data
|
||||
unsigned char dw_status( void )
|
||||
{
|
||||
// check for input data waiting
|
||||
|
||||
if (retry | (dwSocket == 0) | (InReadPos == InWritePos))
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
// coco reads a byte
|
||||
unsigned char dw_read( void )
|
||||
{
|
||||
// increment buffer read pos, return next byte
|
||||
unsigned char dwdata = InBuffer[InReadPos];
|
||||
|
||||
InReadPos++;
|
||||
|
||||
if (InReadPos == BUFFER_SIZE)
|
||||
InReadPos = 0;
|
||||
|
||||
BytesReadSince++;
|
||||
|
||||
return dwdata;
|
||||
}
|
||||
|
||||
|
||||
// coco writes a byte
|
||||
int dw_write( char dwdata)
|
||||
{
|
||||
|
||||
// send the byte if we're connected
|
||||
if ((dwSocket != 0) & (!retry))
|
||||
{
|
||||
int res = send(dwSocket, &dwdata, 1, 0);
|
||||
if (res != 1)
|
||||
{
|
||||
DLOG_C("dw_write: socket error %d\n", WSAGetLastError());
|
||||
closesocket(dwSocket);
|
||||
dwSocket = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
BytesWrittenSince++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DLOG_C("coco write but null socket error\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void killDWTCPThread()
|
||||
{
|
||||
|
||||
// close socket to cause io thread to die
|
||||
if (dwSocket != 0)
|
||||
closesocket(dwSocket);
|
||||
|
||||
dwSocket = 0;
|
||||
|
||||
// reset buffer po
|
||||
InReadPos = 0;
|
||||
InWritePos = 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// set our hostname, called from config.c
|
||||
int dw_setaddr(const char *bufdwaddr)
|
||||
{
|
||||
strcpy(dwaddress,bufdwaddr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// set our port, called from config.c
|
||||
int dw_setport(const char *bufdwport)
|
||||
{
|
||||
dwsport = (unsigned short)atoi(bufdwport);
|
||||
|
||||
if ((dwsport != curport) || (strcmp(dwaddress,curaddress) != 0))
|
||||
{
|
||||
// host or port has changed, kill open connection
|
||||
killDWTCPThread();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// try to connect with DW server
|
||||
void attemptDWConnection( void )
|
||||
{
|
||||
|
||||
retry = true;
|
||||
BOOL bOptValTrue = TRUE;
|
||||
int iOptValTrue = 1;
|
||||
|
||||
|
||||
strcpy(curaddress, dwaddress);
|
||||
curport= dwsport;
|
||||
|
||||
// resolve hostname
|
||||
LPHOSTENT dwSrvHost= gethostbyname(dwaddress);
|
||||
|
||||
if (dwSrvHost == NULL)
|
||||
{
|
||||
// invalid hostname/no dns
|
||||
retry = false;
|
||||
}
|
||||
|
||||
// allocate socket
|
||||
dwSocket = socket (AF_INET,SOCK_STREAM,IPPROTO_TCP);
|
||||
|
||||
if (dwSocket == INVALID_SOCKET)
|
||||
{
|
||||
// no deal
|
||||
retry = false;
|
||||
DLOG_C("invalid socket.\n");
|
||||
}
|
||||
|
||||
// set options
|
||||
setsockopt(dwSocket,IPPROTO_TCP,SO_REUSEADDR,(char *)&bOptValTrue,sizeof(bOptValTrue));
|
||||
setsockopt(dwSocket,IPPROTO_TCP,TCP_NODELAY,(char *)&iOptValTrue,sizeof(iOptValTrue));
|
||||
|
||||
// build server address
|
||||
SOCKADDR_IN dwSrvAddress;
|
||||
|
||||
dwSrvAddress.sin_family= AF_INET;
|
||||
dwSrvAddress.sin_addr= *((LPIN_ADDR)*dwSrvHost->h_addr_list);
|
||||
dwSrvAddress.sin_port = htons(dwsport);
|
||||
|
||||
// try to connect...
|
||||
int rc = connect(dwSocket,(LPSOCKADDR)&dwSrvAddress, sizeof(dwSrvAddress));
|
||||
|
||||
retry = false;
|
||||
|
||||
if (rc==SOCKET_ERROR)
|
||||
{
|
||||
// no deal
|
||||
closesocket(dwSocket);
|
||||
dwSocket = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// TCP connection thread
|
||||
unsigned __stdcall DWTCPThread(void *Dummy)
|
||||
{
|
||||
HANDLE hEvent = (HANDLE)Dummy;
|
||||
WSADATA wsaData;
|
||||
|
||||
int sz;
|
||||
int res;
|
||||
|
||||
// Request Winsock version 2.2
|
||||
if ((WSAStartup(0x202, &wsaData)) != 0)
|
||||
{
|
||||
DLOG_C("WSAStartup() failed, DWTCPConnection thread exiting\n");
|
||||
WSACleanup();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
while(DWTCPEnabled)
|
||||
{
|
||||
// get connected
|
||||
attemptDWConnection();
|
||||
|
||||
// keep trying...
|
||||
while ((dwSocket == 0) & DWTCPEnabled)
|
||||
{
|
||||
attemptDWConnection();
|
||||
|
||||
// after 2 tries, sleep between attempts
|
||||
Sleep(TCP_RETRY_DELAY);
|
||||
}
|
||||
|
||||
while ((dwSocket != 0) & DWTCPEnabled)
|
||||
{
|
||||
// we have a connection, lets chew through some i/o
|
||||
|
||||
// always read as much as possible,
|
||||
// max read is writepos to readpos or buffersize
|
||||
// depending on positions of read and write ptrs
|
||||
|
||||
if (InReadPos > InWritePos)
|
||||
sz = InReadPos - InWritePos;
|
||||
else
|
||||
sz = BUFFER_SIZE - InWritePos;
|
||||
|
||||
// read the data
|
||||
res = recv(dwSocket,(char *)InBuffer + InWritePos, sz, 0);
|
||||
|
||||
if (res < 1)
|
||||
{
|
||||
// no good, bail out
|
||||
closesocket(dwSocket);
|
||||
dwSocket = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// good recv, inc ptr
|
||||
InWritePos += res;
|
||||
if (InWritePos == BUFFER_SIZE)
|
||||
InWritePos = 0;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// close socket if necessary
|
||||
if (dwSocket != 0)
|
||||
closesocket(dwSocket);
|
||||
|
||||
dwSocket = 0;
|
||||
|
||||
_endthreadex(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// called from config.c/UpdateConfig
|
||||
void SetDWTCPConnectionEnable(unsigned int enable)
|
||||
{
|
||||
|
||||
// turning us on?
|
||||
if ((enable == 1) & (!DWTCPEnabled))
|
||||
{
|
||||
DWTCPEnabled = true;
|
||||
|
||||
// reset buffer pointers
|
||||
InReadPos = 0;
|
||||
InWritePos = 0;
|
||||
|
||||
|
||||
// start create thread to handle io
|
||||
hDWTCPThread;
|
||||
HANDLE hEvent;
|
||||
|
||||
unsigned threadID;
|
||||
|
||||
hEvent = CreateEvent( NULL, FALSE, FALSE, NULL ) ;
|
||||
|
||||
if (hEvent==NULL)
|
||||
{
|
||||
DLOG_C("Cannot create DWTCPConnection thread!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// start it up...
|
||||
hDWTCPThread = (HANDLE)_beginthreadex( NULL, 0, &DWTCPThread, hEvent, 0, &threadID );
|
||||
|
||||
if (hDWTCPThread==NULL)
|
||||
{
|
||||
DLOG_C("Cannot start DWTCPConnection thread!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
DLOG_C("DWTCPConnection thread started with id %d\n",threadID);
|
||||
|
||||
|
||||
}
|
||||
else if ((enable != 1) & DWTCPEnabled)
|
||||
{
|
||||
// we were running but have been turned off
|
||||
DWTCPEnabled = false;
|
||||
|
||||
killDWTCPThread();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extern "C"
|
||||
{
|
||||
__declspec(dllexport) const char* PakGetName()
|
||||
{
|
||||
static char string_buffer[MAX_LOADSTRING];
|
||||
|
||||
//LoadString(gModuleInstance, IDS_MODULE_NAME, string_buffer, MAX_LOADSTRING);
|
||||
strcpy(string_buffer, "Bare Becker Port");
|
||||
|
||||
return string_buffer;
|
||||
}
|
||||
|
||||
__declspec(dllexport) const char* PakGetCatalogId()
|
||||
{
|
||||
static char string_buffer[MAX_LOADSTRING];
|
||||
|
||||
//LoadString(gModuleInstance, IDS_CATNUMBER, string_buffer, MAX_LOADSTRING);
|
||||
strcpy(string_buffer, "");
|
||||
|
||||
return string_buffer;
|
||||
}
|
||||
|
||||
__declspec(dllexport) const char* PakGetDescription()
|
||||
{
|
||||
static char string_buffer[MAX_LOADSTRING];
|
||||
|
||||
LoadString(gModuleInstance, IDS_DESCRIPTION, string_buffer, MAX_LOADSTRING);
|
||||
|
||||
return string_buffer;
|
||||
}
|
||||
|
||||
__declspec(dllexport) void PakInitialize(
|
||||
slot_id_type SlotId,
|
||||
const char* const configuration_path,
|
||||
HWND hVccWnd,
|
||||
const cpak_callbacks* const callbacks)
|
||||
{
|
||||
gSlotId = SlotId;
|
||||
PakSetCart = callbacks->assert_cartridge_line;
|
||||
LastStats = GetTickCount();
|
||||
gpSettings = new VCC::Util::settings(configuration_path);
|
||||
LoadConfig();
|
||||
SetDWTCPConnectionEnable(1);
|
||||
}
|
||||
|
||||
__declspec(dllexport) bool PakGetMenuItem(menu_item_entry* item, size_t index)
|
||||
{
|
||||
return get_menu_item(item, index);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
extern "C" __declspec(dllexport) void PakWritePort(unsigned char Port,unsigned char Data)
|
||||
{
|
||||
switch (Port)
|
||||
{
|
||||
// write data
|
||||
case 0x42:
|
||||
dw_write(Data);
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
extern "C" __declspec(dllexport) unsigned char PakReadPort(unsigned char Port)
|
||||
{
|
||||
switch (Port)
|
||||
{
|
||||
// read status
|
||||
case 0x41:
|
||||
if (dw_status() != 0)
|
||||
return 2;
|
||||
else
|
||||
return 0;
|
||||
break;
|
||||
// read data
|
||||
case 0x42:
|
||||
return(dw_read());
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
__declspec(dllexport) void PakReset()
|
||||
{
|
||||
if (PakSetCart!=NULL)
|
||||
PakSetCart(1);
|
||||
return(0);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
extern "C" __declspec(dllexport) unsigned char PakReadMemoryByte(unsigned short Address)
|
||||
{
|
||||
return(HDBRom[Address & 8191]);
|
||||
|
||||
}
|
||||
|
||||
extern "C" __declspec(dllexport) void PakProcessHorizontalSync()
|
||||
{
|
||||
// flush write buffer in the future..?
|
||||
return;
|
||||
}
|
||||
|
||||
extern "C" __declspec(dllexport) void PakGetStatus(char* text_buffer, size_t buffer_size)
|
||||
{
|
||||
// calculate speed
|
||||
DWORD sinceCalc = GetTickCount() - LastStats;
|
||||
if (sinceCalc > STATS_PERIOD_MS)
|
||||
{
|
||||
LastStats += sinceCalc;
|
||||
|
||||
ReadSpeed = 8.0f * (BytesReadSince / (1000.0f - sinceCalc));
|
||||
WriteSpeed = 8.0f * (BytesWrittenSince / (1000.0f - sinceCalc));
|
||||
|
||||
BytesReadSince = 0;
|
||||
BytesWrittenSince = 0;
|
||||
}
|
||||
|
||||
|
||||
if (DWTCPEnabled)
|
||||
{
|
||||
if (retry)
|
||||
{
|
||||
sprintf(text_buffer,"DW %s?", curaddress);
|
||||
}
|
||||
else if (dwSocket == 0)
|
||||
{
|
||||
sprintf(text_buffer,"DW ConError");
|
||||
}
|
||||
else
|
||||
{
|
||||
int buffersize = InWritePos - InReadPos;
|
||||
if (InReadPos > InWritePos)
|
||||
buffersize = BUFFER_SIZE - InReadPos + InWritePos;
|
||||
|
||||
|
||||
sprintf(text_buffer,"DW OK R:%04.1f W:%04.1f", ReadSpeed , WriteSpeed);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(text_buffer,"");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
bool get_menu_item(menu_item_entry* item, size_t index) {
|
||||
if (!item) return false;
|
||||
if (index == 0) {
|
||||
BeckerMenu.clear();
|
||||
BeckerMenu.add("", 0, MIT_Seperator);
|
||||
BeckerMenu.add("DriveWire Server..", ControlId(16), MIT_StandAlone);
|
||||
}
|
||||
return BeckerMenu.copy_item(*item, index);
|
||||
}
|
||||
|
||||
extern "C" __declspec(dllexport) void PakMenuItemClicked(unsigned char MenuID)
|
||||
{
|
||||
HWND h_own = GetActiveWindow();
|
||||
CreateDialog(gModuleInstance,(LPCTSTR)IDD_PROPPAGE,h_own,(DLGPROC)Config);
|
||||
ShowWindow(g_hConfigDlg,1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
LRESULT CALLBACK Config(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HWND hwndOwner;
|
||||
RECT rc, rcDlg, rcOwner;
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case WM_CLOSE:
|
||||
DestroyWindow(hDlg);
|
||||
g_hConfigDlg=nullptr;
|
||||
return TRUE;
|
||||
break;
|
||||
|
||||
case WM_INITDIALOG:
|
||||
|
||||
if ((hwndOwner = GetParent(hDlg)) == NULL)
|
||||
{
|
||||
hwndOwner = GetDesktopWindow();
|
||||
}
|
||||
|
||||
g_hConfigDlg=hDlg;
|
||||
|
||||
GetWindowRect(hwndOwner, &rcOwner);
|
||||
GetWindowRect(hDlg, &rcDlg);
|
||||
CopyRect(&rc, &rcOwner);
|
||||
|
||||
OffsetRect(&rcDlg, -rcDlg.left, -rcDlg.top);
|
||||
OffsetRect(&rc, -rc.left, -rc.top);
|
||||
OffsetRect(&rc, -rcDlg.right, -rcDlg.bottom);
|
||||
|
||||
SetWindowPos(hDlg,
|
||||
HWND_TOP,
|
||||
rcOwner.left + (rc.right / 2),
|
||||
rcOwner.top + (rc.bottom / 2),
|
||||
0, 0, // Ignores size arguments.
|
||||
SWP_NOSIZE);
|
||||
|
||||
SendDlgItemMessage (hDlg,IDC_TCPHOST, WM_SETTEXT, 0,(LPARAM)(LPCSTR)dwaddress);
|
||||
sprintf(msg,"%d", dwsport);
|
||||
SendDlgItemMessage (hDlg,IDC_TCPPORT, WM_SETTEXT, 0,(LPARAM)(LPCSTR)msg);
|
||||
|
||||
return TRUE;
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDOK:
|
||||
|
||||
SendDlgItemMessage (hDlg,IDC_TCPHOST, WM_GETTEXT, MAX_PATH,(LPARAM)(LPCSTR)dwaddress);
|
||||
SendDlgItemMessage (hDlg,IDC_TCPPORT, WM_GETTEXT, MAX_PATH,(LPARAM)(LPCSTR)msg);
|
||||
dw_setaddr(dwaddress);
|
||||
dw_setport(msg);
|
||||
SaveConfig();
|
||||
|
||||
DestroyWindow(hDlg);
|
||||
g_hConfigDlg=nullptr;
|
||||
return TRUE;
|
||||
break;
|
||||
|
||||
case IDHELP:
|
||||
return TRUE;
|
||||
break;
|
||||
|
||||
case IDCANCEL:
|
||||
DestroyWindow(hDlg);
|
||||
g_hConfigDlg=nullptr;
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
break;
|
||||
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
void LoadConfig()
|
||||
{
|
||||
const char* ModName = "DW Becker";
|
||||
char saddr[MAX_LOADSTRING]="";
|
||||
char sport[MAX_LOADSTRING]="";
|
||||
|
||||
Setting().read(ModName,"DWServerAddr","",saddr, MAX_LOADSTRING);
|
||||
Setting().read(ModName,"DWServerPort","",sport, MAX_LOADSTRING);
|
||||
|
||||
if (strlen(saddr) > 0)
|
||||
dw_setaddr(saddr);
|
||||
else
|
||||
dw_setaddr("127.0.0.1");
|
||||
|
||||
if (strlen(sport) > 0)
|
||||
dw_setport(sport);
|
||||
else
|
||||
dw_setport("65504");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void SaveConfig()
|
||||
{
|
||||
const char* ModName = "DW Becker";
|
||||
Setting().write(ModName,"DWServerAddr",dwaddress);
|
||||
sprintf(msg, "%d", dwsport);
|
||||
Setting().write(ModName,"DWServerPort",msg);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
#ifndef __BECKER_H__
|
||||
#define __BECKER_H__
|
||||
|
||||
#ifndef __cplusplus
|
||||
#define bool int
|
||||
#define true 1
|
||||
#define false 0
|
||||
#endif
|
||||
|
||||
// functions
|
||||
void MemWrite(unsigned char,unsigned short );
|
||||
unsigned char MemRead(unsigned short );
|
||||
|
||||
extern const unsigned char Rom[8192];
|
||||
|
||||
// settings.. should these be settings in the gui?
|
||||
#define BUFFER_SIZE 512
|
||||
#define TCP_RETRY_DELAY 500
|
||||
#define STATS_PERIOD_MS 100
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,154 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_PROPPAGE DIALOG DISCARDABLE 0, 0, 192, 86
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
|
||||
CAPTION "DriveWire Server"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
RTEXT "Server address:",IDC_STATIC,8,16,61,10
|
||||
RTEXT "Server port:",IDC_STATIC,25,34,44,11
|
||||
EDITTEXT IDC_TCPPORT,74,32,46,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
DEFPUSHBUTTON "Ok",IDOK,73,59,48,19
|
||||
PUSHBUTTON "Cancel",IDCANCEL,138,59,45,19
|
||||
EDITTEXT IDC_TCPHOST,74,14,105,12,ES_AUTOHSCROLL
|
||||
END
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 2,1,8,1
|
||||
PRODUCTVERSION 2,1,8,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x21L
|
||||
#else
|
||||
FILEFLAGS 0x20L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "Becker Port Interface"
|
||||
VALUE "CompanyName", "BitRot Software"
|
||||
VALUE "FileDescription", "becker"
|
||||
VALUE "FileVersion", "2.1.8.1"
|
||||
VALUE "InternalName", "Becker Port Interface"
|
||||
VALUE "LegalCopyright", "Copyright � 2007"
|
||||
VALUE "OriginalFilename", "becker.dll"
|
||||
VALUE "ProductName", "becker"
|
||||
VALUE "ProductVersion", "26-3124"
|
||||
VALUE "SpecialBuild", "Becker Port Interface"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_PROPPAGE, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 185
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 79
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_MODULE_NAME "HDBDOS/DW/Becker"
|
||||
IDS_VERSION "1.00"
|
||||
IDS_CATNUMBER "00-0000"
|
||||
IDS_DESCRIPTION "Standalone Becker Port for communicating with Drivewire. Must be selected using SCS spare slot select. For special use only - the Becker Port included in FD502 is better for most purposes"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Legacy|Win32">
|
||||
<Configuration>Legacy</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<SccProjectName />
|
||||
<SccLocalPath />
|
||||
<ProjectGuid>{C78D7242-DB92-49BC-AFF5-433E16C3C9D4}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Legacy|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v141_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Legacy|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\vcc-base.props" />
|
||||
<Import Project="..\vcc-legacy.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\vcc-base.props" />
|
||||
<Import Project="..\vcc-release.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\vcc-base.props" />
|
||||
<Import Project="..\vcc-debug.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Legacy|Win32'">
|
||||
<LibraryPath>C:\Program Files %28x86%29\Windows Kits\8.1\Lib\winv6.3\um\x86;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;BECKER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ResourceCompile />
|
||||
<Link>
|
||||
<LinkDLL>true</LinkDLL>
|
||||
<AdditionalDependencies>WS2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<FullProgramDatabaseFile>
|
||||
</FullProgramDatabaseFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Legacy|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;_USRDLL;BECKER_EXPORTS;_LEGACY_VCC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalOptions>/arch:SSE</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<LinkDLL>true</LinkDLL>
|
||||
<AdditionalDependencies>WS2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;BECKER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalOptions>/arch:SSE</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<ResourceCompile />
|
||||
<Link>
|
||||
<LinkDLL>true</LinkDLL>
|
||||
<AdditionalDependencies>WS2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="becker.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Legacy|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
</PrecompiledHeaderOutputFile>
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Legacy|Win32'">
|
||||
</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Legacy|Win32'">
|
||||
</PrecompiledHeaderOutputFile>
|
||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
</PrecompiledHeaderOutputFile>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="becker.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="becker.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\libcommon\libcommon.vcxproj">
|
||||
<Project>{e0aa25bd-5527-475f-8d8b-b549a6311b0c}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,22 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by becker.rc
|
||||
//
|
||||
#define IDS_MODULE_NAME 1
|
||||
#define IDS_VERSION 2
|
||||
#define IDS_CATNUMBER 3
|
||||
#define IDS_DESCRIPTION 4
|
||||
#define IDD_PROPPAGE 102
|
||||
#define IDC_TCPPORT 1004
|
||||
#define IDC_TCPHOST 1005
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1008
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
Reference in new issue
Block a user