Allowing two disks to be specified.

This commit is contained in:
Rob Greene 2020-04-12 18:29:04 -05:00 committed by Iván Izaguirre
parent f6c99d93a8
commit f4cc6521cb
2 changed files with 14 additions and 2 deletions

View File

@ -95,7 +95,7 @@ func (a *Apple2) LoadRom(filename string) error {
} }
// AddDisk2 inserts a DiskII controller // AddDisk2 inserts a DiskII controller
func (a *Apple2) AddDisk2(slot int, diskRomFile string, diskImage string) error { func (a *Apple2) AddDisk2(slot int, diskRomFile string, diskImage, diskBImage string) error {
var c cardDisk2 var c cardDisk2
data, err := loadResource(diskRomFile) data, err := loadResource(diskRomFile)
if err != nil { if err != nil {
@ -112,6 +112,14 @@ func (a *Apple2) AddDisk2(slot int, diskRomFile string, diskImage string) error
c.drive[0].insertDiskette(diskette) c.drive[0].insertDiskette(diskette)
} }
if diskBImage != "" {
diskette, err := loadDisquette(diskBImage)
if err != nil {
return err
}
c.drive[1].insertDiskette(diskette)
}
return nil return nil
} }

View File

@ -25,6 +25,10 @@ func MainApple() *Apple2 {
"disk", "disk",
"<internal>/dos33.dsk", "<internal>/dos33.dsk",
"file to load on the first disk drive") "file to load on the first disk drive")
diskBImage := flag.String(
"diskb",
"",
"file to load on the second disk drive")
wozImage := flag.String( wozImage := flag.String(
"woz", "woz",
"", "",
@ -224,7 +228,7 @@ func MainApple() *Apple2 {
a.AddFastChip(*fastChipCardSlot) a.AddFastChip(*fastChipCardSlot)
} }
if *disk2Slot > 0 { if *disk2Slot > 0 {
err := a.AddDisk2(*disk2Slot, *disk2RomFile, *diskImage) err := a.AddDisk2(*disk2Slot, *disk2RomFile, *diskImage, *diskBImage)
if err != nil { if err != nil {
panic(err) panic(err)
} }