|
8BIT OPERATING SYSTEM FOR ZX-SPECTRUM
\history \doors2000
DOORS 2000 (a part 2)
(Year 2000, the wind of the changes which have broken a roof, at all..)
COMPONENTS D2K
(Standard elements of the script)
To begin the review of components D2K I has solved with WINDOW. We already mentioned it, when considered an example of the script. However here costs will stop in more detail as window it not simply component, is an initial component which sets work of the appendix. Therefore construction should be begun with it. By the way it is completely not obligatory to use a standard window, it is possible to create the, but about it a little below ?
-9,8 - the address of procedure of synchronization (0 - standard) That such synchronization, moreover and standard? The answer is very simple - standard synchronization is = mSYNC address. If to look it in kernale except for command RET, we there shall find nothing;) Now for what? It is reserved under the further expansion of system, suddenly you will want to write MULTICOLOR STUDIO under D2K.
-7,6 - the address of procedure of processing of the keyboard (0 - standard). About principles of work with the keyboard, we spoke above i.e. as there is a management of the cursor and as it will be switched to a mode of input of the text. That gives out standard obrabotchik keyboards you will find in the appendix, and here is how to write the obrabotchik we shall consider in the chapter - the components under d2k.
Here these two items of heading (-9,8 and-7,6) the component window differs from other components d2k.
Further the standard heading for all components follows:
-5,4 - the address of processing of events (event). I already spoke above that if we do not have any events that it is possible to specify a cell with command RET. But if we want, that our window would start to compete a mousy here it is necessary to specify a place in kernale mWINMOVE.
-3 - the mask of events (event) on what to react. The list event'ia has been described above, and here I shall add that while here will be 0 the window cannot compete, for normal work it is enough to put 4.
-2,1 - the address of a following element (*0000 - there are no elements). I shall leave without comments.
On it the standard heading comes to an end, and the description characteristic only for a component window further follows:
+1 - coordinate X (a)
+2 - coordinate Y (p) It should be multiple 8!
+3 - the size on X (a)
+4 - the size on Y (p) It should be multiple 8!
+5 - attributes of all window
+6 - attributes of heading windows (strip). Yes not muchatsja in the further with selection of color scale, in the appendix it is possible to find the table with color codes.
+7,8,9 - it is reserved under needs of system.
+10 - heading of a window terminating a code *00.
FUNCTIONS WINDOW:
About functions of components, we still shall talk in more detail. Here I while shall simply list them:
*00 - gives out coordinates in HL for a press of buttons
*01 - correction of coordinates
At once I wish you to warn, that initially again created window has no button ' x ' closing! And that that it is represented is reached by this here a command.
+1 - displacement from a right edge-X (a) 0 - to not be displaced anywhere.
+2 - type of the button (*00 - close, *01 - minimize, *FF - the button)
+3 - attributes of the button (*00 - without attributes)
If the button:
+4, 5 - ni?aeoa address of the wrung out button (8x8 pix)
+6, 7 - ni?aeoa address of the pressed button (8x8 pix)
Example of creation of buttons:
| The Code *00
| | The Code *01
| | The Code *FF
|
01 | BORDER (type 1: shadow) |
Border is a frame inside of a window, or speaking easier a framework. Anything complex in their description is not present, except for perhaps some people, but on them we shall stop in more detail.
+1 - coordinate X (a)
+2 - coordinate Y (p)
+3 - the size on X (a)
+4 - size Y (p) not less than 8!
02 | BORDER (type 2: shaggy) |
+1 - coordinate X (a)
+2 - coordinate Y (p)
+3 - the size on X (a)
+4 - size Y (p) not less than 8!
+1 - coordinate X (a)
+2 - coordinate Y (p)
+3 - the size on X (a)
+4 - size Y (p) not less than 8!
07 | BORDER (type 4: personal) |
If you did not accept for whatever reasons three top types ramok, you can create an own framework. For this purpose you need to set only descriptors of elements.
+1 - coordinate X (a)
+2 - coordinate Y (p)
+3 - the size on X (a)
+4 - the size on Y (p)
+5,6 - the address given (6*3=18 byte)
If in +5 = 0 data begin with +7
+7 - Given ?.
For above specified framework, the example of a writing of the script will be such.
04 | PRINT TEXT (type: proportional) |
Well here gradually we have approached to functions of a conclusion of the text. Their two: a press a proportional font (8x8 max) and a press a font 5x5
+1 - coordinate X (p)
+2 - coordinate Y (p)
+3 - it is reserved under needs of system *00
+4 - the text, coming to an end a code *00
Coordinates of a press of the text are set in pix and the coordinate (0,0) corresponds to the left top corner of a window. At a press State that alternative coding or as it still name CP866. (It you is used will find in the appendix). Exception makes a code *01 - Invers. It works by a principle of the trigger, i.e. having met a code *01, kernal changes a condition of register A ' (the alternative accumulator), on opposite. If A ' =0 that a normal press, if A ' =1 - a negative. From operating codes are used *0D - translation of a line, and *00 - the end of the text.
05 | PRINT TEXT (type: 5x5) |
+1 - coordinate X (p)
+2 - coordinate Y (p)
+3 - it is reserved, *00
+4 - the text, coming to an end a code *00
Above told about a press a proportional font, it is possible to carry all and for printing a font 5x5. C that difference that, symbols of Russian and English small letters are replaced with font ITALIK, but the size 5x5, as well as greater letters. (examples of fonts in the appendix)
06 | BUTTON (type: standart) |
+1 - coordinate X (a)
+2 - coordinate Y (p)
+3 - the size on X (a)
+4 - the size on Y (p)
+5 - BIT7 (it is equal: the 0-normal, 1-pressed button), BIT6 (?aaai:0-standard, 1-user procedure of processing)
+6 - ATTR (*00 - without attributes)
+7 - the text, coming to an end a code *00
Functions of the button:
0 - to press the button
1 - to release the button
You probably have already paid attention that in the text " CLICK HERE " instead of a blank there is a same structure as well as on all buttons. It is reached by application instead of a code *20 (blank) - a code *1F. (you can find a set of all symbols in the appendix). As all rules as for a press with a font 5x5 here operate: at a press State that alternative coding or as it still name CP866 is used. Exception makes a code *01 - Invers. It works by a principle of the trigger, i.e. having met a code *01, kernal changes a condition of register A ' (the alternative accumulator), on opposite. If A ' =0 that a normal press, if A ' =1 - a negative. From operating codes it is used *00 - the end of the text. Symbols of Russian and English small letters are replaced with font ITALIK, but the size 5x5, as well as greater letters.
08 | Border (type: selected) |
+1 - coordinate X (a)
+2 - coordinate Y (p)
+3 - the size on X (a)
+4 - the size on Y (p)
+5 - quantity take in
+6 - current "ear" (it is considered from 0 ?)
+7 - BIT7 (it is equal: 0 - to not erase inside of "ear", 1 - to erase), BIT6 (it is equal: 0 - standard, 1-user procedure of processing)
+8 - reserved (here then kernal registers length of one "ear")
+9,10 - basically reserved, but if standard procedure of processing is used, here it is possible to specify the address of elements for a window if here to specify 0 will be considered that elements will begin with +11.
+11,12 - if the user procedure of processing, IN is used: A - number of "ear", in HL - the address of the text, coming to an end a code *00. Here again ?
+13,14 - the address of procedure at copying IN: And - number of "ear" which should become current.
If standard procedure of processing the format of elements of a window will be such:
Begin: the Address of an element - 2 bajta
The text, coming to an end a code *00
The address of an element - 2 bajta
The text, coming to an end a code *00
-------------------//-----------------------
-------------------//-----------------------
i.t.d.
Further I shall give an example an initial code which opens the above-stated window.
BA03 | DW RET_I
DB 1
DW 0
DB 8
DB 0,24,19,8*12
DB 3,0
DB %00000000
DB 0
DB 0,0
DW BU01
DB "LEFT", *00
DW BU02
DB "CENTER", *00
DW BU03
DB "RIGHT", *00 | ; It is necessarily necessary!
; Differently ears Will not be switched
; A code ears
; The sizes and coordinates
; 3-?e an ear, 0 current
; All is standard
; reserved
; Data will begin right now +11
;----------------------------------
; The beginning of given
; Address first podstsenarija
; The name of an ear
; Address second podstsenarija
; The name of an ear
; Address third podstsenarija
; The name of an ear |
Further in BU01, BU02, BU03 a standard format of the script, with the termination of elements by a code *0000
BU02 | DW RET_I
DB 1
DW 0
DB 6
DB 5,64,8,16
DB %00000000
DB *31
DB "CENTER", *00
| ; the standard button
; With name CENTER |
10 | ScrollBar (type: standart) |
+1 - coordinate X (a)
+2 - coordinate Y (p)
+3 - the size on Y (p)
+4 - a flag:
BIT7 - (it is equal: it 0-is impossible to hold for a roller, it 1-is possible)
BIT6 - (it is equal: 0-arrows are not present, the 1-arrow is visible)
BIT5 - (it is equal: 0-c attributes, 1 - without attributes)
BIT4 - (it is equal: there is a procedure of initialization before vyrisovkoj, 1 - is not present)
BIT3 - (it is equal: 0-standard obrabotchik, 1 - the)
+5,6 - Quantity of all elements (max 32768)
+7,8 - the Current element
+9,10 - Elements it is visible on the screen
+11,12 - the Address of procedure which is caused at vyrisovke a roller
+13,14 - the Address of procedure which is caused at copying a roller
+15,16 - the Address of procedure which is caused at UP Scroll
+17,18 - the Address of procedure which is caused at DOWN Scroll
+19,20 - Reserved
+21 - ATTR buttons
+22 - ATTR a roller
+23,24 - it is unessential (the Address of procedure of initialization)
Functions of a roller:
00 - To draw again a roller
01 - Vyrisovat buttons (reg. B bit 0-1y the button: 0-off, 1-on, bit1 - 2y the button: 0-off, 1 on)
02 - Standard performance
Well here we also have approached to one of the most interesting elements - scrollbar, or simply roller. Than it is interesting? Well first not one program as a matter of fact does not do without help'a, and scrollbar noticeably facilitates a life at creation any listalki. Well it so the lyrical introduction:) Now about realization of idea ?.
Generally as you have already understood that the roller is all a graphic element, instead of a ready viewer and consequently you independently should write procedures skrollinga the text or schedules up and down. And here from that what you choose a method, final appearance - 50 fps will depend or it all will be derganym and will be terrible tormozzzzit: (the Element scrollbar will be to you the assistant in a graphic part, so about all under the order ?.
Let's consider above published screenshot. a set example reads the catalogue with TR-DOS diskettes and makes the list of all files. It is necessary to pay special attention to behaviour of the roller, during reading the catalogue ? it as well as in DOpus on AMIGA creeps up (decreases at a rate of) slowly to top directly as on the original ? then by means of a roller or buttons up/down it is possible proskrollirovat the text. As the example of a writing of a roller uses many other things the components which earlier have been not described we shall consider it further under the text.
The eleventh component is any area in a current window. The area can be set for work of own element, as for example in the editor ikonok. It is possible to set area and for clearing the set window. And it would be possible and to define simply a zone in which the kind of the cursor ? more shortly applications changed much:)
+1 - coordinate X (a)
+2 - coordinate Y (p)
+3 - the size on X (a)
+4 - the size on Y (p)
+5,6-address of procedure at vyrisovke
+7,8 - the Address of procedure at copying
Fuktsii areas:
00 - to clear a window (reg. N:bit0-pxl clr.bit1-attr clr.; reg. B-attr)
At the instruction of the address of procedure at vyrisovke or at copying it is possible to cause procedure of area (about that as it to make - in the chapter about work with functions)
09 | My Element (type: only my) |
+1,2 - auia?aoee Address
+3,4 - the Address of copying
+5,6-address of check on an accessory of an arrow on the given element
+7,8 - the Address of procedure of processing of functions
Here I have resulted only a format of heading for the script, in more detail we shall talk in the chapter about creation of own elements.
13 | My Window (type: not standart) |
+1 - coordinate X (a)
+2 - coordinate Y (p) It should be multiple 8!
+3 - the size on X (a)
+4 - the size on Y (p) It should be multiple 8!
+5 - attributes of all window
+6 - FREE (for the needs).
+7,8,9 - it is reserved under needs of system.
+10,11 - Adress procedures vypechatki windows
+12,13 - Adress procedures at a reprint of a window
+14,15 - Adress procedures defining, whether navedina an arrow on a window (H ' (altern.) = 0 window, H ' =1 heading)
+16,17 - Adress procedures of processing of functions
Standard functions which should be realized:
00 - gives out coordinates in HL for a press of buttons
01 - correction of coordinates
Here I have resulted only a format of heading for the script, in more detail we shall talk in the chapter about creation of own elements.
In the chapter about creation of own elements.
FUNCTIONS OF COMPONENTS
(As to cause this or that fuktsiju? ?)
Well here also send by that moment when it is necessary to talk about functions of elements. As you already could notice earlier they meet at following components: WINDOW (00), BUTTON (06), SCROLL BAR (10), AREA (11), MY WINDOW (13). So what to me from them use? And how them to use?
Let's consider a variant with function areas AREA (Area) 00 - to clear a window. For this purpose we shall take a part of the script:
MDSK1 | DB 0
DW MDSK2
DB 11
DB 2,24,9,95+8
DW MDSK1D
DW RETA
|
; A following element of the script
; Area
; Coordinates and the sizes
; It is caused at vyrisovke
; It is caused at copying |
And here now that part where we cause function (the example is taken from the program of work with a roller):
MDSK1D |
XOR A
LD BC, *3003
JP mITEMFUNCTION | ; CLEARING OF AREA AT VYPECHATKE
; Number of caused function (*00)
; An operating code
; The command kernalju to execute function |
So like all it is simple?:) as if to an operating code in the given situation it matters:
reg. With / bit0 =1 clearing pikselnaja, bit1=1 clearing of attributes; If attribute clearing, in reg is included. B there will be a code of attributes (*30 in our case) what to decorate cleared area.
|
|