3Bit #01
03 января 2005

Programming - a collection of codes: Draw a window frame in the color processing of disk errors TR-DOS, a universal procedure Scroll'a screen.

<b>Programming</b> - a collection of codes: Draw a window frame in the color processing of disk errors TR-DOS, a universal procedure Scroll'a screen.
Draw a box with a border in color.

(C) Ivan Roshchin
(C) Cooper/RSM/P7S


  The author of the basic algorithm is
Ivan Roshchin. Cooper, tobish I added a very
procedure for printing the symbol 8x8 (optimized in a hurry. 
Who's supposed to - the do it faster;) and color support. Yes,

and yet, I made the call box by the vector
but can do so as it is more convenient for you.

  When you call it (the label OPEN_W) in the DE register pair 
to specify the coordinates of the left upper corner of the 
frame, the register B - height, in C - the width of the window 
(in characters). Cell COLOR should contain color.



        LD IX, VEKT

        CALL OKHO

        RET

OKHO LD D, (IX +0)

        LD E, (IX +1)

        LD B, (IX +2)

        LD C, (IX +3)

        LD A, (IX +4)

        LD (COLOR), A
OPEN_W LD A, ""; upper left corner of the frame.

        LD L, ""; left bottom corner of the frame.

        CALL OPEN_W2
OPEN_W1 LD A, ""; horizontal borders of the frame.

        LD H, ""; This symbol fills the window.

        LD L, A

        CALL OPEN_W3

        DJNZ OPEN_W1

        LD A, ""; upper right corner of the frame.

        LD L, ""; the lower right corner of the frame.
OPEN_W2 LD H, ""; horizontal borders of the frame.
OPEN_W3 PUSH DE

        CALL PRSYM

        INC D

        LD A, H

        LD H, C
OPEN_W4 CALL PRSYM

        INC D

        DEC H

        JP NZ, OPEN_W4

        LD A, L

        CALL PRSYM

        POP DE

        INC E

        RET

; Print character 8x8 color
; In: DE - coordinates, A - character code
PRSYM PUSH BC

        PUSH AF

        PUSH DE

        PUSH HL

        LD L, A

        LD H, 0

        LD BC, 42048, the address of your font

        ADD HL, BC

        LD A, D

        AND 7

        RRCA

        RRCA

        RRCA

        OR E

        LD E, A

        LD A, D

        AND 24

        OR 64

        LD D, A

        DUP 7

        LD A, (HL)

        LD (DE), A

        INC H

        INC D

        EDUP

        LD A, (HL)

        LD (DE), A

        LD A, D

        RRCA

        RRCA

        RRCA

        AND 3

        OR # 58

        LD D, A

        LD A,% 00001111
COLOR EQU $ -1

        LD (DE), A

        POP HL

        POP DE

        POP AF

        POP BC

        RET
; --- Vector window ----; +00 - Y coordinate
; +01 - X coordinate
; +02 - X-Size
; +03 - Y-size
; +04 - Window color
;------------------
; Example of the vector window
VEKT DB 1,1,10,10,15


Handling disk errors TR-DOS

(C) Max


  If your program does not need to do more error handling to 
throw out the menu with a choice of Retry Abort / Ignore, but 
you want to avoid cleaning screen and the appearance of vile 
inscriptions TR-DOS "Disk error", then this will help you I 
have developed a short protsedurka that blocks all attempts to 
TR-DOS print error, it, in this case,

no ill effects return control
program with an error code in register A (a copy of the system 
variable # 5D0F (23,823). 

  If you need to handle the RIA, it
on this protsedurku without any problems you
can hang a driver error handling
For example, such as published in the newspaper
ECHO 3 (author VfNG). In case you have
can not find this newspaper, I cite this
driver, once connected to my program that I it was made only
determine the type of error DISK ERROR or
READ ONLY.
 Instead, # 3D13 call TR-DOS, obrabotka
errors without menus RIA TRDOS:

     ...

     PUSH HL

     LD HL, (23613) Save. ERR_SP

     LD (ERR +1), HL

     LD HL, ERR

     EX (SP), HL

     LD (23613), SP

     EX AF, AF '

     XOR A

     LD (23823), A

     LD (23824), A

     LD (23570), A

     EX AF, AF '

     JP 15635

ERR LD HL, 0

     LD (23613), HL; Restore. ERR_SP

     LD A, 6

     LD (23570), A

     LD A, (23823)

     AND A

TRD1 RET Z

     PUSH AF

     LD IX, W1; box ERROR!

     CALL OPWIN; open

     POP AF

     RET


  Note: if you use beysikovskie channels to print characters or
any other purposes, then insert
error handling procedure before opening
window with an error message initializing
desired channel. For example:


     LD A, 2

     CALL 5633


  By the way, one way to break fast
programs - is opening the latch drive at boot time, and the 
preservation of MAGIC'u or entry into the monitor, and then 
just need to find LOADER. So, if you want to properly protect 
the program, then hang one or another error handling procedure.



        Again Scroll ...

(C) cooper/RSM/P7S


  Bring to your attention a little protsedurku to shift the 
screen. What are its advantages over the others? Firstly, it is 
universal, ie suitable for how to scroll down or up. It all 
depends from the addresses that you specify it at startup. 
Secondly, it moves one at a time line, ie, if you need to move, 
not all screen, but let's say 2 / 3, respectively, to cause it 
to loop 16 times (maybe it and not rational, but it handy). 
Third, it moves and graphics, and attributes. And does this 
tricky way:) Well, I think, will understand how. Here is its 
listing: 


        LD DE, # 4000; from

        LD HL, # 4020; to

        LD B, # 17; number of rows

MAIN PUSH BC

        CALL SCROLL; call prots.sdviga

        CALL LL693E; office procedures (page up)

        CALL LL6949; office procedures (page down)

        POP BC

        DJNZ MAIN

        RET

, But it actually is official procedures
, Where some, figure it out, ok?
LL692A LD A, L

        SUB # 20

        LD L, A

        RET NC

        LD A, H

        SUB # 08

        LD H, A

        RET

LL6934 LD A, E

        SUB # 20

        LD E, A

        RET NC

        LD A, D

        SUB # 08

        LD D, A

        RET

LL693E INC H

        LD A, L

        SUB # E0

        LD L, A

        RET NC

        LD A, H

        SUB # 08

        LD H, A

        RET

LL6949 INC D

        LD A, E

        SUB # E0

        LD E, A

        RET NC

        LD A, D

        SUB # 08

        LD D, A

        RET

Directly scroll screen
SCROLL PUSH HL

        PUSH DE

        LD A, D

        RRCA

        RRCA

        RRCA

        AND # 03

        OR # 58

        LD D, A

        LD A, H

        RRCA

        RRCA

        RRCA

        AND # 03

        OR # 58

        LD H, A

        DUP 1932

        LDI

        EDUP

        POP DE

        POP HL

        LD BC, # 00F8

        JP LOOP2
LOOP1 INC H

        INC D
LOOP2 DUP 31

        LDI

        EDUP

        LD A, (HL)

        LD (DE), A

        INC H

        INC D

        DUP 1931

        LDD

        EDUP

        LD A, (HL)

        LD (DE), A

        JP PE, LOOP1

        RET


  And another point - it is used in our
journal, ie, you can assess its performance on a live example. 
Incidentally, the magazine she runs slower original. Themselves 
understand the music, scroll bar, scrolling line and other muck 
in the interrupt ... 





Other articles:

From the Editor - the new Ukrainian electronic journal called "3BiT".

From the Editor - eve: correspondence with the authors of the magazine correspondents.

From the Editor - Credits: The authors of the magazine.

Speccy news - news: Scl published newspaper Cossackos, the results of the Voronezh Festival KidSoft'2004, Sergey Bulba archive AY music, Alone Coder released Info Guide # 6 ...

Programming - a new fast and short PT3.x Player of the RSM.

Programming - Design source: the basic requirements for listing of the program focused on the general public.

Programming - the procedure to print the text fonts, 8x8, 6x8, 5x8, 4x8 pixels.

Programming - an overview of features and company models ottechestvennogo Spectrum of Rob F.

Programming - a collection of codes: Draw a window frame in the color processing of disk errors TR-DOS, a universal procedure Scroll'a screen.

Programming - Game Making: Mad Killer shares his experience creating games for the ZX Spectrum.

Programming - Non-standard use of the General Sound: Sound emulation coprocessor AY-3-8910.

Hacker Zone - "phreaking": Freestuff calls to payphones. Free calls to anywhere world.

Outlook - Dune for the Spectrum of Sosyura Igor.

Have an opinion - Mad Killer accuses of corruption Inforkom PC.

Desktop - JPEG / GIF laboratory 1.1: a program for viewing images in a format JPEG / GIF.

Desktop - General Sound AY Emulator v1.0

Desktop - an overview of tools to search for music files, Pro Tracker 3.X Mod Finder v1.2

Gambling - The archivist: a review of not very fresh but I wonder adventyury "Last adventure. "

Gambling - Wolf 2004: The world saw something that worked Alone Coder entire 8-NIL years!

Zhelezyachki - Something about the CMOS-clock: a modified scheme of Alone Coder'a.

Zhelezyachki - an overview of some modern controllers for use with external storage media for the ZX-Spectrum.

Veselukha - Life is simple sysadmin and sad and dreary if there no beer: sysadmin is dedicated.

Veselukha - a humorous story: I am a machine.

Veselukha - Computer jokes.

Another World - Radeon X700: an inexpensive base for gaming cards.

Miscellaneous - report of Rob F. with the Ukrainian hangouts SpeXtream'2004.

Miscellaneous - age: what do you want the software, especially games and how to make them well.

Miscellaneous - Competition from GROUPS P7S for Patriots Spectrum!

Miscellaneous - An Interview with DESALEX'om / XPJ.

Miscellaneous - an interview with the author of one of the most anticipated game projects, games, Dune: The Battle for Arakkis.

Miscellaneous - an interview with the author of acclaimed demos under the VIC-20 - Viznut / PWP.

Miscellaneous - an interview with the renowned British spektrumistom Gasman / Raww arse.

Miscellaneous - An Interview with Random'om taken on Construction Chaos 2004.

Miscellaneous - Advertisement - motor trade and not only.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Network News - At this point in Kirov in full swing there are two BBS'ki and there are 13 points.
Editor - I found some relics IBM PC, skopee only 286 RAM, 1024 KB.

В этот день...   6 May