Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Screen 13 buffer
#5
So, here's it is, fixed:
Code:
SUB bbput (x%, y%, filename$)
   DIM img%(201)
   DEF SEG = VARSEG(img%(0))
   BLOAD "shipa.put", VARPTR(img%(0))
   wimg% = img%(0) \ 8                                                
   himg% = img%(1)                                                  
   wpage% = page(0) \ 8                                              
   simg% = VARPTR(img%(2))
   spage% = VARPTR(page(2))
   FOR ycnt% = 0 TO himg% - 1
      FOR xcnt% = 0 TO wimg% - 1
         oimg% = wimg% * ycnt% + xcnt% + simg%
         DEF SEG = VARSEG(img%(0))
         pixeltocopy% = PEEK(oimg%)
         IF pixeltocopy% THEN
            opage% = wpage% * (ycnt% + y%) + xcnt% + x% + spage%
            DEF SEG = VARSEG(page(0))
            POKE opage%, pixeltocopy%
         END IF
      NEXT xcnt%
   NEXT ycnt%
   DEF SEG
END SUB

previously, I was using two subs to do this same thing (one loaded the file into the array, and then passed it on to the other)

I now realize that this is what was slowing down my code so much, with this, and the total conversion to short integers, my sub puts grafix to the buffer in about 1/3 to 1/4 the time qbasics put can write them to the screen. Granted I still have to transfer them from the buffer to the screen, but that is rather quick in the overall scheme of things.

thanks for all your help with getting this little thing worked out, I appreciate the responses

Aaron
Reply


Messages In This Thread
Screen 13 buffer - by Aaron - 05-04-2003, 10:37 AM
Screen 13 buffer - by toonski84 - 05-04-2003, 07:06 PM
Screen 13 buffer - by relsoft - 05-05-2003, 10:53 AM
Screen 13 buffer - by Aaron - 05-05-2003, 07:40 PM
Screen 13 buffer - by Aaron - 05-06-2003, 09:00 AM
Screen 13 buffer - by relsoft - 05-09-2003, 12:29 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)