Log In  

btnp seems to completely stop working iff _update60 is used instead of the normal _update

to reproduce:

  1. run the program below
  2. press Esc
  3. type some sort of statement (for some reason the bug only occurs if you type something before typing resume) e.g. ?"hello"
  4. type resume
  5. push or hold down the button (O)

expected: "pushed" will appear onscreen
actual: "pushed" no longer appears onscreen

function _update60()
  pushed = btnp(4)
end

function _draw()
  cls()
  if pushed then
    print("pushed", 52, 60, 8)
  end
end
P#77182 2020-05-25 18:44 ( Edited 2020-05-25 19:18)

1

Ah!

I've seen btnp() stop working on several occasions and I never knew what caused it. Thanks for figuring it out! 👍

I hope it's an easy fix.

P#77184 2020-05-25 18:51
1

Interesting find!

btnp() also bugs out a bit with the regular update, but doesn't stop working completely.
With the reproduction code above, if you swap _update60 to _update and follow the steps, you can see that

  1. A quick button press will no longer register, and
  2. When holding, the text appears, but it blinks a lot faster.

I briefly mentioned this here:
https://www.lexaloffle.com/bbs/?tid=35317
But nice to have this too clearly stated and with a good reproduction method.

P#77188 2020-05-25 20:05 ( Edited 2020-05-25 20:07)

Thank you for this! As noppa mentioned, it doesn't behave as expected with regular _update() either. I thought something was wrong with my program and have spent hours today trying to track down the bug! 😂

P#77582 2020-06-03 05:31

I noticed that after a resume, in _update btnp(X) does not work, but btnp(O) works fine. To be more specific, this only happens after entering a console command.

Steps to reproduce:
1) Hit Esc to halt cartridge
2) Enter a console command (could be anything like 'dir')
3) Enter 'resume' command
4) btnp(X) no longer registers key presses

P#77858 2020-06-09 18:15 ( Edited 2020-06-11 18:31)

I'm also seeing this behaviour using the usual draw function (at 30fps)

P#78387 2020-06-22 08:49

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 08:47:01 | 0.008s | Q:20