summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Michael Zapf <Michael.Zapf@mizapf.de>2015-07-14 23:08:06 +0200
committer Michael Zapf <Michael.Zapf@mizapf.de>2015-07-14 23:20:24 +0200
commit2fe1b16c633e11bb9a7d41a2861a15ed17784d48 (patch)
tree21ba3cbeb8db31e6bf980de6f951ea71301a6959 /src
parent32fd5e1405105b2b1bd84664e7c661a6afb9f901 (diff)
Fixed image truncate and a lockup during disk formatting
Diffstat (limited to 'src')
-rw-r--r--src/emu/machine/hdc9234.c12
-rw-r--r--src/osd/sdl/sdlfile.c2
2 files changed, 8 insertions, 6 deletions
diff --git a/src/emu/machine/hdc9234.c b/src/emu/machine/hdc9234.c
index 06d1eba4cc3..4247f17aa51 100644
--- a/src/emu/machine/hdc9234.c
+++ b/src/emu/machine/hdc9234.c
@@ -1740,7 +1740,7 @@ void hdc9234_device::format_track()
switch (m_substate)
{
case WAITINDEX0:
- if (TRACE_FORMAT && TRACE_DETAIL) logerror("%s: Format track - waiting for index hole\n", tag());
+ if (TRACE_FORMAT && TRACE_DETAIL) logerror("%s: Format track; looking for track start\n", tag());
if (!index_hole())
{
m_substate = WAITINDEX1;
@@ -1749,13 +1749,14 @@ void hdc9234_device::format_track()
else
{
// We're above the index hole right now, so wait for the line going down
- if (TRACE_FORMAT && TRACE_DETAIL) logerror("%s: Index hole just passing by ... waiting for next\n", tag());
- wait_line(INDEX_LINE, ASSERT_LINE, WAITINDEX1, false);
+ if (TRACE_FORMAT && TRACE_DETAIL) logerror("%s: Index hole just passing by ... \n", tag());
+ wait_line(INDEX_LINE, CLEAR_LINE, WAITINDEX1, false);
cont = WAIT;
}
break;
case WAITINDEX1:
// Waiting for the next rising edge
+ if (TRACE_FORMAT && TRACE_DETAIL) logerror("%s: Waiting for next index hole\n", tag());
wait_line(INDEX_LINE, ASSERT_LINE, TRACKSTART, false);
cont = WAIT;
break;
@@ -2503,8 +2504,9 @@ void hdc9234_device::live_run_until(attotime limit)
write_on_track(encode((m_live_state.crc >> 8) & 0xff), 1, WRITE_DATA_CRC);
}
else
- // Write a filler byte so that the last CRC bit is saved correctly
- write_on_track(encode(0xff), 1, WRITE_DONE);
+ // Write a filler byte so that the last CRC bit is saved correctly (why actually?)
+ // write_on_track(encode(0xff), 1, WRITE_DONE);
+ m_live_state.state = WRITE_DONE;
break;
diff --git a/src/osd/sdl/sdlfile.c b/src/osd/sdl/sdlfile.c
index 24fe05ac027..74779252641 100644
--- a/src/osd/sdl/sdlfile.c
+++ b/src/osd/sdl/sdlfile.c
@@ -375,7 +375,7 @@ file_error osd_truncate(osd_file *file, UINT64 offset)
{
case SDLFILE_FILE:
result = ftruncate(file->handle, offset);
- if (!result)
+ if (result)
return error_to_file_error(errno);
return FILERR_NONE;