Flappy Bird in App Loader broken?

Posted on
  • Welcome back and congratulations to you both Gordon!! I hope everyone is thriving.

    Not a hugely important one but it's hitting everyone we've given a Bangle.js to:

    The Flappy Bird app.js code runs fine on a Bangle.js if you paste it into the Web IDE and run from RAM (or use the emulator) but when I install it as an app from the App Loader (or create an offline version of it), it hangs on "Loading..." if I try to launch it.

    Commenting out

    Bangle.setLCDMode("120x120");
    

    strangely worked but obviously resulted in a trashed display. No errors being shown anywhere so not sure where to look further.

    I did see

    Execution Interrupted
    New interpreter error: LOW_MEMORY,MEMORY
    

    once in the Web IDE after pasting Bangle.setLCDMode("120x120"); directly but that may just be a coincidence.

    I also changed the code not to use onInit(); in case that was causing some issue but that was a red herring.

    Is there some behaviour difference between that code running from RAM and running from Flash?

    I've tried multiple firmware versions including today's nightly but no joy.

  • I just deleted all apps and erased storage on a device. Then I reinstalled Bootloader, Morphing Clock and Flappy Bird only. It worked! So is it the Settings app or something else that's using up RAM (presumably) even when running other apps?

  • Annnnd confirmed. It's the Settings App. As soon as I installed it, Flappy Bird stopped working. Interestingly the opposite happened with Morphing Clock. Didn't work until I re-installed Settings.

  • Hmm, thanks! Do you have an up to date firmware version, or are you still using the Nodeconf one?

    I made some changes to settings but it looks like they may depend on features found in the newer firmwares.

  • Using the latest from the download page (several versions over the past 2 weeks or so). Also tried most recent nightly.

  • Thanks - just tried this and reproduced. Looks like something has happened which is getting Bangle.setLCDMode into an odd state. It seems to switch to normal/doublebuffered/80x80, but the 'fast' 120x120 mode doesn't work.

    It doesn't seem to be updating g.buffer either so it must be some internal state - I'll look into it today.

  • Thanks Gordon. Possibly related, as it uses the screen heavily - Jhey's Hypno Rings app now causes a hard crash of the watch when launched even tho he hasn't changed the code since NCEU. Have to reboot watch after launching. I think it gets as far as displaying one pixel. Tried it as copy/paste in REPL and it causes the same crash with no errors shown. Also crashes emulator and causes Chrome tab to hang.

  • Ok, just tracked this one down. It's not a bug as such - just not enough memory left to allocate the buffer as one flat string. I've pushed some firmware changes that should fix it.

    Out of interest, what clock face are you using? I discovered that if you've got a custom font, it gets left inside the Graphics class even when clear(1) is called - so that's something else that can cause memory issues. I'll get that fixed.

    Also crashes emulator and causes Chrome tab to hang

    Wow, nasty. Turns out it's the new g.drawEllipse that was added to give nicer edges. It seems not to like small circles - I'll get that one fixed in the next few minutes

  • ...the world is just not 'linear' when it comes to things just a few pixels in size.

    About the subject: is there a way to 'unregister' a font? I noticed when writing my emulation for the Graphics class that 'registration' is very dynamic and nicely tucked away.

    Since al font in itself is static/read only, it would be nice to have some more control over what kind of memory is used (don't expect me to be aware of the possible ramification of what I'm asking for... a grain of salt at be required here).

  • is there a way to 'unregister' a font?

    Adding a custom font just adds a function like Graphics.prototype.setMyMagicFontso you should just be able to delete Graphics.prototype.setMyMagicFont

  • In deed... nevertheless I'd prefer something along the lines the require, where a string identifies the font... In my most recent UI version I allow multiple fonts in an indexed palette and keep the methods in that mapping to pick the font... after all, code competes with source code size... inherent to Espruino and is opposed to verbosity. Not an easy task to get opposites into a smooth marriage, even though opposites attract. (Some of the function/methods names in the new NRF/BLE world are just egregious long... and the devices' memory is less than the trend was after the Espruino Original STM32 chip... : )

  • Thanks Gordon! Mostly using stock morphing clock but had big clock on one device. I'll test latest build today.

  • Just confirming that both Flappy Bird and Hypno Rings are working on the latest nightly build. Thanks again Gordon.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Flappy Bird in App Loader broken?

Posted by Avatar for ConorONeill @ConorONeill

Actions