[Scummvm-cvs-logs] SF.net SVN: scummvm: [25907] tools/trunk
kirben at users.sourceforge.net
kirben at users.sourceforge.net
Wed Feb 28 14:36:17 CET 2007
Revision: 25907
http://scummvm.svn.sourceforge.net/scummvm/?rev=25907&view=rev
Author: kirben
Date: 2007-02-28 05:36:16 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
Minor cleanup.
Modified Paths:
--------------
tools/trunk/extract_mm_apple.c
tools/trunk/extract_mm_c64.c
tools/trunk/extract_zak_c64.c
Modified: tools/trunk/extract_mm_apple.c
===================================================================
--- tools/trunk/extract_mm_apple.c 2007-02-28 12:54:59 UTC (rev 25906)
+++ tools/trunk/extract_mm_apple.c 2007-02-28 13:36:16 UTC (rev 25907)
@@ -31,12 +31,10 @@
#define vsnprintf _vsnprintf
#endif
-void writeByteAlt(FILE *fp, uint8 b)
-{
+void writeByteAlt(FILE *fp, uint8 b) {
writeByte(fp, (uint8)(b ^ 0xFF));
}
-void writeUint16LEAlt(FILE *fp, uint16 value)
-{
+void writeUint16LEAlt(FILE *fp, uint16 value) {
writeUint16LE(fp, (uint16)(value ^ 0xFFFF));
}
#define writeByte writeByteAlt
@@ -55,15 +53,13 @@
unsigned char room_disks[55], room_tracks[55], room_sectors[55];
-int main (int argc, char **argv)
-{
+int main (int argc, char **argv) {
FILE *input1, *input2, *output;
char fname[256];
int i, j;
unsigned short signature;
- if (argc < 3)
- {
+ if (argc < 3) {
printf("Syntax: %s <disk1.dsk> <disk2.dsk>\n",argv[0]);
return 1;
}
@@ -106,22 +102,26 @@
writeByte(output, room_tracks[i]);
}
- /* TODO: Double check values, as index is slightly longer */
-
+ /* copy costume offsets */
for (i = 0; i < 25; i++)
writeByte(output, readByte(input1));
for (i = 0; i < 25; i++)
writeUint16LE(output, readUint16LE(input1));
+ /* copy script offsets */
for (i = 0; i < 160; i++)
writeByte(output, readByte(input1));
for (i = 0; i < 160; i++)
writeUint16LE(output, readUint16LE(input1));
+ /* copy sound offsets */
for (i = 0; i < 70; i++)
writeByte(output, readByte(input1));
for (i = 0; i < 70; i++)
writeUint16LE(output, readUint16LE(input1));
+
+ /* NOTE: Extra 92 bytes of unknown data */
+
fclose(output);
for (i = 0; i < 55; i++) {
Modified: tools/trunk/extract_mm_c64.c
===================================================================
--- tools/trunk/extract_mm_c64.c 2007-02-28 12:54:59 UTC (rev 25906)
+++ tools/trunk/extract_mm_c64.c 2007-02-28 13:36:16 UTC (rev 25907)
@@ -31,12 +31,10 @@
#define vsnprintf _vsnprintf
#endif
-void writeByteAlt(FILE *fp, uint8 b)
-{
+void writeByteAlt(FILE *fp, uint8 b) {
writeByte(fp, (uint8)(b ^ 0xFF));
}
-void writeUint16LEAlt(FILE *fp, uint16 value)
-{
+void writeUint16LEAlt(FILE *fp, uint16 value) {
writeUint16LE(fp, (uint16)(value ^ 0xFFFF));
}
#define writeByte writeByteAlt
@@ -55,15 +53,13 @@
unsigned char room_disks[55], room_tracks[55], room_sectors[55];
-int main (int argc, char **argv)
-{
+int main (int argc, char **argv) {
FILE *input1, *input2, *output;
char fname[256];
int i, j;
unsigned short signature;
- if (argc < 3)
- {
+ if (argc < 3) {
printf("Syntax: %s <disk1.d64> <disk2.d64>\n",argv[0]);
return 1;
}
@@ -93,46 +89,46 @@
writeByte(output, readByte(input1));
/* copy room offsets */
- for (i = 0; i < 55; i++)
- {
+ for (i = 0; i < 55; i++) {
room_disks[i] = readByte(input1);
writeByte(output, room_disks[i]);
}
- for (i = 0; i < 55; i++)
- {
+ for (i = 0; i < 55; i++) {
room_sectors[i] = readByte(input1);
writeByte(output, room_sectors[i]);
room_tracks[i] = readByte(input1);
writeByte(output, room_tracks[i]);
}
+
+ /* copy costume offsets */
for (i = 0; i < 25; i++)
writeByte(output, readByte(input1));
for (i = 0; i < 25; i++)
writeUint16LE(output, readUint16LE(input1));
+ /* copy script offsets */
for (i = 0; i < 160; i++)
writeByte(output, readByte(input1));
for (i = 0; i < 160; i++)
writeUint16LE(output, readUint16LE(input1));
+ /* copy sound offsets */
for (i = 0; i < 70; i++)
writeByte(output, readByte(input1));
for (i = 0; i < 70; i++)
writeUint16LE(output, readUint16LE(input1));
+
fclose(output);
- for (i = 0; i < 55; i++)
- {
- const int SectorOffset[36] =
- {
+ for (i = 0; i < 55; i++) {
+ const int SectorOffset[36] = {
0,
0, 21, 42, 63, 84, 105, 126, 147, 168, 189, 210, 231, 252, 273, 294, 315, 336,
357, 376, 395, 414, 433, 452, 471,
490, 508, 526, 544, 562, 580,
598, 615, 632, 649, 666
};
- const int ResourcesPerFile[55] =
- {
+ const int ResourcesPerFile[55] = {
0, 11, 1, 3, 9, 12, 1, 13, 10, 6,
4, 1, 7, 1, 1, 2, 7, 8, 19, 9,
6, 9, 2, 6, 8, 4, 16, 8, 3, 3,
@@ -153,8 +149,7 @@
error("Unable to create %s!",fname);
notice("Creating %s...",fname);
fseek(input, (SectorOffset[room_tracks[i]] + room_sectors[i]) * 256, SEEK_SET);
- for (j = 0; j < ResourcesPerFile[i]; j++)
- {
+ for (j = 0; j < ResourcesPerFile[i]; j++) {
unsigned short len = readUint16LE(input);
writeUint16LE(output, len);
for (len -= 2; len > 0; len--)
Modified: tools/trunk/extract_zak_c64.c
===================================================================
--- tools/trunk/extract_zak_c64.c 2007-02-28 12:54:59 UTC (rev 25906)
+++ tools/trunk/extract_zak_c64.c 2007-02-28 13:36:16 UTC (rev 25907)
@@ -31,12 +31,10 @@
#define vsnprintf _vsnprintf
#endif
-void writeByteAlt(FILE *fp, uint8 b)
-{
+void writeByteAlt(FILE *fp, uint8 b) {
writeByte(fp, (uint8)(b ^ 0xFF));
}
-void writeUint16LEAlt(FILE *fp, uint16 value)
-{
+void writeUint16LEAlt(FILE *fp, uint16 value) {
writeUint16LE(fp, (uint16)(value ^ 0xFFFF));
}
#define writeByte writeByteAlt
@@ -55,15 +53,13 @@
unsigned char room_disks[59], room_tracks[59], room_sectors[59];
-int main (int argc, char **argv)
-{
+int main (int argc, char **argv) {
FILE *input1, *input2, *output;
char fname[256];
int i, j;
unsigned short signature;
- if (argc < 3)
- {
+ if (argc < 3) {
printf("Syntax: %s <disk1.d64> <disk2.d64>\n",argv[0]);
return 1;
}
@@ -92,47 +88,45 @@
writeByte(output, readByte(input1));
/* copy room offsets */
- for (i = 0; i < 59; i++)
- {
+ for (i = 0; i < 59; i++) {
room_disks[i] = readByte(input1);
writeByte(output, room_disks[i]);
}
- for (i = 0; i < 59; i++)
- {
+ for (i = 0; i < 59; i++) {
room_sectors[i] = readByte(input1);
room_tracks[i] = readByte(input1);
writeByte(output, room_sectors[i]);
writeByte(output, room_tracks[i]);
}
+ /* copy costume offsets */
for (i = 0; i < 38; i++)
writeByte(output, readByte(input1));
for (i = 0; i < 38; i++)
writeUint16LE(output, readUint16LE(input1));
+ /* copy script offsets */
for (i = 0; i < 155; i++)
writeByte(output, readByte(input1));
for (i = 0; i < 155; i++)
writeUint16LE(output, readUint16LE(input1));
+ /* copy sound offsets */
for (i = 0; i < 127; i++)
writeByte(output, readByte(input1));
for (i = 0; i < 127; i++)
writeUint16LE(output, readUint16LE(input1));
fclose(output);
- for (i = 0; i < 59; i++)
- {
- const int SectorOffset[36] =
- {
+ for (i = 0; i < 59; i++) {
+ const int SectorOffset[36] = {
0,
0, 21, 42, 63, 84, 105, 126, 147, 168, 189, 210, 231, 252, 273, 294, 315, 336,
357, 376, 395, 414, 433, 452, 471,
490, 508, 526, 544, 562, 580,
598, 615, 632, 649, 666
};
- const int ResourcesPerFile[59] =
- {
+ const int ResourcesPerFile[59] = {
0, 29, 12, 14, 13, 4, 4, 10, 7, 4,
14, 19, 5, 4, 7, 6, 11, 9, 4, 4,
1, 3, 3, 5, 1, 9, 4, 10, 13, 6,
@@ -153,8 +147,7 @@
error("Unable to create %s!",fname);
notice("Creating %s...",fname);
fseek(input, (SectorOffset[room_tracks[i]] + room_sectors[i]) * 256, SEEK_SET);
- for (j = 0; j < ResourcesPerFile[i]; j++)
- {
+ for (j = 0; j < ResourcesPerFile[i]; j++) {
unsigned short len = readUint16LE(input);
writeUint16LE(output, len);
for (len -= 2; len > 0; len--)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list