These days I am working on porting the iGame to AmigaOS 4, compiling it with vbcc and using the latest SDKs. Although that I have it compiling without any errors, the app crashes on MUI Label() method, at line https://github.com/MrZammler/iGame/blob/master/src/iGameGUI.c#L259
I compile it with the following command
vbccppc -quiet src/funcs.c -o= /tmp/filexgdr56.scs -dontwarn=-1 -I/opt/sdk/ppc-amigaos/Include/include_h -I/opt/sdk/MUI_5.0/C/include -D__USE_INLINE__ -elf -no-regnames -no-multiple-ccs -madd -c99 -use-commons -O=1023 -I/opt/vbcc/targets/ppc-amigaos/include -D__amigaos4__
I am not sure, but if there was something missing, I guess I would get some errors on compiling. On the same environment I compiled MUI examples, like MUI-Demo, and they work just fine.
Thank you all for your help.
Do you get the GUI or it crashes before (just on startup)?
Downloaded from git and just found I crashes here too, but in "read_tool_types()" funcs.c,
Instead of using VBCC used GCC.
Did some includes fixex here and there and "fixed" crash in funcs.c:
//char *filename = strcat(PROGDIR, executable_name);
strncpy(filename, PROGDIR, sizeof(filename));
strncat(filename, executable_name, sizeof(filename));
And at least it loads GUI (empty), but no crash.
BTW only loads GUI when compiling with GCC when using VBCC it exists "gracefully", maybe some libs not "auto" opened/loaded ¿:-/
Thank you for your reply. Yeah, the code that you mention was already fixed here on my local code.
About the Label() crashing, for me crashes before any window opens, so I guess it is generic on whatever has to do with MUI. I will check to see what is not loaded, although that I guess the only needed library would be muimaster, right?
Thanks again for your help.
I just found the problem and now it compiles on vbcc as well. The problem was the MUIMasterIFace, which was not loaded at all. Thank you for your help.
Yep, I had the same problem and added in iGameMain.c:
IMUIMaster = (struct MUIMasterIFace *)GetInterface(MUIMasterBase, "main", 1, NULL);
DropInterface( (struct Interface*)IMUIMaster );
And VBCC compiles ok, but it doesn't show any GUI at all, instead the same sources with GCC works, so I suspect some libs/resources under vbcc are missing.
EDIT1: ..and it was lowlevelIFace not being opening :-) thx you too for suggestion about IFaces.
ILowLevel = (struct LowLevelIFace *)GetInterface(LowLevelBase, "main", 1, NULL);
Now under VBCC works too :-)
Thank you so much for your help. You pointed me to the right direction. Now I need to make the code better and fix various issues.
Dunnot if happens to you too, but menu hotkeys/qualifiers don't work/show ok on my compiled iGame.
It would be nice to add/open/close all libs/resources needed, instead of using -lauto -lamiga.
Keep coding mate!!!!
Since the last release I did some fixes on the menu shortcuts and other places, that right now were merged at the repo, but there is no new release of iGame with them. I will try to ask the owner about a beta release.
Tell me please, how you implemented the ILowLevel GetInterface, because as soon as I put it in the code, it compiles just fine, but the exits instantly. Also I have the same problem when I use the code that uses lowlevel at the main(). For now I removed it for AmigaOS 4 (https://github.com/walkero-gr/iGame/blob/develop/src/iGameMain.c#L185).
Implement whaaaa?!?! ;-)
Don't know if it will make joystick/pads work, just added the IFace:
Thats why I think would be better to add/open/close libs/resources in sources, and get rid of -lauto and -lamiga