Log in

View Full Version : RELEASE: Ipaqman with a decent installer & storage card support

10-18-2005, 09:00 AM
Upon trying to find an answer to the question here (http://www.pocketpcthoughts.com/forums/viewtopic.php?t=43737), I've run into Ipaqman - v1.0 (http://pocketpcfreewares.com/en/index.php?soft=472), a nice freeware game compatible with all my latest Pocket PC's (iPAQ 3660, iPAQ 2210 and Pocket Loox 720). (Make sure you use the stylus to move and not the D-Pad! Also, I haven't tried to make the multiplayer option work. I may try to rewrite the protocol/the communication some day to support plain PAN instead of the desktop-based client/server model as of now.)

As it also uses wired-in file paths (which, to make things even worse, refer to three subdirectories in the root directory this is definitely bad programming practice), I decided to hack it to be able to relocate. I haven't gone for the traditional hexedit hack because 1, it has very few characters to modify 2, the sources are present so that I could just recompile the entire stuff under eVC 3.0.

Also, I've packed the entire distribution pack so that it's much easier to install with a trial version of e-Pocketsetup 2003 (therefore, don't be afraid of the trial messages at setup time!) and, also, uninstall from the device. Finally, I've enabled the creation of a Start Menu shortcut (it's in the Ipaqman folder now; feel free to freely relocate the link file) this was also missing from the original version.

I've created three CAB files for you:

This version (http://winmobiletech.com/102005Ipaqman/ipaqmanStorageCard.zip) is meant for people with a PDA that refers to the storage card as Storage Card . (WM2003 Pocket PC's.)

This version (http://winmobiletech.com/102005Ipaqman/ipaqman-SD.zip) is meant for people with a PDA that refers to the SD card as SD Card . (For example, the iPAQ 2210, the iPAQ hx4700 and a lot of other Pocket PC's)

This version (http://winmobiletech.com/102005Ipaqman/ipaqman-SD-MMC.zip) is meant for people with a PDA that refers to the SD card as SD-MMCard . (For example, Fujtisu-Siemens Pocket PC's.) (Note that I haven't created a separate version for CF cards.)

These ZIP files all contain a CAB file which should just be transferred to the PDA and installed to their default target directory. If you don't use any tool like CabInstl, everything will be OK. If you do use CabInstl, on the other hand, make sure you don't change the target path.

In addition to the CAB file, they all contain two .h files. These files contain the wired-in paths of the three (sound/level/image) subdirectories. If you want to use them, just modify the paths in them and overwrite DataStorage\DHconst.h and Graphics\RDWCconst.h with the properly modified files once you've loaded PacmanMain\PacmanMain.vcw in eVC. Then, just press F7 to build the entire stuff (after defining PPC2k2 as the target operating system and switching to Release mode) and get PacmanMain\ARMRel\PacmanMain.exe . (The resource files won't change.)

Sorry for not making the resource access mechanism even more dynamic it would have required a lot of additional work from me. Hope this version will be useful for many of you. If you want a specific configuration (My PDA has a CF card only, I'd like to install this stuff in the File Store etc), let me know and I also release the appropriate version.

Happy gaming! :)

10-18-2005, 06:12 PM
CString strFilePath;
CString strFolderPath;

//Get program file path
TCHAR lpFileName[MAX_PATH+1];
GetModuleFileName(NULL, lpFileName, MAX_PATH);
strFilePath = lpFileName;

//Get program folder
int nLastIndex = strFilePath.ReverseFind('\\');
if (nLastIndex!=-1) {
strFolderPath = strFilePath.Left(nLastIndex);
} else {
strFolderPath = _T("\\");

AfxMessageBox(_T("Program: ") + strFilePath);
AfxMessageBox(_T("Folder: ") + strFolderPath);

Courtesy of PocketPCDN: http://www.pocketpcdn.com/articles/program_path.html


10-18-2005, 06:26 PM
Courtesy of PocketPCDN: http://www.pocketpcdn.com/articles/program_path.html


Thanks for the code snippet; I didn't/don't want to rewrite the resource access code that much because it accesses the file system from quite a few different functions. I'd like to make the multiplayer communication p2p-based first.