Why does it take so long to fill?

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

Why does it take so long to fill?

riverfish
I'm currently working on Fill.asm and I can get the code to start filling the screen black, but it just takes so long! Definitely not like in the video example where the Professor just hit a single keyboard key and the entire screen went black.

This is how I have set it up in pseudo code:


// Initialize screenPointer to 0
// Once KBD != 0, goto KBDPRESSED:

(KBDPRESSED)
// Check if KBD - (SCREEN + screenPointer) - 1 == 0, if true goto LISTENKBD
  @KBD
  D=A-1
  @screenPointer
  D=D-M
  @SCREEN
  D=D-A
  @LISTENKBD
  D;JEQ

// Else continue to fill screen black
  @SCREEN
  D=A
  @screenPointer
  A=D+M
  M=-1

// Increment screenPointer
  @screenPointer
  M=M+1

  @KBDPRESSED
  0;JMP

General concept is to fill every address from SCREEN to (KBD-1) with -1 using a loop.

Is this method too slow?
Reply | Threaded
Open this post in threaded view
|

Re: Why does it take so long to fill?

xedover
In the CPU Emulator, set the Animation speed to "no animation"
Reply | Threaded
Open this post in threaded view
|

Re: Why does it take so long to fill?

riverfish
Working well now. Cheers