diff options
author | Leo C | 2016-08-14 21:21:56 +0200 |
---|---|---|
committer | Leo C | 2016-08-14 21:21:56 +0200 |
commit | 8bc5ea2267aec88cc21937d962c3e077414e2c65 (patch) | |
tree | a6567eeba108f5b05945c41d7b294d8f3ee25f3a | |
parent | 2d914eb7d607546546a41af99ded751e8e416dfb (diff) | |
download | ddt180-0.2.zip |
Add version stringv0.2
Minor optimizations (p_fill_space)
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | Makefile | 46 | ||||
-rw-r--r-- | ddt180.z80 | 71 |
3 files changed, 79 insertions, 41 deletions
@@ -3,3 +3,6 @@ scratch *.rel *.prl *.com +*.zip +autorevision.cache +version.inc @@ -4,12 +4,21 @@ PROG := ddt180 SRC := $(PROG).z80 +EXTRA_DIST := autorevision.cache version.inc + OBJ := $(SRC:.z80=.rel) -AS_OPT := MFS +DIST_NAME = $(PROG)_$(VERS).zip +PREFIX = $(PROG)_$(VERS) -ASM := zxcc slrz80.com -LINK := zxcc link80.com +ASM := zxcc slrz80.com +LINK := zxcc link80.com +CP := cp +RM := rm -f +GIT := git +ZIP := zip + +AS_OPT := MFS .phony: all all: $(PROG).com @@ -23,7 +32,38 @@ $(PROG).com: $(PROG).prl $(PROG).prl: $(OBJ) $(LINK) -'$(PROG)[op,$$SZ]' +$(PROG).rel: version.inc + +$(foreach X,$(subst =,:=,$(subst ",,$(filter VCS_%,\ + $(shell autorevision -t sh -o $(CURDIR)/autorevision.cache)))),$(eval $X)) + +VERS := $(shell echo "$(VCS_TAG)" | sed -e 's/^v//g') + +ifneq ($(VCS_TICK),0) + VERS := $(VERS)-$(VCS_TICK) +endif +ifneq ($(VCS_BRANCH),master) + VERS := $(VERS)-$(VCS_BRANCH) +endif +ifeq ($(VCS_WC_MODIFIED),1) + VERS := $(VERS)-dirty +endif + + + +version.inc: autorevision.cache + @echo update $@ + @printf "defvers macro\r\n\ + db '$(VERS)'\r\n\ + endm\r\n\032" > $@ +.phony: dist +dist: $(PROG).com version.inc + $(GIT) archive --format=zip --prefix=$(PREFIX)/ -9 -o $(DIST_NAME) HEAD^{tree} + @mkdir -p $(PREFIX) + @$(CP) -p $(EXTRA_DIST) $(PREFIX) + $(ZIP) -r -9 $(DIST_NAME) $(PREFIX) $(PROG).com + @$(RM) -r $(PREFIX) .phony: clean clean: @@ -9,7 +9,6 @@ ;-------------------------------------------------------------------------------
; Relocation loader
;
-
TPA equ 0100h
cseg
.phase TPA
@@ -80,8 +79,11 @@ ddtz_bdos: current_cseg defl $ - current_cseg
.phase current_phase + current_cseg
signon:
- db 'DDT/180',TAB
- db '[8101] 003',CR,LF,'$'
+ db 'Symbolic DDTZ/180'
+ db ' - Version '
+ maclib version.inc
+ defvers
+ db CR,LF,'$'
msgz80:
db 'Z80 or better required!',cr,lf,'$'
@@ -287,6 +289,7 @@ l01f3h: call outbl
djnz l01f3h
ret
+
sub_01f9h:
dec b
push de
@@ -422,6 +425,13 @@ pstr_inl: ex (sp),hl
ret
+p_fill_space:
+ call outbl
+ ld a,(con_col)
+ cp c
+ jr c,p_fill_space
+ ret
+
inchar:
push hl
push de
@@ -2524,11 +2534,7 @@ psym_nxtsym: sub b
cp c
jr c,psym_nxtline
-psym_fillcol:
- call outbl
- ld a,(con_col)
- cp c
- jr c,psym_fillcol
+ call p_fill_space
jr psym_nxtsym
psym_nxtline:
@@ -3142,7 +3148,7 @@ rs_3: call read_byte jr rs_3
rs_4: ld hl,(BDOS+1) ;
- ld e,0 ; setup symlen
+ ld d,0 ; setup symlen
rs_5: dec hl ;
call read_byte ; next char of symbol name
cp TAB ; symbol term?
@@ -3152,8 +3158,8 @@ rs_5: dec hl ; cp '!' ; TODO: check for valid symbol char instead
jr c,error9 ;
ld (hl),a ;
- inc e ; symlen++
- ld a,e ;
+ inc d ; symlen++
+ ld a,d ;
cp 10h+1 ;
jr c,rs_5 ;
error9:
@@ -3187,18 +3193,17 @@ rs_61: ld de,(BDOS+1) ;
ld (BDOS+1),hl ;
ex de,hl ;
- pop de ;
- ld (hl),e ; symlen
- ld a,e
+ pop af ;
+ ld (hl),a ; symlen
inc hl ;
pop de ; symval
ld (hl),e ;
inc hl ;
ld (hl),d ;
- ld hl,symlen_max
- cp (hl)
- jr c,$+3
- ld (hl),a
+ ld hl,symlen_max ;
+ cp (hl) ; new max?
+ jr c,$+3 ;
+ ld (hl),a ;
jp rs_1 ;
@@ -3296,18 +3301,15 @@ l1211h: push hl
call p_disas_line
pop iy
- ld c,b
ld de,(var.@)
ld a,d
or e
- ld b,17
+ ld c,17
jr z,l122dh
- ld b,25
+ ld c,25
l122dh:
- call outbl
- ld a,(con_col)
- cp b
- jr c,l122dh
+ call p_fill_space
+ ld c,b
push bc
call get_line
pop bc
@@ -4491,11 +4493,9 @@ p_disas_line: call p_disas_instr
and a
ret z
-l193fh:
- call outbl
- ld a,(con_col)
- cp 16
- jr c,l193fh
+
+ ld c,16
+ call p_fill_space
p_offset:
ld de,(var.@)
@@ -5334,15 +5334,10 @@ p_arg: p_mnemonic:
ld a,(con_col)
+ add a,5
ld c,a
- call pstr
-l1ebch:
- call outbl
- ld a,(con_col)
- sub c
- cp 5
- jr c,l1ebch
- ret
+ call pstr
+ jp p_fill_space
t_MNEMONICS:
DC 'ADC'
|