summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/misc/mcatadv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/misc/mcatadv.cpp')
-rw-r--r--src/mame/misc/mcatadv.cpp87
1 files changed, 39 insertions, 48 deletions
diff --git a/src/mame/misc/mcatadv.cpp b/src/mame/misc/mcatadv.cpp
index d436899e2a6..ae9fd6986b7 100644
--- a/src/mame/misc/mcatadv.cpp
+++ b/src/mame/misc/mcatadv.cpp
@@ -21,8 +21,8 @@ Magical Cat (C) 1993 Wintechno
Board Name: LINDA5
Main CPU: 68000-16
- Sound CPU: Z80
- Sound Chip: YMF286-K
+ Sound CPU: Z0840004PSC
+ Sound Chip: YMF286-K & Y3016-F
Custom: FACE FX1037 x1
038 x2 (As in Cave)
@@ -68,7 +68,7 @@ NOS-B1-00.U60 /
NOS-B1-01.U61-
YMF286-K is compatible to YM2610 - see psikyo/psikyo.cpp driver
-038 9320EX702 / 038 9330EX705 - see misc/cave.cpp driver
+038 9320EX702 / 038 9330EX705 - see atlus/cave.cpp driver
Note # = Pin #1 PCB Layout:
@@ -186,12 +186,12 @@ public:
, m_vidregs(*this, "vidregs")
{ }
- void nost(machine_config &config);
- void mcatadv(machine_config &config);
+ void nost(machine_config &config) ATTR_COLD;
+ void mcatadv(machine_config &config) ATTR_COLD;
protected:
- virtual void machine_start() override;
- virtual void video_start() override;
+ virtual void machine_start() override ATTR_COLD;
+ virtual void video_start() override ATTR_COLD;
private:
// memory pointers
@@ -218,28 +218,23 @@ private:
void screen_vblank(int state);
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_tilemap_part(screen_device &screen, int layer, int i, bitmap_ind16 &bitmap, const rectangle &cliprect);
- void main_map(address_map &map);
- void mcatadv_sound_io_map(address_map &map);
- void mcatadv_sound_map(address_map &map);
- void nost_sound_io_map(address_map &map);
- void nost_sound_map(address_map &map);
+ void main_map(address_map &map) ATTR_COLD;
+ void mcatadv_sound_io_map(address_map &map) ATTR_COLD;
+ void mcatadv_sound_map(address_map &map) ATTR_COLD;
+ void nost_sound_io_map(address_map &map) ATTR_COLD;
+ void nost_sound_map(address_map &map) ATTR_COLD;
};
-// video
-
void mcatadv_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- u16 *source = (m_spriteram->buffer() + (m_spriteram->bytes() / 2) /2);
+ const u16 *source = (m_spriteram->buffer() + (m_spriteram->bytes() / 2) / 2);
source -= 4;
- u16 *finish = m_spriteram->buffer();
- int const global_x = m_vidregs->live()[0] - 0x184;
- int const global_y = m_vidregs->live()[1] - 0x1f1;
-
- u32 const sprmask = m_sprdata.bytes() - 1;
+ const u16 *finish = m_spriteram->buffer();
+ const int global_x = m_vidregs->live()[0] - 0x184;
+ const int global_y = m_vidregs->live()[1] - 0x1f1;
- int xstart, xend, xinc;
- int ystart, yend, yinc;
+ const u32 sprmask = m_sprdata.bytes() - 1;
if (m_vidregs->buffer()[2] == 0x0001) // double buffered
{
@@ -253,24 +248,19 @@ void mcatadv_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co
while (source >= finish)
{
- u32 const pen = (source[0] & 0x3f00) >> 8;
- u32 const tileno = source[1] & 0xffff;
- u8 pri = (source[0] & 0xc000) >> 14;
-
- pri |= 0x8;
+ const u32 pen = (source[0] & 0x3f00) >> 8;
+ const u32 tileno = source[1] & 0xffff;
+ const u8 pri = 0x8 | ((source[0] & 0xc000) >> 14);
- int x = source[2] & 0x3ff;
- int y = source[3] & 0x3ff;
- int flipy = source[0] & 0x0040;
- int flipx = source[0] & 0x0080;
+ int x = util::sext(source[2] & 0x3ff, 10);
+ int y = util::sext(source[3] & 0x3ff, 10);
+ bool flipy = BIT(source[0], 6);
+ bool flipx = BIT(source[0], 7);
- int const height = ((source[3] & 0xf000) >> 12) * 16;
- int const width = ((source[2] & 0xf000) >> 12) * 16;
+ const int height = ((source[3] & 0xf000) >> 12) * 16;
+ const int width = ((source[2] & 0xf000) >> 12) * 16;
u32 offset = tileno * 256;
- if (x & 0x200) x -= 0x400;
- if (y & 0x200) y -= 0x400;
-
#if 0 // For Flipscreen/Cocktail
if (m_vidregs->live()[0] & 0x8000)
{
@@ -284,6 +274,9 @@ void mcatadv_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co
if (source[3] != source[0]) // 'hack' don't draw sprites while it's testing the RAM!
{
+ int xstart, xend, xinc;
+ int ystart, yend, yinc;
+
if (!flipx) { xstart = 0; xend = width; xinc = 1; }
else { xstart = width-1; xend = -1; xinc = -1; }
if (!flipy) { ystart = 0; yend = height; yinc = 1; }
@@ -308,10 +301,10 @@ void mcatadv_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co
if (!(pridata & 0x10)) // if we haven't already drawn a sprite pixel here (sprite masking)
{
- u8 pix = m_sprdata[(offset / 2)&sprmask];
+ u8 pix = m_sprdata[(offset / 2) & sprmask];
- if (offset & 1)
- pix = pix >> 4;
+ if (BIT(offset, 0))
+ pix >>= 4;
pix &= 0x0f;
if (pix)
@@ -370,7 +363,7 @@ void mcatadv_state::draw_tilemap_part(screen_device &screen, int layer, int i, b
// global flip
if (m_tilemap[layer]->flipx()) scrollx -= 0x19;
if (m_tilemap[layer]->flipy()) scrolly -= 0x141;
- int flip = (m_tilemap[layer]->flipx() ? TILEMAP_FLIPX : 0) | (m_tilemap[layer]->flipy() ? TILEMAP_FLIPY : 0);
+ const int flip = (m_tilemap[layer]->flipx() ? TILEMAP_FLIPX : 0) | (m_tilemap[layer]->flipy() ? TILEMAP_FLIPY : 0);
m_tilemap[layer]->set_scrollx(0, scrollx);
m_tilemap[layer]->set_scrolly(0, scrolly);
@@ -430,8 +423,6 @@ void mcatadv_state::video_start()
}
-// machine
-
template<int Chip>
void mcatadv_state::get_banked_color(bool tiledim, u32 &color, u32 &pri, u32 &code)
{
@@ -755,7 +746,7 @@ void mcatadv_state::mcatadv(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(16'000'000) / 2)); // verified on PCB
ymsnd.irq_handler().set_inputline(m_soundcpu, 0);
- ymsnd.add_route(0, "mono", 0.32);
+ ymsnd.add_route(0, "mono", 1.0);
ymsnd.add_route(1, "mono", 0.5);
ymsnd.add_route(2, "mono", 0.5);
}
@@ -767,11 +758,11 @@ void mcatadv_state::nost(machine_config &config)
m_soundcpu->set_addrmap(AS_PROGRAM, &mcatadv_state::nost_sound_map);
m_soundcpu->set_addrmap(AS_IO, &mcatadv_state::nost_sound_io_map);
- ym2610_device &ymsnd(YM2610(config.replace(), "ymsnd", XTAL(16'000'000) / 2)); // verified on PCB
- ymsnd.irq_handler().set_inputline(m_soundcpu, 0);
- ymsnd.add_route(0, "mono", 0.2);
- ymsnd.add_route(1, "mono", 0.5);
- ymsnd.add_route(2, "mono", 0.5);
+ ym2610_device *ymsnd = subdevice<ym2610_device>("ymsnd");
+ ymsnd->reset_routes();
+ ymsnd->add_route(0, "mono", 0.6);
+ ymsnd->add_route(1, "mono", 0.5);
+ ymsnd->add_route(2, "mono", 0.5);
}