;НОВАЯ ВЕРСИЯ PRINT SREEN'А ДЛЯ	BGE3.01
;под ассемблер ZASM 3.10/11
;местами коментировано,	местами	нет.

      ORG  #A500

START LD   (RETAD+1),HL
      CALL EXAMP
      XOR  A
RETAD JP   #0000

EXAMP CALL #6006    ;карт.на экран
      CALL #603F    ;удал.из дискр.все
      LD   A,%1111  ;окна
EXAM  LD   IX,WIND0 ;окно
      LD   (IX+6),A
      LD   A,#01    ;вывести окно
      CALL #6000
      CP   #FF	    ;если #FF то
      RET  Z	    ;выход
      PUSH AF
      CP   7
      JR   NC,EXAM0
      CALL #6006    ;карт.на экран
EXAM0 POP  AF
      LD   BC,TABW0 ;адр.TAB_HL
      JP   #602A    ;выв.TAB_HL	и
		    ;перейти на	(HL)
RETT  CALL #6024    ;закр.окно
RETT_ LD   A,%1101  ;не	перерисовывать
      JR   EXAM

TABW0 DW LA9DD,LA950,LABE4,LAC2E,LABB1
      DW LAB8D,LACBC,LAA7A,LAF19,LB19F

WIND0 DB #04,#04,#10,#11,5*8,5
      DB %00001111,0
      DW TEXT0
      DW STWI0
      DW #FFFF
TEXT0 DB "Screen printer v.1.0",#0D
      DB "Black/White 0.25*0.33",#0D
      DB "Black/White 0.50*0.66",#0D
      DB "Black/White 1*1",#0D
      DB "Black/White 2*2",#0D
      DB "GreyScale 2*2",#0D
      DB "GreyScale 3*3",#0D,#0D
      DB "InkJet 360 dpi by EVP",#0D,#0D
      DB "Eject	paper",#0D
      DB "Setup",#0D,#0D
      DB "About	me",#00

STWI0 DB #00,#03,#10,#01,%11
      DB #00,#04,#10,#01,%11
      DB #00,#05,#10,#01,%11
      DB #00,#06,#10,#01,%11
      DB #00,#07,#10,#01,%11
      DB #00,#08,#10,#01,%11
      DB #00,#0A,#10,#01,%11
      DB #00,#0C,#10,#01,%11
      DB #00,#0D,#10,#01,%11
      DB #00,#0F,#10,#01,%11
      DB #FF
;--------------------------------------
     ;"Setup"
LAF19 LD   A,%1111
RAF19 LD   IX,WIND1  ;OKNO
      LD   (IX+6),A
      LD   A,#01     ;WIN
      CALL #6000
      CP   #FF
      JP   Z,RETT
      CP   #04
      JR   Z,FILO0
      CP   #0B
      JR   Z,SSET0
      JP   LAE06

BAF19 LD   A,%1101
      JP   RAF19

FILO0 LD   HL,SORT0
      CALL #6030    ;FilerE
      JP   C,BAF19
      LD   HL,#8000 ;BUFF
      LD   DE,LA803 ;куда реально
      LD   IX,(#5CEB) ;TR/SEC
      LD   BC,#0105 ;файл в 1 sec.читать
      LD   A,0	    ;стр.в памяти
      EX   AF,AF'
      LD   A,#0B    ;SL_BANK
      CALL #6000    ;GUI
      LD   HL,ENDD  ;буфер для имени
      LD   DE,LADFD ;куда реально
      CALL #6093    ;зап.тек.имя файла
      LD   HL,LADFD ;перенести
      LD   DE,TTEX1 ;имя в меню
      LD   BC,8
      LDIR
      INC  DE
      LD   BC,3
      LDIR
      JR   BAF19

SORT0 DB #00,#01,#FF

LADFD DB "отсутствует",#00

SSET0 LD   HL,NAME
      CALL #602D
      JP   C,LAE06
      LD   HL,#8000
      LD   DE,#A500
      LD   IX,ENDD-START
      LD   BC,#0D0B  ;прим.#0D секторов
      LD   A,0
      EX   AF,AF'
      LD   A,#0B
      CALL #6000
      JR   BAF19
	 ;12345678901
NAME  DB "ScrPrintadd",#00

WIND1 DB #06,#02,#0E,#14,#0F,#0F
      DB %00001111,0
      DW TEXT1 ;текст
      DW STWI1 ;подсветка (выборка)
      DW #0000 ;гор.клавиши
      DW #0000 ;кнопки	  (выборка)
      DW #0000 ;флаги
      DW RADW1 ;групп.кноп.
      DW #FFFF
TEXT1 DB "     SetUp",#0D
      DB "ZXLprint III	   ",#0D
      DB "Scorpion	   ",#0D
      DB "KAY-1024	   ",#0D
      DB "User's driver	   ",#0D
      DB "File:	"
TTEX1 DB "noname  .drv",#0D
      DB 15,#0D
      DB "Modes	ESC * m	   ",#0D
      DB "Modes	ESC K,L,Z  ",#0D,#0D
      DB "9 pin	printer	   ",#0D
      DB "24 pin printer   ",#0D,#0D
      DB "Normal	   ",#0D
      DB "Bold		   ",#0D
      DB 15,#0D
      DB "Save setup",#00

STWI1 DB #00,#03,#0E,#01,%11
      DB #00,#04,#0E,#01,%11
      DB #00,#05,#0E,#01,%11
      DB #00,#06,#0E,#01,%11
      DB #00,#07,#0E,#01,%11
      DB #00,#09,#0E,#01,%11
      DB #00,#0A,#0E,#01,%11
      DB #00,#0C,#0E,#01,%11
      DB #00,#0D,#0E,#01,%11
      DB #00,#0F,#0E,#01,%11
      DB #00,#10,#0E,#01,%11
      DB #00,#12,#0E,#01,%11
      DB #FF

RADW1 DB #0C,#03,#00,#04,#01
      DW DRIV0
RAD11 DB #0C,#09,#05,#02,#00
      DW MODE0
RAD12 DB #0C,#0C,#07,#02,#00
      DW PIN_0
RAD13 DB #0C,#0F,#09,#02,#00
      DW NORM0
      DB #FF

;--------------------------------------
     ;"About me"
LB19F LD   IX,WIND2 ;окно
      LD   A,#00    ;WINDOW
      CALL #6000
      LD   A,#0C    ;NOKEY
      CALL #6000
      LD   A,#0D    ;WAITKEY
      CALL #6000
      JP   RETT

WIND2 DB #04,#06,#10,#0E,#0F,#0F
      DB %00001111,0
      DW TEXT2
      DW #FFFF
TEXT2 DB "Screen printer ver.1.0",#0D
      DB "SABHAR Inc Ltd (C)(R)	",#0D
      DB "Edition by 17.05.2001	",#0D
      DB #0D
      DB "    St.Peterburg"	 ,#0D
      DB " ZXNet: 500:812/08.41" ,#0D
      DB 15,#0D
      DB "  оригинальная идея"	 ,#0D
      DB "    и	часть кода:"	 ,#0D
      DB " Valerij Kozhevnikoff" ,#0D
      DB "  500:95/468.2@ZXNet "
      DB #00,#FF
;--------------------------------------
     ;"File: noname  .p	"
     ;"Save setup"
LAE06 LD   IX,LAE21 ;окно
      LD   A,#00    ;WINDOW
      CALL #6000
      LD   A,#0C    ;NOKEY
      CALL #6000
      LD   A,#0D    ;WAITKEY
      CALL #6000
      CALL #6024
      JP   BAF19

LAE21 DB #04,#09,#0E,#04,#17,#17
      DB %00001110,0
      DW TAE21
      DW #FFFF
TAE21 DB "  В данной версии",#0D
      DB "  не реализовано!"
      DB #00,#FF
;--------------------------------------
DRIV0 LD   A,(RADW1+4)
      CP   0
      JR   Z,LAD53
      CP   1
      JR   Z,LAD6A
      CP   2
      JR   Z,LAD81
      CP   3
      JR   Z,LADAA
      RET
;--------------------------------------
     ;"ZXLprint	III	"
LAD53 LD   HL,LB291	 ;DRIV
      LD   (LB273),HL
      LD   HL,LB27F	 ;INIT
      LD   (LB27D),HL
      RET

     ;"Scorpion		"
LAD6A LD   HL,LB2AF	 ;DRIV
      LD   (LB273),HL
      LD   HL,LB282	 ;INIT
      LD   (LB27D),HL
      RET

     ;"KAY-1024		"
LAD81 LD   HL,LB2D5	 ;DRIV
      LD   (LB273),HL
      LD   HL,LB283	 ;INIT
      LD   (LB27D),HL
      RET

     ;"User's driver	"
LADAA LD   HL,LA805	 ;DRIV
      LD   (LB273),HL
      LD   HL,LA803	 ;INIT
      LD   (LB27D),HL
      LD   HL,LADFD ;перенести
      LD   DE,TTEX1 ;имя в меню
      LD   BC,8
      LDIR
      INC  DE
      LD   BC,3
      LDIR
      RET
;--------------------------------------
MODE0 LD   A,(RAD11+4)
      CP   0
      JR   Z,LAE63
      CP   1
      JR   Z,LAE88
      RET
;--------------------------------------

     ;"Modes ESC * m	"
LAE63 LD   HL,#012A
      LD   (LAB47),HL
      LD   (LAB3B),HL
      LD   HL,#052A
      LD   (LAB5A),HL
      LD   (LAB60),HL
LAE75 LD   HL,#032A
      LD   (LAB35),HL
      RET

     ;"Modes ESC K,L,Z	"
LAE88 LD   A,(RAD12+4)
      CP   1
      JR   NZ,MAE88
      XOR  A
      LD   (RAD11+4),A
      RET
MAE88 LD   HL,#FE5A
      LD   (LAB35),HL
      LD   HL,#FE4C
      LD   (LAB47),HL
      LD   (LAB3B),HL
      DEC  L
      LD   (LAB5A),HL
      LD   (LAB60),HL
      RET
;--------------------------------------
PIN_0 LD   A,(RAD12+4)
      CP   0
      JR   Z,LAEB3
      CP   1
      JR   Z,LAED2
      RET
;--------------------------------------
     ;"9 pin printer	"
LAEB3 LD   HL,LB26F
      LD   (LB26D),HL
      LD   A,0
      LD   (RAD13+4),A
      LD   A,(RAD11+4)
      CP   0
      JR   Z,LAE63    ;ESC * m
      JR   LAE88      ;ESC K,L,Z

     ;"24 pin printer	"
LAED2 LD   A,0
      LD   (RAD11+4),A
      LD   (RAD13+4),A
      LD   HL,#212A
      LD   (LAB47),HL
      LD   (LAB3B),HL
      LD   HL,#262A
      LD   (LAB60),HL
      LD   HL,#202A
      LD   (LAB5A),HL
      LD   HL,LB30C
      LD   (LB26D),HL
      JP   LAE75       ;ESC * m/
;--------------------------------------
NORM0 LD   A,(RAD13+4)
      CP   0
      JR   Z,LAEFA
      CP   1
      JR   Z,LAF06
      RET
;--------------------------------------
     ;"Normal		"
LAEFA
      RET

     ;"Bold		"
LAF06 LD   A,(RAD12+4)	;только	для
      CP   0		;24-pin
      JR   NZ,NAF06
      LD   A,0
      LD   (RAD13+4),A
      RET
NAF06
      RET
;--------------------------------------

LA94A LD   SP,#0000
LA94B EQU  $-#0002
      JP   EXAMP

     ;"Black/White 0.50*0.66"
LA950 LD   (LA94B),SP
      CALL LB27C
      LD   HL,LAB27
      CALL LAA42
      LD   HL,#4000
      LD   B,#10
LA962 PUSH BC
      PUSH HL
      LD   B,#03
LA966 PUSH BC
      PUSH HL
      PUSH HL
      LD   A,B
      LD   (LA98F),A
      CALL LA9D7
      POP  HL
      LD   B,#20
LA973 PUSH BC
      LD   B,#08
LA976 PUSH HL
      LD   D,#00
      LD   C,#04
LA97B PUSH BC
      LD   A,(HL)
LA97D RRA
      DJNZ LA97D
      RL   D
      AND  A
      RL   D
      LD   B,#02
      CALL LAA39
      POP  BC
      DEC  C
      JR   NZ,LA97B
      LD   A,#00
LA98F EQU  $-#0001
      RRA
      LD   A,D
      JR   C,LA996
      SRL  A
LA996 CALL LB26C
      POP  HL
      DJNZ LA976
      INC  HL
      POP  BC
      DJNZ LA973
      CALL LAA50
      LD   A,(LA98F)
      POP  HL
      CP   #03
      JR   Z,LA9B1
      CP   #02
      JR   Z,LA9B8
      JR   LA9BB

LA9B1 LD   B,#02
      CALL LAA39
      JR   LA9BB

LA9B8 CALL LAA6B
LA9BB POP  BC
      DJNZ LA966
      CALL LAA55
      POP  HL
      LD   B,#04
      CALL LAA39
      LD   A,#20
      ADD  A,L
      LD   L,A
      JR   NC,LA9D1
      LD   A,H
      ADD  A,#08
      LD   H,A
LA9D1 POP  BC
      DJNZ LA962
      JP   EXAMP

LA9D7 LD   HL,LAB3A
      JP   LAA42

     ;"Black/White 0.25*0.33"
LA9DD LD   (LA94B),SP
      CALL LB27C
      LD   HL,LAB27
      CALL LAA42
      LD   HL,#4000
      LD   B,#08
LA9EF PUSH BC
      PUSH HL
      LD   B,#03
LA9F3 PUSH BC
      PUSH HL
      PUSH HL
      CALL LAA3F
      POP  HL
      LD   B,#20
LA9FC PUSH BC
      LD   B,#08
LA9FF PUSH HL
      LD   C,#08
LAA02 PUSH BC
      LD   A,(HL)
LAA04 RRA
      DJNZ LAA04
      RL   D
      LD   B,#03
      CALL LAA39
      POP  BC
      DEC  C
      JR   NZ,LAA02
      LD   A,D
      CALL LB26C
      POP  HL
      DJNZ LA9FF
      INC  HL
      POP  BC
      DJNZ LA9FC
      CALL LAA50
      POP  HL
      INC  H
      POP  BC
      DJNZ LA9F3
      CALL LAA55
      POP  HL
      LD   A,#60
      ADD  A,L
      LD   L,A
      JR   NC,LAA33
      LD   A,#08
      ADD  A,H
      LD   H,A
LAA33 POP  BC
      DJNZ LA9EF
      JP   EXAMP

LAA39 CALL LAA5A
      DJNZ LAA39
      RET

LAA3F LD   HL,LAB34
LAA42 LD   A,(HL)
      CP   #FF
      RET  Z
      CP   #FE
      JR   Z,LAA4D
      CALL LB26F
LAA4D INC  HL
      JR   LAA42

LAA50 LD   HL,LAB2A
      JR   LAA42

LAA55 LD   HL,LAB2F
      JR   LAA42

LAA5A INC  H
      LD   A,H
      AND  #07
      RET  NZ
      LD   A,L
      ADD  A,#20
      LD   L,A
      AND  #E0
      RET  Z
      LD   A,H
      SUB  #08
      LD   H,A
      RET

LAA6B LD   A,H
      DEC  H
      AND  #07
      RET  NZ
      LD   A,L
      SUB  #20
      LD   L,A
      RET  C
      LD   A,H
      ADD  A,#08
      LD   H,A
      RET

     ;"Eject paper"
LAA7A LD   (LA94B),SP
      CALL LB27C
      LD   HL,LAB4C
      CALL LAA42
      JP   EXAMP

LAA8A CALL LAB0A
      LD   IY,#5C3A
      LD   B,#00
      LD   (IY+#32),B
      LD   (IY+#33),#C0
      LD   (IY+#34),B
LAA9D LD   HL,LAB46
      CALL LAA42
LAAA3 LD   A,(IY+#32)
      RLA
      RLA
      RLA
      AND  #F8
      LD   C,A
      LD   A,(IY+#33)
      DEC  A
      CALL #22B0
      LD   A,(HL)
      EX   AF,AF'
      LD   A,H
      RRCA
      RRCA
      RRCA
      AND  #03
      OR   #58
      LD   H,A
      EX   AF,AF'
      LD   B,(IY+#34)
      INC  B
LAAC3 RLA
      DJNZ LAAC3
      PUSH AF
      CALL LAB10
      POP  AF
      PUSH DE
      RLA
      CALL LAB10
      POP  HL
      LD   B,#05
LAAD2 EQU  $-#0001
LAAD3 LD   A,(HL)
      AND  #E0
LAAD5 EQU  $-#0001
      LD   C,A
      LD   A,(DE)
      AND  #1C
LAAD9 EQU  $-#0001
      OR   C
      INC  DE
      INC  HL
      CALL LB26C
      DJNZ LAAD3
      DEC  (IY+#33)
      JR   NZ,LAAA3
      LD   (IY+#33),#C0
      LD   HL,LAB50
      CALL LAA42
      LD   A,(IY+#34)
      INC  A
      INC  A
      AND  #07
      LD   (IY+#34),A
      JR   NZ,LAA9D
      INC  (IY+#32)
      LD   A,(IY+#32)
      CP   #20
      JR   NZ,LAA9D
      JP   EXAMP

LAB0A LD   HL,LAB40
      JP   LAA42

LAB10 PUSH HL
      LD   A,(HL)
      JR   C,LAB17
      RRA
      RRA
      RRA
LAB17 AND  #07
      LD   E,A
      ADD  A,A
      ADD  A,A
      ADD  A,E
      LD   E,A
      LD   D,#00
      LD   HL,LAB65
      ADD  HL,DE
      POP  DE
      EX   DE,HL
      RET

LAB27 DB #1B,#40,#FF	;иниц.принтера
LAB2A DB #1B,#4A,#01,#0D;перем.бумаги
      DB #FF		;вперед	на n/216
LAB2F DB #1B,#4A,#15,#0D;--||--
      DB #FF
LAB34 DB #1B		;граф.реж.8 игл
LAB35 DB #2A,#03
      DB #00
      DB #01,#FF
LAB3A DB #1B		;граф.реж.8 игл
LAB3B DB #2A,#01
      DB #00
      DB #01,#FF
LAB40 DB #1B,#40,#1B,#41;иниц.+	интерв.
LAB44 DB #06,#FF
LAB46 DB #1B
LAB47 DB #2A,#01	;граф.реж.8 игл
LAB49 DB #C0,#03
      DB #FF
LAB4C DB #0C,#07,#18,#FF;зв,форм,отм.стр
LAB50 DB #0D,#0A,#FF	;стр./кар.
LAB53 DB #1B,#40,#1B,#33;иниц.+интерв.
      DB #18,#FF
LAB59 DB #1B		;граф.реж.8 игл
LAB5A DB #2A,#05
      DB #00
      DB #01,#FF
LAB5F DB #1B		;граф.реж.8 игл
LAB60 DB #2A,#05
      DB #00
      DB #02,#FF
LAB65 DB #FF,#FF,#FF,#FF,#FF
      DB #48,#FC,#6C,#FC,#FC
      DB #D8,#B4,#6C,#D8,#6C
      DB #48,#FC,#B4,#48,#FC
      DB #B4,#48,#B4,#48,#B4
      DB #48,#90,#24,#90,#24
      DB #00,#B4,#48,#00,#48
      DB #00,#00,#00,#00,#00

     ;"GreyScale 3*3"
LAB8D LD   (LA94B),SP
      CALL LB27C
      LD   A,#05
      LD   (LAAD2),A
      LD   A,#E0
      LD   (LAAD5),A
      LD   A,#1C
      LD   (LAAD9),A
      LD   A,#06
      LD   (LAB44),A
      LD   HL,#03C0
      LD   (LAB49),HL
      JP   LAA8A

     ;"GreyScale 2*2"
LABB1 LD   (LA94B),SP
      CALL LB27C
      LD   A,#03
      LD   (LAAD2),A
      LD   A,#C0
      LD   (LAAD5),A
      LD   A,#30
      LD   (LAAD9),A
      LD   A,#04
      LD   (LAB44),A
      LD   HL,#0240
      LD   (LAB49),HL
      JP   LAA8A

LABD5 LD   C,#08
LABD7 PUSH BC
      LD   A,(HL)
LABD9 RRA
      DJNZ LABD9
      RL   D
      INC  H
      POP  BC
      DEC  C
      JR   NZ,LABD7
      RET

     ;"Black/White 1*1"
LABE4 LD   (LA94B),SP
      CALL LB27C
      LD   HL,LAB53
      CALL LAA42
      LD   B,#18
      LD   HL,#4000
LABF6 PUSH BC
      PUSH HL
      LD   HL,LAB59
      CALL LAA42
      POP  HL
      PUSH HL
      LD   B,#20
LAC02 PUSH BC
      PUSH HL
      LD   B,#08
LAC06 PUSH HL
      PUSH BC
      LD   D,#00
      CALL LABD5
      LD   A,D
      CALL LB26C
      POP  BC
      POP  HL
      DJNZ LAC06
      POP  HL
      INC  HL
      POP  BC
      DJNZ LAC02
      LD   HL,LAB50
      CALL LAA42
      POP  HL
      LD   A,H
      ADD  A,#07
      LD   H,A
      CALL LAA5A
      POP  BC
      DJNZ LABF6
      JP   EXAMP

     ;"Black/White 2*2"
LAC2E LD   (LA94B),SP
      CALL LB27C
      LD   HL,LAB53
      CALL LAA42
      LD   B,#18
      LD   HL,#4000
LAC40 PUSH BC
      PUSH HL
      LD   HL,LAB5F
      CALL LAA42
      POP  HL
      PUSH HL
      LD   A,#A7
      LD   (LAC8A),A
      CALL LAC7C
      LD   HL,LAB50
      CALL LAA42
      LD   HL,LAB5F
      CALL LAA42
      POP  HL
      PUSH HL
      LD   A,#37
      LD   (LAC8A),A
      CALL LAC7C
      LD   HL,LAB50
      CALL LAA42
      POP  HL
      LD   A,H
      ADD  A,#07
      LD   H,A
      CALL LAA5A
      POP  BC
      DJNZ LAC40
      JP   EXAMP

LAC7C LD   B,#20
LAC7E PUSH BC
      PUSH HL
      LD   B,#08
LAC82 PUSH HL
      PUSH BC
      LD   D,#00
      CALL LABD5
      LD   A,D
LAC8A AND  A
      JR   C,LAC91
      RRA
      RRA
      RRA
      RRA
LAC91 LD   D,A
      LD   E,A
      XOR  A
      RR   D
      RRA
      RR   E
      RRA
      RR   D
      RRA
      RR   E
      RRA
      RR   D
      RRA
      RR   E
      RRA
      RR   D
      RRA
      RR   E
      RRA
      CALL LB26C
      CALL LB26C
      POP  BC
      POP  HL
      DJNZ LAC82
      POP  HL
      INC  HL
      POP  BC
      DJNZ LAC7E
      RET

     ;"InkJet 360 dpi by EVP"
LACBC LD   (LA94B),SP
      CALL LACC6
      JP   EXAMP

LACC6 CALL LB27C
      LD   HL,#4000
      LD   YH,#04
      LD   A,#1B ;выдается последова-
      CALL LAD41 ;тельность для	принтера
      LD   A,#2B ;#1B,#2B,#30
      CALL LAD41 ;и
      LD   A,#30 ;#1B,#2A,#49,#00,#01
      CALL LAD41 ;
LACDE LD   A,#1B ;теоретически это
      CALL LAD41 ;должно заставить
      LD   A,#2A ;принтер печатать
      CALL LAD41 ;с разрешенем
      LD   A,#49 ; 360x360dpi
      CALL LAD41
      LD   A,#00
      CALL LAD41
      LD   A,#01
      CALL LAD41
      PUSH HL
      LD   YL,#20
LACFB LD   D,#80
      LD   B,#08
LACFF LD   XH,B
      PUSH HL
      LD   B,#06
LAD04 LD   XL,B
      CALL LAD31
      LD   B,XL
      DJNZ LAD04
      POP  HL
      LD   B,XH
      SRL  D
      DJNZ LACFF
      INC  HL
      DEC  YL
      JR   NZ,LACFB
      LD   A,#0D
      CALL LAD41
      LD   A,#0A
      CALL LAD41
      POP  HL
      LD   B,#30
LAD26 CALL LAD44
      DJNZ LAD26
      DEC  YH
      RET  Z
      JP   LACDE

LAD31 LD   B,#08
LAD33 LD   A,D
      AND  (HL)
      SCF
      JR   NZ,LAD39
      CCF
LAD39 RL   E
      CALL LAD44
      DJNZ LAD33
      LD   A,E
LAD41 JP   LB26F

LAD44 INC  H
      LD   A,H
      AND  #07
      RET  NZ
      LD   A,L
      ADD  A,#20
      LD   L,A
      RET  C
      LD   A,H
      SUB  #08
      LD   H,A
      RET

LB26C JP   LB26F
LB26D EQU  $-#0002

LB26F PUSH AF
      PUSH BC
      PUSH HL
      CALL LB2AF
LB273 EQU  $-#0002
      JP   C,LA94A
      POP  HL
      POP  BC
      POP  AF
      RET

LB27C JP   LB282
LB27D EQU  $-#0002

;--------------------------------------
;встроенные драйвера принтера

LB27F XOR  A	     ;INIT LPR.III
      OUT  (#FB),A
LB282 RET	     ;INIT SCORP

LB283 LD   BC,#FFFD  ;INIT KAY
      LD   A,#07
      OUT  (C),A
      LD   A,#FF
      LD   B,#BF
      OUT  (C),A
      RET

     ;LPRINT-III  DRIVER
LB291 OUT  (#FB),A
      LD   E,A
LB294 CALL #6033 ;опрос	на CANCEL
      RET  C
      IN   A,(#7B)
      RLCA
      JR   C,LB294
      NOP
      NOP
      DI
      LD   A,E
      OUT  (#7B),A
      NOP
      NOP
      NOP
      NOP
      OUT  (#FB),A
      AND  A
      EI
      RET

     ;SCORPION	  DRIVER
LB2AF LD   BC,#FFDD
      OUT  (C),A
LB2B4 CALL #6033 ;опрос	на CANCEL
      RET  C
      LD   A,#FF
      IN   A,(#FE)
      RLCA
      JR   C,LB2B4
      NOP
      NOP
      DI
      LD   BC,#1FFD
      LD   A,#20
      OUT  (C),A
      NOP
      NOP
      NOP
      NOP
      XOR  A
      OUT  (C),A
      EI
      RET

     ;KAY-1024	 DRIVER
LB2D5 LD   E,A
LB2D6 CALL #6033  ; опрос на CANCEL
      RET  C
      LD   A,#FF
      IN   A,(#FE)
      RLCA
      JR   C,LB2D6
      DI
      LD   A,#07
      LD   BC,#FFFD
      OUT  (C),A
      LD   A,#FF
      LD   B,#BF
      OUT  (C),A
      LD   A,#0E
      LD   B,#FF
      OUT  (C),A
      LD   A,E
      LD   B,#BF
      OUT  (C),A
      LD   B,#1F
      LD   A,#20
      OUT  (C),A
      NOP
      NOP
      NOP
      NOP
      XOR  A
      OUT  (C),A
      EI
      RET
;--------------------------------------
;для 24-игольного принтера

LB30C PUSH AF
      LD   A,(RAD13+4) ;если вкл.NORMAL
      CP   0	       ;то здесь
      JR   NZ,LB362    ;иначе там
      POP  AF
      PUSH HL
      PUSH BC
      LD   HL,#0000
      LD   B,L
      RLCA
      RL   H
      RL   H
      RL   H
      RLCA
      RL   H
      RL   H
      RL   H
      RLCA
      RL   H
      RL   H
      RL   L
      RLCA
      RL   L
      RL   L
      RL   L
      RLCA
      RL   L
      RL   L
      RL   L
      RLCA
      RL   L
      RL   B
      RL   B
      RLCA
      RL   B
      RL   B
      RL   B
      RLCA
      RL   B
      RL   B
      RL   B
LB353 LD   A,H
      CALL LB26F
      LD   A,L
      CALL LB26F
      LD   A,B
      CALL LB26F
      POP  BC
      POP  HL
      RET

LB362 POP  AF
      PUSH HL
      PUSH BC
      LD   HL,#0000
      LD   B,L
      RLCA
      RL   H
      RRC  H
      RLC  H
      RL   H
      RRC  H
      RLC  H
      RL   H
      RRC  H
      RLC  H
      RLCA
      RL   H
      RRC  H
      RLC  H
      RL   H
      RRC  H
      RLC  H
      RL   H
      RRC  H
      RLC  H
      RLCA
      RL   H
      RRC  H
      RLC  H
      RL   H
      RRC  H
      RLC  H
      RL   L
      RRC  L
      RLC  L
      RLCA
      RL   L
      RRC  L
      RLC  L
      RL   L
      RRC  L
      RLC  L
      RL   L
      RRC  L
      RLC  L
      RLCA
      RL   L
      RRC  L
      RLC  L
      RL   L
      RRC  L
      RLC  L
      RL   L
      RRC  L
      RLC  L
      RLCA
      RL   L
      RRC  L
      RLC  L
      RL   B
      RRC  B
      RLC  B
      RL   B
      RRC  B
      RLC  B
      RLCA
      RL   B
      RRC  B
      RLC  B
      RL   B
      RRC  B
      RLC  B
      RL   B
      RRC  B
      RLC  B
      RLCA
      RL   B
      RRC  B
      RLC  B
      RL   B
      RRC  B
      RLC  B
      RL   B
      RRC  B
      RLC  B
      JP   LB353

     ;место под	внешний	драйвер	принтера
LA803 DB #C9,#00 ;256 байт
LA805 DB #C9,#00
      DB #0D,"НЕТ ВНЕШНЕГО ДРАЙВЕРА",#0D
      DS 230
ENDD
;------------ END FILE ---------------
