This is a job for Assembly language.
There is just so much to do (more than you expect) and so
little time to do it in.
A modern team would probably prototype in C (+/-) but only to flesh
out what they were trying to do. Then they would start coding the
inner loops in Assembly until it ran fast enough (that's a joke!).
In the end, it winds up all Assembly anyway, just compiled rather
than assembled. And using the compilers STDLIB, rather than mine.
I dug up this old Clunky CGA graphics hack, but it demonstrates some
of the processing power (and the technique) needed to do vector graphics
for something like an attitude display.
This started out on a 16 Mhz AT.
I think it showcases my high speed line drawing routines quite well.
Which is really why it was written.
(one of my "acquired" computer skills - Multi-lingual programmer
http://www.home.earthlink.net/~tp-1/HUD/HUD01.ASM
http://www.home.earthlink.net/~tp-1/HUD/HUD01.COM
Files:
HUD01.ASM 56192 bytes long.
Assembly language source code for a clunky CGA Heads Up Display Demo.
Straight forward assembly with MASM 5.1
Copyright reserved. Non commercial use (unless I get to play too)
HUD01.COM 4785 bytes long
Caution! Executable file!!!
It was clean when I put it up on the web, but you might take note of
the file size, and scan if you feel you should.
The slider displays (vertical read out?) are driven from the keyboard.
Top row - Q to P.
UC INCREASES, lc decreases.
G toggles the gear.
ESCAPE key to quit.
Flight is via the keypad keys: 1- 9
It does weird barrel rolls....
Richard
;Update header from HUD01.ASM
;======================= COMMENTS ========================
;
; Due to the large number of variables needed, and the rather limited
; register architecture of x-86 processors, all variables, flags, etc.
; are located in main memory. No attempt is made to keep certain things
; in specific registers. Subroutines protect the contents of registers
; when necessary. Most of the storage locations are defined at the
; end of this file, however, the circle coordinates are located in an
; external file: "HUD01G.CIR", which was generated by "CIRCLE4A.BAS".
;
;======================= UPDATES =========================
; 09/27/89 * Started HUD01 attitude display program.
; Program uses CGA graphics screen and direct video memory
; writes for maximum speed.
; 09/28/89 * HUD01G1.CIR file generated by CIRC4.BAS
; 09/30/89 * Preliminary program working properly ok.
; Drawing rate is a bit slow due to the complexity of the
; calculations required for direct screen update.
; 10/10/89 * HUD01G1.CIR modified to include markers every 90 degrees
; to make it easier to find horizontal/vertical coordinates.
; 10/13/89 * killed bug in line drawing routine that caused fuzzy circles.
; 10/16/89 * modified X_LINE to make S_LINE routine.
; X_LINE uses XOR, S_LINE just plots...
; 10/22/89 * Pitch bar wraps around at 90 degrees.
; 10/25/89 * Roll and Pitch interaction working smoothly.
; 11/08/89 * Added routines to interface to the external sensors via X-BUS.
; 11/10/89 * Killed the final bugs (?) involving table wrap
; 11/12/89 * Doubled control response rate (by cheating).
; 11/14/89 * Rewrote keypad parser for simultaneous pitch/roll
; Keyboard parser uses numbers 1-9 for inputs.
; 11/18/89 * Numlock turned on/off automatically on entry/exit.
; 11/20/89 * Added vertical readout boxes to screen
; Added EOC and BOC routines to reduce size of code (about 1k).
; These check End Of Table and Beginning Of Table.
; 11/22/89 * Added INVERTED indicator, gear displays.
; 11/25/89 * Added vertical display indicators, slight modifications to
; panel layout to allow simple character indicator.
; Uppercase input moves indicator UP, lowercase moves down.
; 11/28/89 * Moved attitude display to seporate routine.
; Flags used are P_Invert & R_Invert
; 12/02/89 * Fixed minor bug in PrintC (wrong print interupt)
; * Modified Show_Cross to get pitch value from P_BAR.
; Pitch and Roll now run continously (0-360).
; P_Bar wraps at 90 degrees to correct horizion motion.
; 12/04/89 * Added Heading/Reciprocal display
;************************************************* ********
; This routine simulates sensor inputs via keyboard.
; In fully implemented form, the sensor inputs would come from
; the vertical gyro instrument, probably through an ADC S80 chip,
; since the gyro outputs normally drive a synchro-resolver motor.
;
; When sensors are used for input, the local processing found here
; (upper and lower limits) would be added to the sensor driver code.
; The keyboard routine is implemented as a linked list below.
;