L I N E W A R S Version 1.xx Made in Finland by Patrick Aalto Technical Information LineWars is compiled with Turbo Pascal 5.0 (currently 1000 lines) and Microsoft Macro Assembler 4.0 (very many lines). The source code takes about 400KB of disk storage. LineWars is constructed as a Pascal main program having various Assembler units to call. The whole graphical game is one unit. Initial Procedures When LineWars is started, it first checks that you really do have an EGA card. It does this by checking that EGA ROM BIOS at address C000h:001Eh...0020h contains letters 'IBM'. If not, the program is terminated to prevent possible damage on your non-EGA display. When LineWarC is started, this check is not used. After that check LineWars reads in the settings-file. It first checks the command line parameters and reads the file mentioned, if it exists. If not, default settings are used. If no command line parameters are given, LineWars tries to read a file LINEWARS.SET. If it cannot be found, again default settings are used. When settings are read in, LineWars takes posession of a RS-232 line and it's interrupts. It does this whether War Mode is Duel or Single. If Baudrate is not 'Check', LineWars also changes the baud rate of the appropriate com port. After that the current screen contents are saved and Main menu is shown. If Connect Mode is 'BBS-"door"', LineWars sends it's logo to communications line. Cursor is also made hidden now. While in Main Menu, the line is constantly monitored to check if we received an order to play ('î' = ascii 238) or to start terminal ('ì' = ascii 236) or, if 'BBS-"door", a request to quit (ctrl-X). If none of these is received, LineWars checks if the user requested an action. If so, that action is taken. If the action was Terminal, an ascii 236 is sent to line, and if the action was 'quit', ctrl-X is sent, unless in BBS-"door" mode, when ascii 236 is sent to make the other side start terminal mode and receive 'LineWars quitting'- texts. If Play is selected, then EGA / CGA appropriate graphics mode is selected and the Cobra IV cockpit drawn on the screen. If War Mode is Duel, LineWars shows a 'wait for connection'-message and begins to wait for incoming 'î'. If one is not received within half a sec, 'î' is sent to line. This repeats until 'î' is received or the user presses ESC. After a succesfull connection, LineWars sends to line your codename plus information whether your Key Damp is on or off. It then tries to receive that information. When this is done, the game starts. When in game, first the keyboard interrupt is changed to make a distinction between control- and letter keys. Then all meters are drawn, the MainViewer opened and the line begins to transfer info about which keys the user presses. After your shield energy is totally exhausted, your computer will say 'Ouch, that hurts' and your opponent will see your ship explode. The human voice is part of a digitized speech demo I came across while developing the game. I think it sounds pretty nice, but you may disagree. You cannot turn it off, however. There is a chance that this speech procedure will hang a 4.77 Mhz machine, but then again who still has such a machine? (with EGA!) :-) That digitized speech, together with the procedure to drive speaker, takes less than 2 Kbytes of code, by the way. Line Protocol When in actual battle, LineWars sends and receives one byte per every new frame. That means the line must be able to transfer 18 characters per second if the Framerate is 18Hz. This is because the game needs to be synchronized between two machines running possibly at different speeds. If you press a letter-key (or <Ù or BACKSPACE) it will be sent between two synchronizing bytes so that the line should actually be able to transfer about 30 bytes/sec. at maximum. The transferred bytes are coded as follows: 7 6 5 4 3 2 1 0 = bit position ÚÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄ¿ ³0³?³1³?³?³?³?³?³ = Any non-control character (ascii 32..127) ÃÄÅÄÅÄÅÄÅÄÅÄÅÄÅÄ´ ³1³0³L³R³U³D³x³x³ = Left/Right/Up/Down -key pressed. x = Not used. ÃÄÅÄÅÄÅÄÅÄÅÄÅÄÅÄ´ ³1³1³L³M³D³I³E³x³ = Laser Fired/Missile Fired/Decrease Speed/ ÀÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÙ Increase Speed/Enemy Exploded. If no key is pressed, ascii code 128 is sent. In addition to those, ascii codes 13 and 8 are used for sending RETURN and BACKSPACE. As you can see, only the most important information is passed. This may result into very different environments at different ends of the line, but usually one battle does not last long enough for this to be notable. Possible line errors may corrupt or stop the game from running. If this happens, just press ESC, wait a little while and try the game gain. Future versions of LineWars will use a line checking method.