diff options
Diffstat (limited to 'src/mame/atari/marblmd2.cpp')
-rw-r--r-- | src/mame/atari/marblmd2.cpp | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/src/mame/atari/marblmd2.cpp b/src/mame/atari/marblmd2.cpp index 9f0adebd7d8..b4f9295eb67 100644 --- a/src/mame/atari/marblmd2.cpp +++ b/src/mame/atari/marblmd2.cpp @@ -54,8 +54,8 @@ public: void marblmd2(machine_config &config); protected: - virtual void video_start() override; - virtual void machine_start() override; + virtual void video_start() override ATTR_COLD; + virtual void machine_start() override ATTR_COLD; private: required_device<cpu_device> m_maincpu; @@ -65,7 +65,7 @@ private: required_device<atari_vad_device> m_vad; required_device<atari_motion_objects_device> m_mob; - void marblmd2_map(address_map &map); + void marblmd2_map(address_map &map) ATTR_COLD; void latch_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); @@ -113,30 +113,32 @@ uint32_t marblmd2_state::screen_update(screen_device &screen, bitmap_ind16 &bitm } } - for (const sparse_dirty_rect *rect = m_vad->mob().first_dirty_rect(cliprect); rect != nullptr; rect = rect->next()) - { - for (int y = rect->top(); y <= rect->bottom(); y++) - { - uint16_t const *const pf2 = &m_tempbitmap.pix(y); - uint16_t const *const mo = &mobitmap.pix(y); - uint16_t *const pf = &bitmap.pix(y); - for (int x = rect->left(); x <= rect->right(); x++) + m_vad->mob().iterate_dirty_rects( + cliprect, + [this, &bitmap, &mobitmap] (rectangle const &rect) { - if (mo[x] != 0xffff) + for (int y = rect.top(); y <= rect.bottom(); y++) { - if (pf2[x] & 0x80) // check against top bit of temp pf render - { - if (mo[x] & 0x80) - pf[x] = mo[x]; - } - else + uint16_t const *const pf2 = &m_tempbitmap.pix(y); + uint16_t const *const mo = &mobitmap.pix(y); + uint16_t *const pf = &bitmap.pix(y); + for (int x = rect.left(); x <= rect.right(); x++) { - pf[x] = mo[x] | 0x80; + if (mo[x] != 0xffff) + { + if (pf2[x] & 0x80) // check against top bit of temp pf render + { + if (mo[x] & 0x80) + pf[x] = mo[x]; + } + else + { + pf[x] = mo[x] | 0x80; + } + } } } - } - } - } + }); return 0; } @@ -146,7 +148,7 @@ void marblmd2_state::latch_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_latch_data); - if (m_latch_data & 0x0010) + if (BIT(m_latch_data, 4)) m_jsa->soundcpu().set_input_line(INPUT_LINE_RESET, CLEAR_LINE); else m_jsa->soundcpu().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); @@ -245,7 +247,7 @@ static INPUT_PORTS_START( marblmd2 ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_SOUND_TO_MAIN_READY("jsa") // Input buffer full PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa") // Output buffer full PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("screen", FUNC(screen_device::vblank)) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END @@ -274,8 +276,8 @@ static const gfx_layout molayout = static GFXDECODE_START( gfx_mm2 ) - GFXDECODE_ENTRY( "gfx1", 0, pflayout, 0x0, 1 ) - GFXDECODE_ENTRY( "gfx2", 0, molayout, 0x0, 0x10 ) + GFXDECODE_ENTRY( "tiles", 0, pflayout, 0x0, 1 ) + GFXDECODE_ENTRY( "sprites", 0, molayout, 0x0, 0x10 ) GFXDECODE_END @@ -293,7 +295,6 @@ const atari_motion_objects_config marblmd2_state::s_mob_config = 0, // maximum number of links to visit/scanline (0=all) 0x000, // base palette entry - 0x100, // maximum number of colors 0, // transparent pen index {{ 0x03ff,0,0,0 }}, // mask for the link @@ -365,7 +366,7 @@ ROM_START( marblmd2 ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) // 6502 code ROM_LOAD( "aud0.12c", 0x00000, 0x10000, CRC(89a8d90a) SHA1(cd73483d0bcfe2c8134d005c4417975f9a2cb658) ) - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "tiles", 0 ) ROM_LOAD( "pf0l.3p", 0x00000, 0x20000, CRC(a4fe377a) SHA1(a8a1a8027da778e5ad406a65814eec999b0f81af) ) ROM_LOAD( "pf1l.3m", 0x20000, 0x20000, CRC(5dc7aaa8) SHA1(4fb815e9bcf6bcdf1b7976a3dea2b6d1dd6a8f6b) ) ROM_LOAD( "pf2l.3k", 0x40000, 0x20000, CRC(0c7c5f74) SHA1(26f1d36f70f4e8354537d0d67764a1c9be35e8f7) ) @@ -375,7 +376,7 @@ ROM_START( marblmd2 ) ROM_LOAD( "pf2h.1k", 0xc0000, 0x20000, CRC(18323df9) SHA1(9c4add4733bcfe7202b53d86f1bca4b9d207e22a) ) ROM_LOAD( "pf3h.1j", 0xe0000, 0x20000, CRC(05d86ef8) SHA1(47eefd7112a3a3be16f0b4496cf034c8f7a69b1b) ) - ROM_REGION( 0x80000, "gfx2", 0 ) + ROM_REGION( 0x80000, "sprites", 0 ) ROM_LOAD( "mo0l.7p", 0x00000, 0x20000, CRC(950d95a3) SHA1(3f38da7b6eeaa87cc84b98c9d535468b0c060f6d) ) ROM_LOAD( "mo1l.10p", 0x20000, 0x20000, CRC(b62b6ebf) SHA1(3781cd81780c10cd245871bb8f7b6260f7bb53b7) ) ROM_LOAD( "mo0h.12p", 0x40000, 0x20000, CRC(e47d92b0) SHA1(7953e8342450c02408e4d90f132144d55de2f491) ) |