• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Editing FS98 Gauges

Messages
62
Country
unitedstates
Hello All,

I was playing around with piston multi engine gauges from the Cessna 182 on a Combat Flight Simulator aircraft recently.

The Tachometer generally looks useable except that the RPM shown on the dial is consistently about 150 percent of where it should be. Is there an easy way that I can edit this gauge to read correctly? (The Extra 300 digital gauge reads correctly except it is too modern for an old warbird.)

The Manifold Pressure gauge also does not have quite as much range as I need: It reads to 35 inches and I need about 50 inches.

On both of these gauges, I could probably exchange the Bitmap except that the range of readouts is just a bit too low.

Hex Editing?
Other Ideas?
- Ivan.
 
I've got a ton of gauges that I have made from old FS98 bitmaps.
What range are you looking for in the rpm gauge?

Doug
 
Hello Doug,

I am not really looking for a workable gauge so much as I am trying to figure out how to do it on my own with a little guidance.

I know my way around a hex editor reasonably well and have a couple decades experience as a C programmer and have written plenty of utilities for messing around with AIR files, SCASM source and AF99 stuff, so hopefully that is enough background to figure out how to edit a gauge or program one from scratch.

It isn't so much the result as the technique that I am interested in.

Thanks in advance.
- Ivan.
 
If you want to create gauges for CFS, you will need to use C/C++.
Have a look at the ESP SDK - http://msdn.microsoft.com/en-us/library/cc527031.aspx

Microsoft's gauge code makes very heavy use of macros, which makes it a little bit difficult to truly understand what the code is doing, but once you get the sample gauge project to compile, it's not that hard to use one or more of the sample gauges as a template for the gauges you really want to create.

You will of course need a C compiler. I would strongly suggest you use whatever version of Visual Studio you have available. Download the most recent version of VS Express if you don't have any other installed.

You can't really edit FS98 style gauges. You can mess around with the bitmaps with a resource editing tool - the gauges are just Windows dll's, with a different extension.

Doug
 
Thanks for the details. At the last job, I used MSVC a bit but I use Gnu C at home. I understand that Gnu C is also useable in some manner for this purpose. Will do some more reading.

- Ivan.
 
[...] but I use Gnu C at home. I understand that Gnu C is also useable in some manner for this purpose.
I still use MinGW to compile gauges (and other non-gauge DLLs) for FS2004. In case it's helpful, check my reply in this thread about GCC and MinGW. If you decide to take that route and run into any problems, I'd be happy to try to help. Whatever route you take, good luck!

Jester
 
Thanks TGibson,

I came across Resource Hacker with the same idea in mind but wasn;t sure if it would work. There is of course the standard GAU2BMP which I downloaded years ago but never used.

The FS98 C182 Tachometer would be perfect except that the RPM reads from 0-3500 but since the readout is 150% of the real value, it gets pegged at around 2350 and this engine hits 2600 RPM. Jerry Beckwith has a gauge that looks identical but actually reads correctly.


Hello Jester,

Regarding MinGW, is there any advantage to MinGW versus DJGPP? I have DJGPP installed in a couple old machines and was about to load it on my current laptop. There isn't a Vista specific installation for DJGPP.

If I can figure this stuff out, the next step is would be to create a few fuel selector gauges to match oddball configurations that are often found in the old warbirds. In the back of my mind, I am wondering if the "standpipe reserve" idea is workable.

Thanks.
- Ivan.
 
There is of course the standard GAU2BMP which I downloaded years ago but never used.
Depending on how many years ago you downloaded it, you may want to grab the newer version (which runs as 'gaubmp2.exe'):

http://simviation.com/fsdesign_panels1.htm

Search for "FS98/CFS/FS2000 GAU to BMP utility".

I successfully used it back in July on some gauges that the older version (which runs as 'gaubmp.exe') would not handle. The new version worked under both WinXP and Linux + Wine. But be aware that even the newer version didn't work on every gauge I tried.

Regarding MinGW, is there any advantage to MinGW versus DJGPP?
I'm not sure. I've successfully used DJGPP before for compilations (but not for flight sim stuff) but it's been a long time.

For flight sim stuff, when I switched away from Borland C/C++ 5.x, I tried MinGW first. Once I found that it worked fine, I never got around to trying gauge compiles with DJGPP, although it was on my list, right after MinGW and Cygwin. I suppose if you try DJGPP and have issues, at least you know that MinGW should work as a fall-back plan.

Please keep us posted on whatever you try and how well or poorly that works. I'm definitely interested in how it goes. Good luck!

Jester
 
Last edited:
Status Update:

I eventually chose to go with MinGW instead of DJGPP.
DJGPP works fine on the older machines I use (Windows 98 and Windows 2000), but hasn't had an update in years. Latest is still version 2.03. I also wanted to test something different and can port back to DJGPP if I am successful with MinGW.

Installation took about 2.5 Gig but I believe I installed much more than I needed to. Their installation software is not very stable. All that is necessary to run is to set the MinGW/bin directory into your command path.

The ubiquitous "Hello World!" program compiled and ran about an hour ago. Compilation is amazingly slow.

- Ivan.
 
I haven't used MinGW in years. In actual fact, I didn't really even use it then! It was the compiler installed by EasyGauge, which unfortunately ceased to be sold years and years ago. The authors apparently vanished into the void... :(

That's a shame since it really was a pretty neat program for FS98 style, single gauge creation.
 
Thanks for the update, Ivan.
Installation took about 2.5 Gig but I believe I installed much more than I needed to.
You're undoubtedly right. I took a look through my notes from the last time I installed MinGW (Jun 2010) and found a list of the files I downloaded:
  • binutils-2.20.1-2-mingw32-bin.tar.gz (11,285,937 bytes)
  • gcc-core-4.5.0-1-mingw32-bin.tar.lzma ( 4,146,193 bytes)
  • mingw32-make-3.81-20090910.tar.gz ( 238,633 bytes)
  • mingwrt-3.18-mingw32-dev.tar.gz ( 568,649 ytes)
  • mingwrt-3.18-mingw32-dll.tar.gz ( 8,122 bytes)
  • w32api-3.14-3-msys-1.0.12-dev.tar.lzma ( 1,138,299 bytes)
  • libgmp-5.0.1-1-mingw32-dll-10.tar.lzma ( 159,027 bytes)
  • libmpc-0.8.1-1-mingw32-dll-2.tar.lzma ( 24,146 bytes)
  • libmpfr-2.4.1-1-mingw32-dll-1.tar.lzma ( 111,144 bytes)
Total download size: 17,680,150 bytes

With everything extracted, my whole working 'c:\mingw' directory content is under 68 MB total.

That list of files above is all I needed to install (on WinXP) to get MinGW working to compile FS2004 stuff. Sorry for not posting that earlier. But, in reality, that list might have changed since June 2010. One of these days, I'll do a clean install of the latest version of MinGW and (memory willing) post about it on this forum.

The ubiquitous "Hello World!" program compiled and ran about an hour ago.
Excellent! Of course, the real test is if it will compile a gauge that FS2004 will load/use. That thread I referred to in my 1st post was from someone who got a gauge to successfully build with MinGW but FS2004 refused to load it. Sadly, he never returned to tell us why or get more help.

Compilation is amazingly slow.
I'm a bit surprised to hear this. Whenever I compile a gauge with MinGW (over the local network, even, because my gauge source code resides on a Linux PC), it's pretty much done in a few seconds. In fact, so that we might have a common point of reference, I just tried compiling the ubiquitous FS2004 SDK gauge set of 7 simple demo gauges and it took a mere 2 seconds with MinGW.

Just curious... do you have a slow CPU (I'm using an "AMD Athlon 64 X2 6000+" [3.0 GHz] with 1 GB RAM) or maybe some inappropriate MinGW compilation setting (not that I know what those might be, off the top of my head)? I'm just curious what "amazingly slow" really means.

Thanks again for the status update. Looking forward to any clarification and/or further updates you might offer.

Jester
 
I think I lied about the disk space. I was also working on some other stuff which may have taken a bit more space than expected.

Actual disk usage of the MinGW directory is 1.26 GB.
Specifications of my laptop are
2.00 GHz AMD Turion
2.00 GB Memory
MS Vista Operating System

Next step is to download some source from Microsoft for their sample gauges to try to compile. I was poking around at the SDK links but did not find any easily downloaded code.
I also need to do some reading as to how one gets from Object file to DLL and other such "obvious" details a veteran gauge programmer would already know. I have programmed objects for shared libraries on Unix boxes but I suspect the mechanics are different for similar functionality.

My end result is actually intended for Combat Flight Simulator rather than FS 2004.

The response time for MinGW does appear to be a lot slower than for DJGPP but the machines I have for each compiler are not comparable. "Hello World" only took a few seconds to compile but I am used to much quicker response from the old Windows 98 machines.

Thanks.
- Ivan.
 
Actual disk usage of the MinGW directory is 1.26 GB.
For anyone who might be scared off based on that reported disk space usage number, just be aware that even that reduced figure is still way more than the space required (a mere 68 MB) for a MinGW gauge compilation setup.

Next step is to download some source from Microsoft for their sample gauges to try to compile. I was poking around at the SDK links but did not find any easily downloaded code.
The sample gauges are in the MS FS2004 'Panels and Gauges' SDK, which is available in several spots on the Internet (but, strangely enough, apparently not at Microsoft's site!). It's even available at this forum. The file is 'panels_sdk_setup.exe' and, when extracted, should yield the FS2004 sample gauge set I referred to earlier, under the 'Panels_SDK/sample/' subdirectory.

I may have more to add once I've had a chance to do a couple of tests....

Jester
 
After a bit of poking around, I found SDKs for FS2000 / CFS as well as the FS98 SDK. I also found the GaugeDMP utility which can take a FS98 gauge and generate C Code from it.

Now that I have some source code to check out (Starting with the FS98 SDK since I know that other than the scale, the Cessna 182 Tach basically works), I am trying to get that to compile.

The Microsoft makefile that comes in the SDK isn't compatible with the MinGW32-make utility. There are also type conflicts between MinGW and the Gauge source such as a UINT32 being a "unsigned int" as versus a "unsigned long".

I believe I have a fair idea how to modify the gauge pointer to change the range of movement and edit the bitmap to correspond.

No success yet and am still playing.
- Ivan.
 
No success yet and am still playing.
Ivan,

Attached is a 'makefile' which should compile the FS98 SDK's 'control surface (and pitch trim) position indicator' gauge ('SDK.Control_Surfaces.*'), or any other gauge in that SDK -- I just chose that one at random. I've just now successfully built that gauge under the latest version of MinGW (described in greater detail here) using the files straight from the FS98 SDK, with only one minor change in one of the SDK source files (see below).

Even better... I've also tested that FS98-era SDK sample gauge in CFS1 (and CFS2) and it works fine.

The 'gauges.h' file that I used is the unmodified file from the FS98 SDK, simply copied into the same directory as the SDK source code, for convenience.

The MinGW-compatible 'makefile' I've attached is from the well-known 'sd2gau' C-language gauge creation tutorial by Dai Griffiths. (Look for 'sd2gau31.zip' if you haven't gotten that yet -- it's a very good introduction to C-language gauge creation.) I've made 5 very minor changes to Dai's example MinGW makefile to make it work. Dai's makefile is rather different from the makefiles I use for MinGW gauge compilation, but I wanted to use something that was generally available to anyone reading this (now or in the future) who's looking to build FS98 or CFS1 (or even CFS2) gauges.

Aside: Frankly, I suspect that my modified version of Dai's makefile would still work on everything since FS98, with the proviso that the proper 'gauges.h' file was used based on the targeted version of the simulator (FS98, CFS1, FS2000, CFS2, FS2002, CFS3, FS2004, FSX -- I think that's the proper chronological order!). But I've only actually loaded/tested the compiled FS98 sample gauge on CFS1 and CFS2.

As for the change to that SDK source file, it was needed to work around what looked like an ugly hack by Microsoft for their C compiler. In fact, the comment in the offending area says "magic to get the preprocessor to do what we want". Here is the (trivial) change to be made:

In file 'SDK.Control_Surfaces.h', change this line:
Code:
#define		cat3(w,x,z) w##.##x##.##z##\000

To this:
Code:
#define		cat3(w,x,z) w##.##x##.##z

Now, as you know, your compilation of a more complex gauge than the FS98 SDK 'Control Surfaces' gauge will almost certainly lead to other issues to be solved, but I can see that you're well on the way to dealing with those and I don't expect you'll have too many unsolvable issues given your C experience.

BTW, what gauge are you trying to compile with MinGW? You've talked about the C-182 gauges, presumably from FS98, but I don't think there was ever any published source code for those gauges, was there? If you're using Bruce Hellstrom's GaugeDump ('GAUGEDMP.EXE') utility to extract the source, I think you'll run into the issue that (IIUC, I've never actually used it) his utility only creates C source code for the elements of the gauge, leaving you to fill in the gauge handling (etc) C code.

I hope this makefile for MinGW gets you on the right track, so that you can at least get something that compiles and runs under CFS1 (and FS98, although I didn't test it under FS98).

Good luck and let us know if you need more help....

Regards,
Jester
 

Attachments

Hi Jester,

Thanks for the sample Makefile. That wasn't quite where I was getting stuck.
I figured out pretty early on that the syntax of the FS98 SDK Makefile was a touch off. I found that in places, they are using spaces instead of the required <tab> character (causes a 'Missing Separator' error) and commented out some of the other things MinGW32-make was objecting to.

I also copied the binary to 'make.exe' because I kept forgetting what the MinGW version was called.

I also found that the GAUGEDMP utility was just giving a minimal amount of code. The Dai Griffiths tutorial is really quite good and I am reading through it. That is where I finally found out how the dial and pointer worked, but I have not gotten far enough to actually test things in a compiled gauge.

I am using the SDK Temperature Gauge (which is based on the Cessna 182 gauge) to start because I figure it is a dial type gauge rather than a bar / scale as the Control Surfaces are likely to be.

With MinGW, I installed EVERYTHING I thought I might ever need which is why it is 1.26 Gig. The issue I am having here is that the gauges.h file tries to include <windows.h> which sets a whole hat full of definitions such as UINT32, UINT64 and such which conflict with typedefs in gauges.h.
I believe that the values are being set based on Windows Version and whether it is a 64 bit OS picked up as environment variables.

This morning, just to make a clean break, I moved the FS98 SDK to my Windows 98 machine which has a DJGPP version of Gnu C. The issue there is that there isn't a <windows.h> file at all in the compiler include directory.
The compile barfs with a couple pages of errors which appear to be a lot of missing structure typedefs.

I know that the SDK code needs them. I know that the DJGPP install I have doesn't have them. I know that the MinGW definitions are not in agreement.

Now I am looking for a <windows.h> file from an installation of MSVC which I presume will have the typedefs I need.

Thanks for the help!
Am still playing!
- Ivan.
 
I also copied the binary to 'make.exe' because I kept forgetting what the MinGW version was called.
Boy, does that bring back memories. I should've done that 3 years ago, but the 'mingw32-make' name is burned into my grey matter now, I think. :) (At one point in the past, on a Win98se laptop, not for FS stuff, I had Borland, MinGW, CygWin, and DJGPP all installed and usable -- try keeping that straight! :))

I believe that the values are being set based on Windows Version and whether it is a 64 bit OS picked up as environment variables.
That reminds me that I neglected to mention: I'm running 32-bit WinXP-SP2 on the flight sim PC and I had no such issues. Unfortunately, I don't own any 64-bit version of Windows, but I strongly suspect that you're right about that having an impact. I (somewhat foolishly) hadn't even considered that before now, actually. I think I need to modify my post in that MinGW thread I started, in order to make that clearer.

Just to be 100% clear -- is your laptop Vista installation 32-bit or 64-bit?

It will be interesting to see how it all pans out....

Regards,
Jester
 
Hello Jester,

Tried out the same process with a the FS98 SDK files with only the modification in the .h file per your recommendation.

The compile went great. The result was a .gau file as expected.

The next step was to try the same with the SDK Temperature gauge.
The compile barfed as it did before. The difference appears to be that the Control Surfaces gauge doesn't include <windows.h> and the Temperature gauge does.

Now what?
- Ivan.

P.S. 32 bit Vista installation.
 
Back
Top