Miracle #03
16 июля 1999

kodit Who's there? - Chanky flame: a description of the algorithm chankovogo fire.

<b>kodit Who's there?</b> - Chanky flame: a description of the algorithm chankovogo fire.
    (C) Steelzer / Triumph

    ------------------------

            FLAME


    You certainly have seen the effect FLAME'a
(Flame) in the demos, intros and so on and if
for you a secret, as he did - read
on.


    To start a fire, we define
want to get. Fashion on the attributes of long-
sunk, and now more relevant chunky
(Dithering). Therefore, we will focus on
'Chankovom' FLAME. The fire should not be
too high nor too small. Let there be a third of the screen. Burn
he can straight up, and perhaps in
direction, which creates the effect of the wind, but on
how to do this a little later.


    To begin initialize table -
a buffer, with whom we work, and then print the screen. We 
agree that ispolzovatsya be chunks 4x4, and under a chunk in 
the buffer will be allocated 1 byte - so easier to work with 
them. Total we need a table 64x16 (1024 bytes).



    Well, now own about how
is a fire. At the bottom of the flame point
have a maximum brightness and gradually
going to the very top of the glaze.


      Here are the elements of our buffer:
0, 2, 3, ... 61, 62, 63

     64, 65, 66, ... 125, 126, 127


    It should be understood that we have an array of
64x16, and that the number of the lower element
(Memory offset) differs from the number
the top 64.


    Here's the algorithm:

1) take a byte of X;
2) add up to a byte of X +64;
3) to check whether they are equal;
4) If yes, then reset X;
5) add X to X +64 and then divide the

   2;
6) put the quotient in X;
7), etc. for all elements of the buffer;
8) napechat buffer to the screen;
9) after processing and printing, it should be

   update 64 bytes from the end of the buffer

   random digits from 0 to 15 (as

   chunks of 16) that the fire is not quenched
   Lo.


    That the flame went up and away,
to in paragraph 2 of the algorithm to change the number 64
63 (right) or 65 (left).


    That's about what should be on
screen after the print buffer:



    Strongly not look - in effect
need to watch in action, and not make fun of screenshot'am.


    If you think that the flame of which -
there is not enough, you can try
change the algorithm.


    Instead of folding the element with the bottom and divide 
by 2, try add an element of not only lower, but

with the bottom - left and lower right
elements, and divide the sum at 4.


    Then you will see some
is:



    Personally, I prefer the second
FLAME. Here are 3 files of minutes coded,
which just makes the second option.


    There's truth I'm using loadable
block - chankovy font, and print chunks
to 2 at once. I will not argue, pechatalka
far from ideal. But this has been done
to leave "room for
Optimization novice coders. I hope
Generate themselves "chankovy font, and
preload at address # 7800. I personally do it
generated from 32 bytes.


    ; (C) Steelzer / CRZ

    3 minut coded flame

    ; Rem can be modifed:)


    ORG 25000

    LD HL, # C000; initialization

    LD DE, # C001; buffer

    LD (HL), L

    LD BC, 1024

    LDIR


    FLAME LD IX, # C000 +63; shift up and right

    LD DE, # C000

    LD BC, 1024; many elements have

                           ; Process

    BEGIN LD A, (DE)

    CP (IX +0)

    JR NZ, LOOP1

    XOR A

    LOOP1 CP (IX-1)

    JR NZ, LOOP2

    XOR A

    LOOP2 ADD A, (IX +0)

    ADD A, (IX +1)

    ADD A, (IX +2)

    SRA A

    SRA A

    LD (DE), A

    INC IX

    INC DE

    DEC BC

    LD A, B

    OR C

    JR NZ, BEGIN


    CALL PRINT


    LD A, R; zapolnyalka RANDOM'om of almost ROM;)

    AND% 00111111

    LD H, A

    LD A, R

    LD L, A

    LD DE, # C000 +1024

    LD B, 64

    RND LD A, R

    OR (HL)

    OR 8

    AND 15

    LD (DE), A

    INC HL

    INC DE

    DJNZ RND

    JR FLAME


    PRINT LD HL, # C000

    LD DE, # 5000

    LD B, 16

    LI1 PUSH DE


    LD A, (HL); this whole block

    INC HL; must be repeated 32 times

    ADD A, A;

    ADD A, A;

    ADD A, A;

    ADD A, A;

    OR (HL);

    PUSH HL;

    PUSH DE;

    LD L, A;

    LD H, 30;

    ADD HL, HL;

    ADD HL, HL;

    LD A, (HL);

    LD (DE), A;

    INC HL;

    INC D;

    LD A, (HL);

    LD (DE), A;

    INC HL;

    INC D;

    LD A, (HL);

    LD (DE), A;

    INC HL;

    INC D;

    LD A, (HL);

    LD (DE), A;

    POP DE;

    POP HL;

    INC DE;

    INC HL;


    POP DE

    CALL NL1

    DEC B

    JP NZ, LI1


    LD BC, # 7FFE

    IN A, (C)

    BIT 0, A

    JP Z, EXIT; address out, set themselves

    RET


    NL1 LD A, 4

    ADD A, D

    LD D, A

    NEXTL2 LD A, D

    NEXTL3 AND 7

    JR NZ, V1

    LD A, E

    ADD A, 32

    LD E, A

    JR C, V1

    LD A, D

    SUB 8

    LD D, A

    V1 RET

    NX INC D

    JR NEXTL2

---------------------------------------




Other articles:

From the Editor - Preface: For what purpose we are releasing the magazine?

From the Editor - shell: a description of a new obolchka to the magazine.

From the Editor - a letter to the journal: Dr.Sioux / Phantom Family, Fistsoft, Mr.Z / HardWave, Kurov N., Eagle / Computer Ratz Group, Rom Corp / Virtual Vision Group.

From the Editor - in this issue: Content.

Project of the Year - presentation version of the game of Robo KT-soft/ETC.

Project of the Year - a presentation of the game from a group of Spark: Townships.

Project of the Year - a presentation of the game "12 secret book."

Project of the Year - a few words about the upcoming game, Chip & Dale.

Project of the Year - an amazing story to the game "Navigator".

Project of the Year - World of Darkness: a description of a new real-time strategy.

Rattles - Fresh or not, but savory cheats.

Rattles - Crematorium: STALKER game - a description of all items.

Rattles - Crematorium: Country Myths - Tips specials.

SWAP'A Basics - information for beginners as well as a few sly misrepresent, which You can crank the mail.

kodit Who's there? - Quick graphics: a few recipes from Zetter'a (print sprites, update the screen).

kodit Who's there? - Packer'y and Depacker'y: the truth about the packer or the ranting of Sir Kot'a.

kodit Who's there? - Working with MS-DOS: All about the mod files - a full description of the structure of mod-file, as well as a description of all effects.

kodit Who's there? - Working with MS-DOS: Ms-Dos floppy disk - a description of the structure of Ms-Dos disk.

kodit Who's there? - Chanky flame: a description of the algorithm chankovogo fire.

kodit Who's there? - Attribute bump mapping: bump mapping for those who have not entered.

kodit Who's there? - Guru meditates: optimization programs for execution time and size.

kodit Who's there? - An approximate search for a given sequence of bytes!

kodit Who's there? - Fast 42 print: fast how to print 42 characters in a row.

Party zone - KidSoft'98: a report from the Voronezh Festival of Computer Art.

Party zone - EarthQuake'99: a report from the Chelyabinsk festival of computer art.

Myself - 128 colors on the Spectrum: Revised scheme of up to 128 colors from the Donetsk group Spark.

Myself - Kettle: Connection General Sound to Profi through the system connector.

Myself - Uninterruptible Power Supplies: UPS-information technology.

Myself - General Sound Filter: story of the new gadgets to the GS.

Myself - Modems: Diagrams, charts! Scheme G. Shepeleva Kondratiev and M. Hayes modem connection.

Myself - Modems: Command - Command terminal.

Myself - Modems: Total modemizatsiya - a call to connect momedov.

System Software - FastCopy 3.0: a complete description of tricked out turbo-copyist.

System Software - Pro Tracker bugs! Several glyuchkov in ProTracker'ah.

System Software - Pro Tracker 3.4 final presentation remix Pro Tracker from Samara.

News - Chelyabinsk: X-Raizor returned to the Spectrum, Wocen wrote boot, Blade otdahyet, Steelzer joined Triumph, Crite completed the alpha version of the "World of Darkness", Bytic bought GS, Edison makes the site, Ironman wants to buy Spectrum.

News - Omsk: full staff and are expected products from a group of U98.

News - Kaliningrad: The loud death or Spectrum quiet life in Kaliningrad.

Techno-nature - Electronic music: Dj.Ironman talks about technology (Part 1).

Techno-nature - Electronic music: Dj.Ironman talks about technology (part 2).

Techno-nature - Internet music-sites: a lot of addresses where you can learn new about electronic music.

Techno-nature - Addiction XX: bike from Dj.Ironman 'as well.

a quarter to four - the story of everyday life from the X-Raizor'a.

Room with laughter - smells in and around: funny story from the magazine PTUCH.

Room with laughter - Perdmen: damning story of all of the same PTYuCh'a.

Room with laughter - Wick: nekolko scenarios from the film chronicles the wick.

Room with laughter - Halo: The end of the story published in the second room.

Proclamation - advertisements and announcements about finding friends on the Spectrum.

Proclamation - advertisements and announcements about finding friends on the Spectrum.


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

Similar articles:
Games - Black Raven-I. Useful tips.
Advertising - Advertising and announcements.
Chaos Construction 2001 - an interview with the Paracels and Sairoos of Placebo.

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