From 81fcab1bb56536b3dab0991d2898220c19f0be56 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 4 Nov 2020 12:37:52 +1100 Subject: [PATCH] Fixed some MSVC failure to resolve overloaded operator errors. MSVC isn't trying the object finders' cast-to-pointer operators when looking for a suitable operator+. Since GitHub actions can only find 100 occurrences of a string and don't actually give you the full raw log when you ask for it, it's going to take several passes to catch all of these. --- src/mame/drivers/fm7.cpp | 4 ++-- src/mame/drivers/harddriv.cpp | 38 +++++++++++++++++------------------ src/mame/drivers/jaguar.cpp | 10 ++++----- src/mame/drivers/mystwarr.cpp | 4 ++-- src/mame/drivers/nemesis.cpp | 2 +- src/mame/drivers/segahang.cpp | 4 ++-- src/mame/drivers/tmnt.cpp | 4 ++-- src/mame/drivers/wecleman.cpp | 2 +- src/mame/machine/naomigd.cpp | 4 ++-- src/mame/machine/partner.cpp | 2 +- 10 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/mame/drivers/fm7.cpp b/src/mame/drivers/fm7.cpp index f0d6832b89a..70ceed336c9 100644 --- a/src/mame/drivers/fm7.cpp +++ b/src/mame/drivers/fm7.cpp @@ -1800,13 +1800,13 @@ void fm7_state::machine_reset() { m_init_rom_en = true; // last part of Initiate ROM is visible at the end of RAM too (interrupt vectors) - memcpy(&m_vectors[0], m_rom_ptr + 0x1ff0, 16); + memcpy(&m_vectors[0], &m_rom_ptr[0x1ff0], 16); } else if (m_type == SYS_FM11) { m_init_rom_en = true; // last part of Initiate ROM is visible at the end of RAM too (interrupt vectors) - memcpy(&m_vectors[0], m_rom_ptr + 0x0ff0, 16); + memcpy(&m_vectors[0], &m_rom_ptr[0x0ff0], 16); } else m_init_rom_en = false; diff --git a/src/mame/drivers/harddriv.cpp b/src/mame/drivers/harddriv.cpp index ae8b72d5597..76778e3da64 100644 --- a/src/mame/drivers/harddriv.cpp +++ b/src/mame/drivers/harddriv.cpp @@ -4993,14 +4993,14 @@ void harddriv_state::init_harddriv() m_gsp->space(AS_PROGRAM).install_write_handler(0xfffcfc00, 0xfffcfc0f, write16s_delegate(*this, FUNC(harddriv_state::hdgsp_speedup2_w))); m_gsp->space(AS_PROGRAM).install_read_handler(0xfff9fc00, 0xfff9fc0f, read16sm_delegate(*this, FUNC(harddriv_state::hdgsp_speedup_r))); m_gsp_speedup_pc = 0xffc00f10; - m_gsp_speedup_addr[0] = (uint16_t *)(m_gsp_vram + ((0xfff9fc00 - 0xff800000) >> 3)); // Addresses are in bits. Really. - m_gsp_speedup_addr[1] = (uint16_t *)(m_gsp_vram + ((0xfffcfc00 - 0xff800000) >> 3)); + m_gsp_speedup_addr[0] = (uint16_t *)&m_gsp_vram[(0xfff9fc00 - 0xff800000) >> 3]; // Addresses are in bits. Really. + m_gsp_speedup_addr[1] = (uint16_t *)&m_gsp_vram[(0xfffcfc00 - 0xff800000) >> 3]; /* set up msp speedup handler */ m_msp->space(AS_PROGRAM).install_write_handler(0x00751b00, 0x00751b0f, write16s_delegate(*this, FUNC(harddriv_state::hdmsp_speedup_w))); m_msp->space(AS_PROGRAM).install_read_handler(0x00751b00, 0x00751b0f, read16sm_delegate(*this, FUNC(harddriv_state::hdmsp_speedup_r))); m_msp_speedup_pc = 0x00723b00; - m_msp_speedup_addr = m_msp_ram + ((0x751b00 - 0x700000) >> 4); // Address in bits, plus uint16_t * + m_msp_speedup_addr = &m_msp_ram[(0x751b00 - 0x700000) >> 4]; // Address in bits, plus uint16_t * /* set up adsp speedup handlers */ m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16smo_delegate(*this, FUNC(harddriv_state::hdadsp_speedup_r))); @@ -5019,14 +5019,14 @@ void harddriv_state::init_harddrivc() m_gsp->space(AS_PROGRAM).install_write_handler(0xfffcfc00, 0xfffcfc0f, write16s_delegate(*this, FUNC(harddriv_state::hdgsp_speedup2_w))); m_gsp->space(AS_PROGRAM).install_read_handler(0xfff9fc00, 0xfff9fc0f, read16sm_delegate(*this, FUNC(harddriv_state::hdgsp_speedup_r))); m_gsp_speedup_pc = 0xfff40ff0; - m_gsp_speedup_addr[0] = (uint16_t *)(m_gsp_vram + ((0xfff9fc00 - 0xffc00000) >> 3)); // Addresses are in bits. Really. - m_gsp_speedup_addr[1] = (uint16_t *)(m_gsp_vram + ((0xfffcfc00 - 0xffc00000) >> 3)); + m_gsp_speedup_addr[0] = (uint16_t *)&m_gsp_vram[(0xfff9fc00 - 0xffc00000) >> 3]; // Addresses are in bits. Really. + m_gsp_speedup_addr[1] = (uint16_t *)&m_gsp_vram[(0xfffcfc00 - 0xffc00000) >> 3]; /* set up msp speedup handler */ m_msp->space(AS_PROGRAM).install_write_handler(0x00751b00, 0x00751b0f, write16s_delegate(*this, FUNC(harddriv_state::hdmsp_speedup_w))); m_msp->space(AS_PROGRAM).install_read_handler(0x00751b00, 0x00751b0f, read16sm_delegate(*this, FUNC(harddriv_state::hdmsp_speedup_r))); m_msp_speedup_pc = 0x00723b00; - m_msp_speedup_addr = m_msp_ram + ((0x751b00 - 0x700000) >> 4); // Address in bits, plus uint16_t * + m_msp_speedup_addr = &m_msp_ram[(0x751b00 - 0x700000) >> 4]; // Address in bits, plus uint16_t * /* set up adsp speedup handlers */ m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16smo_delegate(*this, FUNC(harddriv_state::hdadsp_speedup_r))); @@ -5044,8 +5044,8 @@ void harddriv_state::init_stunrun() m_gsp->space(AS_PROGRAM).install_write_handler(0xfffcfc00, 0xfffcfc0f, write16s_delegate(*this, FUNC(harddriv_state::hdgsp_speedup2_w))); m_gsp->space(AS_PROGRAM).install_read_handler(0xfff9fc00, 0xfff9fc0f, read16sm_delegate(*this, FUNC(harddriv_state::hdgsp_speedup_r))); m_gsp_speedup_pc = 0xfff41070; - m_gsp_speedup_addr[0] = (uint16_t *)(m_gsp_vram + ((0xfff9fc00 - 0xffc00000) >> 3)); // Addresses are in bits. Really. - m_gsp_speedup_addr[1] = (uint16_t *)(m_gsp_vram + ((0xfffcfc00 - 0xffc00000) >> 3)); + m_gsp_speedup_addr[0] = (uint16_t *)&m_gsp_vram[(0xfff9fc00 - 0xffc00000) >> 3]; // Addresses are in bits. Really. + m_gsp_speedup_addr[1] = (uint16_t *)&m_gsp_vram[(0xfffcfc00 - 0xffc00000) >> 3]; /* set up adsp speedup handlers */ m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16smo_delegate(*this, FUNC(harddriv_state::hdadsp_speedup_r))); @@ -5068,8 +5068,8 @@ void harddriv_state::init_racedriv() /* synchronization */ m_dsp32->space(AS_PROGRAM).install_write_handler(0x613c00, 0x613c03, write32s_delegate(*this, FUNC(harddriv_state::rddsp32_sync0_w))); m_dsp32->space(AS_PROGRAM).install_write_handler(0x613e00, 0x613e03, write32s_delegate(*this, FUNC(harddriv_state::rddsp32_sync1_w))); - m_rddsp32_sync[0] = m_dsp32_ram + ((0x613c00 - 0x600000) >> 2); - m_rddsp32_sync[1] = m_dsp32_ram + ((0x613e00 - 0x600000) >> 2); + m_rddsp32_sync[0] = &m_dsp32_ram[(0x613c00 - 0x600000) >> 2]; + m_rddsp32_sync[1] = &m_dsp32_ram[(0x613e00 - 0x600000) >> 2]; /* set up adsp speedup handlers */ m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16smo_delegate(*this, FUNC(harddriv_state::hdadsp_speedup_r))); @@ -5093,18 +5093,18 @@ void harddriv_state::racedrivc_init_common(offs_t gsp_protection) /* synchronization */ m_dsp32->space(AS_PROGRAM).install_write_handler(0x613c00, 0x613c03, write32s_delegate(*this, FUNC(harddriv_state::rddsp32_sync0_w))); m_dsp32->space(AS_PROGRAM).install_write_handler(0x613e00, 0x613e03, write32s_delegate(*this, FUNC(harddriv_state::rddsp32_sync1_w))); - m_rddsp32_sync[0] = m_dsp32_ram + ((0x613c00 - 0x600000) >> 2); - m_rddsp32_sync[1] = m_dsp32_ram + ((0x613e00 - 0x600000) >> 2); + m_rddsp32_sync[0] = &m_dsp32_ram[(0x613c00 - 0x600000) >> 2]; + m_rddsp32_sync[1] = &m_dsp32_ram[(0x613e00 - 0x600000) >> 2]; /* set up protection hacks */ m_gsp->space(AS_PROGRAM).install_write_handler(gsp_protection, gsp_protection + 0x0f, write16smo_delegate(*this, FUNC(harddriv_state::hdgsp_protection_w))); - m_gsp_protection = (uint16_t *)(m_gsp_vram + ((gsp_protection - 0xffc00000) >> 3)); + m_gsp_protection = (uint16_t *)&m_gsp_vram[(gsp_protection - 0xffc00000) >> 3]; /* set up gsp speedup handler */ m_gsp->space(AS_PROGRAM).install_write_handler(0xfff76f60, 0xfff76f6f, write16s_delegate(*this, FUNC(harddriv_state::rdgsp_speedup1_w))); m_gsp->space(AS_PROGRAM).install_read_handler(0xfff76f60, 0xfff76f6f, read16sm_delegate(*this, FUNC(harddriv_state::rdgsp_speedup1_r))); m_gsp_speedup_pc = 0xfff43a00; - m_gsp_speedup_addr[0] = (uint16_t *)(m_gsp_vram + ((0xfff76f60 - 0xffc00000) >> 3)); + m_gsp_speedup_addr[0] = (uint16_t *)&m_gsp_vram[(0xfff76f60 - 0xffc00000) >> 3]; /* set up adsp speedup handlers */ m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16smo_delegate(*this, FUNC(harddriv_state::hdadsp_speedup_r))); @@ -5127,13 +5127,13 @@ void harddriv_state::init_racedrivc_panorama_side() /* set up protection hacks */ m_gsp->space(AS_PROGRAM).install_write_handler(gsp_protection, gsp_protection + 0x0f, write16smo_delegate(*this, FUNC(harddriv_state::hdgsp_protection_w))); - m_gsp_protection = (uint16_t *)(m_gsp_vram + ((gsp_protection - 0xffc00000) >> 3)); + m_gsp_protection = (uint16_t *)&m_gsp_vram[(gsp_protection - 0xffc00000) >> 3]; /* set up gsp speedup handler (todo, work these out) */ // m_gsp->space(AS_PROGRAM).install_write_handler(0xfff76f60, 0xfff76f6f, write16s_delegate(*this, FUNC(harddriv_state::rdgsp_speedup1_w))); // m_gsp->space(AS_PROGRAM).install_read_handler(0xfff76f60, 0xfff76f6f, read16s_delegate(*this, FUNC(harddriv_state::rdgsp_speedup1_r))); // m_gsp_speedup_pc = 0xfff43a00; -// m_gsp_speedup_addr[0] = (uint16_t *)(m_gsp_vram + ((0xfff76f60 - 0xffc00000) >> 3)); +// m_gsp_speedup_addr[0] = (uint16_t *)&m_gsp_vram[(0xfff76f60 - 0xffc00000) >> 3)]; /* set up adsp speedup handlers */ m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16smo_delegate(*this, FUNC(harddriv_state::hdadsp_speedup_r))); @@ -5185,7 +5185,7 @@ void harddriv_state::steeltal_init_common(offs_t ds3_transfer_pc, int proto_sloo /* set up protection hacks */ m_gsp->space(AS_PROGRAM).install_write_handler(0xfff965d0, 0xfff965df, write16smo_delegate(*this, FUNC(harddriv_state::hdgsp_protection_w))); - m_gsp_protection = (uint16_t *)(m_gsp_vram + ((0xfff965d0 - 0xffc00000) >> 3)); + m_gsp_protection = (uint16_t *)&m_gsp_vram[(0xfff965d0 - 0xffc00000) >> 3]; /* set up adsp speedup handlers */ m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16smo_delegate(*this, FUNC(harddriv_state::hdadsp_speedup_r))); @@ -5230,8 +5230,8 @@ void harddriv_state::init_strtdriv() /* synchronization */ m_dsp32->space(AS_PROGRAM).install_write_handler(0x613c00, 0x613c03, write32s_delegate(*this, FUNC(harddriv_state::rddsp32_sync0_w))); m_dsp32->space(AS_PROGRAM).install_write_handler(0x613e00, 0x613e03, write32s_delegate(*this, FUNC(harddriv_state::rddsp32_sync1_w))); - m_rddsp32_sync[0] = m_dsp32_ram + ((0x613c00 - 0x600000) >> 2); - m_rddsp32_sync[1] = m_dsp32_ram + ((0x613e00 - 0x600000) >> 2); + m_rddsp32_sync[0] = &m_dsp32_ram[(0x613c00 - 0x600000) >> 2]; + m_rddsp32_sync[1] = &m_dsp32_ram[(0x613e00 - 0x600000) >> 2]; /* set up protection hacks */ m_gsp->space(AS_PROGRAM).install_write_handler(0xfff960a0, 0xfff960af, write16smo_delegate(*this, FUNC(harddriv_state::hdgsp_protection_w))); diff --git a/src/mame/drivers/jaguar.cpp b/src/mame/drivers/jaguar.cpp index 17062b14e08..51e98e9d6ad 100644 --- a/src/mame/drivers/jaguar.cpp +++ b/src/mame/drivers/jaguar.cpp @@ -2494,7 +2494,7 @@ void jaguar_state::init_area51a() #if ENABLE_SPEEDUP_HACKS /* install speedup for main CPU */ m_maincpu->space(AS_PROGRAM).install_write_handler(0xa02030, 0xa02033, write32s_delegate(*this, FUNC(jaguar_state::area51_main_speedup_w))); - m_main_speedup = m_mainram + 0x2030/4; + m_main_speedup = &m_mainram[0x2030/4]; #endif } @@ -2507,7 +2507,7 @@ void jaguar_state::init_area51() /* install speedup for main CPU */ m_main_speedup_max_cycles = 120; m_maincpu->space(AS_PROGRAM).install_read_handler(0x100062e8, 0x100062eb, read32smo_delegate(*this, FUNC(jaguar_state::cojagr3k_main_speedup_r))); - m_main_speedup = m_mainram + 0x62e8/4; + m_main_speedup = &m_mainram[0x62e8/4]; #endif } @@ -2539,7 +2539,7 @@ void jaguar_state::init_area51mx() #if ENABLE_SPEEDUP_HACKS /* install speedup for main CPU */ m_maincpu->space(AS_PROGRAM).install_write_handler(0xa19550, 0xa19557, write32s_delegate(*this, FUNC(jaguar_state::area51mx_main_speedup_w))); - m_main_speedup = m_mainram + 0x19550/4; + m_main_speedup = &m_mainram[0x19550/4]; #endif } @@ -2556,7 +2556,7 @@ void jaguar_state::init_a51mxr3k() /* install speedup for main CPU */ m_main_speedup_max_cycles = 120; m_maincpu->space(AS_PROGRAM).install_read_handler(0x10006f0c, 0x10006f0f, read32smo_delegate(*this, FUNC(jaguar_state::cojagr3k_main_speedup_r))); - m_main_speedup = m_mainram + 0x6f0c/4; + m_main_speedup = &m_mainram[0x6f0c/4]; #endif } @@ -2570,7 +2570,7 @@ void jaguar_state::init_fishfren() /* install speedup for main CPU */ m_main_speedup_max_cycles = 200; m_maincpu->space(AS_PROGRAM).install_read_handler(0x10021b60, 0x10021b63, read32smo_delegate(*this, FUNC(jaguar_state::cojagr3k_main_speedup_r))); - m_main_speedup = m_mainram + 0x21b60/4; + m_main_speedup = &m_mainram[0x21b60/4]; #endif } diff --git a/src/mame/drivers/mystwarr.cpp b/src/mame/drivers/mystwarr.cpp index b738bc5a9a3..960b521dc50 100644 --- a/src/mame/drivers/mystwarr.cpp +++ b/src/mame/drivers/mystwarr.cpp @@ -280,7 +280,7 @@ void mystwarr_state::k053247_scattered_word_w(offs_t offset, uint16_t data, uint if (offset & 0x0078) { // osd_printf_debug("spr write %x to %x (PC=%x)\n", data, offset, m_maincpu->pc()); - COMBINE_DATA(m_spriteram+offset); + COMBINE_DATA(&m_spriteram[offset]); } else { @@ -398,7 +398,7 @@ void mystwarr_state::k053247_martchmp_word_w(offs_t offset, uint16_t data, uint1 { if (offset & 0x0018) { - COMBINE_DATA(m_spriteram+offset); + COMBINE_DATA(&m_spriteram[offset]); } else { diff --git a/src/mame/drivers/nemesis.cpp b/src/mame/drivers/nemesis.cpp index 562f18b9872..60e9cd0ea09 100644 --- a/src/mame/drivers/nemesis.cpp +++ b/src/mame/drivers/nemesis.cpp @@ -273,7 +273,7 @@ void nemesis_state::bubsys_mcu_w(offs_t offset, uint16_t data, uint16_t mem_mask logerror("\tCopy page %02x to shared ram\n", page); const uint8_t *src = memregion("bubblememory")->base(); - memcpy(m_bubsys_shared_ram + 0xf00/2, src + page * 0x90, 0x80); + memcpy(&m_bubsys_shared_ram[0xf00/2], src + page * 0x90, 0x80); // The last 2 bytes of the block are loaded into the control register m_bubsys_control_ram[0] = src[page * 0x90 + 0x80] | (src[page * 0x90 + 0x81]<<8); diff --git a/src/mame/drivers/segahang.cpp b/src/mame/drivers/segahang.cpp index 155be049a30..cee6ad4c941 100644 --- a/src/mame/drivers/segahang.cpp +++ b/src/mame/drivers/segahang.cpp @@ -2241,8 +2241,8 @@ void segahang_state::init_endurobl() init_enduror(); // assemble decrypted half of ROM and register it uint16_t *rom = reinterpret_cast(memregion("maincpu")->base()); - memcpy(m_decrypted_opcodes + 0x00000/2, rom + 0x30000/2, 0x10000); - memcpy(m_decrypted_opcodes + 0x10000/2, rom + 0x10000/2, 0x20000); + memcpy(&m_decrypted_opcodes[0x00000/2], rom + 0x30000/2, 0x10000); + memcpy(&m_decrypted_opcodes[0x10000/2], rom + 0x10000/2, 0x20000); } void segahang_state::init_endurob2() diff --git a/src/mame/drivers/tmnt.cpp b/src/mame/drivers/tmnt.cpp index 622a034b549..fe47a15f414 100644 --- a/src/mame/drivers/tmnt.cpp +++ b/src/mame/drivers/tmnt.cpp @@ -127,7 +127,7 @@ uint16_t tmnt_state::k053245_scattered_word_r(offs_t offset) void tmnt_state::k053245_scattered_word_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - COMBINE_DATA(m_spriteram + offset); + COMBINE_DATA(&m_spriteram[offset]); if (!(offset & 0x0031)) { @@ -714,7 +714,7 @@ void tmnt_state::tmnt2_1c0800_w(offs_t offset, uint16_t data, uint16_t mem_mask) uint16_t src[4], mod[24]; uint8_t keepaspect, xlock, ylock, zlock; - COMBINE_DATA(m_tmnt2_1c0800 + offset); + COMBINE_DATA(&m_tmnt2_1c0800[offset]); if (offset != 0x18/2 || !ACCESSING_BITS_8_15) return; diff --git a/src/mame/drivers/wecleman.cpp b/src/mame/drivers/wecleman.cpp index 69d55f85e64..65118646066 100644 --- a/src/mame/drivers/wecleman.cpp +++ b/src/mame/drivers/wecleman.cpp @@ -317,7 +317,7 @@ uint16_t wecleman_state::wecleman_protection_r() void wecleman_state::wecleman_protection_w(offs_t offset, uint16_t data, uint16_t mem_mask) { if (offset == 2) m_prot_state = data & 0x2000; - if (!m_prot_state) COMBINE_DATA(m_protection_ram + offset); + if (!m_prot_state) COMBINE_DATA(&m_protection_ram[offset]); } diff --git a/src/mame/machine/naomigd.cpp b/src/mame/machine/naomigd.cpp index f907a263b15..935a3a7a0d2 100644 --- a/src/mame/machine/naomigd.cpp +++ b/src/mame/machine/naomigd.cpp @@ -924,8 +924,8 @@ void naomi_gdrom_board::device_start() } else { // use extracted pic data // printf("This PIC key hasn't been converted to a proper PIC binary yet!\n"); - memcpy(name, picdata+33, 7); - memcpy(name+7, picdata+25, 7); + memcpy(name, &picdata[33], 7); + memcpy(name+7, &picdata[25], 7); key = ((uint64_t(picdata[0x31]) << 56) | (uint64_t(picdata[0x32]) << 48) | diff --git a/src/mame/machine/partner.cpp b/src/mame/machine/partner.cpp index 1d7873a91d8..eeb99867c70 100644 --- a/src/mame/machine/partner.cpp +++ b/src/mame/machine/partner.cpp @@ -344,7 +344,7 @@ void partner_state::mem_page_w(u8 data) I8275_DRAW_CHARACTER_MEMBER(partner_state::display_pixels) { rgb_t const *const palette = m_palette->palette()->entry_list_raw(); - u8 const *const charmap = m_chargen + 0x400 * (gpa * 2 + hlgt); + u8 const *const charmap = &m_chargen[0x400 * (gpa * 2 + hlgt)]; u8 pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff; if (vsp) pixels = 0;