; -----------------------------------------------
; PShell - a runtime environment for    
; sharp pocket computers                 
; file     : printer.asm                   
; author   : puehringer edgar           
; date     : 09.05.2005                 
; version  : 1.0.0                      
; assembler: as61860                    
;                                       
; All printer interface related funtions for 
; pshell. If printer interface functions for
; a specific modell had not been implemented
; yet, output functions return imidiatly 
; without doing anything. Only CE-126P for
; a few modells is supported.
; -----------------------------------------------

.area pshell (REL)
        
.include "pshell.h"
.include "internal.h"


; -----------------------------------------------
; Writes a character in A to the printer
; label prefix 02
; -----------------------------------------------
ps_putchar_prn::
; If we have a PC-1350 with ROM Version 1
.if __PC_1350__ * __ROM_VERS__
	
	CALL EXT_ROM_TESTPRN
	CAL  INT_ROM_WAIT6MS
	LIA 0x17		; 24 characters to print
	PUSH
lb0203:	IXL
	CPIA 0xFE		; it's a SHIFT : skiped
	JRNZP lb0201
	IXL
lb0201:	CPIA 0x00		; end of this line ?
	JRZP lb0202
	CALL EXT_ROM_PRINTA
	LOOP lb0203
lb0204:	LIA 0x0D			; Print end of line
	CALL EXT_ROM_PRINTA
	LIA 0x0E
	CALL EXT_ROM_PRINTA
	RC
	RTN
lb0202:	RA			; Fill until 24 char with space
	CALL EXT_ROM_PRINTA
	LOOP lb0202
	CALL lb0204
	SC

.endif	
	RTN


