summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-06-24 09:05:55 -0400
committer AJR <ajrhacker@users.noreply.github.com>2018-06-24 09:05:55 -0400
commit297b99c0faa2e70ed3fb5cc4c9ed60e40cd9af5a (patch)
tree1a7320439bad68743edc71db3543d76063e466ad
parentd2fbefd97733188b4ceb2e3de963971b9e658813 (diff)
Move ROM loading macros to romentry.h and remove romload.h from emu.h (nw)
-rw-r--r--src/devices/imagedev/chd_cd.cpp1
-rw-r--r--src/devices/imagedev/diablo.cpp1
-rw-r--r--src/devices/imagedev/harddriv.cpp1
-rw-r--r--src/devices/machine/akiko.cpp1
-rw-r--r--src/devices/machine/laserdsc.cpp1
-rw-r--r--src/emu/addrmap.cpp1
-rw-r--r--src/emu/devfind.cpp1
-rw-r--r--src/emu/device.cpp1
-rw-r--r--src/emu/diimage.cpp1
-rw-r--r--src/emu/emu.h2
-rw-r--r--src/emu/machine.cpp1
-rw-r--r--src/emu/romentry.h69
-rw-r--r--src/emu/romload.cpp2
-rw-r--r--src/emu/romload.h70
-rw-r--r--src/emu/softlist_dev.cpp1
-rw-r--r--src/emu/validity.cpp1
-rw-r--r--src/frontend/mame/audit.cpp1
-rw-r--r--src/frontend/mame/clifront.cpp1
-rw-r--r--src/frontend/mame/info.cpp1
-rw-r--r--src/frontend/mame/media_ident.h1
-rw-r--r--src/frontend/mame/ui/devopt.cpp1
-rw-r--r--src/frontend/mame/ui/info.cpp1
-rw-r--r--src/frontend/mame/ui/miscmenu.cpp1
-rw-r--r--src/frontend/mame/ui/selgame.cpp1
-rw-r--r--src/frontend/mame/ui/selmenu.cpp1
-rw-r--r--src/frontend/mame/ui/utils.cpp1
-rw-r--r--src/mame/drivers/konamim2.cpp1
-rw-r--r--src/mame/drivers/ksys573.cpp1
-rw-r--r--src/mame/drivers/ldplayer.cpp1
-rw-r--r--src/mame/drivers/system16.cpp2
-rw-r--r--src/mame/machine/cdicdic.cpp1
-rw-r--r--src/mame/machine/naomigd.cpp1
-rw-r--r--src/mame/machine/xbox.cpp1
33 files changed, 101 insertions, 72 deletions
diff --git a/src/devices/imagedev/chd_cd.cpp b/src/devices/imagedev/chd_cd.cpp
index 49592a33f63..5daaba2ed45 100644
--- a/src/devices/imagedev/chd_cd.cpp
+++ b/src/devices/imagedev/chd_cd.cpp
@@ -12,6 +12,7 @@
#include "chd_cd.h"
#include "cdrom.h"
+#include "romload.h"
// device type definition
DEFINE_DEVICE_TYPE(CDROM, cdrom_image_device, "cdrom_image", "CD-ROM Image")
diff --git a/src/devices/imagedev/diablo.cpp b/src/devices/imagedev/diablo.cpp
index 1291e83c01b..82da0a417ab 100644
--- a/src/devices/imagedev/diablo.cpp
+++ b/src/devices/imagedev/diablo.cpp
@@ -9,6 +9,7 @@
#include "emuopts.h"
#include "harddisk.h"
+#include "romload.h"
OPTION_GUIDE_START(dsk_option_guide)
diff --git a/src/devices/imagedev/harddriv.cpp b/src/devices/imagedev/harddriv.cpp
index 490e0fe1bed..a3d567de33f 100644
--- a/src/devices/imagedev/harddriv.cpp
+++ b/src/devices/imagedev/harddriv.cpp
@@ -18,6 +18,7 @@
#include "emuopts.h"
#include "harddisk.h"
+#include "romload.h"
OPTION_GUIDE_START(hd_option_guide)
diff --git a/src/devices/machine/akiko.cpp b/src/devices/machine/akiko.cpp
index 19a6a3c9395..0394750fe30 100644
--- a/src/devices/machine/akiko.cpp
+++ b/src/devices/machine/akiko.cpp
@@ -17,6 +17,7 @@
#include "akiko.h"
#include "imagedev/chd_cd.h"
#include "coreutil.h"
+#include "romload.h"
//**************************************************************************
diff --git a/src/devices/machine/laserdsc.cpp b/src/devices/machine/laserdsc.cpp
index 301eb39b2d3..f797289bf52 100644
--- a/src/devices/machine/laserdsc.cpp
+++ b/src/devices/machine/laserdsc.cpp
@@ -14,6 +14,7 @@
#include "vbiparse.h"
#include "config.h"
#include "render.h"
+#include "romload.h"
#include "chd.h"
diff --git a/src/emu/addrmap.cpp b/src/emu/addrmap.cpp
index b015620f0eb..544bb51011c 100644
--- a/src/emu/addrmap.cpp
+++ b/src/emu/addrmap.cpp
@@ -9,6 +9,7 @@
***************************************************************************/
#include "emu.h"
+#include "romload.h"
#include "validity.h"
diff --git a/src/emu/devfind.cpp b/src/emu/devfind.cpp
index bb23e003f4d..d3cfaf8c0a1 100644
--- a/src/emu/devfind.cpp
+++ b/src/emu/devfind.cpp
@@ -9,6 +9,7 @@
***************************************************************************/
#include "emu.h"
+#include "romload.h"
//**************************************************************************
diff --git a/src/emu/device.cpp b/src/emu/device.cpp
index b7035a28fc7..6bd458b0e0b 100644
--- a/src/emu/device.cpp
+++ b/src/emu/device.cpp
@@ -9,6 +9,7 @@
***************************************************************************/
#include "emu.h"
+#include "romload.h"
#include "speaker.h"
#include "debug/debugcpu.h"
diff --git a/src/emu/diimage.cpp b/src/emu/diimage.cpp
index 1a30cb1d1ad..ed0f6ae35f4 100644
--- a/src/emu/diimage.cpp
+++ b/src/emu/diimage.cpp
@@ -12,6 +12,7 @@
#include "emuopts.h"
#include "drivenum.h"
+#include "romload.h"
#include "ui/uimain.h"
#include "zippath.h"
#include "softlist.h"
diff --git a/src/emu/emu.h b/src/emu/emu.h
index 049bfc96bc3..2bce001824c 100644
--- a/src/emu/emu.h
+++ b/src/emu/emu.h
@@ -53,7 +53,7 @@ class address_map; // Forward declaration
#include "memarray.h"
// machine-wide utilities
-#include "romload.h"
+#include "romentry.h"
#include "save.h"
// I/O
diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp
index 7b46290c7e6..904644e104f 100644
--- a/src/emu/machine.cpp
+++ b/src/emu/machine.cpp
@@ -82,6 +82,7 @@
#include "dirtc.h"
#include "image.h"
#include "network.h"
+#include "romload.h"
#include "ui/uimain.h"
#include <time.h>
#include <rapidjson/writer.h>
diff --git a/src/emu/romentry.h b/src/emu/romentry.h
index 607e1ebe5c6..ff73e432c65 100644
--- a/src/emu/romentry.h
+++ b/src/emu/romentry.h
@@ -8,6 +8,10 @@
*********************************************************************/
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef MAME_EMU_ROMENTRY_H
#define MAME_EMU_ROMENTRY_H
@@ -112,6 +116,71 @@ enum
#define ROM_INHERITEDFLAGS (ROM_GROUPMASK | ROM_SKIPMASK | ROM_REVERSEMASK | ROM_BITWIDTHMASK | ROM_BITSHIFTMASK | ROM_BIOSFLAGSMASK)
+/* ----- start/stop macros ----- */
+#define ROM_NAME(name) rom_##name
+#define ROM_START(name) static const tiny_rom_entry ROM_NAME(name)[] = {
+#define ROM_END { nullptr, nullptr, 0, 0, ROMENTRYTYPE_END } };
+
+
+/* ----- ROM region macros ----- */
+#define ROM_REGION(length,tag,flags) { tag, nullptr, 0, length, ROMENTRYTYPE_REGION | (flags) },
+#define ROM_REGION16_LE(length,tag,flags) ROM_REGION(length, tag, (flags) | ROMREGION_16BIT | ROMREGION_LE)
+#define ROM_REGION16_BE(length,tag,flags) ROM_REGION(length, tag, (flags) | ROMREGION_16BIT | ROMREGION_BE)
+#define ROM_REGION32_LE(length,tag,flags) ROM_REGION(length, tag, (flags) | ROMREGION_32BIT | ROMREGION_LE)
+#define ROM_REGION32_BE(length,tag,flags) ROM_REGION(length, tag, (flags) | ROMREGION_32BIT | ROMREGION_BE)
+#define ROM_REGION64_LE(length,tag,flags) ROM_REGION(length, tag, (flags) | ROMREGION_64BIT | ROMREGION_LE)
+#define ROM_REGION64_BE(length,tag,flags) ROM_REGION(length, tag, (flags) | ROMREGION_64BIT | ROMREGION_BE)
+
+
+/* ----- core ROM loading macros ----- */
+#define ROMX_LOAD(name,offset,length,hash,flags) { name, hash, offset, length, ROMENTRYTYPE_ROM | (flags) },
+#define ROM_LOAD(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, 0)
+#define ROM_LOAD_OPTIONAL(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_OPTIONAL)
+
+
+/* ----- specialized loading macros ----- */
+#define ROM_LOAD_NIB_HIGH(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI)
+#define ROM_LOAD_NIB_LOW(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO)
+#define ROM_LOAD16_BYTE(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_SKIP(1))
+#define ROM_LOAD16_WORD(name,offset,length,hash) ROM_LOAD(name, offset, length, hash)
+#define ROM_LOAD16_WORD_SWAP(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE)
+#define ROM_LOAD32_BYTE(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_SKIP(3))
+#define ROM_LOAD32_WORD(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_SKIP(2))
+#define ROM_LOAD32_WORD_SWAP(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE | ROM_SKIP(2))
+#define ROM_LOAD32_DWORD(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPDWORD)
+#define ROM_LOAD64_BYTE(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_SKIP(7))
+#define ROM_LOAD64_WORD(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_SKIP(6))
+#define ROM_LOAD64_WORD_SWAP(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE | ROM_SKIP(6))
+#define ROM_LOAD64_DWORD_SWAP(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPDWORD | ROM_REVERSE | ROM_SKIP(4))
+
+
+/* ----- ROM_RELOAD related macros ----- */
+#define ROM_RELOAD(offset,length) { nullptr, nullptr, offset, length, ROMENTRYTYPE_RELOAD | ROM_INHERITFLAGS },
+#define ROM_RELOAD_PLAIN(offset,length) { nullptr, nullptr, offset, length, ROMENTRYTYPE_RELOAD },
+
+/* ----- additional ROM-related macros ----- */
+#define ROM_CONTINUE(offset,length) { nullptr, nullptr, (offset), (length), ROMENTRYTYPE_CONTINUE | ROM_INHERITFLAGS },
+#define ROM_IGNORE(length) { nullptr, nullptr, 0, (length), ROMENTRYTYPE_IGNORE | ROM_INHERITFLAGS },
+#define ROM_FILL(offset,length,value) { nullptr, (const char *)(value), (offset), (length), ROMENTRYTYPE_FILL },
+#define ROMX_FILL(offset,length,value,flags) { nullptr, (const char *)(value), (offset), (length), ROMENTRYTYPE_FILL | flags },
+#define ROM_COPY(srctag,srcoffs,offset,length) { (srctag), (const char *)(srcoffs), (offset), (length), ROMENTRYTYPE_COPY },
+
+
+/* ----- system BIOS macros ----- */
+#define ROM_SYSTEM_BIOS(value,name,description) { name, description, 0, 0, ROMENTRYTYPE_SYSTEM_BIOS | ROM_BIOS(value) },
+#define ROM_DEFAULT_BIOS(name) { name, nullptr, 0, 0, ROMENTRYTYPE_DEFAULT_BIOS },
+
+
+/* ----- game parameter macro ----- */
+#define ROM_PARAMETER(tag, value) { tag, value, 0, 0, ROMENTRYTYPE_PARAMETER },
+
+/* ----- disk loading macros ----- */
+#define DISK_REGION(tag) ROM_REGION(1, tag, ROMREGION_DATATYPEDISK)
+#define DISK_IMAGE(name,idx,hash) ROMX_LOAD(name, idx, 0, hash, DISK_READWRITE)
+#define DISK_IMAGE_READONLY(name,idx,hash) ROMX_LOAD(name, idx, 0, hash, DISK_READONLY)
+#define DISK_IMAGE_READONLY_OPTIONAL(name,idx,hash) ROMX_LOAD(name, idx, 0, hash, DISK_READONLY | ROM_OPTIONAL)
+
+
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/emu/romload.cpp b/src/emu/romload.cpp
index 3a3c31ac572..ff680b173a1 100644
--- a/src/emu/romload.cpp
+++ b/src/emu/romload.cpp
@@ -8,6 +8,8 @@
*********************************************************************/
#include "emu.h"
+#include "romload.h"
+
#include "emuopts.h"
#include "drivenum.h"
#include "softlist_dev.h"
diff --git a/src/emu/romload.h b/src/emu/romload.h
index 89c0e56a225..ae78d409932 100644
--- a/src/emu/romload.h
+++ b/src/emu/romload.h
@@ -9,15 +9,10 @@
#pragma once
-#ifndef __EMU_H__
-#error Dont include this file directly; include emu.h instead.
-#endif
-
#ifndef MAME_EMU_ROMLOAD_H
#define MAME_EMU_ROMLOAD_H
#include "chd.h"
-#include "romentry.h"
#include <type_traits>
@@ -376,71 +371,6 @@ public:
} // namespace romload
-/* ----- start/stop macros ----- */
-#define ROM_NAME(name) rom_##name
-#define ROM_START(name) static const tiny_rom_entry ROM_NAME(name)[] = {
-#define ROM_END { nullptr, nullptr, 0, 0, ROMENTRYTYPE_END } };
-
-
-/* ----- ROM region macros ----- */
-#define ROM_REGION(length,tag,flags) { tag, nullptr, 0, length, ROMENTRYTYPE_REGION | (flags) },
-#define ROM_REGION16_LE(length,tag,flags) ROM_REGION(length, tag, (flags) | ROMREGION_16BIT | ROMREGION_LE)
-#define ROM_REGION16_BE(length,tag,flags) ROM_REGION(length, tag, (flags) | ROMREGION_16BIT | ROMREGION_BE)
-#define ROM_REGION32_LE(length,tag,flags) ROM_REGION(length, tag, (flags) | ROMREGION_32BIT | ROMREGION_LE)
-#define ROM_REGION32_BE(length,tag,flags) ROM_REGION(length, tag, (flags) | ROMREGION_32BIT | ROMREGION_BE)
-#define ROM_REGION64_LE(length,tag,flags) ROM_REGION(length, tag, (flags) | ROMREGION_64BIT | ROMREGION_LE)
-#define ROM_REGION64_BE(length,tag,flags) ROM_REGION(length, tag, (flags) | ROMREGION_64BIT | ROMREGION_BE)
-
-
-/* ----- core ROM loading macros ----- */
-#define ROMX_LOAD(name,offset,length,hash,flags) { name, hash, offset, length, ROMENTRYTYPE_ROM | (flags) },
-#define ROM_LOAD(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, 0)
-#define ROM_LOAD_OPTIONAL(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_OPTIONAL)
-
-
-/* ----- specialized loading macros ----- */
-#define ROM_LOAD_NIB_HIGH(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI)
-#define ROM_LOAD_NIB_LOW(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO)
-#define ROM_LOAD16_BYTE(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_SKIP(1))
-#define ROM_LOAD16_WORD(name,offset,length,hash) ROM_LOAD(name, offset, length, hash)
-#define ROM_LOAD16_WORD_SWAP(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE)
-#define ROM_LOAD32_BYTE(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_SKIP(3))
-#define ROM_LOAD32_WORD(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_SKIP(2))
-#define ROM_LOAD32_WORD_SWAP(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE | ROM_SKIP(2))
-#define ROM_LOAD32_DWORD(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPDWORD)
-#define ROM_LOAD64_BYTE(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_SKIP(7))
-#define ROM_LOAD64_WORD(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_SKIP(6))
-#define ROM_LOAD64_WORD_SWAP(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE | ROM_SKIP(6))
-#define ROM_LOAD64_DWORD_SWAP(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPDWORD | ROM_REVERSE | ROM_SKIP(4))
-
-
-/* ----- ROM_RELOAD related macros ----- */
-#define ROM_RELOAD(offset,length) { nullptr, nullptr, offset, length, ROMENTRYTYPE_RELOAD | ROM_INHERITFLAGS },
-#define ROM_RELOAD_PLAIN(offset,length) { nullptr, nullptr, offset, length, ROMENTRYTYPE_RELOAD },
-
-/* ----- additional ROM-related macros ----- */
-#define ROM_CONTINUE(offset,length) { nullptr, nullptr, (offset), (length), ROMENTRYTYPE_CONTINUE | ROM_INHERITFLAGS },
-#define ROM_IGNORE(length) { nullptr, nullptr, 0, (length), ROMENTRYTYPE_IGNORE | ROM_INHERITFLAGS },
-#define ROM_FILL(offset,length,value) { nullptr, (const char *)(value), (offset), (length), ROMENTRYTYPE_FILL },
-#define ROMX_FILL(offset,length,value,flags) { nullptr, (const char *)(value), (offset), (length), ROMENTRYTYPE_FILL | flags },
-#define ROM_COPY(srctag,srcoffs,offset,length) { (srctag), (const char *)(srcoffs), (offset), (length), ROMENTRYTYPE_COPY },
-
-
-/* ----- system BIOS macros ----- */
-#define ROM_SYSTEM_BIOS(value,name,description) { name, description, 0, 0, ROMENTRYTYPE_SYSTEM_BIOS | ROM_BIOS(value) },
-#define ROM_DEFAULT_BIOS(name) { name, nullptr, 0, 0, ROMENTRYTYPE_DEFAULT_BIOS },
-
-
-/* ----- game parameter macro ----- */
-#define ROM_PARAMETER(tag, value) { tag, value, 0, 0, ROMENTRYTYPE_PARAMETER },
-
-/* ----- disk loading macros ----- */
-#define DISK_REGION(tag) ROM_REGION(1, tag, ROMREGION_DATATYPEDISK)
-#define DISK_IMAGE(name,idx,hash) ROMX_LOAD(name, idx, 0, hash, DISK_READWRITE)
-#define DISK_IMAGE_READONLY(name,idx,hash) ROMX_LOAD(name, idx, 0, hash, DISK_READONLY)
-#define DISK_IMAGE_READONLY_OPTIONAL(name,idx,hash) ROMX_LOAD(name, idx, 0, hash, DISK_READONLY | ROM_OPTIONAL)
-
-
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/emu/softlist_dev.cpp b/src/emu/softlist_dev.cpp
index 43eb72427c1..21dfb45ba09 100644
--- a/src/emu/softlist_dev.cpp
+++ b/src/emu/softlist_dev.cpp
@@ -11,6 +11,7 @@
#include "emu.h"
#include "emuopts.h"
#include "diimage.h"
+#include "romload.h"
#include "softlist_dev.h"
#include "validity.h"
diff --git a/src/emu/validity.cpp b/src/emu/validity.cpp
index 866df59f78b..f8745e66bef 100644
--- a/src/emu/validity.cpp
+++ b/src/emu/validity.cpp
@@ -12,6 +12,7 @@
#include "validity.h"
#include "emuopts.h"
+#include "romload.h"
#include "video/rgbutil.h"
#include <ctype.h>
diff --git a/src/frontend/mame/audit.cpp b/src/frontend/mame/audit.cpp
index b0268675005..a33dd4bb52a 100644
--- a/src/frontend/mame/audit.cpp
+++ b/src/frontend/mame/audit.cpp
@@ -13,6 +13,7 @@
#include "audit.h"
#include "chd.h"
#include "drivenum.h"
+#include "romload.h"
#include "sound/samples.h"
#include "softlist_dev.h"
diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp
index a5f186dec7f..60260556606 100644
--- a/src/frontend/mame/clifront.cpp
+++ b/src/frontend/mame/clifront.cpp
@@ -16,6 +16,7 @@
#include "mameopts.h"
#include "audit.h"
#include "info.h"
+#include "romload.h"
#include "unzip.h"
#include "validity.h"
#include "sound/samples.h"
diff --git a/src/frontend/mame/info.cpp b/src/frontend/mame/info.cpp
index d3e7e36cfb1..f4e1a01ca68 100644
--- a/src/frontend/mame/info.cpp
+++ b/src/frontend/mame/info.cpp
@@ -18,6 +18,7 @@
#include "config.h"
#include "drivenum.h"
+#include "romload.h"
#include "screen.h"
#include "softlist_dev.h"
#include "speaker.h"
diff --git a/src/frontend/mame/media_ident.h b/src/frontend/mame/media_ident.h
index ac919dd8611..3430e02cb0b 100644
--- a/src/frontend/mame/media_ident.h
+++ b/src/frontend/mame/media_ident.h
@@ -10,6 +10,7 @@
#ifndef MAME_FRONTEND_MEDIA_IDENT_H
#define MAME_FRONTEND_MEDIA_IDENT_H
+#include "romload.h"
#include <vector>
diff --git a/src/frontend/mame/ui/devopt.cpp b/src/frontend/mame/ui/devopt.cpp
index ac9a721e455..562bcc26e2c 100644
--- a/src/frontend/mame/ui/devopt.cpp
+++ b/src/frontend/mame/ui/devopt.cpp
@@ -11,6 +11,7 @@
#include "emu.h"
#include "ui/ui.h"
#include "ui/devopt.h"
+#include "romload.h"
namespace ui {
diff --git a/src/frontend/mame/ui/info.cpp b/src/frontend/mame/ui/info.cpp
index 4e184e19727..fde44227ea3 100644
--- a/src/frontend/mame/ui/info.cpp
+++ b/src/frontend/mame/ui/info.cpp
@@ -14,6 +14,7 @@
#include "ui/ui.h"
#include "drivenum.h"
+#include "romload.h"
#include "softlist.h"
#include "emuopts.h"
diff --git a/src/frontend/mame/ui/miscmenu.cpp b/src/frontend/mame/ui/miscmenu.cpp
index 6792cef3f4f..57b1412dd5d 100644
--- a/src/frontend/mame/ui/miscmenu.cpp
+++ b/src/frontend/mame/ui/miscmenu.cpp
@@ -15,6 +15,7 @@
#include "pluginopts.h"
#include "drivenum.h"
#include "natkeyboard.h"
+#include "romload.h"
#include "uiinput.h"
#include "ui/ui.h"
diff --git a/src/frontend/mame/ui/selgame.cpp b/src/frontend/mame/ui/selgame.cpp
index 92185adfbe6..0b47fa1d7d1 100644
--- a/src/frontend/mame/ui/selgame.cpp
+++ b/src/frontend/mame/ui/selgame.cpp
@@ -26,6 +26,7 @@
#include "emuopts.h"
#include "mame.h"
#include "rendutil.h"
+#include "romload.h"
#include "softlist_dev.h"
#include "uiinput.h"
#include "luaengine.h"
diff --git a/src/frontend/mame/ui/selmenu.cpp b/src/frontend/mame/ui/selmenu.cpp
index e77d6e73476..05240981ea0 100644
--- a/src/frontend/mame/ui/selmenu.cpp
+++ b/src/frontend/mame/ui/selmenu.cpp
@@ -29,6 +29,7 @@
#include "emuopts.h"
#include "rendfont.h"
#include "rendutil.h"
+#include "romload.h"
#include "softlist.h"
#include "softlist_dev.h"
#include "uiinput.h"
diff --git a/src/frontend/mame/ui/utils.cpp b/src/frontend/mame/ui/utils.cpp
index 7c369398a1d..1a8ff0ba476 100644
--- a/src/frontend/mame/ui/utils.cpp
+++ b/src/frontend/mame/ui/utils.cpp
@@ -19,6 +19,7 @@
#include "drivenum.h"
#include "rendfont.h"
+#include "romload.h"
#include "softlist.h"
#include <bitset>
diff --git a/src/mame/drivers/konamim2.cpp b/src/mame/drivers/konamim2.cpp
index 44f365a9d45..09045ed0005 100644
--- a/src/mame/drivers/konamim2.cpp
+++ b/src/mame/drivers/konamim2.cpp
@@ -194,6 +194,7 @@ Notes:
#include "imagedev/chd_cd.h"
#include "machine/terminal.h"
#include "emupal.h"
+#include "romload.h"
#include "softlist.h"
#include "screen.h"
diff --git a/src/mame/drivers/ksys573.cpp b/src/mame/drivers/ksys573.cpp
index a4ca67b6c68..e035454d0bb 100644
--- a/src/mame/drivers/ksys573.cpp
+++ b/src/mame/drivers/ksys573.cpp
@@ -365,6 +365,7 @@ G: gun mania only, drives air soft gun (this game uses real BB bullet)
#include "sound/cdda.h"
#include "video/psx.h"
#include "cdrom.h"
+#include "romload.h"
#include "screen.h"
#include "speaker.h"
diff --git a/src/mame/drivers/ldplayer.cpp b/src/mame/drivers/ldplayer.cpp
index 9a9bb53d055..ae3dc419493 100644
--- a/src/mame/drivers/ldplayer.cpp
+++ b/src/mame/drivers/ldplayer.cpp
@@ -17,6 +17,7 @@
#include "ui/uimain.h"
#include "emuopts.h"
+#include "romload.h"
#include "speaker.h"
#include "screen.h"
diff --git a/src/mame/drivers/system16.cpp b/src/mame/drivers/system16.cpp
index 532ba140f9f..a96d0278da1 100644
--- a/src/mame/drivers/system16.cpp
+++ b/src/mame/drivers/system16.cpp
@@ -133,7 +133,7 @@ READ8_MEMBER(segas1x_bootleg_state::sound_command_irq_r)
WRITE8_MEMBER(segas1x_bootleg_state::soundbank_msm_w)
{
- m_soundbank->set_entry((data & 7) ^ 6); // probably wrong
+ m_soundbank->set_entry(data & 7);
m_msm->reset_w(BIT(data, 3));
}
diff --git a/src/mame/machine/cdicdic.cpp b/src/mame/machine/cdicdic.cpp
index ebd9851eea0..4b371e8f78a 100644
--- a/src/mame/machine/cdicdic.cpp
+++ b/src/mame/machine/cdicdic.cpp
@@ -27,6 +27,7 @@ TODO:
#include "cpu/m68000/m68000.h"
#include "cdrom.h"
+#include "romload.h"
#include "sound/cdda.h"
diff --git a/src/mame/machine/naomigd.cpp b/src/mame/machine/naomigd.cpp
index 9c41ae21f9a..811dde9d415 100644
--- a/src/mame/machine/naomigd.cpp
+++ b/src/mame/machine/naomigd.cpp
@@ -3,6 +3,7 @@
#include "emu.h"
#include "naomigd.h"
+#include "romload.h"
#include "imagedev/chd_cd.h"
/*
diff --git a/src/mame/machine/xbox.cpp b/src/mame/machine/xbox.cpp
index bf0af2747c3..a85a0c2bfb6 100644
--- a/src/mame/machine/xbox.cpp
+++ b/src/mame/machine/xbox.cpp
@@ -11,6 +11,7 @@
#include "debug/debugcmd.h"
#include "debugger.h"
+#include "romload.h"
#include <functional>