Giter Site home page Giter Site logo

Configure Joystick for vice.js about vice.js HOT 4 OPEN

nodepond avatar nodepond commented on September 24, 2024
Configure Joystick for vice.js

from vice.js.

Comments (4)

nodepond avatar nodepond commented on September 24, 2024

There seems to be some news, at this thread:
https://www.forum64.de/index.php?thread/106793-emulator-im-browser/&postID=1630975#post1630975

Seems, that Vice3.4 makes joystick-configuraion via command-line params possible.

I was wondering how difficult i would be, to update this repo to the latest version of vice? If you need help, I could also help or assist... Greetings from Scene World.

from vice.js.

rjanicek avatar rjanicek commented on September 24, 2024

from vice.js.

nodepond avatar nodepond commented on September 24, 2024

Hi. Maybe I was a little but too euphoric. It seems the solution from the user on Forum64 does actually not work, because the parameter he proposed are actually not command-line parameters, but params read from a config-file.

So updating the version of VICE would not really help on this issue so it seems.

from vice.js.

nodepond avatar nodepond commented on September 24, 2024

Another last question. I've found some "living example", where at least emulated joystick-buttons work on the web.

I looked at the code, and wonder how this joystick_set_value_and and joystick_set_value_or commands work? The look similar to keyboard_key_pressed that you can send directly to the emulator with i.e. Module.ccall('keyboard_key_released','undefined',['number'],[121])

I found the joystick_set_value_and-commands at the end of this file:
https://vice.janicek.co/js/index.js

At this example:
https://vice.janicek.co/c64/

For reference, in this passage here:
function c(e){return t.JOYSTICK_BITS[$(e.currentTarget).attr("joystick")]}var f={};f[o.ALT]=t.JOYSTICK_BITS.FIRE,f[o.KP1]=t.JOYSTICK_BITS.SOUTHWEST,f[o.KP2]=t.JOYSTICK_BITS.SOUTH,f[o.KP3]=t.JOYSTICK_BITS.SOUTHEAST,f[o.KP4]=t.JOYSTICK_BITS.WEST,f[o.KP5]=t.JOYSTICK_BITS.SOUTH,f[o.KP6]=t.JOYSTICK_BITS.EAST,f[o.KP7]=t.JOYSTICK_BITS.NORTHWEST,f[o.KP8]=t.JOYSTICK_BITS.NORTH,f[o.KP9]=t.JOYSTICK_BITS.NORTHEAST,u.onChange(e),e(),$("#joystickPort").on("click",n),$("[joystick]").on("mousedown touchstart",(function(e){var n=c(e);t.joystick_set_value_or(a.port,n)})).on("mouseup touchend",(function(e){var n=c(e);t.joystick_set_value_and(a.port,~n)})),$(document).on("keydown",(function(e){var r=f[e.which];r&&t.joystick_set_value_or(a.port,r),e.which===o.KP_SUBTRACT&&n()})).on("keyup",(function(e){var n=f[e.which];n&&t.joystick_set_value_and(a.port,~n)}))};t.exports=a},function(t,e,n){"use strict";var r={each:n(0)},o=n(2),u=n(4),i=n(15),a=n(36);t.exports=function(t){function e(){var t=u.getArguments(o.get()).keys;t&&($("#virtualKeys").empty(),r.each(t,(function(t,e){var n=a[e];t=t||n.label;var r=n.code,o=$('<button class="btn btn-lg btn-primary" title="'+e+'">'+t+"</button>");

from vice.js.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.