Coding - Dithering: To output one line, to output two lines.

Psychoz #11
:##%##########:: про кодинг?.. ::###########%##:
                                                
(с) Dark^х-trade                                
                                                
              Dithering 2*2=1b ;)               
                                                
1. Для вывода одной строки:                     
                                                
POP hl   ; hl = tttcccco tttcccco ==> 8k table  
lD A,(hl);(hl)= ddddoooo                        
POP hl                                          
InC l                                           
OR (hl)  ;(hl)= oooodddd                        
lD (DE),A                                       
InC Е                                           
                                                
    итого: ч9 тактов = 12.25т/о.5п = 2ч.5т/п    
                                                
    на  полный  экран  (12288  байт)  т.о. уйдет
эо1o5b  тактов  = ч.2 фрейма :( так что актуален
интерлейсинг  -  в  первом кадре рисуются четные
строки,  во втором нечетные. Это не только вдвое
сократит  время  дитеринга,  но еще и организует
подобие motion blur'а :)Naturally, this must be done on one
screen, otherwise there will be a mess.                       
                                                
2. To output two lines:                       
                                                
as always, we draw with a meander (snake).           
                                                
POP hl ;ttocccco ttocccco ==> 1bk table       
lD C,(hl);lllloooo bottom line                
InC l                                           
lD A,(hl);hhhhoooo top line               
POP hl                                          
SEt 5.l                                         
OR(hl);  oooohhhh                              
lD(DE),A                                       
InC D                                           
InC l                                           
lD A,C                                          
OR (hl);  oooolll                              
lD(DE),A                                       
InC E                                           
                                                
;9o                                             
POP hl                                          
lD A,(hl);llllooooInC l                                           
lD C,(hl);hhhhoooo                              
POP hl                                          
SEt 5.l                                         
InC l                                           
OR(hl);  oooolll                              
lD(DE),A                                       
DEC D                                           
DEC l                                           
lD A,C                                          
OR (hl);  oooohhhh                              
lD(DE),A                                       
InC E                                           
;9h                                             
                                                
;9o*9h=18h for 8 full pixels = 2e t/p        
                                                
 thus. snatched another 1.5 t/p Hurray!               
                                                
    Now the entire screen output takes 282b2h
tact.                                          
                                                
 sweat: we should not forget that the pattern has
size h*h, therefore for case (1) it is necessary for each
line to change the table (h option). For the occasion
(2) you need to change the table for every pair of rows (2
option).     

Share your thoughts about the article