Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
112 user(s) are online (71 user(s) are browsing Forums)

Members: 0
Guests: 112

more...

Headlines

 
  Register To Post  

Detecting if a 68k prog is running on os4 ?
Not too shy to talk
Not too shy to talk


See User information
Hello

I have made a program GMAP for both OS3 68k and OS4 ppc

GMAP-os3 run well on OS3
GMAP-os4 run well on OS4

but GMAP-os3 got a bug when running on OS4

I can easily fix this bug if I can detect that this 68k prog is now running on OS4....
But how to detect that ?

Alain Thellier

Go to top
Re: Detecting if a 68k prog is running on os4 ?
Just can't stay away
Just can't stay away


See User information
@thellier

The following should work for identifying AmigaOS 4.x while excluding MorphOS which also uses version numbers >= 50.

if (((struct Library *)SysBase)->lib_Version >= 50 && !FindResident("MorphOS")) {
    
/* AmigaOS 4.x */
}


This still might give a false positive for 68k AROS though...

Go to top
Re: Detecting if a 68k prog is running on os4 ?
Not too shy to talk
Not too shy to talk


See User information

Even if the bug only shows on OS4, it is still a bug. You should fix it properly and not work around it.


Go to top
Re: Detecting if a 68k prog is running on os4 ?
Home away from home
Home away from home


See User information
@thellier

Way do you want to run less efficient 68k version on a powerpc cpu?

How about checking CPU, if you have a PowerPC, then it's not running on AmigaOS3.x, or you check if a system file is a ELF file, that’s easy as its first bytes in program file.

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: Detecting if a 68k prog is running on os4 ?
Just popping in
Just popping in


See User information

There are several things you can do to determine this, but what I would
really like to know is.... Why ?

If you know what it is that is "easily fixed" if you could detect the OS4
68K emulator, would you mind telling us, what it is that makes the
OS4 68K emulator somehow incompatible with your 68K app. ?

To me, it initially sounds like some "side effect" is being exploited,
that either doesn't exist anymore or is no longer supported on OS4,
or the OS4 68K emulator has some compatibility limitation that could
perhaps be fixed.

Trying to write apps that need to use work-arounds, doesn't sound like
a robust methodology to me.


Go to top
Re: Detecting if a 68k prog is running on os4 ?
Not too shy to talk
Not too shy to talk


See User information
@salass00
Thanks

>Way do you want to run less efficient 68k version on a powerpc cpu?
1) Because the GMAP users try also the os3 version and complain "os3 version dont works on os4"
2) Because I want it to be fixed and not release bugged softwares
3) Because you CAN run the os3 version...

>Trying to write apps that need to use work-arounds

In fact the problem is NOT in my code but within the PNG datatype used

I use the same
bpa.MethodID = PDTM_READPIXELARRAY;
bpa.pbpa_PixelData = T->pixels;
bpa.pbpa_PixelFormat = PBPAFMT_ARGB;
[...]
on os3 and os4
But GMAP-os3 running on OS4 dont give the RGB pixels with background color where pixels are transparent but the transparent color itself
I mean if the "sprites" are surrounded with a purple transparent color then I obtain purple not the workbench grey

This is very strange as it only happen in this case
I mean:
GMAP-os3 run well on OS3
GMAP-os4 run well on OS4

Alain Thellier




Go to top
Re: Detecting if a 68k prog is running on os4 ?
Just popping in
Just popping in


See User information
Do you have any local structures defined in your program (without packing)
that are referenced outside of your own code,. (ie; by system functions) ?

The reason I mention this is because if you look at the OS4 includes,
you will notice that there are blocks like this in the include files;

#ifdef __GNUC__
#ifdef __PPC__
#pragma pack(2)
#endif
#elif defined(__VBCC__)
#pragma amiga-align
#endif

If you have mixed size members (or <32 bit sized members) in locally
defined structures, the alignment padding can differ and some members
of the structures may not be where you think they are, because of the
invisible alignment padding being added.




Go to top
Re: Detecting if a 68k prog is running on os4 ?
Not too shy to talk
Not too shy to talk


See User information
@colinw

No no structures seems ok

Go to top
Re: Detecting if a 68k prog is running on os4 ?
Just can't stay away
Just can't stay away


See User information
@thellier

Only an end user guess but on OS4 you probably have to look at the Alpha levels as they have much more support under OS4 than OS3.


Amiga user since 1985
AOS4, A-EON, IBrowse & Alinea Betatester

Ps. I hate the new amigans website. <shudder>
Go to top
Re: Detecting if a 68k prog is running on os4 ?
Not too shy to talk
Not too shy to talk


See User information
salass00 method allow me to add a fix
So case is closed

Thanks to all

Alain Thellier

Go to top
Re: Detecting if a 68k prog is running on os4 ?
Quite a regular
Quite a regular


See User information
Revisiting this topic, is there a more reliable way to do this other than checking the SysBase version? Before we get sidetracked about fixing my code and why I want to do this, I'd like to avoid h/w banging code from crashing if my program was started on OS4.
The exec.library version check alone won't be enough as we have forks and clones. For example 68k AROS is at 51.3, the 3.2 team has also bumped the main versions to 47, so maybe they will hit 50 with future versions. How could I avoid false positives? Is there a public port, semaphore, or component I could check, that's unique to OS4?

This is just like television, only you can see much further.
Go to top
Re: Detecting if a 68k prog is running on os4 ?
Just can't stay away
Just can't stay away


See User information
@BSzili

Would FindTask("idle.task") work?

Go to top
Re: Detecting if a 68k prog is running on os4 ?
Just can't stay away
Just can't stay away


See User information
check for elf.library?

Go to top
Re: Detecting if a 68k prog is running on os4 ?
Quite a regular
Quite a regular


See User information
Thanks for the suggestions, I'll try these later in WinUAE.

This is just like television, only you can see much further.
Go to top
Re: Detecting if a 68k prog is running on os4 ?
Quite a regular
Quite a regular


See User information
I ended up going with:
if (((struct Library *)SysBase)->lib_Version >= 50 && (FindResident((STRPTR)"elf.library") || FindResident((STRPTR)"MorphOS"))) {
    
// AmigaOS4 or MorphOS
}

which does the job I think.

This is just like television, only you can see much further.
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project