diff options
Diffstat (limited to 'src/devices/imagedev/picture.cpp')
-rw-r--r-- | src/devices/imagedev/picture.cpp | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/devices/imagedev/picture.cpp b/src/devices/imagedev/picture.cpp new file mode 100644 index 00000000000..2767d80a1d4 --- /dev/null +++ b/src/devices/imagedev/picture.cpp @@ -0,0 +1,64 @@ +// license:BSD-3-Clause +// copyright-holders:R. Belmont +/********************************************************************* + + picture.cpp + + Image device for still pictures. + +*********************************************************************/ + +#include "emu.h" +#include "picture.h" +#include "png.h" + +/*************************************************************************** + TYPE DEFINITIONS +***************************************************************************/ + +// device type definition +DEFINE_DEVICE_TYPE(IMAGE_PICTURE, picture_image_device, "picture_image", "Still Image") + +//------------------------------------------------- +// microdrive_image_device - constructor +//------------------------------------------------- + +picture_image_device::picture_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, IMAGE_PICTURE, tag, owner, clock), + device_image_interface(mconfig, *this), + m_picture(nullptr) +{ +} + +//------------------------------------------------- +// microdrive_image_device - destructor +//------------------------------------------------- + +picture_image_device::~picture_image_device() +{ + if (m_picture) + { + delete m_picture; + m_picture = nullptr; + } +} + + +void picture_image_device::device_start() +{ +} + +image_init_result picture_image_device::call_load() +{ + m_picture = new bitmap_argb32; + if (png_read_bitmap(image_core_file(), *m_picture) != PNGERR_NONE) + { + return image_init_result::FAIL; + } + + return image_init_result::PASS; +} + +void picture_image_device::call_unload() +{ +} |