Ejemplo n.º 1
0
        // configuration
        //auto data_pending_callback() { return m_data_pending_cb.bind(); }
        //void set_separate_acknowledge(bool ack) { m_separate_acknowledge = ack; }


        //DECLARE_READ_LINE_MEMBER(pending_r);

        //DECLARE_READ8_MEMBER( acknowledge_r );
        //DECLARE_WRITE8_MEMBER( acknowledge_w );


        //-------------------------------------------------
        //  device_start - device-specific startup
        //-------------------------------------------------
        protected override void device_start()
        {
            m_data_pending_cb.resolve_safe();
            save_item(m_latch_written, "m_latch_written");

            // synchronization is needed since other devices may not be initialized yet
            machine().scheduler().synchronize(init_callback);
        }
Ejemplo n.º 2
0
Archivo: i8257.cs Proyecto: kwanboy/mcs
        // device-level overrides
        protected override void device_start()
        {
            m_diexec = GetClassInterface <device_execute_interface_i8257>();


            LOG("{0}\n", "device_start"); //FUNCNAME);

            // set our instruction counter
            set_icountptr(m_icountRef);

            // resolve callbacks
            m_out_hrq_cb.resolve_safe();
            m_out_tc_cb.resolve_safe();
            m_in_memr_cb.resolve_safe(0);
            m_out_memw_cb.resolve_safe();
            foreach (var cb in m_in_ior_cb)
            {
                cb.resolve_safe(0);
            }
            foreach (var cb in m_out_iow_cb)
            {
                cb.resolve_safe();
            }
            foreach (var cb in m_out_dack_cb)
            {
                cb.resolve_safe();
            }

            // state saving
            save_item(m_msb, "m_msb");
            save_item(m_hreq, "m_hreq");
            save_item(m_hack, "m_hack");
            save_item(m_ready, "m_ready");
            save_item(m_state, "m_state");
            save_item(m_current_channel, "m_current_channel");
            save_item(m_last_channel, "m_last_channel");
            save_item(m_transfer_mode, "m_transfer_mode");
            save_item(m_status, "m_status");
            save_item(m_request, "m_request");

            save_item(m_channel[0].m_address, "m_channel[0].m_address");
            save_item(m_channel[0].m_count, "m_channel[0].m_count");
            save_item(m_channel[0].m_mode, "m_channel[0].m_mode");
            save_item(m_channel[1].m_address, "m_channel[1].m_address");
            save_item(m_channel[1].m_count, "m_channel[1].m_count");
            save_item(m_channel[1].m_mode, "m_channel[1].m_mode");
            save_item(m_channel[2].m_address, "m_channel[2].m_address");
            save_item(m_channel[2].m_count, "m_channel[2].m_count");
            save_item(m_channel[2].m_mode, "m_channel[2].m_mode");
            save_item(m_channel[3].m_address, "m_channel[3].m_address");
            save_item(m_channel[3].m_count, "m_channel[3].m_count");
            save_item(m_channel[3].m_mode, "m_channel[3].m_mode");
        }
Ejemplo n.º 3
0
Archivo: m6801.cs Proyecto: kwanboy/mcs
        //void m6801_clock_serial();


        // device-level overrides
        protected override void device_resolve_objects()
        {
            foreach (var cb in m_in_port_func)
            {
                cb.resolve_safe(0xff);
            }

            foreach (var cb in m_out_port_func)
            {
                cb.resolve_safe();
            }

            m_out_sc2_func.resolve_safe();
            m_out_sertx_func.resolve_safe();
        }
Ejemplo n.º 4
0
        //DECLARE_WRITE_LINE_MEMBER(s1_w);
        //DECLARE_WRITE_LINE_MEMBER(s2_w);


        // device-level overrides
        protected override void device_start()
        {
            m_vck_cb.resolve_safe();
            m_vck_legacy_cb.resolve();

            /* compute the difference tables */
            compute_tables();

            /* stream system initialize */
            m_stream        = machine().sound().stream_alloc(this, 0, 1, (int)clock());
            m_vck_timer     = timer_alloc(TIMER_VCK);
            m_capture_timer = timer_alloc(TIMER_ADPCM_CAPTURE);

            /* register for save states */
            save_item(m_data, "m_data");
            save_item(m_vck, "m_vck");
            save_item(m_reset, "m_reset");
            save_item(m_s1, "m_s1");
            save_item(m_s2, "m_s2");
            save_item(m_bitwidth, "m_bitwidth");
            save_item(m_signal, "m_signal");
            save_item(m_step, "m_step");
        }
Ejemplo n.º 5
0
        }                                                                               //template <std::size_t Port> auto write_r() { return m_write_r[Port].bind(); }

        // SI: serial input
        //auto read_si() { return m_read_si.bind(); }

        // SO: serial output
        //auto write_so() { return m_write_so.bind(); }


        //static void set_pla(device_t &device, UINT8 *pla) { downcast<mb88_cpu_device &>(device).m_PLA = pla; }


        //DECLARE_WRITE_LINE_MEMBER( clock_w );


        //void data_4bit(address_map &map);
        //void data_5bit(address_map &map);
        //void data_6bit(address_map &map);
        //void data_7bit(address_map &map);
        //void program_10bit(address_map &map);
        //void program_11bit(address_map &map);
        //void program_9bit(address_map &map);


        // device-level overrides

        /***************************************************************************
        *   INITIALIZATION AND SHUTDOWN
        ***************************************************************************/
        protected override void device_start()
        {
            m_dimemory = GetClassInterface <device_memory_interface_mb88>();
            m_diexec   = GetClassInterface <device_execute_interface_mb88>();
            m_distate  = GetClassInterface <device_state_interface_mb88>();


            m_program = m_dimemory.space(AS_PROGRAM);
            m_cache   = m_program.cache(0, 0, (int)endianness_t.ENDIANNESS_BIG);
            m_data    = m_dimemory.space(AS_DATA);

            m_read_k.resolve_safe(0);
            m_write_o.resolve_safe();
            m_write_p.resolve_safe();
            foreach (var cb in m_read_r)
            {
                cb.resolve_safe(0);
            }
            foreach (var cb in m_write_r)
            {
                cb.resolve_safe();
            }
            m_read_si.resolve_safe(0);
            m_write_so.resolve_safe();

            m_serial = machine().scheduler().timer_alloc(serial_timer);  //timer_expired_delegate(FUNC(mb88_cpu_device::serial_timer), this));

            m_ctr = 0;

            save_item(m_PC, "m_PC");
            save_item(m_PA, "m_PA");
            save_item(m_SP[0], "m_SP[0]");
            save_item(m_SP[1], "m_SP[1]");
            save_item(m_SP[2], "m_SP[2]");
            save_item(m_SP[3], "m_SP[3]");
            save_item(m_SI, "m_SI");
            save_item(m_A, "m_A");
            save_item(m_X, "m_X");
            save_item(m_Y, "m_Y");
            save_item(m_st, "m_st");
            save_item(m_zf, "m_zf");
            save_item(m_cf, "m_cf");
            save_item(m_vf, "m_vf");
            save_item(m_sf, "m_sf");
            save_item(m_nf, "m_nf");
            save_item(m_pio, "m_pio");
            save_item(m_TH, "m_TH");
            save_item(m_TL, "m_TL");
            save_item(m_TP, "m_TP");
            save_item(m_ctr, "m_ctr");
            save_item(m_SB, "m_SB");
            save_item(m_SBcount, "m_SBcount");
            save_item(m_pending_interrupt, "m_pending_interrupt");

            m_distate.state_add(MB88_PC, "PC", m_PC).formatstr("%02X");
            m_distate.state_add(MB88_PA, "PA", m_PA).formatstr("%02X");
            m_distate.state_add(MB88_SI, "SI", m_SI).formatstr("%01X");
            m_distate.state_add(MB88_A, "A", m_A).formatstr("%01X");
            m_distate.state_add(MB88_X, "X", m_X).formatstr("%01X");
            m_distate.state_add(MB88_Y, "Y", m_Y).formatstr("%01X");
            m_distate.state_add(MB88_PIO, "PIO", m_pio).formatstr("%02X");
            m_distate.state_add(MB88_TH, "TH", m_TH).formatstr("%01X");
            m_distate.state_add(MB88_TL, "TL", m_TL).formatstr("%01X");
            m_distate.state_add(MB88_SB, "SB", m_SB).formatstr("%01X");

            m_distate.state_add(STATE_GENPC, "GENPC", m_debugger_pc).callimport().callexport().noshow();
            m_distate.state_add(STATE_GENPCBASE, "CURPC", m_debugger_pc).callimport().callexport().noshow();
            m_distate.state_add(STATE_GENFLAGS, "GENFLAGS", m_debugger_flags).callimport().callexport().formatstr("%6s").noshow();

            set_icountptr(m_icountRef);
        }
Ejemplo n.º 6
0
Archivo: m6502.cs Proyecto: kwanboy/mcs
        //bool get_sync() const { return sync; }
        //void disable_direct() { direct_disabled = true; }

        //auto sync_cb() { return sync_w.bind(); }


        protected virtual void init()
        {
            mintf.program  = m_dimemory.space(AS_PROGRAM);
            mintf.sprogram = m_dimemory.has_space(AS_OPCODES) ? m_dimemory.space(AS_OPCODES) : mintf.program;

            mintf.cache  = mintf.program.cache(0, 0, (int)endianness_t.ENDIANNESS_LITTLE);
            mintf.scache = mintf.sprogram.cache(0, 0, (int)endianness_t.ENDIANNESS_LITTLE);

            XPC = 0;

            sync_w.resolve_safe();

            m_distate.state_add(STATE_GENPC, "GENPC", XPC).callexport().noshow();
            m_distate.state_add(STATE_GENPCBASE, "CURPC", XPC).callexport().noshow();
            m_distate.state_add(STATE_GENSP, "GENSP", SP).noshow();
            m_distate.state_add(STATE_GENFLAGS, "GENFLAGS", P).callimport().formatstr("%6s").noshow();
            m_distate.state_add(M6502_PC, "PC", NPC).callimport();
            m_distate.state_add(M6502_A, "A", A);
            m_distate.state_add(M6502_X, "X", X);
            m_distate.state_add(M6502_Y, "Y", Y);
            m_distate.state_add(M6502_P, "P", P).callimport();
            m_distate.state_add(M6502_S, "SP", SP);
            m_distate.state_add(M6502_IR, "IR", IR);

            save_item(PC, "PC");
            save_item(NPC, "NPC");
            save_item(PPC, "PPC");
            save_item(A, "A");
            save_item(X, "X");
            save_item(Y, "Y");
            save_item(P, "P");
            save_item(SP, "SP");
            save_item(TMP, "TMP");
            save_item(TMP2, "TMP2");
            save_item(IR, "IR");
            save_item(nmi_state, "nmi_state");
            save_item(irq_state, "irq_state");
            save_item(apu_irq_state, "apu_irq_state");
            save_item(v_state, "v_state");
            save_item(inst_state, "inst_state");
            save_item(inst_substate, "inst_substate");
            save_item(inst_state_base, "inst_state_base");
            save_item(irq_taken, "irq_taken");
            save_item(inhibit_interrupts, "inhibit_interrupts");

            set_icountptr(icountRef);

            PC                            = 0x0000;
            NPC                           = 0x0000;
            A                             = 0x00;
            X                             = 0x80;
            Y                             = 0x00;
            P                             = 0x36;
            SP                            = 0x01bd;
            TMP                           = 0x0000;
            TMP2                          = 0x00;
            IR                            = 0x00;
            nmi_state                     = false;
            irq_state                     = false;
            apu_irq_state                 = false;
            irq_taken                     = false;
            v_state                       = false;
            inst_state                    = STATE_RESET;
            inst_substate                 = 0;
            inst_state_base               = 0;
            sync                          = false;
            inhibit_interrupts            = false;
            count_before_instruction_step = 0;
        }