mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
kan_pand.cpp: Eliminate driver_data dependency (nw)
This commit is contained in:
parent
101cc67202
commit
08e7ef5682
@ -276,10 +276,12 @@ WRITE8_MEMBER(airbustr_state::slave_bankswitch_w)
|
||||
{
|
||||
membank("slavebank")->set_entry(data & 0x07);
|
||||
|
||||
flip_screen_set(data & 0x10);
|
||||
m_bg_tilemap->set_flip(BIT(data, 4) ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
|
||||
m_fg_tilemap->set_flip(BIT(data, 4) ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
|
||||
m_pandora->flip_screen_set(BIT(data, 4));
|
||||
|
||||
// used at the end of levels, after defeating the boss, to leave trails
|
||||
m_pandora->set_clear_bitmap(data & 0x20);
|
||||
m_pandora->set_clear_bitmap(BIT(data, 5));
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(airbustr_state::sound_bankswitch_w)
|
||||
|
@ -88,10 +88,15 @@ a joystick. This is not an emulation bug.
|
||||
#include "speaker.h"
|
||||
|
||||
|
||||
WRITE16_MEMBER(snowbros_state::snowbros_flipscreen_w)
|
||||
WRITE8_MEMBER(snowbros_state::snowbros_flipscreen_w)
|
||||
{
|
||||
if (ACCESSING_BITS_8_15)
|
||||
flip_screen_set(~data & 0x8000);
|
||||
m_pandora->flip_screen_set(!BIT(data, 7));
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(snowbros_state::bootleg_flipscreen_w)
|
||||
{
|
||||
flip_screen_set(~data & 0x80);
|
||||
}
|
||||
|
||||
|
||||
@ -214,7 +219,7 @@ static ADDRESS_MAP_START( snowbros_map, AS_PROGRAM, 16, snowbros_state )
|
||||
AM_RANGE(0x100000, 0x103fff) AM_RAM
|
||||
AM_RANGE(0x200000, 0x200001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
|
||||
AM_RANGE(0x300000, 0x300001) AM_READWRITE(snowbros_68000_sound_r,snowbros_68000_sound_w)
|
||||
AM_RANGE(0x400000, 0x400001) AM_WRITE(snowbros_flipscreen_w)
|
||||
AM_RANGE(0x400000, 0x400001) AM_WRITE8(snowbros_flipscreen_w, 0xff00)
|
||||
AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW1")
|
||||
AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW2")
|
||||
AM_RANGE(0x500004, 0x500005) AM_READ_PORT("SYSTEM")
|
||||
@ -296,7 +301,7 @@ static ADDRESS_MAP_START( wintbob_map, AS_PROGRAM, 16, snowbros_state )
|
||||
AM_RANGE(0x100000, 0x103fff) AM_RAM
|
||||
AM_RANGE(0x200000, 0x200001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
|
||||
AM_RANGE(0x300000, 0x300001) AM_READWRITE(snowbros_68000_sound_r,snowbros_68000_sound_w)
|
||||
AM_RANGE(0x400000, 0x400001) AM_WRITE(snowbros_flipscreen_w)
|
||||
AM_RANGE(0x400000, 0x400001) AM_WRITE8(bootleg_flipscreen_w, 0xff00)
|
||||
AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW1")
|
||||
AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW2")
|
||||
AM_RANGE(0x500004, 0x500005) AM_READ_PORT("SYSTEM")
|
||||
@ -353,7 +358,7 @@ static ADDRESS_MAP_START( twinadv_map, AS_PROGRAM, 16, snowbros_state )
|
||||
AM_RANGE(0x100000, 0x10ffff) AM_RAM
|
||||
AM_RANGE(0x200000, 0x200001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
|
||||
AM_RANGE(0x300000, 0x300001) AM_READWRITE(snowbros_68000_sound_r,twinadv_68000_sound_w)
|
||||
AM_RANGE(0x400000, 0x400001) AM_WRITE(snowbros_flipscreen_w)
|
||||
AM_RANGE(0x400000, 0x400001) AM_WRITE8(bootleg_flipscreen_w, 0xff00)
|
||||
|
||||
AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW1")
|
||||
AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW2")
|
||||
@ -530,7 +535,7 @@ static ADDRESS_MAP_START( snowbros3_map, AS_PROGRAM, 16, snowbros_state )
|
||||
AM_RANGE( 0x200000, 0x200001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
|
||||
AM_RANGE( 0x300000, 0x300001) AM_READ(sb3_sound_r) // ?
|
||||
AM_RANGE( 0x300000, 0x300001) AM_WRITE(sb3_sound_w) // ?
|
||||
AM_RANGE( 0x400000, 0x400001) AM_WRITE(snowbros_flipscreen_w)
|
||||
AM_RANGE( 0x400000, 0x400001) AM_WRITE8(bootleg_flipscreen_w, 0xff00)
|
||||
AM_RANGE( 0x500000, 0x500001) AM_READ_PORT("DSW1")
|
||||
AM_RANGE( 0x500002, 0x500003) AM_READ_PORT("DSW2")
|
||||
AM_RANGE( 0x500004, 0x500005) AM_READ_PORT("SYSTEM")
|
||||
|
@ -36,7 +36,8 @@ public:
|
||||
int m_sb3_music;
|
||||
uint8_t m_semicom_prot_offset;
|
||||
|
||||
DECLARE_WRITE16_MEMBER(snowbros_flipscreen_w);
|
||||
DECLARE_WRITE8_MEMBER(snowbros_flipscreen_w);
|
||||
DECLARE_WRITE8_MEMBER(bootleg_flipscreen_w);
|
||||
DECLARE_WRITE16_MEMBER(snowbros_irq4_ack_w);
|
||||
DECLARE_WRITE16_MEMBER(snowbros_irq3_ack_w);
|
||||
DECLARE_WRITE16_MEMBER(snowbros_irq2_ack_w);
|
||||
|
@ -82,6 +82,7 @@ void kaneko_pandora_device::static_set_gfxdecode_tag(device_t &device, const cha
|
||||
void kaneko_pandora_device::device_start()
|
||||
{
|
||||
m_bg_pen = 0;
|
||||
m_flip_screen = false;
|
||||
|
||||
m_spriteram = std::make_unique<uint8_t[]>(0x1000);
|
||||
|
||||
@ -89,6 +90,7 @@ void kaneko_pandora_device::device_start()
|
||||
|
||||
save_item(NAME(m_clear_bitmap));
|
||||
save_item(NAME(m_bg_pen));
|
||||
save_item(NAME(m_flip_screen));
|
||||
save_pointer(NAME(m_spriteram.get()), 0x1000);
|
||||
save_item(NAME(*m_sprites_bitmap));
|
||||
}
|
||||
@ -181,7 +183,7 @@ void kaneko_pandora_device::draw( bitmap_ind16 &bitmap, const rectangle &cliprec
|
||||
y = dy;
|
||||
}
|
||||
|
||||
if (machine().driver_data()->flip_screen())
|
||||
if (m_flip_screen)
|
||||
{
|
||||
sx = 240 - x;
|
||||
sy = 240 - y;
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
void set_clear_bitmap( int clear );
|
||||
void eof();
|
||||
void set_bg_pen( int pen );
|
||||
void flip_screen_set(bool flip) { m_flip_screen = flip; }
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
@ -58,6 +59,7 @@ private:
|
||||
uint8_t m_gfx_region;
|
||||
int m_xoffset;
|
||||
int m_yoffset;
|
||||
bool m_flip_screen;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user