trunk/src/mame/drivers/niyanpai.c
| r245372 | r245373 | |
| 44 | 44 | #include "includes/niyanpai.h" |
| 45 | 45 | |
| 46 | 46 | |
| 47 | | WRITE16_MEMBER(niyanpai_state::sound_w) |
| 48 | | { |
| 49 | | soundlatch_byte_w(space, 0, ((data >> 8) & 0xff)); |
| 50 | | } |
| 51 | | |
| 52 | 47 | WRITE8_MEMBER(niyanpai_state::soundbank_w) |
| 53 | 48 | { |
| 54 | 49 | membank("soundbank")->set_entry(data & 0x03); |
| r245372 | r245373 | |
| 68 | 63 | SNDROM[0x0213] = 0x00; // DI -> NOP |
| 69 | 64 | |
| 70 | 65 | // initialize sound rom bank |
| 71 | | membank("soundbank")->configure_entries(0, 2, memregion("audiocpu")->base() + 0x8000, 0x8000); |
| 66 | membank("soundbank")->configure_entries(0, 3, memregion("audiocpu")->base() + 0x8000, 0x8000); |
| 72 | 67 | membank("soundbank")->set_entry(0); |
| 73 | 68 | |
| 74 | 69 | // initialize out coin flag (musobana) |
| r245372 | r245373 | |
| 78 | 73 | |
| 79 | 74 | READ16_MEMBER(niyanpai_state::dipsw_r) |
| 80 | 75 | { |
| 81 | | UINT8 dipsw_a, dipsw_b; |
| 76 | UINT8 dipsw_a = ioport("DSWA")->read(); |
| 77 | UINT8 dipsw_b = ioport("DSWB")->read(); |
| 82 | 78 | |
| 83 | | dipsw_a = (((ioport("DSWA")->read() & 0x01) << 7) | ((ioport("DSWA")->read() & 0x02) << 5) | |
| 84 | | ((ioport("DSWA")->read() & 0x04) << 3) | ((ioport("DSWA")->read() & 0x08) << 1) | |
| 85 | | ((ioport("DSWA")->read() & 0x10) >> 1) | ((ioport("DSWA")->read() & 0x20) >> 3) | |
| 86 | | ((ioport("DSWA")->read() & 0x40) >> 5) | ((ioport("DSWA")->read() & 0x80) >> 7)); |
| 79 | dipsw_a = BITSWAP8(dipsw_a,0,1,2,3,4,5,6,7); |
| 80 | dipsw_b = BITSWAP8(dipsw_b,0,1,2,3,4,5,6,7); |
| 87 | 81 | |
| 88 | | dipsw_b = (((ioport("DSWB")->read() & 0x01) << 7) | ((ioport("DSWB")->read() & 0x02) << 5) | |
| 89 | | ((ioport("DSWB")->read() & 0x04) << 3) | ((ioport("DSWB")->read() & 0x08) << 1) | |
| 90 | | ((ioport("DSWB")->read() & 0x10) >> 1) | ((ioport("DSWB")->read() & 0x20) >> 3) | |
| 91 | | ((ioport("DSWB")->read() & 0x40) >> 5) | ((ioport("DSWB")->read() & 0x80) >> 7)); |
| 92 | | |
| 93 | 82 | return ((dipsw_a << 8) | dipsw_b); |
| 94 | 83 | } |
| 95 | 84 | |
| r245372 | r245373 | |
| 153 | 142 | |
| 154 | 143 | AM_RANGE(0x0bf800, 0x0bffff) AM_RAM |
| 155 | 144 | |
| 156 | | AM_RANGE(0x200000, 0x200001) AM_WRITE(sound_w) |
| 145 | AM_RANGE(0x200000, 0x200001) AM_WRITE8(soundlatch_byte_w, 0xff00) |
| 157 | 146 | |
| 158 | 147 | AM_RANGE(0x200200, 0x200201) AM_WRITENOP // unknown |
| 159 | 148 | AM_RANGE(0x240000, 0x240009) AM_WRITENOP // unknown |
| r245372 | r245373 | |
| 189 | 178 | AM_RANGE(0x0a8000, 0x0a87ff) AM_RAM AM_SHARE("nvram") |
| 190 | 179 | AM_RANGE(0x0bf800, 0x0bffff) AM_RAM |
| 191 | 180 | |
| 192 | | AM_RANGE(0x200000, 0x200001) AM_WRITE(sound_w) |
| 181 | AM_RANGE(0x200000, 0x200001) AM_WRITE8(soundlatch_byte_w, 0xff00) |
| 193 | 182 | |
| 194 | 183 | AM_RANGE(0x200200, 0x200201) AM_WRITE(musobana_inputport_w) // inputport select |
| 195 | 184 | AM_RANGE(0x240000, 0x240009) AM_WRITENOP // unknown |
| r245372 | r245373 | |
| 228 | 217 | AM_RANGE(0x0a8000, 0x0a87ff) AM_RAM AM_SHARE("nvram") |
| 229 | 218 | AM_RANGE(0x0bf000, 0x0bffff) AM_RAM |
| 230 | 219 | |
| 231 | | AM_RANGE(0x200000, 0x200001) AM_WRITE(sound_w) |
| 220 | AM_RANGE(0x200000, 0x200001) AM_WRITE8(soundlatch_byte_w, 0xff00) |
| 232 | 221 | |
| 233 | 222 | AM_RANGE(0x200200, 0x200201) AM_WRITE(musobana_inputport_w) // inputport select |
| 234 | 223 | AM_RANGE(0x240000, 0x240009) AM_WRITENOP // unknown |
| r245372 | r245373 | |
| 267 | 256 | AM_RANGE(0x0a8000, 0x0a87ff) AM_RAM AM_SHARE("nvram") |
| 268 | 257 | AM_RANGE(0x0c0000, 0x0cffff) AM_RAM |
| 269 | 258 | |
| 270 | | AM_RANGE(0x200000, 0x200001) AM_WRITE(sound_w) |
| 259 | AM_RANGE(0x200000, 0x200001) AM_WRITE8(soundlatch_byte_w, 0xff00) |
| 271 | 260 | |
| 272 | 261 | AM_RANGE(0x200200, 0x200201) AM_WRITE(musobana_inputport_w) // inputport select |
| 273 | 262 | AM_RANGE(0x240000, 0x240009) AM_WRITENOP // unknown |