izapple2/main.go

77 lines
1.6 KiB
Go
Raw Normal View History

2019-01-26 17:57:03 +00:00
package main
2019-04-13 18:29:31 +00:00
import (
2019-04-15 21:13:05 +00:00
"flag"
2019-04-13 18:29:31 +00:00
"go6502/apple2"
"go6502/apple2sdl"
)
2019-01-26 17:57:03 +00:00
func main() {
2019-04-15 21:13:05 +00:00
romFile := flag.String(
"rom",
"apple2/romdumps/Apple2_Plus.rom",
"main rom file")
disk2RomFile := flag.String(
"diskRom",
"apple2/romdumps/DISK2.rom",
"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. 0 for none.")
2019-04-15 21:13:05 +00:00
diskImage := flag.String(
"disk",
"../dos33.dsk",
"file to load on the first disk drive")
2019-05-04 17:49:11 +00:00
cpuClock := flag.Float64(
"mhz",
apple2.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",
"apple2/romdumps/Apple2rev7CharGen.rom",
"rom file for the disk drive controller")
2019-04-15 21:13:05 +00:00
useSdl := flag.Bool(
"sdl",
true,
"use SDL")
stdoutScreen := flag.Bool(
"stdout",
false,
"show the text screen on the standard output")
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-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 := apple2.NewCharacterGenerator(*charRomFile)
cg.Dump()
return
}
2019-03-04 23:00:12 +00:00
log := false
2019-05-05 11:25:45 +00:00
a := apple2.NewApple2(*romFile, *charRomFile, *cpuClock, !*mono, *panicSS)
2019-05-09 22:09:15 +00:00
if *disk2Slot > 0 {
a.AddDisk2(*disk2Slot, *disk2RomFile, *diskImage)
}
2019-04-15 21:13:05 +00:00
if *useSdl {
a.ConfigureStdConsole(false, *stdoutScreen)
2019-04-13 18:29:31 +00:00
apple2sdl.SDLRun(a)
} else {
a.ConfigureStdConsole(true, true)
a.Run(log)
2019-04-13 18:29:31 +00:00
}
2019-01-26 17:57:03 +00:00
}