Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Gromtar

Pages: [1]
1
FF7 Tools / Re: PC - FF7 LGP Loader
« on: 2011-08-19 17:52:02 »
Hm as far as i know does Alis LGP tool extract the files, or recreate a archiv.

But if i just want to read data from the archiv i dont need to extract all the file just holding the needed files in the memory is enougth.
Therefor i wrote this little dll to get access to all the files in the lgp without extracting them on hd.

2
FF7 Tools / Re: PC - FF7 LGP Loader
« on: 2011-08-19 17:14:54 »
You can open the lgp archive and load the files in the archiv direct in to the memory to work with them.

I need this for a little tool, and with a dll it is just faster to implement if i need it again.

3
FF7 Tools / [FF7] LGP Loader (2011-08-19)
« on: 2011-08-19 16:31:14 »
Hiho,

Sorry my English is not so good but i try my best an hope you guys understand me ^^

Yesterday i had an idea for a tool and for this idea i have to load the ff7 lgp files in to the memory.
So i wrote a little dll to do the job.

It has just a few functions to load the lgp in to the memory but if some one want to test it i Uploaded it here gromtars_lgp_loader
I wrote it in PB (PureBasic) so the test source file is in pb but it should work in each language that can load dll's

4
Now i looks good  :)


But the face groups are messed up


The heads are working but why does the faces look so broken  :o any ideas ?  ;)

5
Quote
Plants do not require 24/7 emotional support

Who knows he might tells them fantasy storys or plays mozart for them or somthing like that  :mrgreen:

6
Hiho,

again i have some litle question  ;D

The thing is my english is not the best so im not sure if i understood the Wiki correct.

Im currently working on the p file and need to get the vertices.
The wiki says this "you have to add group.VerticesStartIndex to each vertex index".
does this means i have to add the group.VerticesStartIndex to each index i get from the polygon.VertexIndex?

Somthing like this
Code: [Select]
v1.x = vertices[groups[x].VerticesStartIndex + polygons[y].vi_1].x;



EDIT:
------------------------------------------------
Ok now its "half" working  ::)
Her face is just a hole  :?







7
General Discussion / just one stupid litle question
« on: 2010-09-01 04:00:48 »
Hiho,

3 weeks ago i finished my last PB project (loli-browser) and got a litle bored i didnt knew what to do next.
Then i thought i try out PB + Irrlicht and do somthing but the PB Irrlicht wrapper is to old so i thought "ok lets try c++"
and finaly i tripped over Qhimms wiki and there i got an idea i wanted to make a litle model viewer
but as engine i wanted to use Irrlicht it should load the models on a bsp map so i could walk over the maps with it.
So i could learn more about C++, Irrlich and the FF7 files in one little project. :)

But i just read the harsh answers Senti became for his Idee and wen i think about it my model viewer would
do the same, it would load the models out off the lgp to Irrlicht and on top onto a map.

So i just got a little lost, should i drop this idea and do somthing other?
But i just dont know what (any idea's?  :?)

-------------------------
Sorry for my bad english.

8
General Discussion / Re: Entertaining an idea
« on: 2010-08-31 19:10:25 »
Hm,

the idee is nice but i think, if your going to do this dont use the Unreal def kit.
What i mean is, Epic Games is a ("konkurrent" sorry dont know the correct english word) rival to Square Enix so it wont be a good idee to use this  ;)

Quote from: Shankifer
Not going to agree with the whole "FF7 must be installed" deal with you on this. Considering it will be completely made from scratch, I think all the rights other than the ideas for the game belong to you, and unless it is a moral thing for you, you should feel free to distribute it freely. Just a thought.

I think it is a good Idee to check if the orginal is installed or a ff7 psx cd is in the cd drive, even if the sources are not from Square Enix/Eidos but the rights for the name "Final Fantasy7 etc." lies with them.
But if you make sure Square Enix/Eidos will have their share with this, you minimize the risk to get sued.

9
Quote from: NFITC1
for (int i = 0; i < 8 && inputPos < ll_obj->curr->filesize; i++)

This done it  :-D now it works fine, thanks.

And thanks at all for the usefull tipps :)

10
Morning  ;),

Ok now it works fine only a litte thing is off  ???

Code: [Select]
    int lgp_tools::decodeLZS(int fileID)
    {
        ll_obj->SelectElement(fileID);

        unsigned char *data = ll_obj->curr->memPtr;
        unsigned char controlByte  = NULL;
        unsigned int input_offset = 4;
        unsigned int output_offset = NULL;


        unsigned char* output_buffer = (unsigned char*) malloc(ll_obj->curr->filesize * 9);

        while (input_offset < ll_obj->curr->filesize)
        {
            controlByte = data[input_offset++];

            for (int i = 0; i < 8;i++)
            {
                if((controlByte >> i) & 1)
                {
                    output_buffer[output_offset++] = data[input_offset++];
                }
                else
                {
                    unsigned char ref1 = data[input_offset++];
                    unsigned char ref2 = data[input_offset++];

                    unsigned short RefLength = (ref2 & 0xF) + 3;
                    unsigned short ref_offset = ref1 + ((ref2 & 0xF0) << 4);

                    int real_offset = output_offset - ((output_offset - 18 - ref_offset) & 0xFFF);

                    for(int x = 0; x < RefLength; x++)
                    {
                        if (real_offset  + x < 0)
                        {
                             output_buffer[output_offset++] = 0;
                        }
                        else
                        {
                             output_buffer[output_offset++] = output_buffer[real_offset + x];
                        }
                    }
                }
            }
        }

        ll_obj->curr->filesize = output_offset;
        delete(ll_obj->curr->memPtr);
        ll_obj->curr->memPtr = (unsigned char*)realloc(output_buffer, output_offset);
    }

The decoded Data is the same as the data i got with highwind only that i get 20-30 byte to manny after the "FINAL FANTASY7" tag  :-o
It seems it goes over the last controlbyte  :(


11
Thanks you two, now it seems to work.
The problem was that i got the first controlbyte wrong  :-[
The file header inside the lgp is 24Bytes and i used 20 + 4 for the lzs so i had it 4 bytes to short  :roll:

12
Hiho,

sorry for my bad english but i try my best and hope you guys understand me ;)

I have a little problem with the LZS compression.
I am currently learning c++ (2 days), then i found the QhimmWiki and it seemed interesting so i put some code together to load the lgp's in the memory and dump files out of it to the HD.
So far it worked good but now i want to unpack the lzs files but it seems i am to stupid  :'(

For the start i wanted to walk down all the controllbytes and lenghtbyte of the refference to get the total size of the decodet data but i get the wrong input pos and dont know why.

Code: [Select]
    int lgp_tools::decodeLZS(int fileID)
    {
        ll_obj->SelectElement(fileID);

        char *data = ll_obj->curr->memPtr;

        int inputPos = 4;
        char controlByte;
        int wSize;

        while(inputPos <= ll_obj->curr->filesize)
        {
            controlByte = data[inputPos];
            inputPos = inputPos + 1;

            for (int i = 0; i <= 7;i++)
            {
                if ((controlByte >> i) & 1)
                {
                    inputPos = inputPos + 1;
                    wSize = wSize + 1;
                }
                else
                {
                    int len = (data[inputPos + 1] & 0xF) + 3;

                    wSize = wSize + len;
                    inputPos = inputPos + 2;
                }
            }

        }

        cout <<  wSize <<"\n";
    }

Wen i dump the "ll_obj->curr->memPtr" to hd with this
Code: [Select]
    void lgp_tools::dumpFile(string path, int fileID)
    {
        ll_obj->SelectElement(fileID);
        ofstream outputFile (path.c_str(), ios::out | ios::binary);
        outputFile.write((char *) ll_obj->curr->memPtr, ll_obj->curr->filesize);
        outputFile.close();
    }

the file has the same content and file size as the file i extracted with highwind. So the input data cant be wrong.

Does some one see the error? I dont get it  (like i said it seems i am to stupid :cry: )

Pages: [1]