From e3d45954ad80f6335677a50f313502d9c28c4e94 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 14 Jun 2023 15:43:29 +0200 Subject: xbox_nv2a: better fix for dangling pointer warning, coleco: remove romhacked bios rom --- src/lib/netlist/plib/prandom.h | 4 ++-- src/mame/coleco/coleco.cpp | 6 +----- src/mame/misc/esripsys.cpp | 22 +++++++++++----------- src/mame/shared/xbox_nv2a.cpp | 22 +++------------------- src/mame/upl/ninjakd2.h | 16 ++++++++-------- src/mame/upl/xxmissio.cpp | 10 +++++----- src/osd/modules/diagnostics/diagnostics_win32.cpp | 14 +++++++------- 7 files changed, 37 insertions(+), 57 deletions(-) diff --git a/src/lib/netlist/plib/prandom.h b/src/lib/netlist/plib/prandom.h index c087e6acbda..3772343826a 100644 --- a/src/lib/netlist/plib/prandom.h +++ b/src/lib/netlist/plib/prandom.h @@ -190,8 +190,8 @@ namespace plib FT v2; do { - v1 = normalize_uniform(p, constants::two(), constants::one()); // [-1..1[ - v2 = normalize_uniform(p, constants::two(), constants::one()); // [-1..1[ + v1 = normalize_uniform(p, constants::two(), constants::one()); // [-1..1] + v2 = normalize_uniform(p, constants::two(), constants::one()); // [-1..1] s = v1 * v1 + v2 * v2; } while (s >= constants::one()); if (s == constants::zero()) diff --git a/src/mame/coleco/coleco.cpp b/src/mame/coleco/coleco.cpp index fae256d3dc6..feacf10b146 100644 --- a/src/mame/coleco/coleco.cpp +++ b/src/mame/coleco/coleco.cpp @@ -663,11 +663,7 @@ void coleco_state::dina(machine_config &config) ROM_START (coleco) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_SYSTEM_BIOS( 0, "original", "Original" ) - ROMX_LOAD( "313 10031-4005 73108a.u2", 0x0000, 0x2000, CRC(3aa93ef3) SHA1(45bedc4cbdeac66c7df59e9e599195c778d86a92), ROM_BIOS(0) ) - ROM_SYSTEM_BIOS( 1, "thick", "Thick characters" ) - // differences to 0x3aa93ef3 modified characters, added a pad 2 related fix - ROMX_LOAD( "colecoa.rom", 0x0000, 0x2000, CRC(39bb16fc) SHA1(99ba9be24ada3e86e5c17aeecb7a2d68c5edfe59), ROM_BIOS(1) ) + ROM_LOAD( "313_10031-4005_73108a.u2", 0x0000, 0x2000, CRC(3aa93ef3) SHA1(45bedc4cbdeac66c7df59e9e599195c778d86a92) ) ROM_END /* ONYX (Prototype) diff --git a/src/mame/misc/esripsys.cpp b/src/mame/misc/esripsys.cpp index ca1f6a84d3d..9a3db07061f 100644 --- a/src/mame/misc/esripsys.cpp +++ b/src/mame/misc/esripsys.cpp @@ -418,19 +418,19 @@ INPUT_CHANGED_MEMBER(esripsys_state::coin_interrupt) static INPUT_PORTS_START( turbosub ) PORT_START("KEYPAD_A") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("Keypad 0") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Keypad 1") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Keypad 2") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Keypad 3") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Keypad 4") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Keypad 5") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("Keypad 0") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Keypad 1") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Keypad 2") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Keypad 3") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Keypad 4") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Keypad 5") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) PORT_START("KEYPAD_B") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Keypad 6") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("Keypad 7") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("Keypad 8") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("Keypad 9") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME("Keypad *") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Keypad 6") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("Keypad 7") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("Keypad 8") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("Keypad 9") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME("Keypad *") PORT_CHANGED_MEMBER(DEVICE_SELF, esripsys_state,keypad_interrupt, 0) PORT_START("COINS") PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED ) diff --git a/src/mame/shared/xbox_nv2a.cpp b/src/mame/shared/xbox_nv2a.cpp index d555bbce996..e13a32d06c4 100644 --- a/src/mame/shared/xbox_nv2a.cpp +++ b/src/mame/shared/xbox_nv2a.cpp @@ -660,6 +660,8 @@ void vertex_program_simulator::process(int address, vertex_nv *in, vertex_nv *ou output++; count--; } + input = nullptr; + output = nullptr; } int vertex_program_simulator::status() @@ -2512,25 +2514,7 @@ void nv2a_renderer::compute_supersample_factors(float &horizontal, float &vertic void nv2a_renderer::convert_vertices(vertex_nv *source, nv2avertex_t *destination) { -/* - FIXME: GCC 13.1 errored this without the static on "vert". I believe this is a real bug, but I don't - know enough about what this code is doing to be confident. - - In member function ‘void vertex_program_simulator::set_data(vertex_nv*, vertex_nv*)’, - inlined from ‘void vertex_program_simulator::process(int, vertex_nv*, vertex_nv*, int)’ at ../../../../../src/mame/shared/xbox_nv2a.cpp:643:10, - inlined from ‘void nv2a_renderer::convert_vertices(vertex_nv*, nv2avertex_t*)’ at ../../../../../src/mame/shared/xbox_nv2a.cpp:2546:29: -../../../../../src/mame/shared/xbox_nv2a.cpp:449:16: error: storing the address of local variable ‘vert’ in ‘*&this_144(D)->vertexprogram.exec.vertex_program_simulator::output’ [-Werror=dangling-pointer=] - 449 | output = out; - | ~~~~~~~^~~~~ -../../../../../src/mame/shared/xbox_nv2a.cpp: In member function ‘void nv2a_renderer::convert_vertices(vertex_nv*, nv2avertex_t*)’: -../../../../../src/mame/shared/xbox_nv2a.cpp:2504:19: note: ‘vert’ declared here - 2522 | vertex_nv vert; - | ^~~~ -../../../../../src/mame/shared/xbox_nv2a.cpp:2502:82: note: ‘this’ declared here - 2502 | void nv2a_renderer::convert_vertices(vertex_nv *source, nv2avertex_t *destination) - | ^ -*/ - static vertex_nv vert; + vertex_nv vert; int u; float v[4]; double c; diff --git a/src/mame/upl/ninjakd2.h b/src/mame/upl/ninjakd2.h index 1efeb9bb307..bebc26d5c97 100644 --- a/src/mame/upl/ninjakd2.h +++ b/src/mame/upl/ninjakd2.h @@ -56,10 +56,10 @@ protected: required_device m_screen; required_device m_soundcpu; - uint8_t m_vram_bank_mask; - int m_robokid_sprites; + uint8_t m_vram_bank_mask = 0; + int m_robokid_sprites = 0; bool (*m_stencil_compare_function) (uint16_t pal); - int m_sprites_updated; + int m_sprites_updated = 0; tilemap_t* m_fg_tilemap; tilemap_t* m_bg_tilemap; bitmap_ind16 m_sprites_bitmap; @@ -96,8 +96,8 @@ private: required_memory_bank m_mainbank; std::unique_ptr m_sampledata; - int m_next_sprite_overdraw_enabled; - uint8_t m_rom_bank_mask; + int m_next_sprite_overdraw_enabled = 0; + uint8_t m_rom_bank_mask = 0; void draw_sprites( bitmap_ind16 &bitmap); void erase_sprites( bitmap_ind16 &bitmap); @@ -145,7 +145,7 @@ protected: template void robokid_bg_videoram_w(offs_t offset, uint8_t data); template void robokid_bg_ctrl_w(offs_t offset, uint8_t data); template void robokid_bg_bank_w(uint8_t data); - tilemap_t* m_robokid_tilemap[3]{}; + tilemap_t* m_robokid_tilemap[3]; void video_init_banked(uint32_t vram_alloc_size); TILEMAP_MAPPER_MEMBER(robokid_bg_scan); @@ -160,7 +160,7 @@ private: uint32_t screen_update_robokid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void motion_error_kludge(uint16_t offset); - uint8_t m_robokid_bg_bank[3]; + uint8_t m_robokid_bg_bank[3] = { }; std::unique_ptr m_robokid_bg_videoram[3]; }; @@ -196,7 +196,7 @@ private: void io_protection_start(); void io_protection_reset(); - uint8_t m_io_protection[3]; + uint8_t m_io_protection[3] = { }; uint8_t m_io_protection_input = 0; int m_io_protection_tick = 0; }; diff --git a/src/mame/upl/xxmissio.cpp b/src/mame/upl/xxmissio.cpp index dfe6842eb9f..714c1b5e6b0 100644 --- a/src/mame/upl/xxmissio.cpp +++ b/src/mame/upl/xxmissio.cpp @@ -2,7 +2,7 @@ // copyright-holders:Uki /***************************************************************************** -XX Mission (c) 1986 UPL + XX Mission (c) 1986 UPL Driver by Uki @@ -59,10 +59,10 @@ private: tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - uint8_t m_status; - uint8_t m_xscroll; - uint8_t m_yscroll; - uint8_t m_flipscreen; + uint8_t m_status = 0; + uint8_t m_xscroll = 0; + uint8_t m_yscroll = 0; + uint8_t m_flipscreen = 0; void bank_sel_w(uint8_t data); void status_m_w(uint8_t data); diff --git a/src/osd/modules/diagnostics/diagnostics_win32.cpp b/src/osd/modules/diagnostics/diagnostics_win32.cpp index 5b82b63f2c3..519000903ea 100644 --- a/src/osd/modules/diagnostics/diagnostics_win32.cpp +++ b/src/osd/modules/diagnostics/diagnostics_win32.cpp @@ -169,8 +169,8 @@ bool stack_walker::s_initialized = false; // stack_walker - constructor //------------------------------------------------- -stack_walker::stack_walker() - : m_process(GetCurrentProcess()), +stack_walker::stack_walker() : + m_process(GetCurrentProcess()), m_thread(GetCurrentThread()), m_first(true) { @@ -289,8 +289,8 @@ bool stack_walker::unwind() // symbol_manager - constructor //------------------------------------------------- -symbol_manager::symbol_manager(const char *argv0) - : m_mapfile(argv0), +symbol_manager::symbol_manager(const char *argv0) : + m_mapfile(argv0), m_symfile(argv0), m_process(GetCurrentProcess()), m_last_base(0), @@ -300,7 +300,7 @@ symbol_manager::symbol_manager(const char *argv0) // compute the name of the mapfile int extoffs = m_mapfile.find_last_of('.'); if (extoffs != -1) - m_mapfile.substr(0, extoffs); + m_mapfile = m_mapfile.substr(0, extoffs); m_mapfile.append(".map"); // and the name of the symfile @@ -653,8 +653,8 @@ uintptr_t symbol_manager::get_text_section_base(ULONG &size) // sampling_profiler - constructor //------------------------------------------------- -sampling_profiler::sampling_profiler(uint32_t max_seconds, uint8_t stack_depth = 0) - : m_target_thread(nullptr), +sampling_profiler::sampling_profiler(uint32_t max_seconds, uint8_t stack_depth = 0) : + m_target_thread(nullptr), m_thread(nullptr), m_thread_id(0), m_thread_exit(false), -- cgit v1.2.3