mirror of
https://github.com/tjboldt/Apple2-IO-RPi.git
synced 2024-12-22 02:30:12 +00:00
Fix #170 driver crash on unload drive
This commit is contained in:
parent
9786590f6e
commit
1e73e8d886
@ -22,7 +22,7 @@ func ReadBlockCommand(drive1 prodos.ReaderWriterAt, drive2 prodos.ReaderWriterAt
|
||||
driveUnit, err = comm.ReadByte()
|
||||
|
||||
if err != nil {
|
||||
fmt.Printf("Failed to read block")
|
||||
fmt.Printf("Failed to receive requested block number")
|
||||
return 0, err
|
||||
}
|
||||
|
||||
@ -34,6 +34,11 @@ func ReadBlockCommand(drive1 prodos.ReaderWriterAt, drive2 prodos.ReaderWriterAt
|
||||
driveNumber = 2
|
||||
}
|
||||
|
||||
if file == nil {
|
||||
fmt.Printf("Requested drive not loaded")
|
||||
return 0, err
|
||||
}
|
||||
|
||||
slotNumber := driveUnit & 0x7F >> 4
|
||||
|
||||
block := int(blockHigh)*256 + int(blockLow)
|
||||
|
@ -8,4 +8,4 @@ package info
|
||||
|
||||
// Version is the hexadecimal version number that
|
||||
// should be incremented with each driver update
|
||||
const Version = "002D"
|
||||
const Version = "002E"
|
||||
|
Loading…
Reference in New Issue
Block a user