Previous 199869 Revisions Next

r36861 Wednesday 1st April, 2015 at 02:02:08 UTC by Alex W. Jackson
niyanpai.c: fix banking, remove an additional trampoline (nw)
[src/mame/drivers]niyanpai.c
[src/mame/includes]niyanpai.h

trunk/src/mame/drivers/niyanpai.c
r245372r245373
4444#include "includes/niyanpai.h"
4545
4646
47WRITE16_MEMBER(niyanpai_state::sound_w)
48{
49   soundlatch_byte_w(space, 0, ((data >> 8) & 0xff));
50}
51
5247WRITE8_MEMBER(niyanpai_state::soundbank_w)
5348{
5449   membank("soundbank")->set_entry(data & 0x03);
r245372r245373
6863   SNDROM[0x0213] = 0x00;          // DI -> NOP
6964
7065   // 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);
7267   membank("soundbank")->set_entry(0);
7368
7469   // initialize out coin flag (musobana)
r245372r245373
7873
7974READ16_MEMBER(niyanpai_state::dipsw_r)
8075{
81   UINT8 dipsw_a, dipsw_b;
76   UINT8 dipsw_a = ioport("DSWA")->read();
77   UINT8 dipsw_b = ioport("DSWB")->read();
8278
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);
8781
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
9382   return ((dipsw_a << 8) | dipsw_b);
9483}
9584
r245372r245373
153142
154143   AM_RANGE(0x0bf800, 0x0bffff) AM_RAM
155144
156   AM_RANGE(0x200000, 0x200001) AM_WRITE(sound_w)
145   AM_RANGE(0x200000, 0x200001) AM_WRITE8(soundlatch_byte_w, 0xff00)
157146
158147   AM_RANGE(0x200200, 0x200201) AM_WRITENOP            // unknown
159148   AM_RANGE(0x240000, 0x240009) AM_WRITENOP            // unknown
r245372r245373
189178   AM_RANGE(0x0a8000, 0x0a87ff) AM_RAM AM_SHARE("nvram")
190179   AM_RANGE(0x0bf800, 0x0bffff) AM_RAM
191180
192   AM_RANGE(0x200000, 0x200001) AM_WRITE(sound_w)
181   AM_RANGE(0x200000, 0x200001) AM_WRITE8(soundlatch_byte_w, 0xff00)
193182
194183   AM_RANGE(0x200200, 0x200201) AM_WRITE(musobana_inputport_w) // inputport select
195184   AM_RANGE(0x240000, 0x240009) AM_WRITENOP            // unknown
r245372r245373
228217   AM_RANGE(0x0a8000, 0x0a87ff) AM_RAM AM_SHARE("nvram")
229218   AM_RANGE(0x0bf000, 0x0bffff) AM_RAM
230219
231   AM_RANGE(0x200000, 0x200001) AM_WRITE(sound_w)
220   AM_RANGE(0x200000, 0x200001) AM_WRITE8(soundlatch_byte_w, 0xff00)
232221
233222   AM_RANGE(0x200200, 0x200201) AM_WRITE(musobana_inputport_w) // inputport select
234223   AM_RANGE(0x240000, 0x240009) AM_WRITENOP            // unknown
r245372r245373
267256   AM_RANGE(0x0a8000, 0x0a87ff) AM_RAM AM_SHARE("nvram")
268257   AM_RANGE(0x0c0000, 0x0cffff) AM_RAM
269258
270   AM_RANGE(0x200000, 0x200001) AM_WRITE(sound_w)
259   AM_RANGE(0x200000, 0x200001) AM_WRITE8(soundlatch_byte_w, 0xff00)
271260
272261   AM_RANGE(0x200200, 0x200201) AM_WRITE(musobana_inputport_w) // inputport select
273262   AM_RANGE(0x240000, 0x240009) AM_WRITENOP            // unknown
trunk/src/mame/includes/niyanpai.h
r245372r245373
5858   UINT8 m_motor_on;
5959   
6060   // common
61   DECLARE_WRITE16_MEMBER(sound_w);
6261   DECLARE_WRITE8_MEMBER(soundbank_w);
6362   DECLARE_WRITE8_MEMBER(soundlatch_clear_w);
6463   DECLARE_READ16_MEMBER(dipsw_r);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team