Fixed MT 00340 [Robbbert]

This commit is contained in:
Robbbert 2012-11-26 11:48:57 +00:00
parent 19232286c8
commit 09cc0182e5

View File

@ -24,14 +24,36 @@ public:
m_maincpu(*this,"maincpu"),
m_videoram(*this, "videoram"){ }
DECLARE_READ8_MEMBER(port29_r);
DECLARE_WRITE8_MEMBER(port28_w);
DECLARE_WRITE8_MEMBER(port30_w);
bool m_flipscreen;
required_device<cpu_device> m_maincpu;
required_shared_ptr<UINT8> m_videoram;
UINT32 screen_update_rotaryf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(rotaryf_interrupt);
};
READ8_MEMBER( rotaryf_state::port29_r )
{
UINT8 data = ioport("INPUTS")->read();
if (m_flipscreen) return data;
return (data & 0xCD) | ((data & 0x01) << 1) | ((data & 0x0c) << 2);
}
WRITE8_MEMBER( rotaryf_state::port28_w )
{
// sound
}
WRITE8_MEMBER( rotaryf_state::port30_w )
{
/* bit 0 = player 2 is playing */
m_flipscreen = BIT(data, 0) & BIT(ioport("COCKTAIL")->read(), 0);
}
@ -65,22 +87,25 @@ TIMER_DEVICE_CALLBACK_MEMBER(rotaryf_state::rotaryf_interrupt)
UINT32 rotaryf_state::screen_update_rotaryf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
offs_t offs;
pen_t pens[2];
pens[0] = RGB_BLACK;
pens[1] = RGB_WHITE;
UINT8 i,x,y,data;
for (offs = 0; offs < m_videoram.bytes(); offs++)
{
int i;
UINT8 x = offs << 3;
int y = offs >> 5;
UINT8 data = m_videoram[offs];
x = offs << 3;
y = offs >> 5;
data = m_videoram[offs];
for (i = 0; i < 8; i++)
{
pen_t pen = (data & 0x01) ? RGB_WHITE : RGB_BLACK;
bitmap.pix32(y, x) = pen;
if (m_flipscreen)
bitmap.pix32(255-y, 247-(x|i)) = pens[data & 1];
else
bitmap.pix32(y, x|i) = pens[data & 1];
data = data >> 1;
x = x + 1;
data >>= 1;
}
}
@ -95,28 +120,27 @@ static ADDRESS_MAP_START( rotaryf_map, AS_PROGRAM, 8, rotaryf_state )
// AM_RANGE(0x6fff, 0x6fff) AM_READ_LEGACY(random_r) ??
AM_RANGE(0x7000, 0x73ff) AM_RAM // clears to 1ff ?
AM_RANGE(0x8000, 0x9fff) AM_MIRROR(0x4000) AM_RAM AM_SHARE("videoram")
AM_RANGE(0xa000, 0xa1ff) AM_RAM
AM_RANGE(0xa000, 0xa1ff) AM_RAM /* writes 00, 18, 27, 3C, 7E, FE to A019, A039, A059... A179 */
ADDRESS_MAP_END
static ADDRESS_MAP_START( rotaryf_io_map, AS_IO, 8, rotaryf_state )
// AM_RANGE(0x00, 0x00) AM_READ_PORT("UNK")
AM_RANGE(0x21, 0x21) AM_READ_PORT("COIN")
AM_RANGE(0x26, 0x26) AM_READ_PORT("DSW")
AM_RANGE(0x29, 0x29) AM_READ_PORT("INPUTS")
AM_RANGE(0x29, 0x29) AM_READ(port29_r)
AM_RANGE(0x02, 0x02) AM_WRITENOP
AM_RANGE(0x04, 0x04) AM_WRITENOP
AM_RANGE(0x07, 0x07) AM_WRITENOP
AM_RANGE(0x20, 0x20) AM_WRITENOP
AM_RANGE(0x21, 0x21) AM_WRITENOP
AM_RANGE(0x28, 0x28) AM_WRITE(port28_w)
AM_RANGE(0x2a, 0x2a) AM_WRITENOP
AM_RANGE(0x2b, 0x2b) AM_WRITENOP
AM_RANGE(0x30, 0x30) AM_WRITE(port30_w)
ADDRESS_MAP_END
static INPUT_PORTS_START( rotaryf )
PORT_START("UNK")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("COIN")
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)