Code Monkey home page Code Monkey logo

guncon3's People

Contributors

beardypig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

guncon3's Issues

mame setup

been trying to use the gcon3 with MAME but without sucess. in the games menu, it gets recognized, but not ingame

guncon3_decode correction

I have corrected the error of the random numbers when the stick is placed in certain positions. I signed the variables, a_sum,b_sum and key_offset

static int guncon3_decode(unsigned char *data, const unsigned char *key) {
    int x, y, key_index;
    unsigned char bkey, keyr, byte;
    s32 a_sum, b_sum;
    s32 key_offset;

    b_sum = ((data[13] ^ data[12]) + data[11] + data[10] - data[9] - data[8]) ^ data[7];
    b_sum&=0xFF;
    a_sum = (((data[6] ^ b_sum) - data[5] - data[4]) ^ data[3]) + data[2] + data[1] - data[0];
    a_sum &=0xFF;
    if (a_sum != key[7]) {
        if (debug)
            printk(KERN_ERR "checksum mismatch: %02x %02x\n", a_sum, key[7]);
        return -1;
    }

    key_offset = (((((key[1] ^ key[2]) - key[3] - key[4]) ^ key[5]) + key[6] - key[7]) ^ data[14]) + (unsigned char)0x26;
    key_offset &= 0xFF;
    key_index = 4;

    //byte E is part of the key offset
    // byte D is ignored, possibly a padding byte - make the checksum workout
    for (x = 12; x >= 0; x--) {
        byte = data[x];
        for (y = 4; y > 1; y--) { // loop 3 times
            key_offset--;

            bkey = KEY_TABLE[key_offset + 0x41];
            keyr = key[key_index];
            if (--key_index == 0)
                key_index = 7;

            if ((bkey & 3) == 0)
                byte =(byte - bkey) - keyr;
            else if ((bkey & 3) == 1)
                byte = ((byte + bkey) + keyr);
            else
                byte = ((byte ^ bkey) ^ keyr);
        }
        data[x] = byte;
    }
    return 0;
}

Button presses generate when joysticks in certain positions

When either of the joysticks are held in a certain position, somewhere along the North East axis there are a lot of button presses generated, it appears like noise - looking at the raw data from the Guncon there is no such noise and the signal remains stable.

Can you do the same for Guncon2?

Hello, we are the development team of RGB-Pi, we work on a soft to emulate on raspberry and tube TV, an extremely interesting function would be to use lightguns synchronized on the CRT itself, we just need to be able to communicate with the gun, is possible to repeat the hack you made for guncon3 with a guncon2? It would be very appreciated.

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.