diff 06/std.xhtml @ 1:b1bec4b5ccf3

Add anm and pbg3 file formats, and improve the std one.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 02 Aug 2011 14:18:01 +0200
parents f82309a9465e
children 0a7e6e3d5327
line wrap: on
line diff
--- a/06/std.xhtml
+++ b/06/std.xhtml
@@ -1,34 +1,135 @@
 <?xml version="1.0" encoding="utf-8"?>
+<?xml-stylesheet type="text/css" href="../style.css"?>
 <!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 	<head>
 		<title>STD format</title>
 	</head>
 	<body>
 		<h1>STD format</h1>
-		<p>All integers are little endian, all number are hex.</p>
 
 		<h2>Header</h2>
-		<pre>
-0 - 2 - 
-2 - 2 - 
-4 - 4 - Size of something
-8 - 2 - 
-a - 6 - Always zero
-10 - 80 - Name of the stage
-90 - 80 - Name of the first song
-110 - 80 - Name of the second song
-190 - 80 - A string of only a single whitespace
-210 - 80 - A string of only a single whitespace
-290 - 80 - path to the first song (as midi)
-310 - 80 - path to the second song (as midi)
-390 - 80 - A string of only a single whitespace
-410 - 80 - A string of only a single whitespace
-490 - ... - The real data</pre>
+<pre>
+typedef struct {
+    uint16_t nb_objects; //TODO
+    uint16_t nb_faces; //TODO
+    uint32_t faces_offset; //TODO
+    uint32_t messages_offset; //TODO
+    uint32_t unknown; //TODO: always 0
+    char stage_name[128]; // Name of the stage in SHIFT_JIS
+    char song1_name[128]; // Name of the first song in SHIFT_JIS
+    char song2_name[128]; // Name of the second song in SHIFT_JIS
+    char song3_name[128]; // ? A single blank if unused
+    char song4_name[128]; // ? A single blank if unused
+    char song1_path[128];
+    char song2_path[128];
+    char song3_path[128]; // ? A single blank if unused
+    char song4_path[128]; // ? A single blank if unused
+} thstd_header_t;
+</pre>
+
+		<h2>First section</h2>
+		<p>This section is responsible for creating objects from the stgxbg.anm file.</p>
+<pre>
+struct object_header {
+    uint16_t id; // Always equal to the object's number. Not used by the game.
+    uint16_t unknown1; //TODO
+    float unknown2; //TODO
+    uint32_t unknown3; //TODO
+    float unknown4; //TODO
+    float unknown5; //TODO
+    float unknown6; //TODO
+    float unknown7; //TODO
+};
+
+typedef struct {
+    uint16_t unknown; // 0 means a quad, 0xffff means the end.
+    uint16_t size; // 0x1c for a quad, 4 for the end marker.
+    uint16_t script_index; // Index of a script entry in the corresponding anm file
+    uint16_t _padding; // Unused, padding
+    float x; // x coordinate of the bottom-left corner of the quad
+    float y; // y coordinate of the bottom-left corner of the quad
+    float z; // z coordinate of the bottom-left corner of the quad
+    float width; // If 0, defaults to 32.0f
+    float height; // If 0, defaults to 32.0f
+} thstd_object_t;
+
+struct object {
+    struct object_header header;
+    struct object_quad quads[]; // Stop when quads.unknown1 == 0x0004ff
+};
+</pre>
+
+		<p>The following description is symbolic.</p>
+<pre>
+struct section1 {
+    uint32_t offsets[]; // header.nb_objects offsets towards objects
+};*/
+</pre>
+
 
-		<h2>Data</h2>
-		<pre>
-0 - ... - ...
+		<h2>Second section</h2>
+		<p>This section is responsible for placing objects from section 1 in the space.</p>
+<pre>
+typedef struct {
+    uint16_t object_id; // must not exceed header.nb_objects
+    uint16_t unknown1; // Always 256, doesn't seem to change anything
+    float x;
+    float y;
+    float z;
+} thstd_face_t;
+// ends with 16 \xFF
+</pre>
+
+
+
+		<h2>Third Section</h2>
+		<p>This section is responsible for camera movement, color effects, and such things.</p>
+<pre>
+typedef struct {
+    uint32_t frame_num;
+    uint16_t type; // 1=colormsg
+    uint16_t unknown; //TODO: Probably the size of the message, always 0x0c, ignored by the game
+    uint32_t arg1;
+    float arg2;
+    float arg3;
+} thstd_message_t;
+
+typedef struct {
+    uint8_t b;
+    uint8_t g;
+    uint8_t r;
+    uint8_t unknown1; // Seems useless. padding?
+} color_t;
+
+typedef struct {
+    color_t color;
+    float opacity_gradient_start; //TODO
+    float opacity_gradient_stop; //TODO
+} thstd_colormsg_t;
+
+typedef struct {
+    float x;
+    float y;
+    float z;
+} thstd_cameramsg_t;
+// ends with 20 \xFF
+</pre>
+
+
+
+
+
+
+
+<pre>
+typedef struct {
+    thstd_header_t header;
+    uint32_t* offsets;
+    list_t objects;
+    list_t faces;
+    list_t messages;
+} PACK_ATTRIBUTE thstd_t;
 </pre>
 	</body>
 </html>