mirror of
https://github.com/holub/mame
synced 2025-07-04 17:38:08 +03:00
Fixed image truncate and a lockup during disk formatting
This commit is contained in:
parent
32fd5e1405
commit
2fe1b16c63
@ -1740,7 +1740,7 @@ void hdc9234_device::format_track()
|
|||||||
switch (m_substate)
|
switch (m_substate)
|
||||||
{
|
{
|
||||||
case WAITINDEX0:
|
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())
|
if (!index_hole())
|
||||||
{
|
{
|
||||||
m_substate = WAITINDEX1;
|
m_substate = WAITINDEX1;
|
||||||
@ -1749,13 +1749,14 @@ void hdc9234_device::format_track()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// We're above the index hole right now, so wait for the line going down
|
// 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());
|
if (TRACE_FORMAT && TRACE_DETAIL) logerror("%s: Index hole just passing by ... \n", tag());
|
||||||
wait_line(INDEX_LINE, ASSERT_LINE, WAITINDEX1, false);
|
wait_line(INDEX_LINE, CLEAR_LINE, WAITINDEX1, false);
|
||||||
cont = WAIT;
|
cont = WAIT;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WAITINDEX1:
|
case WAITINDEX1:
|
||||||
// Waiting for the next rising edge
|
// 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);
|
wait_line(INDEX_LINE, ASSERT_LINE, TRACKSTART, false);
|
||||||
cont = WAIT;
|
cont = WAIT;
|
||||||
break;
|
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);
|
write_on_track(encode((m_live_state.crc >> 8) & 0xff), 1, WRITE_DATA_CRC);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// Write a filler byte so that the last CRC bit is saved correctly
|
// Write a filler byte so that the last CRC bit is saved correctly (why actually?)
|
||||||
write_on_track(encode(0xff), 1, WRITE_DONE);
|
// write_on_track(encode(0xff), 1, WRITE_DONE);
|
||||||
|
m_live_state.state = WRITE_DONE;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -375,7 +375,7 @@ file_error osd_truncate(osd_file *file, UINT64 offset)
|
|||||||
{
|
{
|
||||||
case SDLFILE_FILE:
|
case SDLFILE_FILE:
|
||||||
result = ftruncate(file->handle, offset);
|
result = ftruncate(file->handle, offset);
|
||||||
if (!result)
|
if (result)
|
||||||
return error_to_file_error(errno);
|
return error_to_file_error(errno);
|
||||||
return FILERR_NONE;
|
return FILERR_NONE;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user