summaryrefslogtreecommitdiffstats
path: root/src/devices/imagedev/bitbngr.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2022-03-10 02:55:40 +1100
committer Vas Crabb <vas@vastheman.com>2022-03-10 02:55:40 +1100
commit422185fe558463a119cfdee25e2d4b6e5d71dc97 (patch)
tree10a01acb7c99b76a0cc575dabd4ce76ec9e3249f /src/devices/imagedev/bitbngr.cpp
parentbbb9ec846a44598159258d36f21bae42437ee290 (diff)
docs: Added page describing how MAME searches for media.
Also made error messages for missing CHDs and missing files for software parts using the image file loader show search paths, and changed the (poorly named) bitbanger device to use the image file loader rather than the ROM loader for software items.
Diffstat (limited to 'src/devices/imagedev/bitbngr.cpp')
-rw-r--r--src/devices/imagedev/bitbngr.cpp30
1 files changed, 4 insertions, 26 deletions
diff --git a/src/devices/imagedev/bitbngr.cpp b/src/devices/imagedev/bitbngr.cpp
index 86c92c88ceb..dc31c4ccb83 100644
--- a/src/devices/imagedev/bitbngr.cpp
+++ b/src/devices/imagedev/bitbngr.cpp
@@ -28,8 +28,6 @@ DEFINE_DEVICE_TYPE(BITBANGER, bitbanger_device, "bitbanger", "Bitbanger")
bitbanger_device::bitbanger_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, BITBANGER, tag, owner, clock),
device_image_interface(mconfig, *this),
- m_next(nullptr),
- m_end(nullptr),
m_interface(nullptr),
m_is_readonly(false)
{
@@ -54,21 +52,10 @@ void bitbanger_device::output(uint8_t data)
uint32_t bitbanger_device::input(void *buffer, uint32_t length)
{
- if (loaded_through_softlist())
- {
- size_t const result = std::min<size_t>(length, m_end - m_next);
- memcpy(buffer, m_next, result);
- m_next += result;
- return uint32_t(result);
- }
- else if (exists())
- {
+ if (exists())
return fread(buffer, length);
- }
else
- {
return 0;
- }
}
@@ -89,7 +76,7 @@ void bitbanger_device::device_start()
const software_list_loader &bitbanger_device::get_software_list_loader() const
{
- return rom_software_list_loader::instance();
+ return image_software_list_loader::instance();
}
@@ -100,16 +87,7 @@ const software_list_loader &bitbanger_device::get_software_list_loader() const
image_init_result bitbanger_device::call_load()
{
- if (loaded_through_softlist())
- {
- auto const length = get_software_region_length("input");
- m_next = get_software_region("input");
- m_end = m_next + length;
- }
- else
- {
- m_next = m_end = nullptr;
- }
+ // we don't need to do anything special
return image_init_result::PASS;
}
@@ -125,5 +103,5 @@ image_init_result bitbanger_device::call_create(int format_type, util::option_re
void bitbanger_device::call_unload()
{
- m_next = m_end = nullptr;
+ // we don't need to do anything special
}