Hi Tom N
The salient code portion to calculate the Mach Number is found inside MODEL.ASM file:
(http://www.moodurian.com/tornado/images/di_tor_speed_mach_01.png)
When you need to search for a string inside an entire folder, you need a tool like Agent Ransack to retrieve every file
that contains the search value, and shows you where in which lines the search value is found.
[/size]
(http://www.moodurian.com/tornado/images/di_tor_speed_mach_02.png)
Variables declarations.
(http://www.moodurian.com/tornado/images/di_tor_speed_mach_03.png)
Calculation of true air speed (Vtas variable)
(http://www.moodurian.com/tornado/images/di_tor_speed_mach_04.png)
Calculation of Mach speed (Mach1 variable)
(http://www.moodurian.com/tornado/images/di_tor_speed_mach_05.png)
How DispMachNum is derived. Converts MachNum[*16] to *10 scaled (MachNum * 5 / 8)
I've attached the MODEL.ASM file in this post.
Hope this helps,
Frankie Kam
Hi Tom
https://github.com/tornadorebooted/tornado-dos-flightsim
You can download the source code by clicking on the "Clone of download" button.
Regards
Frankie Kam
P.S., In case you are interested, the attached work-in-progress FLIGHT.EXE uses the bottom status bar to show the airspeed in both Knots and Mach.
(http://www.moodurian.com/tornado/images/machknots.png)
Hit the '4' key or Alt+H to change from one unit of measurement to the other.
The Mach/Knots value in the simulation is also shown on the HUD when you hit Alt+h.
(http://www.moodurian.com/tornado/images/machknots2.png)
Hope this helps.
Frankie Kam