Some of us on here had discussed coding up a gamepad testing program. I got back to the house yesterday and banged out a little code for that style program. For the time being it is only targeting the SNES style pad. I'm getting a wired PS4 controller for Christmas, so I will add that later on.

The code is rough and crude, and will be uploaded Thursday or Friday (depending on when I get back home). Graphics are just simple Engine BASIC CIRCLEs, LINEs, and some free 32x32 assets for the button images. If it would be better to use real gamepad images, please let me know and I will do that πŸ™‚

Image over at imgur dot come >> [https://imgur.com/gallery/SS84HEx](https://)

Edit: disregard the mouse pointer and the mouse coordinates in the lower left-hand corner πŸ™‚ Having those in place really helped me figure out the best place to place the graphics.

  • Hawk replied to this.

    painintheworld That's cool. I really like how you utilised the mouse to help with the locations on the screen. I'm going to have to keep that in mind.

    I'll test the few USB controllers that I have when you post it. That probably won't be until the weekend.

    When I get it posted, please don't make too much fun of it πŸ™‚

    It is really super simple; each button has a not pressed and a pressed version. The not pressed version is loaded onto the screen as standard 32x32 PNG images. The pressed versions are PNG images loaded as sprites, and then placed in the exact same coordinates. A button press simply toggles a sprite on or off.

    My personal preference for a gamepad for the NG would be to use the same Sont pad as I do with the original BASIC Engine. The two USB to Playstation gamepad adapters I have do not function with the NG. My success rate with different pads has increased a good deal since uli tweaked things a bit....which reminds me that I'm supposed to try some of those pads and report back.

    Should later versions of the program use this style simple graphics or should it show real controller images? I'm torn in a way. Given the nature of the device, I'm leaning towards simple pixel graphics.

    Once we all get a few more controllers tested, should I change later versions to give the option to choose controller style? NES two button style, SNES four button style with shoulder buttons, PS4/Xbox style, etc?

    Any easy to implement ideas are very welcome!

    I like your idea of having images of the controllers, but it will be extra work. Are there few enough standard controllers to try this method?
    Regarding implementation, my testing with the playing cards has shown me how easy it is to use a sprite sheet and just load a portion of the image to a location of the display. I want to create a graphical representation of this to show how to use the LOAD IMAGE Command.
    Basically, I have an image that has all the playing cards on it and I load just the card I want onto the screen.
    I think there should also be some sort of diagnostic screen that outputs the codes returned for each button. I’m assuming how it works, as I haven’t played with controllers yet.

    4 days later

    I think basically the only controllers that will be used will have essentially the same button layout as a two button NES, four button & two shoulder button SNES, and the PS4/Xbox/PS Dual Shock, so you are probably correct πŸ™‚

    My apologies for not getting it posted when I said I would πŸ™ I was in an auto accident and my car was totaled....and it will be this Wednesday or Thursday when I get to the tow truck place to get my stuff out of the car. I had taken my laptop and portable BASIC Engine NG setup with me to the cabin to finish the program...then the wreck. Will get it here soon!

    • Hawk replied to this.

      painintheworld I’m really sorry to hear that you were in a car crash. I hope you are OK. I look forward to you posting your program, but there is no rush. Look after yourself first.

      I had a play with the idea of controller testing, just to try out an idea. This is how far I've gotten so far.
      SNES Controller
      I have the coordinates and size of all the buttons so far except the sholder buttons. The idea is then to replace the default image with a representation of the pressed image at the correct coordinates. The images at the bottom still need to be updated to respresent being pressed. I'm going to test my GIMP skills and see if I can make them look like they are glowing or something.
      Unfortunately, in the default mode that I made it for (480x270) it appears a little squashed.

      16 days later

      Thank you, Hawk. I was messed up for a while. My past includes over 40 surgeries, most on my spine and pelvis. The accident really put a halt on things. My beloved, but nearly worthless, Dell E7450 was broken πŸ™ In any case, I will put it the program soon! I am finally able to move about pretty much like a normal human. Fwiw, GEICO really, REALLY sucks ;(

      • Hawk replied to this.

        painintheworld Had to Google GEICO...now makes sense. ;^)
        If you're using Linux, any old laptop will work for BASIC Engine. Building the full system may take longer, and you may not be able to have as many tabs open in your browser, but over here people are throwing away laptops that are more than adequate...the only thing that they really lack is battery life. Often the battery pack is dead altogether.
        Anyway, to get back on topic, I was playing with the image I posted earlier, and I now have a GIMP image that has each button in a pushed state on a different layer. I also have the sizes and locations for all the buttons. If you'd like to use that, let me know.
        Nevermind...here's the link to the GIMP document.
        GIMP SNES Demo

          Hawk The Dell E7450 had been with me for several years and it worked, day in and day out, without complaining πŸ™‚ I have a couple of recent laptops (one with an I7-10750H and one with an I7-11800H) that I leave at the two main places that I stay at...but my little Dell went with me everywhere πŸ˜€ I carry a couple of hotspot devices for data, and the E7450 also has data service via a Verizon SIM. I got a killer good deal on Christmas night for an older Lenovo T540p, so I will carry it to and fro this winter. We are going to buy a new to us, but still used vehicle next week. When I get that paid down considerably, in a few months, we're getting me an Apple silicon MacBook for taking on the road.

          Thank you for the link! Just downloaded Gimp and checked it out! Yes, I would like to use it πŸ™‚

          I finally connected the broken laptop to a monitor, pulled the code off and onto a microSD card, and in a BASIC Engine NG. This code is quite messy. I will rectify that in a few days.

          Here is a quick YouTube video > [https://www.youtube.com/watch?v=V4ZmT-fW2kE](https://)

          Github > [https://github.com/painintheworld/BASIC-Engine-NG-Gamepad-Testing](https://)
          Please excuse the Github mess, I've not taken the time to learn to use it correctly.

          BASIC Engine Google Drive > Gamepad testing >[https://drive.google.com/drive/folders/1qCVyJfkNuBJfi90RN6PQnLmzwiPxopmD?usp=sharing](https://)

          BASIC Engine Google Drive - General BASIC Engine stuff > [https://drive.google.com/drive/folders/10DggcYqozVR_Sd_LN7d2A3pPJLP5kzbf?usp=sharing](https://)

          The gamepad image is offset to the left on purpose. There will be a sprite that moves to D-pad movements, to the right of the gamepad image. Maybe I will have bullets or small explosions go off with button presses

          I downloaded the Gamepad testing software and got it loaded on the SD card this afternoon. I used it with the gamepad and it works. I will start studying the code to see how you read the gamepad and mouse. Thanks for your hard work on the program.

          Back in the day, I started on a Commodore C-64 and used a joystick. Last weekend we downloaded Asteroids from the forum and used the gamepad with it. I looked at it after using a joystick with 4 directions and a fire button wondering what to do with 10 buttons. My grandson that uses a Nintendo Switch took it and ask how he could play the game with only 10 buttons. I guess that shows the different in our generations.

            Willard Thank you, Willard...but it wasn't hard work. I hope to straighten the code up a bit this weekend.

            The variable STICK is used to store the values returned by PAD(0). Free to use gamepad images for buttons are used for the onscreen gamepad. A differently colored version of those same graphics over overlaid in the same X/Y positions, only as sprites. The sprites are normal turned off, until a button is pressed; at that moment, a SPRITE 1 ON command is issued. Before the program loops back, all sprites are turned back off.

            Powered by: FreeFlarum.
            (remove this footer)