PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

SH3 Port

Ok, I'm working on an SH3 port of PQ2. I KNOW, don't get me started about speed, etc. Just, don't ask, ok? Anyway, I've got the files compiled and I'm positive I've got everything in the right directory. Is there any reason it shouldn't be finding the PAK file. Some code-specific SH3 stuff? Cause when I run it I keep getting the "Can't find pics/colormap.pcx" error.
No, I would think that any SH3-specific error would result in catastrophic failure, and the app would terminate. Make sure you have the pak file in the right directory:

\quake2\baseq2\pak0.pak
or
\Storage Card\quake2\baseq2\pak0.pak

Remember that pQ2 does not support gzipped pak files.

Dan East
Nope, no catastrophic failure, just something that appears to be the inability to find the pak file. I've got pocketquake2.exe, ref_soft.dll, and game.dll in the following directories:
\Windows\Start Menu
\Storage Card\Quake2
\Storage Card\Quake2\baseq2

and the pak file in:
\Storage Card\Quake2\baseq2\pak0.pak

Running it from any of the locations I have the exe in does not work, just the can't find colormap error. I've cleaned almost everything off the Jornada and have approx. 22 MB of program memory free, and I'm storing the PAK file on a 64 MB CF Type I card. Any ideas?
Also, one more question. Should I be able to open the pak file in a standard zip file editor such as WinZIP?
In qcommon\files.c::FS_InitFilesystem I add any attached storage cards to the pak search path. You may debug there and make sure the cards are being found and properly added in with FS_AddGameDirectory.

You can also step into the LoadPCX function in ref_soft\r_main.c::DrawGetPalette to see exactly what's going on. Step into ri.FS_LoadFile in DrawGetPalette.

Dan East
Ok, but also one more thing. Does Q2 also do a check of the filesize of the pak?
The file is of course Zipped if you got it from the PM website. You have to unzip it once. Once it is pak0.pak, you cannot open it with WinZip, etc. You need a pak editor to make changes to it, as the pak format is a proprietary creation of id Software. They finally wised up with QIII and started using regular old Zips.
Check some of the other threads in this forum, because links to a few different pak editors have been posted.

Dan East
Oh, ok, just checking. I thought I remembered you could open it with WinZIP, that's why, but that's just with Q3. (I just wanted to make sure my PAK wasn't corrupted)
If you look in qcommon\files.c, you will see some defines at the beginning of that source file:
Code:

// define this to dissalow any data but the demo pak file
//#define NO_ADDONS

// if a packfile directory differs from this, it is assumed to be hacked
// Full version
#define PAK0_CHECKSUM 0x40e614e0
// Demo
//#define PAK0_CHECKSUM 0xb2c6d7ea
// OEM
//#define PAK0_CHECKSUM 0x78e135c


I did not touch those - they were commented in exactly that way as released by id Software. So you can see that NO_ADDONS is not defined, so modified pak files will work since the checksum is ignored.

Dan East
Ok, well I tracked it through the debugger and I think that the function that returns the string to FS_AddGameDirectory returns "\Storage Card\quake2/baseq2" now shouldn't that "/" be a "\"? I think so, but I'm going to bed. Let me know.
Hey Dan, could you possibly give me some more insight on the string creation in that function that shows that path for the dir?
I doubt that backwards slash is the problem. You can verify that by hitting that point again in the debugger, then correcting the value of that var in the Watch window. See if it works after you fix its value. You could also just hardcode the value for testing as well.

Dan East
Should the path be \Storage Card\quake2\baseq2\pak0.pak in the compiler, or /Storage Card/quake2/baseq2/pak0.pak?
Use the former syntax.

After you start debugging, hit View->Debug Windows->Watch in eVC++. When you hit a breakpoint you can type (or drag / drop) a variable name into the left column. Its value will be displayed on the right. You can edit the var's value there as well. You can also right click on the var and hit QuickWatch. I seldom use that though - I keep the watch window docked to the right of the variables window.

You can also edit the var in the variables window if the var you need is being shown. I tries to show variables that are referenced near the break point, but I got tired of it not doing such a great job, so I almost always do it manually with the watch window.

Dan East
So use the backslashes?
Right: \Storage Card\quake2\baseq2\pak0.pak.

Dan East
Ok, what's up now? I just received my iPAQ back from Compaq (bad ROM upgrade) and I put in my microdrive and installed PQ2. I installed PQ2 to the RAM on my ipaq in \Daniel East's Pocket Quake 2 or whatever and my pak file is in Storage Card\quake2\baseq2\pak0.pak. It says 'Can't find pics/colormap.pcx' what's up?
It sounds like the file on your CF card is corrupted, or there may be a problem with the actual CF hardware. Have you tried copying the file back off of your storage card to see if it will work with Quake on your PC?

Dan East