þ a‹R þ d 
þ w ÿÿÿÿÿÿÿÿþ m
Z<     þ hý	 oP   þ nSystem-wide$NOLIST
	NAME	GfxConsole

$INCLUDE (``OsIncs`Windows.ASM.Inc~Text~)

RAM_CGROUP GROUP    RAM_CODE

	PUBLIC	GfxCharOut, GfxLineOut

	EXTRN	CpDrawChars:NEAR
	EXTRN	GetMeWindowState:NEAR

RAM_CODE	SEGMENT	PUBLIC	'CODE'
	ASSUME	CS:RAM_CGROUP



$EJECT
$LIST
; PROCEDURE GfxCharOut (ch: BYTE);
;
; Char is placed with its top left corner at the point (xLoc, yLoc).
; No chars are interpreted.

GfxCharOut PROC FAR

	PUSH	DS
	PUSH	BP
	MOV	BP,SP
	CALL	GetMeWindowState
	MOV	DS,AX

	PUSH      DS:wsPwindowSeg         ; screen location
	PUSH      DS:wsBytesPerLine       ; window size
	PUSH      DS:wsWindowHeight       ; window height

	MOV	AX,DS:wsTheWindowTopLeftX
	ADD	AX, DS:wsXLoc
	PUSH	AX			; screen rel xLoc
	MOV	AX,DS:wsTheWindowTopLeftY
	ADD	AX, DS:wsYLoc
	PUSH	AX			; screen rel yLoc

	LES	BX, DWORD PTR [BP+10]	; string to print
	PUSH      SS
          MOV       AX, BP
	ADD       AX, 8                         ; ch at [BP+8]
          PUSH      AX

	MOV	AX, 1			; count
	PUSH	AX			

	LES	BX,DS:wsPFontTable
	PUSH      ES			; push the font table
          PUSH      BX
          CALL      CpDrawChars		; draw the line

	POP	BP
	POP	DS
	RET	2

GfxCharOut ENDP
$NOLIST

$EJ

; PROCEDURE GfxLineOut (VAR ch: BYTES; count: WORD);

GfxLineOut PROC FAR

	PUSH	DS
	PUSH	BP
	CALL	GetMeWindowState
	MOV	DS,AX
	MOV	BP,SP

	PUSH      DS:wsPWindowSeg           ; screen location
	PUSH      DS:wsBytesPerLine         ; window info
	PUSH      DS:wsWindowHeight         ; window info

	MOV	AX,DS:wsTheWindowTopLeftX
	ADD	AX, DS:wsXLoc
	PUSH	AX			; screen rel xLoc
	MOV	AX,DS:wsTheWindowTopLeftY
	ADD	AX, DS:wsYLoc
	PUSH	AX			; screen rel yLoc

	LES	BX, DWORD PTR [BP+10]	; string to print
	PUSH      ES
          PUSH      BX

	MOV	AX, WORD PTR [BP+8]			; count
	PUSH	AX			

	LES	BX,DS:wsPFontTable
	PUSH      ES			; push the font table
          PUSH      BX
          CALL      CpDrawChars		; draw the line

	POP	BP
	POP	DS
	RET	6

GfxLineOut ENDP

RAM_CODE	ENDS

END
