Question about speed of drawing

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

Question about speed of drawing

John Douma
I am testing my drawing operations in Screen.jack using the supplied files in ScreenTest. As the test is running I see the objects being drawn. However, if I remove my copy of Screen.jack and just compile Main.jack so that the built-ins are used, the objects get drawn instantaneously. Should my code be that fast?
Reply | Threaded
Open this post in threaded view
|

Re: Question about speed of drawing

cadet1620
Administrator
John Douma wrote
I am testing my drawing operations in Screen.jack using the supplied files in ScreenTest. As the test is running I see the objects being drawn. However, if I remove my copy of Screen.jack and just compile Main.jack so that the built-ins are used, the objects get drawn instantaneously. Should my code be that fast?
Mine works the same way.  I imagine that the VM Emulator's built in system functions are Java and that no VM interpretation is done to run them.  As an experiment you could copy TECS/tools/OS/Screen.vm into your ScreenTest directory to see how the authors' compiled Screen.jack VM code performs compared to yours.

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

Re: Question about speed of drawing

John Douma
I will try that. By the way, thanks a lot for all your replies. I am almost done. I only have the Keyboard and the Sys modules left.
Reply | Threaded
Open this post in threaded view
|

Re: Question about speed of drawing

John
Just in case anyone is looking at old entries I will make a suggestion.  My drawing of rectangles and circles was very slow also since I was drawing lines one pixel at a time.  Remember, though, that the bits in the memory map for a horizontal line will be in contiguous words.  When I went through the effort of changing my code so that for horizontal lines I fill in whole words (16 pixels) at a time with a single mask my drawing speed increased to the same as the provided Screen.vm.  The left and right edges of the lines have to be treated a bit different since the line may start and end in the middle of a word.  It takes a bit of coding, but really isn't that hard, and the change in speed is dramatic.