babyface Posted July 23, 2022 Share Posted July 23, 2022 Hi folks. Does anyone have information about the format of the GFA basic source files? I would like to build an environment where I can write GFA code on a PC, but use the GFA compiler in a Hatari emulator to compile these sources. However, the compiler requires a GFA file (which is some kind of binary, tokenized format), so I would need to convert my ASCII source files to the ".GFA" format before feeding them to the compiler. So - is there any documentation about the ".GFA" file format anywhere? Any hints appreciated. 1 Quote Link to comment Share on other sites More sharing options...
ggn Posted July 23, 2022 Share Posted July 23, 2022 Hi there, There are certainly tools to do the opposite of what you ask (gfa->lst) but I can't find anything to do what you wish right now. However, @lp060 has been maintaining GFA Basic (compiler side) and has created his own IDE. I suggest you visit his website (http://gfabasic.net) and probably get in touch with him. I also see in his website that there's a discord so they also can help you out. Good luck! Quote Link to comment Share on other sites More sharing options...
babyface Posted July 23, 2022 Author Share Posted July 23, 2022 I am already in contact with him. Unfortunately, he can't really help out so far either. I'll probably have to reverse engineer the format. Quote Link to comment Share on other sites More sharing options...
ggn Posted July 24, 2022 Share Posted July 24, 2022 Well, in that case you might want to check out projects like https://github.com/mmuman/gfalist that convert .gfa files to .lst so you don't start completely from scratch. Quote Link to comment Share on other sites More sharing options...
babyface Posted July 26, 2022 Author Share Posted July 26, 2022 (edited) I already did check it out. It helped indeed. At this point, I can kinda read a binary GFA file with a hex editor and can recognize where the variable list is and where the code lines begin I do have an early simple parser which can read a source file, process the header, the variable lists and then all the program lines. Still, apart from the fact that I need to implement a serialization/deserialization for every single command, there is one part that I don't really understand yet; the 38 4-byte pointers. I guess for your use-case they were not really important and could be ignored, but when I create GFA files, these values need to be correct (I tried setting them to 0; the GFA compiler then hangs when processing the file). Anyway, your stuff was of great help already, so thanks for that! Edited July 26, 2022 by babyface 1 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.