From 081a78b10ffed26096e6e107a7287aab86f73a58 Mon Sep 17 00:00:00 2001 From: Egan Ford Date: Sat, 22 Apr 2017 10:33:53 -0600 Subject: [PATCH] screen hole patching directly in c2d, more test options --- Makefile | 19 ++++--- README.md | 9 ++-- bin/c2d | Bin 156904 -> 156936 bytes bin/c2d.exe | Bin 185064 -> 185082 bytes bin/page2text.exe | Bin 28529 -> 28529 bytes bin/text2page.exe | Bin 28370 -> 28370 bytes c2d.c | 34 ++++++++++-- c2d.h | 7 +-- c2d.h.0 | 7 +-- holes.h | 10 ++++ test.scrp | 2 +- test.sh | 128 +++++++++++++++++++++++++--------------------- text2page.c | 12 +---- 13 files changed, 136 insertions(+), 92 deletions(-) create mode 100644 holes.h diff --git a/Makefile b/Makefile index 7e8df3b..8da771d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,4 @@ -EMUTEST = 1 WIN32GCC = /usr/local/gcc-4.8.0-qt-4.8.4-for-mingw32/win32-gcc/bin/i586-mingw32-gcc all: bin/c2d bin/text2page bin/page2text @@ -11,16 +10,16 @@ dist: all windows c2d.h: c2d.h.0 asm/loader.s makeheader ./makeheader -bin/c2d: c2d.c c2d.h +bin/c2d: c2d.c c2d.h holes.h gcc -Wall -Wno-missing-braces -I. -O3 -o $@ $< -lm -bin/c2d.exe: c2d.c c2d.h +bin/c2d.exe: c2d.c c2d.h holes.h $(WIN32GCC) -Wall -Wno-missing-braces -I. -O3 -o $@ $< -bin/text2page: text2page.c +bin/text2page: text2page.c holes.h gcc -Wall -O3 -o $@ $< -lm -bin/text2page.exe: text2page.c +bin/text2page.exe: text2page.c holes.h $(WIN32GCC) -Wall -O3 -o $@ $< bin/page2text: page2text.c @@ -36,6 +35,12 @@ clean: gameserverclient.text: Makefile figlet -c -w 40 -f slant "Game Server Online Client" >$@ -test: gameserverclient gameserverclient.mon gameserverclient.text dist - EMU=$(EMUTEST) ./test.sh +emutest: gameserverclient gameserverclient.mon gameserverclient.text dist + EMU=1 WIN=1 ./test.sh + +fulltest: gameserverclient gameserverclient.mon gameserverclient.text dist + EMU=0 WIN=1 ./test.sh + +test: gameserverclient gameserverclient.mon gameserverclient.text all + EMU=0 WIN=0 ./test.sh diff --git a/README.md b/README.md index 90955f2..8c27036 100644 --- a/README.md +++ b/README.md @@ -51,13 +51,14 @@ Windows/MinGW: ``` usage: c2d [-vh?] - c2d [-m] [-t filename] [-s start address override] input[.mon],[load_address] output.dsk + c2d [-mu] [-t filename] [-s start address override] input[.mon],[load_address] output.dsk -h|? this help -m jump to monitor after booting -s XXXX jump to XXXX after booting - -t filename where filename is a 1K $400-$7FF text page splash screen. - The splash screen will display while the binary is loading. + -t filename, where filename is a 1K $400-$7FF text page splash screen + The splash screen will display while the binary is loading + -u do not patch screen holes -v print version number and exit Input without a .mon extension is assumed to be a binary with a 4 byte header. @@ -103,7 +104,7 @@ Yes. No input checking. Big Endian untested. ### The Ugly Stuff -c2d, Code to Disk, Version 0.51, Fri Apr 21 23:13:38 UTC 2017 +c2d, Code to Disk, Version 0.53 (c) 2012,2017 All Rights Reserved, Egan Ford (egan@sense.net) diff --git a/bin/c2d b/bin/c2d index a9bccf06a9ce96d3241269697124ac0756dcc8ba..351713089b620f65b343a773976e1e289f5d832f 100755 GIT binary patch delta 3521 zcmZWs3s6+o89sOA!t(M0@-Qg4>S8fs3QcH?9UhBIda0`s)M;pm%43xzD1=7_Gt@=F zc5gRpG-n#9)1=LFrm-5QP7zI{yDDIHGNEbGF*T{t+T^ZiW3W|xq}%U5_mUy>&Yb^0 z|KmINKmYmvb9ePWMSD+2?;c4CL^CEa#v+N}2}JL?SeQ5xV`y*28rqRP7v}N`DKqg@ zs$uw%p=YP~cBv@Qo@Qv@Ftv96XJ|)E?TJWp5kA*al-QeT_}Wb0Uj7uc{iaqm!{|R0 zw0I=x6n8}Y&|;PO-iVU?b|5SmGco$BEo?TpwGJ9!D9%+FlOHPtD^HZ?NbNjNE=oAE zye?O#7Ep`$B&g+vpk(E8Va2=VJdE*MN;xV3cC;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Lf($D_y|KLqS|68*v3CZ8?j`*q`jQBFex`03`O6%X(X|>l#&bem{Qu zd>2aPymN^g@zS$hKs5ii!C>D;dESHIp4XA^APnd9t(E6|XpxJsYWgDh6kNcaaxT#h zzvi-;isUL{&8x5yM+-P;6CP~hzj5{X&j->{m%7WEY;eXp&;=_fQ*D;F#%T6v6?IMa(1muiiGMkvNO>;Sd|#j& z^+b`z5lwiUQ#At8(s+8gK22p4TPhab!LA@^y>jJJ1%Oowbh9&zz3=DRR3Sb-+g?Tw_|tz_=iE zT=VI;x~|@cROc&IF^+*N-=h9{^BHZ_cjtSl2Z`~gV06xx72-U1QzbC14XKGc5~>mh zkeWu1LYOdj5{39M)E(VMYC~gJ(9~_DMjYh0+HItBVOoP#rCfn`^JUuINgRH+kxtNN zX#N%&Dr_k#e+tuTNXJ&HWetjv%;CP(3;Ut*O7!1G&sRh>cL& z`47X4a+HuP<(P?P17E10yN&2>yl{-v*CxLM#+VVhP;AC+GWym#2&D}4Kw9Oc>IPmT zCEk%zpq(T%vlKW;65XAFy(HnCB?WeoL5e~*=r zD&4eZ#bZ=`udvnd7mSs8Tw;Pbd5TbKdAcZb@nLMWSO;h070k*e!FB?h3Lf#Ui_c+A zVoWWcEtb^qF=BfIj}uk3(6)#(q-}G-tZ=)gfLWGk-44adT6}!9op-QSGRx{bS;sS( zu?GDgBZlta8Dj7bK39w++b4GLr$T08vguG)N0!v zJ_=0kJva%EfKicn;~8GhJe}l#Kk!8Tb9^={6n)R3ZrP1+8MPNKUh(o?C>HPKOLTct zShcVztjZFnqvU(s5&fwsd0ulwe=gR+oI$N2P1kJO7H8?OpHIy58=}J<8cf}gBWvy S!i!H&@GMr-8TS_dI`JQjcuDdA diff --git a/bin/page2text.exe b/bin/page2text.exe index 0b66a0f45ee1622dc7bcb79b3d23a899288dc2cb..77bd009f9ad5d89071a08ffe2d4d7fefa499c5c1 100755 GIT binary patch delta 23 fcmex(kMZL@#t9wFt*yT&cKb4KPG#J9ds-d7_U delta 23 fcmex(kMZL@#t9wF)zf}W?Dl0|S;nyO_Ov_zm0Szr diff --git a/bin/text2page.exe b/bin/text2page.exe index 3ee63acc0b6335fe9d6e57af28e0462a8c583f87..7b2781d7e009dea5516045b02a691340c849fcde 100755 GIT binary patch delta 22 ecmca~m+{hF#t9wFt*yT&cKb3dpS1DTk6ZwU<_r}8 delta 22 ecmca~m+{hF#t9wF)zf}W?Dl1vvv}jJAGrXCI1C{G diff --git a/c2d.c b/c2d.c index 0d8228e..e9a8f60 100644 --- a/c2d.c +++ b/c2d.c @@ -1,6 +1,6 @@ /* -c2d, Code to Disk, Version 0.51, Fri Apr 21 23:13:38 UTC 2017 +c2d, Code to Disk, Version 0.53 (c) 2012,2017 All Rights Reserved, Egan Ford (egan@sense.net) @@ -41,8 +41,9 @@ Based on work by: #include #include #include "c2d.h" +#include "holes.h" -#define VERSION "Version 0.51" +#define VERSION "Version 0.53" #define INFILE argv[argc-2] #define OUTFILE argv[argc-1] #define BINARY 0 @@ -55,14 +56,14 @@ char *getext(char *filename); int main(int argc, char **argv) { FILE *ifp, *ofp; - int c, i, j, k, start = 0, loadaddress, inputtype, warm = 0, filesize = 0; + int c, i, j, k, start = 0, loadaddress, inputtype, warm = 0, filesize = 0, unpatch = 0; int loaderstart, loader = 0, loadersize = 0, textpagesize = 0; struct stat st; char *filetypes[] = { "BINARY", "MONITOR" }; char *ext, filename[256], load_address[10], *textpage = NULL; opterr = 1; - while ((c = getopt(argc, argv, "t:vmh?s:")) != -1) + while ((c = getopt(argc, argv, "t:vmh?s:u")) != -1) switch (c) { case 't': // load a splash page while loading binary loader = 1; @@ -79,6 +80,9 @@ int main(int argc, char **argv) warm = 0; start = (int) strtol(optarg, (char **) NULL, 16); // todo: input check break; + case 'u': + unpatch = 1; + break; case 'h': // help case '?': usage(); @@ -209,9 +213,25 @@ int main(int argc, char **argv) return 1; } + // check for errors fread(&blank.track[1].sector[0].byte[0], textpagesize, 1, ifp); fclose(ifp); + // patch holes + if(!unpatch) + { + uint64_t *p = (uint64_t *)&blank.track[1].sector[0].byte[0]; // set to start of splash page + uint64_t *h = (uint64_t *)&holes; // holes are 64-bits + int i; + + p -= 1; // back up virtual hole + + for(i = 0; i < 8; i++) { + p += 16; // 3 lines x 40 columns + last hole / 8 (64-bit); + *p = *h++; // copy screen hole data + } + } + if ((loadersize = sizeof(loadercode)) > 256) { fprintf(stderr, "Loader code size %d > 256\n\n", loadersize); return 1; @@ -233,7 +253,11 @@ int main(int argc, char **argv) blank.track[1].sector[4].byte[loadersize + 4] = start >> 8; loaderstart = 0x400; - loadersize += (1024 + 5); // textpage + loader + loader args + + // temp hack to effect the sound of the drive, i.e. to make consistent + // longer term put binary payload at end of loader + // loadersize += (1024 + 5); // textpage + loader + loader args + loadersize = 4096; blank.track[0].sector[1].byte[0xE0] = ceil((loadersize + (loaderstart & 0xFF)) / 256.0); blank.track[0].sector[1].byte[0xE7] = ((loaderstart + loadersize - 1) >> 8) + 1; diff --git a/c2d.h b/c2d.h index 1d0621c..631728c 100644 --- a/c2d.h +++ b/c2d.h @@ -13,13 +13,14 @@ typedef struct d { const char *usagetext="\n\ usage: c2d [-vh?]\n\ - c2d [-m] [-t filename] [-s start address override] input[.mon],[load_address] output.dsk\n\ + c2d [-mu] [-t filename] [-s start address override] input[.mon],[load_address] output.dsk\n\ \n\ -h|? this help\n\ -m jump to monitor after booting\n\ -s XXXX jump to XXXX after booting\n\ - -t filename, where filename is a 1K $400-$7FF text page splash screen.\n\ - The splash screen will display while the binary is loading.\n\ + -t filename, where filename is a 1K $400-$7FF text page splash screen\n\ + The splash screen will display while the binary is loading\n\ + -u do not patch screen holes\n\ -v print version number and exit\n\ \n\ Input without a .mon extension is assumed to be a binary with a 4 byte header.\n\ diff --git a/c2d.h.0 b/c2d.h.0 index 4108116..bd3c82a 100644 --- a/c2d.h.0 +++ b/c2d.h.0 @@ -13,13 +13,14 @@ typedef struct d { const char *usagetext="\n\ usage: c2d [-vh?]\n\ - c2d [-m] [-t filename] [-s start address override] input[.mon],[load_address] output.dsk\n\ + c2d [-mu] [-t filename] [-s start address override] input[.mon],[load_address] output.dsk\n\ \n\ -h|? this help\n\ -m jump to monitor after booting\n\ -s XXXX jump to XXXX after booting\n\ - -t filename, where filename is a 1K $400-$7FF text page splash screen.\n\ - The splash screen will display while the binary is loading.\n\ + -t filename, where filename is a 1K $400-$7FF text page splash screen\n\ + The splash screen will display while the binary is loading\n\ + -u do not patch screen holes\n\ -v print version number and exit\n\ \n\ Input without a .mon extension is assumed to be a binary with a 4 byte header.\n\ diff --git a/holes.h b/holes.h new file mode 100644 index 0000000..e6d6bf5 --- /dev/null +++ b/holes.h @@ -0,0 +1,10 @@ +unsigned char holes[] = { + 0x37, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, + 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, + 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, + 0xff, 0xff, 0x00, 0x17, 0xff, 0xff, 0x00, 0x00, + 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, + 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, + 0xff, 0xff, 0x00, 0xd0, 0xff, 0xff, 0x00, 0x00, + 0xc6, 0xff, 0x00, 0x07, 0xff, 0xff, 0x00, 0x00 +}; diff --git a/test.scrp b/test.scrp index 79d583f..ce33a3b 100644 --- a/test.scrp +++ b/test.scrp @@ -10,7 +10,7 @@ on run argv tell application "Virtual ][" activate -- may need delay for this error: execution error: Virtual ][ got an error: Connection is invalid. (-609) - delay 0.5 + delay 1.0 -- Close all open machines close every machine saving no -- Create a new (AppleIIe) diff --git a/test.sh b/test.sh index 85185ae..98a6a2c 100755 --- a/test.sh +++ b/test.sh @@ -41,23 +41,26 @@ then echo PASSED fi -rm -f ${BIN}.dsk -echo -echo "Testing Windows c2d..." -echo -PATH=$HOME/wine/bin:$PATH -echo "wine bin/c2d.exe ${BIN},${ADDR} ${BIN}.dsk" -wine bin/c2d.exe ${BIN},${ADDR} ${BIN}.dsk 2>&1 | sed 's/^/ /' -CHECK=$(md5sum ${BIN}.dsk | awk '{print $1}') -if [ "$CHECK" = "$SUM" ] +if ((WIN == 1)) then - echo PASSED -else - echo "FAILED $CHECK != $SUM (expected)" - exit 1 + rm -f ${BIN}.dsk + echo + echo "Testing Windows c2d..." + echo + PATH=$HOME/wine/bin:$PATH + echo "wine bin/c2d.exe ${BIN},${ADDR} ${BIN}.dsk" + wine bin/c2d.exe ${BIN},${ADDR} ${BIN}.dsk 2>&1 | sed 's/^/ /' + CHECK=$(md5sum ${BIN}.dsk | awk '{print $1}') + if [ "$CHECK" = "$SUM" ] + then + echo PASSED + else + echo "FAILED $CHECK != $SUM (expected)" + exit 1 + fi fi -SUM=c829f377a6a1040bebb68bd3365c522c +SUM=45ac447dc3e2e762c2b5ab1180682d34 rm -f ${BIN}.dsk echo @@ -95,22 +98,25 @@ then echo PASSED fi -rm -f ${BIN}.dsk -echo -echo "Testing Windows c2d textpage..." -echo -PATH=$HOME/wine/bin:$PATH -echo "wine bin/text2page.exe <${BIN}.text >${BIN}.textpage" -wine bin/text2page.exe <${BIN}.text >${BIN}.textpage -echo "wine bin/c2d.exe -t ${BIN}.textpage ${BIN},${ADDR} ${BIN}.dsk" -wine bin/c2d.exe -t ${BIN}.textpage ${BIN},${ADDR} ${BIN}.dsk 2>&1 | sed 's/^/ /' -CHECK=$(md5sum ${BIN}.dsk | awk '{print $1}') -if [ "$CHECK" = "$SUM" ] +if ((WIN == 1)) then - echo PASSED -else - echo "FAILED $CHECK != $SUM (expected)" - exit 1 + rm -f ${BIN}.dsk + echo + echo "Testing Windows c2d textpage..." + echo + PATH=$HOME/wine/bin:$PATH + echo "wine bin/text2page.exe <${BIN}.text >${BIN}.textpage" + wine bin/text2page.exe <${BIN}.text >${BIN}.textpage + echo "wine bin/c2d.exe -t ${BIN}.textpage ${BIN},${ADDR} ${BIN}.dsk" + wine bin/c2d.exe -t ${BIN}.textpage ${BIN},${ADDR} ${BIN}.dsk 2>&1 | sed 's/^/ /' + CHECK=$(md5sum ${BIN}.dsk | awk '{print $1}') + if [ "$CHECK" = "$SUM" ] + then + echo PASSED + else + echo "FAILED $CHECK != $SUM (expected)" + exit 1 + fi fi BIN=gameserverclient @@ -133,23 +139,26 @@ else exit 1 fi -rm -f ${BIN}.dsk -echo -echo "Testing Windows c2d..." -echo -PATH=$HOME/wine/bin:$PATH -echo "wine bin/c2d.exe ${BIN},${ADDR} ${BIN}.dsk" -wine bin/c2d.exe ${MON} ${BIN}.dsk 2>&1 | sed 's/^/ /' -CHECK=$(md5sum ${BIN}.dsk | awk '{print $1}') -if [ "$CHECK" = "$SUM" ] +if ((WIN == 1)) then - echo PASSED -else - echo "FAILED $CHECK != $SUM (expected)" - exit 1 +rm -f ${BIN}.dsk + echo + echo "Testing Windows c2d..." + echo + PATH=$HOME/wine/bin:$PATH + echo "wine bin/c2d.exe ${BIN},${ADDR} ${BIN}.dsk" + wine bin/c2d.exe ${MON} ${BIN}.dsk 2>&1 | sed 's/^/ /' + CHECK=$(md5sum ${BIN}.dsk | awk '{print $1}') + if [ "$CHECK" = "$SUM" ] + then + echo PASSED + else + echo "FAILED $CHECK != $SUM (expected)" + exit 1 + fi fi -SUM=c829f377a6a1040bebb68bd3365c522c +SUM=45ac447dc3e2e762c2b5ab1180682d34 rm -f ${BIN}.dsk echo @@ -168,22 +177,25 @@ else exit 1 fi -rm -f ${BIN}.dsk -echo -echo "Testing Windows c2d textpage..." -echo -PATH=$HOME/wine/bin:$PATH -echo "wine bin/text2page.exe <${BIN}.text >${BIN}.textpage" -wine bin/text2page.exe <${BIN}.text >${BIN}.textpage -echo "wine bin/c2d.exe -t ${BIN}.textpage ${BIN},${ADDR} ${BIN}.dsk" -wine bin/c2d.exe -t ${BIN}.textpage ${MON} ${BIN}.dsk 2>&1 | sed 's/^/ /' -CHECK=$(md5sum ${BIN}.dsk | awk '{print $1}') -if [ "$CHECK" = "$SUM" ] +if ((WIN == 1)) then - echo PASSED -else - echo "FAILED $CHECK != $SUM (expected)" - exit 1 + rm -f ${BIN}.dsk + echo + echo "Testing Windows c2d textpage..." + echo + PATH=$HOME/wine/bin:$PATH + echo "wine bin/text2page.exe <${BIN}.text >${BIN}.textpage" + wine bin/text2page.exe <${BIN}.text >${BIN}.textpage + echo "wine bin/c2d.exe -t ${BIN}.textpage ${BIN},${ADDR} ${BIN}.dsk" + wine bin/c2d.exe -t ${BIN}.textpage ${MON} ${BIN}.dsk 2>&1 | sed 's/^/ /' + CHECK=$(md5sum ${BIN}.dsk | awk '{print $1}') + if [ "$CHECK" = "$SUM" ] + then + echo PASSED + else + echo "FAILED $CHECK != $SUM (expected)" + exit 1 + fi fi echo diff --git a/text2page.c b/text2page.c index 5252ecf..98780eb 100644 --- a/text2page.c +++ b/text2page.c @@ -1,15 +1,5 @@ #include - -unsigned char holes[] = { - 0x37, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, - 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x17, 0xff, 0xff, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0xff, 0xff, 0x00, 0xd0, 0xff, 0xff, 0x00, 0x00, - 0xc6, 0xff, 0x00, 0x07, 0xff, 0xff, 0x00, 0x00 -}; +#include "holes.h" #define NORMAL 0x80 #define BLINK 0x40