PocketMatrix forums

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

Descent development

Hey guys,

Here's the current status: Descent now starts on the iPaq. Shortly after the title screen, it crashes. The PC version is working all the way to the actual game.

So here's the plan: I uploaded the sources and project files for Visual C++ (PC) and Embedded Visual Tools (PPC). If you're a coder, you can fetch them.

If you make any changes to the sources as they are right now, please mark your changes clearly and send them to me.

The sources will probably need some more work before this really takes off, but I could really use some help in one area: The crash on the iPaq. It looks like an unaligned memory access, but I don't have a USB cable. If you do have one, please find the bug. :)

URL for the sources: www.pocketmatrix.com/descent_release1.zip

It's a 1.3Mb file. It DOES NOT include the data files. I'm not going to spread illegal stuff here, so find another way of obtaining them. Once you got the data, store all data files in the same dir as the executable (NOT in a data/font/demo whatever dir). Same goes for the iPaq: Store all files in the same dir.

Let's have some serious coding fun,

- Jacco.
The correct url is
www.pocketmatrix.com/phantom/descent_release1.zip
"Give me some good data
and I will give you the world"

Dan East
Let's hope it'll be a decent port...
HAHAHAHAHAHAHAHAHAHAHAHAHA!!!
HAHAHAHAHAHAHAHAHAHAHAHAHA!!!

indeed
Mike Wagstaff · 12 Sep 2001, 13:10 UTC
Less of the sarcasm, please. Shapey nicked that one off me... and it was funny when I made it. No, really, it was.* Shapeshifter (or should I call you Shiftyshape?), you should be ashamed of yourself! ;)

* That's a lie, btw.
yeah, however
Moose or Chuck · 12 Sep 2001, 14:32 UTC
As long as it's in the forum of a Project for MS Visual C++ I'll look at it, maybe even try a debug on my Casio. Of course, I don't have the embedded tools reinstalled yet from my last crash :(
Diego Cueva · 12 Sep 2001, 14:44 UTC
off-topic, but, where can I get Descent demo? I had the full version of it in my old 386, but now... :(
Moose or Chuck · 12 Sep 2001, 14:49 UTC
Diego Cueva · 12 Sep 2001, 14:52 UTC
thanks
Diego Cueva · 12 Sep 2001, 14:56 UTC
nah, they only have Descent II and III demos..
hey moosy,

would appreciate having a port for the MIPS devices ! Be sure to work on it :-)

greets,
Dada
haha, you're askin the wrong guy, moose knows less about c++ than i do about talkin to girls.
Moose or Chuck · 12 Sep 2001, 15:12 UTC
Ya, but with EasyCE the porting is a universal process. So it has worked for the Casio ever since it never worked, ya get me? But Jacco wants an on-device debug, which is what I can do. Of course, I've never tried it before, so... :( And I still don't have the tools installed.
then what was the deal with pocketcoder? you!!! you stink!!
alright, some guy asked for the required files:
The files you'll need are:
CHAOS.HOG
CHAOS.MSN
DESCENT.B50
DESCENTG.INI
DESCENT.CFG
DESCENT.HOG
DESCENT.M50
DESCENT.PHX
DESCENT.PIG
DESCENT2.ADV
(not sure about these:)
HMIDET.386
HMIMDRV.386
HMIDRV.386

I dont think there is much space to change the config. Here is my config:
DigiDeviceID=0xe001
DigiPort=0x220
DigiIrq=5
DigiDma=1
DigiVolume=8
MidiDeviceID=0xa001
MidiPort=0x330
MidiVolume=7
StereoReverse=0
GammaLevel=1
DetailLevel=5,4,4,4,4,4,4
JoystickMin=0,0,0,0
JoystickCen=0,0,0,0
JoystickMax=0,0,0,0
LastPlayer=SHAPE
LastMission=

And look what I found in the FAQ:
Q:Wait, I read somewhere about something called Quake. Isn't this it?
A:  No.  Quake is a game currently being designed by Id software, the makers
   of Doom.  Quake is promised to contain many of the features that Descent
   carries, such as true 3D.  But for now, Descent is wholly independent of
   the Quake project, and there is no overlap between the two.

Cute, isnt it? ;)
-Shape
Image
quake to be descent ? :-)

really cute. i would like to get back to those times when everything i cared about was how to drink a bottle of beer in less than 8 seconds and playing PC games all the time.(was just more fun at that time :-( ...
Moose or Chuck · 12 Sep 2001, 16:51 UTC
Image
IT BEGINS!!
Diego Cueva · 12 Sep 2001, 17:32 UTC
Image
oh. my. gawd.
I'm downloading the source right now, i'll debug in the emulator so it will be a piece of cake.
too bad EasyCE doesn't have support for the Emulator, i'll make it run anyway.

:o)
cool
Image
Diego Cueva · 12 Sep 2001, 17:56 UTC
nice eyes
why, thank you.
hehe
just wanted to try this one
it's a datatype misalignment on the first line of:

void vms_vector_swap(vms_vector *v)
{
     v->x = (fix)swapint((int)v->x);
     v->y = (fix)swapint((int)v->y);
     v->z = (fix)swapint((int)v->z);
}
All right, 720 port here I come.   BTW, is that code posted the fix, or does it need fixed?  I am still downloading the source.
Carp, thanks for the info. I'll be away till Monday (wedding of my sister in law on Friday), but on Monday I'll fix this one.
Hi,

I recognise this problem, the misalignment is due to the polygon model data which is processed in interp.c and read in, in bm.c.

One solution is to change the code that reads this data so that it always reads it byte by byte.
The other, and better solution is to re-align the data. I've written some code that does this, you can find the changes in http://www.student.nada.kth.se/~d95-rpe/ALIGNMENT.TXT. With these changes (and some other minor ones) I managed to get into the game on my Casio E-115. Although there are quite a few problems left =)

The reason I know what I know about this is that I started porting descent myself back when PocketQuake was released. I got it running at 8fps on my E-115. I also based the port on the original Mac sources. However, I never finished the port as I lost interest when the fun part was over + had to focus on other things.

If anyone is interested I could release that source code and perhaps some of the parts could be integrated into your descent port. If nothing else it gives some clues as to which fonts should be used and things like that... (Basically, the existing Macintosh code must be converted back to use a 320x200 screen size here and there).

An executable for Casio E-115:s built from my source code can be found here (in case someone wants to know what it's like to play descent on a
PocketPC. (The controls are quite a big problem...))

http://www.student.nada.kth.se/~d95-rpe/desCEnt-casio.zip.

NOTE: Because of the well-known lag problem in the Casio keyboard driver this executable bypasses that driver and reads the key status directly from memory. Therefore this executable will only work on Casio E-115 and VERY similar Casio devices. It has only been tested on a E-115.
The descent files must be placed in
\descent\
The files required are:
DESCENT.HOG and DESCENT.PIG from the 1.5 PC version of Descent.

To play:
Start the game, it takes about 20 seconds for the data to load so be patient. (Due to naive
implementation of fread).

In the menu, select things using the "recorder-button".
NOTE: be careful, the full menu system is not implemented so you might not be able to get back if you go into the wrong menu...
Just do New Game->Rookie and the game will start.

/Roland
Great, thanks a lot!!!
Can I put it to my CF-Card? I think so...
For some reason I think I'm the only one of the main board members who owns an E-115... :-D
U might be right
Wow thats cool i wonder why ir runs at 8fps, Jacco said he expected to run pretty fast.
I've got an error saying something like "Oh master of all masters, I need more lines. You gave me 555 of these, but we need 629."
at least something like that... ;)
haha, thats some funny shit.
Umm, where do I get the other files necessary to play, like DESCENT.PIG and DESCENT.HOG?  Does Descent even have a website?
buy descent or get it off the warez (difficult, no site works). try irc...
Dont bother no one on irc has old games like that.
abandonware
Mark (killzat) · 16 Sep 2001, 04:58 UTC
You will find Descent was released as Shareware much like the first episode of Doom etc. Just hunt for 'Descent shareware' and after many fail attempts you might find it.

If somebody does then post a link, thanks.
Mark (killzat) · 16 Sep 2001, 05:07 UTC
Ok found it, although nobody seems to have the shareware v1.5, only v1.4 - not that it makes any difference:

http://descent2.com/shareware/d1/
can someone upload the files i need for playing?
i have win me, and with dos things i always have lots of problems, even with the setup... :(
Moose or Chuck · 16 Sep 2001, 07:55 UTC
I have WinME and I have no problems with DOS stuff... What do you mean by problems?
Try doing a search for "Abandonware", like Descent Abandonware.

These abandonware thing is almost legal since no company bothers to complain about their Very old games being distributed.
I've found i site that has descent as abandonware. Here is the link:

http://selvacamaleon.metropoli2000.com/

Then you choose Abandonware and choose the Arcade/Action link then in the list right you can choose descent. It's the full version and is about 7 mb.

BjB
Got the same problem like shapeshifter :(
i have the demo files copied, got the same error as shapeshifter

expecting 621 strings, found 514
and plz make a version that i can put on my storage card, i have an em-500, you know, only 16 megs ram... :(
EM-500ers suck
Moose or Chuck · 16 Sep 2001, 12:40 UTC
since i have version 1.4 full version. when i run it it says cannot find descent.tex or descent.txb.. Help :(
Ah, I had this problem, too. I think I solved it by putting it to the main memory (for some reason...)
Moose or Chuck · 16 Sep 2001, 16:06 UTC
it twas in main memory :(
Shut up shapeshifter
EM500 rules
Yeah, 16 megs of RAM rule!
And who really want's a Microdrive or a CF Modem or anything? Shitty MultiMedia Cards are just enough!
And that freeeeeeeeeaky look...!
Why am I too lazy to post that many tildes?
Hi again,

First of all, because of the problems people have
had, here's a binary that can be put in any directory (including on Storage Cards), just make sure to have it in the same directory as the other files.

http://www.student.nada.kth.se/~d95-rpe/desCEnt-casio-cf.zip

The files in my Descent directory are:
DESCENT.PIG   4 920 305 bytes CRC = 0AB80428
DESCENT.HOG   6 856 701 bytes CRC = 3B0B1041
DESCENT.EXE  

The above CRCs are from WinZip...

Putting other Descent files in the directory is likely to create problems. So have ONLY the above files there. (When the program runs it creates a DESCENT.LOG but that's OK).

The executable now looks for the other files in the same directory it is run from, so that's how that works.

The files I know it works with are from the official 1.5 PC version of Descent (which I own...) Any other files are almost certain to NOT work.

If you have a version prior to 1.5 it should be possible to upgrade it to 1.5 using the patches here http://descent2.com/patches/d1/ but I haven't tried that. (In fact I can't, because I only have the 1.5 files myself).

It would be interesting to know if someone actually got it running =)

Good luck!

/Roland
I tried it on my E-125, using the data files from a site mentioned earlier in this discussion. It starts, but once I get to the menu, I cant do anything. None of the buttons have any effect, nor does tapping on the screen :(

The size of the data files I used matches the sizes of yours
Orpe

You mentioned that you read the key status direcly from memory to fix the Casio keyboard driver lag problem.  Could you post the code on how you access the keyboard directly on a Casio?  (Or provide a link to the info.)

thanks.
man, just use the 'code' tags or turn off smileys...
I'm back. Orpe, I tried your modifications, and the game still runs on the PC, so that's good. :) Sad thing is that it still crashes on the iPaq. The lines that Carp mentioned can't be the problem, your fixes got rid of those. So I sent Carp the current version for another debug session. Does anyone feel the urge to send me a USB cable for testing? :)
Mark (killzat) · 17 Sep 2001, 11:24 UTC
Perhaps it crashed on the iPAQ because it's designed for the CASIO MIPs chip.
Ehm, I mean MY version crashed. :) Odd thing is, Carp got it to run right to the options menu on his iPaq, while I can't get past the title screen. Very odd.
bernard · 17 Sep 2001, 12:49 UTC — Thanks for the Casio key code Orpe!
Thanks for the code.  Now I'm off to see if your method needs to be put in MameCE's code.  (There is a keylag problem in with the Casio that might be caused by not using your method of key press reading.)

Pocketaholic · 17 Sep 2001, 13:29 UTC
Orpe:

Interesting to note--   on the E-125, the binary that runs from main memory runs all the way to the menu and then stops responding.

However, the binary that is altered to run from the CF card only runs to the Descent title screen then crashes.

Pocketaholic:

What does the crash look like, i.e. nothing happens or some sort of error message/something appears...

When I run it from CF on my E-115 it takes about 1 minute for the menu to appear...

Pocketaholic · 17 Sep 2001, 17:25 UTC
It just freezes-  no errors.

I notice in the PC version it asks you for a player name before you get to the menu, but not in the PPC build.  

It takes about 10 seconds for the Descent title to come up on the E-125 (@200mhz) and the menu takes about 20 seconds more.

Here's some code for reading the keys directly on E-115:s (to avoid severe input lag).

/Roland (I did check the the no smilies checkbox...) It doesn't seem to work...
Code:

//
// Key Definitions
//


#define  CASIO_ACTION_UP            0x0001
#define  CASIO_ACTION_DOWN            0x0002
#define  CASIO_ACTION_PRESSED              0x0004
#define  CASIO_WINDOWS                  0x0008
#define  CASIO_PAD_UP                  0x0010
#define  CASIO_PAD_DOWN                  0x0020
#define  CASIO_PAD_RIGHT            0x0040
#define  CASIO_PAD_LEFT                  0x0080
#define  CASIO_NOTES                  0x0200
#define  CASIO_CONTACTS                 0x0400
#define  CASIO_CALENDAR                 0x0800
#define  CASIO_MENU                     0x1000

//
// This function actually exists in the MicroSoft libraries
// but is not included in the header files (or in most documentation)
// It it documented on MSDN online though.
//

extern "C"
BOOL VirtualCopy (
LPVOID lpvDest,
LPVOID lpvSrc,
DWORD cbSize,
DWORD fdwProtect );


//
// Init code
// Sets some things up so that the specified address can be read.
// The address is 0x1400a018. At that address is a WORD containing
// the status of each key.
//

DWORD dwSize = 0xa018*2;
virtMem = VirtualAlloc (0, dwSize, MEM_RESERVE, PAGE_NOACCESS);
if (virtMem == NULL)
     Error ("Cannot allocate virtual memory range." ) ;

BOOL bRet = VirtualCopy(virtMem, (void *)((0x14000000) >> 8 ),
                     dwSize, PAGE_READWRITE | PAGE_NOCACHE | PAGE_PHYSICAL);
if (!bRet)
     Error ("Cannot allocate physical memory range." ) ;

WORD * keyStatusPort = (WORD *) (((unsigned char *) virtMem) + 0xa018 ) ;

//
// Reading the keys
//

WORD status = *keyStatusPort;

if ((status & CASIO_PAD_UP) != 0)
 // up button on the pad was pressed...


//
// NOTE:
//
//  The keyStatusPort is some sort of memory mapped hardware port and
//  because of that works in some special ways.
//  
//  * When it is read it is also cleared, i.e. if you read it again it is all zeros.
//    I think I remember this correctly, but do some tests...
//
//  * This also means that if the built-in keyboard driver reads it before you do, keypresses
//    will be lost. (In games like Descent this is not a problem though). And because the built-in
//    driver is so slow and laggy (for some reason) the game will probably almost always beat it, at
//    least if it reads the key-status often enough. The cost of reading the keystatus is basically 0.
//
//  * It is possible to determine KEY_PAD_UP and KEY_PAD_DOWN from UP and DOWN on the action button =)
//
//  * This probably isn't the Microsoft way of doing things... I have only tested it on an E-115, it seems
//    that it doesn't work on E-125 but possibly the E-125 just has that port at another address.
//
//  



hmm.... I'm still seeing smilies

i cant get it to work on my casio e125
Bump

Jacco any news on this? Is the project dead?
Orpe, dunno if your there, but can you post the source to your build? or email it to me at jm9402@aol.com
I wonder why that [code] block isn't being handled properly 4 posts up? I would take a look at the message source but I don't have admin for this forum.

Dan East
yeah, that code block is wierd. ... I want that source code!!! hehe. I know the Descent source code is freely available, but this would make things even easier. also thats only for the joystick