Adventurer #08
31 августа 1998

Exchange of experience - Graphic effect IRIS (plasma).

<b>Exchange of experience</b> - Graphic effect IRIS (plasma).
    (C) Ivan Roshchin, Moscow, 1998


     This beautiful effect is the first time I saw on the PC, 
the program Dos Navigator (Screen saver 'iris. Ss'), and 
transferred it at the Spectrum. Here is the full text of the 
program with detailed comments:


M_X EQU 7; Scale X
M_Y EQU 7; Scale Y


        ORG # 6000

; Set attributes:


        HALT

        LD HL, # 5800

        LD DE, # 5801

        LD BC, # 2FF

        LD (HL), L

        LDIR

; Draw the grid:



        LD HL, # 4000
LP1 LD A,% 01010101

        BIT 0, H

        JR NZ, NE_FF

        CPL
NE_FF LD (HL), A

        INC HL

        LD A, H

        CP # 58

        JR NZ, LP1

; Main loop:


MAIN_LP LD IX, BUFER + # 2FF

; Buffer filled "from end to beginning"
, And in the same order will be displayed
; On the screen in the procedure TO_SCR.


        LD H, TAB / # 100

        LD DE, (M_3)

        LD A, 24

LOOP_V EX AF, AF '

        LD BC, (M_1)

        EXX

        LD B, 32

LOOP_H EXX

        LD A, (MEM_BP)

        LD L, C

        ADD A, (HL)

        LD L, B

        ADD A, (HL)

        LD L, E

        ADD A, (HL)

        LD L, D

        ADD A, (HL)

        AND # 7F

; Significant bit accumulator reset, and
; Buffer is populated with the # 00 - # 7F.
; This is useful in the procedure TO_SCR.



        LD (IX), A

        DEC IX


        INC C;!
ADR_MX LD A, M_X

        ADD A, B

        LD B, A


        EXX

        DJNZ LOOP_H


        EXX

ADR_MY LD A, M_Y

        ADD A, E

        LD E, A

        INC D;!


        EX AF, AF '

        DEC A

        JP NZ, LOOP_V


        LD HL, (MEM_BP)

        DEC HL;!!

        LD (MEM_BP), HL


        LD A, L

        XOR H

        LD HL, BUFER + # 2FF

        XOR (HL)

        XOR E

        XOR C

        ADD A, D

        ADD A, B

        LD B, A


        LD HL, NAPR

        AND 3

        LD D, 0

        LD E, A

        ADD HL, DE

        LD A, (HL)


        BIT 3, B

        JR NZ, TO_DEC


        CP 3

        JP P, TO_END

        INC (HL)

        JR TO_END

TO_DEC CP # FD

        JP M, TO_END

        DEC (HL)

TO_END LD A, (NAPR)

        LD HL, M_1

        ADD A, (HL)

        LD (HL), A


        LD A, (M_2)

        LD HL, NAPR +1

        SBC A, (HL)

        LD (M_2), A


        LD A, (NAPR +2)

        LD HL, M_3

        ADD A, (HL)

        LD (HL), A


        LD A, (M_4)

        LD HL, NAPR +3

        SBC A, (HL)

        LD (M_4), A


        CALL TO_SCR; Displays



        XOR A; Something

        IN A, (254); pressed?

        CPL

        AND 31

        JR NZ, OBR_Z

; If not pressed, restoring
, The scale of the X and Y:



        CALL INC_M

        JP MAIN_LP

; Button is pressed Z (Zoom)?


OBR_Z LD A, # FE

        IN A, (254)

        BIT 1, A

        RET NZ; If not - go

; If pressed - Scales:


        CALL DEC_M

        JP MAIN_LP

MEM_BP DW 0
M_1 DB 0
M_2 DB 0
M_3 DB 0
M_4 DB 0
NAPR DB 2,1,3,4

;----------------------------------; Procedures INC_M and DEC_M 
increase , And reduce the scale:



INC_M LD HL, ADR_MX +1

        LD A, (HL)

        CP M_X

        JR NC, INC_Y

        INC (HL)
INC_Y LD HL, ADR_MY +1

        LD A, (HL)

        CP M_Y

        RET NC

        INC (HL)

        RET

DEC_M LD HL, ADR_MX +1

        LD A, (HL)

        AND A

        JR Z, DEC_Y

        DEC (HL)
DEC_Y LD HL, ADR_MY +1

        LD A, (HL)

        AND A

        RET Z

        DEC (HL)

        RET

;----------------------------------; Procedure TO_SCR recode 
bytes ; From the buffer using a palette and

; The result as a file attribute:


TO_SCR LD HL, PALETTE; palette

        LD DE, # 5800; screen

        LD BC, BUFER + # 2FF; end of the buffer


        HALT
LP_S LD A, (BC)

        LD L, A

        LDI

, Ie take a byte from the buffer and place
; In the register L. This will be offset in
; Panel (which is why it should start
; To address the multiple # 100). LDI team
; Take a byte from the palette (HL) and put
; On the screen at (DE), which
; Increased by 1. The situation in the buffer (BC)
, Decreases by 1. The fact that HL is also
; Increased by 1, no role
; Played since H does not change (because
, That in the buffer are the values ​​0 .. # 7F),
, And L is still unchanged at the next
; Step.



        LD A, (BC)

        LD L, A

        LDI

        LD A, (BC)

        LD L, A

        LDI

        LD A, (BC)

        LD L, A

        LDI

        LD A, (BC)

        LD L, A

        LDI

        LD A, (BC)

        LD L, A

        LDI

        LD A, (BC)

        LD L, A

        LDI

        LD A, (BC)

        LD L, A

        LDI

        LD A, D

        CP # 5B

        JP NZ, LP_S


        RET

;--------------------------------; Auxiliary buffers and tables:


        ORG # C000

; Auxiliary table begins
; To address the multiple # 100:


TAB

    DB # 40, # 40, # 40, # 40, # 40, # 40, # 40, # 40

    DB # 3F, # 3F, # 3F, # 3F, # 3F, # 3E, # 3E, # 3E

    DB # 3E, # 3D, # 3D, # 3D, # 3C, # 3C, # 3B, # 3B

    DB # 3B, # 3A, # 3A, # 39, # 39, # 38, # 38, # 37

    DB # 37, # 36, # 35, # 35, # 34, # 34, # 33, # 32

    DB # 32, # 31, # 30, # 30, # 2F, # 2E, # 2E, # 2D

    DB # 2C, # 2C, # 2B, # 2A, # 29, # 29, # 28, # 27

    DB # 26, # 25, # 25, # 24, # 23, # 22, # 22, # 21

    DB # 20, # 1F, # 1E, # 1E, # 1D, # 1C, # 1B, # 1B

    DB # 1A, # 19, # 18, # 17, # 17, # 16, # 15, # 14

    DB # 14, # 13, # 12, # 12, # 11, # 10, # 10, # 0F

    DB # 0E, # 0E, # 0D, # 0C, # 0C, # 0B, # 0B, # 0A

    DB # 09, # 09, # 08, # 08, # 07, # 07, # 06, # 06

    DB # 05, # 05, # 05, # 04, # 04, # 03, # 03, # 03

    DB # 02, # 02, # 02, # 02, # 01, # 01, # 01, # 01

    DB # 01, # 00, # 00, # 00, # 00, # 00, # 00, # 00

    DB # 00, # 00, # 00, # 00, # 00, # 00, # 00, # 00

    DB # 01, # 01, # 01, # 01, # 01, # 02, # 02, # 02

    DB # 02, # 03, # 03, # 03, # 04, # 04, # 05, # 05

    DB # 05, # 06, # 06, # 07, # 07, # 08, # 08, # 09

    DB # 09, # 0A, # 0B, # 0B, # 0C, # 0C, # 0D, # 0E

    DB # 0E, # 0F, # 10, # 10, # 11, # 12, # 12, # 13

    DB # 14, # 14, # 15, # 16, # 17, # 17, # 18, # 19

    DB # 1A, # 1B, # 1B, # 1C, # 1D, # 1E, # 1E, # 1F

    DB # 20, # 21, # 22, # 22, # 23, # 24, # 25, # 25

    DB # 26, # 27, # 28, # 29, # 29, # 2A, # 2B, # 2C

    DB # 2C, # 2D, # 2E, # 2E, # 2F, # 30, # 30, # 31

    DB # 32, # 32, # 33, # 34, # 34, # 35, # 35, # 36

    DB # 37, # 37, # 38, # 38, # 39, # 39, # 3A, # 3A

    DB # 3B, # 3B, # 3B, # 3C, # 3C, # 3D, # 3D, # 3D

    DB # 3E, # 3E, # 3E, # 3E, # 3F, # 3F, # 3F, # 3F

    DB # 3F, # 40, # 40, # 40, # 40, # 40, # 40, # 40

; Palette that determines the color effect
, Starts with the address of a multiple # 100:

PALETTE

    DB # 09, # 09, # 09, # 09, # 09, # 09, # 09, # 09

    DB # 09, # 09, # 09, # 0B, # 0B, # 0B, # 0B, # 0B

    DB # 0B, # 0B, # 0B, # 0B, # 0B, # 0B, # 1B, # 1B

    DB # 1B, # 1B, # 1B, # 1B, # 1B, # 1B, # 1B, # 1B

    DB # 1A, # 1A, # 1A, # 1A, # 1A, # 1A, # 1A, # 1A

    DB # 1A, # 1A, # 1A, # 12, # 12, # 12, # 12, # 12

    DB # 12, # 12, # 12, # 12, # 12, # 12, # 16, # 16

    DB # 16, # 16, # 16, # 16, # 16, # 16, # 16, # 16

    DB # 36, # 36, # 36, # 36, # 36, # 36, # 36, # 36

    DB # 36, # 36, # 36, # 34, # 34, # 34, # 34, # 34

    DB # 34, # 34, # 34, # 34, # 34, # 34, # 24, # 24

    DB # 24, # 24, # 24, # 24, # 24, # 24, # 24, # 24

    DB # 25, # 25, # 25, # 25, # 25, # 25, # 25, # 25

    DB # 25, # 25, # 25, # 2D, # 2D, # 2D, # 2D, # 2D

    DB # 2D, # 2D, # 2D, # 2D, # 2D, # 2D, # 29, # 29

    DB # 29, # 29, # 29, # 29, # 29, # 29, # 29, # 29

; Intermediate buffer may begin
; From any address:


BUFER DS # 300



     How can I experiment with this
program:

     - Change the scale (and constant M_X
M_Y). This can be done directly
during the program by pressing
'Z'.

     - Instead of commands INC C and INC D, placed ennyh! "You 
can put the commands that increase (or decrease) of registers C 
and D is at 1, and to any other number.


     - Command DEC HL, placed such training is essential "!!",
can replace some of these teams
(Or, for example, commands INC HL).

     - Change the contents of the table TAB.

     - Change the color set by
palette (array of PALETTE).

     You can change all of the above
parameters directly during the program, if you make it 
self-modifying. 


                *







Other articles:

From the Author - help: New bugs in the new shell.

From the Author - the author: about the authors of the magazine.

Presentation - Content of the program: Installer to AUTORUN DISK v2. 0 adventyurnaya game Diamond.

Presentation - a program for protecting programs TRICK v1. 003b.

Presentation - HELP Z_80: User's Guide.

Interface - letters from readers: Black Raven, The Secret Game NEW DIZZY, On the errors of the game APOLLO, a new debugger Veros STS 6.2, How to beat the game Svyatogor.

Interface - PC vs Amiga: Is AMIGA RULEZ? First impressions neophyte.

Interface - support for producers of "iron" their "creations" after they (the creatures) get into the hands of users.

Interface - thinking out loud: "SPECCY computer for young people. If we have so many cool coders, why so little steep domestic soft'a?"

Interface - pens from CAV inc: "SPECCY it does not work, this rest is, even more than the rest, it's a lifestyle, and if by that you still manage to get the money. .. "

Interface - SPECCY pros and cons, Reflections Spy / Eternity Industry.

System - Overview of system programming: ZX-IBM Editor v1.5M, PPF v1.05, Multistudio v2.0p, Mods Player v2.0, Bitmap Viewer v2.0, Corrector v2.0, Storm v1.1, 866 v1.2, HRUM v3.5, TDU v1.0, HRUST v1.0, RLE-Compressor v1.21, Overlays Consul Commander.

Toy Review - An overview of new gaming software: Rabbit Jazzy, Quadrax, Komplex, Math of the day, Cue Boy, Zly Sen, Prva Aakcia, Outlaw, The Dark Empire, Gary Linekers.

Toy Review - Demos: Little Ghost, The Dark Empire, Worms, Smagli 3 Monster Land, Civilization, Mysteries of Captain Shelton.

Guests - Presentation of a group of Kovrova - Eternity Industry.

Guests - Filix about creating games Winnie The Pooh-2.

Guests - ekstremalschiki: new section which highlights aspects of the life and work of extreme Rybinsk musicians. Today, a visit Marat and Demon - stood at the origins of such well-known (in the narrow circles) team "Disgust".

Promotion - How to play the game Encyclopedia of WAR.

Promotion - the passing game Where time Stood Still.

Promotion - description of the game Elopement: back to the Earth.

Promotion - the passage of text adventyury Island of Darkness (Island Darkness).

Promotion - the passage of text adventyury Knightmare.

Exchange of experience - Russian glitches: The Island of Darkness Game (how NOT to write adventyurnye game).

Exchange of experience - Finalization ZX-ASM v3.0 by Ivan Roshchina.

Exchange of experience - Features video controller ZX Spectrum (for programmers).

Exchange of experience - Graphic effect IRIS (plasma).

Exchange of experience - the procedure output window frame.

Exchange of experience - on how to operate in the assembly with the long numbers of type Long.

Exchange of experience - Art Studio and the principle of open architecture (how to write their own modules to the editor).

Exchange of experience - The movement procedure of attribute labels in pixels (floating atrubuty).

Ottyag - A Tale of Pentium Pentiumovicha Pentiumova. 20 things you can do if your favorite team lost on the road. Toilet, as a measure of human values.

Ottyag - Test "Formatsevt, check for authenticity."

Ottyag - Test "You are not dumb ass."

Ottyag - The test "Do you have a sense of humor."

Ottyag - Test "Which of your student."

Ottyag - How to PROPERLY kill Windows'95.

Ottyag - Winnie the Pooh and all-all-all - 2.

Novella - Tales Corporal Djilali (the game Laser Squad).

Novella - Escape from Space (the game Elite).

Novella - Hedgehogs mutants.

News - News from the Rybinsk spektrumistov: Infosoft, Shrsoft, Surgeon, Chasm, Protecvision, Groboclone, Volume 4, Experience, Mr. Vano, Ant, Demon, Miguel, Veka, RDM, Auryn.

News - News from the Yaroslavl spektrmistov: Marchy, Kav Software, Nicolas Viper, Dr Shura, Harkonnen, MacKeymn, DJ Reason.

Advertising - advertising and announcements.


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

Similar articles:
Honor and Eternal - List of Honored Members AC Edit.
Aphorisms - 10 best quotes from the computer press.
Humor - A new era of science, news - the facts - a sensation.

В этот день...   21 November