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 - halkun

Pages: [1] 2 3 4
1
The FF7 opcode list can be found here

I have a hard time believing they would recode the whole thing when there was a perfectly good parser to start with.

2
The samples should be in APCM format. That's what the SPU took.

3
Yup, The PSX video memory is split into different texture zones, (Texture caches), you select which cache to "view" by using a GPU command.

4
Alrighty, I'd better get the signed fixed-point info in the wiki. I'll have some reading to do here first. What's the significance of the number 4.12 with respect to the 3D coordinates, guys?

The PSX had a 3D coprocessor called the Geometry Transformation Engine, or GTE. This device did various 3D maths (Dot products, matrix transformations, vector math, etc, etc) much faster than the normal CPU. The GTE used fixed point 16-bit numbers. the first 4 bits are the whole number part and the second 12 bits were the decimal part. (4.12) This means that when you loaded the GTE with number to preform math on, it had to be in 4.12 format.

Oops here a little vocabulary.

Fixed-point is a kind of format that computers use to express decimals. Computer, by themselves, are quite terrible at decimal math, so this is a way for them to "understand" what a decimal is. "Fixed point" means that the decimal does not move, and the whole/factional parts are "stuck" at a particular accuracy. With computers, fixed point math is really quick, but is prone to rounding errors. (That's why you see "warped" textures on the PSX sometimes... That and there is an actual bug in the GTE that Sony never fixed. On the other hand, if Sony fixed it, it would of screwed up all the games before it was fixed). The opposite of fixed point is "floating point"

Floating point is a number where the decimal point can float all around the number so the system is not limited to a particular whole/factional split all the time. The problem is floating point is *MUCH* slower and *much* more complex and expensive to implement in a computer. The PSX can not do hardware-based floating point math, and is stuck using a 4.12 format when it needs to do anything with a decimal quickly.

Does that make sense?

 

5
Perhaps someone could make a intermediate seperate version of the python script
that does remove the black parts.For now this is OK.

The problem is that "the black parts" are part of the model. In a PS1, the black zones are understood as being transparent, and in blender, it doesn't understand that UV maps can have transparent data. You can't "cut out" the black parts. All blender knows is "Make a triangle here" and "cover with this texture". It can't "look" at a texture and figure out what needs to be "cut". Blender can't "cut" things. It only make or remove triangles that are already there.

So, you can't go back, and edit those portions into code "00", like back on page 12?
By the way- very well done! Reading this whole thread, was like trying to make sense of hieroglyphs...so to me, it was like magic! :?

Already been done.
 "00" == black color in blender.
 "00" == transparent color in a PS1.
Blender does not understand transparent UV maps. 

6
Perhaps someone could make a intermediate seperate version of the python script
that does remove the black parts.For now this is OK.

The problem is that "the black parts" are part of the model. In a PS1, the black zones are understood as being transparent, and in blender, it doesn't understand that UV maps can have transparent data. You can't "cut out" the black parts. All blender knows is "Make a triangle here" and "cover with this texture". It can't "look" at a texture and figure out what needs to be "cut". Blender can't "cut" things. It only make or remove triangles that are already there.

7
The Transparency thing in Blender is a known issue. The 3d modeler does not understand "transparent" unless it is a transparent material. (Not a UV map). Blender was designed as a 3d movie renderer that used materials to describe surfaces. UV mapping is not "complete" by game standards.

8
Chrono Trigger Modification / Re: Translate Japanese ROM to English?
« on: April 24, 2008, 11:52:53 pm »
The japanese text system and the US system are different. You will probably need another tool.

The Rom, (for those who don't know) is used as data for the game. In the US version also has some "patches" that are located elsewhere on the disk. The rom was supposed to be a a freebe from square, but They couldn't get a release for the US rom for the US PSX CC release.

9
The AKAO blocks are not part of the field script and are actually subsections of the field file itself. The Akao field command calls the AKAO block for music/sound playback.

10
No, it's just a sequence of hex codes. In the example dump above, the hex codes representing the commnd have been changed to names, and the number of arguments written down.

The only thing that is text in the fieldscript is the entity name. (Dic, Yufi, cloud) and these are in a seperite lookup table. 

11
Here is an old fieldscript dump from ff7's debug room (It's gotten much better)

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



Here's how it works. Each entity has a a few scripts. Depending on how you interact with the script determines which script is ran.

The "Main script" is the one at the top (Dic). That script sets up the room and gets all the other entities going.

Code: [Select]
#****** Section n°0 (dic) Script n° 0:setup ******
000 : PRTYP ( 00 )     #Adds character 0 (Cloud) to the party.
002 : RET                  #return

#****** Section n°0 (dic) Script n° 0:loop ******
003 : RET                  #return every frame (do nothing)
                                                                               
#****** Section n°0 (dic) Script n° 1:"O" button******
000 : RET                #if "O" button is pressed... return (do nothing)
 


It gets more complex when you talk to people.

Code: [Select]
#****** Section n°4 (yufi) Script n° 0:setup ******
000 : CHAR ( 03 )                                                    #This entity is char #3
002 : XYZI ( 00, 00, B6, FF, 7E, FF, 00, 00, 64, 00 )     #This is the initial X,Y, and Z location of the character
00D : DIR ( 00, 60 )                                                 #This is the direction the character is facing
010 : SLIDR ( 00, 01 )                                              #Set solid range (Bounding box) of this character to 1
013 : RET                                                                #return

#****** Section n°4 (yufi) Script n° 0:loop ******
014 : RET          #every loop return (do nothing)
                                                                               
#****** Section n°4 (yufi) Script n° 1:"O" button ******
000 : window( id=01, X=0000, Y=0000, W=008A, H=00A9 )  #set up a window
00A : ASK ( 05, 01, 00, 00, 09, 00 )  #ask a question with text found in bank 9


See how it works?

12
IN FF7, rooms were loaded using a door lookup table in the header, and the JUMPMAP() opcode. Rooms were referenced by number.

13
if you have the files uncompressed, there is an lzs uncompressor in the qhimm forums somewhere.

14
Chrono Cross Modification / Re: Event Code -- what makes it tick?
« on: April 18, 2008, 04:21:50 am »
Yes, you will find the fieldscript uncompressed in memory. The problem is you are only going to have the tokenized opcodes and not command words.

For Q-gears, I wrote a script dumper. What makes it cool is I commented the sheer hell out of it in plain English so anyone can follow along.

http://q-gears.svn.sourceforge.net/viewvc/q-gears/trunk/src/utils/scriptdump/

Here is the source from the above link

scriptdump.c
script.c
script.h
The makefile
 

15
Chrono Cross Modification / Re: Event Code -- what makes it tick?
« on: April 18, 2008, 02:15:11 am »
Looking at the release dates, it appears that CC may use a slightly modded version of the FF8 fieldscript system. Because this hasn't been reversed very far, I can gave you some tips over what to look for.

1) The fieldscript system starts with a "Base script" that runs every loop. Looking at Square's code, to appears this is actually called the "Directer script" and commonly has an entity name of "Dic" In FF7 and FF8, the entities in the fieldscript actually are labeled in text and not stripped. Look for this in the uncompressed fieldscript data.

2) Find the debug room if one exists and start there. In the case of FF7 and FF8, the debug room is an overhead view with the camera located at 0,0,0 and looking down at 0,0,0. There were minimal variables set. I don't think CC has one though. In this case look for the first scene.

3) Remember that all field files are self-contained. They do not pull data from other "rooms". Each field file is likely split up into sections. (background, palette, walkmesh, entity models, script) if you can find the "top" of one of these data fields and then walk backwards to a referencing header, you can see where a field file "begins" and "ends". They are also most likely compressed with some kind of lzs compression.

Pages: [1] 2 3 4