Rev 194 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed | ?url?
;SAMPLE.H Пример программы, использующей оболочку.
;(C) Vitamin/CAIG/2001
;Опции проекта. Нужное раскомментировать, программа изменится
MODULE gui_sample
PUBLIC main11,LSTMHZ,putchar,puts,myint,getkey,winlog
EXTERN FONT6X8,broadcast,strip,recv_p,memtest,usb_test
EXTERN RX_BUF,mhz,update_main_menu,editbuf,sscanf
EXTERN miniterm
RSEG FREESEG
RSEG CODE
#define NOLOADFIL
#define NOSAVEFIL
#define NOMEMDRV
#define NOFILER
#define WIZ_BASE_ADDR 0X0000
;Цвета
#define ACTCOLOR 40
#define ACTPCOLR 6
#define WINCOLOR 5
#define HDRCOLOR 48
;Память
#define CPAGE1 66
#define DISKBUF 0xC000
#define LIST DISKBUF+0x900
#define LISTLEN 0x600
#define NUMLIST LIST+LISTLEN
;Файл макросов. ПОСЛЕ всех настроек
#include "MACROS.s01"
winlog:
push bc
push de
push ix
push iy
call logwinini
pop iy
pop ix
pop de
pop bc
ret
main11:
;Главное окно
push bc
push de
push ix
push iy
;call logwinini
PROGR_UPD
call update_main_menu
LD A,WIN_HEADER|WIN_REFRESH|WIN_MOVABLE
PROGR
LD IX,MAINWIN
LD (IX+4),A
CALL WAITKEY
CALL WINDOW
CP -1
jr Z,main11_quit
LD HL,MAINJP
JP TAB_JP
main11_quit:
pop iy
pop ix
pop de
pop bc
ret
MAINWIN DEFB 7,5,21,13
DEFB 15
DEFB 0
DEFW RX_BUF
DEFW MAINLGT
DEFW MAINHOT
DEFW -1
MAINLGT
DEFB 0,2,21,1, 7 ;WIN
DEFB 0,3,21,1, 7 ;SPR-BUTTON
DEFB 0,4,21,1, 7 ;FLAG
DEFB 0,5,21,1, 7 ;SWITCH
DEFB 0,6,21,1, 7 ;SCROLLBAR
DEFB 0,7,21,1, 7 ;SLIDER
DEFB 0,8,21,1, 7 ;LIST
DEFB 0,9,21,1, 7 ;FILER
DEFB 0,10,21,1, 7 ;COMBO
DEFB 0,11,21,1, 7 ;ASKER
DEFB -1
MAINHOT DEFB '0'
DEFW 0
DEFB '1'
DEFW 1
DEFB '2'
DEFW 2
DEFB '3'
DEFW 3
DEFB '4'
DEFW 4 ;"номер зоны"
DEFB '5' ;и
DEFW 5 ;прямой адрес перехода
DEFB '6' ;два способа
DEFW 6
DEFB '7'
DEFW 7
DEFB '8'
DEFW 8
DEFB '9'
DEFW 9
DEFB -1
MAINJP DEFW CHMHZ
DEFW EDITGAR
DEFW EDITSUBR
DEFW EDITSIPR
DEFW BROAD
DEFW RECVPACK
DEFW WIZMEMTST
DEFW SL811TEST
DEFW MINTERM
DEFW abaut_proc
abaut_proc
LD IX,abaut_win
CALL MAKEWIND
ld c,3
exx
ld hl,0x0202
ld bc,0x0606
ld de,nedo_qr
call PUT_SPRT
;ld c,2
;exx
;ld hl,0x0202
;ld bc,0x0606
;ld de,nedo_qr_attr
;call PUT_SPRT
CALL WAITKEY
CALL NOKEY
CALL CLOSE
JP PROGR_UPD
abaut_win
DEFB 10,10,10,9,7
DEFB 0
DEFW abaut_txt
DEFW -1
abaut_txt
DEFB ' nedopc.com',0
EDITGAR
ld hl,WIZ_BASE_ADDR+0x0010
jp get_ip
EDITSUBR
ld hl,WIZ_BASE_ADDR+0x0014
jp get_ip
EDITSIPR
ld hl,WIZ_BASE_ADDR+0x0018
jp get_ip
get_ip
push hl
LD IX,JUSTWIN
CALL MAKEWIND
CALL WAITKEY
LD DE,0x0101 ;оконные координаты
ld hl,editbuf
ld b,15
call EDIT
CALL CLOSE
ld hl,tmp_ip+3
push hl
dec hl
push hl
dec hl
push hl
dec hl
push hl
ld hl,strip
push hl
ld hl,editbuf
push hl
call sscanf
pop af
pop af
pop af
pop af
pop af
pop af
ld bc,0x82ab
in a,(c)
xor 0x08
out (c),a
ld hl,tmp_ip
pop de
ld bc,4
ldir
ld bc,0x82ab
in a,(c)
or 0x08
out (c),a
call CLOSE
JP PROGR_UPD
JUSTWIN DEFB 15,14,13,3,14
DEFB -1
tmp_ip DEFB 0,0,0,0,0
;----------------------------------------------------
BROAD
CALL CLOSE
call logwinini
call broadcast
call NOKEY
;CALL CLOSE
JP PROGR_UPD
;----------------------------------------------------
RECVPACK
CALL CLOSE
call logwinini
call recv_p
call NOKEY
;CALL CLOSE
JP PROGR_UPD
;----------------------------------------------------
MINTERM
CALL CLOSE
call logwinini
call miniterm
call NOKEY
;CALL CLOSE
JP PROGR_UPD
;выбор клока--------------------
CHMHZ
LD HL,LSTMHZ
LD DE,0x0b02 ;оконные координаты
CALL CAL_ABS ;в экранные
EX DE,HL
LD BC,0x0405 ;размер
EXX
LD DE,0x0304 ;параметры
EXX
LD A,H
LD H,L
LD L,A
XOR A
CALL COMBOBOX
CP -1
JR Z,CHMHZ_EXIT
ld (mhz),a
call update_main_menu
CHMHZ_EXIT:
LD A,WIN_HEADER|WIN_NOBACK|WIN_MOVABLE
JP PROGR
LSTMHZ DEFB '3.5',0
DEFB ' 7',0
DEFB ' 14',0
;-------------------------------------------
SL811TEST:
CALL CLOSE
call logwinini
call WAITKEY
call usb_test
JP PROGR_UPD
;-------------------------------------------
WIZMEMTST:
LD IX,PERMWIN
CALL WINDOW
push af
CALL CLOSE
CALL CLOSE
call logwinini
call WAITKEY
pop af
ld e,a
call memtest
JP PROGR_UPD
PERMWIN
DEFB 9,10,17,4,7
DEFB 0
DEFW PERMTEXT
DEFW PERMACT
DEFW PERMHOT
DEFW -1
PERMTEXT
DEFB ' Доступ по',13,13
DEFB ' [1]меммап [2]порты',0
PERMACT
DEFB 1,2,7,1,7
DEFB 9,2,7,1,7
DEFB -1
PERMHOT
DEFB '1'
DEFW 0
DEFB '2'
DEFW 1
DEFB -1
SPEED DEFB 5
SHOWDEL DEFB 255
;--------------------------------------
logwinini:
ld hl,0x0100
ld (YTXT),hl
ld (YWIN),hl
ld bc,0x2018
ld (YSIZ),bc
call CLS_WIN
ret
puts:
push ix
push iy
push de
push bc
ld h,d
ld l,e
ld c,0
call PRINTOLD
ld e,'\r'
call putchar
pop bc
pop de
pop iy
pop ix
ret
putchar:
push ix
push iy
push de
push bc
ld hl,putcharchar
ld (hl),e
ld c,0
call PRINTOLD
pop bc
pop de
pop iy
pop ix
ret
putcharchar:
DEFB 0,0
nedo_qr:
DEFB 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
DEFB 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x79, 0xFE, 0x00, 0x07
DEFB 0xE0, 0x00, 0x79, 0xFE, 0x00, 0x07, 0xE7, 0xFE, 0x67, 0xFE, 0x7F, 0xE7
DEFB 0xE7, 0xFE, 0x67, 0xFE, 0x7F, 0xE7, 0xE6, 0x06, 0x60, 0x7E, 0x60, 0x67
DEFB 0xE6, 0x06, 0x60, 0x7E, 0x60, 0x67, 0xE6, 0x06, 0x78, 0x1E, 0x60, 0x67
DEFB 0xE6, 0x06, 0x78, 0x1E, 0x60, 0x67, 0xE6, 0x06, 0x60, 0x7E, 0x60, 0x67
DEFB 0xE6, 0x06, 0x60, 0x7E, 0x60, 0x67, 0xE7, 0xFE, 0x67, 0x9E, 0x7F, 0xE7
DEFB 0xE7, 0xFE, 0x67, 0x9E, 0x7F, 0xE7, 0xE0, 0x00, 0x66, 0x66, 0x00, 0x07
DEFB 0xE0, 0x00, 0x66, 0x66, 0x00, 0x07, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF
DEFB 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xE1, 0x9E, 0x1E, 0x7E, 0x06, 0x1F
DEFB 0xE1, 0x9E, 0x1E, 0x7E, 0x06, 0x1F, 0xFE, 0x07, 0xE6, 0x06, 0x07, 0xE7
DEFB 0xFE, 0x07, 0xE6, 0x06, 0x07, 0xE7, 0xE1, 0x80, 0x1F, 0xE1, 0x9E, 0x67
DEFB 0xE1, 0x80, 0x1F, 0xE1, 0x9E, 0x67, 0xE6, 0x67, 0xE1, 0x86, 0x61, 0x87
DEFB 0xE6, 0x67, 0xE1, 0x86, 0x61, 0x87, 0xE1, 0x80, 0x1F, 0xE7, 0x99, 0xFF
DEFB 0xE1, 0x80, 0x1F, 0xE7, 0x99, 0xFF, 0xFF, 0xFF, 0xE6, 0x01, 0x9F, 0xE7
DEFB 0xFF, 0xFF, 0xE6, 0x01, 0x9F, 0xE7, 0xE0, 0x00, 0x66, 0x61, 0xE0, 0x1F
DEFB 0xE0, 0x00, 0x66, 0x61, 0xE0, 0x1F, 0xE7, 0xFE, 0x78, 0x1F, 0xE7, 0xFF
DEFB 0xE7, 0xFE, 0x78, 0x1F, 0xE7, 0xFF, 0xE6, 0x06, 0x78, 0x61, 0x81, 0x87
DEFB 0xE6, 0x06, 0x78, 0x61, 0x81, 0x87, 0xE6, 0x06, 0x67, 0x86, 0x07, 0xE7
DEFB 0xE6, 0x06, 0x67, 0x86, 0x07, 0xE7, 0xE6, 0x06, 0x79, 0x86, 0x66, 0x67
DEFB 0xE6, 0x06, 0x79, 0x86, 0x66, 0x67, 0xE7, 0xFE, 0x60, 0x61, 0x99, 0xFF
DEFB 0xE7, 0xFE, 0x60, 0x61, 0x99, 0xFF, 0xE0, 0x00, 0x60, 0x7E, 0x7F, 0x9F
DEFB 0xE0, 0x00, 0x60, 0x7E, 0x7F, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
DEFB 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
nedo_qr_attr:
DEFB 0x07, 0x07, 0x07, 0x07, 0x07, 0x07
DEFB 0x07, 0x07, 0x07, 0x07, 0x07, 0x07
DEFB 0x07, 0x07, 0x07, 0x07, 0x07, 0x07
DEFB 0x07, 0x07, 0x07, 0x07, 0x07, 0x07
DEFB 0x07, 0x07, 0x07, 0x07, 0x07, 0x07
DEFB 0x07, 0x07, 0x07, 0x07, 0x07, 0x07
#include "COVER.s01"
END