Speccy #02
31 октября 1995

Programming - Universal program I / O sprites.

<b>Programming</b> - Universal program I / O sprites.
       PROGRAMMING


We bring to your attention a program sent to us Kotov AV
from the city of Rybinsk.

 Kotov AV


 Universal routine

      I / O sprite

 This works with prtsedura
File format editor
sprites "SPRITE EDITOR 2. For
those who have it do not have to report that
file format from the editor
as follows:

 If the file is created with
Mask option turned off and
Color, ie contains only
information about the schedule, the first
are the first 8 rows familiarity
sprite then 8 second, and so
on.


 The data in podprogramku transmitted through IX register, it
recorded address parameter table.


  Table Format:

 IX + 0 X - X coordinate of O
on the screen (in the familiarity)

     + 1 Y - Y coordinate output
on the screen (in the familiarity)

     + 2 Xraz-size sprite
horizontally in the familiarity

     + 3 Yraz-size sprite
vertical familiarity

     + 4 n - number of the sprite to
conclusion (smaller than the actual
1) for tables of sprites.

     + 5 \

     + 6 / size of the sprite in

             bytes.


* SPBUF DEFW 0; address here

        ; Early table sprites

sprite DI

       LD B, (IX +4); received

                  ; Number sprite

       LD A, B

       CP # 0

       JR Z, sl2; entry point

                ; For the first or

                  ; Single

                       ; Sprite

       LD E, (IX +5)

       LD D, (IX +6); download

                        ; Size

                        ; Sprite

       LD HL, (spbuf); address

                    , Or sprites

                       ; Table

                       ; Sprites
 sl1 ADD HL, DE

       DJNZ sl1
 sl2 LD B, (IX +3); the size of the Y

       LD D, (IX +0)

       LD E, (IX +1); coordinates

                         , O

                        ; Sprite

       PUSH HL

       CALL GET_ADR_S

       POP DE
 sl3 PUSH BC

       LD B, 8; beginning of the cycle of

                     ; Familiarity
 sl4 PUSH BC

       PUSH HL

       CALL Outspr; drawing

                   ; One line

                        ; Sprite

       POP HL

       INC H

       POP BC

       DJNZ sl4

       DEC H; correction HL

       CALL next_b; transition to

                      , The following

                     ; Character

                         ; Line

                    , And correction

                   ; Transition

                  , Across the border

                   ; Third of the screen


       POP BC

       DJNZ sl3

       EI

       RET


, This procedure allows for both
; Display the sprite on the screen and
; Take it with ekrana.Vyvod
; Possible line of XOR, OR, AND
; Only need to replace the command
; NOP to the one you need.


  Outspr:

       LD B, (IX +2); length

                         ; Line
outsp1 LD A, (DE)

       NOP

       LD (HL), A

       INC DE

       INC HL

       DJNZ outsp1

       RET
next_b INC H

       LD A, H

       AND # 7

       RET NZ

       LD A, 1

       ADD A, # 30

       LD 1, A

       RET C

       LD A, H

       SUB 8

       LD H, A

       RET
* Set_Adr_S; this procedure

         , Finds the address of the display

                 ; On familiarity

        ; / Coordinates DE, address

        , Returns to the HL (vzya
        , Then from the book "Priklodnaya

            ; Graphics Inforkom) /

       LD A, E

       AND # 18

       OR # 40

       LD H, A

       LD A, E

       AND # 07

       OR A

       RRA

       RRA

       RRA

       RRA

       ADD A, D

       LD L, A

       RET


 Solomon Anton from Chelyabinsk
asks a question related to use of the printer.

I have a computer "Ssorpion 256"
Version 2.4d. When connected to a
circulated via Centroniss
Printer "Seikosha", when filing
commands to the printer with control codes LPRINT CHR $ 15 in 
text mode provides a completely not what you need ...

 In graphical mode when you reset
Pictures from the screen to the printer
instead of a picture, and printed
letters ...

 To answer such questions
You must have complete information. As is known, to the printer 
to work, required to fulfill two conditions: 1. Correctly make 
the connection 

   (Hardware).
2.Install support program

  printer (software).

 In corporate ZX-Spectrum'e in ROM
is a program that only works with the printer specially created 
for this computer. If your computer is connected to any other 
printer, for its work program is required (driver) supports

this type of printer. Unfortunately
Most programs contain
Driver Epson - Compatible
printers.

 In order for your printer earned must be purchased,
or write a driver for this
printer and install it
in both graphical and text editors.
 Piobresti such a program can be
on the radio market. If there is any
will not appear, contact the NGO
"URALavto (sm.reklamu).
 Request to readers:
Due to the fact that so many
users to ask questions related to repairs
computers, connecting any external devices, writing programs 
poddetzhki, then let him who is able and willing

do such work, will give
Advertise in our magazine.


         *





Other articles:

authoring program - Presentation system software: Bestseller from Stars, Visual layer Demo.

Igroskop - Questions about the passing game: Hobbit, Last Raider, Star Heritage. Game description: Crystal Kingdom Dizzy 7 and Robocop 2.

Comics multroliki - Computer-comic "The Miracle of the hat" with Donald duck.

Muzoboz - Describes the two contest works: Axis of Evil, Faces-I.

Novella - fiction novel based on the game "Laser Sqadron" a series of "Laser Squadron of the galaxy."

From the Editor - O magazine "SPECCY".

Programming - Universal program I / O sprites.

Advertising - Advertising and announcements.

Tusovka - Opinions Fan ZX-Spectrum.


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

Similar articles:
Hall of Fame - "oVERFILE" threw the whole country. "On the Kemerovo Spectrum scene. A few words on pisi.
BBS on ZX?! - BBS on SPECCY - this is real.

В этот день...   29 April