From 7813a2e4a8bc4b3453911e811f3e196936ea2a3b Mon Sep 17 00:00:00 2001 From: Leo C Date: Fri, 11 Dec 2015 15:09:23 +0100 Subject: [PATCH] Bugfix in outmdm (output buffer flush) --- cpxac.asm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cpxac.asm b/cpxac.asm index f8763c8..0b15d21 100644 --- a/cpxac.asm +++ b/cpxac.asm @@ -707,7 +707,7 @@ outcon: outmdm: push hl ld hl,(outptr) - ld (hl),e ;return buffered char + ld (hl),e ;save char in buffer inc hl ld (outptr),hl ld a,(outcnt) @@ -750,22 +750,23 @@ omf_2: ld a,2 ;start write transaction out (VI2C_CTRL),a - ld hl,outbuf+2 - ld (outptr),hl + ld hl,outbuf+2 ;buffer start ld a,(outcnt) - sub c + sub c ;buffer now empty? ld (outcnt),a jr z,omfex - push de - ld d,h + push de ;no, shift remaining chars down + ld d,h ;dest = buffer start ld e,l ld b,0 - add hl,bc + add hl,bc ;src = buffer start + num chars last transmitted ld c,a ldir + ex de,hl pop de omfex: + ld (outptr),hl pop bc pop hl ret -- 2.39.2