Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
91 user(s) are online (52 user(s) are browsing Forums)

Members: 1
Guests: 90

orgin, more...
Support us!
Recent OS4 Files
OS4Depot.net





OpenClaw
Just popping in
Joined:
2006/11/27 20:35
From Poland
Posts: 114
Is it possible for AmigaOS 4 port?

https://github.com/pjasicek/OpenClaw

   Report Go to top

Re: OpenClaw
Home away from home
Joined:
2007/1/26 21:48
From New Zealand
Posts: 2196
@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


_________________
http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more.
https://keasigmadelta.com/ - more of my work
   Report Go to top

Re: OpenClaw
Just popping in
Joined:
2016/5/28 13:35
From The Netherlands
Posts: 55
We're off to a good start

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

Resized Image

   Report Go to top

Re: OpenClaw
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 5536
@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!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: OpenClaw
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 5536
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!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: OpenClaw
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 5536
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!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: OpenClaw
Not too shy to talk
Joined:
2011/6/3 12:49
Posts: 252
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...

   Report Go to top

Re: OpenClaw
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 5536
@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!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: OpenClaw
Just can't stay away
Joined:
2006/11/29 8:09
From Lyon, France
Posts: 1007
@kas1e

Nice. thanks for keeping us informed

_________________
--
AmigaONE X1000 1,8Ghz, 2GB, Sapphire Radeon HD 7700, with Amiga OS 4.1 FE
http://www.amiga-ng.org
   Report Go to top





[Advanced Search]


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project