-
Notifications
You must be signed in to change notification settings - Fork 10
/
softVideoSwitch.go
50 lines (39 loc) · 930 Bytes
/
softVideoSwitch.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package izapple2
import (
"image"
"image/color"
)
/*
Videx Soft Video Switch
See:
https://archive.org/details/videx-soft-video-switch
*/
// SoftVideoSwitch represents a Videx soft video switch
type SoftVideoSwitch struct {
card *CardVidex
forced bool
}
// NewSoftVideoSwitch creates a new SoftVideoSwitch
func NewSoftVideoSwitch(card *CardVidex, force bool) *SoftVideoSwitch {
var vs SoftVideoSwitch
vs.card = card
vs.forced = force
return &vs
}
func (vs *SoftVideoSwitch) isActive() bool {
if vs == nil {
return false
}
if vs.forced {
return true
}
isTextMode := vs.card.a.io.isSoftSwitchActive(ioFlagText)
ann0 := vs.card.a.io.isSoftSwitchActive(ioFlagAnnunciator0)
return isTextMode && ann0
}
func (vs *SoftVideoSwitch) BuildAlternateImage(light color.Color) *image.RGBA {
return vs.card.buildImage(light)
}
func (a *Apple2) SoftVideoSwitch() *SoftVideoSwitch {
return a.softVideoSwitch
}