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.


Topics - halkun

Pages: 1 2 3 4 5 [6] 7
126
This is going to be an expansive section of Gears and so it's nice to start a new topic and keep the script-related here.

Now, this is a sample of how I'm documenting each opcode. I think this is the most elegent solution.



Now, if you guys want you can take a line from the opcode marix in Gears and assist me by posting discovered arguments in something like this style here. I'll pop it into Gears. If you can think of something more elegent than this, let me know before we hae 128 of the little boogers decypered only to find some really key information we should of included...

For example should WINDOW say the following?
WINDOW (id=00 x=0000 y=0000 h=0000 w=0000)
-----

Now, terrence, because you have had more play time with script logics (I've been working on more of the cosmetic aspects of the language) Can you tell me how memory management works? Is there a protected array in memory that the script language uses for storing variables? Does it has free reign over the the PSX's memory. I would think the kernel will allow for a degree of protection.

Also, are there flags? Are these bools different from the memory array?

I guess memory management should be the first thing to work out.

127
here is a new field file script dumper for both the PC and PSX versions of the game made by lasyan3.

It's a little wonky, as it doen't dump the dialogs, and the hex dumps are a little on the skitzo side. but it's a good start for those who want to hack the scripting language apart.

You are going to need the command table file from the PSX script editor, that's here.

http://the-afterm.ath.cx/hack7_en.zip

The PC/PSX script dumper is here.

http://the-afterm.ath.cx/script_dump.zip

On the PC dumper, you can do a hex search for a particular sequence of hex numbers on an uncompressed field file to find the command line in question (The hex codes that make up the command are in the brackets) Keep in mind some commands are not parsed correctly, such as the BATTLE command The program dumps the data like this.

BATTLE (00, e7, 03)

Which gets transcribed as this

BATTLE (00,233,03)

when in fact it should read this

BATTLE  (00,999)

Anyway watch for that.

Have fun, happy hacking and  let me know if you learn anything.....

128
Even wonder what those Japanese characters ment in the FF7 debug room? Well wonder no more...

Takashi Tokita (時田貴司)
Mr. Tokita assisted in the event planning for Final Fantasy 7. He did general event flow throughout the game.

Masao Kato (加藤正人)
Mr. Kato also assisted with event planning, mostly working on the lifestream sequences  and the final battle with Sephiroth.

All the Japanese letters you see are names. Each leads to a room that that contains events that particular person was responsible for. Here is a list of Japanese letters and who it represents.

1. Kita (北) - Yoshinori Kitase (北瀬佳範)
Mr. Kitase was the director of the Final Fantasy Project, he also helped write the story and assisted in event planning.

2. Kyou (京) - Hidemi Kyounen (京念秀史)
Event planner.

3. No (野) - Itsushige Yajima (野島一成)
Mr. Yajima also helped write the story and was one of the main event planners.

4. Yoshi (吉) - Kazuhiko Kichioka (吉岡加寿彦)
Event planner.

5. Tori (鳥) - Motomu Toyama (鳥山モトム)
Event planner.

6. Aki (秋) - Jun Akiyama (秋山淳)
Event planner.

7. Matsu (松) - Hiroyuki Matsuhara (松原啓介)
Event planner.

8. Sen (千) - Hiroki Chiba (千葉広樹)
Event planner.

Just thought I'd share...

129
Here you guys go I hope it's useful, it might be wrong....

Code: [Select]

Halkun's script doo-bob with lotsa help from lasyan3 and FIce.


The script on FF7 is exactly the same between the PSX and PC versions. The
headers are the only thing that different. They just tell you how to
find the data, and once that is found, the are exatly the same. Here's how
you get to the script in both the PC and PSX versions. Then the last part
is the generic scripting accessor and how to universally extarct the
script from both versions.

THE PC VERSION:

The scripts are found in the files within flevel.lgp. For those who know
how to access data in the field files, it's the first block...

for those who don't, it's easy. After decompressing the field file you have
to find the first block, to quote fice's doc...

-----
The first two bytes of each (decompressed) field file are blank (zero).
The next four bytes is an integer indicating how many sections are present in
the file.
Then a number of 4-byte integers follow, giving the starting offset for each
section.

All field files should contain 9 sections; it's what FF7 expects.

So, normally you'll find:

00              Blank                   2 bytes
0009            NumSections             4 bytes
????            Section 1 location      4 bytes
????            Section 2 location      4 bytes
etc.            etc.                    etc.

-------------------

The jump to the first section will give you a 4 byte number. I think this is
how long the section is, I'm really not to sure, after that is the beginning of
the script section....

THE PSX VERSION: (from lasyan3)

The PSX script is contained in the DAT file, it is compressed with LZS
compression. After it's decompressed, here is the header format for that..


First, we have 28 unused bytes (in fact, they are used by the PSX, it's a list
of 7 2-bytes values which refer to a place in the RAM). So each time you'll
find a value which is an adress in the file, you'll have to add 28 to
it in order to find the right position in the file (or else you can simply
remove the first 28 bytes of the file).

Note: the first byte in the header is byte 0.

------------------------------------
halkun: THE REST OF THE SCRIPT FORMAT IS EXACTLY THE SAME
The rule of thumb is, if you want to access the PSX version of the script,
start at an offset of +0x1c. If you want to access the PC version, start at
an offset of +2e
------------------------------------

byte 00 : unknown
byte 01 : number of sections
byte 02 : unknown
byte 03 & 04 : adress of the pointer's table for the dialogs
byte 05 : number of data areas
byte 06 to 14 : unknown
                                                                               
byte 15 to 15+number of unknown_names*8-1 : unknown names (8 bytes each)

byte 15+number of unknown_names*8 to 15+(number of unknown_names+number
 of sections)*8-1 : name of each section (8 bytes each)

byte 15+(number of unknown_names+number of sections)*8 to 15+
(number of unknown_names+number of sections)*8+number of data areas*4-1: data
areas pointers (4 bytes each)
                                                                               
length of the header : 15 + (number of unknown_names+number of sections)*8+
number of data areas*4

********************EVENTS PART********************
Here we have all of the pointers tables, one for each section. Pointers are 2
bytes length, like all of the pointers we can find in a DAT file.  Each table
has a length of 64 bytes, which means a section can have 32 scripts max. Each
pointer refers to the first command of the current script.  The section number
N begins at the offset header_length+N*64.  Note: the only way to retrieve the
length of a script is to substract the position of the next script to the
position of the current script.

********************DIALOGS PART********************
Right after the last script of the last section, we find the pointer's table
of the dialogs.  The first 2 bytes show the number of dialogs in the file, so
you can deduct the length of the table: number_of_dialogs*2.  After these 2
bytes we have the pointers for each dialog. Be aware that the pointers are
relative to the table, which means you must add the position of the table to
each pointer in order to find the right position of the dialog.  The dialogs
begin right after the table, and the code 255 means the end of the dialog.

Note: some <<hidden>> dialogs are not referenced in the table!

********************END PART********************

130
Good news everyone!

I'm working with lasyan3 and he was able to give me a listing of the Scripting Tolkens (Commands) for the field files.

There are over 200 scripting commands. I don't have thier definitions yet, some are hard to decypher and I haven't even dug through the field files to figure out what section conatins the tokens. (In the PSX version, it's the DAT file, which is split into two parts. The text, and then the script that's executed)

Here's a listing of the scripting commands, you read it like this:

num = name | arg

num is the tolken number (The command code)
name is the name of the command
arg is the legnth of the command including arguments. (For example RET is one command with no arguments, so it's 1)

Here are the commands.....

Code: [Select]

00 = RET | 1
01 = REQ | 3
02 = REQSW | 3
03 = REQEW | 3
04 = PREQ | 3
05 = PRQSW | 3
06 = PRQEW | 3
07 = RETTO | 5
08 = JOIN | 2
09 = SPLIT | 15
0A = SPTYE | 6
0B = GTPYE | 6
0C =  | 0
0D =  | 0
0E = DSKCG | 2
0F = SPECIAL | 2
10 = gotoNext +<1> | 2
11 = gotoNextLong +<2> | 3
12 = gotoPrev -<1> | 2
13 = gotoPrevLong -<2> | 3
14 = if UByte(<1>)[<1>] != <1> then(<1>) goto +<1> | 6
15 = if UByteL(<1>)[<1>] != <1> then(<1>) gotoLong +<2> | 7
16 = if SWord(<1>)[<2>] != <2> then(<1>) goto +<1> | 8
17 = if SWordL(<1>)[<2>] != <2> then(<1>) gotoLong +<2> | 9
18 = if USWord(<1>)[<2>] != <2> then(<1>) goto +<1> | 8
19 = if USWordL(<1>)[<2>] != <2> then(<1>) gotoLong +<2> | 9
1A =  | 0
1B =  | 0
1C =  | 0
1D =  | 0
1E =  | 0
1F =  | 0
20 = MINIGAME | 11
21 = TUTOR | 2
22 = BTMD2 | 5
23 = BTRLD | 3
24 = wait( time=<2> ) | 3
25 = NFADE | 9
26 = BLINK | 2
27 = BGMOVIE | 2
28 = KAWAI | 255
29 = KAWIW | 1
2A = PMOVA | 2
2B = SLIP | 2
2C = BGPDH | 5
2D = BGSCR | 7
2E = WCLS | 2
2F = WSIZW | 10
30 = IF-KEY | 4
31 = IF-KEYON | 4
32 = IF-KEYOF | 4
33 = UC | 2
34 = PDIRA | 2
35 = PTURA | 4
36 = WSPCL | 5
37 = WNUMB | 8
38 = STTIM | 6
39 = GOLD+ | 6
3A = GOLD- | 6
3B = CHGLD | 4
3C = HMPMAX1 | 1
3D = HMPMAX2 | 1
3E = MHMMX | 1
3F = HMPMAX3 | 1
40 = message( window=<1>, dialog=<1> ) | 3
41 = MPARA | 5
42 = MPRA2 | 6
43 = MPNAM | 2
44 =  | 0
45 = MP+ | 5
46 =  | 0
47 = MP- | 5
48 = ASK | 7
49 = MENU | 4
4A = MENU2 | 2
4B = BTLTB | 2
4C =  | 0
4D = HP+ | 5
4E =  | 0
4F = HP- | 5
50 = window( id=<1>, X=<2>, Y=<2>, W=<2>, H=<2> ) | 10
51 = WMOVE | 6
52 = WMODE | 4
53 = WREST | 2
54 = WCLSE | 2
55 = WROW | 3
56 = GWCOL | 7
57 = SWCOL | 7
58 = ST-ITM | 5
59 = DL-ITM | 5
5A = CK-ITM | 5
5B = SM-TRA | 7
5C = DM-TRA | 8
5D = CM-TRA | 10
5E = SHAKE | 8
5F = NOP | 1
60 = MAPJUMP | 10
61 = SCRLO | 2
62 = SCRLC | 5
63 = SCRLA | 6
64 = SCR2D | 6
65 = SCRCC | 1
66 = SCR2DC | 9
67 = SCRLW | 1
68 = SCR2DL | 9
69 = MPDSP | 2
6A = VWOFT | 7
6B = FADE | 9
6C = FADEW | 1
6D = IDLCK | 4
6E = LSTMP | 3
6F = SCRLP | 6
70 = battle | 4
71 = BTLON | 2
72 = BTLMD | 3
73 = PGTDR | 4
74 = GETPC | 4
75 = PXYZI | 8
76 = PLUS! | 4
77 = PLUS2! | 5
78 = MINUS! | 4
79 = MINUS2! | 5
7A = INC! | 3
7B = INC2! | 3
7C = DEC! | 3
7D = DEC2! | 3
7E = TLKON | 2
7F = RDMSD | 3
80 = set byte(<1>)[<1>]=<1> | 4
81 = SET-WORD | 5
82 = BIT-ON | 4
83 = BIT-OFF | 4
84 = BIT-XOR | 4
85 = PLUS | 4
86 = PLUS2 | 5
87 = MINUS | 4
88 = MINUS2 | 5
89 = MUL | 4
8A = MUL2 | 5
8B = DIV | 4
8C = DIV2 | 5
8D = MOD | 4
8E = MOD2 | 5
8F = AND | 4
90 = AND2 | 5
91 = OR | 4
92 = OR2 | 5
93 = XOR | 4
94 = XOR2 | 5
95 = INC | 3
96 = INC2 | 3
97 = DEC | 3
98 = DEC2 | 3
99 = RANDOM | 3
9A = LBYTE | 4
9B = HBYTE | 5
9C = 2BYTE | 6
9D = SETX | 7
9E = GETX | 7
9F = SEARCHX | 11
A0 = PC | 2
A1 = CHAR | 2
A2 = DFANM | 3
A3 = ANIME1 | 3
A4 = VISI | 2
A5 = XYZI | 11
A6 = XYI | 9
A7 = XYZ | 9
A8 = MOVE | 6
A9 = CMOVE | 6
AA = MOVA | 2
AB = TURA | 4
AC = ANIMW | 1
AD = FMOVE | 6
AE = ANIME2 | 3
AF = ANIM!1 | 3
B0 = CANIM1 | 5
B1 = CANM!1 | 5
B2 = MSPED | 4
B3 = DIR | 3
B4 = TURNGEN | 6
B5 = TURN | 6
B6 = DIRA | 2
B7 = GETDIR | 4
B8 = GETAXY | 5
B9 = GETAI | 4
BA = ANIM!2 | 3
BB = CANIM2 | 5
BC = CANM!2 | 5
BD = ASPED | 4
BE =  | 0
BF = CC | 2
C0 = JUMP | 11
C1 = AXYZI | 8
C2 = LADER | 15
C3 = OFST | 12
C4 = OFSTW | 1
C5 = TALKR | 3
C6 = SLIDR | 3
C7 = SOLID | 2
C8 = PRTYP | 2
C9 = PRTYM | 2
CA = PRTYE | 4
CB = IF-PRTYQ | 3
CC = IF-MEMBQ | 3
CD = MMB+- | 3
CE = MMBLK | 2
CF = MMBUK | 2
D0 = LINE | 13
D1 = LINON | 2
D2 = MPJPO | 2
D3 = SLINE | 16
D4 = SIN | 10
D5 = COS | 10
D6 = TLKR2 | 4
D7 = SLDR2 | 4
D8 = PMJMP | 3
D9 = PMJMP2 | 1
DA = AKAO2 | 15
DB = FCFIX | 2
DC = CCANM | 4
DD = ANIMB | 1
DE = TURNW | 1
DF = MPPAL | 11
E0 = BGON | 4
E1 = BGOFF | 4
E2 = BGROL | 3
E3 = BGROL2 | 3
E4 = BGCLR | 3
E5 = STPAL | 5
E6 = LDPAL | 5
E7 = CPPAL | 5
E8 = RTPAL | 7
E9 = ADPAL | 10
EA = MPPAL2 | 10
EB = STPLS | 5
EC = LDPLS | 5
ED = CPPAL2 | 8
EE = RTPAL2 | 8
EF = ADPAL2 | 11
F0 = MUSIC | 2
F1 = Sound | 5
F2 = AKAO | 14
F3 = MUSVT | 2
F4 = MUSVM | 2
F5 = MULCK | 2
F6 = BMUSC | 2
F7 = CHMPH | 4
F8 = PMVIE | 2
F9 = MOVIE | 1
FA = MVIEF | 3
FB = MVCAM | 2
FC = FMUSC | 2
FD = CMUSC | 6
FE = CHMST | 3
FF = GAMEOVER | 1



Now STARTMAP is the first room in the debug room. Yuffie is there and you have that first menu, here is the code for that room as it's really small.

This is the text section.
Code: [Select]

000------------------------------------------------
        NEXT{EOL}
        MENU ON{EOL}
        BATTLE LOCK{EOL}
        BATTLE UNLOCK{EOL}
        MOVIE LOCK{EOL}
        MOVIE UNLOCK{EOL}
        GLOBAL RESET{EOL}
        FULL NAME{EOL}
        NEW START{EOL}
        EXIT{STOP}
001------------------------------------------------
        BACK{EOL}
        SOUND RESET{EOL}
        FULL MATERIA{EOL}
        BATTLE999{EOL}
        EXIT{STOP}
002------------------------------------------------
MMMMMMMMMMMMMMM{STOP}
003------------------------------------------------
WWWWWWWWWWWWWWW{STOP}
004------------------------------------------------
MMMMMMMMMMMMMMM{STOP}
005------------------------------------------------
WWWWWWWWWWWWWWW{STOP}
006------------------------------------------------
MMMMMMMMMMMMMMM{STOP}
007------------------------------------------------
WWWWWWWWWWWWWWW{STOP}
008------------------------------------------------
MMMMMMMMMMMMMMM{STOP}
009------------------------------------------------
WWWWWWWWWWWWWWW{STOP}
00A------------------------------------------------
MMMMMMMMMMMMMMM{STOP}


and this is the script section

Code: [Select]

****** Section n°0 (dic) Script n° 0 ******
000 : PRTYP ( 00 )
002 : RET
003 : RET
                                                                               
****** Section n°0 (dic) Script n° 1 ******
000 : RET
                                                                               
****** Section n°1 (cloud) Script n° 0 ******
000 : CHAR ( 00 )
002 : PC ( 00 )
004 : RET
005 : XYZI ( 00, 00, 00, 00, 00, 00, 00, 00, 01, 00 )
010 : RET
                                                                               
****** Section n°1 (cloud) Script n° 1 ******
000 : RET
                                                                               
****** Section n°2 (tifa) Script n° 0 ******
000 : CHAR ( 01 )
002 : PC ( 02 )
004 : RET
005 : RET
                                                                               
****** Section n°2 (tifa) Script n° 1 ******
000 : RET
                                                                               
****** Section n°3 (cid) Script n° 0 ******
000 : CHAR ( 02 )
002 : PC ( 08 )
004 : RET
005 : RET
                                                                               
****** Section n°3 (cid) Script n° 1 ******
000 : RET
                                                                               
****** Section n°4 (yufi) Script n° 0 ******
000 : CHAR ( 03 )
002 : XYZI ( 00, 00, B6, FF, 7E, FF, 00, 00, 64, 00 )
00D : DIR ( 00, 60 )
010 : SLIDR ( 00, 01 )
013 : RET
014 : RET
                                                                               
****** Section n°4 (yufi) Script n° 1 ******
000 : window( id=01, X=0000, Y=0000, W=008A, H=00A9 )
00A : ASK ( 05, 01, 00, 00, 09, 00 )
011 : gotoNext +15
013 : window( id=01, X=0000, Y=0000, W=0081, H=0059 )
01D : ASK ( 05, 01, 01, 00, 04, 00 )
024 : gotoNextLong +009D
027 : if UByteL(50)[00] != 00 then(00) gotoLong +0007
02E : gotoPrev -1B
030 : gotoNextLong +0090
033 : if UByteL(50)[00] != 01 then(00) gotoLong +000A
03A : SET-WORD ( 20, 1E, 00, 00 )
03F : gotoNextLong +0081
042 : if UByteL(50)[00] != 02 then(00) gotoLong +0008
049 : SPECIAL ( FB )
04B : REQ ( 11, 74 )
04E : RET
04F : if UByteL(50)[00] != 03 then(00) gotoLong +0008
056 : SPECIAL ( FB )
058 : RET
059 : gotoNextLong +0067
05C : if UByteL(50)[00] != 04 then(00) gotoLong +0008
063 : SPECIAL ( FC )
065 : REQ ( 11, 5A )
068 : RET
069 : if UByteL(50)[00] != 05 then(00) gotoLong +0008
070 : SPECIAL ( FC )
072 : RET
073 : gotoNextLong +004D
076 : if UByteL(50)[00] != 06 then(00) gotoLong +0007
07D : SPECIAL ( FE )
07F : gotoNextLong +0041
082 : if UByteL(50)[00] != 07 then(00) gotoLong +0029
089 : SPECIAL ( FD )
08B : RET
08C : REQSW ( 0F, FD )
08F : REQ ( 03, 0F )
092 : CMUSC ( 02, 04, 0F, FD, 03 )
098 : PRQSW ( 0F, FD )
09B : PRQSW ( 06, 0F )
09E : CMUSC ( 06, 07, 0F, FD, 08 )
0A4 : JOIN ( 0F )
0A6 : CMUSC ( 04, 0A, 0F, FD, 07 )
0AC : SPLIT ( 11, 13, 00, 15, 50, 00, 08, 00, 0C, 00, 60, 74, 00, 00 )
0BB : RET
0BC : RET
0BD : RET
0BE : RET
0BF : RET
0C0 : RET
0C1 : RET
0C2 : if UByteL(50)[00] != 00 then(00) gotoLong +0008
0C9 : gotoPrevLong -00C9
0CC : gotoNextLong +0102
0CF : if UByteL(50)[00] != 01 then(00) gotoLong +00DF
0D6 : AKAO ( 00, 00, 00, C0, 7F, 00, 00, 00, 00, 00, 00, 00, 00 )
0E4 : AKAO ( 00, 00, 00, A0, 7F, 00, 00, 00, 00, 00, 00, 00, 00 )
0F2 : AKAO ( 00, 00, 00, A1, 7F, 00, 00, 00, 00, 00, 00, 00, 00 )
100 : AKAO ( 00, 00, 00, A2, 7F, 00, 00, 00, 00, 00, 00, 00, 00 )
10E : AKAO ( 00, 00, 00, A3, 7F, 00, 00, 00, 00, 00, 00, 00, 00 )
11C : AKAO2 ( 00, 00, 00, C8, FF, 7F, 00, 00, 00, 00, 00, 00, 00, 00 )
12B : AKAO2 ( 00, 00, 00, E4, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 )
13A : AKAO2 ( 00, 00, 00, B0, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 )
149 : AKAO2 ( 00, 00, 00, B1, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 )
158 : AKAO2 ( 00, 00, 00, B2, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 )
167 : AKAO2 ( 00, 00, 00, B3, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 )
176 : MUSIC ( 00 )
178 : AKAO ( 00, 00, 00, 28, 3F, 00, 00, 00, 00, 00, 00, 00, 00 )
186 : AKAO ( 00, 00, 00, 29, 3F, 00, 00, 00, 00, 00, 00, 00, 00 )
194 : AKAO ( 00, 00, 00, 2A, 3F, 00, 00, 00, 00, 00, 00, 00, 00 )
1A2 : AKAO ( 00, 00, 00, 2B, 3F, 00, 00, 00, 00, 00, 00, 00, 00 )
1B0 : gotoNextLong +001E
1B3 : if UByteL(50)[00] != 02 then(00) gotoLong +000B
1BA : SPECIAL ( F9 )
1BC : SPECIAL ( F9 )
1BE : SPECIAL ( F9 )
1C0 : gotoNextLong +000E
1C3 : if UByteL(50)[00] != 03 then(00) gotoLong +0007
1CA : battle ( 00, E7, 03 )
1CE : MHMMX
                                                                               
****** Section n°4 (yufi) Script n° 2 ******
000 : RET



THANKS LASYAN3!!!!!



Oh, and Gears has been updated.
http://the-afterm.ath.cx/gears/gears.pdf

Oh: One last thing...
Which field file is the first one where the game starts? Not STARTMAP, but where Barret says "C'mon newcomer, follow me"

131
camdat0.bin camdat1.bin camdat2.bin
That exactly *DO* these files do?. This is what I discovered...

The camdat*.lzs files on the PSX, when uncompressed are eactly the same files as the PC .bin files.

It has often been theroized that it holds all the dynamic data for the camera movements in battle. (That makes sense, as it will take much less horsepower to just use precalculated cam movements)

It is not in scene.bin format. The camdat's bin files are natively uncompressed. The compressed versions are .lzs files.

Hhere's the real stickler...

I swaped around camdat0.bin, camdat1.bin, camdat2.bin and fought a few battles. From what I could tell, there was no change in camera movement at all. Granted I was only playing the first level so I didn't pan that much. But nothing was different. (Maybe I should try some summons the next time around)

Also, when I was decoding the .a files. I was at least able to jive up some kind of alignment. Looking through a hex editor. I see there is some kind of alignment, but can't get it to line up right. There is also a header at the beginning of the file....

Anyone wanna take a peek at those?

132
I feel so terrible, I'm tryin to get myself up to speed with hacking FF7 and I feel so behind the power curve. Sorry for so many different topics. I'm gonna take a stab at the scripting engine, but need to know which field files the debug rooms are in.

Thanks.

133
General Discussion / Some thoughts on the PC Port.
« on: 2004-06-20 08:37:23 »
You know, I just installed the program for the first time in on old PC winning winodws 98. (Yes for the last 4 years I've just been poking at it with hex editors and never really *PLAYED* the PC port as I owned a PSX.

The install goes without a hitch... Reboot, and play the game....

The movies are updaide down and backwards.

Now think about this for a second.

I know this is a bug with the original game. I know that there is a patch for it, but honestly, I want you to take a step back for a bit.

It's a bug, it's something that wasn't cought because the demo didn't have any movies in it... It was an honest accident that bad code got into the release, they pached it..

An accident...

How on earth does something like that happen *ON ACCIDENT!*

I mean, I'm no whiz of a programmer myself, but if I was to write a movie subroutine, and I screwed it up somehow, I'm pretty sure my video would die a horrable death before anything was actually displayed. However UPSIDE DOWN and BACKWARDS? I coudn't code something like that *ON PURPOSE* much less on accident. It's silly! I mean, can you image the look on the prducer's face when he saw that? That's not only a bad bug. It's down right embarrasing.

I'm gonna grab the patch... Just wanted to know you guy's thoughts...

134
I need you permission to update your Mechanics doc (Formatting mostly) and place it onto my FF7 doc. I also want to do some cometic moving about, (Moiving the bugs you have discovered into a special BUGS section) I also I wish to table-ize some of the data. Possably also add side bars. It'll just be a general clean up for readbility.

I have some sections reserved for Allys and Enimeies as well.

I would just like your OK...

Also would it be ok to convert it to American English? My spell checker is sort of gagging on the little things. (realized/realised -formulae/formula) Though that might be asking a bit much....

135
Ok, to help unify the PC and PSX ports of FF7, there a little tutorial to help start data mining the PSX version. Let us start with the extraction of a texture.

Now I'm going to use the PC executable as a map, as I don't know exactly how the data is mapped in the PSX version. I'm also running Linux, so I have a few slick tools to help me.

Let us extract a texture, because that's the easiest. I have arbitrarily decided to extract from the PSX disk the blue bubble from the "aqua" enemy attack.

First I need to know where the texture is located. I start with the PC executable (There is a very good reason for this, I know we can just go into /magic/aqua.bin on the PSX CD-ROM but I want to show how you how the PC and the PSX formats link togeather.)

The first thing I do I look up the aqua attack in ff7.exe I have a command in Linux called "strings" that gets me pointed in the right direction.

Code: [Select]

>$ strings ff7.exe | less


This dumps all the readable text into a scrollable interface. I want to look for the aqua attack so I press the forward slash and put in "aqua" as my search string.

Code: [Select]

/aqua


The search will return with the following

Code: [Select]

...
goblinp1.spt
GOBLIN_2.TIM
goblinp2.spt
blue/goblinp
AQUA.TIM
AQUA.SPT
blue/aqua
MAGIKAL.TIM
MAGIKAL.SPT
blue/magikal
trainn_1.rsd
...


You can see the "blue/aqua" line. That's telling me that the aqua command is referenced in the /blue directory. I know that the "blue" dir is folded into the "magic" dir. Now I know what to look for in "magic/aqua.bin" on the PSX CD-ROM.

No you will notice that the actual files that make up aqua.bin are listed *BEFORE* the directory. This is not telling the order the data is in though, it's a refrence of what is in there.

Now, we are going  want to extract aqua.tim, which is the texture for the command. We do that by opening auqa.bin on the PSX disk and finding the TIM header.

ABOUT TIM HEADERS

A Texture In Memory (TIM)  is raw PSX video memory image with a few headers. The PSX did not have the ability to directly access it's VRAM and pushes everything through the GPU. TIMs are an easy way to upload a texture into VRAM with little hassle. The header format is as follows.

Here is a  4 bpp TIM header
  [1-4]   - 10 00 00 00: ID Tag for TIM Format
  [5-8]   - 08 00 00 00: ID Tag for 4BPP
 
Here is a  8 bpp TIM header
  [1-4]   - 10 00 00 00: ID Tag for TIM Format
  [5-8]   - 09 00 00 00: ID Tag for 8BPP

Here is a  16 bpp TIM header
  [1-4]   - 10 00 00 00: ID Tag for TIM Format
  [5-8]   - 02 00 00 00: ID Tag for 16BPP

Here is a  24 bpp TIM header
  [1-4]   - 10 00 00 00: ID Tag for TIM Format
  [5-8]   - 03 00 00 00: ID Tag for 24BPP


So now what we do is search for the TIM and extract it out of the bin file.

I'll so a search with the hex command first.

Code: [Select]

>$ hex aqua.bin | less


now I need to search for the TIM header sequence

Code: [Select]

/10 00 00 00


I wind up with this.

Code: [Select]

0720  10 00 00 00 09 00 00 00  0c 02 00 00 00 03 ff 00  ........ ........
0730  00 01 01 00 ff ff de ff  bc ff 9a ff 78 ff 56 ff  ........ ....x.V.


AHA! One 8 bpp texture at an offset of 0720

Now here's the sad thing that will probably be a let-down for everyone.

I don't know how to extract it properly...

I usally strip out all the data before the 10 00 00 00 header and use a TIM ripper to extract the file. I than can use the imagemagik to view it as it can read TIM files natively.
.
.
.
.
.
Wait for it....
.
.
.
.
.
Wait for it....
.
.
.
.
.



TAAAADAAAAA!~

Here are some exercises for the reader.

We know this bin has a TIM and a SPR file. Where is the SPR file? What's in it? What's in the leftover data? Is there leftover data? Where is the script? Where is the file table in the PSX version?

Well, that's it for now. Lemme know what you guys thought of this.

-halkun

136
Well, you guys conviced me. I've decided to go ahead and document all the FF7 engine findings into one super document. I've decided to call it "Gears" as not only a name that inspires the inner workings of something, but also because it brings up the "Steampunk" genre that FF7 takes place in.

I finished the outline and will be populating the document with content that I can find from here and all around the Internet.

The byline was tricky to come up with as it's not just me. I decided to write "By Joshua Walker and the 'Qhimm team'"

I hope that's OK...

This will help us muchly. Not only will we have a centralized place for data collection, but will allow us to take the engine apart in small chunks that are easy to decipher.

Here is the outline/Table of contents. If you have anything you want to add, let me know. This will dictate the way the data is presented. Did I get all the terms right?

Code: [Select]

Table of Contents
Introduction
History
-PSX version overview
-PC version overview
Engine Basics
-Common Terms
-Parts of the Engine
-A Look at the Debug Room
The Kernel
-Kernel Overview
-Generic Program Flow
-The Threading System
-Data Caching
-File System Access
The Field Module
-Field Overview
-Event Scripting
-Triggers
-The 3D overlay
-The Actors
-The Ego
-Data Organization
-Textures (The TIM Files)
-Polygons (The PLY Files)
-Hierarchy (The HRC Files)
-Animation (The ANM files)
-Models (The RSD Files)
The Battle Module
-The Mathematics of Battle
-The Battle Scene
-Allys
-Enemies
-Magic Scripting
-Data Organization
-Textures (The TIM Files)
-Sprites (The SPT Files)
-Models (The RSD Files)
The Menu Module
-The Accessors
-Game Saves
The World Map
-Data Format
Appendix
-Item Listings
-Resource Lookup tables
-Source Code Forensics
BUGS
-PSX Version
-PC Version


IF YOU WANT TO HELP
I am using OpenOffice.org as my document writer of choice. The reason why is because it supports open formats for data exchange (XML) and has a pretty wicked PDF generator. I would recommend if you want to assist, download OpenOffice and send me changes in .sxw format. (OOo's native compressed XML format) OOo is free, runs on every popular OS, and is availible at http://www.openoffice.org

137
Now that we seem to have the ability to export FF7 mattle models as max files, I propose creating a project for NWN.

Neverwinter nights is a fully scriptable RPG based on the aurura engine. It nativly takes in MAX data and every corner of the game can be changed.

It also runs on Linux, Mac, and Windows.

To help you get started (Mostly this is for TallgeeseIIII) I have the cutom content guide that tells how to rip apart NWN's aura engine and input new data into the game.

The guide is here

Now this is just the tip of the iceburg, I think.

You can also import not only models, but also convert large models as the 3d environment your characters can walk around in...

Now the FF7 battle environments are not very well suited for this as they are really small, but use cute visual effects to make them look expansive (Like the open field scene) but they are *PERFECT* for a backdrop for a scripted movie using the FF7 in realtime 3d.

NWN has 154 preanimated and scriptiable actions for humanoid characters. You can, in therory, (According to the CCG anyway), do a mesh-for-mesh replacement of body parts with already exiting NWN bones and animations.

Let me put this in perspective....

Red vs Blue has created ingame moves using nothing but head bobbing and looking through a gunsite.

We have the ability to create whole backdrops and use a much more expansive scripting system. We can also play the files ingame and not have to render video to a DIVIX file.

NWN also has what's called the CEP pac that gretly expands the defualt objects (read: props) in the game. Also if a particular 3d balle scene isn't avilible (FOr example, wall market) we can use nwn's default tiles for inside cities and houses.

WHat about the extra characters?

Well, lucky for *YOU* guys I have a whole bunch of unskinned toshindin models floating about, combined with the humanoid monsters in FF7, I think I have enough parts to make a cast of people.

Let's retell the *ORIGINAL* FF7 story as a movie to celibrate the coming of "Advent Children"

That and if we get sick of it, we at least make a cute FF7 module for NWN so you can run around as cloud/yuffie/tifa in the game.

Input?

138
More for you guys. Keep in mind, like the other directories there is a "dummy file" with the same name as the directory I added as kind of a "Catch all" for any data that's recovered that doesn't fit.

From what I gather, this is where the engine expects to find these files, however they are obfuscated by the filesystem I/O on both the PC and PSX version in diffrent ways.

I like to think of this as the "FF7 Grand Unifacation Theory"

It appears that the engine can only read, at most, about 10 diffrent "pure" file formats after the obfuscation is cleared away.

ANM (Animation)
PLY (Polygon)
RSD (Resourse)
HRC (Hirearchy)
TIM (Texture-In-Memory)
SPT (sprite, I'm guessing a 2D image or animation sequence placed in 3D space, meaning the face of the picture always faces the camera)

Plus some others. I'm still collecting a list of "pure" filetypes

Other things to note....

The FF7 kernel is thread-based. Because the PSX lacks an MMU and the three segments of protected memory are hard-wired togeather, this creates a bit of a problem as you don't want one thread to overwrite another. The thread management core keeps everything running without something going spry and stomping all over another's memory segemnt. This is why there are exaustive debug comments in the FF7 PC executable. I'm sure the hisenbugs would of been horrific.

In battle I have IDed a clock thread, and a magic thread. Only one magic can shoot off at time. Magic is cached as well. I think there is cache paging, but only one way (Disk -> Ram) When a new magic is threaded that is not cached, and there is no room left in VRAM for that spell, the old spell is marked "dirty" and the vram contents overwritten. There is no preemtive threading so any new magic is paged on demand in that is not cached.

I think that make sense.

Anyway, here's the files..

Code: [Select]

effect/hitmark
єffect/hitmark/jo_c01.spt
єffect/hitmark/jo_c02.spt
єffect/hitmark/jo_c03.spt
єffect/hitmark/jo_c04.spt
єffect/hitmark/jo_c05.spt
єffect/hitmark/jo_c06.spt
єffect/hitmark/jo_c07.spt
єffect/hitmark/jo_c08.spt
effect/s_baria
effect/s_baria/jo_ba.rsd
effect/s_baria/jo_mba.rsd
effect/s_baria/jo_rif.rsd

Ñ–tem/kemuri
Ñ–tem/kemuri/kemuri
Ñ–tem/kemuri/smkball.tim
Ñ–tem/kemuri/kemuri.spt
item/veget
item/veget/veget
item/veget/yasai_1.rsd
item/veget/yasai_2.rsd
item/veget/yasai_3.rsd
item/veget/yasai_4.rsd
item/veget/yasai_5.rsd
item/veget/yasai_6.rsd
item/veget/yasai_7.rsd
item/veget/yasai_8.rsd
item/wp_ba
item/wp_ba/wp_ba
item/wp_ba/brhand01.rsd
item/wp_ba/brhand02.rsd
item/wp_ba/brhand03.rsd
item/wp_ba/brhand04.rsd
item/wp_ba/brhand05.rsd
item/wp_ba/brhand06.rsd
item/wp_ba/brhand07.rsd
item/wp_ba/brhand08.rsd
item/wp_ba/brhand09.rsd
item/wp_ba/brhand10.rsd
item/wp_ba/brhand11.rsd
item/wp_ba/brhand12.rsd
item/wp_ba/brhand13.rsd
item/wp_ba/brhand14.rsd
item/wp_ba/brhand15.rsd
Ñ–tem/wp_bi
item/wp_bi/wp_bi
item/wp_bi/vin_gun01.rsd
item/wp_bi/vin_gun02.rsd
item/wp_bi/vin_gun03.rsd
item/wp_bi/vin_gun04.rsd
item/wp_bi/vin_gun05.rsd
item/wp_bi/vin_gun06.rsd
item/wp_bi/vin_gun07.rsd
item/wp_bi/vin_gun08.rsd
item/wp_bi/vin_gun09.rsd
item/wp_bi/vin_gun10.rsd
item/wp_bi/vin_gun11.rsd
item/wp_bi/vin_gun12.rsd
item/wp_bi/vin_gun13.rsd
item/wp_cu
item/wp_cu/wp_cu
item/wp_cu/h_sword01.rsd
item/wp_cu/h_sword02.rsd
item/wp_cu/h_sword03.rsd
item/wp_cu/h_sword04.rsd
item/wp_cu/h_sword05.rsd
item/wp_cu/h_sword06.rsd
item/wp_cu/h_sword07.rsd
item/wp_cu/h_sword08.rsd
item/wp_cu/h_sword09.rsd
item/wp_cu/h_sword10.rsd
item/wp_cu/h_sword11.rsd
item/wp_cu/h_sword12.rsd
item/wp_cu/h_sword13.rsd
item/wp_cu/h_sword14.rsd
item/wp_cu/h_sword15.rsd
item/wp_ea
item/wp_ea/wp_ea
item/wp_ea/rod01.rsd
item/wp_ea/rod02.rsd
item/wp_ea/rod03.rsd
item/wp_ea/rod04.rsd
item/wp_ea/rod05.rsd
item/wp_ea/rod06.rsd
item/wp_ea/rod07.rsd
item/wp_ea/rod08.rsd
item/wp_ea/rod09.rsd
item/wp_ea/rod10.rsd
item/wp_ea/rod11.rsd
item/wp_ke
item/wp_ke/wp_ke
item/wp_ke/mega01.rsd
item/wp_ke/mega02.rsd
item/wp_ke/mega03.rsd
item/wp_ke/mega04.rsd
item/wp_ke/mega05.rsd
item/wp_ke/mega06.rsd
item/wp_ke/mega07.rsd
item/wp_ke/mega08.rsd
item/wp_ke/mega09.rsd
item/wp_ke/mega10.rsd
item/wp_ke/mega11.rsd
item/wp_ke/mega12.rsd
item/wp_ke/mega13.rsd
item/wp_si/
item/wp_si/wp_si
item/wp_si/weapon01.rsd
item/wp_si/weapon02.rsd
item/wp_si/weapon03.rsd
item/wp_si/weapon04.rsd
item/wp_si/weapon05.rsd
item/wp_si/weapon06.rsd
item/wp_si/weapon07.rsd
item/wp_si/weapon08.rsd
item/wp_si/weapon09.rsd
item/wp_si/weapon10.rsd
item/wp_si/weapon11.rsd
item/wp_si/weapon12.rsd
item/wp_si/weapon13.rsd
item/wp_si/weapon14.rsd
item/wp_yu
item/wp_yu/wp_yu
item/wp_yu/shuriken01.rsd
item/wp_yu/shuriken02.rsd
item/wp_yu/shuriken03.rsd
item/wp_yu/shuriken04.rsd
item/wp_yu/shuriken05.rsd
item/wp_yu/shuriken06.rsd
item/wp_yu/shuriken07.rsd
item/wp_yu/shuriken08.rsd
item/wp_yu/shuriken09.rsd
item/wp_yu/shuriken10.rsd
item/wp_yu/shuriken11.rsd
item/wp_yu/shuriken12.rsd
item/wp_yu/shuriken13.rsd
item/wp_yu/shuriken14.rsd
item/wp_yu/zeni.rsd
item/yamabiko
item/yamabiko/yamabiko
item/yamabiko/echoes.tim
item/yamabiko/kemuri.spt

weapon/beam1
weapon/beam1/beam1
weapon/beam1/awa_1.tim
weapon/beam1/awa_1.spt
weapon/beam1/hit_1.tim
weapon/beam1/hit_1.spt
weapon/beam1/beam1.rsd
weapon/beam1/beam2.rsd
weapon/beam1/energy1.rsd
weapon/beam1/energy2.rsd
weapon/dia_u
weapon/dia_u/dia_u
weapon/dia_u/stage57.dat
weapon/dia_u/senkou2.rsd
weapon/dia_u/hikari.rsd
weapon/dia_u/hikari1.rsd
weapon/dia_u/line.rsd
weapon/dia_u/gan1.rsd
weapon/dia_u/gan2.rsd
weapon/dia_u/gan3.rsd
weapon/dia_u/gan4.rsd
weapon/dia_u/gan5.rsd
weapon/dia_u/gan6.rsd
weapon/dia_u/tama1.rsd
weapon/dia_u/tama2.rsd
weapon/dia_u/moto.rsd
weapon/dia_u/hado1.rsd
weapon/dia_u/hado.rsd
weapon/dia_u/soto.rsd
weapon/dia_u/kemu1.tim
weapon/dia_u/kemu1.spt
weapon/dia_u/kemu2.tim
weapon/dia_u/kemu2.spt
weapon/dia_u/baku1.tim
weapon/dia_u/baku1.spt
weapon/dia_u/kou.tim
weapon/dia_u/kou.spt
weapon/s_nova
weapon/s_nova/s_nova
weapon/s_nova/bomb_1.rsd
weapon/s_nova/comet_1.rsd
weapon/s_nova/corona_1.rsd
weapon/s_nova/corona_2.rsd
weapon/s_nova/corona_3.rsd
weapon/s_nova/cosmo_1.rsd
weapon/s_nova/earth_1.rsd
weapon/s_nova/earth_2.rsd
weapon/s_nova/exp_1.rsd
weapon/s_nova/exp_2.rsd
weapon/s_nova/exp_3.rsd
weapon/s_nova/exp_4.rsd
weapon/s_nova/flash_1.rsd
weapon/s_nova/formula1.spt
weapon/s_nova/formula1.tim
weapon/s_nova/formula2.spt
weapon/s_nova/formula3.spt
weapon/s_nova/formula4.spt
weapon/s_nova/galaxy_1.rsd
weapon/s_nova/ice_1.rsd
weapon/s_nova/ice_2.rsd
weapon/s_nova/ice_3.rsd
weapon/s_nova/inseki_1.rsd
weapon/s_nova/jupiter1.rsd
weapon/s_nova/lens_1.spt
weapon/s_nova/lens_1.tim
weapon/s_nova/line_1.rsd
weapon/s_nova/mars_1.rsd
weapon/s_nova/mercury1.spt
weapon/s_nova/mercury1.tim
weapon/s_nova/mercury2.rsd
weapon/s_nova/mercury2.tim
weapon/s_nova/name_1.spt
weapon/s_nova/name_1.tim
weapon/s_nova/nova_1.spt
weapon/s_nova/nova_1.tim
weapon/s_nova/nova_2.spt
weapon/s_nova/nova_2.tim
weapon/s_nova/nova_3.rsd
weapon/s_nova/pluto_1.rsd
weapon/s_nova/pluto_1.tim
weapon/s_nova/ring_1.rsd
weapon/s_nova/rock_1.rsd
weapon/s_nova/rock_2.rsd
weapon/s_nova/rock_3.rsd
weapon/s_nova/s_ring1.rsd
weapon/s_nova/saturn_1.rsd
weapon/s_nova/saturn_2.rsd
weapon/s_nova/sta_neb.tim
weapon/s_nova/stage572.tim
weapon/s_nova/star_1.spt
weapon/s_nova/sun_1.rsd
weapon/s_nova/sun_1.spt
weapon/s_nova/sun_x.rsd
weapon/s_nova/tendou_1.spt
weapon/s_nova/tendou_1.tim
weapon/s_nova/tim.tim
weapon/s_nova/venus_1.rsd
weapon/s_nova/venus_1.tim
weapon/weapon1
weapon/weapon1/weapon1
weapon/weapon1/smoke_1.tim
weapon/weapon1/smoke_1.spt
weapon/weapon2
weapon/weapon2/weapon2
weapon/weapon2/ant1.tim
weapon/weapon3
weapon/weapon3/weapon3
weapon/weapon3/awa_1.tim
weapon/weapon3/awa_1.spt
weapon/weapon3/exp_1.tim
weapon/weapon3/exp_1.spt
weapon/weapon3/line_1.tim
weapon/weapon3/line_1.spt
weapon/weapon3/tama_1.tim
weapon/weapon3/tama_1.spt
weapon/weapon3/flash_1.rsd
weapon/weapon3/ring_1.rsd
weapon/weapon3/w_ball.rsd
weapon/weapon4
weapon/weapon4/weapon4
weapon/weapon4/houden_1.tim
weapon/weapon4/houden_1.spt
weapon/weapon4/smoke_1.tim
weapon/weapon4/smoke_1.spt
weapon/weapon4/bomb_1.rsd
weapon/weapon4/rock_1.rsd
weapon/weapon4/rock_2.rsd
weapon/weapon4/rock_3.rsd


I wonder where these files are "folded" into? I know /weapon/s_nova is folded into the /snova dir on the PSX

/item I bet is folded into /enemy6

Theroies?

139
I have yet to find the tolkenized data, but the uncompressed tolkens are here, I'm found it rumminging through some arifacts in the /summons dir Though I'm not sure if this is conatined in VAHAMUT2 or not. I'm still getting the hang of how a directory points to the files within. This is the only instance I have found of an uncompressed file found in a listing so I may have it messed up where it belongs. I may also not have the whole thing.

Bare in mind, this is just an arifact of the development tree and doen't reflect the location PC data or PSX data (Yet!) But its something to keep an eyeball out for. (I know neeldle in a haystack)

Also, have a new tool at my displosal. I have the ability to copy my /dev/cdrom device as an ISO image and mount that file as a filesystem. What does this mean? Well, It allows me to create a "rewritable CD-ROM" on my hard drive, play with the files, and then point an emulator to my edited CD-ROM image. This will allow me to directly play with the data (By opening/reading/writing files) without having to mess static ISO images. Is one thing to change a few bytes in an ISO image. It's another to be able to mount the image and swap out this BIN file for that one.

The PC executable is one heck of a roadmap.

ADDUNDUM: Forgot the script...
Code: [Select]

SUMMON/VAHAMUT2
[Neo] begin scan ground
[Neo] finish scan ground
[Neo] begin thunder
[Neo] Effect_play3 group 0
[Neo] finished effect play
[Neo] Link ground, dust_manager, rock1_manager
[Neo] link cloud1, sky_mask
[Neo] link cloud2
[Neo] link line_light3_manager
[Neo] white out
[Neo] white-in, link cloudsea, backsky
[Neo] effect play3 group 1
[Neo] finished effect play 3
[Neo] linke ball_manager, circle, line_light1_manager
[Neo] effect_play3 group 2
[Neo] finished effect play3
[Neo] link breath
[Neo] rock2_manager
[Neo] link flash2, rock3_manager, line_light2_manager
[Neo] white-out
[Neo] effect_play3 group 3
[Neo] finished effect_play3
[Neo] white-in
[Neo] finish Neo Bahamut

140
It would seem, that early on in FF7's development cycle, the game data was originally  all "expanded" and placed in appropriate directories. I've been trying to rebuild the original uncompressed development environment using artifacts I'm finding in the game's executable. Through a very weird set of events, I only have disk 2 and 3 of the PSX version and the PC executable. However there are a few assumptions I have made that make my life much easier.

1) FF7 was designed for the PSX.

2) Before build-time FF7's game data  must be fully expanded to allow the various development teams and artists direct access to their work.

3) Post build results in three ISO images that can be burned and mass produced.

4) The data must have a logical placement so non programmers can find it.

5) Everything is under a /FF7 directory

I have discovered that within the PSX version of the game, the data consists of BIN files and LZS files. On the PSX, BIN files are uncompressed archives and LZS file are compressed ones. Both contain multiple files within them. Using artifacts I found the PC executable, I can see what files are contained in the PSX BIN and LZS files. I also have the ability to place them (Somewhat) into my current image of the FF7 development tree. The data files only use relative pathnames.

The downside, I have no headers. Only filenames.

There is a silver lining. The files within the BIN files have headers themselves, though they are hard to pick out. Not only that, the *original* filenames, from which both the PSX and PC datasets are derived  are intact. For example .a files on the PC are really .ANM files. (These were stripped of a name, enumerated, and placed into BIN file on the PSX version.)  Another example is .p files. These are called .PLY files. These too were stripped of a name, enumerated, and placed into BIN files as well.

A PSX BIN file can only be so big, if there is too much data contained within it, it will "spill over" into a compressed LZS file with the same name.

In my quest to rebuild the deveopment tree, I have now decoded the /blue directory I have some notes after the listing....

Code: [Select]

blue/aqua
blue/aqua/aqua
blue/aqua/aqua.tim
blue/aqua/squa.spt
blue/beata
blue/beata/beata
blue/beata/beata_1.rsd
blue/beata/beata_2.rsd
blue/chyobo
blue/chyobo/chyobo
blue/chyobo/confu_1.tim
blue/chyobo/confu_1.spt
blue/chyobo/smoke.tim
blue/chyobo/smoke_1.spt
blue/dethfo/dethfo
blue/dethfo/dethfo_1.tim
blue/dethfo/light1.rsd
blue/dragonn
blue/dragonn/dragonn
blue/dragonn/dragon.tim
blue/dragonn/dragon.spt
blue/dragonn/dragon_1.rsd
blue/dragonn/dragon_2.rsd
blue/dragonn/dragon_3.rsd
blue/dragonn/dragon_4.rsd
blue/dragonn/light.rsd
blue/goblinp
blue/goblinp/goblinp
blue/goblinp/goblin_1.tim
blue/goblinp/goblinp1.spt
blue/goblinp/goblin_2.tim
blue/goblinp/goblinp2.spt
blue/hanmmer
blue/hanmmer/hanmmer
blue/hanmmer/hanmer.rsd
blue/hatena
blue/hatena/hatena
blue/hatena/hatena_2.tim
blue/hatena/hatena_1.tim
blue/hatena/hatena1.spt
blue/howin
blue/howin/howin
blue/howin/w_wind.tim
blue/howin/line.spt
blue/kaenn
blue/kaenn/kaenn
blue/kaenn/flame00.tim
blue/kaenn/kaenn.spt
blue/kaenn/flame01.tim
blue/kaeru
blue/kaeru/kaeru
blue/kaeru/kaeru_1.tim
blue/kaeru/kaeru.spt
blue/kaeru/onpu1.tim
blue/kaeru/onpu1.spt
blue/kusai
blue/kusai/kusai
blue/kusai/kusai_1.tim
blue/kusai/kusai.spt
blue/lv4jibak
blue/lv4jibak/lv4jibak
blue/lv4jibak/lv4ji_1.tim
blue/lv4jibak/lv4jiba.spt
blue/lv5deth
blue/lv5deth/lv5deth
blue/lv5deth/lv5deth.tim
blue/lv5deth/lv5deth.spt
blue/lv5deth/light_1.rsd
blue/magikal
blue/magikal/magikal
blue/magikaL/magikal.tim
blue/magikal/magikal.spt
blue/matra
blue/matra/matra
blue/matra/matra_1.tim
blue/matra/matra.spt
blue/matra/matra.rsd
blue/mytyg
blue/mytyg/mytyg
blue/mytyg/mytyg_1.rsd
blue/mytyg/light_1.rsd
blue/nanntoka
blue/nanntoka/nanntoka
blue/nanntoka/hatena.rsd
blue/nanntoka/inseki_1.rsd
blue/nanntoka/inseki_2.rsd
blue/nanntoka/iinseki_3.rsd
blue/nanntoka/ilight.rsd
blue/nanntoka/ister.rsd
blue/reazer
blue/reazer/reazer
blue/reazer/reazer.tim
blue/reazer/reazer.spt
blue/ruretto
blue/ruretto/ruretto
blue/ruretto/yubi.tim
blue/sflea
blue/sflea/sflea
blue/sflea/flea_5.tim
blue/sflea/flea_4.tim
blue/sflea/exp_1.spt
blue/sflea/flea_3.tim
blue/sflea/exp_2.spt
blue/sflea/flea_5.tim
blue/sflea/exp_3.spt
blue/sflea/flea_1.rsd
blue/sflea/flea_2.rsd
blue/trainn
blue/trainn/trainn
blue/trainn/trainn_1.rsd


The files created in the /blue directory are placed into the /magic directory on the PSX during build-time.

I would like to draw your attention to the blue/ruretto directory, as that's the easiest to understand. In the game, this is the blue magic that spins the white gloved Final Fantasy pointing finger (Called a "Yubi") around to all allys and monsters on the battle screen. When the finger stops, that character or monster is killed.

In this directory (an also uncompressed in "ruretto.bin" in the PSX) there is a picture file of the finger (yubi.tim) and a bunch of other unnamed data that I don't know. I've collected that data into a file with the same name as the directory. (blue/ruretto/ruretto) I'm guessing this is the master script that tells the engine how to "play" this particular spell.

Now for those who don't know, a TIM file is not only a picture, but it also holds data on where to put the picture in video memory, and where to put the color look up table (CLUT). This helps massivly with texture management and cacheing..

RSD files are text in the PC version. On a PSX, these are "compiled" into a binary format to make them smaller. They are, however, the same format by way of the order the data comes in.

What's a SPR file? A sprite? Does this have more or less information than a TIM?

Anyways that's what I discoverd. I'm going to make some pasta now. I hope I'm not flooding the board with useless posts. I'll try and answer any questions you might have.

ADDUNDUM:
DRAT! It seems that the files are renamed. My example isn't in /magic under the name ruretto.bin

I'm sure it's in there though... I'll have to decode more and find what was renamed...

141
Scripting and Reverse Engineering / Just an experiment
« on: 2004-06-07 00:20:11 »
Can someone give me a file listing of what's in condor.lgp and chocobo.lgp? That would be swell.

ADUUNDUM:
Also also magic.lgp, that would be great!

ADDUNDUM#2:
I don't remeber, but wasn't everything tucked into a /data directory. If it was, could you confirm that?

142
Once upon a time....

(Wow, that's how it always starts, huh ^_^)

Once upon a time, almost four yars ago, I came to this board and tought a little about how to reverse programs. I, like yourselfs, enjoy picking apart things and learning more about the world.

This is the basis of science.

I tought a little bit about how to look at data in diffrent ways. I showed how programmers can be lazy (and the contract workers for the FF7 port to the PC doublely so). The therory being if programmers were really motivated, they woudn't of persued a carrer sitting on thier butts for more than 8 hours a day.

Between the fact that programmers are lazy, and computers don't care, this causes arifacts that, over time, can tell a story about how things came to be.

We are, in fact, data archiologists.

So it has come, where I have decided to grab my shovel and bit-bucket and see what I can find. Sometimes, when people are busing blowing the dust off a particular rock, or examining the attibutes of some long cast out stone, it's easy to lose the big picture.

To help, in the little way I can, I have decided to assist and paint for you not a complete picture, but something that may assist you. If not, it's at least intresting as hell to look at.

I gave you the following....

Code: [Select]

c:\ff7\chocobo\ch_app.cpp
c:\ff7\chocobo\ch_chr.cpp
c:\ff7\chocobo\ch_ddraw.cpp
c:\ff7\chocobo\ch_init.cpp
c:\ff7\coaster\psxdata_c.cpp
c:\ff7\condor\cd_app.cpp
c:\ff7\condor\cd_ddraw.cpp
c:\ff7\condor\cd_init.cpp
c:\ff7\condor\cd_tim.cpp
c:\ff7\field\src\ad_app.cpp
c:\ff7\field\src\ad_bk.cpp
c:\ff7\field\src\ad_cdr.cpp
c:\ff7\field\src\ad_data.cpp
c:\ff7\field\src\ad_ddraw.cpp
c:\ff7\field\src\ad_human.cpp
c:\ff7\field\src\ad_image.cpp
c:\ff7\field\src\ad_list.cpp
c:\ff7\field\src\ad_list.cpp
c:\ff7\field\src\ad_obj.cpp
c:\ff7\field\src\ad_pal.cpp
c:\ff7\field\src\ad_tile.cpp
c:\ff7\field\src\tutaddr.cpp
c:\ff7\highway\psxdata.cpp
c:\ff7\snobo\memory.cpp
c:\ff7\snobo\tmd.cpp
c:\ff7\src\battle\b3ddata.cpp
c:\ff7\src\battle\battle.cpp
c:\ff7\src\battle\battle3d\amptoanm.cpp
c:\ff7\src\battle\battle3d\bdata.cpp
c:\ff7\src\battle\battle3d\char.cpp
c:\ff7\src\battle\battle3d\enemy.cpp
c:\ff7\src\battle\battle3d\limitbrk.cpp
c:\ff7\src\battle\battle3d\lmd.cpp
c:\ff7\src\battle\battle3d\lmd.cpp
c:\ff7\src\battle\battle3d\mdl.cpp
c:\ff7\src\battle\battle3d\stage.cpp
c:\ff7\src\battle\battle3d\stage.cpp
c:\ff7\src\battle\myoshiok\lasboss3.cpp
c:\ff7\src\battle\yama\coloss.cpp
c:\ff7\src\battle\yama\init.cpp
c:\ff7\src\battle\yama\inits.cpp
c:\ff7\src\battle\yasui\deadsef.cpp
c:\ff7\src\battle\yasui\sting.cpp
c:\ff7\src\battle\yasui\vahamut0.cpp
c:\ff7\src\credits\credfile.cpp
c:\ff7\src\main\initpath.cpp
c:\ff7\src\main\main.cpp
c:\ff7\src\menu\btlmenu\english\callback.cpp
c:\ff7\src\menu\english\loadmenu.cpp
c:\ff7\src\movie\sm_movie.cpp
c:\ff7\src\wm\wmdefine.cpp
c:\ff7\src\wm\wmfile.cpp
c:\lib\h\graphics\sw\offset.hpp
c:\lib\src\file\direct.cpp
c:\lib\src\file\file.cpp
c:\lib\src\file\is_lib.cpp
c:\lib\src\file\registry.cpp
c:\lib\src\file\smcdfile.cpp
c:\lib\src\graphics\directx.cpp
c:\lib\src\graphics\driver.cpp
c:\lib\src\graphics\dx_3d2d.cpp
c:\lib\src\graphics\dx_dbg.cpp
c:\lib\src\graphics\dx_graph.cpp
c:\lib\src\graphics\dx_mat.cpp
c:\lib\src\graphics\dx_mesh.cpp
c:\lib\src\graphics\dx_pal.cpp
c:\lib\src\graphics\dx_rend.cpp
c:\lib\src\graphics\dx_rend.cpp
c:\lib\src\graphics\dx_rend5.cpp
c:\lib\src\graphics\dx_rend5.cpp
c:\lib\src\graphics\dx_rendi.cpp
c:\lib\src\graphics\dx_rendi.cpp
c:\lib\src\graphics\dx_rendx.cpp
c:\lib\src\graphics\dx_sfx.cpp
c:\lib\src\graphics\dx_spr.cpp
c:\lib\src\graphics\dx_stat.cpp
c:\lib\src\graphics\dx_view.cpp
c:\lib\src\graphics\g_drv.cpp
c:\lib\src\graphics\instance.cpp
c:\lib\src\graphics\light.cpp
c:\lib\src\graphics\psx.cpp
c:\lib\src\graphics\psxgraph.cpp
c:\lib\src\graphics\render.cpp
c:\lib\src\graphics\shp.cpp
c:\lib\src\graphics\sw\sw.cpp
c:\lib\src\graphics\sw\sw.cpp
c:\lib\src\graphics\sw\sw_vert.cpp
c:\lib\src\graphics\sw\z.cpp
c:\lib\src\input\input.cpp
c:\lib\src\list\list.cpp
c:\lib\src\mem\heap.cpp
c:\lib\src\mem\mem.cpp
c:\lib\src\movie\movie.cpp
c:\lib\src\polygon\anm.cpp
c:\lib\src\polygon\plytopd.cpp
c:\lib\src\polygon\polygon.cpp
c:\lib\src\polygon\rsd.cpp
c:\lib\src\polygon\tim.cpp
c:\lib\src\sort\sort.cpp
c:\lib\src\sound\acm.cpp
c:\lib\src\sound\creative\sfutils.cpp
c:\lib\src\sound\dx_snd.cpp
c:\lib\src\sound\midi1.cpp
c:\lib\src\sound\sound.cpp
c:\lib\src\stack\stack.cpp
c:\lib\src\thread\thread.cpp
c:\lib\src\token\token.cpp
c:\lib\src\trans\trans.cpp


I'm not done yet, I think I have some enums and reconstucted filenames...

This is just the beginning, I have made some rather intresting discoveries that I may share later. I have to experiment first...

That and buy another copy of FF7 PC ^_^

143
Buy it's been a few years, hasn't it?

I'm just wondering. Also is there an extractor tool for the PSX version of FF8, as it seems to use Squares own filesystem on the disk.

I remember that someone got thier fingers into FF7's battle fields a while ago. Anything come from that?

Just rolling around in the background...

144
Scripting and Reverse Engineering / Source code to FF1
« on: 2004-03-13 11:08:02 »
Hi guys, remeber me?

Hey, I was reversing FF1 for the NES a while ago and posted some of my progrgress in the form of psudo code in a .zip file (I was about 60% done)

Does anyone have a copy of this. I lost in in a nasty hard drive crash. If not then it's sadly lost to time ;_;

145
General Discussion / Qhimm, Fix your forums!
« on: 2003-01-15 22:38:41 »
I don't mean to sound infamatory, but for the last few months I haven't been showing up here because I thought the forums were broken. Turns out the won't render in Mozilla. IIS is refusing to run the board script, so all I get is <html><body></body></html> from forums.qhimm.com. This as *NOT* a render problem, but a server-side issue. This is being posted on a friends laptop. Can you *please* make it a little more platform-friendly? It appears that phpBB 2 (possably subsilver) is barfing on browser detection as it seems to be asking what browser I have for CSS setup. (posting.php executes fine, and it has a code snippit in it. index.php, search.php, login.php etc... don't have me anything but the blank tags)

In other news, how are you guys?

-halkun

146
I know me of all people whould know this, but I wanna try my hands at making an interactive PSX dissasembler. Reason being is that the PSX FF7 exe is much smaller and much more easy to work with. I need to at what address should I start the dump at?

I know where the BIOS is, but I don't know at what address the BIOS loads the PSX exe at.



Help

147
Scripting and Reverse Engineering / Source for FF1
« on: 2002-10-29 01:18:25 »
I thought I would put it here too. I've been talking about it in the general board.

ff1src.tar.gz

there you go, it's not complete, read the readme.

148
General Discussion / Source code for Final fantasy one
« on: 2002-10-28 07:34:02 »
One of the projects I was working on  once upon a time was reversing the source code to the original final fantasy. I got side tracked and now, because most of my tools are dos/windows and I run linux, it's more difficult to finish. Would you guys like to complete what I was working on?

Here's some quick stats.

The rom uses 6502 Machine code.
FF1 is a 256K game broken up in to 16 banks of 16k. I have the banks seperated (0-15)
Bank 15 is the kernel, it never gets banked out and controls the whole game.

I have bank01.asm  bank02.chr,  bank03.chr, bank10.asm, bank 12.asm,  bank13.asm, and   bank14.asm done.

Other banks are well on ther way.

The is a program called "Final Fantasy Hackster" that edits all the object data in the game. You can use that to find what I'm missing data-wise. Everything else after that point is 6502 code. You can simply run that through a dissasembler and comment what it's doing.

I can offer help of those who want to finish it.

Any takers? It says right there in the upper left hand corner of the forums "A community dedicated to FF-related engineering" I thought I'd contibute.

I'll post a link to what I have in anyone is intrested.

-halkun

149
Hi, It's halkun, remember me?
I am currently under orders by my boss to start a home project so I can program better. While going though my stuff I have dicoverd that on a spending spree, I had purchased a Gameboy Adavnace dev kit...

Even cooler is that I have a 256 Meg flash cart for it too.

This is a picture of me holding said kit.



Now 256Meg is a lot for a cart. I was thinking, woudn't it be kid of cool to port FF7 to the GBA

Ok, stop laughing, hear me out.

The characters can be 3d scaled sprites, the backgrounds will be scaled down as well along with the movies.  Kind of like what they did with redient evil for the GBC in Japan

http://www.zadok.uklinux.net/necropolis/regbpictures.htm

(you will have a sprite for side view 1/4 view and top view) We can create the sprites by making 2d versions of the 3d monsters (screen caps) and we can animate most the characters.

Of course, it would require to re-constuct the fileds from scratch, but that shoudn't be too had as all the dramas are accessable via the debug room...

Or can someone else give me a cool FF7 idea to do.

*warning* I run linux. I made a posting about my dellemas with that.

Any input?

-halkun

150
Hi, haven't been here in a while

long store short: I have a new job as a relational database programmer. Had little time for anything else

Now the n00b question, ^_^

I need to extract the battle models (main characters, summons, and the more human looking enemies (rude and the gang, hojo, sephie,). The problem is that after extraction I neeed them in LWO  (lightwave) format. Is there an easy way to do this?  

I know this is kind of silly coming from the guy who found out the .a format and assisted in finding the polygon/texture data in FF8. Along with teaching some reversing techniques early on. I just need a quick thing as I need off things like seph's trenchcoat and hair. I need Tifa's fair too. And the cloak from the summon, possably the pot too.

any help would be.... helpful

-halkun

Pages: 1 2 3 4 5 [6] 7