BeginGUI EQU #C800

ScrPage  EQU 0
SuxPage  EQU 1
GUIPage  EQU 3
AddPage  EQU 4
PgnPage1 EQU 6
PgnPage2 EQU 7
RamPage  EQU 7

        ORG #C000,3
+       INCBIN "A:gui"

        ORG #6128

        INCLUDE "GuiVar",#40
        INCLUDE "ResGUI",#08

MAST    INCLUDE "UnHrip1",#41

Runner  LD A,GUIPage|#10
        LD (GUI_PAGE),A
        LD A,SuxPage|#10
        LD (STORE_PAGE),A
        LD A,#10
        LD (S_PAGE),A
        LD HL,Resident
        LD (ResAdr),HL

        LD A,%1111
hrp     LD IX,WHrp
        LD (IX+6),A
        LD A,Win
        CALL GUI
        CP #FF
        RET Z
        LD BC,TBHrp
        CALL TAB_HL
        JP (HL)
hrp__   CALL CLOSE
hrp_    LD A,%1101
        JR hrp    

TBHrp   DW OpenHrp
        DW OutHrp

OpenHrp LD HL,HRPB
        LD (TAB_SORT),HL
        LD A,Filer
        CALL GUI
        CP #FF
        JP Z,hrp__
        LD HL,(START_SEC)
        LD DE,ELIST
        XOR A
        CALL GET_CAT
        JP hrp__

OutHrp  LD HL,16
        LD (SpLen),HL
        LD HL,8
        LD (SpLenW),HL
        LD HL,12+4
        LD (SpLenD),HL
        LD HL,DopExt
        LD (SpDop),HL
        LD A,10
        LD (SpBar),A
        LD HL,ELIST
        LD (SpAdr),HL
        LD (SpAdrT),HL
        LD HL,Ret
        LD (SpDop2),HL
        LD HL,FSpisok
        SCF 
        EX AF,AF'
        LD A,Spisok
        CALL GUI
        JP hrp__

HRPB    DB 1,"hrp",#FF

DopExt  LD A,"."
        LD (DE),A
        INC DE
        LD A,FormExt
        CALL GUI_
        LD A," "
        LD (DE),A
        INC HL
        INC DE
        LD HL,(SpAdrT)
        LD BC,15
        ADD HL,BC
        LD A,(HL)
        LD C,0
        EX AF,AF'
        LD A,GET_NUM
        CALL GUI_
        RET 

FSpisok DB 13,14         ; ширина окна
        DW Nil           ; обработка кнопок
        DW Nil           ; обработка прерываний
        DB 11,4          ; X,Y скроллинга
        DB 10            ; сколько всего в окне
        DB 8             ; высота ползунка
        DW #0103         ; X,Y списка в окне
        DW TEXTFW        ; адрес текста

TEXTFW  DB "[nothing.hrp]",13
        DB 0

RAM     LD (S_PAGE),A
        OR #10
        LD BC,#7FFD
        OUT (C),A
        RET 

DOS_FUNC_
        EX AF,AF'
        LD A,DOS_FUNC
        JP GUI

WHrp    DB 3,3,8,8,2*8+7,7,%1111,0
        DW THrp
        DW SHrp
        DW #FFFF
THrp    DB "UnHrip",13
        DB "Открыть_",13
        DB "Вывести_",13
        DB "Скрин",13
        DB "Дисковод",0
SHrp    DB 1,3,6,1,%11
        DB 1,4,6,1,%11
        DB 1,5,6,1,%11
        DB 1,6,6,1,%11
        DB #FF

ELIST   DS 256*16

LEN     EQU $-MAST
        DISPLAY "Length: ",LEN

        ORG Runner

