Previous 199869 Revisions Next

r19151 Monday 26th November, 2012 at 11:48:57 UTC by Robbbert
Fixed MT 00340 [Robbbert]
[src/mame/drivers]rotaryf.c

trunk/src/mame/drivers/rotaryf.c
r19150r19151
2424      m_maincpu(*this,"maincpu"),
2525      m_videoram(*this, "videoram"){ }
2626
27   DECLARE_READ8_MEMBER(port29_r);
28   DECLARE_WRITE8_MEMBER(port28_w);
29   DECLARE_WRITE8_MEMBER(port30_w);
30   bool m_flipscreen;
2731   required_device<cpu_device> m_maincpu;
2832   required_shared_ptr<UINT8> m_videoram;
2933   UINT32 screen_update_rotaryf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
3034   TIMER_DEVICE_CALLBACK_MEMBER(rotaryf_interrupt);
3135};
3236
37READ8_MEMBER( rotaryf_state::port29_r )
38{
39   UINT8 data = ioport("INPUTS")->read();
3340
41   if (m_flipscreen) return data;
3442
43   return (data & 0xCD) | ((data & 0x01) << 1) | ((data & 0x0c) << 2);
44}
3545
46WRITE8_MEMBER( rotaryf_state::port28_w )
47{
48// sound
49}
3650
51WRITE8_MEMBER( rotaryf_state::port30_w )
52{
53   /* bit 0 = player 2 is playing */
3754
55   m_flipscreen = BIT(data, 0) & BIT(ioport("COCKTAIL")->read(), 0);
56}
57
58
59
3860/*************************************
3961 *
4062 *  Interrupt generation
r19150r19151
6587UINT32 rotaryf_state::screen_update_rotaryf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
6688{
6789   offs_t offs;
90   pen_t pens[2];
91   pens[0] = RGB_BLACK;
92   pens[1] = RGB_WHITE;
93   UINT8 i,x,y,data;
6894
6995   for (offs = 0; offs < m_videoram.bytes(); offs++)
7096   {
71      int i;
97      x = offs << 3;
98      y = offs >> 5;
99      data = m_videoram[offs];
72100
73      UINT8 x = offs << 3;
74      int y = offs >> 5;
75      UINT8 data = m_videoram[offs];
76
77101      for (i = 0; i < 8; i++)
78102      {
79         pen_t pen = (data & 0x01) ? RGB_WHITE : RGB_BLACK;
80         bitmap.pix32(y, x) = pen;
103         if (m_flipscreen)
104            bitmap.pix32(255-y, 247-(x|i)) = pens[data & 1];
105         else
106            bitmap.pix32(y, x|i) = pens[data & 1];
81107
82         data = data >> 1;
83         x = x + 1;
108         data >>= 1;
84109      }
85110   }
86111
r19150r19151
95120//  AM_RANGE(0x6fff, 0x6fff) AM_READ_LEGACY(random_r) ??
96121   AM_RANGE(0x7000, 0x73ff) AM_RAM // clears to 1ff ?
97122   AM_RANGE(0x8000, 0x9fff) AM_MIRROR(0x4000) AM_RAM AM_SHARE("videoram")
98   AM_RANGE(0xa000, 0xa1ff) AM_RAM
123   AM_RANGE(0xa000, 0xa1ff) AM_RAM   /* writes 00, 18, 27, 3C, 7E, FE to A019, A039, A059... A179 */
99124ADDRESS_MAP_END
100125
101126static ADDRESS_MAP_START( rotaryf_io_map, AS_IO, 8, rotaryf_state )
102//  AM_RANGE(0x00, 0x00) AM_READ_PORT("UNK")
103127   AM_RANGE(0x21, 0x21) AM_READ_PORT("COIN")
104128   AM_RANGE(0x26, 0x26) AM_READ_PORT("DSW")
105   AM_RANGE(0x29, 0x29) AM_READ_PORT("INPUTS")
129   AM_RANGE(0x29, 0x29) AM_READ(port29_r)
130
131   AM_RANGE(0x02, 0x02) AM_WRITENOP
132   AM_RANGE(0x04, 0x04) AM_WRITENOP
133   AM_RANGE(0x07, 0x07) AM_WRITENOP
134   AM_RANGE(0x20, 0x20) AM_WRITENOP
135   AM_RANGE(0x21, 0x21) AM_WRITENOP
136   AM_RANGE(0x28, 0x28) AM_WRITE(port28_w)
137   AM_RANGE(0x2a, 0x2a) AM_WRITENOP
138   AM_RANGE(0x2b, 0x2b) AM_WRITENOP
139   AM_RANGE(0x30, 0x30) AM_WRITE(port30_w)
106140ADDRESS_MAP_END
107141
108142
109143static INPUT_PORTS_START( rotaryf )
110   PORT_START("UNK")
111   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
112   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
113   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
114   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
115   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
116   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
117   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
118   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
119
120144   PORT_START("COIN")
121145   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
122146

Previous 199869 Revisions Next


© 1997-2024 The MAME Team