Hi Jochen,
I hope this is enough?
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
; MOVE_SCREEN - Move bytes at DS:[SI] [WORK1] to the screen at ES:[DI] 00
; PSEUDO.ASM 1986 for Z-100
; PSEUDO2.ASM 11 May 1999 for HPLX - CGA
; Code modified for 200LX DRAW-LX 29 July 2002, SRN (MOVSW)
PUBLIC Move_Screen0 ; move from work area to screen
Move_Screen0 PROC
ASSUME CS:CODE
MOV AX,0B800H ; Point to CGA video memory
MOV ES,AX
XOR DI,DI
MOV SI,[WORK1] ; make offsets
CLD
MOV CX,100-(199-dispYMax)/2 ; count 100 records (odd lines per screen)
MS0_1: PUSH CX
MOV CX,40 ; count 40 words (80 bytes per line)
; = 640 monochrome pixels
REP MOVSW ; Data seg = Work, Extra seg = screen
ADD SI,050H ; Skip line in work area so odd lines copied
POP CX
LOOP MS0_1
; - - even lines - -
MOV SI,[WORK1]
ADD SI,050H ; Point to second line, CGA lines use 80 bytes
MOV DI,02000H ; 100 line offset + waste for CGA screen area
MOV CX,100-(199-dispYMax)/2 ; count 100 records (even lines per screen)
MS0_3: PUSH CX
MOV CX,40 ; count 40 words (bytes per line)
REP MOVSW
ADD SI,050H ; Skip line in work area to copy even lines
POP CX
LOOP MS0_3
RET
Move_Screen0 ENDP
...
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
; If we can't get their routines to work, we'll make a
; bog simple line routine, 9 August 2002, SRN
VertLine06 PROC NEAR
MOV AX,[y1] ; AX = y1
MOV CX,[y2]
SUB CX,AX ; CX = y2-y1
JGE VL_1 ; jump if dY >= 0
ADD AX,CX ; AX = y2
NEG CX ; force dY >= 0
VL_1: INC CX ; CX = # of pixels to draw
; point to the Topmost pixel (??) Smallest line #
MOV [usY],AX
MOV AX,[x1]
MOV [usX],AX
; draw the line
VL_2: PUSH CX ; preserve CX
CALL [SetPixel]
INC [usY]
POP CX ; CX = # of pixels
LOOP VL_2
RET
VertLine06 ENDP
HorzLine06 PROC NEAR
; ensure that x1 < x2 (move left to right)
MOV AX,[x1] ; AX = x1
MOV CX,[x2] ; CX = x2
SUB CX,AX ; CX = x2-x1
JAE HL_1
ADD AX,CX ; AX = x2
NEG CX ; force dX >= 0
HL_1: INC CX ; CX = # of pixels to draw
MOV [usX],AX
MOV AX,[y1]
MOV [usY],AX
HL_2: PUSH CX ; preserve CX
CALL [SetPixel]
INC [usX] ; Move right
POP CX ; CX = # of pixels
LOOP HL_2
RET
HorzLine06 ENDP
Regards,
Steve N.