Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
159 user(s) are online (84 user(s) are browsing Forums)

Members: 2
Guests: 157

Georg, cygnusEd, more...

Headlines

Forum Index


Board index » All Posts (NoCache)




Re: DevilutionX - Diablo 1
Just popping in
Just popping in


@kas1e

Sorry, I was unavailable and busy recently... Anyway, Artur contacted me directly on discord, he seems to be more experienced with porting so I provided him all my codes and information I had, I'm really glad he got into it coz I didn't have so much time recently.
Anyway, feel free to compile it for OS4.1 as You already did, the most important is that someone got it working :)
I think I will have some time now again, so I can focus on some other project.
Thanks guys You got it working :)

Go to top


Re: adtools
Just popping in
Just popping in


@salass00

Ah, I forgot this option, thanks ;)

Go to top


Re: adtools
Just popping in
Just popping in


Hi fellows

any idea what might cause this?
$ /usr/local/amiga/bin/ppc-amigaos-g++ -o hellocpp hello.cpp
/usr/local/amiga/lib/gcc/ppc-amigaos/8.2.0/../../../../ppc-amigaos/lib/libstdc++.a(ios_init.o): In function `__exchange_and_add_dispatch':
/home/pavel.bekesky/adtools/gcc/repo/libstdc++-v3/include/ext/atomicity.h:81: undefined reference to 
`__gthread_active_p'
/usr/local/amiga/lib/gcc/ppc-amigaos/8.2.0/../../../../ppc-amigaos/lib/libstdc++.a(ios_init.o): In function `__atomic_add_dispatch'
:
/
home/pavel.bekesky/adtools/gcc/repo/libstdc++-v3/include/ext/atomicity.h:95undefined reference to `__gthread_active_p'
/usr/local/amiga/lib/gcc/ppc-amigaos/8.2.0/../../../../ppc-amigaos/lib/libstdc++.a(ios_init.o): In function 
`__exchange_and_add_dispatch':
/home/pavel.bekesky/adtools/gcc/repo/libstdc++-v3/include/ext/atomicity.h:81: undefined reference to `__gthread_active_p'
/usr/local/amiga/lib/gcc/ppc-amigaos/8.2.0/../../../../ppc-amigaos/lib/libstdc++.a(locale.o): In function `__gnu_cxx::__mutex::~__mutex()':
/home/pavel.bekesky/adtools/gcc/repo/libstdc++-v3/include/ext/concurrence.h:142: undefined reference to 
`__gthread_active_p'
/home/pavel.bekesky/adtools/gcc/repo/libstdc++-v3/include/ext/concurrence.h:143: undefined reference to `__gthread_mutex_destroy'
/usr/local/amiga/lib/gcc/ppc-amigaos/8.2.0/../../../../ppc-amigaos/lib/libstdc++.a(locale.o): In function `__gnu_cxx::__mutex::unlock()':
/home/pavel.bekesky/adtools/gcc/repo/libstdc++-v3/include/ext/concurrence.h:161: undefined reference to 
`__gthread_active_p'


I had to reinstall adtools in cygwin and I'm getting this when trying to recompile simple hello world code:
#include <iostream>
using std::cout;
using std::endl;

int main()
{
std::cout << "Hello cross-compiled c++ World!" << endl;
}


C lang code with gcc works fine...

thanks

Go to top


Re: Porting to AmigaOS4 thread
Just popping in
Just popping in


Any idea how to deal with lseek() method?
I need to offset filepointer by bytes to create new file with specific amount in size but the lseek result ends up with -1.

If I don't specify offset bytes, the file is created correctly but the size is incorrect as it needs to be

this is from lseek() method specs:
Quote:
The lseek() function allows the file offset to be set beyond the end of
the existing end-of-file of the file. If data is later written at this
point, subsequent reads of the data in the gap return bytes of zeros
(until data is actually written into the gap).

Some devices are incapable of seeking. The value of the pointer associ-
ated with such a device is undefined.


Go to top


Re: DevilutionX - Diablo 1
Just popping in
Just popping in


@kas1e
Another reason to finish this up :)

I'm in touch with DevilutionX developers, there want to support big endian platforms, so yes, I will upload my changes later on.
They also made jokes that that will have AmigaOS port done faster than Apple's :)

Go to top


Re: DevilutionX - Diablo 1
Just popping in
Just popping in


@kas1e

ah, I didn't know about that at all, so really good to know...
I will also make a note for future projects :)
thanks

By the way, encoding is resolved, it is going forward slowly, but there is at least some progress :)

Go to top


Re: DevilutionX - Diablo 1
Just popping in
Just popping in


@RIBDEVIL

Now it mainly depends on how fast I will be able to resolve Run-Length Encoding (RLE) on big-endian platform...

Anyone worked with that already on some project? :)

Go to top


Re: DevilutionX - Diablo 1
Just popping in
Just popping in


Resized Image

Go to top


Re: Porting to AmigaOS4 thread
Just popping in
Just popping in


@Raziel

I think it is great idea, I will also find it handy
That wstring issue... I'm also dealing with it at the moment in one project, but no solution so far

Go to top


Re: DevilutionX - Diablo 1
Just popping in
Just popping in


What is the correct way for memory allocation?
I'm sorry if it was already discussed in some other thread, I just can't find proper answer..
I'm not 100% sure how it works but I will try to describe my concern
Lets say I need to open a file, so I will allocate needed memory size with malloc function and load the file into the memory. Now I need to decode the content in memory so I need to use some operations like swap some bytes etc.
Is it OK to use malloc operation for this purpose regarding memory protection or should AllocVecTags() be used instead?
Devilution goes to GR in following function, I'm trying to understand what is going on and memory protection comes to my mind as possible issue
void __fastcall CelDrawDatOnly(char *pDecodeTochar *pRLEBytesint dwRLESizeint dwRLEWdt)
{
    
char *v4// esi
    
char *v5// edi
    
int v6// edx
    
unsigned int v7// eax
    
unsigned int v8// ecx
    
char v9// cf
    
unsigned int v10// ecx
    
char *v11// [esp+4h] [ebp-8h]

    
v11 pRLEBytes;
    if ( 
pDecodeTo && pRLEBytes )
    {
        
v4 pRLEBytes;
        
v5 pDecodeTo;
        do
        {
            
v6 dwRLEWdt;
            do
            {
                while ( 
)
                {
                    
v7 static_cast<unsigned char>(*v4++);
                    if ( (
v7 0x80u) == )
                        break;
                    
_LOBYTE(v7) = -(char)v7;
                    
v5 += v7;
                    
v6 -= v7;
                    if ( !
v6 )
                        goto 
LABEL_14;
                }
                
v6 -= v7;
                
v8 v7 >> 1;
                if ( 
v7 )
                {
                    *
v5++ = *v4++;   ///<<<<<<<<<<<<<< Grim Reaper
                    
if ( !v8 )
                        continue;
                }
                
v9 v8 1;
                
v10 v7 >> 2;
                if ( 
v9 )
                {
                    *(
_WORD *)v5 = *(_WORD *)v4;
                    
v4 += 2;
                    
v5 += 2;
                    if ( !
v10 )
                        continue;
                }
                
qmemcpy(v5v4v10);
                
v4 += v10;
                
v5 += v10;
            }
            while ( 
v6 );
LABEL_14:
            
v5 += -dwRLEWdt 768;
        }
        while ( &
v11[dwRLESize] != v4 );
    }
}


Thanks

Go to top


Re: adtools
Just popping in
Just popping in


@kas1e

I think it is is pretty clear now, I'm already working on the devilutionX...
the speed is kinda different as You said :D

thanks a lot

Go to top


Re: adtools
Just popping in
Just popping in


Finally I got the crosscompiler working after two days of installations, reinstallations debugging etc...

Now maybe little stupid questions, but...
Include files the project I'm trying to compile needs, like SDL,GL etc, should I install them with cygwin installator or download the libs from os4depot and put them to crosscompiler directory somewhere?
Also Cmake on amiga has it's own platform specification file.. should I use this one, default one that it is using by default or write new one?
Are there any simple tutorials for this maybe? It would be handy for beginners like me to see the correct process steps.

Thanks

Go to top


Re: adtools
Just popping in
Just popping in


@kas1e

Found Your guide on os4coding so I will going through
I wonder however, how is debugging working ? I will probably see soon enough :)

Go to top


Re: adtools
Just popping in
Just popping in


@kas1e

Indeed, I probably messed up the libraries while experimenting, I will rather reinstall it.
I'm in AmigaOS, using abc-shell, cmake, sdk and adtools it looked as best option to me...
Downloaded latest adtools package available which gives me version 8.1.0, but I will double check that
I don't have crosscompile environment set up but is seems to be better option as I can see
thanks for the linking line :)

Go to top


Re: adtools
Just popping in
Just popping in


I got those gthread errors while compiling DevilutionX, so I added -athread=native -lpthreads flags and now I got this:
[  2%] Linking CXX executable devilution
ld
cannot find gthr-amigaos-native.oNo such file or directory
ld
Warningalignment 4 of symbol `channel' in CMakeFiles/devilution.dir/Stub/sound.cpp.obj is smaller than 8 in /SDK/local/newlib/lib/libSDL2_mixer.a(playmidi.o)
gmake[2]: *** [devilution] Error 1
gmake[1]: *** [CMakeFiles/devilution.dir/all] Error 2
gmake: *** [all] Error 2


the library is present in GCC:lib/gcc/ppc-amigaos/8.1.0/ I also tried it to link it to gcc:lib and /SObjs, include the folder with -L flag but now use...

Actually I got error about missing lgcc library, I linked it into GCC:lib folder and now it needs gthr-amigaos-native.o which is unable to find.

Go to top


Re: adtools
Just popping in
Just popping in


@kas1e

I think I will stay with newlib,it was build previously succesfully and when You wrote adtools can be safely used with newlib, I don't see any reason to move to clib then :)

Go to top


Re: adtools
Just popping in
Just popping in


@kas1e

I have makefiles already generated by cmake with SDK's version of GCC so I will probably try to just modift it for adtools and see how it goes and I will stick with newlib then :)

Go to top


Re: DevilutionX - Diablo 1
Just popping in
Just popping in


Is anyone willing to help me with debugging?
Since this is my first project, I'm not so experienced with this stuff so it could help to speed it up a lot.

Feel free to send me pm or by email if interested, thanks :)

Go to top


Re: adtools
Just popping in
Just popping in


@all

It helped with my code, it now works as it should.

I will try to recompile the DevilutionX code, but it uses cmake which is hardcoded to use newlib while adtools should be used by clib2, I wonder if that might be an issue or not.
No idea if cmake is compatible with clib as well

Thanks with adtools configuration :)

Go to top


Re: adtools
Just popping in
Just popping in


@salass00 @kas1e
Thanks, I'm on it )

Go to top



TopTop
(1) 2 3 »




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project