Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
119 user(s) are online (109 user(s) are browsing Forums)

Members: 1
Guests: 118

Hans, more...

Support us!

Headlines

 
  Register To Post  

OpenClaw
Not too shy to talk
Not too shy to talk


See User information
Is it possible for AmigaOS 4 port?

https://github.com/pjasicek/OpenClaw

Go to top
Re: OpenClaw
Home away from home
Home away from home


See User information
@mufa

The dependencies sound manageable:
- SDL2 Libraries (SDL2, SDL_Image, SDL_TTF, SDL_Mixer, SDL2_Gfx) for graphics, input, font and audio
- Box2D Library for Physics
- Tinyxml library for data-driven approach

Hans


Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: OpenClaw
Just popping in
Just popping in


See User information
We're off to a good start

Captain Claw already has an official AmigaOS appearance in Shogo M.A.D

Resized Image

Go to top
Re: OpenClaw
Home away from home
Home away from home


See User information
@mufa
Loosing a day and was able to build binary almost with no code changes (just few fixes because of gcc differences and makefiles's compiling/linking things)

Resized Image


I can see also in the game's code big endian ifdefs, so there is chances that after fixing amiga patches and co it may works, but of course we can't be sure that loading of data file big endian aware. Hope to check it a bit later today.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: OpenClaw
Home away from home
Home away from home


See User information
As expected it fail to load data file (CLAW.REZ), which is on 99% probabaly because of endianes.

Game come with some small "libwap" library, which deal with loading of .REZ datafiles, and it just return NULL (meaning invalid data file) when calling WAP_LoadRezArchive(), which is just:

RezArchiveWAP_LoadRezArchive(const charrezFilePath)
{
    
std::ifstreamfileStream = new std::ifstream(rezFilePathstd::ifstream::binary);
    if (!
fileStream->is_open())
    {
        return 
NULL;
    }

    
RezArchiverezArchive = new RezArchive;
    
rezArchive->rootDirectory = new RezDirectory;
    
// Initialize to default values
    
(*rezArchive->rootDirectory) = { };
    
rezArchive->rootDirectory->name StdStringToCharArray(std::string(""));

    
// Read rez file header which is 127 bytes long
    
fileStream->read(rezArchive->header127);
    
// Read rez file version
    
FileRead(&(rezArchive->version), fileStream127);
    
// Read rez payload offset (offset of first directory)
    
FileRead(&(rezArchive->rootDirectory->offset), fileStream131);
    
// 
    
FileRead(&(rezArchive->rootDirectory->size), fileStream135);

    
// Checksum, offset to last archive + its node size should == file size
    
uint32_t expectedRezArchiveSize rezArchive->rootDirectory->offset rezArchive->rootDirectory->size;
    
// Get actual size of file we opened
    
fileStream->seekg(0std::ios::end);
    
std::streamoff actualLoadedFileSize fileStream->tellg();
    
// If this check fails, we did not load valid REZ file
    
if (expectedRezArchiveSize != actualLoadedFileSize)
    {
        
WAP_DestroyRezArchive(rezArchive);
        return 
NULL;
    }

    
// Recursively read all directories
    
ReadRezDirectory(rezArchiverezArchive->rootDirectoryfileStream);

    
// Register loaded REZ archive file
    
RegisterRezArchiveFile(rezArchivefileStream);

    
// Create map of REZ files with key being their full file path
    //START_QUERY_PERFORMANCE_TIMER;
    
CreateRezArchiveFileMap(rezArchive);
    
//END_QUERY_PERFORMANCE_TIMER;
    
return rezArchive;
}


So somewhere in that function it fail (probabaly reading wrongly structures because of endianes), and return NULL.

If anyone can/want to help with rewriting it to big-endian: help will be appreacated. There is relevant source file:

https://github.com/pjasicek/OpenClaw/b ... p/RezArchiveFile.cpp#L602

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: OpenClaw
Home away from home
Home away from home


See User information
Asking author about, he says that yeah, big-endian wasn't consider so it is.

I tried to replace in that WAP_LoadRezArchive, that part:

// Read rez file version
    
FileRead(&(rezArchive->version), fileStream127);
    
// Read rez payload offset (offset of first directory)
    
FileRead(&(rezArchive->rootDirectory->offset), fileStream131);
    
// 
    
FileRead(&(rezArchive->rootDirectory->size), fileStream135);


On that one:

// Read rez file version
    
FileRead(&(rezArchive->version), fileStream127);
   
rezArchive->version SDL_SwapLE32(rezArchive->version);
    
// Read rez payload offset (offset of first directory)
    
FileRead(&(rezArchive->rootDirectory->offset), fileStream131);
    
rezArchive->rootDirectory->offset SDL_SwapLE32(rezArchive->rootDirectory->offset);
    
// 
    
FileRead(&(rezArchive->rootDirectory->size), fileStream135);
    
rezArchive->rootDirectory->size SDL_SwapLE32(rezArchive->rootDirectory->size);


But it only make it freezes. Probabaly that 127 bytes header need adjustements as well as some other stuff.

Authour through say, that probably what would solve this would be making FileRead and all other reading generics to be endian agnostic. But he don't have any device which has big endian, so there would be no way for him to test it at the moment :(

In other words, someone should help there with big-endian fixes, anyone ?:)

At moment i only find one generic reading function:

template<typename T>
static 
void FileRead(Tdeststd::ifstreamfileint32_t offset)
{
    
file->seekg(offsetstd::ios::beg);
    
file->read((char*)destsizeof(*dest));
}


Not sure how to make it endian agnostic, so help need it.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: OpenClaw
Not too shy to talk
Not too shy to talk


See User information
Hello

The whole rezarchive need to be reordered
I whould do a file search containing "rootDirectory" to found the source whith his définition

Aldo the structure is read a part after a part
So must reorder all fields from .version in the 127 bytes range
Then all fields from .offset for 131 bytes
From .size for 135

Etc...

Go to top
Re: OpenClaw
Home away from home
Home away from home


See User information
@all
I progress futher with endian fixes, so step by step hope to have something. At least now i almost fixed endian issue with zip file loading.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: OpenClaw
Just can't stay away
Just can't stay away


See User information
@kas1e

Nice. thanks for keeping us informed

--
AmigaONE X1000 and Radeon RX 560
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-2024 The XOOPS Project