From 5efaf196cbc95f1cacf5b5d88d14d8b1bed7b574 Mon Sep 17 00:00:00 2001 From: AJR Date: Sat, 26 Oct 2019 01:20:52 -0400 Subject: tilemap.cpp: Relax assert and do some sanity checks (fixes mtrain and strain with DEBUG=1) Note that opengolf is still broken, with a segmentation fault occurring at some point. --- src/emu/tilemap.cpp | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/emu/tilemap.cpp b/src/emu/tilemap.cpp index 083b4b4ef5a..b3ddac976fc 100644 --- a/src/emu/tilemap.cpp +++ b/src/emu/tilemap.cpp @@ -947,10 +947,10 @@ void tilemap_t::draw_common(screen_device &screen, _BitmapClass &dest, const rec g_profiler.start(PROFILER_TILEMAP_DRAW); // configure the blit parameters based on the input parameters - assert(dest.cliprect().contains(cliprect)); - assert(screen.cliprect().contains(cliprect)); blit_parameters blit; configure_blit_parameters(blit, screen.priority(), cliprect, flags, priority, priority_mask); + assert(dest.cliprect().contains(cliprect)); + assert(screen.cliprect().contains(cliprect) || blit.tilemap_priority_code == 0xff00); // flush the dirty state to all tiles as appropriate realize_all_dirty_tiles(); @@ -1084,10 +1084,10 @@ void tilemap_t::draw_roz_common(screen_device &screen, _BitmapClass &dest, const g_profiler.start(PROFILER_TILEMAP_DRAW_ROZ); // configure the blit parameters - assert(dest.cliprect().contains(cliprect)); - assert(screen.cliprect().contains(cliprect)); blit_parameters blit; configure_blit_parameters(blit, screen.priority(), cliprect, flags, priority, priority_mask); + assert(dest.cliprect().contains(cliprect)); + assert(screen.cliprect().contains(cliprect) || blit.tilemap_priority_code == 0xff00); // get the full pixmap for the tilemap pixmap(); @@ -1303,7 +1303,7 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c const int ymask = m_pixmap.height() - 1; const int widthshifted = m_pixmap.width() << 16; const int heightshifted = m_pixmap.height() << 16; - u32 priority = blit.tilemap_priority_code; + const u32 priority = blit.tilemap_priority_code; u8 mask = blit.mask; u8 value = blit.value; u8 alpha = blit.alpha; @@ -1344,7 +1344,7 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c u32 cy = starty >> 16; // get source and priority pointers - u8 *pri = &priority_bitmap.pix8(sy, sx); + u8 *pri = (priority != 0xff00) ? &priority_bitmap.pix8(sy, sx) : nullptr; const u16 *src = &m_pixmap.pix16(cy); const u8 *maskptr = &m_flagsmap.pix8(cy); typename _BitmapClass::pixel_t *dest = &destbitmap.pix(sy, sx); @@ -1356,14 +1356,16 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c if ((maskptr[cx >> 16] & mask) == value) { ROZ_PLOT_PIXEL(src[cx >> 16]); - *pri = (*pri & (priority >> 8)) | priority; + if (priority != 0xff00) + *pri = (*pri & (priority >> 8)) | priority; } // advance in X cx += incxx; x++; ++dest; - pri++; + if (priority != 0xff00) + pri++; } } @@ -1386,7 +1388,7 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c // get dest and priority pointers typename _BitmapClass::pixel_t *dest = &destbitmap.pix(sy, sx); - u8 *pri = &priority_bitmap.pix8(sy, sx); + u8 *pri = (priority != 0xff00) ? &priority_bitmap.pix8(sy, sx) : nullptr; // loop over columns while (x <= ex) @@ -1395,7 +1397,8 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c if ((m_flagsmap.pix8((cy >> 16) & ymask, (cx >> 16) & xmask) & mask) == value) { ROZ_PLOT_PIXEL(m_pixmap.pix16((cy >> 16) & ymask, (cx >> 16) & xmask)); - *pri = (*pri & (priority >> 8)) | priority; + if (priority != 0xff00) + *pri = (*pri & (priority >> 8)) | priority; } // advance in X @@ -1403,7 +1406,8 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c cy += incxy; x++; ++dest; - pri++; + if (priority != 0xff00) + pri++; } // advance in Y @@ -1426,7 +1430,7 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c // get dest and priority pointers typename _BitmapClass::pixel_t *dest = &destbitmap.pix(sy, sx); - u8 *pri = &priority_bitmap.pix8(sy, sx); + u8 *pri = (priority != 0xff00) ? &priority_bitmap.pix8(sy, sx) : nullptr; // loop over columns while (x <= ex) @@ -1436,7 +1440,8 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c if ((m_flagsmap.pix8(cy >> 16, cx >> 16) & mask) == value) { ROZ_PLOT_PIXEL(m_pixmap.pix16(cy >> 16, cx >> 16)); - *pri = (*pri & (priority >> 8)) | priority; + if (priority != 0xff00) + *pri = (*pri & (priority >> 8)) | priority; } // advance in X @@ -1444,7 +1449,8 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c cy += incxy; x++; ++dest; - pri++; + if (priority != 0xff00) + pri++; } // advance in Y -- cgit v1.2.3 From 84ab8dcd634cfc3131fce1328dc28f2b80ba5165 Mon Sep 17 00:00:00 2001 From: AJR Date: Sun, 27 Oct 2019 01:42:18 -0400 Subject: hvyunit: Fix coin counters --- src/mame/drivers/hvyunit.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/mame/drivers/hvyunit.cpp b/src/mame/drivers/hvyunit.cpp index 28990353c76..3f7374820f1 100644 --- a/src/mame/drivers/hvyunit.cpp +++ b/src/mame/drivers/hvyunit.cpp @@ -140,9 +140,8 @@ private: DECLARE_WRITE8_MEMBER(slave_bankswitch_w); DECLARE_WRITE8_MEMBER(scrollx_w); DECLARE_WRITE8_MEMBER(scrolly_w); - DECLARE_WRITE8_MEMBER(coin_count_w); + DECLARE_WRITE8_MEMBER(slave_ack_w); DECLARE_WRITE8_MEMBER(sound_bankswitch_w); - DECLARE_READ8_MEMBER(mermaid_p0_r); DECLARE_WRITE8_MEMBER(mermaid_p0_w); DECLARE_READ8_MEMBER(mermaid_p1_r); DECLARE_WRITE8_MEMBER(mermaid_p1_w); @@ -182,6 +181,7 @@ void hvyunit_state::machine_start() m_slavebank->configure_entries(0, 4, memregion("slave")->base(), 0x4000); m_soundbank->configure_entries(0, 4, memregion("soundcpu")->base(), 0x4000); + std::fill_n(&m_mermaid_p[0], 4, 0xff); save_item(NAME(m_mermaid_p)); } @@ -294,10 +294,9 @@ WRITE8_MEMBER(hvyunit_state::scrolly_w) m_scrolly = data; } -WRITE8_MEMBER(hvyunit_state::coin_count_w) +WRITE8_MEMBER(hvyunit_state::slave_ack_w) { - machine().bookkeeping().coin_counter_w(0, data & 1); - machine().bookkeeping().coin_counter_w(1, data & 2); + m_slavecpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE); } @@ -319,12 +318,6 @@ WRITE8_MEMBER(hvyunit_state::sound_bankswitch_w) * *************************************/ -READ8_MEMBER(hvyunit_state::mermaid_p0_r) -{ - // ? - return 0; -} - WRITE8_MEMBER(hvyunit_state::mermaid_p0_w) { if (!BIT(m_mermaid_p[0], 1) && BIT(data, 1)) @@ -333,6 +326,14 @@ WRITE8_MEMBER(hvyunit_state::mermaid_p0_w) if (BIT(data, 0) == 0) m_mermaid_p[1] = m_mermaidlatch->read(); + if (!BIT(m_mermaid_p[0], 4) && BIT(data, 4)) + { + machine().bookkeeping().coin_counter_w(0, BIT(m_mermaid_p[2], 0)); + machine().bookkeeping().coin_counter_w(1, BIT(m_mermaid_p[2], 1)); + machine().bookkeeping().coin_lockout_w(0, !BIT(m_mermaid_p[2], 2)); + machine().bookkeeping().coin_lockout_w(1, !BIT(m_mermaid_p[2], 3)); + } + m_mermaid_p[0] = data; } @@ -433,7 +434,7 @@ void hvyunit_state::slave_io(address_map &map) map(0x06, 0x06).w(FUNC(hvyunit_state::scrolly_w)); map(0x08, 0x08).w(FUNC(hvyunit_state::scrollx_w)); map(0x0c, 0x0c).r(FUNC(hvyunit_state::mermaid_status_r)); - map(0x0e, 0x0e).w(FUNC(hvyunit_state::coin_count_w)); + map(0x0e, 0x0e).w(FUNC(hvyunit_state::slave_ack_w)); // map(0x22, 0x22).r(FUNC(hvyunit_state::hu_scrolly_hi_reset)); //22/a2 taken from ram $f065 // map(0xa2, 0xa2).r(FUNC(hvyunit_state::hu_scrolly_hi_set)); @@ -613,14 +614,13 @@ void hvyunit_state::hvyunit(machine_config &config) Z80(config, m_slavecpu, XTAL(12'000'000)/2); /* 6MHz verified on PCB */ m_slavecpu->set_addrmap(AS_PROGRAM, &hvyunit_state::slave_memory); m_slavecpu->set_addrmap(AS_IO, &hvyunit_state::slave_io); - m_slavecpu->set_vblank_int("screen", FUNC(hvyunit_state::irq0_line_hold)); + m_slavecpu->set_vblank_int("screen", FUNC(hvyunit_state::irq0_line_assert)); Z80(config, m_soundcpu, XTAL(12'000'000)/2); /* 6MHz verified on PCB */ m_soundcpu->set_addrmap(AS_PROGRAM, &hvyunit_state::sound_memory); m_soundcpu->set_addrmap(AS_IO, &hvyunit_state::sound_io); I80C51(config, m_mermaid, XTAL(12'000'000)/2); /* 6MHz verified on PCB */ - m_mermaid->port_in_cb<0>().set(FUNC(hvyunit_state::mermaid_p0_r)); m_mermaid->port_out_cb<0>().set(FUNC(hvyunit_state::mermaid_p0_w)); m_mermaid->port_in_cb<1>().set(FUNC(hvyunit_state::mermaid_p1_r)); m_mermaid->port_out_cb<1>().set(FUNC(hvyunit_state::mermaid_p1_w)); -- cgit v1.2.3 From a529dcbfd3f5af0cb44314bf56442d5e4a108aa8 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Mon, 28 Oct 2019 19:15:26 +1100 Subject: MT 07469: vboy: sprite elements are cut off. --- src/mame/drivers/vboy.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/vboy.cpp b/src/mame/drivers/vboy.cpp index 512925a51e8..2efc1d95614 100644 --- a/src/mame/drivers/vboy.cpp +++ b/src/mame/drivers/vboy.cpp @@ -223,8 +223,8 @@ void vboy_state::put_obj(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, if (dat) { - uint8_t const res_x = x + xi; - uint8_t const res_y = y + yi; + uint16_t const res_x = x + xi; + uint16_t const res_y = y + yi; if (cliprect.contains(res_x, res_y)) { -- cgit v1.2.3 From b085530756fbd23576dc5fc9b00829e7ceb5c0a1 Mon Sep 17 00:00:00 2001 From: algestam Date: Mon, 28 Oct 2019 23:27:24 +0100 Subject: bgfx: fix resource leak (nw) (#5820) --- src/osd/modules/render/bgfx/chain.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/osd/modules/render/bgfx/chain.cpp b/src/osd/modules/render/bgfx/chain.cpp index 906e715e177..940bf85d81d 100644 --- a/src/osd/modules/render/bgfx/chain.cpp +++ b/src/osd/modules/render/bgfx/chain.cpp @@ -168,5 +168,6 @@ void bgfx_chain::prepend_converter(bgfx_effect *effect, chain_manager &chains) const uint32_t screen_width = chains.targets().width(TARGET_STYLE_GUEST, m_screen_index); const uint32_t screen_height = chains.targets().height(TARGET_STYLE_GUEST, m_screen_index); + m_targets.destroy_target("screen", m_screen_index); m_targets.create_target("screen", bgfx::TextureFormat::RGBA8, screen_width, screen_height, TARGET_STYLE_GUEST, true, false, 1, m_screen_index); } -- cgit v1.2.3 From d4a42bd13f60732a208fb143da4b303746a368d9 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Tue, 29 Oct 2019 12:45:45 +1100 Subject: screen.cpp: remove leftover debug print (nw) --- src/emu/screen.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp index a946fb22bd2..4ac63a0e981 100644 --- a/src/emu/screen.cpp +++ b/src/emu/screen.cpp @@ -1039,11 +1039,6 @@ void screen_device::update_scan_bitmap_size(int y) // determine effective size to allocate s32 effwidth = std::max(m_max_width, m_visarea.right() + 1); - if (machine().input().code_pressed(KEYCODE_Q)) - { - printf("Updating scan bitmap %d to %d (%d vs. %d)\n", y, effwidth, m_max_width, m_visarea.right() + 1); - } - if (m_scan_widths[y] == effwidth) return; -- cgit v1.2.3 From e9ef4808dd1fe9e5d3c26bc0c1144209503222ab Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 30 Oct 2019 04:16:37 +1100 Subject: version bump (nw) --- android-project/app/src/main/AndroidManifest.xml | 4 ++-- makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/android-project/app/src/main/AndroidManifest.xml b/android-project/app/src/main/AndroidManifest.xml index 41ca3b16ffc..1974d532430 100644 --- a/android-project/app/src/main/AndroidManifest.xml +++ b/android-project/app/src/main/AndroidManifest.xml @@ -4,8 +4,8 @@ --> diff --git a/makefile b/makefile index 6b6d256b855..d51272121ba 100644 --- a/makefile +++ b/makefile @@ -1704,14 +1704,14 @@ endif ifeq (posix,$(SHELLTYPE)) $(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS) - @echo '#define BARE_BUILD_VERSION "0.214"' > $@ + @echo '#define BARE_BUILD_VERSION "0.215"' > $@ @echo 'extern const char bare_build_version[];' >> $@ @echo 'extern const char build_version[];' >> $@ @echo 'const char bare_build_version[] = BARE_BUILD_VERSION;' >> $@ @echo 'const char build_version[] = BARE_BUILD_VERSION " ($(NEW_GIT_VERSION))";' >> $@ else $(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS) - @echo #define BARE_BUILD_VERSION "0.214" > $@ + @echo #define BARE_BUILD_VERSION "0.215" > $@ @echo extern const char bare_build_version[]; >> $@ @echo extern const char build_version[]; >> $@ @echo const char bare_build_version[] = BARE_BUILD_VERSION; >> $@ -- cgit v1.2.3