Quick run-through to get the Handy sources to compile for Windows using Microsoft Visual Studio 2010 (or Microsoft Visual C++ 2010 Express, which is a free download).
Download these first:
- Handy source code (Handy-win32src-0.95.zip contains the sources)
- Microsoft Visual C++ 2010 Express (in case you do not own a copy of Visual Studio that includes C++)
- DirectX 9.0 Software Development Kit Update (August 2005)
Install Visual C++ and the DirectX SDK. Unpack the sources of Handy.
Open the folder of the Handy sources and find the Handy.dsp file. Doubleclick to the open it in Visual C++. It will prompt you to convert the project. Choose Yes in the dialog.
Save the solution. You must specify the location of the .sln solution file. The root of the project will be an appropriate location.
Right-click the Handy project and open the Properties dialog. Go to the C/C++ section and enter a new entry under “Additional Include Directories”. This should be “C:\Program Files (x86)\Microsoft DirectX 9.0 SDK (August 2005)\Include” if you installed the DirectX 9 SDK to the default installation directory.
Next, go to the Linker section and add “C:\Program Files (x86)\Microsoft DirectX 9.0 SDK (August 2005)\Lib\x86” to the “Additional Libraries Directories”.
When you first try to compile the sources you will get a number of errors. Fix each of these, bullet by bullet and recompile in between:
- 22 errors: error C1083: Cannot open include file: ‘strstrea.h’: No such file or directory
Apply fix 1.
- 96 errors: related to endl, ostream&, ostrstream and ostrstream& references and declarations in error.h
Apply fix 2.
- 43 errors:
error C4430: missing type specifier – int assumed. Note: C++ does not support default-int
error C2664: ‘CWnd::OnActivateApp’ : cannot convert parameter 2 from ‘HTASK’ to ‘DWORD’
error C2440: ‘static_cast’ : cannot convert from ‘void (__thiscall CLynxWindow::* )(WPARAM,LPARAM)’ to ‘LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)’
error C2065: ‘loop’ : undeclared identifier
error C2065: ‘endl’ : undeclared identifier
Apply fixes 2 to 6
This is the list of fixes you will need to make to get the sources to compile.
- Replace #include “strstrea.h” in error.h with these two lines:
#include <iostream> #include <strstream>
- Prefix endl, ostream&, ostrstream and ostrstream& declarations with:
- Change line 1192 in Lynxwin.cpp to
static bool firsttime=0;
- Change HTASK hTask in line 2365 of Lynxwin.cpp and line 325 of Lynxwin.h to
- Comment out the lines 868 and 869 of Lynxwin.cpp. I do not know how to really fix these errors yet.
- Add a new line at 1552 in Lynxwin.cpp with:
- Change line 195 of Debuggerwin.cpp to:
for(int loop=0;loop<mWinHeight;loop++) LineOutput("");
- Change line 550 of Debuggerwin.cpp to these two:
int loop; for(loop=0;loop<mLineInput-1;loop++)
- Change line 487 of codewin.cpp to these two:
int loop; for(loop=0;loop<MAX_CPU_BREAKPOINTS;loop++)
After that you should have a Handy C++ project that compiles, links and runs correctly.
For the developer version of Handy you should add a preprocessor definition _LYNXDBG to the project:
The developer version gives you a Code, Debugger and Graphics dump window and ability to debug/step-through the 65SC02 code. You do not have to change this if you switch to another configuration “Debug Dbg” or “Release Dbg”. You will have to go through the process of setting the Include and Library directories again.
You will also get new compile errors. To fix these, apply fix 7 to 9 to get rid of those.
Run the Handy emulator, find yourself LYNXBOOT.IMG if you have got the boot image and some rom images for (homebrew) games.
For your convenience, you can download the revised sources here:
To be determined