2 * Copyright (C) 2023 Anton Blad
3 * Copyright (C) 2023 Fredrik Kuivinen
4 * Copyright (C) 2023 Jakob Rosén
6 * This file is licensed under GPL v2.
9 // Just a simple tool used for testing the TRUT64 GUI
15 int main(int argc
, char** argv
)
17 printf("Contap. Concatenates two TAP files and saves the result.\n");
20 printf("Usage: contap <source1> <source2> <destination> [<padding>]\n");
24 char* source1_name
=argv
[1];
25 char* source2_name
=argv
[2];
26 char* destination_name
=argv
[3];
30 sscanf(argv
[4], "%d", &padding
);
32 printf("Padding %d seconds between tap files\n", padding
);
34 struct tape_data
* tap1
;
35 struct tape_data
* tap2
;
36 tap1
=load_tap_file(source1_name
);
37 tap2
=load_tap_file(source2_name
);
39 struct tape_data
* result
;
40 result
=malloc(sizeof(struct tape_data
));
41 result
->length
=tap1
->length
+tap2
->length
+padding
;
42 result
->data
=(int*)malloc(result
->length
*sizeof(int));
45 for (i
=0; i
<tap1
->length
; i
++)
47 result
->data
[pos
++]=tap1
->data
[i
];
49 for (i
=0; i
<padding
; i
++)
51 result
->data
[pos
++]=985248;
53 for (i
=0; i
<tap2
->length
; i
++)
55 result
->data
[pos
++]=tap2
->data
[i
];
62 f
= fopen(destination_name
, "rb");
64 printf("File '%s' already exist! Please delete it first.\n", destination_name
);
68 f
= fopen(destination_name
, "wb");
71 printf("All done!\n");