Welcome, Guest. Please login or register.

Author Topic: AmiDARK Engine Flying Feather on AROS  (Read 4673 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline BSzili

  • Full Member
  • ***
  • Join Date: May 2012
  • Posts: 112
  • Country: 00
    • Show all replies
    • http://bszili.morphos.me
Re: AmiDARK Engine Flying Feather on AROS
« on: June 09, 2014, 08:18:46 AM »
I get a "not enough memory available" error, because you stripped the executable. If you do so, please always use the --strip-unneeded argument, otherwise the executable becomes unusable.
This is just like television, only you can see much further.
 

Offline BSzili

  • Full Member
  • ***
  • Join Date: May 2012
  • Posts: 112
  • Country: 00
    • Show all replies
    • http://bszili.morphos.me
Re: AmiDARK Engine Flying Feather on AROS
« Reply #1 on: June 09, 2014, 10:16:46 AM »
I tried the demo, but it still doesn't work. It cannot open input.device, and I think I know why. On AROS, before you open input.device, you have to initialize the mn_Length field of the IORequest message, like this:

Code: [Select]
struct IOStdReq            input_req;
(...)
input_req.io_Message.mn_Length = sizeof(input_req);
« Last Edit: June 09, 2014, 10:19:43 AM by BSzili »
This is just like television, only you can see much further.
 

Offline BSzili

  • Full Member
  • ***
  • Join Date: May 2012
  • Posts: 112
  • Country: 00
    • Show all replies
    • http://bszili.morphos.me
Re: AmiDARK Engine Flying Feather on AROS
« Reply #2 on: June 09, 2014, 01:00:45 PM »
I don't want to force anything on you, but if you have an x86 PC, then you have the computer to run AROS. You don't even have to install it, you can run it in VmWare, VirtualBox, QEMU, etc.
This is just like television, only you can see much further.
 

Offline BSzili

  • Full Member
  • ***
  • Join Date: May 2012
  • Posts: 112
  • Country: 00
    • Show all replies
    • http://bszili.morphos.me
Re: AmiDARK Engine Flying Feather on AROS
« Reply #3 on: June 09, 2014, 09:57:04 PM »
It still crashes with the same error, and since the executable is stripped I can't get a backtrace. If you want you can download any AROS distro and run it in your VM of preference, so you can test the program yourself. If you don't want to download AROS, that's fin too, but I don't have the source code, so this is as far as I can go with guesswork.
This is just like television, only you can see much further.
 

Offline BSzili

  • Full Member
  • ***
  • Join Date: May 2012
  • Posts: 112
  • Country: 00
    • Show all replies
    • http://bszili.morphos.me
Re: AmiDARK Engine Flying Feather on AROS
« Reply #4 on: June 10, 2014, 08:03:07 AM »
Oops, my bad. I assumed you just added --strip-unneeded instead of removing the stripping altogether. This is the backtrace I get:
Code: [Select]
#0  0x885c80df in MyGetSysTime ()
#1  0x885c823e in deOpenDevice_Timer ()
#2  0x885b7023 in DarkENGINE_Start ()
#3  0x885b726e in main ()
This is just like television, only you can see much further.
 

Offline BSzili

  • Full Member
  • ***
  • Join Date: May 2012
  • Posts: 112
  • Country: 00
    • Show all replies
    • http://bszili.morphos.me
Re: AmiDARK Engine Flying Feather on AROS
« Reply #5 on: June 10, 2014, 10:01:11 AM »
You have to read the backtrace from the bottom to the top, the function which crashes the program is MyGetSysTime. If the debug symbols were present, the backtrace would have the exact file name and line numbers too.
You don't need to burn a DVD, just pop in an Icaros Desktop ISO into VMWare Player, and you have a ready to use system.
This is just like television, only you can see much further.
 

Offline BSzili

  • Full Member
  • ***
  • Join Date: May 2012
  • Posts: 112
  • Country: 00
    • Show all replies
    • http://bszili.morphos.me
Re: AmiDARK Engine Flying Feather on AROS
« Reply #6 on: June 10, 2014, 10:13:24 AM »
I noticed a problem in  DarkENGINE_Start(). The way it currently  works is potentially dangerous, since the function won't return  immediately if it can't open input.device or timer.device. It prints a  message but continues executing, which can lead to a crash if the rest  of the function depends on these devices being correctly opened.
You could share the implementation of deOpenDevice_Input and deOpenDevice_Timer so I can see what breaks them on AROS.
This is just like television, only you can see much further.
 

Offline BSzili

  • Full Member
  • ***
  • Join Date: May 2012
  • Posts: 112
  • Country: 00
    • Show all replies
    • http://bszili.morphos.me
Re: AmiDARK Engine Flying Feather on AROS
« Reply #7 on: June 10, 2014, 11:09:35 AM »
Ok, I didn't know you have had error handling somewhere else. Thanks for the code, I'll write a small test program to figure out why they wouldn't work. I see there MyCreateIORequest and CreateExtIO used interchangeably. Does MyCreateIORequest use CreateExtIO internally? I have the same question about  MyCreateMsgPort, I presume it's a wrapper around CreateMsgPort.
This is just like television, only you can see much further.
 

Offline BSzili

  • Full Member
  • ***
  • Join Date: May 2012
  • Posts: 112
  • Country: 00
    • Show all replies
    • http://bszili.morphos.me
Re: AmiDARK Engine Flying Feather on AROS
« Reply #8 on: June 10, 2014, 12:36:56 PM »
While that's a perfectly sound way of doing it, if you want to avoid wrapper functions like that, you can define __USE_INLINE__ on AmigaOS4. That will define you a bunch of compatibility macros, so you can use CreateMsgPort instead of IExec->CreateMsgPort.
Back to the AROS. This code doesn't look right to me:
Code: [Select]
if ( MyOpenDevice( "input.device", 0, (struct IORequest *)m_inputRequest, 0 ) ){
        #if defined( __amigaos4__ )
          InputBase = m_inputRequest->io_Device;
          m_IInput = (struct InputIFace *)MyGetInterface( ( struct Library *)InputBase, "main", 0 );
         #endif
        mReturn = TRUE;
       }
Unless you changed that in MyOpendevice, OpenDevice returns 0 if the device was opened successfully and an != 0 error code if it failed.
The second problem is InputBase. You only set it on AmigaOS4, which means it will be uninitialized on other platforms, unless a library auto-opener does it for you. Since you are already opening input.device, InputBase should be always initialized.
The same goes for TimerBase, the initializer function most likely segfaults on the first GetSysTime call, because TimerBase is not initialized, and holds a random value.
This is just like television, only you can see much further.
 

Offline BSzili

  • Full Member
  • ***
  • Join Date: May 2012
  • Posts: 112
  • Country: 00
    • Show all replies
    • http://bszili.morphos.me
Re: AmiDARK Engine Flying Feather on AROS
« Reply #9 on: June 10, 2014, 01:14:08 PM »
What about the second part of my post? E.g. the return value of OpenDevice, TimerBase and InputBase not being set, etc.
This is just like television, only you can see much further.