Example #1
0
static void cia1_internal_lightpen_check(BYTE pa, BYTE pb)
{
    BYTE val = 0xff;
    BYTE msk = pa & ~joystick_value[2];
    BYTE m;
    int i;

    for (m = 0x1, i = 0; i < 8; m <<= 1, i++) {
        if (!(msk & m)) {
            val &= ~keyarr[i];
        }
    }

    m = val & pb & ~joystick_value[1];

    vicii_set_light_pen(maincpu_clk, !(m & 0x10));
}
Example #2
0
static void cia1_internal_lightpen_check(BYTE pa, BYTE pb)
{
    BYTE val = 0xff;
    BYTE msk = pa & read_joyport_dig(JOYPORT_2);
    BYTE m;
    int i;

    if (c64keyboard_active) {
        for (m = 0x1, i = 0; i < 8; m <<= 1, i++) {
            if (!(msk & m)) {
                val &= ~keyarr[i];
            }
        }
    }

    m = val & pb & read_joyport_dig(JOYPORT_1);

    vicii_set_light_pen(maincpu_clk, !(m & 0x10));
}