;HP/PCL printing routines include "settings.inc" include "ti83plus.inc" include "equates.inc" include "usb8x.inc" SEGMENT Main GLOBALS ON EXTERN IPutS,IGetKey,IPutS11,PrintOutPipe,SendPrintData PCL_startPrintJob: ;Starts PCL print job ;Returns C if problems ld hl,sStartJob ld bc,sStartJobEnd-sStartJob jr SendPrintData ; ld hl,appData ; ld bc,255 ; B_CALL MemClear ; ld b,14 ;$$: push bc ; ld hl,appData ; ld bc,255 ; call SendPrintData ; pop bc ; djnz $B ; ld hl,appData ; ld bc,30 ; call SendPrintData ; ld hl,sStartJob ; ld bc,sStartJobEnd-sStartJob ; jr SendPrintData PCL_sendData: ;Sends ASCII text and picture data to printer ;HL points to data to send ;BC is number of bytes to send ;Returns C if problems ld (iMathPtr5),hl ld (iMathPtr4),bc xor a PCL_sendDataLoop: ld hl,(iMathPtr4) ld bc,128 or a sbc hl,bc jr nc,$F ld bc,(iMathPtr4) inc a $$: ld hl,(iMathPtr4) or a sbc hl,bc ld (iMathPtr4),hl ld hl,(iMathPtr5) ld de,appData push bc ldir ld (iMathPtr5),hl pop bc ld hl,appData push af call SendPrintData pop af or a ret nz jr PCL_sendDataLoop PCL_stopPrintJob: ;Stops PCL print job and prints pages in buffer ;Returns C if problems ld hl,sStopJob ld bc,sStopJobEnd-sStopJob jr SendPrintData sStartJob: DB 1Bh,"E",1Bh,45h,1Bh,25h,2Dh,31h,32h,33h,34h,35h,58h ; DB 1Bh,45h,1Bh,25h,2Dh,31h,32h,33h,34h,35h,58h,40h,50h,4Ah,4Ch,20h ; DB 4Ah,4Fh,42h,20h,4Eh,41h,4Dh,45h,20h,3Dh,20h,22h,34h,36h,39h,33h ; DB 62h,31h,61h,65h,30h,66h,63h,35h,61h,30h,30h,30h,36h,66h,38h,33h ; DB 22h,0Ah,40h,50h,4Ah,4Ch,20h,45h,4Eh,54h,45h,52h,20h,4Ch,41h,4Eh ; DB 47h,55h,41h,47h,45h,3Dh,50h,43h,4Ch,33h,47h,55h,49h,0Ah,1Bh,2Ah ; DB 62h,32h,42h,1Bh,2Ah,6Fh,35h,57h,04h,0Ch,00h,00h,00h,1Bh,2Ah,6Fh ; DB 31h,44h,1Bh,26h,6Ch,31h,48h,1Bh,26h,62h,32h,38h,57h,50h,4Dh,4Ch ; DB 20h,04h,00h,04h,01h,01h,02h,08h,10h,0Fh,01h,15h,32h,30h,30h,36h ; DB 31h,30h,30h,31h,32h,33h,34h,35h,5Ah,1Bh,26h,6Ch,2Dh,32h,48h,1Bh ; DB 26h,6Ch,32h,41h,1Bh,26h,6Ch,30h,4Dh,1Bh,2Ah,6Fh,35h,57h,04h,65h ; DB 00h,00h,03h,1Bh,2Ah,6Fh,30h,4Dh,1Bh,26h,75h,33h,30h,30h,44h,1Bh ; DB 26h,6Ch,30h,65h,30h,4Ch,1Bh,2Ah,70h,30h,59h,1Bh,2Ah,70h,30h,58h ; DB 1Bh,2Ah,67h,32h,36h,57h,02h,04h,02h,58h,01h,2Ch,00h,02h,01h,2Ch ; DB 01h,2Ch,00h,02h,01h,2Ch,01h,2Ch,00h,02h,01h,2Ch,01h,2Ch,00h,02h ; DB 1Bh,2Ah,72h,31h,41h sStartJobEnd: ; DB 1Bh,2Ah,62h,32h,6Dh,31h,34h,37h,38h,79h ;1Bh, "*b2m1478y" ; DB 30h,76h,36h,76h,81h,00h,0CFh,00h,00h,80h ;"0v6v", ... ; DB 36h,76h,81h,00h,0CFh,00h,00h,0C0h ;"6v", ... ; DB 36h,77h,81h,00h,0CFh,00h,00h,80h ;"6w", ... ; DB 30h,76h,36h,76h,81h,00h,0CFh,00h,00h,0C0h ;"0v6v", ... ; DB 36h,76h,81h,00h,0CFh,00h,00h,0C0h ;"6v", ... ; DB 36h,77h,81h,00h,0CFh,00h,00h,0C0h ;"6w", ... ; DB 30h,76h,36h,76h,81h,00h,0CFh,00h,00h,0C0h ;"0v6v", ... ; DB 30h,76h,36h,77h,81h,00h,0CFh,00h,00h,40h ;"0v6w", ... ; DB 31h,37h,39h,38h,59h ;"1798Y" sStopJob: DB 1Bh,45h,1Bh,25h,2Dh,31h,32h,33h,34h,35h,58h,1Bh,"E" ; DB 1Bh,2Ah,72h,43h,0Ch,1Bh,45h,1Bh,25h,2Dh,31h,32h,33h,34h,35h,58h sStopJobEnd: