Skip to content

Commit

Permalink
applied DrGuz parallel port change
Browse files Browse the repository at this point in the history
git-svn-id: https://www.daphne-emu.com:9443/daphnesvn/branches/v_1_0@3855 c98d566b-fa28-4d4c-8a7b-932307ef5c1a
  • Loading branch information
matt committed Jul 3, 2013
1 parent 7814d26 commit cd214c6
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 23 deletions.
3 changes: 3 additions & 0 deletions daphne-changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Daphne Changelog
-------------------------

v1.0.13
- Changed inpout library so it only loads (and thus installs itself) if parallel port is actually used.

v1.0.12
- Fixed hardware scoreboard so it will work on 64-bit Windows.

Expand Down
7 changes: 0 additions & 7 deletions src/clear_hw_scoreboard/clear_hw_scoreboard.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,6 @@
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
</Filter>
<Filter
Name="lib"
Filter="">
<File
RelativePath="..\lib\inpout32.lib">
</File>
</Filter>
</Files>
<Globals>
</Globals>
Expand Down
2 changes: 1 addition & 1 deletion src/daphne.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ using namespace std;

const char *get_daphne_version()
{
return "1.0.12";
return "1.0.13";
}

unsigned char get_filename(char *s, unsigned char n)
Expand Down
10 changes: 5 additions & 5 deletions src/daphne.rc
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,1,0,12
PRODUCTVERSION 0,1,0,12
FILEVERSION 0,1,0,13
PRODUCTVERSION 0,1,0,13
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x3L
Expand All @@ -70,12 +70,12 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "DAPHNE, a Laserdisc Arcade Game Emulator"
VALUE "FileVersion", "0, 1, 0, 12"
VALUE "FileVersion", "0, 1, 0, 13"
VALUE "InternalName", "daphne"
VALUE "LegalCopyright", "Copyright (C) 1999-2011 Matt Ownby"
VALUE "LegalCopyright", "Copyright (C) 1999-2013 Matt Ownby"
VALUE "OriginalFilename", "daphne.exe"
VALUE "ProductName", " daphne Application"
VALUE "ProductVersion", "0, 1, 0, 12"
VALUE "ProductVersion", "0, 1, 0, 13"
END
END
BLOCK "VarFileInfo"
Expand Down
7 changes: 0 additions & 7 deletions src/daphne_vs2003.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -935,13 +935,6 @@
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
<Filter
Name="lib"
Filter="">
<File
RelativePath=".\lib\inpout32.lib">
</File>
</Filter>
<File
RelativePath="..\daphne-changelog.txt">
</File>
Expand Down
25 changes: 22 additions & 3 deletions src/io/parallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ short par::m_base2[3] = { 0x37A, 0x27A, 0 };
#ifdef WIN32

#include <windows.h>
#include "inpout32.h"

typedef void (WINAPI *Out32_t)(short PortAddress, short data);
Out32_t Out32;
HINSTANCE g_hInstInpout;

bool par::init(unsigned int port, ILogger *pLogger)
// initializes parallel port for use
Expand All @@ -59,9 +62,21 @@ bool par::init(unsigned int port, ILogger *pLogger)
s += numstr::ToStr(m_base0[m_uPortIdx], 16, 4);
pLogger->Log(s);

bool bRes = (IsInpOutDriverOpen() != 0);
g_hInstInpout = LoadLibrary("inpout32.dll");
if (g_hInstInpout == NULL)
{
return(false);
}

return(bRes);
Out32 = (Out32_t)GetProcAddress(g_hInstInpout, "Out32");
if (!Out32)
{
FreeLibrary(g_hInstInpout);
g_hInstInpout = NULL;
return(false);
}

return(true);
}

// writes a byte to the port at base+0
Expand All @@ -80,6 +95,10 @@ void par::close(ILogger *pLogger)
{
// does nothing with current win32 implementation
pLogger->Log("Closing parallel port");

FreeLibrary(g_hInstInpout);
g_hInstInpout = NULL;
Out32 = NULL;
}

#endif
Expand Down

0 comments on commit cd214c6

Please sign in to comment.