Do not return sync bytes if no image inserted

- This really should be backed by more testing or research =P
This commit is contained in:
Aaron Culliney 2015-10-17 13:23:49 -07:00
parent 053a4c8c93
commit 39c09a042f
2 changed files with 4 additions and 3 deletions

View File

@ -527,9 +527,10 @@ static bool save_track_data(void) {
GLUE_C_READ(disk_read_write_byte)
{
uint8_t value = 0xFF;
uint8_t value = 0x00;
do {
if (disk6.disk[disk6.drive].fp == NULL) {
////ERRLOG_THROTTLE("OOPS, attempt to read byte from NULL image in drive (%d)", disk6.drive+1);
break;
}

View File

@ -226,7 +226,7 @@ TEST test_read_null_bytes() {
BOOT_TO_DOS();
apple_ii_64k[0][WATCHPOINT_ADDR] = 0x00;
apple_ii_64k[0][TESTOUT_ADDR] = 0x00;
apple_ii_64k[0][TESTOUT_ADDR] = 0xAA;
ASM_INIT();
ASM_TEST_DISK_READ_NULL();
@ -237,7 +237,7 @@ TEST test_read_null_bytes() {
c_debugger_go();
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
ASSERT(apple_ii_64k[0][TESTOUT_ADDR] == 0xFF);
ASSERT(apple_ii_64k[0][TESTOUT_ADDR] == 0x00);
PASS();
}