Bad Apple on the PicoMite HDMI

Bad Apple on the PicoMite HDMI

Home Forums The Tea Room Bad Apple on the PicoMite HDMI

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #827226
    IanT
    Participant
      @iant

      Yes, not ‘Model Engineering’ I’m afraid but some very impressive PicoMite MMB coding from Marcos (in Spain). Even if you are not interested in micros – you still might enjoy watching ‘Bad Apple’

      Bad Apple

      Regards,

       

      IanT

      #827249
      Michael Gilligan
      Participant
        @michaelgilligan61133

        I had no idea what to expect … but that’s amazing !

        MichaelG.

        #827257
        noel shelley
        Participant
          @noelshelley55608

          INTERESTING ! Noel.

          #827268
          SillyOldDuffer
          Moderator
            @sillyoldduffer

            Worth explaining what ‘Bad Apple!!’ is:

            • The look and sound is from a video game popular 20 years ago.
            • Building on the game’s success, the audio track was remixed by a group and became a worldwide hit.
            • The black and white animation was developed shortly after and became very popular on the web.  (Young people, not grandads!)
            • As the animation is low-resolution black and white, with no gray-scale or colour, it’s since taken off as a “can it run on this?” challenge.  Targets include calculators, Gameboys, early mobile phones and small microcontrollers.
            • Getting BadApple to run on a Pi Pico in MMBasic is impressive because the Pi Pico and MMB Basic are both at their limits. The Pico does not support graphics and has limited memory whilst MMBasic isn’t the fastest language available.
            • Looking at the detail:
              • To do BadApple the Pico is overclocked at 315MHz – smoking hot!
              • MMBasic on it’s own is too slow, project description:  “(160×120, ~6 FPS) – Pure MMBasic, easy to read.
              • The video shared by Ian is an MMBasic/C hybrid: “(320×240, ~22 FPS) – Uses a fast CSUB decoder in C

            Lesson learned is not: ‘MMBasic is wonderful”,  it’s, “the program runs nearly four times faster when the performance critical function is written in C.

            The BadApple challenge is trivial if powerful hardware is allowed.   An ESP32-P4 would eat it whatever language was used.  Easy on a pi4 and most laptops/desktops could display dozens of Badapples at the same time. No problem on a modern phone; they all support graphics in hardware.  Implementing Badapple on a tiny computer is seriously difficult though: the programmer has to apply every performance improvement he can, resulting in advanced code that isn’t easy to read. Getting a Pico to display video at 22 frames per second is a major achievement.  Roughly equivalent to a car cruising at 60mph being overtaken by a souped-up Traction Engine.

            Dave

             

             

            #827278
            noel shelley
            Participant
              @noelshelley55608

              Thanks for that Dave ! I don’t claim to understand in detail but enough to be impressed . Souped up traction engine, My main worry would be which would explode first – The flywheel or the rear wheels ? Using a Case I would consider as cheating !  Noel.

              #827299
              IanT
              Participant
                @iant

                “The Pico does not support graphics and has limited memory whilst MMBasic isn’t the fastest language available”

                Both those statements are correct Dave, although the RP2350 (used in the Pico2) does have HSTX (High Speed Serial Interface) which is a lot more capable than the name might suggest.

                However, the PicoMite firmware, which is now available in twelve ‘flavours’ (dependent on display output and whether for Pico 1 or 2) has extensive language support for graphics, be that LCD, VGA or HDMI displays. The ‘Control Panel’ below was written as a simple demo of the built-in graphic functions available on a simple (MMB) PicoMite with an LCD touch panel. Obviously VGA and HDMI graphics are different in nature – VGA needs one of the PIOs, whilst HDMI needs a Pico2 and uses it HSTX pins.

                MMB Windows Control Panel

                And I agree that MMB may not be the “fastest” language but does it need to be? What I need when building my simple embedded solutions is something that is affordable, easy to learn and quick to de-bug. PicoMites meet my needs in all those respects. They don’t need to be super fast, most of my apps sit in loops waiting for something to happen.

                Dave, you were a professional programmer but I wasn’t. So you look at my ‘saloon’ car and don’t see it’s overall utility. I look at your racing car and know that I don’t need its performance and don’t have the skills to drive it (and have no desire to learn to do so either).

                Regards,

                 

                IanT

                PS That ‘Bad Apple’ demo by Marcos was a first attempt but has sparked some interest from the PicoMite community. I think they have already got the ‘native’ MMB performance up to 15 fpm. Not something that I can help with (for the reasons I’ve outlined above) but they seem to be having fun trying to improve it. I guess it’s a bit like tuning a Ford Escort in your garage…  🙂

                 

                 

                #827350
                IanT
                Participant
                  @iant

                  MMBasic on it’s own is too slow, project description:  “(160×120, ~6 FPS)”

                  “Getting a Pico to display video at 22 frames per second is a major achievement.  Roughly equivalent to a car cruising at 60mph being overtaken by a souped-up Traction Engine.”

                  Quick Update – – – Marcos posted his ‘Bad Apple’ demo mid-day yesterday (with C-Sub) and the PM community has been having a look at his code and finding ways to improve performance. This note was posted by Matherp this lunchtime. He’s using MMB (with no C-sub) @ 320×240 resolution. It seems likely that our Picomite (Traction Engine) may be ‘fast enough’ in this case too.

                  “The average frame time over the whole sequence is now 50.9mSec giving an average of 19.6 FPS”

                  Regards,

                   

                  IanT

                Viewing 7 posts - 1 through 7 (of 7 total)
                • Please log in to reply to this topic. Registering is free and easy using the links on the menu at the top of this page.

                Latest Replies

                Home Forums The Tea Room Topics

                Viewing 25 topics - 1 through 25 (of 25 total)
                Viewing 25 topics - 1 through 25 (of 25 total)

                View full reply list.