Hey there, i'm trying to code a realtime text zoomscroller but i'm having some issues to find a proper algorithm.
Here is what i have in mind:
assuming that each char is an 8X8 pixel square for example:
00000000
00000000
01111100
01100100
01111100
01100000
01100000
01000000
(this can be the letter P - 1 byte per line)
assuming that i want to zoom from 1X1 to 2X2, for each step of the algorithm i have to double only certain couple of pixels, for x and y like
STEP1 (one step per frame - i double the the border pixels)
//X zoom
foreach row of the char (1 byte)
double pixel (row+0) //first pixel of each row
double pixel (row+7) //Last pixel of each row
endforeach
//Y zoom
foreach col of the char (1 byte, formed by "vertical" pixels)
double pixel (colum+0) //First pixel of each column
double pixel (column+56) //last pixel of each column
endforeach
-----------------------------------------------------------------------
STEP2 (i double the leftborder+1 pixel and rightborder-1 pixels)
//X zoom
foreach row of the char (1 byte)
double pixel (row+1) //second pixel of each row
double pixel (row+6) //last-1 pixel of each row
endforeach
//Y zoom
foreach col of the char (1 byte, formed by "vertical" pixels)
double pixel (colum+1) //Second pixel of each column
double pixel (column+56) //last-1 pixel of each column
endforeach
(repeat for 7 frames to obtain a 1X1 to 2X2 zoom)
What do you think? This effect is quite common in all oldschool demos, so i know that it's doable with my C64. My approach is surely NOT optimized
