Previous Thread
Next Thread
Print Thread
Joined: Jul 2022
Posts: 3
R
Member
OP Offline
Member
R
Joined: Jul 2022
Posts: 3
All, I have been fighting to compile MAME with MS Visual C (Visual Studio, MSVS) for some time. I am down to just one error which is related to a "dynamic_cast". Error is:

332>C:\Users\stuar\Documents\mame-ai\src\emu\devfind.h(644,1): error C2680: 'DeviceClass *': invalid target type for dynamic_cast
332>C:\Users\stuar\Documents\mame-ai\src\emu\devfind.h(644,1): error C2680: with
332>C:\Users\stuar\Documents\mame-ai\src\emu\devfind.h(644,1): error C2680: [
332>C:\Users\stuar\Documents\mame-ai\src\emu\devfind.h(644,1): error C2680: DeviceClass=mc68hc16z1_device
332>C:\Users\stuar\Documents\mame-ai\src\emu\devfind.h(644,1): error C2680: ]
332>C:\Users\stuar\Documents\mame-ai\src\emu\devfind.h(644,1): error C2680: this->m_target = dynamic_cast<DeviceClass *>(device);
332>C:\Users\stuar\Documents\mame-ai\src\emu\devfind.h(644,1): error C2680: ^
332>C:\Users\stuar\Documents\mame-ai\src\emu\devfind.h(644,1): message : 'mc68hc16z1_device': class must be defined before using in a dynamic_cast
332>C:\Users\stuar\Documents\mame-ai\src\emu\devfind.h(644,1): message : this->m_target = dynamic_cast<DeviceClass *>(device);
332>C:\Users\stuar\Documents\mame-ai\src\emu\devfind.h(644,1): message : ^
332>C:\Users\stuar\Documents\mame-ai\src\emu\devfind.h(636): message : while compiling class template member function 'bool device_finder<mc68hc16z1_device,true>::findit(validity_checker *)'
This is in the findit() function.

I have tried MSVS 2022 and 2019, forced the compiler to C17 and C20, all on Windows 11.

I have followed the guidelines in "Compiling MAME / Issues Affecting Visual Studio". No luck.

I am compiling code from July 19, 2022 (Commit hash 2ff1f130c34a6ff29468d9f9d633ba13659180e3).

I have some ideas and would like to eventually contribute to the mainline sources, but obviously I'm not contributing anything until I can compile! Any help would be greatly appreciated!

Thanks

Joined: Nov 2016
Posts: 64
Likes: 18
P
Member
Offline
Member
P
Joined: Nov 2016
Posts: 64
Likes: 18
This issue was fixed here early August. Rebase and it should work.

Joined: Apr 2005
Posts: 600
Likes: 2
Senior Member
Offline
Senior Member
Joined: Apr 2005
Posts: 600
Likes: 2
did you do a clean build with REGENIE=1 ?

Joined: Jul 2022
Posts: 3
R
Member
OP Offline
Member
R
Joined: Jul 2022
Posts: 3
Thanks for the help. I had started working on this back in July, ran into trouble, and put it on hold until recently, which explains why my code was out-of-date. I still have some compilation problems, but with some brute-force hacking, I got it to build. Here are the changes.

You can see that in ldv42000hle.cpp, I needed to make some casts to disambiguate the parameter to signbit(). Not sure why MSVC did not like this, but the MinGW compiler didn't care.

In the other files, there were some more complex compiler errors. I just commented out the code (!) and hope I don't run into it.

Thanks for the help!

Code
diff --git a/src/devices/bus/mtu130/datamover.cpp b/src/devices/bus/mtu130/datamover.cpp
index 3b5d8f33ee0..aeaedcc5f46 100644
--- a/src/devices/bus/mtu130/datamover.cpp
+++ b/src/devices/bus/mtu130/datamover.cpp
@@ -3,6 +3,7 @@

 // Datamover - 68K-based extension board

+#include "emu.h"
 #include "datamover.h"

 DEFINE_DEVICE_TYPE(MTU130_DATAMOVER0, mtu130_datamover0_device, "datamover0", "Datamover")
diff --git a/src/devices/machine/ldv4200hle.cpp b/src/devices/machine/ldv4200hle.cpp
index db8f86a2a03..cebdd5739c2 100644
--- a/src/devices/machine/ldv4200hle.cpp
+++ b/src/devices/machine/ldv4200hle.cpp
@@ -801,7 +801,7 @@ TIMER_CALLBACK_MEMBER(pioneer_ldv4200hle_device::process_vbi_data)
                                int32_t old_delta = (int32_t)m_mark_frame - (int32_t)old_frame;
                                int32_t curr_delta = (int32_t)m_mark_frame - (int32_t)m_curr_frame;
                                LOGMASKED(LOG_STOPS, "%s: Stop Mark is currently %d, old frame is %d, current frame is %d, old delta %d, curr delta %d\n", machine().describe_context(), m_mark_frame, old_frame, m_curr_frame, old_delta, curr_delta);
-                               if (curr_delta == 0 || std::signbit(old_delta) != std::signbit(curr_delta))
+                               if (curr_delta == 0 || std::signbit((double)old_delta) != std::signbit((double)curr_delta))
                                {
                                        m_mark_frame = ~uint32_t(0);
                                        if (is_cav_disc())
@@ -919,7 +919,7 @@ int32_t pioneer_ldv4200hle_device::player_update(const vbi_metadata &vbi, int fi
                        int32_t jump_frame = (int32_t)m_curr_frame + elapsed_tracks;
                        int32_t curr_delta = (int32_t)m_mark_frame - (int32_t)m_curr_frame;
                        int32_t next_delta = (int32_t)m_mark_frame - (int32_t)jump_frame;
-                       if (std::signbit(curr_delta) != std::signbit(next_delta))
+                       if (std::signbit((double)curr_delta) != std::signbit((double)next_delta))
                        {
                                elapsed_tracks = curr_delta;
                        }
diff --git a/src/mame/nintendo/vsnes.cpp b/src/mame/nintendo/vsnes.cpp
index 7044c909e7c..90dc1fc3000 100644
--- a/src/mame/nintendo/vsnes.cpp
+++ b/src/mame/nintendo/vsnes.cpp
@@ -949,9 +949,12 @@ void vs_dual_state::vsdual_vrom_banking(u8 data)
        // switch vrom
        m_chr_banks[Side]->set_entry(BIT(data, 2));

+#if 0
+       // SFR Removed
        // bit 1 ( data & 2 ) triggers irq on the other cpu
        auto cpu = (Side == SUB) ? m_maincpu : m_subcpu;
        cpu->set_input_line(0, (data & 2) ? CLEAR_LINE : ASSERT_LINE);
+#endif

        // move along
        vsnes_in0_w<Side>(data);
diff --git a/src/mame/sony/news_r4k.cpp b/src/mame/sony/news_r4k.cpp
index a83e7c3f468..caece8d1b6a 100644
--- a/src/mame/sony/news_r4k.cpp
+++ b/src/mame/sony/news_r4k.cpp
@@ -442,11 +442,14 @@ void news_r4k_state::machine_common(machine_config &config)
                                escc1_int_status = status ? 0x8 : 0x0; // guess
                        });

+#if 0
+       // SFR Removed
        CXD8452AQ(config, m_sonic3, 0);
        m_sonic3->set_addrmap(0, &news_r4k_state::sonic3_map);
        m_sonic3->irq_out().set(FUNC(news_r4k_state::irq_w<irq0_number::SONIC>));
        m_sonic3->set_bus(m_cpu, 0);
        m_sonic3->set_apbus_address_translator(FUNC(news_r4k_state::apbus_virt_to_phys));
+#endif

        // TODO: actual clock frequency - there is a 20MHz crystal nearby on the board, but traces need to be confirmed
        DP83932C(config, m_sonic, 20'000'000);
@@ -476,10 +479,13 @@ void news_r4k_state::machine_common(machine_config &config)
                        [this] ()
                        { return uint32_t(m_fdc->dma_r()); });

+#if 0
+       // SFR Removed
        DMAC3(config, m_dmac, 0);
        m_dmac->set_apbus_address_translator(FUNC(news_r4k_state::apbus_virt_to_phys));
        m_dmac->set_bus(m_cpu, 0);
        m_dmac->irq_out().set(FUNC(news_r4k_state::irq_w<DMAC>));
+#endif

        NSCSI_BUS(config, m_scsibus0);
        NSCSI_BUS(config, m_scsibus1);

Joined: May 2009
Posts: 2,052
Likes: 85
J
Very Senior Member
Offline
Very Senior Member
J
Joined: May 2009
Posts: 2,052
Likes: 85
You're using the wrong version of MSVC. Using the latest version of MSVC 2022, these are the only work-arounds you need to apply: https://docs.mamedev.org/initialsetup/compilingmame.html#issues-affecting-microsoft-visual-studio

Joined: Jun 2001
Posts: 479
Likes: 3
O
Senior Member
Offline
Senior Member
O
Joined: Jun 2001
Posts: 479
Likes: 3
Added the missing emu.h include though, that's a pure mistake.

Joined: Jul 2022
Posts: 3
R
Member
OP Offline
Member
R
Joined: Jul 2022
Posts: 3
I pulled down the newest code and tried to compile with MSVC 2022. There does not seem to be a VS2022 make target:

Quote
[MINGW64] C:\Users\stuar\Documents\mame-ai>make vs2022 PYTHON_EXECUTABLE=c:/Users/stuar/Documents/msys64/mingw64/bin/python.exe MODERN_WIN_API=1 NOWERROR=1 NO_USE_PORTAUDIO=1
GCC 12.1.0 detected
fatal: No names found, cannot describe anything.
make: *** No rule to make target 'vs2022'. Stop.

But, if I use the MSVS 2019 make target (make vs2019), but actually open the project with MSVS 2022, the projects were automatically update by MSVC. I still get the many of the same errors.

Is there a "real" vs2022 target?

Do I need to explicitly set the C++ language version (i.e. C++17? C++20?)?

Am I doing something wrong here?

I'll probably just comment out the problematic code and move on, but if anyone is interested, the errors are below.

Thank you!

Quote
<SNIP>
2>C:\Users\stuar\Documents\mame-ai\src\mame\sinclair\atm.cpp(355,52): error C2666: '+': 2 overloads have similar conversions
2>C:\Users\stuar\Documents\mame-ai\src\mame\sinclair\atm.cpp(355,52): error C2666: u8 chunk = *(m_char_rom + (*symb_location << 3) + (y & 0x07));
2>C:\Users\stuar\Documents\mame-ai\src\mame\sinclair\atm.cpp(355,52): error C2666: ^
2>C:\Users\stuar\Documents\mame-ai\src\emu\attotime.h(183,27): message : could be 'attotime operator +(const attotime &,const attotime &) noexcept'
2>C:\Users\stuar\Documents\mame-ai\src\emu\attotime.h(183,27): message : inline constexpr attotime operator+(const attotime &left, const attotime &right) noexcept
2>C:\Users\stuar\Documents\mame-ai\src\emu\attotime.h(183,27): message : ^
2>C:\Users\stuar\Documents\mame-ai\src\mame\sinclair\atm.cpp(355,52): message : or 'built-in C++ operator+(bool, int)'
2>C:\Users\stuar\Documents\mame-ai\src\mame\sinclair\atm.cpp(355,52): message : u8 chunk = *(m_char_rom + (*symb_location << 3) + (y & 0x07));
2>C:\Users\stuar\Documents\mame-ai\src\mame\sinclair\atm.cpp(355,52): message : ^
2>C:\Users\stuar\Documents\mame-ai\src\mame\sinclair\atm.cpp(355,52): message : or 'built-in C++ operator+(ObjectClass, __int64)'
2>C:\Users\stuar\Documents\mame-ai\src\mame\sinclair\atm.cpp(355,52): message : with
2>C:\Users\stuar\Documents\mame-ai\src\mame\sinclair\atm.cpp(355,52): message : [
2>C:\Users\stuar\Documents\mame-ai\src\mame\sinclair\atm.cpp(355,52): message : ObjectClass=osd::u8
2>C:\Users\stuar\Documents\mame-ai\src\mame\sinclair\atm.cpp(355,52): message : ]
2>C:\Users\stuar\Documents\mame-ai\src\mame\sinclair\atm.cpp(355,52): message : u8 chunk = *(m_char_rom + (*symb_location << 3) + (y & 0x07));
2>C:\Users\stuar\Documents\mame-ai\src\mame\sinclair\atm.cpp(355,52): message : ^
2>C:\Users\stuar\Documents\mame-ai\src\mame\sinclair\atm.cpp(355,52): message : while trying to match the argument list '(region_ptr_finder<osd::u8,false>, int)'
2>C:\Users\stuar\Documents\mame-ai\src\mame\sinclair\atm.cpp(355,52): message : u8 chunk = *(m_char_rom + (*symb_location << 3) + (y & 0x07));
2>C:\Users\stuar\Documents\mame-ai\src\mame\sinclair\atm.cpp(355,52): message :
<SNIP>
5>C:\Users\stuar\Documents\mame-ai\src\devices\machine\ldv4200hle.cpp(804,8): error C2668: 'signbit': ambiguous call to overloaded function
5>C:\Users\stuar\Documents\mame-ai\src\devices\machine\ldv4200hle.cpp(804,8): error C2668: if (curr_delta == 0 || std::signbit(old_delta) != std::signbit(curr_delta))
5>C:\Users\stuar\Documents\mame-ai\src\devices\machine\ldv4200hle.cpp(804,8): error C2668: ^
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(309,32): message : could be 'bool signbit(float) noexcept'
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(309,32): message : _Check_return_ inline bool signbit(_In_ float _X) throw()
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(309,32): message : ^
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(314,32): message : or 'bool signbit(double) noexcept'
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(314,32): message : _Check_return_ inline bool signbit(_In_ double _X) throw()
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(314,32): message : ^
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(319,32): message : or 'bool signbit(long double) noexcept'
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(319,32): message : _Check_return_ inline bool signbit(_In_ long double _X) throw()
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(319,32): message : ^
5>C:\Users\stuar\Documents\mame-ai\src\devices\machine\ldv4200hle.cpp(804,8): message : while trying to match the argument list '(int32_t)'
5>C:\Users\stuar\Documents\mame-ai\src\devices\machine\ldv4200hle.cpp(804,8): message : if (curr_delta == 0 || std::signbit(old_delta) != std::signbit(curr_delta))
5>C:\Users\stuar\Documents\mame-ai\src\devices\machine\ldv4200hle.cpp(804,8): message : ^
5>C:\Users\stuar\Documents\mame-ai\src\devices\machine\ldv4200hle.cpp(922,7): error C2668: 'signbit': ambiguous call to overloaded function
5>C:\Users\stuar\Documents\mame-ai\src\devices\machine\ldv4200hle.cpp(922,7): error C2668: if (std::signbit(curr_delta) != std::signbit(next_delta))
5>C:\Users\stuar\Documents\mame-ai\src\devices\machine\ldv4200hle.cpp(922,7): error C2668: ^
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(309,32): message : could be 'bool signbit(float) noexcept'
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(309,32): message : _Check_return_ inline bool signbit(_In_ float _X) throw()
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(309,32): message : ^
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(314,32): message : or 'bool signbit(double) noexcept'
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(314,32): message : _Check_return_ inline bool signbit(_In_ double _X) throw()
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(314,32): message : ^
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(319,32): message : or 'bool signbit(long double) noexcept'
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(319,32): message : _Check_return_ inline bool signbit(_In_ long double _X) throw()
5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(319,32): message : ^
5>C:\Users\stuar\Documents\mame-ai\src\devices\machine\ldv4200hle.cpp(922,7): message : while trying to match the argument list '(int32_t)'
5>C:\Users\stuar\Documents\mame-ai\src\devices\machine\ldv4200hle.cpp(922,7): message : if (std::signbit(curr_delta) != std::signbit(next_delta))
5>C:\Users\stuar\Documents\mame-ai\src\devices\machine\ldv4200hle.cpp(922,7): message : ^
<SNIP>
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,73): error C2672: 'devcb_write<int,1>::binder::set': no matching overloaded function found
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,73): error C2672: m_sonic3->irq_out().set(FUNC(news_r4k_state::irq_w<irq0_number::SONIC>));
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,73): error C2672: ^
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2104,87): message : could be 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(const device_finder<U,R> &,T &&,const char *)'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2104,87): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(device_finder<U, R> const &finder, T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2104,87): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(const device_finder<U,R> &,T &&,const char *)': expects 3 arguments - 2 provided
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : m_sonic3->irq_out().set(FUNC(news_r4k_state::irq_w<irq0_number::SONIC>));
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2104): message : see declaration of 'devcb_write<int,1>::binder::set'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2104): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(device_finder<U, R> const &finder, T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2096,87): message : or 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(device_finder<U,R> &,T &&,const char *)'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2096,87): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(device_finder<U, R> &finder, T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2096,87): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(device_finder<U,R> &,T &&,const char *)': expects 3 arguments - 2 provided
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : m_sonic3->irq_out().set(FUNC(news_r4k_state::irq_w<irq0_number::SONIC>));
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2096): message : see declaration of 'devcb_write<int,1>::binder::set'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2096): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(device_finder<U, R> &finder, T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2089,87): message : or 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(U &,T &&,const char *)'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2089,87): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(U &obj, T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2089,87): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(U &,T &&,const char *)': expects 3 arguments - 2 provided
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : m_sonic3->irq_out().set(FUNC(news_r4k_state::irq_w<irq0_number::SONIC>));
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2089): message : see declaration of 'devcb_write<int,1>::binder::set'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2089): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(U &obj, T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2082,87): message : or 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(const char *,T &&,const char *)'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2082,87): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(char const *tag, T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2082,87): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(const char *,T &&,const char *)': expects 3 arguments - 2 provided
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : m_sonic3->irq_out().set(FUNC(news_r4k_state::irq_w<irq0_number::SONIC>));
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2082): message : see declaration of 'devcb_write<int,1>::binder::set'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2082): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(char const *tag, T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2075,87): message : or 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(T &&,const char *)'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2075,87): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2075,87): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447): message : 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(T &&,const char *)': could not deduce template argument for 'T'
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447): message : m_sonic3->irq_out().set(FUNC(news_r4k_state::irq_w<irq0_number::SONIC>));
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2075): message : see declaration of 'devcb_write<int,1>::binder::set'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2075): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2068,95): message : or 'enable_if<std::integral_constant<bool,std::is_invocable<T,offs_t,Input,unsigned int>::value||std::is_invocable<T,offs_t,Input>::value||std::is_invocable<T,Input>::value>::value,devcb_write<Input,1>::functoid_builder<remove_reference<_Uty>::type>>::type devcb_write<Input,1>::binder::set(T &&)'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2068,95): message : with
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2068,95): message : [
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2068,95): message : Input=int
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2068,95): message : ]
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2068,95): message : std::enable_if_t<is_write<Input, T>::value, functoid_builder<std::remove_reference_t<T> > > set(T &&cb)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2068,95): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : 'enable_if<std::integral_constant<bool,std::is_invocable<T,offs_t,Input,unsigned int>::value||std::is_invocable<T,offs_t,Input>::value||std::is_invocable<T,Input>::value>::value,devcb_write<Input,1>::functoid_builder<remove_reference<_Uty>::type>>::type devcb_write<Input,1>::binder::set(T &&)': expects 1 arguments - 2 provided
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : with
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : [
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : Input=int
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : ]
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : m_sonic3->irq_out().set(FUNC(news_r4k_state::irq_w<irq0_number::SONIC>));
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(447,21): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2068): message : see declaration of 'devcb_write<int,1>::binder::set'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2068): message : std::enable_if_t<is_write<Input, T>::value, functoid_builder<std::remove_reference_t<T> > > set(T &&cb)
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,57): error C2672: 'devcb_write<int,1>::binder::set': no matching overloaded function found
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,57): error C2672: m_dmac->irq_out().set(FUNC(news_r4k_state::irq_w<DMAC>));
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,57): error C2672: ^
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2104,87): message : could be 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(const device_finder<U,R> &,T &&,const char *)'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2104,87): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(device_finder<U, R> const &finder, T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2104,87): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(const device_finder<U,R> &,T &&,const char *)': expects 3 arguments - 2 provided
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : m_dmac->irq_out().set(FUNC(news_r4k_state::irq_w<DMAC>));
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2104): message : see declaration of 'devcb_write<int,1>::binder::set'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2104): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(device_finder<U, R> const &finder, T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2096,87): message : or 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(device_finder<U,R> &,T &&,const char *)'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2096,87): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(device_finder<U, R> &finder, T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2096,87): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(device_finder<U,R> &,T &&,const char *)': expects 3 arguments - 2 provided
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : m_dmac->irq_out().set(FUNC(news_r4k_state::irq_w<DMAC>));
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2096): message : see declaration of 'devcb_write<int,1>::binder::set'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2096): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(device_finder<U, R> &finder, T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2089,87): message : or 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(U &,T &&,const char *)'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2089,87): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(U &obj, T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2089,87): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(U &,T &&,const char *)': expects 3 arguments - 2 provided
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : m_dmac->irq_out().set(FUNC(news_r4k_state::irq_w<DMAC>));
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2089): message : see declaration of 'devcb_write<int,1>::binder::set'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2089): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(U &obj, T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2082,87): message : or 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(const char *,T &&,const char *)'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2082,87): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(char const *tag, T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2082,87): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(const char *,T &&,const char *)': expects 3 arguments - 2 provided
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : m_dmac->irq_out().set(FUNC(news_r4k_state::irq_w<DMAC>));
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2082): message : see declaration of 'devcb_write<int,1>::binder::set'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2082): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(char const *tag, T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2075,87): message : or 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(T &&,const char *)'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2075,87): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2075,87): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482): message : 'enable_if<devcb_write_base::is_write_method<T,void>::value,devcb_write<int,1>::delegate_builder<rw_delegate_type<T,void>::type>>::type devcb_write<int,1>::binder::set(T &&,const char *)': could not deduce template argument for 'T'
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482): message : m_dmac->irq_out().set(FUNC(news_r4k_state::irq_w<DMAC>));
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2075): message : see declaration of 'devcb_write<int,1>::binder::set'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2075): message : std::enable_if_t<is_write_method<T>::value, delegate_builder<delegate_type_t<T> > > set(T &&func, char const *name)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2068,95): message : or 'enable_if<std::integral_constant<bool,std::is_invocable<T,offs_t,Input,unsigned int>::value||std::is_invocable<T,offs_t,Input>::value||std::is_invocable<T,Input>::value>::value,devcb_write<Input,1>::functoid_builder<remove_reference<_Uty>::type>>::type devcb_write<Input,1>::binder::set(T &&)'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2068,95): message : with
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2068,95): message : [
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2068,95): message : Input=int
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2068,95): message : ]
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2068,95): message : std::enable_if_t<is_write<Input, T>::value, functoid_builder<std::remove_reference_t<T> > > set(T &&cb)
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2068,95): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : 'enable_if<std::integral_constant<bool,std::is_invocable<T,offs_t,Input,unsigned int>::value||std::is_invocable<T,offs_t,Input>::value||std::is_invocable<T,Input>::value>::value,devcb_write<Input,1>::functoid_builder<remove_reference<_Uty>::type>>::type devcb_write<Input,1>::binder::set(T &&)': expects 1 arguments - 2 provided
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : with
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : [
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : Input=int
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : ]
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : m_dmac->irq_out().set(FUNC(news_r4k_state::irq_w<DMAC>));
1>C:\Users\stuar\Documents\mame-ai\src\mame\sony\news_r4k.cpp(482,19): message : ^
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2068): message : see declaration of 'devcb_write<int,1>::binder::set'
1>C:\Users\stuar\Documents\mame-ai\src\emu\devcb.h(2068): message : std::enable_if_t<is_write<Input, T>::value, functoid_builder<std::remove_reference_t<T> > > set(T &&cb)
<SNIP>
3>C:\Users\stuar\Documents\mame-ai\src\mame\nintendo\vsnes.cpp(953,1): error C2446: ':': no conversion from 'device_finder<cpu_device,false>' to 'device_finder<cpu_device,true>'
3>C:\Users\stuar\Documents\mame-ai\src\mame\nintendo\vsnes.cpp(953,1): error C2446: auto cpu = (Side == SUB) ? m_maincpu : m_subcpu;
3>C:\Users\stuar\Documents\mame-ai\src\mame\nintendo\vsnes.cpp(953,1): error C2446: ^
3>C:\Users\stuar\Documents\mame-ai\src\mame\nintendo\vsnes.cpp(953,41): message : No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
3>C:\Users\stuar\Documents\mame-ai\src\mame\nintendo\vsnes.cpp(953,41): message : auto cpu = (Side == SUB) ? m_maincpu : m_subcpu;
3>C:\Users\stuar\Documents\mame-ai\src\mame\nintendo\vsnes.cpp(953,41): message : ^
3>C:\Users\stuar\Documents\mame-ai\src\mame\nintendo\vsnes.cpp(963): message : see reference to function template instantiation 'void `anonymous-namespace'::vs_dual_state::vsdual_vrom_banking<`anonymous-namespace'::vs_base_state::MAIN>(osd::u8)' being compiled
3>C:\Users\stuar\Documents\mame-ai\src\mame\nintendo\vsnes.cpp(963): message : m_maincpu->space(AS_PROGRAM).install_write_handler(0x4016, 0x4016, write8smo_delegate(*this, FUNC(vs_dual_state::vsdual_vrom_banking<MAIN>)));
3>C:\Users\stuar\Documents\mame-ai\src\mame\nintendo\vsnes.cpp(954,1): error C3536: 'cpu': cannot be used before it is initialized
3>C:\Users\stuar\Documents\mame-ai\src\mame\nintendo\vsnes.cpp(954,1): error C3536: cpu->set_input_line(0, (data & 2) ? CLEAR_LINE : ASSERT_LINE);
3>C:\Users\stuar\Documents\mame-ai\src\mame\nintendo\vsnes.cpp(954,1): error C3536: ^
<SNIP>

Joined: Jun 2001
Posts: 479
Likes: 3
O
Senior Member
Offline
Senior Member
O
Joined: Jun 2001
Posts: 479
Likes: 3
There are some in there that point to things that could be better code-wise (e.g. using signbit on a integer is inefficient) but also show that what vs2022 calls c++ is not what normal people call c++ (std::signbit on an integer is explicitely supposed to work). So some we'll probably change, but others, like the devcb ones, are probably here to stay.

Joined: Apr 2006
Posts: 757
Likes: 1
D
Senior Member
Offline
Senior Member
D
Joined: Apr 2006
Posts: 757
Likes: 1
Use this instead. https://www.mamedev.org/tools/ I use this and no issue at all.

No more headache to anyone.


Windows 10 Home 64-bit / AMD Radeon RX 5700 XT / AMD Ryzen 7 3700X 8-Core 3.59 GHz / RAM 16 GB

Link Copied to Clipboard
Who's Online Now
4 members (mixmaster, Golden Child, Justin, 1 invisible), 37 guests, and 1 robot.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,110
Posts119,395
Members5,024
Most Online890
Jan 17th, 2020
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com