2019-06-01 15:11:25 +00:00
|
|
|
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"
|
2019-06-01 15:11:25 +00:00
|
|
|
"os"
|
2019-04-13 18:29:31 +00:00
|
|
|
)
|
2019-02-16 19:15:41 +00:00
|
|
|
|
2019-06-01 15:11:25 +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",
|
2019-06-01 18:06:44 +00:00
|
|
|
"<internal>/Apple2_Plus.rom",
|
2019-04-15 21:13:05 +00:00
|
|
|
"main rom file")
|
|
|
|
disk2RomFile := flag.String(
|
|
|
|
"diskRom",
|
2019-06-01 18:06:44 +00:00
|
|
|
"<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,
|
2019-05-17 21:28:20 +00:00
|
|
|
"slot for the disk driver. -1 for none.")
|
2019-04-15 21:13:05 +00:00
|
|
|
diskImage := flag.String(
|
|
|
|
"disk",
|
2019-06-01 18:06:44 +00:00
|
|
|
"<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",
|
2019-06-01 15:11:25 +00:00
|
|
|
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",
|
2019-06-01 18:06:44 +00:00
|
|
|
"<internal>/Apple2rev7CharGen.rom",
|
2019-04-21 16:18:43 +00:00
|
|
|
"rom file for the disk drive controller")
|
2019-05-17 21:28:20 +00:00
|
|
|
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.",
|
|
|
|
)
|
2019-05-10 16:07:36 +00:00
|
|
|
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,
|
2019-05-03 20:00:48 +00:00
|
|
|
"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 {
|
2019-06-01 15:11:25 +00:00
|
|
|
cg := NewCharacterGenerator(*charRomFile)
|
2019-04-21 16:18:43 +00:00
|
|
|
cg.Dump()
|
2019-06-01 15:11:25 +00:00
|
|
|
os.Exit(0)
|
|
|
|
return nil
|
2019-04-21 16:18:43 +00:00
|
|
|
}
|
|
|
|
|
2019-06-01 15:11:25 +00:00
|
|
|
a := NewApple2(*romFile, *charRomFile, *cpuClock, !*mono, *fastDisk, *panicSS)
|
2019-05-17 21:28:20 +00:00
|
|
|
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)
|
|
|
|
|
2019-06-01 15:11:25 +00:00
|
|
|
return a
|
2019-01-26 17:57:03 +00:00
|
|
|
}
|