Procedures in Main.asm

All procedures owned by All, mostly written by Charlie Pikscher

Included Files:
    Macros.inc - general purpose macros
    Structs.inc - game data structures

Segements:
    Stkseg:  Run of the mill stack segment

External Procedures and Variables:
    Dosxit:  From Lib291
    NetInit: From NetLib
    SendPacket:  From NetLib
    NetRelease:   From NetLib
    NetTest:       From NetLib
    TXBuffer, RXBuffer:  From NetLib

    Installer:  From logic.asm, installs the keyboard and mouse handlers
    Uninstaller:  From logic.asm, uninstalls the keyboard and mouse handlers
     Intro:  From network.asm, does the game intro (main menu, joining the network)
    TimerUpdate:  From logic.asm, controls counters for movement
     CollisionDetect: From logic.asm, detects if ship has been hit
    RedrawScreen:   From animate.asm, redraws the screen w/ double buffering
    SendGoodbye:    From network.asm, tells other players that you have left the game
    ShowMenu:  From animate.asm, displays pcx images (main, win, lose, credit, and instructions screens)
     PLAY_WAV:  From sound.asm, plays a wave file
    PlayIntroMidi:  From sound.asm, starts the intro midi
    PlayGameMidi:  From sound.asm, starts the game midi
    StopMidi:  From sound.asm, stops the midi currently playing

Variables:
    NumberPlayers         db 1 : The  # of players in the game
    MyShip PlayerType   {} : All the information about your ship
    EnemyArray              EnemyType 3 dup (< >) : array holding the info of the other players
    NumProjectiles          db 0 : # of projectiles currently on screen
    ProjectileArray          ProjectileType 50 dup (< >):  array of info on all projectiles currently on screen
    Killed                        db 0 : 0 = player alive, 1 = player was killed
    ExitFlag                    db 0 : To exit the program or not - 0 is play, 1 is exit
    pbuf                         db 7 dup(?) : used by macros.inc for debugging
    crlf                           db CR,LF,'$' : used by macros.inc for debugging
    grp_name                 db  'BattleBlue$$$$$$' : Used by NetLib to set up network stuff
    my_name                 db  'BattlePlayer00$$' : Used by NetLib to set up network stuff
    rxinvalid                   dw 0 : Number of Invalid packet types - Used for debugging of NetLib
    rxhello                      dw 0 : Used for debugging of NetLib
    rxupdate                   dw 0 : Used for debugging of NetLib
    rxgoodbye                dw 0 : Used for debugging of NetLib
    rxbadlength               dw 0 ; Number of Wrong-length packets
     WinPCX                  db 'win.pcx',0  ;win screen
    DeadPCX                 db 'dead.pcx',0 ;dead screen
    CreditsPCX              db 'credits.pcx',0 ;credits screen

Procedures:
    Main:
        Input: none
         Output: none
         Purpose:  Controls the flow of game play.  Basically is a loop calling the logic and redraw
                        procedures.  Psuedocode follows:

                        Play the intro midi
                        CALL Intro     ;get connected to network
                        Play the opening wav files and start the game midi

                        Install the mouse and keyboard handlers

                Loop:
                         CLI
                         Call UpdateTimer, CollisionDetect, and RedrawScreen
                         STI
                Loop until you win (only one player left), die, or exit early

                Send a goodbye, release the network, uninstall keyboard and mouse handlers
                Show win or lose screen if you won or lost and play sound associated w/ it.
                Show credits, return to textmode, and exit program