-
Notifications
You must be signed in to change notification settings - Fork 2
/
AtlasMain.cpp
54 lines (43 loc) · 1.06 KB
/
AtlasMain.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Atlas main entry point
#include "stdafx.h"
#include <ctime>
#include <string>
#include <vector>
#include <conio.h>
#include "AtlasCore.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
clock_t StartTime, EndTime, ElapsedTime;
int argoff = 0;
int retcode = 0;
Logger.SetLogStatus(false);
StartTime = clock();
printf("Atlas 1.12 by Klarth\n\n");
if (argc != 3 && argc != 5)
{
printf("Usage: %s [switches] ROM.ext Script.txt\n", argv[0]);
printf("Switches: -d filename or -d stdout (debugging)\n");
printf("Arguments in brackets are optional\n\n");
printf("Press any key to continue\n");
(void)getch();
return 1;
}
if (strcmp("-d", argv[1]) == 0)
{
if (strcmp("stdout", argv[2]) == 0)
Atlas.SetDebugging(stdout);
else
Atlas.SetDebugging(fopen(argv[2], "w"));
argoff += 2;
}
if (!Atlas.Insert(argv[1 + argoff], argv[2 + argoff]))
{
printf("Insertion failed\n\n");
retcode = 2;
}
EndTime = clock();
ElapsedTime = EndTime - StartTime;
printf("Execution time: %u msecs\n", (unsigned int)ElapsedTime);
return retcode;
}