diff --git a/.gitignore b/.gitignore index 07e802b..5f067b2 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ src/tools/nfs2ac/nfs2ac src/tools/nfsperf/nfsperf src/tools/texmapper/texmapper src/tools/trackgen/trackgen +src/tags *.a *-bin *.depend diff --git a/src/drivers/jz/Makefile b/src/drivers/jz/Makefile new file mode 100644 index 0000000..e8be7ab --- /dev/null +++ b/src/drivers/jz/Makefile @@ -0,0 +1,29 @@ +############################################################################## +# +# file : Makefile +# created : Thu Jan 21 11:41:38 CET 2016 +# copyright : (C) 2002 Jure Zbontar +# +############################################################################## +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +############################################################################## + +ROBOT = jz +MODULE = ${ROBOT}.so +MODULEDIR = drivers/${ROBOT} +SOURCES = ${ROBOT}.cpp + +SHIPDIR = drivers/${ROBOT} +SHIP = ${ROBOT}.xml pw-imprezawrc.rgb logo.rgb +SHIPSUBDIRS = + +PKGSUBDIRS = ${SHIPSUBDIRS} +src-robots-jz_PKGFILES = $(shell find * -maxdepth 0 -type f -print) +src-robots-jz_PKGDIR = ${PACKAGE}-${VERSION}/$(subst ${TORCS_BASE},,$(shell pwd)) + +include ${MAKE_DEFAULT} diff --git a/src/drivers/jz/jz.cpp b/src/drivers/jz/jz.cpp new file mode 100644 index 0000000..e6c429a --- /dev/null +++ b/src/drivers/jz/jz.cpp @@ -0,0 +1,119 @@ +/*************************************************************************** + + file : jz.cpp + created : Thu Jan 21 11:41:38 CET 2016 + copyright : (C) 2002 Jure Zbontar + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifdef _WIN32 +#include +#endif + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +static tTrack *curTrack; + +static void initTrack(int index, tTrack* track, void *carHandle, void **carParmHandle, tSituation *s); +static void newrace(int index, tCarElt* car, tSituation *s); +static void drive(int index, tCarElt* car, tSituation *s); +static void endrace(int index, tCarElt *car, tSituation *s); +static void shutdown(int index); +static int InitFuncPt(int index, void *pt); + + +/* + * Module entry point + */ +extern "C" int +jz(tModInfo *modInfo) +{ + memset(modInfo, 0, 10*sizeof(tModInfo)); + + modInfo->name = strdup("jz"); /* name of the module (short) */ + modInfo->desc = strdup(""); /* description of the module (can be long) */ + modInfo->fctInit = InitFuncPt; /* init function */ + modInfo->gfId = ROB_IDENT; /* supported framework version */ + modInfo->index = 1; + + return 0; +} + +/* Module interface initialization. */ +static int +InitFuncPt(int index, void *pt) +{ + tRobotItf *itf = (tRobotItf *)pt; + + itf->rbNewTrack = initTrack; /* Give the robot the track view called */ + /* for every track change or new race */ + itf->rbNewRace = newrace; /* Start a new race */ + itf->rbDrive = drive; /* Drive during race */ + itf->rbPitCmd = NULL; + itf->rbEndRace = endrace; /* End of the current race */ + itf->rbShutdown = shutdown; /* Called before the module is unloaded */ + itf->index = index; /* Index used if multiple interfaces */ + return 0; +} + +/* Called for every track change or new race. */ +static void +initTrack(int index, tTrack* track, void *carHandle, void **carParmHandle, tSituation *s) +{ + curTrack = track; + *carParmHandle = NULL; +} + +/* Start a new race. */ +static void +newrace(int index, tCarElt* car, tSituation *s) +{ +} + +/* Drive during race. */ +static void +drive(int index, tCarElt* car, tSituation *s) +{ + memset((void *)&car->ctrl, 0, sizeof(tCarCtrl)); + car->ctrl.brakeCmd = 1.0; /* all brakes on ... */ + /* + * add the driving code here to modify the + * car->_steerCmd + * car->_accelCmd + * car->_brakeCmd + * car->_gearCmd + * car->_clutchCmd + */ +} + +/* End of the current race */ +static void +endrace(int index, tCarElt *car, tSituation *s) +{ +} + +/* Called before the module is unloaded */ +static void +shutdown(int index) +{ +} + diff --git a/src/drivers/jz/jz.def b/src/drivers/jz/jz.def new file mode 100644 index 0000000..92ae4e2 --- /dev/null +++ b/src/drivers/jz/jz.def @@ -0,0 +1,19 @@ +; +; file : jz.def +; created : Thu Jan 21 11:41:38 CET 2016 +; copyright : (C) 2002 Jure Zbontar +; +; +; This program is free software; you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 2 of the License, or +; (at your option) any later version. +; + +LIBRARY jz + +SECTIONS .data READ WRITE + +EXPORTS + jz + diff --git a/src/drivers/jz/jz.dsp b/src/drivers/jz/jz.dsp new file mode 100644 index 0000000..f7633a9 --- /dev/null +++ b/src/drivers/jz/jz.dsp @@ -0,0 +1,238 @@ +# Microsoft Developer Studio Project File - Name="jz" - Package Owner=<4> + +# Microsoft Developer Studio Generated Build File, Format Version 6.00 + +# ** DO NOT EDIT ** + + + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + + + +CFG=jz - Win32 Debug + +!MESSAGE This is not a valid makefile. To build this project using NMAKE, + +!MESSAGE use the Export Makefile command and run + +!MESSAGE + +!MESSAGE NMAKE /f "jz.mak". + +!MESSAGE + +!MESSAGE You can specify a configuration when running NMAKE + +!MESSAGE by defining the macro CFG on the command line. For example: + +!MESSAGE + +!MESSAGE NMAKE /f "jz.mak" CFG="jz - Win32 Debug" + +!MESSAGE + +!MESSAGE Possible choices for configuration are: + +!MESSAGE + +!MESSAGE "jz - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") + +!MESSAGE "jz - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") + +!MESSAGE + + + +# Begin Project + +# PROP AllowPerConfigDependencies 0 + +# PROP Scc_ProjName "" + +# PROP Scc_LocalPath "" + +CPP=cl.exe + +MTL=midl.exe + +RSC=rc.exe + + + +!IF "$(CFG)" == "jz - Win32 Release" + + + +# PROP BASE Use_MFC 0 + +# PROP BASE Use_Debug_Libraries 0 + +# PROP BASE Output_Dir "Release" + +# PROP BASE Intermediate_Dir "Release" + +# PROP BASE Target_Dir "" + +# PROP Use_MFC 0 + +# PROP Use_Debug_Libraries 0 + +# PROP Output_Dir "Release" + +# PROP Intermediate_Dir "Release" + +# PROP Ignore_Export_Lib 1 + +# PROP Target_Dir "" + +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JZ_EXPORTS" /YX /FD /c + +# ADD CPP /nologo /G5 /W3 /GX /O2 /I "../../../export/include" /I "../../windows/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JZ_EXPORTS" /YX /FD /c + +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 + +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 + +# ADD BASE RSC /l 0x40c /d "NDEBUG" + +# ADD RSC /l 0x40c /d "NDEBUG" + +BSC32=bscmake.exe + +# ADD BASE BSC32 /nologo + +# ADD BSC32 /nologo + +LINK32=link.exe + +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 + +# ADD LINK32 tgf.lib robottools.lib sg.lib ul.lib /nologo /dll /map /machine:I386 /nodefaultlib:"LIBCD" /libpath:"../../../export/lib" /libpath:"../../windows/lib" + +# Begin Special Build Tool + +WkspDir=. + +TargetDir=.\Release + +SOURCE="$(InputPath)" + +PostBuild_Cmds=copy $(TargetDir)\*.dll $(WkspDir)\runtime\drivers\jz + +# End Special Build Tool + + + +!ELSEIF "$(CFG)" == "jz - Win32 Debug" + + + +# PROP BASE Use_MFC 0 + +# PROP BASE Use_Debug_Libraries 1 + +# PROP BASE Output_Dir "Debug" + +# PROP BASE Intermediate_Dir "Debug" + +# PROP BASE Target_Dir "" + +# PROP Use_MFC 0 + +# PROP Use_Debug_Libraries 1 + +# PROP Output_Dir "Debug" + +# PROP Intermediate_Dir "Debug" + +# PROP Ignore_Export_Lib 1 + +# PROP Target_Dir "" + +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JZ_EXPORTS" /YX /FD /GZ /c + +# ADD CPP /nologo /G5 /W3 /Gm /GX /ZI /Od /I "../../../export/include" /I "../../windows/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JZ_EXPORTS" /YX /FD /GZ /c + +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 + +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 + +# ADD BASE RSC /l 0x40c /d "_DEBUG" + +# ADD RSC /l 0x40c /d "_DEBUG" + +BSC32=bscmake.exe + +# ADD BASE BSC32 /nologo + +# ADD BSC32 /nologo + +LINK32=link.exe + +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept + +# ADD LINK32 robottools.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib sg.lib ul.lib /nologo /dll /map /debug /machine:I386 /pdbtype:sept /libpath:"../../../export/libd" /libpath:"../../windows/lib" + +# Begin Special Build Tool + +WkspDir=. + +TargetDir=.\Debug + +SOURCE="$(InputPath)" + +PostBuild_Cmds=copy $(TargetDir)\*.dll $(WkspDir)\runtimed\drivers\jz + +# End Special Build Tool + + + +!ENDIF + + + +# Begin Target + + + +# Name "jz - Win32 Release" + +# Name "jz - Win32 Debug" + +# Begin Group "Source Files" + + + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + +# Begin Source File + + + +SOURCE=.\jz.cpp + +# End Source File + +# Begin Source File + + + +SOURCE=.\jz.def + +# End Source File + +# End Group + +# Begin Group "Header Files" + + + +# PROP Default_Filter "h;hpp;hxx;hm;inl" + +# End Group + +# End Target + +# End Project + diff --git a/src/drivers/jz/jz.xml b/src/drivers/jz/jz.xml new file mode 100644 index 0000000..56aad68 --- /dev/null +++ b/src/drivers/jz/jz.xml @@ -0,0 +1,31 @@ + + + + + + + + + + +
+
+
+ + + + + + + + + + +
+
+
+
diff --git a/src/drivers/jz/logo.rgb b/src/drivers/jz/logo.rgb new file mode 100644 index 0000000..036f1e2 Binary files /dev/null and b/src/drivers/jz/logo.rgb differ diff --git a/src/drivers/jz/pw-imprezawrc.rgb b/src/drivers/jz/pw-imprezawrc.rgb new file mode 100644 index 0000000..f52d6bc Binary files /dev/null and b/src/drivers/jz/pw-imprezawrc.rgb differ