From f2a7789fa016371538e64f1220539554769f2e2b Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 11 Nov 2022 16:04:17 -0500 Subject: v0.2.1: Prepend D: to Save filename if needed. Move VERSION out of the Makefile. --- Makefile | 10 ++++------ VERSION | 1 + dla.s | 28 ++++++++++++++++++++++++++-- dla.xex | Bin 4696 -> 4696 bytes dla2csv.xex | Bin 10885 -> 10885 bytes dlaver.h | 2 +- dlaver.inc | 2 +- mkver.pl | 2 +- 8 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 VERSION diff --git a/Makefile b/Makefile index ec4d009..15a4ac9 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,6 @@ # Makefile for dla-asm. # See https://slackware.uk/~urchlay/repos/dla-asm -VERSION=0.2.0 - CL65=cl65 CL65FLAGS= @@ -13,7 +11,7 @@ CFLAGS=-O2 -Wall all: dla.xex dla2csv dla2csv.xex -dla.xex: dla.s io.s dlatbl.s xex.inc printint.s render.s drunkwalk.s dlaver.inc +dla.xex: dla.s io.s dlatbl.s xex.inc printint.s render.s drunkwalk.s dlaver.h $(CL65) $(CL65FLAGS) -l dla.list -Ln dla.labels -t none -o dla.xex dla.s dla2csv.xex: dla2csv.c dlaver.h @@ -21,10 +19,10 @@ dla2csv.xex: dla2csv.c dlaver.h dlatbl.s: mkdlatbl.pl $(PERL) mkdlatbl.pl > dlatbl.s -dlaver.inc: dlaver.h +#dlaver.inc: dlaver.h -dlaver.h: mkver.pl - $(PERL) mkver.pl $(VERSION) +dlaver.h: mkver.pl VERSION + $(PERL) mkver.pl dla2csv: dla2csv.c @echo $(CC) $(CFLAGS) -o dla2csv dla2csv.c ; \ diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..0c62199 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.2.1 diff --git a/dla.s b/dla.s index 3d540b3..5126b50 100644 --- a/dla.s +++ b/dla.s @@ -309,6 +309,30 @@ saveimage: jsr close1 ; make sure the IOCB is closed before we open it! + ; prepend D: to the filename, if there's no device given. + lda linebuf+1 + cmp #':' + beq open_output + lda linebuf+2 + cmp #':' + beq open_output + + ldy ICBLL +dloop: + lda linebuf,y + sta linebuf+2,y ; make for for D: + dey + bpl dloop + + ; insert D: and add 2 to the buffer length. + lda #'D' + sta linebuf + lda #':' + sta linebuf+1 + inc ICBLL + inc ICBLL + +open_output: ; CIO is nice, but it's kind of a PITA to use... ; OPEN #1,8,0, ldx #$10 @@ -319,7 +343,7 @@ saveimage: lda #>linebuf sta ICBAH,x ldy ICBLL ; length returned by CIO when we called readline... - dey ; ...but one byte too long. + dey ; ...but one byte too long (due to the EOL). tya sta ICBLL,x lda #0 @@ -637,7 +661,7 @@ seedprompt2: .byte "]? ",$0 saveprompt: - .byte $7d, "Save: Enter filename, including Dn:",$9b,"> ",$0 + .byte $7d, "Save: Enter filename:",$9b,"> ",$0 saveokmsg: .byte "Saved OK, press any key...",$0 diff --git a/dla.xex b/dla.xex index 113e80b..b4bf550 100644 Binary files a/dla.xex and b/dla.xex differ diff --git a/dla2csv.xex b/dla2csv.xex index 60fccce..8bb40ee 100644 Binary files a/dla2csv.xex and b/dla2csv.xex differ diff --git a/dlaver.h b/dlaver.h index a7cc638..cb1ae9a 100644 --- a/dlaver.h +++ b/dlaver.h @@ -1 +1 @@ -#define VERSION "0.2.0" +#define VERSION "0.2.1" diff --git a/dlaver.inc b/dlaver.inc index 8bb2e0e..7f669e7 100644 --- a/dlaver.inc +++ b/dlaver.inc @@ -1 +1 @@ - .define VERSION "0.2.0" + .define VERSION "0.2.1" diff --git a/mkver.pl b/mkver.pl index d17efa6..6f92d0a 100644 --- a/mkver.pl +++ b/mkver.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -$ver = shift || die "Usage: $0 [version]\n"; +chomp($ver = `cat VERSION`); open F,">dlaver.inc" or die $!; print F " .define VERSION \"$ver\"\n"; -- cgit v1.2.3