|
8BIT OPERATING SYSTEM FOR ZX-SPECTRUM
\history \doors2000
DOORS 2000 (a part 4)
(Year 2000, the wind of the changes which have broken a roof, at all..)
VECTORS
(Vectors of devices)
Basically inherently, a vector of devices too are functions kernalja, only if API-functions have been directed on creation of the interface the primary goal of vectors to provide correct work with iron. So we shall consider ?
mFIRE The given command is intended for interrogation of a condition of buttons of the mouse. By default in Doors 2000 - two-push-button kempston mouse. In And (accumulator) come back bit0 - the right button of a mousy, bit1 - the left button.
EXAMPLE | BIT 0, A
RET Z | ; check of the right button
; An output if it is not pressed |
IN: under the standard of entrance data is not present
OUT: in And - a condition of buttons of a mousy
mVECTOR The given command returns a vector of moving of a mousy in register pair DE. In register E - displacement on Y (*FBDF), in register D - displacement on X (*FFDF.)
ATTENTION!
7e bats is responsible positively or negative value, bit7=0 - for plus, bit7=1 - a minus.
IN: under the standard of entrance data is not present
OUT: in DE - a vector of moving of a mousy
mPAGEThe given command returns in A (accumulator) the current connected logic bank of memory. (0,1,2 ?. 5y is 7e the screen!!)
IN: under the standard of entrance data is not present
OUT: in A - Logic Bank.
mMAISCR The given command compulsorily includes display of the basic screen (*4000.)
IN: under the standard of entrance data is not present
OUT: under the standard of target data is not present
mEXTSCR The given command compulsorily includes display of additional (7-th) screen (*N000.)
IN: under the standard of entrance data is not present
OUT: under the standard of target data is not present
mKEYBOARD The given command reads out ports of the keyboard and returns in A - a code of the pressed key in format Doors if the code *FF is is equivalent that have not pressed any key. (the table of values of other keys in the appendix).
IN: under the standard of entrance data is not present
OUT: A - a code of a key in format Doors
mCNC mCNC translates a code of the pressed key from format Doors in format ASCII.
IN: A - a code of a key in format Doors
OUT: A - a code of a key in format ASCII
Further commands of work with the graphic screen follow.
DOWN_HL / DOWN_DE Once in printed edition ZX-?aa? one of readers has offered in section "Etudes" small procedures of recalculation of the following address on the screen. A secret that on the Spectrum bajty on the screen go consistently. The screen is broken into 3 parts on 2Ea. To lines with 0 - 7 there correspond addresses (*4000 - *47FF). To lines with 8 - 15 there correspond addresses (*4800 - *4FFF). To lines with 16 - 23 there correspond addresses (*5000 - *57FF). Such structure of the screen, is extremely inconvenient: (And so if we shall want to deduce sprajt or to print any text (finally it too a set sprajtov:) that to us just also will be useful either DOWN_HL, or DOWN_DE. They differ in only register pair. On an input in HL (DE) the address of the screen where we now are, on an output in HL (DE) pereraschitannyj the address.
Lines | The Address | Comments | 0 | *4000 | The Beginning of the screen. A line 32 bajta | 1 | *4100 | This address is given out with described procedure | 2 | | | 3 | | | 4 | | | 5 | | | 6 | | | 7 | | | 8 | *4020 | Following 32 bajta |
Uniqueness above described procedure still that it allows not only it is correct pereraschityvat addresses at transition from one third in another but as and to count addresses not necessarily at once in the basic screen, for example it is possible to arrange the screen in *6000 and to work with it, as with shadow.
IN: HL or DE - the current address of the screen
OUT: HL or DE - pereraschitanyj the address of the screen
UP_HL / UP_DE UP_HL And UP_DE are return procedures, if DOWN_HL and DOWN_DE pereraschityvali the following address described procedures give out the previous address, i.e. above current.
Lines | The Address | Comments | 0 | *4000 | This ia?a?an?aoaao address the given procedure | 1 | *4100 | If it is the current address | 2 | | | 3 | | | 4 | | | 5 | | | 6 | | | 7 | | | 8 | *4020 | Following 32 bajta |
In general procedures UP and DOWN are convenient for using at the organization skrollingov the screen.
IN: HL or DE - the current address of the screen
OUT: HL or DE - pereraschitanyj the address of the screen
mSCREEN mSCREEN is one more useful procedure at work with grafikoj and the screen in particular. The given procedure if it on an input to set in register pair HL of coordinate Xa (0-31) and Yp (0-191) on an output we shall receive in register pair DE the address on the screen. For example if on an input to set HL = * 0000 on an output in DE we shall receive *4000 - the address of the beginning of the screen.
IN: HL - coordinates Xa, Yp
OUT: DE - the address on the screen.
|
|