FALCON-START-SEQUENCE

PRELIMINARY
Startup Sequnces in: WinMain.CPP


LRESULT CALLBACK
Win32-FUNCTION BODIES


 
 
NAME OF MESSAGE HANDLER Where and what.
FalconMessageHandler StandardUIHandler
SimWndProc Simulator
ACMIWndProc ACMI
CampaignWndProc CAMPTOOL version
ToolWndProc CAMPTOOL version
PlayVoicesProc CAMPTOOL version

NOTES:
1. The HandleWinMain function initializes the SimWndProc while the FalconMessageHandler is activated in FalconDisplay.Setup
 
 
 

 


Threads

F4THREADHANDLE

Is used in conjunction with movie threads.

a. The ThreadManager's construction indicates that there essentially are two threads;

1. The Campaign thread
2. The Sim thread
b. The helper functions are defined and implemented this way:
 

We also become aware of the following define statement
#define F4MAX_THREADS        20

c. The VU also has conceptualized threadsafety in its design.The VUThreads class tree explains these classes further.

Identified Win32 threads

Threads are spawn via regular Win32 calls. Either _createThreadex or _createThread

My Investigation has shown the following sequence of threads launched by the main application thread. But there are some threads which are activated as other threads are handled by the cpu(s).  Yes Falcon is a CPU aware application. Multi symmetric processing is though only available with NT 4.0 which to my current knowledge only in some rare hardware and servicepack dependant cases can execute Falcon 4.0. This is mainly a question of the Video and Sound hardware used. Other  available option are Win2K Professional and XP-Professional - but not XP-Home Edition.

MSP-aware threads

which is run exclusively with a second CPU.

A. Pre Win32 MessageLoop activated threads

During setup of the application and as part of the HandleWinMain function

B. Win32 Message loop activated threads

The rest of the threads are either called into life on demand or activated before the GUI actually is responding to user input: There are currently identified  4 main WinMeesages that trigger most of  the threads. Backtraceing to the origin from the threads  beeing initialized and run showed early on that the threads found in th Source code are with exception of some  sound related threads launched from single places in the source code.

1- FM_START_GAME

(This Meesage will allways be excuted before the others) Within WinMain.Cpp is the the function SystemLevelInit that is responsible for the launch of the simulator loop.

2- FM_START_UI

When this message is recieved UI  threads are activated:

3- FM_PLAY_INTRO_MOVIE

4- FM_PLAY_UI_MOVIE

both activate 2 related threads

The latter one activates a

C. UI CB activated Threads

UI sounds are often related to mouse clicks and naturally we se many instances activated of the


CRITICAL SECTIONS

F4CSECTIONHANDLE Different Critical Sections are used to synchronize the threads in Falcon
gUICriticalSection
campCritical Initialized after FM_GAME_START:
vuCritical
StreamCSection
QueueCritical
SetupCritSection
---

Functionality:

 

F4CSECTIONHANDLE F4CreateCriticalSection (void)
void F4LeaveCriticalSection F4CSECTIONHANDLE
void F4TryEnterCriticalSection F4CSECTIONHANDLE
void F4EnterCriticalSection F4CSECTIONHANDLE
void F4DestroyCriticalSection F4CSECTIONHANDLE

 
 
 
 
 
 
 

 


Processor
[SMP]


F4SetThreadProcessor
Camp_Init