I am trying to understand assembly language instructions, for a DOS Game. I have looked at the following Link :- https://atrevida.comprenica.com/atrtut07.html
reading about how VGA Graphics work in DOS Games. I opened up the main .exe File for the 16 bit DOS Game in IDA Pro Version 5, a freeware version of the program that supports DOS Executables. and did a search for A000 in text I got the following result :-
I then clicked on 6000h and got the following :-
There are 10 Data Segments in the Second image, and in the AC i.e. Aircraft Folder of the Game there are 13 'S' i.e. Shape or Sprite Files. the External Graphics of the WW2 Planes. and 3 other relevant Files. So I think this code is referencing to those Files. I want to make new shape graphics to make new WW2 planes, to put in the game for fun. But I need to decode the structure of the Graphics. I have altered bytes in HxD Hex Editor Program in Little-Endian Format, in one of the 'S' Planes Files, at certain offsets i.e. FW190AS.PAC i.e. the Focke-Wulf 190A, and got altered images, not a new plane as such but coloured lines of different segments, or smaller lines depending on which bytes I alter and what value I change the current value to, the line coming out of the plane.
Is there a way I can decipher exactly, what offsets and bytes correspond to the image i.e. sprite of the plane using IDA PR0 Version 5 ? Can someone explain what the instructions mean exactly. I have looked at a wikipedia Webpage about assembly, but still not sure exactly what the code in the images I posted here mean. I know that DS means Data Segment. Does 2242h mean 2242 in Hex ? What does 22A6h mean in Hex ? are these the specific number of Hex Values for the Sprite, rather than all the bytes in the File ? Here is another image when I open A000h I don't fully understand the code there, SI is Source Index ? :- Here is a dropbox link to the Swotl.exe File. :- https://www.dropbox.com/scl/fi/6pi1osmb8j3fjauqullnb/Swotl.exe?rlkey=dw2x82ivijx10ssjdhqo2ekkt&dl=0
Here are two pictures of the altered Focke-Wulf 190A, i.e. a line coming out of plane in the rear view Mirror shot, with different coloured segments :-
Another thing I have noticed, is that the Hex Value for ds i.e. the Data Segments in 6000h don't match those of the Total Hex Value or Decimal Value when I open the Plane Shape Files in HxD Hex Editor in Windows 10. Do DOS Hex Values for DOS 16 bit Files differ when opened in a modern Hex Editor, than say for a DOS Native Hex Editor ? And if so, how do I obtain the correct value, i.e. how do I convert one value to the other ? I am fairly convinced these Data Segments are the 'S' Shape Files. Also in these two following Pictures, the DB Define Bytes differ in two chosen Data Segments. What do those define Bytes Mean, are they to do with the Bitmap coded in the 'S' Files, there appear to be two different DB Bytes Segments one starting with 80h and one with 27h, either one or the other used for the Data Segments in 6000h. What do the Define Bytes mean here, can someone work it out for me ?
Also I clicked on 2646h in A000h, and got what is shown. Am I right in thinking, 0Fh is where Data Segments i.e. the File is opened ? What else is going on there ? I checked what 2710h i.e. hexadecimal is in Decimal, and it's 10000, what is the significance there ?
Edit:- I clicked on call sub_A7CD in the 6000h segment, and the flow chart there in IDA Pro 7, I think is possibly how the 'S' Files are decoded and where the Bitmap of the Plane is stored in the 'S' Files i.e. there is jmp i.e. jump to cs: code segment Offset when I click on 0FFFEh ? Could someone look at call sub_A7CD Flow Diagram in IDA PRO and tell me what is going on there ?
Also I looked at another Website Page, here is the link :-
https://thiscouldbebetter.wordpress.com/2011/03/17/using-vga-graphics-in-assembly-language/
There is a DisplayPixelDrawXY: part of the VGA Graphics code, which has two pieces of Code I found similar in IDA Pro :-
mov cx, [bp+8] ; x pos
mov dx, [bp+6] ; y pos
In the Swotl.exe File, I found :-
mov ax, [bp+6]
mov ax, [bp+8]
shown with other code, at loc_49C2 in IDA Pro 7, is that significant ?
Any help and info would be much appreciated.