Merge pull request #10 from clehner/master

Allow specifying creator code in MakeAPPL
This commit is contained in:
Wolfgang Thaller 2014-10-13 22:58:05 +02:00
commit 7eede70bda

View File

@ -393,6 +393,7 @@ int main(int argc, char *argv[])
std::string outFileName = "Test"; std::string outFileName = "Test";
std::string binFileName = "Test.bin"; std::string binFileName = "Test.bin";
std::string dskFileName = "Test.dsk"; std::string dskFileName = "Test.dsk";
std::string creatorCode = "????";
std::string curRType = "CODE"; std::string curRType = "CODE";
bool breakOnEntry = false; bool breakOnEntry = false;
@ -430,6 +431,11 @@ int main(int argc, char *argv[])
rsrc.addResource(Resource(curRType, id, readfile(fn))); rsrc.addResource(Resource(curRType, id, readfile(fn)));
} }
else if(arg == "-C")
{
assert(i < argc);
creatorCode = argv[i++];
}
else if(arg == "-c") else if(arg == "-c")
{ {
assert(i < argc); assert(i < argc);
@ -521,7 +527,7 @@ int main(int argc, char *argv[])
{ {
std::ofstream out(binFileName.c_str()); std::ofstream out(binFileName.c_str());
writeMacBinary(out, outFileName, "APPL", "????", writeMacBinary(out, outFileName, "APPL", creatorCode,
rsrc, Fork()); rsrc, Fork());
} }
wrapMacBinary(binFileName, dskFileName); wrapMacBinary(binFileName, dskFileName);
@ -535,7 +541,7 @@ int main(int argc, char *argv[])
system("mkdir -p .finf"); system("mkdir -p .finf");
std::ofstream finfOut((".finf/" + outFileName + ".APPL").c_str()); std::ofstream finfOut((".finf/" + outFileName + ".APPL").c_str());
ostype(finfOut, "APPL"); ostype(finfOut, "APPL");
ostype(finfOut, "????"); ostype(finfOut, creatorCode);
for(int i = 8; i < 32; i++) for(int i = 8; i < 32; i++)
byte(finfOut, 0); byte(finfOut, 0);
} }