summaryrefslogtreecommitdiff
path: root/z180/conbuf-a.180
diff options
context:
space:
mode:
authorLeo C2015-05-01 23:19:32 +0200
committerLeo C2015-05-01 23:19:32 +0200
commit64cc220767e870fad388fb9021cf96ff2958275b (patch)
treee3e465d35e364b2c9f70c39dce77820c5480eb92 /z180/conbuf-a.180
parent2fe441224da6410ec112322abf78524589b15498 (diff)
downloadz180-stamp-64cc220767e870fad388fb9021cf96ff2958275b.zip
Simplify Console I/O. Switch back to IOBYTE.
Diffstat (limited to 'z180/conbuf-a.180')
-rw-r--r--z180/conbuf-a.18085
1 files changed, 60 insertions, 25 deletions
diff --git a/z180/conbuf-a.180 b/z180/conbuf-a.180
index 8534f73..096bbf9 100644
--- a/z180/conbuf-a.180
+++ b/z180/conbuf-a.180
@@ -9,7 +9,9 @@
extrn buf.init
include config.inc
+ if CPU_Z180
include z180reg.inc
+ endif
;--------------------------------------------------------------
@@ -96,36 +98,69 @@ buf.full:
ret
+ if 1
ff.out:
- push ix
- ld ix,co.fifo ;
+ push ix ;15
+ ld ix,co.fifo ;14
buf.put:
- push hl ;
- push bc
- push ix
- pop hl
- ld a,c
- ld c,(ix+o.in_idx) ;
- ld b,0
- add hl,bc
- ld b,a
-
- ld a,c ;
- inc a
- and (ix+o.mask)
+ push hl ;11
+ push bc ;11
+ push ix ;15
+ pop hl ;10
+ ld a,c ;4
+ ld c,(ix+o.in_idx) ;19
+ ld b,0 ;7
+ add hl,bc ;11
+ ld (hl),a ;7
+ ld b,a ;4
+
+ ld a,c ;4
+ inc a ;4
+ and (ix+o.mask) ;19
bp.wait:
- cp (ix+o.out_idx) ;
- jr z,bp.wait
- ld (hl),b
- ld (ix+o.in_idx),a
+ cp (ix+o.out_idx) ;19
+ jr z,bp.wait ;12/7
+ ld (ix+o.in_idx),a ;19
- out (AVRINT6),a
- ld a,b
- pop bc
- pop hl
- pop ix
- ret
+ out (AVRINT6),a ;11
+ ld a,b ;4
+ pop bc ;10
+ pop hl ;10
+ pop ix ;14
+ ret ;10
+
+ else
+
+ff.out:
+ push ix ;15
+ ld ix,co.fifo ;14
+
+buf.put:
+ push hl ;11
+ push ix ;15
+ pop hl ;10
+ ld a,(ix+o.in_idx) ;19
+ add a,l ;4
+ ld l,a ;4
+ jr nc,bp.1 ;12/7
+ inc l ;4
+ ld (hl),c ;7
+ ld a,(ix+o.in_idx) ;19
+ inc a ;4
+ and (ix+o.mask) ;19
+bp.wait:
+ cp (ix+o.out_idx) ;19
+ jr z,bp.wait ;12/7
+ ld (ix+o.in_idx),a ;19
+
+ out (AVRINT6),a ;11
+ ld a,c ;4
+ pop hl ;10
+ pop ix ;14
+ ret ;10 |
+
+ endif
end