izapple2/apple2main.go

87 lines
1.8 KiB
Go
Raw Normal View History

package apple2
2019-01-26 17:57:03 +00:00
2019-04-13 18:29:31 +00:00
import (
2019-04-15 21:13:05 +00:00
"flag"
"os"
2019-04-13 18:29:31 +00:00
)
// MainApple is a device independant main. Video, keyboard and speaker won't be defined
func MainApple() *Apple2 {
2019-04-15 21:13:05 +00:00
romFile := flag.String(
"rom",
"<internal>/Apple2_Plus.rom",
2019-04-15 21:13:05 +00:00
"main rom file")
disk2RomFile := flag.String(
"diskRom",
"<internal>/DISK2.rom",
2019-04-15 21:13:05 +00:00
"rom file for the disk drive controller")
2019-05-09 22:09:15 +00:00
disk2Slot := flag.Int(
"disk2Slot",
6,
"slot for the disk driver. -1 for none.")
2019-04-15 21:13:05 +00:00
diskImage := flag.String(
"disk",
"<internal>/dos33.dsk",
2019-04-15 21:13:05 +00:00
"file to load on the first disk drive")
2019-05-04 17:49:11 +00:00
cpuClock := flag.Float64(
"mhz",
CpuClockMhz,
2019-05-05 11:25:45 +00:00
"cpu speed in Mhz, use 0 for full speed. Use F5 to toggle.")
2019-04-21 16:18:43 +00:00
charRomFile := flag.String(
"charRom",
"<internal>/Apple2rev7CharGen.rom",
2019-04-21 16:18:43 +00:00
"rom file for the disk drive controller")
languageCardSlot := flag.Int(
"languageCardSlot",
0,
"slot for the 16kb language card. -1 for none")
saturnCardSlot := flag.Int(
"saturnCardSlot",
-1,
"slot for the 256kb Saturn card. -1 for none")
2019-05-05 11:25:45 +00:00
mono := flag.Bool(
"mono",
false,
"emulate a green phosphor monitor instead of a NTSC color TV. Use F6 to toggle.",
)
fastDisk := flag.Bool(
"fastDisk",
true,
"set fast mode when the disks are spinning",
)
2019-04-15 21:13:05 +00:00
panicSS := flag.Bool(
"panicss",
false,
"panic if a not implemented softswitch is used")
2019-04-21 16:18:43 +00:00
dumpChars := flag.Bool(
"dumpChars",
false,
"shows the character map",
)
2019-04-15 21:13:05 +00:00
flag.Parse()
2019-04-21 16:18:43 +00:00
if *dumpChars {
cg := NewCharacterGenerator(*charRomFile)
2019-04-21 16:18:43 +00:00
cg.Dump()
os.Exit(0)
return nil
2019-04-21 16:18:43 +00:00
}
a := NewApple2(*romFile, *charRomFile, *cpuClock, !*mono, *fastDisk, *panicSS)
if *languageCardSlot >= 0 {
a.AddLanguageCard(*languageCardSlot)
}
if *saturnCardSlot >= 0 {
a.AddSaturnCard(*saturnCardSlot)
}
if *disk2Slot >= 0 {
2019-05-09 22:09:15 +00:00
a.AddDisk2(*disk2Slot, *disk2RomFile, *diskImage)
}
2019-05-18 21:40:59 +00:00
//a.AddCardInOut(2)
//a.AddCardLogger(4)
return a
2019-01-26 17:57:03 +00:00
}