Пример #1
0
 public static void cps2_eeprom_port_bh(int data)
 {
     data = (data & 0xff) << 8;
     Eeprom.eeprom_write_bit(data & 0x1000);
     Eeprom.eeprom_set_clock_line(((data & 0x2000) != 0) ? LineState.ASSERT_LINE : LineState.CLEAR_LINE);
     Eeprom.eeprom_set_cs_line(((data & 0x4000) != 0) ? LineState.CLEAR_LINE : LineState.ASSERT_LINE);
 }
Пример #2
0
 public static void cps1_eeprom_port_w(int data)
 {
     /*
      * bit 0 = data
      * bit 6 = clock
      * bit 7 = cs
      */
     Eeprom.eeprom_write_bit(data & 0x01);
     Eeprom.eeprom_set_cs_line(((data & 0x80) != 0) ? LineState.CLEAR_LINE : LineState.ASSERT_LINE);
     Eeprom.eeprom_set_clock_line(((data & 0x40) != 0) ? LineState.ASSERT_LINE : LineState.CLEAR_LINE);
 }
Пример #3
0
        public static void cps2_eeprom_port_w(int data)
        {
            //high 8 bits
            {
                /* bit 0 - Unused */
                /* bit 1 - Unused */
                /* bit 2 - Unused */
                /* bit 3 - Unused? */
                /* bit 4 - Eeprom data  */
                /* bit 5 - Eeprom clock */
                /* bit 6 - */
                /* bit 7 - */

                /* EEPROM */
                Eeprom.eeprom_write_bit(data & 0x1000);
                Eeprom.eeprom_set_clock_line(((data & 0x2000) != 0) ? LineState.ASSERT_LINE : LineState.CLEAR_LINE);
                Eeprom.eeprom_set_cs_line(((data & 0x4000) != 0) ? LineState.CLEAR_LINE : LineState.ASSERT_LINE);
            }
            //low 8 bits
            {
                /* bit 0 - coin counter 1 */
                /* bit 0 - coin counter 2 */
                /* bit 2 - Unused */
                /* bit 3 - Allows access to Z80 address space (Z80 reset) */
                /* bit 4 - lock 1  */
                /* bit 5 - lock 2  */
                /* bit 6 - */
                /* bit 7 - */

                /* Z80 Reset */
                Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_RESET, ((data & 0x0008) != 0) ? LineState.CLEAR_LINE : LineState.ASSERT_LINE);

                Generic.coin_counter_w(0, data & 0x0001);
                Generic.coin_counter_w(1, data & 0x0002);

                Generic.coin_lockout_w(0, ~data & 0x0010);
                Generic.coin_lockout_w(1, ~data & 0x0020);
                Generic.coin_lockout_w(2, ~data & 0x0040);
                Generic.coin_lockout_w(3, ~data & 0x0080);

                /*
                 * set_led_status(0,data & 0x01);
                 * set_led_status(1,data & 0x10);
                 * set_led_status(2,data & 0x20);
                 */
            }
        }