diff options
author | Vas Crabb <vas@vastheman.com> | 2020-09-25 20:53:06 +1000 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2020-09-25 20:53:06 +1000 |
commit | 2323b68878f630bf0bdbaac8b9c51ac2026201cd (patch) | |
tree | 2e84bc0d00a22f4083e4ef3a54ec41bb6d025e31 | |
parent | 37b3c550da2554dee1b08599a7bf8e997b276de1 (diff) |
Fix MT07756 (ROM sets incorrectly being reported as missing) by partially reverting 44416bee2d3b14dabc32df064f93af5b6bb740c0.
Also some random minor cleanup.
-rw-r--r-- | src/devices/bus/a2bus/sider.cpp | 4 | ||||
-rw-r--r-- | src/devices/bus/bbc/joyport/joyport.h | 4 | ||||
-rw-r--r-- | src/devices/bus/bbc/userport/userport.h | 4 | ||||
-rw-r--r-- | src/frontend/mame/audit.cpp | 7 | ||||
-rw-r--r-- | src/mame/drivers/wswan.cpp | 46 |
5 files changed, 37 insertions, 28 deletions
diff --git a/src/devices/bus/a2bus/sider.cpp b/src/devices/bus/a2bus/sider.cpp index 93d8a50350f..d2722c8bb77 100644 --- a/src/devices/bus/a2bus/sider.cpp +++ b/src/devices/bus/a2bus/sider.cpp @@ -210,7 +210,7 @@ uint8_t a2bus_sider_device::read_c0nx(uint8_t offset) return rv; default: - printf("Read c0n%x (%s)\n", offset, machine().describe_context().c_str()); + logerror("Read c0n%x (%s)\n", offset, machine().describe_context().c_str()); break; } @@ -260,7 +260,7 @@ void a2bus_sider_device::write_c0nx(uint8_t offset, uint8_t data) break; default: - printf("Write %02x to c0n%x (%s)\n", data, offset, machine().describe_context().c_str()); + logerror("Write %02x to c0n%x (%s)\n", data, offset, machine().describe_context().c_str()); break; } } diff --git a/src/devices/bus/bbc/joyport/joyport.h b/src/devices/bus/bbc/joyport/joyport.h index f19e7da34bb..15d81243d84 100644 --- a/src/devices/bus/bbc/joyport/joyport.h +++ b/src/devices/bus/bbc/joyport/joyport.h @@ -90,8 +90,8 @@ class device_bbc_joyport_interface : public device_interface public: virtual uint8_t pb_r() { return 0xff; } virtual void pb_w(uint8_t data) { } - virtual void write_cb1(int state) { }; - virtual void write_cb2(int state) { }; + virtual void write_cb1(int state) { } + virtual void write_cb2(int state) { } protected: device_bbc_joyport_interface(const machine_config &mconfig, device_t &device); diff --git a/src/devices/bus/bbc/userport/userport.h b/src/devices/bus/bbc/userport/userport.h index dfaa8032ad8..29374eb9058 100644 --- a/src/devices/bus/bbc/userport/userport.h +++ b/src/devices/bus/bbc/userport/userport.h @@ -93,8 +93,8 @@ public: virtual uint8_t pb_r() { return 0xff; } virtual void pb_w(uint8_t data) { } - virtual void write_cb1(int state) { }; - virtual void write_cb2(int state) { }; + virtual void write_cb1(int state) { } + virtual void write_cb2(int state) { } protected: device_bbc_userport_interface(const machine_config &mconfig, device_t &device); diff --git a/src/frontend/mame/audit.cpp b/src/frontend/mame/audit.cpp index f8d2cbdd9d4..c5ee2e30e7d 100644 --- a/src/frontend/mame/audit.cpp +++ b/src/frontend/mame/audit.cpp @@ -72,11 +72,10 @@ media_auditor::summary media_auditor::audit_media(const char *validation) char const *const name(ROM_GETNAME(rom)); util::hash_collection const hashes(ROM_GETHASHDATA(rom)); - device_t *const shared_device(find_shared_device(device, name, hashes, rom_file_size(rom))); - const auto dumped(!hashes.flag(util::hash_collection::FLAG_NO_DUMP)); + device_t *const shared_device(find_shared_device(device, name, hashes, ROM_GETLENGTH(rom))); // count the number of files with hashes - if (dumped && !ROM_ISOPTIONAL(rom)) + if (!hashes.flag(util::hash_collection::FLAG_NO_DUMP) && !ROM_ISOPTIONAL(rom)) { required++; if (shared_device) @@ -92,7 +91,7 @@ media_auditor::summary media_auditor::audit_media(const char *validation) if (record) { // count the number of files that are found. - if (!device.owner() && ((record->status() == audit_status::GOOD && dumped) || (record->status() == audit_status::FOUND_INVALID && !find_shared_device(device, name, record->actual_hashes(), record->actual_length())))) + if ((record->status() == audit_status::GOOD) || ((record->status() == audit_status::FOUND_INVALID) && !find_shared_device(device, name, record->actual_hashes(), record->actual_length()))) { found++; if (shared_device) diff --git a/src/mame/drivers/wswan.cpp b/src/mame/drivers/wswan.cpp index 0fd49940a3c..633438334fa 100644 --- a/src/mame/drivers/wswan.cpp +++ b/src/mame/drivers/wswan.cpp @@ -2,7 +2,7 @@ // copyright-holders:Anthony Kruize,Wilbert Pol /*************************************************************************** - wswan.c + wswan.cpp Driver file to handle emulation of the Bandai WonderSwan By: @@ -17,15 +17,15 @@ configuration menu. Known issues/TODOs: - - Add support for noise sound - - Add support for voice sound - - Add support for enveloped sound + - Add support for noise sound. + - Add support for voice sound. + - Add support for enveloped sound. - Perform video DMA at proper timing. - Add (real/proper) RTC support. - Swan Crystal can handle up to 512Mbit ROMs?????? - - SRAM sizes should be in kbit instead of kbytes(?). This raises a few + - SRAM sizes should be in kbit instead of kbytes(?). This raises a few interesting issues: - - mirror of smaller <64KBYTE/512kbit sram sizes + - mirror of smaller <64KBYTE/512kbit SRAM sizes - banking when using 1M or 2M sram sizes - The units likely came with the name "WONDERSWAN" configured in the internal EEPOM @@ -47,6 +47,11 @@ #include "wswan.lh" +#include <algorithm> + + +namespace { + class wswan_state : public driver_device { public: @@ -92,9 +97,11 @@ protected: struct sound_dma_t { - u32 source; // Source address - u16 size; // Size - u8 enable; // Enabled + sound_dma_t() { } + + u32 source = 0; // Source address + u16 size = 0; // Size + u8 enable = 0; // Enabled }; required_device<cpu_device> m_maincpu; @@ -456,13 +463,13 @@ void wswan_state::machine_reset() m_rotate = 0; /* Intialize ports */ - memcpy(m_ws_portram, ws_portram_init, 256); + std::copy(std::begin(ws_portram_init), std::end(ws_portram_init), std::begin(m_ws_portram)); render_target *target = machine().render().first_target(); target->set_view(m_rotate); /* Initialize sound DMA */ - memset(&m_sound_dma, 0, sizeof(m_sound_dma)); + m_sound_dma = sound_dma_t(); } @@ -767,12 +774,12 @@ void wswan_state::port_w(offs_t offset, u8 data) } break; case 0xb5: // Read controls - // Bit 0-3 - Current state of input lines (read-only) - // Bit 4-6 - Select line of inputs to read - // 001 - Read Y cursors - // 010 - Read X cursors - // 100 - Read START,A,B buttons - // Bit 7 - Unknown + // Bit 0-3 - Current state of input lines (read-only) + // Bit 4-6 - Select line of inputs to read + // 001 - Read Y cursors + // 010 - Read X cursors + // 100 - Read START,A,B buttons + // Bit 7 - Unknown break; case 0xb6: // Interrupt acknowledge // Bit 0 - Serial transmit interrupt acknowledge @@ -878,7 +885,7 @@ ROM_END ROM_START(wscolor) ROM_REGION(0x2000, "maincpu", 0) - ROM_LOAD("boot.rom", 0x0000, 0x2000, CRC(cb06d9c3) SHA1(c5ad0b8af45d762662a69f50b64161b9c8919efb)) + ROM_LOAD("boot.rom", 0x0000, 0x2000, CRC(cb06d9c3) SHA1(c5ad0b8af45d762662a69f50b64161b9c8919efb)) ROM_REGION(0x800, "nvram", 0) // Need a dump from an original new unit @@ -886,6 +893,9 @@ ROM_START(wscolor) ROM_LOAD("internal_eeprom.wsc", 0x000, 0x800, BAD_DUMP CRC(9e29725c) SHA1(a903c2cb5f4bb94b67326ff87a2d91605dceffff)) ROM_END +} // anonymous namespace + + // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME CONS( 1999, wswan, 0, 0, wswan, wswan, wswan_state, empty_init, "Bandai", "WonderSwan", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) CONS( 2000, wscolor, wswan, 0, wscolor, wswan, wscolor_state, empty_init, "Bandai", "WonderSwan Color", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) |