Hi !I have a question. I would like to continue to edit the game Microprose GP2 with the great community of grandprix2.de (http://grandprix2.de/gp2forum/portal.php) but for this we have need the source code .. So I wondered if is it possible to disassemble this game to obtain more informations? How should it be done? Thank you very much for your answer.

Correct me if i'm wrong, GP2 seems to be a dos game executed in protected mode.- Do you know if some versions of the game contain debug symbols (sometimes it happens) ?- What kind of enhancements are you looking for (data, gfx, extending the game...) ?

If your main objective is to extend the game and add new features, it will be difficult without the source code.

The other ways are:- disassembe the game to get a compiling asm source code: hard to add new features because the game was certainly coded in C/C++/inline asm (and so the asm code may be compiler optimized -> difficult to read). New features need to be coded in asm...- reverse engineer the game in C/C++/etc: hard and (very) long task (especially for a 3D game).

When you see some games have hundred of thousands lines of code at this time (freespace, ...), i don't think it's something that can be done in a "limited" time (few years ?), without considering copyrights infringements (Sony keeps an eye on their licenses).

I've been hacking GP2 for a while, but I came to a point where it seems like there's not much more I can do. I have no debugging or ASM knowledge, so all I do is to find and change values by hex editing which is somewhat useful in GP2 becouse there's so much data stored which gives nice results when edit (game physics, performance values, etc...).

I don't expect you to jump aboard on GP2 editing (I would be glad if you want too), but maybe you can point me some directions.

First: the questions you did to Michael:

Kroah wrote:Hello Michael,

Correct me if i'm wrong, GP2 seems to be a dos game executed in protected mode.- Do you know if some versions of the game contain debug symbols (sometimes it happens) ?- What kind of enhancements are you looking for (data, gfx, extending the game...) ?

- I don't know about debug symbols, but there's a program called GP2lap which loads the game on its own memory and it reads (and I think it sometimes writes) data in GP2 memory at specific game events, may that be a clue that such symbols do exist?

- About enhancements: on the gfx side, GP2 evolved already a lot by just replacing the old graphics with better ones. Also, in the 90ies there was a huge community and great tools were created, like the Track Editor which allow us to create complete new tracks for the game. There are a lot of things we would like to see improved, but the most important would be finding (and editing) the textures mapping for the car model. We can change the 3D model, we can change the piece of texture attached to each polygon, but we can't understand how GP2 splits the car bitmap in several pieces of texture. If we could edit that, we could make better use of the car bitmap and have better looking cars when they are very different from a F1 car.

On the non-gfx side there are much more things we would like to add, but small things could also be useful. One of those things would be to understand and override some game calculations, like the number of cars and which cars are consecutively on track at qualifying sessions or the random way the game dictates car failures, which I think could be so much improved.

About that:

Kroah wrote:The other ways are:- disassembe the game to get a compiling asm source code: hard to add new features because the game was certainly coded in C/C++/inline asm (and so the asm code may be compiler optimized -> difficult to read). New features need to be coded in asm...- reverse engineer the game in C/C++/etc: hard and (very) long task (especially for a 3D game).

I may be very wrong, but I believe the game was coded in assembly language (becouse I believe I've read some text which said that somewhere). I have an old commented IDA database which was given to me by the GP2lap author, but it wasn't very helpful becouse I don't understand assemby and I can't open it in current IDA versions. But I think I've read its data some years ago, I have to check that. Would it be of any use?

Could you point me some reading about debugging or memory handling (there are loads of values in GP2 memory that I would be very happy if I could create a program to manage them)?

In the 90ies there was a lot of great codders working on tools for GP2, but nowadays is very hard to create anything. I'm not myself a programmer, I learned a little just enough to create some tools, but I have no idea on more advanced topics.

GP2Lap source code has been released by his author, René Smit. GP2Lap is a DOS extension for GP2. It loads GP2 on its own memory and adds and changes some of the game methods. The main utility of the program is better logging of game events, like completed laps and races. But it also works on other areas, like automatic recognition of custom tracks and their particular information (replacing hardcoded track names, tyre wear, track length, etc), extending the drawing distance for detailed 3D cars, adding IPX network capabilities, displaying overlay trackmaps during race, displaying realtime race positions and laptimes, etc...

It is also an authentication tool for GP2 internet leagues (yes, they still do exist) and because of that, the authentication code wasn't released. But anyone who wants to add features to the official authentication capable version, just need to make a pull request in Github and René will add your code to the official build.

The code is a mix of C and asm, compiled with Open Watcom.

Even if you are not into GP2, it can show you how to create a realtime extension for a DOS game. That's why I think it might interest someone here.