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 8e9a04b..605d420 100755 Binary files a/bin/c2d and b/bin/c2d differ diff --git a/bin/c2d.exe b/bin/c2d.exe index c33d2c3..1f3da23 100755 Binary files a/bin/c2d.exe and b/bin/c2d.exe differ diff --git a/bin/page2text.exe b/bin/page2text.exe index e5c0926..1ef6cda 100755 Binary files a/bin/page2text.exe and b/bin/page2text.exe differ diff --git a/bin/text2page.exe b/bin/text2page.exe index f53779a..e0d2675 100755 Binary files a/bin/text2page.exe and b/bin/text2page.exe differ 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\