ANIMATION ON SPECTRUM'e Most works on this the topic begins with an explanation what a pixel is, what is an attribute... Let's start right away with of what cartoons do tion smooth. Many noted probably in some animation programs more smooth, and in some - less. So, the movement of an object along appears continuous on the screen and smooth if it is synchronized but with the frame rate of television on-line image - 50 hertz (or 50 half frames per second, i.e. 25 full frames per second). On the computer exactly c this frequency per processor interrupt pulse arrives (MI input). The easiest way program synchronization, outputting cabbage sprite on the screen, with impulse interrupts, use this processor command HALT, which stops him before he arrives pulse to input MI (Maskable Interrupt - Maskable Interrupt- tion).In BASIC the same effect achieved by the PAUSE 1 command, but creating animation on BASIC is a thankless task, Let's not consider this for now. If in your program you do not disabled command interruptions DI, and did not turn on the second mode interruptions, then for each pulse MI processor accesses program in ROM, execution of co- which takes a certain amount of time me. When working with several sprites, sometimes every beat processor count, and so once It’s not worth wasting his time it. This is where the second one comes in handy interrupt mode enabled by mandoy IM 2, which is one way or another otherwise used in almost all game programs. In this mode me address to which it is transmitted control by MI signal, set is arbitrary. At this address - there may be a procedure forming an image on the screen not, or the RET command, ensuring providing an immediate return to performance the opinion of the team following the mandoy HALT. Let's take a closer look correct activation of IM2 mode, because are not implemented in SPECTRUM all the features of this mode. High byte of the table address, from which will take the transition address yes, according to the MI signal, must find to be stored in the processor register I. For example, let it be number #5B: LD A,#5BLD I,A The low byte of the address is taken c data bus. Usually in a cycle interrupt confirmation, it may be equal to #FF, but full guarantees that there won't be any any other number, no. Therefore the transition address can be taken starting from #5B00 to #SBFF. Yes how can a number on a data bus be both even and odd, it is necessary that the table the faces of the transitions consisted of one nakovyte bytes, for example #FE. Then, from any address in the range zone #5B00-#SBFF can be taken you two bytes #FE in a row, form- interrupting service address nia #FEFE. Can be used any address consisting of two identical bytes (#8080, #CSCS etc.). Create a table transitions can be done like this: LD HL,#5B00 LD DE,#5B01 LD BC,#0100 LD (HL),#FE ;program address byte service ranges interruptions. LDIR ;filling area memory from 5B00 to SBFF by FE byte Second interrupt mode used not only for syn- chronization of programs that display screen sprites, but more on that later; let's first figure out why sprite mask.
Animation on SPECTRUM - Most works on this topic begin with an explanation of what a pixel is, what an attribute is...
Share your thoughts about the article