mirror of
https://github.com/ivanizag/izapple2.git
synced 2025-01-23 05:29:59 +00:00
Screen dumped on the stdout no longer by default
This commit is contained in:
parent
f80b635ff1
commit
240cfbae9b
@ -49,17 +49,24 @@ func (a *Apple2) AddDisk2(diskRomFile string, diskImage string) {
|
||||
}
|
||||
}
|
||||
|
||||
// Run starts the Apple2 emulation
|
||||
func (a *Apple2) Run(log bool, stdinKeyboard bool) {
|
||||
// ConfigureStdConsole uses stdin and stdout to interface with the Apple2
|
||||
func (a *Apple2) ConfigureStdConsole(stdinKeyboard bool, stdoutScreen bool) {
|
||||
if !stdinKeyboard && !stdoutScreen {
|
||||
return
|
||||
}
|
||||
|
||||
// Init frontend
|
||||
fe := newAnsiConsoleFrontend(a, stdinKeyboard)
|
||||
if stdinKeyboard {
|
||||
a.io.setKeyboardProvider(fe)
|
||||
}
|
||||
if !log {
|
||||
if stdoutScreen {
|
||||
go fe.textModeGoRoutine()
|
||||
}
|
||||
}
|
||||
|
||||
// Run starts the Apple2 emulation
|
||||
func (a *Apple2) Run(log bool) {
|
||||
// Start the processor
|
||||
a.cpu.Reset()
|
||||
for {
|
||||
|
@ -23,7 +23,7 @@ func SDLRun(a *apple2.Apple2) {
|
||||
|
||||
kp := newSDLKeyBoard()
|
||||
a.SetKeyboardProvider(&kp)
|
||||
go a.Run(false, false)
|
||||
go a.Run(false)
|
||||
|
||||
running := true
|
||||
for running {
|
||||
|
10
main.go
10
main.go
@ -27,10 +27,14 @@ func main() {
|
||||
"sdl",
|
||||
true,
|
||||
"use SDL")
|
||||
stdoutScreen := flag.Bool(
|
||||
"stdout",
|
||||
false,
|
||||
"show the text screen on the standard output")
|
||||
panicSS := flag.Bool(
|
||||
"panicss",
|
||||
false,
|
||||
"panic if a not implemented softwtich is used")
|
||||
"panic if a not implemented softswitch is used")
|
||||
dumpChars := flag.Bool(
|
||||
"dumpChars",
|
||||
false,
|
||||
@ -56,8 +60,10 @@ func main() {
|
||||
a := apple2.NewApple2(*romFile, *charRomFile, *panicSS)
|
||||
a.AddDisk2(*disk2RomFile, *diskImage)
|
||||
if *useSdl {
|
||||
a.ConfigureStdConsole(false, *stdoutScreen)
|
||||
apple2sdl.SDLRun(a)
|
||||
} else {
|
||||
a.Run(log, true)
|
||||
a.ConfigureStdConsole(true, true)
|
||||
a.Run(log)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user