Jump to content

Photo

running out of time or what?


4 replies to this topic

#1 kisrael OFFLINE  

kisrael

    HMBL 2600 coder

  • 4,059 posts
  • Location:Boston Burbs, MA

Posted Mon Jan 15, 2018 9:36 AM

So, here's a stripped down version of my golem moving - the most relevant bit is this loop, which I do to erase all the old squares of it and then again to put them in the new place

cursorX = golemX
cursorY = golemY
for counter = 0 to GOLEM_END
  cursorX = golemShapeX[counter]
  cursorX = golemX + cursorX
  cursorY = golemShapeY[counter]
  cursorY = golemY + cursorY
  pfpixel cursorX cursorY on
next counter

GOLEM_END is 21 (because golemShape data goes up to 22)

If i set GOLEM_END to like 10, things are fine.

 

Am I running into a simple out of time problem, so dropping a frame? 

 

Trying to confirm that is the problem, and ways around it:

* maybe sread() is more efficient?

* maybe drawing pixels "hardcoded" (though each would be an offset from golemX and golemY) and/or doing pfvlines would be faster?

* in theory i could just used fixed playfields for a set number of positions of the golem, and do a full screen clear

Of course there's always

* just accept the screenflick and say the earth shakes as the golem walks :-D

 

 

I don't know if a hardcoded set of draw instructions (maybe even pfvline ) would be more efficient, or if I should draw it once 

Attached Files


Edited by kisrael, Mon Jan 15, 2018 9:43 AM.


#2 kisrael OFFLINE  

kisrael

    HMBL 2600 coder

  • Topic Starter
  • 4,059 posts
  • Location:Boston Burbs, MA

Posted Mon Jan 15, 2018 11:41 AM

Quick answer: unrolling the loop, so to speak, and setting the pfpixels I want "by hand" seems to work better



#3 bogax OFFLINE  

bogax

    Dragonstomper

  • 761 posts

Posted Mon Jan 15, 2018 8:15 PM

sped it up a little, but not enough

Attached Files



#4 kisrael OFFLINE  

kisrael

    HMBL 2600 coder

  • Topic Starter
  • 4,059 posts
  • Location:Boston Burbs, MA

Posted Tue Jan 16, 2018 8:33 AM

Thanks for looking!

 

Made a lot of progress yesterday, with the "unpacked to a lot of inc/dec" version. Still getting the odd blank frame, and still a bit more code to write, but we'll see



#5 bogax OFFLINE  

bogax

    Dragonstomper

  • 761 posts

Posted Tue Jan 16, 2018 5:57 PM

If you can clear the whole screen instead of just the Golem

 

 

Attached Files






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users