Ejemplo n.º 1
0
Archivo: namco.cs Proyecto: kwanboy/mcs
        //WRITE8_MEMBER( namco_device::pacman_sound_w )
        public void pacman_sound_w(address_space space, offs_t offset, byte data, byte mem_mask = 0xff)
        {
            sound_channel voice;
            int           ch;

            data &= 0x0f;
            if (m_soundregs[offset] == data)
            {
                return;
            }

            /* update the streams */
            m_stream.update();

            /* set the register */
            m_soundregs[offset] = data;

            if (offset < 0x10)
            {
                ch = (int)((offset - 5) / 5);
            }
            else if (offset == 0x10)
            {
                ch = 0;
            }
            else
            {
                ch = (int)((offset - 0x11) / 5);
            }

            if (ch >= m_voices)
            {
                return;
            }

            /* recompute the voice parameters */
            voice = m_channel_list[ch]; // m_channel_list + ch;
            switch (offset - ch * 5)
            {
            case 0x05:
                voice.waveform_select = data & 7;
                break;

            case 0x10:
            case 0x11:
            case 0x12:
            case 0x13:
            case 0x14:
                /* the frequency has 20 bits */
                /* the first voice has extra frequency bits */
                voice.frequency  = (ch == 0) ? (UInt32)m_soundregs[0x10] : 0;
                voice.frequency += (UInt32)(m_soundregs[ch * 5 + 0x11] << 4);
                voice.frequency += (UInt32)(m_soundregs[ch * 5 + 0x12] << 8);
                voice.frequency += (UInt32)(m_soundregs[ch * 5 + 0x13] << 12);
                voice.frequency += (UInt32)(m_soundregs[ch * 5 + 0x14] << 16);     /* always 0 */
                break;

            case 0x15:
                voice.volume[0] = data;
                break;
            }
        }
Ejemplo n.º 2
0
 //WRITE8_MEMBER( galaxian_sound_device::background_enable_w )
 public void background_enable_w(address_space space, offs_t offset, byte data, byte mem_mask = 0xff)
 {
     m_discrete.target.write((offs_t)NODE_RELATIVE(galaxian_state.GAL_INP_FS1, (int)offset), (uint8_t)(data & 0x01));
 }
Ejemplo n.º 3
0
        handler_entry_write <int_Width, int_AddrShift> m_next;  //handler_entry_write<Width, AddrShift> *m_next;


        handler_entry_write_passthrough(address_space space, memory_passthrough_handler mph) : base(space, handler_entry.F_PASSTHROUGH)
        {
            m_mph = mph; m_next = null;
        }
Ejemplo n.º 4
0
 handler_entry_write_passthrough(address_space space, memory_passthrough_handler mph, handler_entry_write <int_Width, int_AddrShift> next) : base(space, handler_entry.F_PASSTHROUGH)
 {
     m_mph = mph; m_next = next;  next.ref_(); mph.add_handler(this);
 }
Ejemplo n.º 5
0
        //WRITE8_MEMBER( pokey_device::write )
        public void pokey_device_write(address_space space, offs_t offset, u8 data, u8 mem_mask = 0xff)
        {
            pokey_device pokey = (pokey_device)subdevice("pokey");

            pokey.write(space, offset, data, mem_mask);
        }
Ejemplo n.º 6
0
 //WRITE8_MEMBER(pacman_state::pacman_interrupt_vector_w)
 public void pacman_interrupt_vector_w(address_space space, offs_t offset, u8 data, u8 mem_mask = 0xff)
 {
     m_maincpu.target.set_input_line_vector(0, data);
     m_maincpu.target.set_input_line(0, CLEAR_LINE);
 }
Ejemplo n.º 7
0
 //WRITE8_MEMBER( namco_device::pacman_sound_w )
 public void namco_device_pacman_sound_w(address_space space, offs_t offset, u8 data, u8 mem_mask = 0xff)
 {
     m_namco_sound.target.pacman_sound_w(space, offset, data, mem_mask);
 }
Ejemplo n.º 8
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.º 9
0
        //READ8_MEMBER( namco_06xx_device::ctrl_r )
        public u8 namco_06xx_device_ctrl_r(address_space space, offs_t offset, u8 mem_mask = 0xff)
        {
            namco_06xx_device namco_06xx = (namco_06xx_device)subdevice("06xx");

            return(namco_06xx.ctrl_r(space, offset, mem_mask));
        }
Ejemplo n.º 10
0
        //WRITE8_MEMBER( namco_06xx_device::ctrl_w )
        public void namco_06xx_device_ctrl_w(address_space space, offs_t offset, u8 data, u8 mem_mask = 0xff)
        {
            namco_06xx_device namco_06xx = (namco_06xx_device)subdevice("06xx");

            namco_06xx.ctrl_w(space, offset, data, mem_mask);
        }
Ejemplo n.º 11
0
 /* emulation for schematic 9B */
 //WRITE8_MEMBER( xevious_state::xevious_bs_w )
 public void xevious_bs_w(address_space space, offs_t offset, u8 data, u8 mem_mask = 0xff)
 {
     m_xevious_bs[offset & 1] = data;
 }
Ejemplo n.º 12
0
 //WRITE8_MEMBER( xevious_state::xevious_bg_colorram_w )
 public void xevious_bg_colorram_w(address_space space, offs_t offset, u8 data, u8 mem_mask = 0xff)
 {
     m_xevious_bg_colorram.target[offset] = data;
     m_bg_tilemap.mark_tile_dirty(offset);
 }
Ejemplo n.º 13
0
        }                                                                                                         //#define mspacman_disable_decode_latch(m) m.root_device().membank("bank1")->set_entry(0)

        // any access to these ROM addresses disables the decoder, and all you see is the original Pac-Man code
        //READ8_MEMBER(pacman_state::mspacman_disable_decode_r_0x0038){ mspacman_disable_decode_latch(machine()); return memregion("maincpu")->base()[offset+0x0038]; }
        public u8 mspacman_disable_decode_r_0x0038(address_space space, offs_t offset, u8 mem_mask = 0xff)
        {
            mspacman_disable_decode_latch(machine()); return(memregion("maincpu").base_()[offset + 0x0038]);
        }
Ejemplo n.º 14
0
 //WRITE8_MEMBER( galaxian_sound_device::fire_enable_w )
 public void fire_enable_w(address_space space, offs_t offset, byte data, byte mem_mask = 0xff)
 {
     m_discrete.target.write(galaxian_state.GAL_INP_FIRE, (byte)(data & 0x01));
 }
Ejemplo n.º 15
0
        //WRITE8_MEMBER( namco_50xx_device::write )
        public void namco_50xx_device_write(address_space space, offs_t offset, u8 data, u8 mem_mask = 0xff)
        {
            namco_50xx_device namco_50xx = (namco_50xx_device)subdevice("50xx");

            namco_50xx.write(space, offset, data, mem_mask);
        }
Ejemplo n.º 16
0
 /* IC 9J */
 //WRITE8_MEMBER( galaxian_sound_device::pitch_w )
 public void pitch_w(address_space space, offs_t offset, byte data, byte mem_mask = 0xff)
 {
     m_discrete.target.write(galaxian_state.GAL_INP_PITCH, data);
 }
Ejemplo n.º 17
0
        //READ8_MEMBER( namco_53xx_device::read )
        public u8 namco_53xx_device_read(address_space space, offs_t offset, u8 mem_mask = 0xff)
        {
            namco_53xx_device namco_53xx = (namco_53xx_device)subdevice("53xx");

            return(namco_53xx.read(space, offset, mem_mask));
        }
Ejemplo n.º 18
0
        //void centiped_base(machine_config &config);
        //void milliped(machine_config &config);
        //void bullsdrt(machine_config &config);
        //void centipdb(machine_config &config);
        //void magworm(machine_config &config);
        //void caterplr(machine_config &config);
        //void centiped(machine_config &config);
        //void centipedj(machine_config &config);
        //void mazeinv(machine_config &config);
        //void warlords(machine_config &config);
        //void multiped(machine_config &config);

        //void init_multiped();
        //void init_bullsdrt();

        // drivers/centiped.cpp
        //DECLARE_WRITE8_MEMBER(irq_ack_w);
        //DECLARE_READ8_MEMBER(centiped_IN0_r);
        //DECLARE_READ8_MEMBER(centiped_IN2_r);
        //DECLARE_READ8_MEMBER(milliped_IN1_r);
        //DECLARE_READ8_MEMBER(milliped_IN2_r);
        //DECLARE_WRITE_LINE_MEMBER(input_select_w);
        //DECLARE_WRITE_LINE_MEMBER(control_select_w);
        //DECLARE_READ8_MEMBER(mazeinv_input_r);
        //DECLARE_WRITE8_MEMBER(mazeinv_input_select_w);
        //DECLARE_READ8_MEMBER(bullsdrt_data_port_r);
        //DECLARE_WRITE_LINE_MEMBER(coin_counter_left_w);
        //DECLARE_WRITE_LINE_MEMBER(coin_counter_center_w);
        //DECLARE_WRITE_LINE_MEMBER(coin_counter_right_w);
        //DECLARE_WRITE_LINE_MEMBER(bullsdrt_coin_count_w);
        //DECLARE_READ8_MEMBER(earom_read);
        //DECLARE_WRITE8_MEMBER(earom_write);
        //DECLARE_WRITE8_MEMBER(earom_control_w);
        //DECLARE_READ8_MEMBER(caterplr_unknown_r);
        //DECLARE_WRITE8_MEMBER(caterplr_AY8910_w);
        //DECLARE_READ8_MEMBER(caterplr_AY8910_r);
        //DECLARE_READ8_MEMBER(multiped_eeprom_r);
        //DECLARE_WRITE8_MEMBER(multiped_eeprom_w);
        //DECLARE_WRITE8_MEMBER(multiped_prgbank_w);

        // video/centiped.c
        //DECLARE_WRITE8_MEMBER(centiped_videoram_w);
        //DECLARE_WRITE_LINE_MEMBER(flip_screen_w);
        //DECLARE_WRITE8_MEMBER(multiped_gfxbank_w);
        //DECLARE_WRITE8_MEMBER(bullsdrt_tilesbank_w);
        //DECLARE_WRITE8_MEMBER(bullsdrt_sprites_bank_w);
        //DECLARE_WRITE8_MEMBER(centiped_paletteram_w);
        //DECLARE_WRITE8_MEMBER(milliped_paletteram_w);
        //DECLARE_WRITE8_MEMBER(mazeinv_paletteram_w);
        //TILE_GET_INFO_MEMBER(centiped_get_tile_info);
        //TILE_GET_INFO_MEMBER(warlords_get_tile_info);
        //TILE_GET_INFO_MEMBER(milliped_get_tile_info);
        //TILE_GET_INFO_MEMBER(bullsdrt_get_tile_info);
        //DECLARE_MACHINE_START(centiped);
        //DECLARE_MACHINE_RESET(centiped);
        //DECLARE_VIDEO_START(centiped);
        //DECLARE_VIDEO_START(bullsdrt);
        //DECLARE_MACHINE_RESET(magworm);
        //DECLARE_VIDEO_START(milliped);
        //DECLARE_VIDEO_START(warlords);
        //DECLARE_PALETTE_INIT(warlords);
        //uint32_t screen_update_centiped(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
        //uint32_t screen_update_bullsdrt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
        //uint32_t screen_update_milliped(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
        //uint32_t screen_update_warlords(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
        //TIMER_DEVICE_CALLBACK_MEMBER(generate_interrupt);
        //void init_penmask();
        //void init_common();
        //void milliped_set_color(offs_t offset, uint8_t data);
        //inline int read_trackball(int idx, int switch_port);
        //void bullsdrt_data_map(address_map &map);
        //void bullsdrt_map(address_map &map);
        //void bullsdrt_port_map(address_map &map);
        //void caterplr_map(address_map &map);
        //void centipdb_map(address_map &map);
        //void centiped_base_map(address_map &map);
        //void centiped_map(address_map &map);
        //void centipedj_map(address_map &map);
        //void magworm_map(address_map &map);
        //void mazeinv_map(address_map &map);
        //void milliped_map(address_map &map);
        //void multiped_map(address_map &map);
        //void warlords_map(address_map &map);


        // wrappers because I don't know how to find the correct device during construct_ startup

        //READ8_MEMBER( pokey_device::read )
        public u8 pokey_device_read(address_space space, offs_t offset, u8 mem_mask = 0xff)
        {
            pokey_device pokey = (pokey_device)subdevice("pokey");

            return(pokey.read(space, offset, mem_mask));
        }
Ejemplo n.º 19
0
        //WRITE8_MEMBER(addressable_latch_device::write_d0)
        public void ls259_device_write_d0_videolatch(address_space space, offs_t offset, u8 data, u8 mem_mask = 0xff)
        {
            addressable_latch_device device = (addressable_latch_device)subdevice("videolatch");

            device.write_d0(space, offset, data, mem_mask);
        }
Ejemplo n.º 20
0
        //WRITE8_MEMBER( watchdog_timer_device::reset_w )
        public void watchdog_timer_device_reset_w(address_space space, offs_t offset, u8 data, u8 mem_mask = 0xff)
        {
            watchdog_timer_device watchdog = (watchdog_timer_device)machine().config().device_find(this, "watchdog");

            watchdog.reset_w(space, offset, data, mem_mask);
        }
Ejemplo n.º 21
0
 //WRITE8_MEMBER(pacman_state::mspacman_enable_decode_w){ mspacman_enable_decode_latch(machine()); }
 public void mspacman_enable_decode_w(address_space space, offs_t offset, u8 data, u8 mem_mask = 0xff)
 {
     mspacman_enable_decode_latch(machine());
 }