From 4b8a3b854a2ffc114e1a92dc7c6b2ccc4442bcf6 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 26 Aug 2018 17:29:20 +1000 Subject: fix validity by making region size match other sets (nw) --- src/mame/drivers/snk68.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/drivers/snk68.cpp b/src/mame/drivers/snk68.cpp index 420ffd91d69..a51b610923d 100644 --- a/src/mame/drivers/snk68.cpp +++ b/src/mame/drivers/snk68.cpp @@ -889,7 +889,7 @@ ROM_START( ikari3w ) /* Initial boot shows Ikari III The Rescue, then the title ROM_LOAD16_BYTE( "ik_2.c10", 0x000000, 0x20000, CRC(d0b690d3) SHA1(6c31b27e6b9f1438e8ddbefe41fa8ded22cdb51c) ) /* Rotary Joystick - hand written label */ ROM_LOAD16_BYTE( "ik_3.c9", 0x000001, 0x20000, CRC(11a9e664) SHA1(bf2d8a5f3f2aeff99a45d26279c88ebf04b7f79b) ) /* Rotary Joystick - hand written label */ - ROM_REGION( 0x10000, "soundcpu", 0 ) /* Sound CPU */ + ROM_REGION( 0x20000, "soundcpu", 0 ) /* Sound CPU */ ROM_LOAD( "ik3-6.18e", 0x000000, 0x20000, CRC(59d256a4) SHA1(1e7b33329f761c695bc9a817bbc0c5e13386d073) ) ROM_REGION( 0x010000, "gfx1", 0 ) /* characters */ -- cgit v1.2.3 From f70581a7a90b5a9cba6ea52dfe6ebc940181a7ff Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 26 Aug 2018 19:59:54 +1000 Subject: hook up Amiga CDTV keyboard reset --- src/mame/drivers/amiga.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mame/drivers/amiga.cpp b/src/mame/drivers/amiga.cpp index ffa5bd40d63..f235f1440e0 100644 --- a/src/mame/drivers/amiga.cpp +++ b/src/mame/drivers/amiga.cpp @@ -74,6 +74,10 @@ different components: * BAS32L diode for power-on reset * This gives delays of 152ms, 176µs, and 704ms +The equivalent circuit in the Amiga CDTV has the same thresholds as the +Amiga 2000, but uses 1kΩ resistors for timing. This gives delays of +11.2ms, 7.43ms, and 27.5ms. + */ DECLARE_DEVICE_TYPE(A2000_KBRESET, a2000_kbreset_device) @@ -206,7 +210,7 @@ private: u8 m_c814_charging = 1U; // U805 pin 2 }; -DEFINE_DEVICE_TYPE(A2000_KBRESET, a2000_kbreset_device, "a2000kbrst", "Amiga 1000/2000 keyboard reset circuit") +DEFINE_DEVICE_TYPE(A2000_KBRESET, a2000_kbreset_device, "a2000kbrst", "Amiga 1000/2000/CDTV keyboard reset circuit") //************************************************************************** @@ -1762,6 +1766,9 @@ MACHINE_CONFIG_START(cdtv_state::cdtv) auto &kbd(AMIGA_KEYBOARD_INTERFACE(config, "kbd", amiga_keyboard_devices, "a2000_us")); kbd.kclk_handler().set("cia_0", FUNC(mos8520_device::cnt_w)); kbd.kdat_handler().set("cia_0", FUNC(mos8520_device::sp_w)); + A2000_KBRESET(config, "kbrst") + .set_delays(attotime::from_usec(11238), attotime::from_usec(7432), attotime::from_usec(27539)) + .kbrst_cb().set(FUNC(a1000_state::kbreset_w)); // main cpu MCFG_DEVICE_ADD("maincpu", M68000, amiga_state::CLK_7M_PAL) -- cgit v1.2.3 From d629034f52ae18a44196cfca2bfb185b8bd48e16 Mon Sep 17 00:00:00 2001 From: smf- Date: Sun, 26 Aug 2018 08:32:20 +0100 Subject: added devcb workround to allow mitsumi keyboard to build with visual studio (nw) --- src/emu/devcb.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/emu/devcb.h b/src/emu/devcb.h index f535b9db84e..e45c94adfd6 100644 --- a/src/emu/devcb.h +++ b/src/emu/devcb.h @@ -1120,12 +1120,14 @@ private: template class transform_builder; // workaround for MSVC template class first_transform_builder; // workaround for MSVC + template class functoid_builder; // workaround for MSVC class builder_base { protected: template friend class transform_builder; // workaround for MSVC template friend class first_transform_builder; // workaround for MSVC + template friend class functoid_builder; // workaround for MSVC builder_base(devcb_write &target, bool append) : m_target(target), m_append(append) { } builder_base(builder_base const &) = delete; -- cgit v1.2.3 From c643b6cc519607fe4bc9833b91eff062ada62630 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 27 Aug 2018 00:17:00 +1000 Subject: name after oldest machine it appears in (nw) --- src/mame/drivers/amiga.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/mame/drivers/amiga.cpp b/src/mame/drivers/amiga.cpp index f235f1440e0..6fa3c5cc5d9 100644 --- a/src/mame/drivers/amiga.cpp +++ b/src/mame/drivers/amiga.cpp @@ -80,20 +80,20 @@ Amiga 2000, but uses 1kΩ resistors for timing. This gives delays of */ -DECLARE_DEVICE_TYPE(A2000_KBRESET, a2000_kbreset_device) +DECLARE_DEVICE_TYPE(A1000_KBRESET, a1000_kbreset_device) -class a2000_kbreset_device : public device_t +class a1000_kbreset_device : public device_t { public: - a2000_kbreset_device(machine_config const &config, char const *tag, device_t *owner, u32 clock = 0U) : - device_t(config, A2000_KBRESET, tag, owner, clock), + a1000_kbreset_device(machine_config const &config, char const *tag, device_t *owner, u32 clock = 0U) : + device_t(config, A1000_KBRESET, tag, owner, clock), m_kbrst_cb(*this) { } auto kbrst_cb() { return m_kbrst_cb.bind(); } - a2000_kbreset_device &set_delays(attotime detect, attotime stray, attotime output) + a1000_kbreset_device &set_delays(attotime detect, attotime stray, attotime output) { m_detect_time = detect; m_stray_time = stray; @@ -137,8 +137,8 @@ protected: virtual void device_start() override { // allocate resources - m_c813_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a2000_kbreset_device::c813_charged), this)); - m_c814_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a2000_kbreset_device::c814_charged), this)); + m_c813_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a1000_kbreset_device::c813_charged), this)); + m_c814_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a1000_kbreset_device::c814_charged), this)); // start in idle state m_kbclk = 1U; @@ -210,7 +210,7 @@ private: u8 m_c814_charging = 1U; // U805 pin 2 }; -DEFINE_DEVICE_TYPE(A2000_KBRESET, a2000_kbreset_device, "a2000kbrst", "Amiga 1000/2000/CDTV keyboard reset circuit") +DEFINE_DEVICE_TYPE(A1000_KBRESET, a1000_kbreset_device, "a1000kbrst", "Amiga 1000/2000/CDTV keyboard reset circuit") //************************************************************************** @@ -1637,9 +1637,9 @@ MACHINE_CONFIG_START(a1000_state::a1000) // keyboard auto &kbd(AMIGA_KEYBOARD_INTERFACE(config, "kbd", amiga_keyboard_devices, "a1000_us")); kbd.kclk_handler().set("cia_0", FUNC(mos8520_device::cnt_w)); - kbd.kclk_handler().append("kbrst", FUNC(a2000_kbreset_device::kbclk_w)); + kbd.kclk_handler().append("kbrst", FUNC(a1000_kbreset_device::kbclk_w)); kbd.kdat_handler().set("cia_0", FUNC(mos8520_device::sp_w)); - A2000_KBRESET(config, "kbrst") + A1000_KBRESET(config, "kbrst") .set_delays(attotime::from_msec(152), attotime::from_usec(176), attotime::from_msec(704)) .kbrst_cb().set(FUNC(a1000_state::kbreset_w)); @@ -1676,9 +1676,9 @@ MACHINE_CONFIG_START(a2000_state::a2000) // keyboard auto &kbd(AMIGA_KEYBOARD_INTERFACE(config, "kbd", amiga_keyboard_devices, "a2000_us")); kbd.kclk_handler().set("cia_0", FUNC(mos8520_device::cnt_w)); - kbd.kclk_handler().append("kbrst", FUNC(a2000_kbreset_device::kbclk_w)); + kbd.kclk_handler().append("kbrst", FUNC(a1000_kbreset_device::kbclk_w)); kbd.kdat_handler().set("cia_0", FUNC(mos8520_device::sp_w)); - A2000_KBRESET(config, "kbrst") + A1000_KBRESET(config, "kbrst") .set_delays(attotime::from_msec(112), attotime::from_msec(74), attotime::from_msec(1294)) .kbrst_cb().set(FUNC(a2000_state::kbreset_w)); @@ -1765,8 +1765,9 @@ MACHINE_CONFIG_START(cdtv_state::cdtv) // keyboard auto &kbd(AMIGA_KEYBOARD_INTERFACE(config, "kbd", amiga_keyboard_devices, "a2000_us")); kbd.kclk_handler().set("cia_0", FUNC(mos8520_device::cnt_w)); + kbd.kclk_handler().append("kbrst", FUNC(a1000_kbreset_device::kbclk_w)); kbd.kdat_handler().set("cia_0", FUNC(mos8520_device::sp_w)); - A2000_KBRESET(config, "kbrst") + A1000_KBRESET(config, "kbrst") .set_delays(attotime::from_usec(11238), attotime::from_usec(7432), attotime::from_usec(27539)) .kbrst_cb().set(FUNC(a1000_state::kbreset_w)); -- cgit v1.2.3 From 8105b735482ab55b342578f3c4ab1e3c75c41942 Mon Sep 17 00:00:00 2001 From: mooglyguy Date: Sun, 26 Aug 2018 16:26:22 +0200 Subject: -bgfx: Improved rendering with artwork by 5-10x or more. [Ryan Holtz] --- src/emu/render.cpp | 16 +++++- src/emu/render.h | 11 ++-- src/emu/screen.cpp | 4 +- src/osd/modules/render/bgfx/texturemanager.cpp | 78 +++++++++++++++++++++++++- src/osd/modules/render/bgfx/texturemanager.h | 19 ++++++- src/osd/modules/render/bgfxutil.h | 8 +-- src/osd/modules/render/drawbgfx.cpp | 9 +-- src/osd/modules/render/drawbgfx.h | 6 +- src/osd/modules/render/drawd3d.cpp | 11 ++-- 9 files changed, 130 insertions(+), 32 deletions(-) diff --git a/src/emu/render.cpp b/src/emu/render.cpp index d06c617d0c6..8c743e9a6a6 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -323,7 +323,8 @@ render_texture::render_texture() m_next(nullptr), m_bitmap(nullptr), m_format(TEXFORMAT_ARGB32), - m_osddata(~0L), + m_id(~0ULL), + m_old_id(~0ULL), m_scaler(nullptr), m_param(nullptr), m_curseq(0) @@ -357,7 +358,8 @@ void render_texture::reset(render_manager &manager, texture_scaler_func scaler, m_scaler = scaler; m_param = param; } - m_osddata = ~0L; + m_old_id = m_id; + m_id = ~0L; } @@ -447,7 +449,10 @@ void render_texture::get_scaled(u32 dwidth, u32 dheight, render_texinfo &texinfo if (dwidth < 1) dwidth = 1; if (dheight < 1) dheight = 1; - texinfo.osddata = m_osddata; + texinfo.unique_id = m_id; + texinfo.old_id = m_old_id; + if (m_old_id != ~0ULL) + m_old_id = ~0ULL; // are we scaler-free? if so, just return the source bitmap if (m_scaler == nullptr || (m_bitmap != nullptr && swidth == dwidth && sheight == dheight)) @@ -617,8 +622,10 @@ void render_container::set_overlay(bitmap_argb32 *bitmap) m_overlaybitmap = bitmap; if (m_overlaybitmap != nullptr) { + printf("Allocating overlay\n"); m_overlaytexture = m_manager.texture_alloc(render_container::overlay_scale); m_overlaytexture->set_bitmap(*bitmap, bitmap->cliprect(), TEXFORMAT_ARGB32); + printf("Done allocating overlay\n"); } } @@ -2964,6 +2971,7 @@ render_manager::render_manager(running_machine &machine) : m_machine(machine), m_ui_target(nullptr), m_live_textures(0), + m_texture_id(0), m_ui_container(global_alloc(render_container(*this))) { // register callbacks @@ -3128,6 +3136,8 @@ render_texture *render_manager::texture_alloc(texture_scaler_func scaler, void * // allocate a new texture and reset it render_texture *tex = m_texture_allocator.alloc(); tex->reset(*this, scaler, param); + tex->set_id(m_texture_id); + m_texture_id++; m_live_textures++; return tex; } diff --git a/src/emu/render.h b/src/emu/render.h index d65a1111851..6819fb6efed 100644 --- a/src/emu/render.h +++ b/src/emu/render.h @@ -215,7 +215,8 @@ struct render_texinfo u32 width; // width of the image u32 height; // height of the image u32 seqid; // sequence ID - u64 osddata; // aux data to pass to osd + u64 unique_id; // unique identifier to pass to osd + u64 old_id; // previously allocated id, if applicable const rgb_t * palette; // palette for PALETTE16 textures, bcg lookup table for RGB32/YUY16 }; @@ -441,8 +442,8 @@ public: // configure the texture bitmap void set_bitmap(bitmap_t &bitmap, const rectangle &sbounds, texture_format format); - // set any necessary aux data - void set_osd_data(u64 data) { m_osddata = data; } + // set a unique identifier + void set_id(u64 id) { m_old_id = m_id; m_id = id; } // generic high-quality bitmap scaler static void hq_scale(bitmap_argb32 &dest, bitmap_argb32 &source, const rectangle &sbounds, void *param); @@ -467,7 +468,8 @@ private: bitmap_t * m_bitmap; // pointer to the original bitmap rectangle m_sbounds; // source bounds within the bitmap texture_format m_format; // format of the texture data - u64 m_osddata; // aux data to pass to osd + u64 m_id; // unique id to pass to osd + u64 m_old_id; // previous id, if applicable // scaling state (ARGB32 only) texture_scaler_func m_scaler; // scaling callback @@ -1181,6 +1183,7 @@ private: // texture lists u32 m_live_textures; // number of live textures + u64 m_texture_id; // rolling texture ID counter fixed_allocator m_texture_allocator;// texture allocator // containers for the UI and for screens diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp index edfc92e62a9..2afbb31ce4c 100644 --- a/src/emu/screen.cpp +++ b/src/emu/screen.cpp @@ -764,9 +764,9 @@ void screen_device::device_start() // allocate raw textures m_texture[0] = machine().render().texture_alloc(); - m_texture[0]->set_osd_data(u64((m_unique_id << 1) | 0)); + m_texture[0]->set_id(u64(m_unique_id) << 57); m_texture[1] = machine().render().texture_alloc(); - m_texture[1]->set_osd_data(u64((m_unique_id << 1) | 1)); + m_texture[1]->set_id((u64(m_unique_id) << 57) | 1); // configure the default cliparea render_container::user_settings settings; diff --git a/src/osd/modules/render/bgfx/texturemanager.cpp b/src/osd/modules/render/bgfx/texturemanager.cpp index 61be4f8f247..a5fbca97f35 100644 --- a/src/osd/modules/render/bgfx/texturemanager.cpp +++ b/src/osd/modules/render/bgfx/texturemanager.cpp @@ -11,10 +11,9 @@ #include -#include "emu.h" - #include "texturemanager.h" #include "texture.h" +#include "bgfxutil.h" #include "rendutil.h" #include "modules/render/copyutil.h" @@ -28,6 +27,12 @@ texture_manager::~texture_manager() } } m_textures.clear(); + + for (std::pair mame_texture : m_mame_textures) + { + bgfx::destroy(mame_texture.second.handle); + } + m_mame_textures.clear(); } void texture_manager::add_provider(std::string name, bgfx_texture_handle_provider* provider) @@ -85,6 +90,75 @@ bgfx_texture* texture_manager::create_png_texture(std::string path, std::string return texture; } +bgfx::TextureHandle texture_manager::create_or_update_mame_texture(uint32_t format, int width, int height + , int rowpixels, const rgb_t *palette, void *base, uint32_t seqid, uint32_t flags, uint64_t key, uint64_t old_key) +{ + bgfx::TextureHandle handle = BGFX_INVALID_HANDLE; + if (old_key != ~0ULL) + { + std::map::iterator iter = m_mame_textures.find(old_key); + if (iter != m_mame_textures.end()) + { + handle = iter->second.handle; + if (handle.idx == bgfx::kInvalidHandle) + return handle; + + if (iter->second.width == width && iter->second.height == height) + { + // Size matches, so let's just swap the old handle into the new location + m_mame_textures[key] = { handle, seqid, width, height }; + m_mame_textures[old_key] = { BGFX_INVALID_HANDLE, 0, 0, 0 }; + + if (iter->second.seqid == seqid) + { + // Everything matches, just return the existing handle + return handle; + } + else + { + const bgfx::Memory* mem = bgfx_util::mame_texture_data_to_bgfx_texture_data(format, width, height, rowpixels, palette, base); + bgfx::updateTexture2D(handle, 0, 0, 0, 0, (uint16_t)width, (uint16_t)height, mem); + return handle; + } + } + bgfx::destroy(handle); + m_mame_textures[old_key] = { BGFX_INVALID_HANDLE, 0, 0, 0 }; + } + } + else + { + std::map::iterator iter = m_mame_textures.find(key); + if (iter != m_mame_textures.end()) + { + handle = iter->second.handle; + if (handle.idx == bgfx::kInvalidHandle) + return handle; + + if (iter->second.width == width && iter->second.height == height) + { + if (iter->second.seqid == seqid) + { + return handle; + } + else + { + const bgfx::Memory* mem = bgfx_util::mame_texture_data_to_bgfx_texture_data(format, width, height, rowpixels, palette, base); + bgfx::updateTexture2D(handle, 0, 0, 0, 0, (uint16_t)width, (uint16_t)height, mem); + return handle; + } + } + bgfx::destroy(handle); + } + } + + const bgfx::Memory* mem = bgfx_util::mame_texture_data_to_bgfx_texture_data(format, width, height, rowpixels, palette, base); + handle = bgfx::createTexture2D(width, height, false, 1, bgfx::TextureFormat::RGBA8, flags, nullptr); + bgfx::updateTexture2D(handle, 0, 0, 0, 0, (uint16_t)width, (uint16_t)height, mem); + + m_mame_textures[key] = { handle, seqid, width, height }; + return handle; +} + bgfx::TextureHandle texture_manager::handle(std::string name) { bgfx::TextureHandle handle = BGFX_INVALID_HANDLE; diff --git a/src/osd/modules/render/bgfx/texturemanager.h b/src/osd/modules/render/bgfx/texturemanager.h index 117fc36c502..da66dc2749c 100644 --- a/src/osd/modules/render/bgfx/texturemanager.h +++ b/src/osd/modules/render/bgfx/texturemanager.h @@ -11,8 +11,10 @@ #pragma once -#ifndef __DRAWBGFX_TEXTURE_MANAGER__ -#define __DRAWBGFX_TEXTURE_MANAGER__ +#ifndef DRAWBGFX_TEXTURE_MANAGER +#define DRAWBGFX_TEXTURE_MANAGER + +#include "emu.h" #include #include @@ -31,6 +33,8 @@ public: bgfx_texture* create_png_texture(std::string path, std::string file_name, std::string texture_name, uint32_t flags = BGFX_TEXTURE_U_CLAMP | BGFX_TEXTURE_V_CLAMP, uint32_t screen = -1); void add_provider(std::string name, bgfx_texture_handle_provider* texture); void remove_provider(std::string name, bool delete_provider = false); + bgfx::TextureHandle create_or_update_mame_texture(uint32_t format, int width, int height + , int rowpixels, const rgb_t *palette, void *base, uint32_t seqid, uint32_t flags, uint64_t key, uint64_t old_key); // Getters bgfx::TextureHandle handle(std::string name); @@ -39,7 +43,16 @@ public: private: bgfx_texture* create_texture(std::string name); + struct sequenced_handle + { + bgfx::TextureHandle handle; + uint32_t seqid; + int width; + int height; + }; + std::map m_textures; + std::map m_mame_textures; }; -#endif // __DRAWBGFX_TEXTURE_MANAGER__ +#endif // DRAWBGFX_TEXTURE_MANAGER diff --git a/src/osd/modules/render/bgfxutil.h b/src/osd/modules/render/bgfxutil.h index 88a679e5170..c733987ef18 100644 --- a/src/osd/modules/render/bgfxutil.h +++ b/src/osd/modules/render/bgfxutil.h @@ -1,9 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz -#pragma once +#ifndef RENDER_BGFX_UTIL +#define RENDER_BGFX_UTIL -#ifndef __RENDER_BGFX_UTIL__ -#define __RENDER_BGFX_UTIL__ +#pragma once #include @@ -15,4 +15,4 @@ public: static uint64_t get_blend_state(uint32_t blend); }; -#endif // __RENDER_BGFX_UTIL__ +#endif // RENDER_BGFX_UTIL diff --git a/src/osd/modules/render/drawbgfx.cpp b/src/osd/modules/render/drawbgfx.cpp index 476d04618f3..792c292e23e 100644 --- a/src/osd/modules/render/drawbgfx.cpp +++ b/src/osd/modules/render/drawbgfx.cpp @@ -559,10 +559,9 @@ void renderer_bgfx::render_textured_quad(render_primitive* prim, bgfx::Transient uint16_t tex_width(prim->texture.width); uint16_t tex_height(prim->texture.height); - const bgfx::Memory* mem = bgfx_util::mame_texture_data_to_bgfx_texture_data(prim->flags & PRIMFLAG_TEXFORMAT_MASK, - tex_width, tex_height, prim->texture.rowpixels, prim->texture.palette, prim->texture.base); - - bgfx::TextureHandle texture = bgfx::createTexture2D(tex_width, tex_height, false, 1, bgfx::TextureFormat::RGBA8, texture_flags, mem); + bgfx::TextureHandle texture = m_textures->create_or_update_mame_texture(prim->flags & PRIMFLAG_TEXFORMAT_MASK + , tex_width, tex_height, prim->texture.rowpixels, prim->texture.palette, prim->texture.base, prim->texture.seqid + , texture_flags, prim->texture.unique_id, prim->texture.old_id); bgfx_effect** effects = PRIMFLAG_GET_SCREENTEX(prim->flags) ? m_screen_effect : m_gui_effect; @@ -570,8 +569,6 @@ void renderer_bgfx::render_textured_quad(render_primitive* prim, bgfx::Transient bgfx::setVertexBuffer(0,buffer); bgfx::setTexture(0, effects[blend]->uniform("s_tex")->handle(), texture); effects[blend]->submit(m_ortho_view->get_index()); - - bgfx::destroy(texture); } #define MAX_TEMP_COORDS 100 diff --git a/src/osd/modules/render/drawbgfx.h b/src/osd/modules/render/drawbgfx.h index 2960085444b..87f9aab9d19 100644 --- a/src/osd/modules/render/drawbgfx.h +++ b/src/osd/modules/render/drawbgfx.h @@ -2,8 +2,8 @@ // copyright-holders:Ryan Holtz #pragma once -#ifndef __RENDER_BGFX__ -#define __RENDER_BGFX__ +#ifndef RENDER_BGFX +#define RENDER_BGFX #include @@ -162,4 +162,4 @@ private: static uint32_t s_current_view; }; -#endif +#endif // RENDER_BGFX \ No newline at end of file diff --git a/src/osd/modules/render/drawd3d.cpp b/src/osd/modules/render/drawd3d.cpp index 302dfaf49b1..5b359458f76 100644 --- a/src/osd/modules/render/drawd3d.cpp +++ b/src/osd/modules/render/drawd3d.cpp @@ -453,7 +453,8 @@ void d3d_texture_manager::create_resources() texture.height = m_default_bitmap.height(); texture.palette = nullptr; texture.seqid = 0; - texture.osddata = 0; + texture.unique_id = ~0ULL; + texture.old_id = ~0ULL; // now create it auto tex = std::make_unique(this, &texture, win->prescale(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXFORMAT(TEXFORMAT_ARGB32)); @@ -484,10 +485,10 @@ texture_info *d3d_texture_manager::find_texinfo(const render_texinfo *texinfo, u // find a match for (auto it = m_texture_list.begin(); it != m_texture_list.end(); it++) { - uint32_t test_screen = (uint32_t)(*it)->get_texinfo().osddata >> 1; - uint32_t test_page = (uint32_t)(*it)->get_texinfo().osddata & 1; - uint32_t prim_screen = (uint32_t)texinfo->osddata >> 1; - uint32_t prim_page = (uint32_t)texinfo->osddata & 1; + uint32_t test_screen = (uint32_t)((*it)->get_texinfo().unique_id >> 57); + uint32_t test_page = (uint32_t)((*it)->get_texinfo().unique_id >> 56) & 1; + uint32_t prim_screen = (uint32_t)(texinfo->unique_id >> 57); + uint32_t prim_page = (uint32_t)(texinfo->unique_id >> 56) & 1; if (test_screen != prim_screen || test_page != prim_page) continue; -- cgit v1.2.3 From c87777a0155f20c48e1f313814dbefac4bba0ef4 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 27 Aug 2018 01:30:08 +1000 Subject: fixup (nw) --- src/emu/render.cpp | 2 -- src/emu/render.h | 10 +++++----- src/mame/drivers/snk68.cpp | 6 +++--- src/osd/modules/render/drawbgfx.h | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/emu/render.cpp b/src/emu/render.cpp index 8c743e9a6a6..e3071d5f9f4 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -622,10 +622,8 @@ void render_container::set_overlay(bitmap_argb32 *bitmap) m_overlaybitmap = bitmap; if (m_overlaybitmap != nullptr) { - printf("Allocating overlay\n"); m_overlaytexture = m_manager.texture_alloc(render_container::overlay_scale); m_overlaytexture->set_bitmap(*bitmap, bitmap->cliprect(), TEXFORMAT_ARGB32); - printf("Done allocating overlay\n"); } } diff --git a/src/emu/render.h b/src/emu/render.h index 6819fb6efed..9660b8fc71f 100644 --- a/src/emu/render.h +++ b/src/emu/render.h @@ -215,8 +215,8 @@ struct render_texinfo u32 width; // width of the image u32 height; // height of the image u32 seqid; // sequence ID - u64 unique_id; // unique identifier to pass to osd - u64 old_id; // previously allocated id, if applicable + u64 unique_id; // unique identifier to pass to osd + u64 old_id; // previously allocated id, if applicable const rgb_t * palette; // palette for PALETTE16 textures, bcg lookup table for RGB32/YUY16 }; @@ -468,8 +468,8 @@ private: bitmap_t * m_bitmap; // pointer to the original bitmap rectangle m_sbounds; // source bounds within the bitmap texture_format m_format; // format of the texture data - u64 m_id; // unique id to pass to osd - u64 m_old_id; // previous id, if applicable + u64 m_id; // unique id to pass to osd + u64 m_old_id; // previous id, if applicable // scaling state (ARGB32 only) texture_scaler_func m_scaler; // scaling callback @@ -1183,7 +1183,7 @@ private: // texture lists u32 m_live_textures; // number of live textures - u64 m_texture_id; // rolling texture ID counter + u64 m_texture_id; // rolling texture ID counter fixed_allocator m_texture_allocator;// texture allocator // containers for the UI and for screens diff --git a/src/mame/drivers/snk68.cpp b/src/mame/drivers/snk68.cpp index a51b610923d..7847e62dd14 100644 --- a/src/mame/drivers/snk68.cpp +++ b/src/mame/drivers/snk68.cpp @@ -889,8 +889,8 @@ ROM_START( ikari3w ) /* Initial boot shows Ikari III The Rescue, then the title ROM_LOAD16_BYTE( "ik_2.c10", 0x000000, 0x20000, CRC(d0b690d3) SHA1(6c31b27e6b9f1438e8ddbefe41fa8ded22cdb51c) ) /* Rotary Joystick - hand written label */ ROM_LOAD16_BYTE( "ik_3.c9", 0x000001, 0x20000, CRC(11a9e664) SHA1(bf2d8a5f3f2aeff99a45d26279c88ebf04b7f79b) ) /* Rotary Joystick - hand written label */ - ROM_REGION( 0x20000, "soundcpu", 0 ) /* Sound CPU */ - ROM_LOAD( "ik3-6.18e", 0x000000, 0x20000, CRC(59d256a4) SHA1(1e7b33329f761c695bc9a817bbc0c5e13386d073) ) + ROM_REGION( 0x10000, "soundcpu", 0 ) /* Sound CPU */ + ROM_LOAD( "ik3-5.16d", 0x000000, 0x10000, CRC(ce6706fc) SHA1(95505b90a9524abf0c8c1ec6b2c40d8f25cb1d92) ) ROM_REGION( 0x010000, "gfx1", 0 ) /* characters */ ROM_LOAD( "ik3-7.16l", 0x000000, 0x08000, CRC(0b4804df) SHA1(66d16d245bfc404366164823faaea0bfec83e487) ) @@ -909,7 +909,7 @@ ROM_START( ikari3w ) /* Initial boot shows Ikari III The Rescue, then the title // 340000-3fffff empty ROM_REGION( 0x20000, "upd", 0 ) /* UPD7759 samples */ - ROM_LOAD( "ik_6.18e", 0x000000, 0x20000, CRC(df0d860f) SHA1(dff59a8eaadf83e79da6a15f4be4998721902f5b) ) /* hand written label */ + ROM_LOAD( "ik3-6.18e", 0x000000, 0x20000, CRC(59d256a4) SHA1(1e7b33329f761c695bc9a817bbc0c5e13386d073) ) ROM_REGION16_BE( 0x40000, "user1", 0 ) /* Extra code bank */ ROM_LOAD16_BYTE( "ik3-1.c8", 0x000000, 0x10000, CRC(47e4d256) SHA1(7c6921cf2f1b8c3dae867eb1fc14e3da218cc1e0) ) diff --git a/src/osd/modules/render/drawbgfx.h b/src/osd/modules/render/drawbgfx.h index 87f9aab9d19..fadbabf7c13 100644 --- a/src/osd/modules/render/drawbgfx.h +++ b/src/osd/modules/render/drawbgfx.h @@ -162,4 +162,4 @@ private: static uint32_t s_current_view; }; -#endif // RENDER_BGFX \ No newline at end of file +#endif // RENDER_BGFX -- cgit v1.2.3 From 0fb70e2a2c1711d46e223f46280163817af724c7 Mon Sep 17 00:00:00 2001 From: DavidHaywood <28625134+DavidHaywood@users.noreply.github.com> Date: Mon, 27 Aug 2018 01:53:28 +0100 Subject: actually properly disable opwolf protection simulation, fix coin counters (nw) --- src/mame/drivers/opwolf.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/mame/drivers/opwolf.cpp b/src/mame/drivers/opwolf.cpp index 1cfcd4607b0..aea737e107f 100644 --- a/src/mame/drivers/opwolf.cpp +++ b/src/mame/drivers/opwolf.cpp @@ -333,12 +333,10 @@ READ8_MEMBER(opwolf_state::z80_input2_r) WRITE8_MEMBER(opwolf_state::counters_w) { - //logerror("counters_w data=%2x\n",data ); - machine().bookkeeping().coin_lockout_w(1, data & 0x80); machine().bookkeeping().coin_lockout_w(0, data & 0x40); - machine().bookkeeping().coin_counter_w(1, data & 0x20); - machine().bookkeeping().coin_counter_w(0, data & 0x10); + machine().bookkeeping().coin_counter_w(1, ~data & 0x20); + machine().bookkeeping().coin_counter_w(0, ~data & 0x10); } /****************************************************** @@ -1157,7 +1155,7 @@ void opwolf_state::init_opwolf() m_opwolf_region = rom[0x03fffe / 2] & 0xff; - opwolf_cchip_init(); + //opwolf_cchip_init(); // start old simulation, including periodic timer // World & US version have different gun offsets, presumably slightly different gun hardware m_opwolf_gun_xoffs = 0xec - (rom[0x03ffb0 / 2] & 0xff); -- cgit v1.2.3 From 413e511e121f44e033968dddc6f9a5514030b5b1 Mon Sep 17 00:00:00 2001 From: Roberto Fresca Date: Mon, 27 Aug 2018 02:16:56 +0200 Subject: Update mastboyo.cpp Translated last two DIP switches... --- src/mame/drivers/mastboyo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/mastboyo.cpp b/src/mame/drivers/mastboyo.cpp index c8c71205d4e..fe365c77a3b 100644 --- a/src/mame/drivers/mastboyo.cpp +++ b/src/mame/drivers/mastboyo.cpp @@ -162,10 +162,10 @@ static INPUT_PORTS_START( mastboyo ) PORT_DIPSETTING( 0x10, "3" ) PORT_DIPSETTING( 0x20, "4" ) PORT_DIPSETTING( 0x30, "6" ) - PORT_DIPNAME( 0x40, 0x40, "Con Reclamo" ) + PORT_DIPNAME( 0x40, 0x40, "Attract Music" ) // From manual... 'Con Reclamo' PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "Test Inicial" ) + PORT_DIPNAME( 0x80, 0x80, "Test Mode" ) // From manual... 'Test Inicial' PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) // PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) <--- Why to mask and hide the test mode??? -- cgit v1.2.3 From 9f7bcbd886ba69bccd9180ded7cfbd112f02b23b Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 29 Aug 2018 05:29:50 +1000 Subject: final cleanup (nw) --- src/devices/machine/upd765.cpp | 43 ++++++++++++++++++------------------------ src/devices/sound/huc6230.cpp | 4 +--- src/mame/drivers/circus.cpp | 2 +- src/mame/video/dcheese.cpp | 2 -- 4 files changed, 20 insertions(+), 31 deletions(-) diff --git a/src/devices/machine/upd765.cpp b/src/devices/machine/upd765.cpp index 32cc58fe20f..6fd3d246e6d 100644 --- a/src/devices/machine/upd765.cpp +++ b/src/devices/machine/upd765.cpp @@ -587,8 +587,7 @@ void upd765_family_device::fifo_push(uint8_t data, bool internal) // MZ: A bit speculative. These lines help to avoid some FIFO mess-up // with the HX5102 that happens when WRITE DATA fails to find the sector // but the host already starts pushing the sector data. Should not hurt. - if (fifo_expected == 0) - { + if(fifo_expected == 0) { LOGFIFO("Fifo not expecting data, discarding\n"); return; } @@ -976,15 +975,13 @@ void upd765_family_device::live_run(attotime limit) break; case SCAN_SECTOR_DATA_BYTE: - if(!scan_done) // TODO: handle stp, x68000 sets it to 0xff (as it would dtl)? - { + if(!scan_done) { // TODO: handle stp, x68000 sets it to 0xff (as it would dtl)? int slot = (cur_live.bit_counter >> 4)-1; uint8_t data = fifo_pop(true); if(!slot) st2 = (st2 & ~(ST2_SN)) | ST2_SH; - if(data != cur_live.data_reg) - { + if(data != cur_live.data_reg) { st2 = (st2 & ~(ST2_SH)) | ST2_SN; if((data < cur_live.data_reg) && ((command[0] & 0x1f) == 0x19)) // low st2 &= ~ST2_SN; @@ -992,14 +989,11 @@ void upd765_family_device::live_run(attotime limit) if((data > cur_live.data_reg) && ((command[0] & 0x1f) == 0x1d)) // high st2 &= ~ST2_SN; } - if((slot == sector_size) && !(st2 & ST2_SN)) - { + if((slot == sector_size) && !(st2 & ST2_SN)) { scan_done = true; tc_done = true; } - } - else - { + } else { if(fifo_pos) fifo_pop(true); } @@ -2378,9 +2372,9 @@ std::string upd765_family_device::results() const { std::ostringstream stream; stream << "results=("; - if (!result_pos) stream << "none"; - else - { + if(!result_pos) + stream << "none"; + else { stream << std::hex << std::setfill('0') << std::setw(2) << unsigned(result[0]); for (int i=1; i < result_pos; i++) stream << ',' << std::setw(2) << unsigned(result[i]); @@ -2752,7 +2746,7 @@ void i82072_device::start_command(int cmd) upd765_family_device::start_command(cmd); // set motor off counter if command execution has completed - if (main_phase != PHASE_EXEC && motorcfg) + if(main_phase != PHASE_EXEC && motorcfg) motor_off_counter = (2 + ((motorcfg & MOFF) >> 4)) << (motorcfg & HSDA ? 1 : 0); } else delayed_command = cmd; @@ -2775,7 +2769,7 @@ void i82072_device::execute_command(int cmd) LOGCOMMAND("command motor %s drive %d\n", motor_on ? "on" : "off", fi.id); // if we are selecting a different drive, stop the motor on the previously selected drive - if (selected_drive != fi.id && flopi[selected_drive].dev && flopi[selected_drive].dev->mon_r() == 0) + if(selected_drive != fi.id && flopi[selected_drive].dev && flopi[selected_drive].dev->mon_r() == 0) flopi[selected_drive].dev->mon_w(1); // select the drive @@ -2992,14 +2986,13 @@ WRITE8_MEMBER(tc8566af_device::cr1_w) WRITE8_MEMBER(upd72065_device::auxcmd_w) { - switch(data) - { - case 0x36: // reset - soft_reset(); - break; - case 0x35: // set standby - break; - case 0x34: // reset standby - break; + switch(data) { + case 0x36: // reset + soft_reset(); + break; + case 0x35: // set standby + break; + case 0x34: // reset standby + break; } } diff --git a/src/devices/sound/huc6230.cpp b/src/devices/sound/huc6230.cpp index 23155c4dc7f..9b77d1f83c0 100644 --- a/src/devices/sound/huc6230.cpp +++ b/src/devices/sound/huc6230.cpp @@ -13,13 +13,11 @@ #include "emu.h" #include "huc6230.h" -static const int clamp(int val, int min, int max) { return std::min(max,std::max(min,val)); } +constexpr int clamp(int val, int min, int max) { return std::min(max, std::max(min, val)); } void huc6230_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { - /* Clear buffer */ - int frq = (1 << m_adpcm_freq); for (int i = 0; i < samples; i++) { diff --git a/src/mame/drivers/circus.cpp b/src/mame/drivers/circus.cpp index 6f0d7eb959d..56a703dc485 100644 --- a/src/mame/drivers/circus.cpp +++ b/src/mame/drivers/circus.cpp @@ -596,6 +596,6 @@ GAMEL( 1977, circus, 0, circus, circus, circus_state, init_circus, GAMEL( 1977, springbd, circus, circus, circus, circus_state, init_circus, ROT0, "bootleg (Sub-Electro)", "Springboard (bootleg of Circus)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND, layout_circus ) // looks like a text hack, but we've seen 2 identical copies so it's worth supporting GAME( 1977, robotbwl, 0, robotbwl, robotbwl, circus_state, init_robotbwl, ROT0, "Exidy", "Robot Bowl", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) GAMEL( 1979, crash, 0, crash, crash, circus_state, init_crash, ROT0, "Exidy", "Crash", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND, layout_crash ) -GAMEL( 1979, crasha, crash, crash, crash, circus_state, init_crash, ROT0, "Exidy", "Crash (Alt)", MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND, layout_crash ) +GAMEL( 1979, crasha, crash, crash, crash, circus_state, init_crash, ROT0, "Exidy", "Crash (alt)", MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND, layout_crash ) GAMEL( 1979, smash, crash, crash, crash, circus_state, init_crash, ROT0, "bootleg", "Smash (Crash bootleg)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND, layout_crash ) // looks like a text hack, but it also had a different bezel GAME( 1979, ripcord, 0, ripcord, ripcord, circus_state, init_ripcord, ROT0, "Exidy", "Rip Cord", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/video/dcheese.cpp b/src/mame/video/dcheese.cpp index 96ef8ba4c3b..4c57d67479a 100644 --- a/src/mame/video/dcheese.cpp +++ b/src/mame/video/dcheese.cpp @@ -29,8 +29,6 @@ PALETTE_INIT_MEMBER(dcheese_state, dcheese) { - /* really 65536 colors, but they don't use the later ones so we can stay */ - /* within MAME's limits */ for (int i = 0; i < 65536; i++) { int data = m_palrom[i]; -- cgit v1.2.3 From 4dc302ed05eb03242f514afa6a57876bf15baed9 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 29 Aug 2018 10:35:24 +1000 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 b77fc36b1c5..39f7310f1a5 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 6c9664138f0..8d5f60cc1a9 100644 --- a/makefile +++ b/makefile @@ -1584,14 +1584,14 @@ endif ifeq (posix,$(SHELLTYPE)) $(GENDIR)/version.cpp: $(GENDIR)/git_desc | $(GEN_FOLDERS) - @echo '#define BARE_BUILD_VERSION "0.200"' > $@ + @echo '#define BARE_BUILD_VERSION "0.201"' > $@ @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: $(GENDIR)/git_desc - @echo #define BARE_BUILD_VERSION "0.200" > $@ + @echo #define BARE_BUILD_VERSION "0.201" > $@ @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