;HP/LIDIL printing routines include "settings.inc" include "ti83plus.inc" include "equates.inc" include "usb8x.inc" SEGMENT Main GLOBALS ON EXTERN IPutS,IGetKey,IPutS11,PrintOutPipe LDL_startPrintJob: ;Initialize printer for print job ;Input: None ;Output: Printer initialized ; C set if problems ;Destroys appData ld hl,LDL_syncstart ld bc,10 call LDL_send ret c ld hl,appData push hl ld bc,245 B_CALL MemClear ld hl,appData+256 ld (hl),24h pop hl ld bc,246 call LDL_send ret c ld bc,254 ld hl,appData B_CALL MemClear ld b,8 LDL_spjLoop: push bc ld hl,appData ld bc,254 call LDL_send pop bc ret c djnz LDL_spjLoop ld hl,appData call LDL_send16 ret c ld hl,LDL_synccomplete call LDL_send16 ret c call LDL_sendReset ret c ld hl,LDL_enablepacing call LDL_send16 ret c ld hl,LDL_enableonchange call LDL_send16 ret c ld hl,LDL_startstop jr LDL_send16 LDL_stopPrintJob: ;Ends print job ;Input: None ;Output: Print job ended ; C set if problems ;Destroys appData ld hl,LDL_startstop call LDL_send16 ret c ld hl,LDL_disablepacing call LDL_send16 ret c ;fall through to LDL_sendReset LDL_sendReset: ;"Resets" printer ;Input: None ;Output: Printer is "reset" ; Returns C if problems ;Destroys appData ld hl,LDL_reset LDL_send16: ld bc,16 LDL_send: ld de,appData push bc ldir pop bc LDL_reallysend: ld hl,appData ld b,c ld a,(PrintOutPipe) ld c,a U_CALL SendData ; ld b,2 ; U_CALL ReqData ret LDL_ejectPage: ;Ejects current page from printer ;Input: None ;Output: Printer ejects current page ; Returns C if problems ;Destroys appData ld hl,LDL_eject jr LDL_send16 LDL_reset: DB 24h,0,10h,0,6,0,0,0,0,0,0FFh,0FFh,0FFh,0FFh,0FFh,24h LDL_eject: DB 24h,0,10h,0,0,2,0,13h,0,0,0,0,0,1,0Ch,24h LDL_disablepacing: DB 24h,0,10h,0,1,0,0,0,0,0,0FFh,0FFh,0FFh,0FFh,0FFh,24h LDL_synccomplete: DB 24h,0,10h,0,8,0,0,0,0,0,0FFh,0FFh,0FFh,0FFh,0FFh,24h LDL_enablepacing: DB 24h,0,10h,0,2,0,0,0,0,0,0FFh,0FFh,0FFh,0FFh,0FFh,24h LDL_syncstart: DB 24h,1,0,0,7,0,0,0,8,0 LDL_enableonchange: DB 24h,0,10h,0,0,5,0,0,0,0,0,2,0,0,0FFh,24h LDL_startstop: DB 24h,0,10h,0,0,0,0,4,0,0,0FFh,0FFh,0FFh,0FFh,0FFh,24h