Log In  


I have this bit of code:

  if f==1635 then
   sspr(0,32,128,64,64,64)
   sspr(0,32,128,64,-64,64,128,64,true,false)
   sspr(0,32,128,64,-64,0,128,64,true,true)
   sspr(0,32,128,64,64,0,128,64,false,true)
  end

which causes the CPU load in a demo I'm working on to go over 1.0, even when f!=1635. If I comment out the sspr functions, the demo runs at 60fps. Is this speculative execution as planned, or is this a bug?

EDIT: I was able to drop the CPU load back under 1.0 by doing it as a separate function, like this:

function drawthese()
 sspr(0,32,128,64,64,64)
 sspr(0,32,128,64,-64,64,128,64,true,false)
 sspr(0,32,128,64,-64,0,128,64,true,true)
 sspr(0,32,128,64,64,0,128,64,false,true)
end

...

  if f==1635 then drawthese() end
1


I tried to repro it in a blank cart with this snippet but couldn't see any difference on PC, either by commenting out the sspr calls or deleting them:

function _update()
 --for f=0,999 do
 if f==1635 then
  sspr(0,32,128,64,64,64)
  sspr(0,32,128,64,-64,64,128,64,true,false)
  sspr(0,32,128,64,-64,0,128,64,true,true)
  sspr(0,32,128,64,64,0,128,64,false,true)
 end
 --end

 cls()
 print(tostr(stat(1),true))
 print(tostr(stat(2),true))
end

function _draw()
 -- also tried the same here
end


Strangely, I was also unable to reproduce this at any other part in my code. Unfortunately I can't post the whole code where this occurs quite yet, but I'll keep a copy of the working stage that reproes this and post it after the demoparty where I intend to enter this demo.



[Please log in to post a comment]