ClockworkRobot Posted April 17, 2021 Share Posted April 17, 2021 I've built a simple conversion kit that lets you turn arcade sticks into analogue vectrex controllers. What do you think? https://youtu.be/NAQJgIMtfjU 2 Quote Link to comment Share on other sites More sharing options...
SiLic0ne t0aD Posted April 17, 2021 Share Posted April 17, 2021 I think you've done a great job as usual, Jim! ? If I had some kind of Arcade cabinet to put this in, I'd be all over it! ? Quote Link to comment Share on other sites More sharing options...
biobern Posted July 1, 2021 Share Posted July 1, 2021 That's great! Funny, that I finished today a "poor man's version" of an analog vectrex Flight stick, made only with parts that I happened to have. ? Quote Link to comment Share on other sites More sharing options...
gtoal Posted August 8, 2021 Share Posted August 8, 2021 Here's some sneaky code (easily enough converted to ASM) that will take an analog joystick position and work out the direction of the handle, snapped to 16 compass points. (I eventually managed to tweak this to avoid any expensive divides. There are a few 16 bit comparisons though.) Might come in useful. (Do your own magnitude test if you need that too - remember comparing x^2+y^2 against r^2 is cheaper than comparing the square roots of both and gives the same result.) static const int map[4][5] = { {0, 1, 2, 3, 4}, {8, 7, 6, 5, 4}, {0, 15, 14, 13, 12}, {8, 9, 10, 11, 12} }; int sector(int x, int y) { long tangent; int quadrant = 0; if (x > 0) x = -x; else quadrant |= 2; if (y > 0) y = -y; else quadrant |= 1; if (y != 0) { tangent = (long)x*32L; if (tangent > y*6L ) return map[quadrant][0]; if (tangent > y*21L ) return map[quadrant][1]; if (tangent > y*47L ) return map[quadrant][2]; if (tangent > y*160L) return map[quadrant][3]; } return map[quadrant][4]; } Full test program in http://gtoal.com/vectrex/joystick-direction.c.html 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.