summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/imagedev
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-11-01 14:34:45 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2015-11-01 14:34:45 +0100
commit18188cb13bc11ba743d19e28125c6d8ab940fb70 (patch)
tree1463ebf983d0525857b43cfd0fa2d803ea108e78 /src/devices/imagedev
parentb814617b65550c6f5a86336f048ae14b312b4136 (diff)
making logerror part of machine and device classes [Miodrag Milanovic]
display tag of device that logged message
Diffstat (limited to 'src/devices/imagedev')
-rw-r--r--src/devices/imagedev/floppy.c10
-rw-r--r--src/devices/imagedev/mfmhd.c19
-rw-r--r--src/devices/imagedev/mfmhd.h3
3 files changed, 17 insertions, 15 deletions
diff --git a/src/devices/imagedev/floppy.c b/src/devices/imagedev/floppy.c
index 47ddeb05f38..ae17d0ed34e 100644
--- a/src/devices/imagedev/floppy.c
+++ b/src/devices/imagedev/floppy.c
@@ -942,7 +942,7 @@ void ui_menu_control_floppy_image::do_load_create()
if(input_filename.compare("")==0) {
int err = fd->create(output_filename.c_str(), 0, NULL);
if (err != 0) {
- popmessage("Error: %s", fd->error());
+ machine().popmessage("Error: %s", fd->error());
return;
}
fd->setup_write(output_format);
@@ -951,7 +951,7 @@ void ui_menu_control_floppy_image::do_load_create()
if (!err && output_filename.compare("") != 0)
err = fd->reopen_for_write(output_filename.c_str());
if(err != 0) {
- popmessage("Error: %s", fd->error());
+ machine().popmessage("Error: %s", fd->error());
return;
}
if(output_format)
@@ -963,7 +963,7 @@ void ui_menu_control_floppy_image::hook_load(std::string filename, bool softlist
{
if (softlist)
{
- popmessage("When loaded from software list, the disk is Read-only.\n");
+ machine().popmessage("When loaded from software list, the disk is Read-only.\n");
image->load(filename.c_str());
ui_menu::stack_pop(machine());
return;
@@ -974,7 +974,7 @@ void ui_menu_control_floppy_image::hook_load(std::string filename, bool softlist
if (!input_format)
{
- popmessage("Error: %s\n", image->error());
+ machine().popmessage("Error: %s\n", image->error());
ui_menu::stack_pop(machine());
return;
}
@@ -1049,7 +1049,7 @@ void ui_menu_control_floppy_image::handle()
break;
case ui_menu_select_rw::WRITE_DIFF:
- popmessage("Sorry, diffs are not supported yet\n");
+ machine().popmessage("Sorry, diffs are not supported yet\n");
ui_menu::stack_pop(machine());
break;
diff --git a/src/devices/imagedev/mfmhd.c b/src/devices/imagedev/mfmhd.c
index cfcdbed0353..2a3099fbcde 100644
--- a/src/devices/imagedev/mfmhd.c
+++ b/src/devices/imagedev/mfmhd.c
@@ -346,7 +346,7 @@ void mfm_harddisk_device::device_start()
m_current_cylinder = m_landing_zone; // Park position
m_spinup_timer->adjust(attotime::from_msec(m_spinupms));
- m_cache = global_alloc(mfmhd_trackimage_cache);
+ m_cache = global_alloc(mfmhd_trackimage_cache(machine()));
// In 5 second periods, check whether the cache has dirty lines
m_cache_timer->adjust(attotime::from_msec(5000), 0, attotime::from_msec(5000));
@@ -952,15 +952,16 @@ const device_type MFMHD_ST251 = &device_creator<mfm_hd_st251_device>;
// This is a write-back LRU cache.
// ===========================================================
-mfmhd_trackimage_cache::mfmhd_trackimage_cache():
- m_tracks(NULL)
+mfmhd_trackimage_cache::mfmhd_trackimage_cache(running_machine &machine):
+ m_tracks(NULL),
+ m_machine(machine)
{
}
mfmhd_trackimage_cache::~mfmhd_trackimage_cache()
{
mfmhd_trackimage* current = m_tracks;
- if (TRACE_CACHE) logerror("%s: MFM HD cache destroy\n", m_mfmhd->tag());
+ if (TRACE_CACHE) m_machine.logerror("%s: MFM HD cache destroy\n", m_mfmhd->tag());
while (current != NULL)
{
@@ -991,12 +992,12 @@ void mfmhd_trackimage_cache::write_back_one()
void mfmhd_trackimage_cache::cleanup()
{
mfmhd_trackimage* current = m_tracks;
- if (TRACE_CACHE) logerror("%s: MFM HD cache cleanup\n", m_mfmhd->tag());
+ if (TRACE_CACHE) m_machine.logerror("%s: MFM HD cache cleanup\n", m_mfmhd->tag());
// Still dirty?
while (current != NULL)
{
- if (TRACE_CACHE) logerror("%s: MFM HD cache: evict line cylinder=%d head=%d\n", m_mfmhd->tag(), current->cylinder, current->head);
+ if (TRACE_CACHE) m_machine.logerror("%s: MFM HD cache: evict line cylinder=%d head=%d\n", m_mfmhd->tag(), current->cylinder, current->head);
if (current->dirty)
{
m_mfmhd->write_track(current->encdata, current->cylinder, current->head);
@@ -1023,7 +1024,7 @@ const char *encnames[] = { "MFM_BITS","MFM_BYTE","SEPARATE","SSIMPLE " };
*/
void mfmhd_trackimage_cache::init(mfm_harddisk_device* mfmhd, int tracksize, int trackslots)
{
- if (TRACE_CACHE) logerror("%s: MFM HD cache init; cache size is %d tracks\n", mfmhd->tag(), trackslots);
+ if (TRACE_CACHE) m_machine.logerror("%s: MFM HD cache init; cache size is %d tracks\n", mfmhd->tag(), trackslots);
chd_error state = CHDERR_NONE;
@@ -1039,7 +1040,7 @@ void mfmhd_trackimage_cache::init(mfm_harddisk_device* mfmhd, int tracksize, int
while (track < trackslots)
{
- if (TRACE_CACHE && TRACE_DETAIL) logerror("%s: MFM HD allocate cache slot\n", mfmhd->tag());
+ if (TRACE_CACHE && TRACE_DETAIL) m_machine.logerror("%s: MFM HD allocate cache slot\n", mfmhd->tag());
previous = current;
current = global_alloc(mfmhd_trackimage);
current->encdata = global_alloc_array(UINT16, tracksize);
@@ -1118,7 +1119,7 @@ UINT16* mfmhd_trackimage_cache::get_trackimage(int cylinder, int head)
// previous points to the second to last element
current = previous->next;
- if (TRACE_CACHE) logerror("%s: MFM HD cache: evict line (c=%d,h=%d)\n", m_mfmhd->tag(), current->cylinder, current->head);
+ if (TRACE_CACHE) m_machine.logerror("%s: MFM HD cache: evict line (c=%d,h=%d)\n", m_mfmhd->tag(), current->cylinder, current->head);
if (current->dirty)
{
diff --git a/src/devices/imagedev/mfmhd.h b/src/devices/imagedev/mfmhd.h
index c15b892423d..85450f23bbb 100644
--- a/src/devices/imagedev/mfmhd.h
+++ b/src/devices/imagedev/mfmhd.h
@@ -33,7 +33,7 @@ public:
class mfmhd_trackimage_cache
{
public:
- mfmhd_trackimage_cache();
+ mfmhd_trackimage_cache(running_machine &machine);
~mfmhd_trackimage_cache();
void init(mfm_harddisk_device* mfmhd, int tracksize, int trackslots);
UINT16* get_trackimage(int cylinder, int head);
@@ -44,6 +44,7 @@ public:
private:
mfm_harddisk_device* m_mfmhd;
mfmhd_trackimage* m_tracks;
+ running_machine & m_machine;
};
class mfm_harddisk_device : public harddisk_image_device,