ZX Live #02

Programming - Synchronization effects in demos at the interruption.

<b>Programming</b> - Synchronization effects in demos at the interruption.
                          -= CODING =

    Today I will break up on how competently do all sorts of
effects, as they do that they plowed all the campaigns,
turbocharged and neturbirovannyh, with one field of memory and 
two, with INT'om from 50'000 to 70'000 cycles. A solution of 
one thing: read slightly following tips:



    1.1 Check your prog on different campaigns
(!!!!!!!!!!!!!!!).

    2.1 Do all of the effects of frame, then they will not
depend on the clock per cent.

    2.2 If this is not possible, then please continue reading 
this article before end.


    3.1 Avoid the super-duper cool disk loadirov, # 3D13, too
not bad

    4.1 Do not assume that if you have a mouse, have it
all.

    4.2 Please note that the speed of the mouse arrow Mixing 
Capacity directly proportional to the speed of the player, but 
from klaviaturygramotnosti your bend, and if you do anything 
with arrow and at the time, make sure you keep this in mind.


    5.1 Do not assume that everyone has a 128-Basic, never
Use the procedures from there.

    5.2 Do not think so well that the 128-Basic'a ​​no one.


    Well, now about a cool way of organizing output
screen, where the rate of change objects in One unit of time
will be the same on all campaigns.


    So the gist I will show a rotating 3D
object, and for the impossibility of framing the withdrawal 
take Amiga bagel the size of the entire screen.



  That piece of code:

SET_IM_2 di

            ld a, # be

            ld i, a

            ld hl, INT

            ld (# beff), hl

            im 2

            ei

LOOP call RENDER

            call OUTPUT

            call KEY

            jp z, LOOP; typa nichoga not natsisnuta


            di

            ld a, 63

            ld i, a

            im 1

            ei

            ret

INT ld a, (ROTX); * 1

            add a, a

            ld (ROTX), a

            ld a, (ROTY)

            add a, 2

            ld (ROTY), a

            ld a, (ROTZ)

            add a, 3

            ld (ROTZ), a; ** 1

            ei

            reti

RENDER ld a, (ROTX); * 2

            ld (ROTXX), a

            ld a, (ROTY)

            ld (ROTYY), a

            ld a, (ROTZ)

            ld (ROTZZ), a; ** 2


        ; Rendar abekta, vugly pavarota:

        ; Na X - ROTX

        ; Na Y - ROTY

        ; Na Z - ROTZ


            ret

OUTPUT; vyvad abekta on concealed


            jp nz, OUTPUT0

            ret

KEY; Z - nifiga not natsisnuta

            ret

ROTX db 0
ROTY db 0
ROTZ db 0
ROTXX db 0
ROTYY db 0
ROTZZ db 0


            org ($ / 256 +1) * 256; chankavy concealed
CHBF


  And now all the words:

    SET_IM_2 - Installation IM2;)

    LOOP - a loop that ends only when you
click on a certain key.

    OUTPUT - output chankovogo Scrin.

  And here is the proper method itself:

    INT - Processor preryvaniy.Mezhdu * 1, ** 1 is modified
angles of rotation of the object.

    RENDER - miscalculation obekta.Zamette that mezhvu * 2 ** 2 
is Copy the angles of rotation in the reserve variables, and 
then work is just with them. The reason is that when rendering

donut may not happen one interrupt (for me personally - 4)
on which hangs a change of angles, and if the renderer will use 
the major, it may zaglyuchit.



    And the result is the following: interrupt
(Velocity is the same everywhere) changes object (in this
If the degree of rotation), and in the main prog with a maximum
speed of the object displayed. In this case, if the frequency
percent even 50MHZ, then change only the smoothness of spinning 
and let's say for 5 seconds as well as on 3.5MHZ 50MHZ object

turns on exactly the same number of degrees. Here's how!

ZY Belarusian haters, sorry for the Belarusian
comments in the prog, but simply took a real prog, and I
was just lazy to correct comments (and I myself as a true
Belarusian, write comments in Belarusian)


  Yzussn Kgduya Afkumf (QWERTY)

  Speccy Rulez Fareva (QWERTY)

  Spetstsy Rulez Farezha (YAVERTY)


  Spekki Fareva Rulez!


                                   Steep you kodinga.Sinus / ZGR





Other articles:

Entry - the reasons for registration papers.

Fantasy - What is iskusstvennyy pazum?

Humor - To start papochku anecdotes.

Programming - Synchronization effects in demos at the interruption.


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

Similar articles:
Sharts - Spectrum chart from Demiurge Ash'a and Proxima Centauri ^ CTL.

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