Пример #1
0
        public static void frame_update_analog_field_quester_p1(analog_field_state analog)
        {
            bool keypressed = false;
            int  delta      = 0;
            int  value2;

            value2          = apply_analog_min_max(analog, analog.accum);
            analog.previous = analog.accum = value2;
            if (Keyboard.IsPressed(Key.Left))
            {
                keypressed         = true;
                delta             -= analog_p0.delta * 0x200;
                analog.lastdigital = 1;
            }
            if (Keyboard.IsPressed(Key.Right))
            {
                keypressed         = true;
                delta             += analog_p0.delta * 0x200;
                analog.lastdigital = 2;
            }
            analog.accum += delta;
            if (!keypressed)
            {
                analog.lastdigital = 0;
            }
        }
Пример #2
0
        public static int apply_analog_min_max(analog_field_state analog, int value)
        {
            int adjmin = (analog.minimum * 100) / analog.sensitivity;
            int adjmax = (analog.maximum * 100) / analog.sensitivity;
            int adj1   = (512 * 100) / analog.sensitivity;
            int adjdif = adjmax - adjmin + adj1;

            if (analog.reverse != 0)
            {
                while (value <= adjmin - adj1)
                {
                    value += adjdif;
                }
                while (value > adjmax)
                {
                    value -= adjdif;
                }
            }
            else
            {
                while (value >= adjmax + adj1)
                {
                    value -= adjdif;
                }
                while (value < adjmin)
                {
                    value += adjdif;
                }
            }
            return(value);
        }
Пример #3
0
        public static void frame_update_analog_field_forgottn_p1(analog_field_state analog)
        {
            bool keypressed = false;
            int  delta      = 0;
            int  value2;

            value2 = apply_analog_min_max(analog, analog.accum);
            if (analog.accum != value2)
            {
                int i1 = 1;
            }
            analog.previous = analog.accum = value2;
            if (Keyboard.IsPressed(Key.NumPad2))
            {
                keypressed         = true;
                delta             -= analog_p0.delta * 0x200;
                analog.lastdigital = 1;
            }
            if (Keyboard.IsPressed(Key.NumPad3))
            {
                keypressed         = true;
                delta             += analog_p0.delta * 0x200;
                analog.lastdigital = 2;
            }
            analog.accum += delta;
            if (!keypressed)
            {
                analog.lastdigital = 0;
            }
        }
Пример #4
0
        public static uint input_port_read_direct(analog_field_state analog)
        {
            uint result;
            int  value;
            long nsec_since_last;

            nsec_since_last = Attotime.attotime_to_attoseconds(Attotime.attotime_sub(Timer.get_current_time(), portdata.last_frame_time)) / Attotime.ATTOSECONDS_PER_NANOSECOND;
            value           = (int)(analog.previous + ((long)(analog.accum - analog.previous) * nsec_since_last / portdata.last_delta_nsec));
            result          = (uint)apply_analog_settings(value);
            return(result);
        }
Пример #5
0
        public static void input_port_init()
        {
            portdata = new input_port_private();
            switch (Machine.sBoard)
            {
            case "CPS-1":
            case "CPS-1(QSound)":
                loop_inputports_callback = CPS.loop_inputports_cps1_6b;
                record_port_callback     = CPS.record_portC;
                replay_port_callback     = CPS.replay_portC;
                analog_p0             = new analog_field_state();
                analog_p1             = new analog_field_state();
                analog_p0.adjdefvalue = 0;
                analog_p1.adjdefvalue = 0;
                analog_p0.sensitivity = 100;
                analog_p1.sensitivity = 100;
                analog_p0.reverse     = 0;
                analog_p1.reverse     = 0;
                analog_p0.delta       = 20;
                analog_p1.delta       = 20;
                analog_p0.minimum     = 0;
                analog_p1.minimum     = 0;
                analog_p0.maximum     = 0x1ffe00;
                analog_p1.maximum     = 0x1ffe00;
                analog_p0.reverse_val = 0x200000;
                analog_p1.reverse_val = 0x200000;
                analog_p0.scalepos    = 0x8000;
                analog_p1.scalepos    = 0x8000;
                analog_p0.scaleneg    = 0x8000;
                analog_p1.scaleneg    = 0x8000;
                break;

            case "CPS2":
                loop_inputports_callback = CPS.loop_inputports_cps2_2p6b;
                record_port_callback     = CPS.record_portC2;
                replay_port_callback     = CPS.replay_portC2;
                analog_p0             = new analog_field_state();
                analog_p1             = new analog_field_state();
                analog_p0.adjdefvalue = 0;
                analog_p1.adjdefvalue = 0;
                analog_p0.sensitivity = 100;
                analog_p1.sensitivity = 100;
                analog_p0.reverse     = 0;
                analog_p1.reverse     = 0;
                analog_p0.delta       = 20;
                analog_p1.delta       = 20;
                analog_p0.minimum     = 0;
                analog_p1.minimum     = 0;
                analog_p0.maximum     = 0x1ffe00;
                analog_p1.maximum     = 0x1ffe00;
                analog_p0.reverse_val = 0x200000;
                analog_p1.reverse_val = 0x200000;
                analog_p0.scalepos    = 0x8000;
                analog_p1.scalepos    = 0x8000;
                analog_p0.scaleneg    = 0x8000;
                analog_p1.scaleneg    = 0x8000;
                break;

            case "Neo Geo":
                loop_inputports_callback = Neogeo.loop_inputports_neogeo_standard;
                record_port_callback     = Neogeo.record_port;
                replay_port_callback     = Neogeo.replay_port;
                analog_p0             = new analog_field_state();
                analog_p1             = new analog_field_state();
                analog_p0.adjdefvalue = 0;
                analog_p1.adjdefvalue = 0;
                analog_p0.sensitivity = 10;
                analog_p1.sensitivity = 10;
                analog_p0.reverse     = 1;
                analog_p1.reverse     = 1;
                analog_p0.delta       = 20;
                analog_p1.delta       = 20;
                analog_p0.minimum     = 0;
                analog_p1.minimum     = 0;
                analog_p0.maximum     = 0x1fe00;
                analog_p1.maximum     = 0x1fe00;
                analog_p0.reverse_val = 0x20000;
                analog_p1.reverse_val = 0x20000;
                analog_p0.scalepos    = 0x8000;
                analog_p1.scalepos    = 0x8000;
                analog_p0.scaleneg    = 0x8000;
                analog_p1.scaleneg    = 0x8000;
                break;

            case "Namco System 1":
                loop_inputports_callback = Namcos1.loop_inputports_ns1_3b;
                record_port_callback     = Namcos1.record_port;
                replay_port_callback     = Namcos1.replay_port;
                analog_p0             = new analog_field_state();
                analog_p1             = new analog_field_state();
                analog_p0.adjdefvalue = 0;
                analog_p1.adjdefvalue = 0;
                analog_p0.sensitivity = 30;
                analog_p1.sensitivity = 30;
                analog_p0.reverse     = 0;
                analog_p1.reverse     = 0;
                analog_p0.delta       = 15;
                analog_p1.delta       = 15;
                analog_p0.minimum     = 0;
                analog_p1.minimum     = 0;
                analog_p0.maximum     = 0x1fe00;
                analog_p1.maximum     = 0x1fe00;
                analog_p0.reverse_val = 0x20000;
                analog_p1.reverse_val = 0x20000;
                analog_p0.scalepos    = 0x8000;
                analog_p1.scalepos    = 0x8000;
                analog_p0.scaleneg    = 0x8000;
                analog_p1.scaleneg    = 0x8000;
                break;

            case "IGS011":
                loop_inputports_callback = IGS011.loop_inputports_igs011_drgnwrld;
                record_port_callback     = IGS011.record_port;
                replay_port_callback     = IGS011.replay_port;
                break;

            case "PGM":
                loop_inputports_callback = PGM.loop_inputports_pgm_standard;
                record_port_callback     = PGM.record_port;
                replay_port_callback     = PGM.replay_port;
                break;
            }
            switch (Machine.sName)
            {
            case "forgottn":
            case "forgottna":
            case "forgottnu":
            case "forgottnue":
            case "forgottnuc":
            case "forgottnua":
            case "forgottnuaa":
            case "lostwrld":
            case "lostwrldo":
                loop_inputports_callback = CPS.loop_inputports_cps1_forgottn;
                break;

            case "sf2ebbl":
            case "sf2ebbl2":
            case "sf2ebbl3":
            case "sf2amf2":
            case "sf2m2":
            case "sf2m4":
            case "sf2m5":
            case "sf2m6":
            case "sf2m7":
            case "sf2yyc":
            case "sf2koryu":
                loop_inputports_callback = CPS.loop_inputports_cps1_sf2hack;
                break;

            case "cworld2j":
            case "cworld2ja":
            case "cworld2jb":
            case "qad":
            case "qadjr":
            case "qtono2j":
                loop_inputports_callback = CPS.loop_inputports_cps1_cworld2j;
                break;

            case "ecofghtr":
                loop_inputports_callback = CPS.loop_inputports_cps2_ecofghtr;
                break;

            case "qndream":
                loop_inputports_callback = CPS.loop_inputports_cps2_qndream;
                break;

            case "irrmaze":
                loop_inputports_callback = Neogeo.loop_inputports_neogeo_irrmaze;
                break;

            case "quester":
            case "questers":
                loop_inputports_callback = Namcos1.loop_inputports_ns1_quester;
                break;

            case "berabohm":
                loop_inputports_callback = Namcos1.loop_inputports_ns1_berabohm;
                break;

            case "faceoff":
                loop_inputports_callback = Namcos1.loop_inputports_ns1_faceoff;
                break;

            case "tankfrce4":
                loop_inputports_callback = Namcos1.loop_inputports_ns1_tankfrce4;
                break;

                /*case "":
                 * case "":
                 *  loop_inputports_callback = IGS011.loop_inputports_igs011_drgnwrldj;
                 *  break;*/
            }
        }