MUI app crashes on LABEL()

9 posts / 0 new
Last post
walkero
walkero's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2009-05-03 16:54
MUI app crashes on LABEL()

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.

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 4 days ago
Joined: 2013-05-30 00:53
Re: MUI app crashes on LABEL()

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:
...
void read_tool_types(void)
...
//char *filename = strcat(PROGDIR, executable_name);
char filename[256];
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 ¿:-/

File attachments: 

AttachmentSize
File igameos4.lha180.07 KB

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

walkero
walkero's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2009-05-03 16:54
Re: MUI app crashes on LABEL()

@jabirulo
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.

walkero
walkero's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2009-05-03 16:54
Re: MUI app crashes on LABEL()

@jabirulo
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.

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 4 days ago
Joined: 2013-05-30 00:53
Re: MUI app crashes on LABEL()

Yep, I had the same problem and added in iGameMain.c:
#ifdef __amigaos4__
IMUIMaster = (struct MUIMasterIFace *)GetInterface(MUIMasterBase, "main", 1, NULL);
#endif
...
#ifdef __amigaos4__
DropInterface( (struct Interface*)IMUIMaster );
#endif

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 :-)

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

walkero
walkero's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2009-05-03 16:54
Re: MUI app crashes on LABEL()

@jabirulo
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.

Thanks again.

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 4 days ago
Joined: 2013-05-30 00:53
Re: MUI app crashes on LABEL()

Ok.
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!!!!

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

walkero
walkero's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2009-05-03 16:54
Re: MUI app crashes on LABEL()

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).

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 4 days ago
Joined: 2013-05-30 00:53
Re: MUI app crashes on LABEL()

Implement whaaaa?!?! ;-)
Don't know if it will make joystick/pads work, just added the IFace:

  1. LowLevelBase = OpenLibrary((CONST_STRPTR)"lowlevel.library", 0);
  2. #ifdef __amigaos4__
  3. ILowLevel = (struct LowLevelIFace *)GetInterface(LowLevelBase, "main", 1, NULL);
  4. #endif

Thats why I think would be better to add/open/close libs/resources in sources, and get rid of -lauto and -lamiga

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

Log in or register to post comments