psedo code for fill.asm

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

psedo code for fill.asm

inyeop
initial thought is to use nested loop.  is that right?

for (row=0;row<255;row++)
  for(col=0;col<511;col++)
     SCREEN[32*row + col/16] = -1
Reply | Threaded
Open this post in threaded view
|

Re: psedo code for fill.asm

cadet1620
Administrator
The Screen is 256 x 512 pixels.

The Screen occupies memory addresses 16384..24757 inclusive, so there are 8192 words of memory in the screen. Therefore, each Screen word controls 16 pixels. (Details in 4.2.5.)

You don't need nested loops setting each pixel individually; it is sufficient to set each of the Screen words to all black or all white pixels.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: psedo code for fill.asm

inyeop
Oh I think I got it.  I keep thinking in terms of 2 dimensional table.  Instead, it's sequential, 1 dimensional 8K memory locations.. haha.. thanks!!!