1 // ToACME - converts other source codes to ACME format.
2 // Copyright (C) 1999-2019 Marco Baye
3 // Have a look at "main.c" for further info
4 //
5 // Version
6 
7 #define RELEASE_NUMBER	"0.15"		// change before release (FIXME)
8 #define CHANGE_DATE	"25 Apr"		// change before release
9 #define CHANGE_YEAR	"2019"		// change before release
10 #define HOME_PAGE	"http://sourceforge.net/projects/acme-crossass/"
11 //			"http://home.pages.de/~mac_bacon/smorbrod/acme/"
12 #define FILE_TAG	";ACME 0.96.4"	// check before release
13 
14 #include <stdio.h>
15 #include <string.h>
16 #include "io.h"
17 #include "platform.h"
18 
19 
20 // variables
21 void	(*client_main)(void)	= NULL;
22 
23 
24 // functions
25 
26 // show version info and usage
version_show_info(const char program_name[])27 void version_show_info(const char program_name[]) {
28 	printf(
29 "\n"
30 "ToACME - converts other assemblers' source codes to ACME format.\n"
31 "Release " RELEASE_NUMBER " (" CHANGE_DATE " " CHANGE_YEAR "), Copyright (C) 1999-" CHANGE_YEAR " Marco Baye.\n"
32 PLATFORM_VERSION "\n"
33 "Thanks to Stefan Hübner for fixing the AssBlaster macro conversion code.\n"
34 "Thanks to Andreas Paul for helping with the Giga-Assembler mode.\n"
35 "Thanks to Arndt Dettke for helping with the Hypra-Assembler mode.\n"
36 "Thanks to Hoogo for helping with the Professional Assembler mode.\n"
37 "\n"
38 "The newest version can be found at the ACME homepage:\n"
39 HOME_PAGE "\n"
40 "\n"
41 "ToACME comes with ABSOLUTELY NO WARRANTY; for details read the help file.\n"
42 "This is free software, and you are welcome to redistribute it under\n"
43 "certain conditions; as outlined in the GNU General Public License.\n"
44 "\n"
45 "Syntax: %s  FORMAT_ID  INPUT_FILE  OUTPUT_FILE\n"
46 "\n"
47 "Format ID:  source file format             quality\n"
48 "--------------------------------------------------\n"
49 "object      object code files                 poor\n"
50 "hypra       C64: Hypra-Assembler                ok\n"
51 "giga        C64: Giga-Assembler                 ok\n"
52 "vis         C64: VisAss                   untested\n"
53 "ab3         C64: AssBlaster 3.0 to 3.2        good\n"
54 "f8ab        C64: Flash8-AssBlaster              ok\n"
55 "prof        C64: Professional Assembler       poor (work in progress)\n"
56 "\n"
57 	, program_name);
58 }
59 
60 
61 extern void visass_main(void);
62 extern void ab3_main(void);
63 extern void f8ab_main(void);
64 extern void giga_main(void);
65 extern void hypra_main(void);
66 extern void obj_main(void);
67 extern void prof_main(void);
68 
69 
70 // check id string. returns whether illegal.
version_parse_id(const char id[])71 int version_parse_id(const char id[])
72 {
73 	if (strcmp(id, "vis") == 0)
74 		client_main = visass_main;
75 	else if (strcmp(id, "ab3") == 0)
76 		client_main = ab3_main;
77 	else if (strcmp(id, "f8ab") == 0)
78 		client_main = f8ab_main;
79 	else if (strcmp(id, "giga") == 0)
80 		client_main = giga_main;
81 	else if (strcmp(id, "hypra") == 0)
82 		client_main = hypra_main;
83 	else if (strcmp(id, "object") == 0)
84 		client_main = obj_main;
85 	else if (strcmp(id, "prof") == 0)
86 		client_main = prof_main;
87 	return client_main ? 0 : 1;
88 }
89 
90 
91 // do the actual work
version_main(void)92 void version_main(void)
93 {
94 	IO_put_string(
95 FILE_TAG "\n"
96 "; ToACME: Converted by ToACME, release " RELEASE_NUMBER ".\n"
97 	);
98 	client_main();
99 }
100