Initial commit

This commit is contained in:
2026-02-02 04:50:13 +01:00
commit 5b11698731
22592 changed files with 7677434 additions and 0 deletions

View File

@@ -0,0 +1,115 @@
19
123
134
49
63
0
135
146
49
63
0
147
158
49
63
0
159
170
49
63
0
171
182
49
63
0
183
194
49
63
0
123
134
64
77
0
135
146
64
77
0
147
158
64
77
0
159
170
64
77
0
171
182
64
77
0
183
194
64
77
0
135
146
78
91
0
147
158
78
91
0
159
170
78
91
0
171
182
78
91
0
84
235
7
131
0
0
24
0
137
0
295
319
0
137
0

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,241 @@
239
0 0 0
5 5 5
8 8 8
11 11 11
14 14 14
17 17 17
20 20 20
24 24 24
28 28 28
32 32 32
36 36 36
40 40 40
45 45 45
50 50 50
56 56 56
63 63 63
0 0 63
16 0 63
31 0 63
47 0 63
63 0 63
63 0 47
63 0 31
63 0 16
63 0 0
63 16 0
63 31 0
63 47 0
63 63 0
47 63 0
31 63 0
16 63 0
0 63 0
0 63 16
0 63 31
0 63 47
0 63 63
0 47 63
0 31 63
0 16 63
31 31 63
39 31 63
47 31 63
55 31 63
63 31 63
63 31 55
63 31 47
63 31 39
63 31 31
63 39 31
63 47 31
63 55 31
63 63 31
55 63 31
47 63 31
39 63 31
31 63 31
31 63 39
31 63 47
31 63 55
31 63 63
31 55 63
31 47 63
31 39 63
45 45 63
49 45 63
54 45 63
58 45 63
63 45 63
63 45 58
63 45 54
63 45 49
63 45 45
63 49 45
63 54 45
63 58 45
63 63 45
58 63 45
54 63 45
49 63 45
45 63 45
45 63 49
45 63 54
45 63 58
45 63 63
45 58 63
45 54 63
45 49 63
0 0 28
7 0 28
14 0 28
21 0 28
28 0 28
28 0 21
28 0 14
28 0 7
28 0 0
28 7 0
28 14 0
28 21 0
28 28 0
21 28 0
14 28 0
7 28 0
0 28 0
0 28 7
0 28 14
0 28 21
0 28 28
0 21 28
0 14 28
0 7 28
14 14 28
17 14 28
21 14 28
24 14 28
28 14 28
28 14 24
28 14 21
28 14 17
28 14 14
28 17 14
28 21 14
28 24 14
28 28 14
24 28 14
21 28 14
17 28 14
14 28 14
14 28 17
14 28 21
14 28 24
14 28 28
14 24 28
14 21 28
14 17 28
20 20 28
22 20 28
24 20 28
26 20 28
28 20 28
28 20 26
28 20 24
28 20 22
28 20 20
28 22 20
28 24 20
28 26 20
28 28 20
26 28 20
24 28 20
22 28 20
20 28 20
20 28 22
20 28 24
20 28 26
20 28 28
20 26 28
20 24 28
20 22 28
0 0 16
4 0 16
8 0 16
50 50 50
0 0 0
28 25 20
15 13 11
55 34 21
57 38 20
58 38 21
24 21 17
49 10 10
26 23 19
53 38 17
22 19 16
20 18 14
20 20 20
56 38 19
34 29 9
36 36 36
40 40 40
63 39 24
51 38 16
50 37 15
54 38 18
34 31 25
47 37 14
43 36 11
46 37 13
44 36 12
49 37 14
49 10 10
30 27 22
19 7 3
34 29 9
40 10 8
27 9 5
42 36 11
34 34 34
40 37 30
44 10 9
23 8 4
23 21 17
30 27 24
31 9 6
36 10 7
35 31 28
45 43 39
38 35 28
31 28 23
43 43 43
32 28 26
37 34 27
32 29 24
34 31 25
35 32 26
18 16 13
43 41 37
40 36 30
44 40 33
42 38 32
19 17 14
38 35 29
36 33 27
36 32 29
21 19 16
34 31 26
46 42 35
29 26 21
42 39 35
23 21 17
29 26 21
31 28 23
33 29 24
27 24 20
25 22 18
40 38 34
37 34 31
39 36 32

View File

@@ -0,0 +1,161 @@
20
0
319
0
137
0
0
0
123
134
49
62
0
44160
0
135
146
49
62
0
44328
0
147
158
49
62
0
44496
0
159
170
49
62
0
44664
0
171
182
49
62
0
44832
0
183
194
49
62
0
45000
0
123
134
63
76
0
45168
0
135
146
63
76
0
45336
0
147
158
63
76
0
45504
0
159
170
63
76
0
45672
0
171
182
63
76
0
45840
0
183
194
63
76
0
46008
0
135
146
77
90
0
46176
0
147
158
77
90
0
46344
0
159
170
77
90
0
46512
0
171
182
77
90
0
46680
0
84
235
6
131
0
46848
0
84
235
39
131
0
464
1
84
235
93
131
0
14600
1

View File

@@ -0,0 +1,7 @@
1
0
319
0
199
0

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

View File

@@ -0,0 +1,241 @@
239
0 0 0
0 6 0
0 6 4
0 6 8
4 6 0
4 6 3
4 6 8
8 6 0
5 6 6
5 6 11
1 7 6
7 6 3
0 9 0
7 6 8
10 5 4
9 6 4
0 9 1
7 7 2
0 9 4
3 8 4
0 9 6
5 7 2
5 7 5
1 9 3
3 9 0
1 9 5
2 9 2
4 9 3
5 9 2
1 10 8
4 9 7
1 10 3
1 10 1
5 9 1
2 9 9
12 7 2
7 9 2
6 9 7
8 9 0
5 9 9
8 9 3
5 10 5
0 12 0
8 9 8
5 10 7
9 9 5
8 9 7
1 12 3
8 9 10
5 10 6
10 8 10
7 10 7
5 10 13
0 12 8
8 10 5
1 12 2
12 9 4
11 9 8
12 9 0
2 12 6
4 12 0
3 11 8
4 12 3
13 8 7
5 12 1
3 12 5
4 12 7
4 12 6
5 12 4
9 9 16
9 11 4
2 12 10
1 14 0
7 11 5
5 12 0
8 12 0
7 12 4
2 12 14
8 12 8
7 11 12
6 12 8
9 11 10
9 12 8
6 12 12
0 16 0
11 13 4
12 13 1
12 12 8
2 16 8
4 16 3
4 16 2
12 13 12
4 16 7
7 16 2
6 16 5
4 16 10
8 15 8
16 13 9
9 15 14
8 16 7
8 16 4
12 15 1
17 14 5
7 16 13
15 14 10
13 14 16
11 15 13
5 17 15
7 17 11
12 16 3
7 16 20
11 15 20
11 16 8
10 16 11
13 16 8
13 16 9
4 20 3
12 17 7
12 16 12
3 20 7
19 14 17
15 17 8
12 17 17
7 20 3
10 19 7
16 17 12
6 20 11
8 20 7
16 17 16
12 19 11
11 20 2
15 19 2
20 16 12
12 19 8
12 21 11
9 21 17
13 21 16
15 21 8
16 21 12
7 24 7
10 22 25
16 21 16
7 24 12
10 24 4
15 21 20
20 21 7
5 26 5
20 21 12
24 20 12
12 24 8
6 25 16
9 25 2
19 21 23
12 24 11
20 21 16
20 21 20
24 20 18
11 24 15
22 21 15
7 26 11
16 24 7
17 22 19
17 24 8
16 24 12
18 21 33
25 20 24
13 24 24
15 24 16
12 25 21
16 26 4
20 24 7
16 25 15
15 26 13
16 25 19
20 25 12
20 24 20
20 25 16
12 28 8
11 28 11
11 28 16
16 28 8
16 28 12
22 27 4
12 29 21
16 28 16
18 27 24
20 28 7
19 28 12
24 27 9
17 28 28
20 28 16
22 27 18
23 27 21
24 27 18
18 28 21
16 30 17
22 28 11
21 28 22
12 32 9
30 26 11
12 32 18
21 28 33
21 29 25
24 28 26
35 25 16
18 33 11
17 31 35
18 33 18
17 33 24
23 33 12
24 33 18
19 36 7
25 34 24
17 36 30
19 37 16
27 33 33
21 35 39
29 33 43
32 35 18
32 35 26
21 38 45
35 37 12
26 39 31
23 41 19
26 40 26
37 36 33
20 43 25
25 40 49
33 41 15
32 39 43
27 44 13
34 41 25
42 40 23
26 43 55
28 44 40
34 44 24
37 43 35
33 49 29
44 49 23

View File

@@ -0,0 +1,9 @@
1
0
319
0
199
0
0
0

View File

@@ -0,0 +1,7 @@
1
0
319
0
199
0

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@@ -0,0 +1,241 @@
239
0 0 0
10 10 10
10 10 10
11 11 11
11 11 11
12 12 12
13 13 13
13 13 13
13 13 13
13 13 13
14 14 14
14 14 14
14 14 14
15 15 15
15 15 15
15 15 15
15 15 15
16 16 16
16 16 16
16 16 16
16 16 16
17 17 17
17 17 17
17 17 17
17 17 17
18 18 18
18 18 18
18 18 18
18 18 18
19 19 19
19 19 19
19 19 19
19 19 19
20 20 20
20 20 20
20 20 20
20 20 20
21 21 21
21 21 21
21 21 21
21 21 21
22 22 22
22 22 22
22 22 22
22 22 22
23 23 23
23 23 23
23 23 23
23 23 23
24 24 24
24 24 24
24 24 24
24 24 24
25 25 25
25 25 25
25 25 25
25 25 25
26 26 26
26 26 26
26 26 26
26 26 26
27 27 27
27 27 27
27 27 27
27 27 27
28 28 28
28 28 28
28 28 28
28 28 28
29 29 29
29 29 29
29 29 29
29 29 29
30 30 30
30 30 30
30 30 30
30 30 30
31 31 31
31 31 31
31 31 31
31 31 31
32 32 32
32 32 32
32 32 32
32 32 32
33 33 33
33 33 33
33 33 33
33 33 33
34 34 34
34 34 34
34 34 34
34 34 34
35 35 35
35 35 35
35 35 35
35 35 35
36 36 36
36 36 36
36 36 36
36 36 36
37 37 37
37 37 37
37 37 37
37 37 37
38 38 38
38 38 38
38 38 38
38 38 38
39 39 39
39 39 39
39 39 39
39 39 39
40 40 40
40 40 40
40 40 40
40 40 40
41 41 41
41 41 41
41 41 41
41 41 41
42 42 42
42 42 42
42 42 42
42 42 42
43 43 43
43 43 43
43 43 43
43 43 43
44 44 44
44 44 44
44 44 44
44 44 44
45 45 45
45 45 45
45 45 45
45 45 45
46 46 46
46 46 46
46 46 46
46 46 46
47 47 47
47 47 47
47 47 47
47 47 47
48 48 48
48 48 48
48 48 48
48 48 48
49 49 49
49 49 49
49 49 49
49 49 49
50 50 50
50 50 50
50 50 50
50 50 50
51 51 51
51 51 51
51 51 51
51 51 51
52 52 52
52 52 52
52 52 52
52 52 52
53 53 53
53 53 53
53 53 53
53 53 53
54 54 54
54 54 54
54 54 54
54 54 54
55 55 55
55 55 55
55 55 55
55 55 55
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

View File

@@ -0,0 +1,9 @@
1
0
319
0
199
0
0
0

View File

@@ -0,0 +1,87 @@
This tool can be used to generate Mission Supernova 2 datafiles containing images
and might be able to do the same even for Mission Supernova 1.
The tool is not foolproof and a lot of checks are missing (since it's just a tool),
so it could easily generate nonsense without any warning if for example command line
arguments aren't as expected.
To use this tool create a folder named as the number of the datafile you want to
create, it should be 3 characters long, add required numbers of zeros to the beginning
of the name (015 for ms2_data.015).
Inside this folder should be:
--clickfield_info, this contains info about clickfields. On the first row should be a
number saying how many clickfields there are and on the following rows are
descripitons of individual clickfields in this order (x1, x2, y1, y2, next),
for example:
2
123
134
49
63
0
135
146
49
63
0
This would be the contents of a file describing 2 clickfields.
--section_info similar to the clickfield_info. Contains info about sections. On the
first row should be a number saying how many sections there are and on the following
rows are descripitons of individual sections in this order
(x1, x2, y1, y2, next, addressLow, addressHigh), for example:
2
0
319
0
137
0
0
0
123
134
49
62
0
44160
0
This would be the contents of a file describing 2 sections
--palette Contains info about palette. On the first row should be a number saying
how many colors there are and on the following rows are the individual RGB values of
colors (don't forget, that the engine shifts each color by 2 places to the left
(brightening the image), so the palette basically has to be shifted by 2 to the right
to get the right colors). For example:
3
50 50 50
0 0 0
28 25 20
This would be the contents of a file containing palette with 3 colors.
--image#.bmp For each section, there has to be image#.bmp, replace the '#' by the
number of section this image belongs to. The image has to use indexes to the palette
for storing the color of each pixel (Image -> Mode -> Indexed... in gimp).
Running the tool
The tool needs 3 comand line arguments when running it:
-- Prefix of the file to be created (use "ms2_data" to create "ms2_data.###")
-- Number of the file to be created and also the number of a folder to read all the
files from (use "15" to create prefix.015)
-- Number of bytes to skip in each .bmp file. At the beginning of each .bmp file is
a header with information about the file and after that is stored the palette. This
tool doesn't need these, so this number says how many bytes to skip to get to the pixel
data. For example: use 1146 to generate ms2_data.015 from the files included.
Be aware, this tool does only basic checks of comandline arguments and no checks of
the input files (only their presence).

View File

@@ -0,0 +1,202 @@
#include <fstream>
#include <iostream>
#include <sstream>
#include <cstring>
#include <iomanip>
#include <cstdlib>
std::string *filenumber;
int writePalette(std::ofstream &output) {
std::string filename = *filenumber + "/palette";
std::ifstream palette(filename.c_str());
if (!palette.is_open()) {
std::cerr << "Couldn't open palette file" << std::endl;
return 1;
}
int input;
do {
palette >> input;
if (palette.eof())
break;
output << (char) input;
} while(true);
palette.close();
return 0;
}
int writeSections(std::ofstream &output) {
std::string filename = *filenumber + "/section_info";
std::ifstream sectionInfo(filename.c_str());
if (!sectionInfo.is_open()) {
std::cerr << "Couldn't open section_info file" << std::endl;
return 0;
}
int numSections;
sectionInfo >> numSections;
output << (char) numSections;
int input;
char *input_byte = (char *) &input;
for(int i = 0; i < numSections; i++) {
//x1
sectionInfo >> input;
output << (char)input_byte[0];
output << (char)input_byte[1];
//x2
sectionInfo >> input;
output << (char)input_byte[0];
output << (char)input_byte[1];
//y1
sectionInfo >> input;
output << (char)input;
//y2
sectionInfo >> input;
output << (char)input;
//next
sectionInfo >> input;
output << (char)input;
//addressLow
sectionInfo >> input;
output << (char)input_byte[0];
output << (char)input_byte[1];
//addressHigh
sectionInfo >> input;
output << (char)input;
}
sectionInfo.close();
return numSections;
}
int writeClickFields(std::ofstream &output) {
std::string filename = *filenumber + "/clickfield_info";
std::ifstream clickFieldInfo(filename.c_str());
if (!clickFieldInfo.is_open()) {
std::cerr << "Couldn't open clickfield_info file" << std::endl;
return 1;
}
int numClickFields;
clickFieldInfo >> numClickFields;
output << (char) numClickFields;
int input;
char *input_byte = (char *) &input;
for(int i = 0; i < numClickFields; i++) {
//x1
clickFieldInfo >> input;
output << (char)input_byte[0];
output << (char)input_byte[1];
//x2
clickFieldInfo >> input;
output << (char)input_byte[0];
output << (char)input_byte[1];
//y1
clickFieldInfo >> input;
output << (char)input;
//y2
clickFieldInfo >> input;
output << (char)input;
//next
clickFieldInfo >> input;
output << (char)input;
}
clickFieldInfo.close();
return 0;
}
int writePixelData(std::ofstream &output, int imageNum, int skip) {
std::ostringstream fileName;
fileName << *filenumber << "/image" << imageNum << ".bmp";
std::ifstream image(fileName.str().c_str(), std::ios::binary);
if (!image.is_open()) {
std::cerr << "Couldn't open " << fileName.str() << " file" << std::endl;
return 0;
}
image.seekg(0, image.end);
int length = image.tellg();
length -= skip;
image.seekg(skip, image.beg);
char *buf = new char[length];
image.read(buf, length);
output.write(buf, length);
delete[] buf;
return length;
}
void printHelp() {
std::cout << "create_image output-prefix file-number bytes-skip" << std::endl << std::endl;
std::cout << " output-prefix: String the created file should begin with" << std::endl;
std::cout << " file-number: Number of the created file and also name of source folder" << std::endl;
std::cout << " bytes-skip: How many bytes to skip in each .bmp file" << std::endl;
std::cout << std::endl << "EXAMPLE:" << std::endl
<< "create_image ms2_data 15 1146" << std::endl
<< " creates ms2_data.015 assuming there are the right files inside 015 folder" << std::endl;
}
int main(int argc, char *argv[]) {
if (argc == 2 && !strcmp(argv[1], "--help")) {
printHelp();
return 0;
}
if (argc != 4 ) {
printHelp();
return 1;
}
std::ostringstream oss;
oss << std::setfill('0') << std::setw(3) << argv[2];
*filenumber = oss.str();
char *ptr;
int bytesSkip = strtol(argv[3], &ptr, 10);
std::string oFileName = argv[1];
oFileName += "." + *filenumber;
std::ofstream output(oFileName.c_str(), std::ios::binary);
if (!output.is_open()) {
std::cerr << "Couldn't open output file" << std::endl;
return 1;
}
// size
// just a place holder, will be filled later
output << (char) 0x40;
output << (char) 0x70;
output << (char) 0x01;
output << (char) 0x00;
if (writePalette(output))
return 1;
int numImages = writeSections(output);
if (numImages == 0)
return 1;
if (writeClickFields(output))
return 1;
// we don't compress the images, so set to 0
output << (char) 0; //numRepeat
output << (char) 0; //numZw
int totalLength = 0;
int oldLength = 0;
for (int i = 0; i < numImages; i++) {
totalLength += writePixelData(output, i, bytesSkip);
if (oldLength == totalLength) {
std::cerr << "Error while reading the image number: " << i << std::endl;
return 1;
}
oldLength = totalLength;
}
//reversing the size computation inside the engine
totalLength += 15;
totalLength /= 16;
totalLength -= 0x70;
int i = (totalLength & 0xf000) >> 12;
int j = totalLength << 4;
char *i_p = (char *) &i;
char *j_p = (char *) &j;
//writing the size
output.seekp(0);
output << j_p[0];
output << j_p[1];
output << i_p[0];
output << i_p[1];
output.close();
return 0;
}

View File

@@ -0,0 +1,3 @@
#!/bin/sh
./create_image ms2_data 15 1146

View File

@@ -0,0 +1,3 @@
#!/bin/sh
./create_image ms2_data 27 1146

View File

@@ -0,0 +1,3 @@
#!/bin/sh
./create_image ms2_data 28 829

View File

@@ -0,0 +1,10 @@
MODULE := devtools/create_supernova/create_image
MODULE_OBJS := create_image.o
# Set the name of the executable
TOOL_EXECUTABLE := create_image
# Include common rules
include $(srcdir)/rules.mk