Fix BSV recording/playback

Inputs are 16-bit numbers, but the file writing routines were called with just one byte lengths.  This change fixes BSV recording and playback for me.
This commit is contained in:
Joe Osborn 2019-10-11 07:37:58 -04:00 committed by GitHub
parent 7afbd4632d
commit ef0eba5c5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12290,7 +12290,7 @@ static int16_t input_state(unsigned port, unsigned device,
if (BSV_MOVIE_IS_PLAYBACK_ON())
{
int16_t bsv_result;
if (intfstream_read(bsv_movie_state_handle->file, &bsv_result, 1) == 1)
if (intfstream_read(bsv_movie_state_handle->file, &bsv_result, 2) == 2)
return swap_if_big16(bsv_result);
bsv_movie_state.movie_end = true;
}
@ -12321,7 +12321,7 @@ static int16_t input_state(unsigned port, unsigned device,
if (BSV_MOVIE_IS_PLAYBACK_OFF())
{
result = swap_if_big16(result);
intfstream_write(bsv_movie_state_handle->file, &result, 1);
intfstream_write(bsv_movie_state_handle->file, &result, 2);
}
return result;