Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
44 user(s) are online (36 user(s) are browsing Forums)

Members: 2
Guests: 42

Georg, saimo, more...
Support us!
Recent OS4 Files
OS4Depot.net



« 1 (2)


Re: another port (was: need little help with big/little endian issues)
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 4547
@all
To continue Endianes problem, i need some help again for my lame knowledge :)

Is "bit-shifting" (<< and >>) are endian unaware in end ?

What i mean is i have for example that kind of code:

// A8R8G8B8
struct sVec4;
struct sCompressedVec4
{
    
u32 argb;
 
    
void setA8R8G8B8 u32 value )
    {
        
argb value;
    }
 
    
void setColorf ( const video::SColorf color )
    {
        
argb core::floor32 color.255.f ) << 24 |
                
core::floor32 color.255.f ) << 16 |
                
core::floor32 color.255.f ) << 8  |
                
core::floor32 color.255.f );
    }
 
    
void setVec4 ( const sVec4 );
 
    
// f = a * t + b * ( 1 - t )
    
void interpolate(const sCompressedVec4a, const sCompressedVec4b, const f32 t)
    {
        
argb PixelBlend32 b.argba.argbcore::floor32 256.f ) );
    }
 
 
};


inline void sCompressedVec4::setVec4 ( const sVec4 )
{
    
argb core::floor32 v.255.f ) << 24 |
            
core::floor32 v.255.f ) << 16 |
            
core::floor32 v.255.f ) << 8  |
            
core::floor32 v.255.f );
}


void setA8R8G8B8 u32 argb )
{
        
= ( ( argb 0xFF000000 ) >> 24 ) * ( 1.f 255.f );
        
= ( ( argb 0x00FF0000 ) >> 16 ) * ( 1.f 255.f );
        
= ( ( argb 0x0000FF00 ) >>  ) * ( 1.f 255.f );
        
= ( ( argb 0x000000FF )       ) * ( 1.f 255.f );
}
 
void setR8G8B8 u32 argb )
{
        
= ( ( argb 0x00FF0000 ) >> 16 ) * ( 1.f 255.f );
        
= ( ( argb 0x0000FF00 ) >>  ) * ( 1.f 255.f );
        
= ( ( argb 0x000000FF )       ) * ( 1.f 255.f );
}


How it all should be done for PPC ? I mean all those << and >> seems like that all should be different for us.

Visually, problem with that code (well, i am not 100% sure that is _that_ code, but pretty possible, as only bit-shifting operations i find is those ones), looks like this:

On PPC (os4):

Resized Image

On X86 (win32)

Resized Image

As can be seen "terrain" scene (earth and sky) looks fine, but colors of the textures on the dwarf looks different. That why i think about those functions i quote..

Whole file is here: Vertex.h


Edited by kas1e on 2018/2/2 13:23:38
_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: another port (was: need little help with big/little endian issues)
Just popping in
Joined:
2017/5/18 10:12
From Audruicq, France
Posts: 13
Hello Kas1e

Are you sure it is ARGB color space used and not RGBA?

I found this on Wikipedia : https://en.wikipedia.org/wiki/RGBA_color_space

Regards,

   Report Go to top

Re: another port (was: need little help with big/little endian issues)
Just can't stay away
Joined:
2006/11/30 11:30
From Finland
Posts: 1583
@Petrol

If the code is meant to run on little endian CPUs the format it uses is BGRA (little endian equivalent of ARGB).

As far as 32-bit RGB with alpha channel pixel formats go there are actually four different variants: ARGB, RGBA, BGRA and ABGR.

   Report Go to top

Re: another port (was: need little help with big/little endian issues)
Home away from home
Joined:
2006/11/20 16:26
From Norway
Posts: 2705
@kas1e

just fix it at load time, or convert it just after loading.

_________________
(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
   Report Go to top

Re: another port (was: need little help with big/little endian issues)
Not too shy to talk
Joined:
2007/7/14 20:30
From Lothric
Posts: 447
@kas1e

Just sell it as a Shrek game.

   Report Go to top

Re: another port (was: need little help with big/little endian issues)
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 4547
@Capehill
:) Its not byte order which is wrong, its shrek ! Its not ports are bad, just they different ! :)

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: another port (was: need little help with big/little endian issues)
Not too shy to talk
Joined:
2010/1/22 20:03
From VIGO SPAIN
Posts: 367
@kas1e

Hi.

I download and test Beret, don't works for me.

After a few seconds the Miggy hangsup, no error or DSI.

Tested some other SDL and GL games and all works fine, with the exception of beret and freedroidrpg, both jangs the computer.

Thanks

Virginio

P.D. Grafx2 2.5 works fine too.

_________________
AmigaOne X5000 OS4.1 FEU1 And Lubuntu 10.04
1200 towered with Blizzard PPC - BVision and Mediator
And a new fantastic Chameleon64
   Report Go to top

Re: another port (was: need little help with big/little endian issues)
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 4547
@RIBDEVIL
Proper bugreport requered, you know what it mean for sure :) Also you should be sure you use latest os4, with all normal stuff.

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: another port (was: need little help with big/little endian issues)
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 4547
Dwarf is not Shrek anymore :)

Resized Image

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top


« 1 (2)



[Advanced Search]


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project