Seek to 0 before writing to /dev/vga.

This commit is contained in:
Jonas 'Sortie' Termansen 2012-11-07 15:26:02 +01:00
parent 4f60d028ef
commit 7e05129023
3 changed files with 9 additions and 3 deletions

View File

@ -57,7 +57,9 @@ void Clear()
bool FlushVGA()
{
return writeall(vgafd, frame, sizeof(frame)) < sizeof(frame);
if ( lseek(vgafd, 0, SEEK_SET) < 0)
return false;
return writeall(vgafd, frame, sizeof(frame)) == sizeof(frame);
}
int Init()

View File

@ -70,7 +70,9 @@ unsigned soundleft;
bool FlushVGA()
{
return writeall(vgafd, frame, sizeof(frame)) < sizeof(frame);
if ( lseek(vgafd, 0, SEEK_SET) < 0)
return false;
return writeall(vgafd, frame, sizeof(frame)) == sizeof(frame);
}
int Init()

View File

@ -95,7 +95,9 @@ void Reset()
bool FlushVGA()
{
return writeall(vgafd, frame, sizeof(frame)) < sizeof(frame);
if ( lseek(vgafd, 0, SEEK_SET) < 0)
return false;
return writeall(vgafd, frame, sizeof(frame)) == sizeof(frame);
}
int Init()