mirror of
https://github.com/holub/mame
synced 2025-04-24 09:20:02 +03:00
xain.cpp: clean up, reduce code duplication, reduce literal tags (nw)
This commit is contained in:
parent
2cdb153103
commit
d1f0520444
@ -147,10 +147,10 @@ Updates by Bryan McPhail, 12/12/2004:
|
||||
#include "speaker.h"
|
||||
|
||||
|
||||
#define MASTER_CLOCK XTAL(12'000'000)
|
||||
#define CPU_CLOCK MASTER_CLOCK / 8
|
||||
#define MCU_CLOCK MASTER_CLOCK / 4
|
||||
#define PIXEL_CLOCK MASTER_CLOCK / 2
|
||||
static constexpr XTAL MASTER_CLOCK(12_MHz_XTAL);
|
||||
static constexpr XTAL CPU_CLOCK(MASTER_CLOCK / 8);
|
||||
static constexpr XTAL MCU_CLOCK(MASTER_CLOCK / 4);
|
||||
static constexpr XTAL PIXEL_CLOCK(MASTER_CLOCK / 2);
|
||||
|
||||
|
||||
/*
|
||||
@ -170,7 +170,7 @@ Updates by Bryan McPhail, 12/12/2004:
|
||||
|
||||
inline int xain_state::scanline_to_vcount(int scanline)
|
||||
{
|
||||
int vcount = scanline + 8;
|
||||
int const vcount = scanline + 8;
|
||||
if (vcount < 0x100)
|
||||
return vcount;
|
||||
else
|
||||
@ -179,49 +179,41 @@ inline int xain_state::scanline_to_vcount(int scanline)
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(xain_state::scanline)
|
||||
{
|
||||
int scanline = param;
|
||||
int screen_height = m_screen->height();
|
||||
int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
|
||||
int vcount = scanline_to_vcount(scanline);
|
||||
int const scanline = param;
|
||||
int const screen_height = m_screen->height();
|
||||
int const vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
|
||||
int const vcount = scanline_to_vcount(scanline);
|
||||
|
||||
/* update to the current point */
|
||||
// update to the current point
|
||||
if (scanline > 0)
|
||||
{
|
||||
m_screen->update_partial(scanline - 1);
|
||||
}
|
||||
|
||||
/* FIRQ (IMS) fires every on every 8th scanline (except 0) */
|
||||
// FIRQ (IMS) fires every on every 8th scanline (except 0)
|
||||
if (!(vcount_old & 8) && (vcount & 8))
|
||||
{
|
||||
m_maincpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
|
||||
}
|
||||
|
||||
/* NMI fires on scanline 248 (VBL) and is latched */
|
||||
// NMI fires on scanline 248 (VBL) and is latched
|
||||
if (vcount == 0xf8)
|
||||
{
|
||||
m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
|
||||
}
|
||||
|
||||
/* VBLANK input bit is held high from scanlines 248-255 */
|
||||
// VBLANK input bit is held high from scanlines 248-255
|
||||
if (vcount >= 248-1) // -1 is a hack - see notes above
|
||||
{
|
||||
m_vblank = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_vblank = 0;
|
||||
}
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(xain_state::cpuA_bankswitch_w)
|
||||
{
|
||||
m_pri = data & 0x7;
|
||||
membank("bank1")->set_entry((data >> 3) & 1);
|
||||
m_rom_banks[0]->set_entry((data >> 3) & 1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(xain_state::cpuB_bankswitch_w)
|
||||
{
|
||||
membank("bank2")->set_entry(data & 1);
|
||||
m_rom_banks[1]->set_entry(data & 1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(xain_state::main_irq_w)
|
||||
@ -284,29 +276,54 @@ READ8_MEMBER(xain_state::mcu_comm_reset_r)
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Memory handlers
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
template <unsigned N> WRITE8_MEMBER(xain_state::bgram_w)
|
||||
{
|
||||
m_bgram[N][offset] = data;
|
||||
m_bg_tilemaps[N]->mark_tile_dirty(offset & 0x3ff);
|
||||
}
|
||||
|
||||
template <unsigned N> WRITE8_MEMBER(xain_state::scrollx_w)
|
||||
{
|
||||
m_scrollx[N][offset] = data;
|
||||
m_bg_tilemaps[N]->set_scrollx(0, m_scrollx[N][0] | (m_scrollx[N][1] << 8));
|
||||
}
|
||||
|
||||
template <unsigned N> WRITE8_MEMBER(xain_state::scrolly_w)
|
||||
{
|
||||
m_scrolly[N][offset] = data;
|
||||
m_bg_tilemaps[N]->set_scrolly(0, m_scrolly[N][0] | (m_scrolly[N][1] << 8));
|
||||
}
|
||||
|
||||
|
||||
void xain_state::bootleg_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x1fff).ram().share("share1");
|
||||
map(0x2000, 0x27ff).ram().w(this, FUNC(xain_state::charram_w)).share("charram");
|
||||
map(0x2800, 0x2fff).ram().w(this, FUNC(xain_state::bgram1_w)).share("bgram1");
|
||||
map(0x3000, 0x37ff).ram().w(this, FUNC(xain_state::bgram0_w)).share("bgram0");
|
||||
map(0x3800, 0x397f).ram().share("spriteram");
|
||||
map(0x2000, 0x27ff).ram().w(this, FUNC(xain_state::charram_w)).share(m_charram);
|
||||
map(0x2800, 0x2fff).ram().w(this, FUNC(xain_state::bgram_w<1>)).share(m_bgram[1]);
|
||||
map(0x3000, 0x37ff).ram().w(this, FUNC(xain_state::bgram_w<0>)).share(m_bgram[0]);
|
||||
map(0x3800, 0x397f).ram().share(m_spriteram);
|
||||
map(0x3a00, 0x3a00).portr("P1");
|
||||
map(0x3a00, 0x3a01).w(this, FUNC(xain_state::scrollxP1_w));
|
||||
map(0x3a00, 0x3a01).w(this, FUNC(xain_state::scrollx_w<1>));
|
||||
map(0x3a01, 0x3a01).portr("P2");
|
||||
map(0x3a02, 0x3a02).portr("DSW0");
|
||||
map(0x3a02, 0x3a03).w(this, FUNC(xain_state::scrollyP1_w));
|
||||
map(0x3a02, 0x3a03).w(this, FUNC(xain_state::scrolly_w<1>));
|
||||
map(0x3a03, 0x3a03).portr("DSW1");
|
||||
map(0x3a04, 0x3a05).w(this, FUNC(xain_state::scrollxP0_w));
|
||||
map(0x3a04, 0x3a05).w(this, FUNC(xain_state::scrollx_w<0>));
|
||||
map(0x3a05, 0x3a05).portr("VBLANK");
|
||||
map(0x3a06, 0x3a07).w(this, FUNC(xain_state::scrollyP0_w));
|
||||
map(0x3a06, 0x3a07).w(this, FUNC(xain_state::scrolly_w<0>));
|
||||
map(0x3a08, 0x3a08).w(m_soundlatch, FUNC(generic_latch_8_device::write));
|
||||
map(0x3a09, 0x3a0c).w(this, FUNC(xain_state::main_irq_w));
|
||||
map(0x3a0d, 0x3a0d).w(this, FUNC(xain_state::flipscreen_w));
|
||||
map(0x3a0f, 0x3a0f).w(this, FUNC(xain_state::cpuA_bankswitch_w));
|
||||
map(0x3c00, 0x3dff).w(m_palette, FUNC(palette_device::write8)).share("palette");
|
||||
map(0x3e00, 0x3fff).w(m_palette, FUNC(palette_device::write8_ext)).share("palette_ext");
|
||||
map(0x4000, 0x7fff).bankr("bank1");
|
||||
map(0x4000, 0x7fff).bankr(m_rom_banks[0]);
|
||||
map(0x8000, 0xffff).rom();
|
||||
}
|
||||
|
||||
@ -324,7 +341,7 @@ void xain_state::cpu_map_B(address_map &map)
|
||||
map(0x2000, 0x2000).w(this, FUNC(xain_state::irqA_assert_w));
|
||||
map(0x2800, 0x2800).w(this, FUNC(xain_state::irqB_clear_w));
|
||||
map(0x3000, 0x3000).w(this, FUNC(xain_state::cpuB_bankswitch_w));
|
||||
map(0x4000, 0x7fff).bankr("bank2");
|
||||
map(0x4000, 0x7fff).bankr(m_rom_banks[1]);
|
||||
map(0x8000, 0xffff).rom();
|
||||
}
|
||||
|
||||
@ -446,49 +463,49 @@ GFXDECODE_END
|
||||
|
||||
void xain_state::machine_start()
|
||||
{
|
||||
membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x4000, 0xc000);
|
||||
membank("bank2")->configure_entries(0, 2, memregion("sub")->base() + 0x4000, 0xc000);
|
||||
membank("bank1")->set_entry(0);
|
||||
membank("bank2")->set_entry(0);
|
||||
m_rom_banks[0]->configure_entries(0, 2, memregion("maincpu")->base() + 0x4000, 0xc000);
|
||||
m_rom_banks[1]->configure_entries(0, 2, memregion("sub")->base() + 0x4000, 0xc000);
|
||||
m_rom_banks[0]->set_entry(0);
|
||||
m_rom_banks[1]->set_entry(0);
|
||||
|
||||
save_item(NAME(m_vblank));
|
||||
}
|
||||
|
||||
MACHINE_CONFIG_START(xain_state::xsleena)
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_DEVICE_ADD("maincpu", MC6809E, CPU_CLOCK) // 68B09E
|
||||
// basic machine hardware
|
||||
MCFG_DEVICE_ADD(m_maincpu, MC6809E, CPU_CLOCK) // 68B09E
|
||||
MCFG_DEVICE_PROGRAM_MAP(main_map)
|
||||
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", xain_state, scanline, "screen", 0, 1)
|
||||
|
||||
MCFG_DEVICE_ADD("sub", MC6809E, CPU_CLOCK) // 68B09E
|
||||
MCFG_DEVICE_ADD(m_subcpu, MC6809E, CPU_CLOCK) // 68B09E
|
||||
MCFG_DEVICE_PROGRAM_MAP(cpu_map_B)
|
||||
|
||||
MCFG_DEVICE_ADD("audiocpu", MC6809, PIXEL_CLOCK) // 68A09
|
||||
MCFG_DEVICE_ADD(m_audiocpu, MC6809, PIXEL_CLOCK) // 68A09
|
||||
MCFG_DEVICE_PROGRAM_MAP(sound_map)
|
||||
|
||||
MCFG_DEVICE_ADD("mcu", TAITO68705_MCU, MCU_CLOCK)
|
||||
MCFG_DEVICE_ADD(m_mcu, TAITO68705_MCU, MCU_CLOCK)
|
||||
|
||||
MCFG_QUANTUM_PERFECT_CPU("maincpu")
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 384, 0, 256, 272, 8, 248) /* based on ddragon driver */
|
||||
// video hardware
|
||||
MCFG_SCREEN_ADD(m_screen, RASTER)
|
||||
MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 384, 0, 256, 272, 8, 248) // based on ddragon driver
|
||||
MCFG_SCREEN_UPDATE_DRIVER(xain_state, screen_update)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_xain)
|
||||
MCFG_DEVICE_ADD(m_gfxdecode, GFXDECODE, "palette", gfx_xain)
|
||||
MCFG_PALETTE_ADD("palette", 512)
|
||||
MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
|
||||
|
||||
/* sound hardware */
|
||||
SPEAKER(config, "mono").front_center();
|
||||
|
||||
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
|
||||
MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", M6809_IRQ_LINE))
|
||||
MCFG_GENERIC_LATCH_8_ADD(m_soundlatch)
|
||||
MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE(m_audiocpu, M6809_IRQ_LINE))
|
||||
|
||||
MCFG_DEVICE_ADD("ym1", YM2203, MCU_CLOCK)
|
||||
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", M6809_FIRQ_LINE))
|
||||
MCFG_YM2203_IRQ_HANDLER(INPUTLINE(m_audiocpu, M6809_FIRQ_LINE))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.50)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.50)
|
||||
MCFG_SOUND_ROUTE(2, "mono", 0.50)
|
||||
|
@ -1,5 +1,9 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Carlos A. Lozano, Rob Rosenbrock, Phil Stroffolino
|
||||
#ifndef MAME_INCLUDES_XAIN_H
|
||||
#define MAME_INCLUDES_XAIN_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "machine/taito68705interface.h"
|
||||
|
||||
@ -21,49 +25,46 @@ public:
|
||||
, m_palette(*this, "palette")
|
||||
, m_soundlatch(*this, "soundlatch")
|
||||
, m_charram(*this, "charram")
|
||||
, m_bgram0(*this, "bgram0")
|
||||
, m_bgram1(*this, "bgram1")
|
||||
, m_bgram(*this, "bgram%u", 0U)
|
||||
, m_spriteram(*this, "spriteram")
|
||||
, m_rom_banks(*this, { "mainbank", "subbank" })
|
||||
, m_char_tilemap(nullptr)
|
||||
, m_bgram0_tilemap(nullptr)
|
||||
, m_bgram1_tilemap(nullptr)
|
||||
, m_bg_tilemaps{ nullptr, nullptr }
|
||||
{
|
||||
}
|
||||
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(vblank_r);
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(mcu_status_r);
|
||||
|
||||
void xsleena(machine_config &config);
|
||||
void xsleenab(machine_config &config);
|
||||
|
||||
protected:
|
||||
DECLARE_WRITE8_MEMBER(cpuA_bankswitch_w);
|
||||
DECLARE_WRITE8_MEMBER(cpuB_bankswitch_w);
|
||||
DECLARE_WRITE8_MEMBER(main_irq_w);
|
||||
DECLARE_WRITE8_MEMBER(irqA_assert_w);
|
||||
DECLARE_WRITE8_MEMBER(irqB_clear_w);
|
||||
DECLARE_READ8_MEMBER(mcu_comm_reset_r);
|
||||
DECLARE_WRITE8_MEMBER(bgram0_w);
|
||||
DECLARE_WRITE8_MEMBER(bgram1_w);
|
||||
template <unsigned N> DECLARE_WRITE8_MEMBER(bgram_w);
|
||||
DECLARE_WRITE8_MEMBER(charram_w);
|
||||
DECLARE_WRITE8_MEMBER(scrollxP0_w);
|
||||
DECLARE_WRITE8_MEMBER(scrollyP0_w);
|
||||
DECLARE_WRITE8_MEMBER(scrollxP1_w);
|
||||
DECLARE_WRITE8_MEMBER(scrollyP1_w);
|
||||
template <unsigned N> DECLARE_WRITE8_MEMBER(scrollx_w);
|
||||
template <unsigned N> DECLARE_WRITE8_MEMBER(scrolly_w);
|
||||
DECLARE_WRITE8_MEMBER(flipscreen_w);
|
||||
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(vblank_r);
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(mcu_status_r);
|
||||
|
||||
TILEMAP_MAPPER_MEMBER(back_scan);
|
||||
TILE_GET_INFO_MEMBER(get_bgram0_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_bgram1_tile_info);
|
||||
template <unsigned N> TILE_GET_INFO_MEMBER(get_bg_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_char_tile_info);
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(scanline);
|
||||
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
void xsleenab(machine_config &config);
|
||||
void xsleena(machine_config &config);
|
||||
void bootleg_map(address_map &map);
|
||||
void cpu_map_B(address_map &map);
|
||||
void main_map(address_map &map);
|
||||
void cpu_map_B(address_map &map);
|
||||
void sound_map(address_map &map);
|
||||
protected:
|
||||
|
||||
virtual void machine_start() override;
|
||||
virtual void video_start() override;
|
||||
|
||||
@ -81,19 +82,19 @@ protected:
|
||||
required_device<generic_latch_8_device> m_soundlatch;
|
||||
|
||||
required_shared_ptr<u8> m_charram;
|
||||
required_shared_ptr<u8> m_bgram0;
|
||||
required_shared_ptr<u8> m_bgram1;
|
||||
required_shared_ptr_array<u8, 2> m_bgram;
|
||||
required_shared_ptr<u8> m_spriteram;
|
||||
|
||||
required_memory_bank_array<2> m_rom_banks;
|
||||
|
||||
tilemap_t *m_char_tilemap;
|
||||
tilemap_t *m_bgram0_tilemap;
|
||||
tilemap_t *m_bgram1_tilemap;
|
||||
tilemap_t *m_bg_tilemaps[2];
|
||||
|
||||
int m_vblank;
|
||||
|
||||
u8 m_pri;
|
||||
u8 m_scrollxP0[2];
|
||||
u8 m_scrollyP0[2];
|
||||
u8 m_scrollxP1[2];
|
||||
u8 m_scrollyP1[2];
|
||||
u8 m_scrollx[2][2];
|
||||
u8 m_scrolly[2][2];
|
||||
};
|
||||
|
||||
#endif // MAME_INCLUDES_XAIN_H
|
||||
|
@ -48,20 +48,11 @@ TILEMAP_MAPPER_MEMBER(xain_state::back_scan)
|
||||
return (col & 0x0f) + ((row & 0x0f) << 4) + ((col & 0x10) << 4) + ((row & 0x10) << 5);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(xain_state::get_bgram0_tile_info)
|
||||
template <unsigned N> TILE_GET_INFO_MEMBER(xain_state::get_bg_tile_info)
|
||||
{
|
||||
int attr = m_bgram0[tile_index | 0x400];
|
||||
SET_TILE_INFO_MEMBER(2,
|
||||
m_bgram0[tile_index] | ((attr & 7) << 8),
|
||||
(attr & 0x70) >> 4,
|
||||
(attr & 0x80) ? TILE_FLIPX : 0);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(xain_state::get_bgram1_tile_info)
|
||||
{
|
||||
int attr = m_bgram1[tile_index | 0x400];
|
||||
SET_TILE_INFO_MEMBER(1,
|
||||
m_bgram1[tile_index] | ((attr & 7) << 8),
|
||||
int const attr = m_bgram[N][tile_index | 0x400];
|
||||
SET_TILE_INFO_MEMBER(2 - N,
|
||||
m_bgram[N][tile_index] | ((attr & 7) << 8),
|
||||
(attr & 0x70) >> 4,
|
||||
(attr & 0x80) ? TILE_FLIPX : 0);
|
||||
}
|
||||
@ -84,19 +75,19 @@ TILE_GET_INFO_MEMBER(xain_state::get_char_tile_info)
|
||||
|
||||
void xain_state::video_start()
|
||||
{
|
||||
m_bgram0_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(xain_state::get_bgram0_tile_info),this),tilemap_mapper_delegate(FUNC(xain_state::back_scan),this),16,16,32,32);
|
||||
m_bgram1_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(xain_state::get_bgram1_tile_info),this),tilemap_mapper_delegate(FUNC(xain_state::back_scan),this),16,16,32,32);
|
||||
m_char_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(xain_state::get_char_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,32,32);
|
||||
m_bg_tilemaps[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(xain_state::get_bg_tile_info<0>), this), tilemap_mapper_delegate(FUNC(xain_state::back_scan), this), 16,16,32,32);
|
||||
m_bg_tilemaps[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(xain_state::get_bg_tile_info<1>), this), tilemap_mapper_delegate(FUNC(xain_state::back_scan), this), 16,16,32,32);
|
||||
m_char_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(xain_state::get_char_tile_info), this), TILEMAP_SCAN_ROWS, 8,8,32,32);
|
||||
|
||||
m_bgram0_tilemap->set_transparent_pen(0);
|
||||
m_bgram1_tilemap->set_transparent_pen(0);
|
||||
m_bg_tilemaps[0]->set_transparent_pen(0);
|
||||
m_bg_tilemaps[1]->set_transparent_pen(0);
|
||||
m_char_tilemap->set_transparent_pen(0);
|
||||
|
||||
save_item(NAME(m_pri));
|
||||
save_item(NAME(m_scrollxP0));
|
||||
save_item(NAME(m_scrollyP0));
|
||||
save_item(NAME(m_scrollxP1));
|
||||
save_item(NAME(m_scrollyP1));
|
||||
save_item(NAME(m_scrollx[0]));
|
||||
save_item(NAME(m_scrolly[0]));
|
||||
save_item(NAME(m_scrollx[1]));
|
||||
save_item(NAME(m_scrolly[1]));
|
||||
}
|
||||
|
||||
|
||||
@ -107,48 +98,12 @@ void xain_state::video_start()
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
WRITE8_MEMBER(xain_state::bgram0_w)
|
||||
{
|
||||
m_bgram0[offset] = data;
|
||||
m_bgram0_tilemap->mark_tile_dirty(offset & 0x3ff);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(xain_state::bgram1_w)
|
||||
{
|
||||
m_bgram1[offset] = data;
|
||||
m_bgram1_tilemap->mark_tile_dirty(offset & 0x3ff);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(xain_state::charram_w)
|
||||
{
|
||||
m_charram[offset] = data;
|
||||
m_char_tilemap->mark_tile_dirty(offset & 0x3ff);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(xain_state::scrollxP0_w)
|
||||
{
|
||||
m_scrollxP0[offset] = data;
|
||||
m_bgram0_tilemap->set_scrollx(0, m_scrollxP0[0]|(m_scrollxP0[1]<<8));
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(xain_state::scrollyP0_w)
|
||||
{
|
||||
m_scrollyP0[offset] = data;
|
||||
m_bgram0_tilemap->set_scrolly(0, m_scrollyP0[0]|(m_scrollyP0[1]<<8));
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(xain_state::scrollxP1_w)
|
||||
{
|
||||
m_scrollxP1[offset] = data;
|
||||
m_bgram1_tilemap->set_scrollx(0, m_scrollxP1[0]|(m_scrollxP1[1]<<8));
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(xain_state::scrollyP1_w)
|
||||
{
|
||||
m_scrollyP1[offset] = data;
|
||||
m_bgram1_tilemap->set_scrolly(0, m_scrollyP1[0]|(m_scrollyP1[1]<<8));
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(xain_state::flipscreen_w)
|
||||
{
|
||||
@ -214,51 +169,51 @@ uint32_t xain_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
|
||||
switch (m_pri&0x7)
|
||||
{
|
||||
case 0:
|
||||
m_bgram0_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
|
||||
m_bgram1_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
m_bg_tilemaps[0]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
|
||||
m_bg_tilemaps[1]->draw(screen, bitmap, cliprect, 0,0);
|
||||
draw_sprites(bitmap,cliprect);
|
||||
m_char_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
break;
|
||||
case 1:
|
||||
m_bgram1_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
|
||||
m_bgram0_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
m_bg_tilemaps[1]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
|
||||
m_bg_tilemaps[0]->draw(screen, bitmap, cliprect, 0,0);
|
||||
draw_sprites(bitmap,cliprect);
|
||||
m_char_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
break;
|
||||
case 2:
|
||||
m_char_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
|
||||
m_bgram0_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
m_char_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
|
||||
m_bg_tilemaps[0]->draw(screen, bitmap, cliprect, 0,0);
|
||||
draw_sprites(bitmap,cliprect);
|
||||
m_bgram1_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
m_bg_tilemaps[1]->draw(screen, bitmap, cliprect, 0,0);
|
||||
break;
|
||||
case 3:
|
||||
m_char_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
|
||||
m_bgram1_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
m_char_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
|
||||
m_bg_tilemaps[1]->draw(screen, bitmap, cliprect, 0,0);
|
||||
draw_sprites(bitmap,cliprect);
|
||||
m_bgram0_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
m_bg_tilemaps[0]->draw(screen, bitmap, cliprect, 0,0);
|
||||
break;
|
||||
case 4:
|
||||
m_bgram0_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
|
||||
m_bg_tilemaps[0]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
|
||||
m_char_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
draw_sprites(bitmap,cliprect);
|
||||
m_bgram1_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
m_bg_tilemaps[1]->draw(screen, bitmap, cliprect, 0,0);
|
||||
break;
|
||||
case 5:
|
||||
m_bgram1_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
|
||||
m_bg_tilemaps[1]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
|
||||
m_char_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
draw_sprites(bitmap,cliprect);
|
||||
m_bgram0_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
m_bg_tilemaps[0]->draw(screen, bitmap, cliprect, 0,0);
|
||||
break;
|
||||
case 6:
|
||||
m_bgram0_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
|
||||
m_bg_tilemaps[0]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
|
||||
draw_sprites(bitmap,cliprect);
|
||||
m_bgram1_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
m_bg_tilemaps[1]->draw(screen, bitmap, cliprect, 0,0);
|
||||
m_char_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
break;
|
||||
case 7:
|
||||
m_bgram1_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
|
||||
m_bg_tilemaps[1]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
|
||||
draw_sprites(bitmap,cliprect);
|
||||
m_bgram0_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
m_bg_tilemaps[0]->draw(screen, bitmap, cliprect, 0,0);
|
||||
m_char_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user