Game Development and WinROTT

by Codewiz51 February 02, 2010 18:48

In order to work on the current releases of WinROTT, you need to be familiar with GameDev.Net, and the circa 1999-2000 articles.  I've found the series Game Programming Genesis by Joseph Farrell to be informative.  Part IV : Introduction to DirectX is helpful for understanding older versions of DirectX and why developers may have followed a particular path that no longer makes sense.  You also need a solid understanding of COM when working with older versions of DirectX, the components tend to be most accessible via COM/ActiveX interfaces.

Good luck with your game programming.  And remember to visit GameDev for the latest development techniques.

Changes to WinROTT

by Codewiz51 December 22, 2009 09:34

Birger has made some nice changes to WinROTT, called WinROTTAPI.  I've downloaded the source and I am checking out how I might integrate Birger's changes into my branch of the game.  Many thanks to Birger for this work.

Back to hobbyist programming...

by Codewiz51 February 02, 2009 19:56

Finally, I can get back to the projects I love. I managed to complete the conversion of some software to work with Vista. The install package required quite a bit of modifcation as well. (UAC is definitely an abomination. There has to be a better way to implement it.)

There's a new WinROTT release 10.  I haven't made any progress converting to modern DirectX code. I am still trying to decipher the documentation and the scheme WinROTT uses to display graphics. To be honest, I am somewhat bewildered by all that is going on with DirectX. Maybe I'll start to click with it soon.

An Interesting Warning in C and C++

by Codewiz51 January 08, 2009 18:47

While working on WinROTT, I have come across a couple of warnings that may actually be serious bugs. One warning is C4309: 'initializing' : truncation of constant value.

This appears to be innocuous. But maybe it's not.

The following statement generates a C4309 warning:

signed char tx = 0x80;

The value of tx is -128 after this declaration and initalization occurs.

Let's assume this is followed by:

// value of tp is 128
unsigned char tp = 0x80;
bool tc = tx == tp;

What's the value of tc? You might think it is true. But in reality, the comparison is -128 == 128 which is false.

This may be a contrived example. But consider when you are working in a normal c++ program, where the type may be hidden:

// header file (.h)
#define SF_BAT      0x80

// Forward only linked list
typedef struct  statestruct
{
    byte                rotate;
    short               shapenum;    // a shapenum of -1 means get from ob->temp1
    short               tictime;
    void                (*think) (void *);
    signed char      condition;     // GH originally signed char
                                             // Caused 0x80 to be assigned as -128
    struct statestruct    *next;    // Link to next struct
} statetype;

// implementation file (.cpp)
// C4309 warning occurs here
statetype s_batblast4 = {FALSE,BATBLAST4,3,T_Projectile,SF_BAT,&s_batblast1};

// Here's where the execution problem occurs
// This comparison will always return false
if (s_batblast4->condition == SF_BAT)
{
    // Do something here
}

The moral is, don't ignore warnings. They may not be harmless. In this case, changing condition to unsigned char is the correct fix.

WinROTT and the modexlib.cpp implementation

by Codewiz51 December 18, 2008 08:06

I spent the evening studying the modexlib and tracing code execution paths. I need to understand how WinROTT is addressing video memory so that I can begin the translation to Direct3D 9. The learning curve is steep. I haven't looked at video memory layouts in 15 years and I have no recollection of ModeX VGA modes.

I am working on the idea that WinROTT will render to a texture which can then be bit blitted to video memory. I've got a rendering framework put together from several examples in the Direct3D 9 SDK, but the physical format WinROTT is using for video buffers is very different from the format needed for a texture.

At the moment, the task is well defined:

  1. Learn Direct3D 9
  2. Understand how WinROTT is addressing video memory (i.e. how is it drawing graphics?)
  3. Translate the existing WinROTT video routines to something Direct3D 9 can understand

I'm also still in the process of performing code cleanup and modernization. I'm working on some aspects of the code that can utilize threading to improve performance.

Powered by BlogEngine.NET 1.6.0.0
Theme by Mads Kristensen | Modified by Mooglegiant


Disclaimer

This blog represents my personal hobby, observations and views. It does not represent the views of my employer, clients, especially my wife, children, in-laws, clergy, the dog, the cats or my daughter's horse. In fact, I am not even sure it represents my views when I take the time to reread postings.

All comments are moderated for content.

© Copyright 2008-2010