コード例 #1
0
ファイル: pacman.cs プロジェクト: kwanboy/mcs
        void mspacman_map(address_map map, device_t device)
        {
            pacman_state pacman_state = (pacman_state)device;

            /* start with 0000-3fff and 8000-bfff mapped to the ROMs */
            map.op(0x0000, 0xffff).bankr("bank1");
            map.op(0x4000, 0x7fff).mirror(0x8000).unmaprw();

            map.op(0x4000, 0x43ff).mirror(0xa000).ram().w(pacman_state.pacman_videoram_w).share("videoram");
            map.op(0x4400, 0x47ff).mirror(0xa000).ram().w(pacman_state.pacman_colorram_w).share("colorram");
            map.op(0x4800, 0x4bff).mirror(0xa000).r(pacman_state.pacman_read_nop).nopw();
            map.op(0x4c00, 0x4fef).mirror(0xa000).ram();
            map.op(0x4ff0, 0x4fff).mirror(0xa000).ram().share("spriteram");
            map.op(0x5000, 0x5007).mirror(0xaf38).w(pacman_state.mainlatch.target, pacman_state.ls259_device_write_d0_mainlatch);
            map.op(0x5040, 0x505f).mirror(0xaf00).w(pacman_state.namco_sound.target, pacman_state.namco_device_pacman_sound_w);
            map.op(0x5060, 0x506f).mirror(0xaf00).writeonly().share("spriteram2");
            map.op(0x5070, 0x507f).mirror(0xaf00).nopw();
            map.op(0x5080, 0x5080).mirror(0xaf3f).nopw();
            map.op(0x50c0, 0x50c0).mirror(0xaf3f).w(pacman_state.watchdog.target, pacman_state.watchdog_timer_device_reset_w);
            map.op(0x5000, 0x5000).mirror(0xaf3f).portr("IN0");
            map.op(0x5040, 0x5040).mirror(0xaf3f).portr("IN1");
            map.op(0x5080, 0x5080).mirror(0xaf3f).portr("DSW1");
            map.op(0x50c0, 0x50c0).mirror(0xaf3f).portr("DSW2");

            /* overlay decode enable/disable on top */
            map.op(0x0038, 0x003f).rw(pacman_state.mspacman_disable_decode_r_0x0038, pacman_state.mspacman_disable_decode_w);
            map.op(0x03b0, 0x03b7).rw(pacman_state.mspacman_disable_decode_r_0x03b0, pacman_state.mspacman_disable_decode_w);
            map.op(0x1600, 0x1607).rw(pacman_state.mspacman_disable_decode_r_0x1600, pacman_state.mspacman_disable_decode_w);
            map.op(0x2120, 0x2127).rw(pacman_state.mspacman_disable_decode_r_0x2120, pacman_state.mspacman_disable_decode_w);
            map.op(0x3ff0, 0x3ff7).rw(pacman_state.mspacman_disable_decode_r_0x3ff0, pacman_state.mspacman_disable_decode_w);
            map.op(0x3ff8, 0x3fff).rw(pacman_state.mspacman_enable_decode_r_0x3ff8, pacman_state.mspacman_enable_decode_w);
            map.op(0x8000, 0x8007).rw(pacman_state.mspacman_disable_decode_r_0x8000, pacman_state.mspacman_disable_decode_w);
            map.op(0x97f0, 0x97f7).rw(pacman_state.mspacman_disable_decode_r_0x97f0, pacman_state.mspacman_disable_decode_w);
        }
コード例 #2
0
ファイル: pacman.cs プロジェクト: kwanboy/mcs
        /*************************************
        *
        *  Main CPU port handlers
        *
        *************************************/

        void writeport(address_map map, device_t device)
        {
            pacman_state state = (pacman_state)device;

            map.global_mask(0xff);
            map.op(0x00, 0x00).w(state.pacman_interrupt_vector_w);    /* Pac-Man only */
        }
コード例 #3
0
ファイル: pacman.cs プロジェクト: kwanboy/mcs
        /*************************************
        *
        *  Main CPU memory handlers
        *
        *************************************/

        void pacman_map(address_map map, device_t device)
        {
            pacman_state pacman_state = (pacman_state)device;

            //A lot of games don't have an a15 at the cpu.  Generally only games with a cpu daughter board can access the full 32k of romspace.
            map.op(0x0000, 0x3fff).mirror(0x8000).rom();
            map.op(0x4000, 0x43ff).mirror(0xa000).ram().w(pacman_state.pacman_videoram_w).share("videoram");
            map.op(0x4400, 0x47ff).mirror(0xa000).ram().w(pacman_state.pacman_colorram_w).share("colorram");
            map.op(0x4800, 0x4bff).mirror(0xa000).r(pacman_state.pacman_read_nop).nopw();
            map.op(0x4c00, 0x4fef).mirror(0xa000).ram();
            map.op(0x4ff0, 0x4fff).mirror(0xa000).ram().share("spriteram");
            map.op(0x5000, 0x5007).mirror(0xaf38).w(pacman_state.mainlatch.target, pacman_state.ls259_device_write_d0_mainlatch);
            map.op(0x5040, 0x505f).mirror(0xaf00).w(pacman_state.namco_sound.target, pacman_state.namco_device_pacman_sound_w);
            map.op(0x5060, 0x506f).mirror(0xaf00).writeonly().share("spriteram2");
            map.op(0x5070, 0x507f).mirror(0xaf00).nopw();
            map.op(0x5080, 0x5080).mirror(0xaf3f).nopw();
            map.op(0x50c0, 0x50c0).mirror(0xaf3f).w(pacman_state.watchdog.target, pacman_state.watchdog_timer_device_reset_w);
            map.op(0x5000, 0x5000).mirror(0xaf3f).portr("IN0");
            map.op(0x5040, 0x5040).mirror(0xaf3f).portr("IN1");
            map.op(0x5080, 0x5080).mirror(0xaf3f).portr("DSW1");
            map.op(0x50c0, 0x50c0).mirror(0xaf3f).portr("DSW2");
        }