From 3731f93a92f6e9b09df5e335315d60e566e46253 Mon Sep 17 00:00:00 2001 From: Egan Ford Date: Sat, 22 Apr 2017 20:36:47 -0600 Subject: [PATCH] -r option to override default bar row --- README.md | 3 ++- asm/bar.s | 18 ++++-------------- bin/c2d | Bin 156984 -> 156984 bytes bin/c2d.exe | Bin 185100 -> 185612 bytes bin/page2text.exe | Bin 28529 -> 28529 bytes bin/text2page.exe | Bin 28370 -> 28370 bytes c2d.c | 16 +++++++++++----- c2d.h | 41 ++++++++++++++++------------------------- c2d.h.0 | 3 ++- 9 files changed, 35 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index d4b39b2..369e8e6 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Windows/MinGW: ``` usage: c2d [-vh?] - c2d [-bum] [-t filename] [-s start address override] input[.mon],[load_address] output.dsk + c2d [-bum] [-r row] [-t filename] [-s start address override] input[.mon],[load_address] output.dsk -h|? this help -m jump to monitor after booting @@ -60,6 +60,7 @@ usage: c2d [-vh?] The splash screen will display while the binary is loading -u do not patch screen holes -b animated loading bar (experimental) + -r override row default of 19 with 'row' -v print version number and exit Input without a .mon extension is assumed to be a binary with a 4 byte header. diff --git a/asm/bar.s b/asm/bar.s index fde56c7..dc33b47 100644 --- a/asm/bar.s +++ b/asm/bar.s @@ -24,7 +24,6 @@ rwts = $B7B5 ; rwts jsr stage1 = $800 stage2 = $300 ; $300 looks open invsp = $20 ; inverse space for draw -;;;run time trkcnt = $00 ; track counter segcnt = $01 ; loop var buffer = $02 ; MSB of RWTS buffer @@ -114,9 +113,9 @@ secloop: bne nodraw ; if bar,x = barcnt draw bar lda barptr ; get position ;clc - ;adc #5 ; intend + ;adc #5 ; indent sta ch - lda #19 ; row 19 + lda row ; row 19 jsr movecur lda #invsp jsr cout @@ -152,16 +151,7 @@ loadpage: .org *+1 nextjump: .org *+2 +row: + .org *+1 bar: .org *+40 -;;; used for debug -;trkcnt: -; .org *+1 -;segcnt: -; .org *+1 -;buffer: -; .org *+1 -;secnum: -; .org *+1 -;trknum: -; .org *+1 diff --git a/bin/c2d b/bin/c2d index 8e9a04b0e4e9e6a62843e691a0fd0cb4050b6218..605d4201bcec32c749c45c728635ccde383e62c4 100755 GIT binary patch delta 3016 zcmZ8j4^R}>8GpOnk^{j#K=9f`S>mE-{KHMbT2sYK4sRKcsEMXV(V_yCj@1OuXgld# z4WMkU*EW4du#;p$EM}aJVJ37CZ7YZ3p~PlRr|qaoi`bOznnaVcF=%40zxQ^bPMO*7 zd++=Ed*A!M$Mp=R^$e!{DxS5%Nr*rQNo53oD_$Nh%c@SZgpN#0SWP`bSyoM+C0%O? zNe$ftY1Eb;wxv;e0n#m#E!#N{SmG_TKrG8@n`%iF+qR892WgKj)ochoU43Gw=sNOu zea`ClikBVgI+6E>bK&{)XHt<+-E~BIOQcb!EG(yS=d;3j>P>6NItLJ1c+o{o1S>XY zXVU((hpQWqM%(kTQ)Ei1joA$NR2NGQz9h%uZocP5fb=20bEus8R8$9Ek=$-nLep>f z^nV+J8H6;BCgr9$U7UU`^g2-Q#!T3H6}GXrp(+FWaCjzV*S)xdLG3okGh!yRz3C$MswC6?7bW|cl}<%Sj1OUzuT zy?P8lcEZA^Uz_@fOOH1i0we)QP<{CqPp1;n%bbl4Iwiw1;i0;@a()v_LFkGMx3HJi zXM9`er|lWjg|qZ5Xe+%5T1WFTr#U{8_mUe25ea&_Yq@gk> zlVapU=xw~048N+zaca3KK>s>%+G90nIZYTa`Y{y&w9@O~$gv1HeEN0$GH{${;aF@V zVks3Uc`;F1BSaU<%R|d#V9ka)A-h(o&dB3JLVhN95u^z@%b_NG^6aZE(tcb=om_Ov z*HZW*mc}p+1cwY2w+5b@3wtD-hJ*=ub~GVZokAEX72+1D8Au^Hi*FFxz7}aW!ycCW zE)uc<9fp9 zRKkw8hTJrl_PKJZT2Rq)Pty1g)96FSDR6TY>mb%k$lHp%#ygfD?}bVS%OjN`UAgBI z&-)Ao3^OP2Or=BPch*RYv&zbY0ON_W3tovJ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`H*NA%!9Fn@P&QQ0aFR4tpk~v1hcdgI;cT< zcOT@2raNJVYNqijsH8auV3DLh0A3DA zN!B1Npw)5kWeH-mHclVxMo-NO9eV6luu$3^2fAKE;BXxH(XTlW=8P%S`a1kXO?#w? z9>}E^;%5tb!MXr?98ygeER@zAhi(-3`Z(ljPUF8V%Hz(G(z-xPBZ`7l@gW?7SU|e> zA*{k8t~>!|3Nc-1(@8j@5c5BR01^SIFAS&A_0Nak3=M}K`WW7zsPLy@*Z`;?6^y`X SzTX;w9GFfHEgXewss8~b^1MF) diff --git a/bin/page2text.exe b/bin/page2text.exe index e5c0926bdb13944408f69258edbbfe5a07b13434..1ef6cda435fd1cb5effcd3b6e47c9059380ead3e 100755 GIT binary patch delta 21 dcmex(kMZL@#t9uv=Y%G9`7!bw)X{FuVtZoD-;4*+rZ3M~Kt diff --git a/bin/text2page.exe b/bin/text2page.exe index f53779a63565620dedb2c32949650c2719d3c359..e0d2675728b546cb46b8515840a9bc4ea8823a8b 100755 GIT binary patch delta 21 dcmca~m+{hF#t9uv=Y%G9`7wQv-+1dsE&z3V3dH~b delta 21 dcmca~m+{hF#t9uv>bw)X{FpqYHs1P?3jk?t32guX diff --git a/c2d.c b/c2d.c index 76e203e..ade08cb 100644 --- a/c2d.c +++ b/c2d.c @@ -1,6 +1,6 @@ /* -c2d, Code to Disk, Version 0.54 +c2d, Code to Disk, Version 0.55 (c) 2012,2017 All Rights Reserved, Egan Ford (egan@sense.net) @@ -43,7 +43,7 @@ Based on work by: #include "c2d.h" #include "holes.h" -#define VERSION "Version 0.54" +#define VERSION "Version 0.55" #define INFILE argv[argc-2] #define OUTFILE argv[argc-1] #define BINARY 0 @@ -57,13 +57,13 @@ int main(int argc, char **argv) { FILE *ifp, *ofp; int c, i, j, k, start = 0, loadaddress, inputtype, warm = 0, filesize = 0, unpatch = 0; - int loaderstart, loader = 0, loadersize = 0, loaderbasesize = 0, textpagesize = 0, bar = 0; + int loaderstart, loader = 0, loadersize = 0, loaderbasesize = 0, textpagesize = 0, bar = 0, row = 19; 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:ub")) != -1) + while ((c = getopt(argc, argv, "r:t:vmh?s:ub")) != -1) switch (c) { case 't': // load a splash page while loading binary loader = 1; @@ -80,6 +80,9 @@ int main(int argc, char **argv) warm = 0; start = (int) strtol(optarg, (char **) NULL, 16); // todo: input check break; + case 'r': // bar row + row = (int) strtol(optarg, (char **) NULL, 10); // todo: input check + break; case 'u': unpatch = 1; break; @@ -273,8 +276,11 @@ int main(int argc, char **argv) int bar_length = 40; int i; + // bar row + blank.track[1].sector[4].byte[loadersize + 5] = row; + for(i = 1; i <= bar_length; i++) - blank.track[1].sector[4].byte[loadersize + 4 + i] = i * num_sectors / bar_length; + blank.track[1].sector[4].byte[loadersize + 5 + i] = i * num_sectors / bar_length; } loaderstart = 0x400; diff --git a/c2d.h b/c2d.h index 93cb1a4..96f5a4d 100644 --- a/c2d.h +++ b/c2d.h @@ -13,7 +13,7 @@ typedef struct d { const char *usagetext="\n\ usage: c2d [-vh?]\n\ - c2d [-bum] [-t filename] [-s start address override] input[.mon],[load_address] output.dsk\n\ + c2d [-bum] [-r row] [-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\ @@ -22,6 +22,7 @@ usage: c2d [-vh?]\n\ The splash screen will display while the binary is loading\n\ -u do not patch screen holes\n\ -b animated loading bar (experimental)\n\ + -r override row default of 19 with 'row'\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\ @@ -9193,7 +9194,6 @@ rwts = $B7B5 ; rwts jsr stage1 = $800 stage2 = $300 ; $300 looks open invsp = $20 ; inverse space for draw -;;;run time trkcnt = $00 ; track counter segcnt = $01 ; loop var buffer = $02 ; MSB of RWTS buffer @@ -9283,9 +9283,9 @@ barptr = $06 ; bar pointer bne nodraw ; if bar,x = barcnt draw bar lda barptr ; get position ;clc - ;adc #5 ; intend + ;adc #5 ; indent sta ch - lda #19 ; row 19 + lda row ; row 19 jsr movecur lda #invsp jsr cout @@ -9321,19 +9321,10 @@ barptr = $06 ; bar pointer .org *+1 nextjump: .org *+2 +row: + .org *+1 bar: .org *+40 -;;; used for debug -;trkcnt: -; .org *+1 -;segcnt: -; .org *+1 -;buffer: -; .org *+1 -;secnum: -; .org *+1 -;trknum: -; .org *+1 */ unsigned char barcode[] = { 0xA9,0x00,0x85,0x05,0x85,0x06,0xA9,0x01, @@ -9341,19 +9332,19 @@ unsigned char barcode[] = { 0x08,0x99,0xE8,0xB7,0xA9,0x02,0x85,0x04, 0xA2,0x00,0xBD,0x28,0x08,0x9D,0x00,0x03, 0xE8,0xE0,0xD0,0xD0,0xF5,0x4C,0x00,0x03, - 0xAD,0x72,0x03,0x85,0x02,0xAE,0x70,0x03, + 0xAD,0x73,0x03,0x85,0x02,0xAE,0x71,0x03, 0xCA,0xCA,0x86,0x00,0xA5,0x04,0xA0,0x04, 0x99,0xE8,0xB7,0xA5,0x00,0xD0,0x05,0xAD, - 0x71,0x03,0x10,0x02,0xA9,0x0F,0x85,0x03, + 0x72,0x03,0x10,0x02,0xA9,0x0F,0x85,0x03, 0xA5,0x03,0xA0,0x05,0x99,0xE8,0xB7,0xA5, 0x02,0x18,0x65,0x03,0xA0,0x09,0x99,0xE8, 0xB7,0xA0,0xE8,0xA9,0xB7,0x20,0xB5,0xB7, - 0xB0,0x33,0xA9,0x00,0x85,0x48,0xE6,0x05, - 0xA6,0x06,0xBD,0x75,0x03,0xC5,0x05,0xD0, - 0x10,0xA5,0x06,0x85,0x24,0xA9,0x13,0x20, - 0x5B,0xFB,0xA9,0x20,0x20,0xED,0xFD,0xE6, - 0x06,0xC6,0x03,0x10,0xC3,0xA5,0x02,0x18, - 0x69,0x10,0x85,0x02,0xE6,0x04,0xC6,0x00, - 0x10,0xA2,0x6C,0x73,0x03,0x4C,0x69,0xFF - + 0xB0,0x34,0xA9,0x00,0x85,0x48,0xE6,0x05, + 0xA6,0x06,0xBD,0x77,0x03,0xC5,0x05,0xD0, + 0x11,0xA5,0x06,0x85,0x24,0xAD,0x76,0x03, + 0x20,0x5B,0xFB,0xA9,0x20,0x20,0xED,0xFD, + 0xE6,0x06,0xC6,0x03,0x10,0xC2,0xA5,0x02, + 0x18,0x69,0x10,0x85,0x02,0xE6,0x04,0xC6, + 0x00,0x10,0xA1,0x6C,0x74,0x03,0x4C,0x69, + 0xFF }; diff --git a/c2d.h.0 b/c2d.h.0 index 1ba0e6c..8323ebc 100644 --- a/c2d.h.0 +++ b/c2d.h.0 @@ -13,7 +13,7 @@ typedef struct d { const char *usagetext="\n\ usage: c2d [-vh?]\n\ - c2d [-bum] [-t filename] [-s start address override] input[.mon],[load_address] output.dsk\n\ + c2d [-bum] [-r row] [-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\ @@ -22,6 +22,7 @@ usage: c2d [-vh?]\n\ The splash screen will display while the binary is loading\n\ -u do not patch screen holes\n\ -b animated loading bar (experimental)\n\ + -r override row default of 19 with 'row'\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\