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)

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

:: Felice


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
:: noppa

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:
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)
:: Coko

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 2021-04-19 12:01 | 0.012s | 2097k | Q:20