Skip to content

Commit

Permalink
removed 'simple' television
Browse files Browse the repository at this point in the history
simple was added so that regression database didn't need to change along
with the changes to the television (simple is an older television
implementation rather than anything really new). but now that the
regress package can redux playback files, there is now no need for the
'simple' version
  • Loading branch information
JetSetIlly committed Nov 23, 2024
1 parent e4dea5c commit 6728d37
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 350 deletions.
6 changes: 0 additions & 6 deletions debugger/debugger.go
Original file line number Diff line number Diff line change
Expand Up @@ -1288,8 +1288,6 @@ func (dbg *Debugger) attachCartridge(cartload cartridgeloader.Loader) (e error)
}

func (dbg *Debugger) startRecording(cartShortName string) error {
dbg.vcs.TV.SetSimple(true)

var err error
var recording string
if dbg.opts.RecordFilename == "" {
Expand Down Expand Up @@ -1317,12 +1315,9 @@ func (dbg *Debugger) endRecording() {
if err != nil {
logger.Log(logger.Allow, "debugger", err)
}
dbg.vcs.TV.SetSimple(false)
}

func (dbg *Debugger) startPlayback(filename string) error {
dbg.vcs.TV.SetSimple(true)

plb, err := recorder.NewPlayback(filename, dbg.opts.PlaybackIgnoreDigest)
if err != nil {
return err
Expand Down Expand Up @@ -1363,7 +1358,6 @@ func (dbg *Debugger) endPlayback() {

dbg.playback = nil
dbg.vcs.Input.AttachPlayback(nil)
dbg.vcs.TV.SetSimple(false)
}

func (dbg *Debugger) startComparison(comparisonROM string, comparisonPrefs string) error {
Expand Down
109 changes: 52 additions & 57 deletions gui/sdlimgui/win_prefs_television.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,74 +133,69 @@ func (win *winPrefs) drawVSYNC() {

if imgui.CollapsingHeader("Synchronisation") {
imgui.Spacing()
if win.img.dbg.TV().IsSimple() {
imgui.Text("Television is in 'simple' mode and")
imgui.Text("VSYNC cannot be altered")
} else {
imgui.Text("VSYNC Scanlines Required")
scanlines := int32(win.img.dbg.VCS().Env.Prefs.TV.VSYNCscanlines.Get().(int))
imgui.Text("VSYNC Scanlines Required")
scanlines := int32(win.img.dbg.VCS().Env.Prefs.TV.VSYNCscanlines.Get().(int))

if scanlines == 1 {
label = fmt.Sprintf("%d scanline", scanlines)
} else {
label = fmt.Sprintf("%d scanlines", scanlines)
}
if scanlines == 1 {
label = fmt.Sprintf("%d scanline", scanlines)
} else {
label = fmt.Sprintf("%d scanlines", scanlines)
}

if imgui.SliderIntV("##vsyncScanlines", &scanlines, 0, 4, label, 1.0) {
win.img.dbg.VCS().Env.Prefs.TV.VSYNCscanlines.Set(scanlines)
}
if imgui.SliderIntV("##vsyncScanlines", &scanlines, 0, 4, label, 1.0) {
win.img.dbg.VCS().Env.Prefs.TV.VSYNCscanlines.Set(scanlines)
}

win.img.imguiTooltipSimple(`The number of scanlines for which VSYNC must be enabled
win.img.imguiTooltipSimple(`The number of scanlines for which VSYNC must be enabled
for it to be a valid VSYNC signal`)

imgui.Spacing()
imgui.Text("Speed of Recovery")
recovery := int32(win.img.dbg.VCS().Env.Prefs.TV.VSYNCrecovery.Get().(int))

const (
verySlow = 90
slow = 75
quick = 60
veryQuick = 45
)

if recovery >= verySlow {
recovery = 3
label = fmt.Sprintf("very slow")
} else if recovery >= slow {
recovery = 2
label = fmt.Sprintf("slow")
} else if recovery >= quick {
recovery = 1
label = fmt.Sprintf("quick")
} else if recovery >= veryQuick {
recovery = 0
label = fmt.Sprintf("very quick")
}
imgui.Spacing()
imgui.Text("Speed of Recovery")
recovery := int32(win.img.dbg.VCS().Env.Prefs.TV.VSYNCrecovery.Get().(int))

const (
verySlow = 90
slow = 75
quick = 60
veryQuick = 45
)

if recovery >= verySlow {
recovery = 3
label = fmt.Sprintf("very slow")
} else if recovery >= slow {
recovery = 2
label = fmt.Sprintf("slow")
} else if recovery >= quick {
recovery = 1
label = fmt.Sprintf("quick")
} else if recovery >= veryQuick {
recovery = 0
label = fmt.Sprintf("very quick")
}

if imgui.SliderIntV("##vsyncRecover", &recovery, 0, 3, label, 1.0) {
if recovery >= 3 {
recovery = verySlow
} else if recovery == 2 {
recovery = slow
} else if recovery == 1 {
recovery = quick
} else if recovery == 0 {
recovery = veryQuick
}
win.img.dbg.VCS().Env.Prefs.TV.VSYNCrecovery.Set(recovery)
if imgui.SliderIntV("##vsyncRecover", &recovery, 0, 3, label, 1.0) {
if recovery >= 3 {
recovery = verySlow
} else if recovery == 2 {
recovery = slow
} else if recovery == 1 {
recovery = quick
} else if recovery == 0 {
recovery = veryQuick
}
win.img.dbg.VCS().Env.Prefs.TV.VSYNCrecovery.Set(recovery)
}

win.img.imguiTooltipSimple(`The speed at which the TV synchronises after
win.img.imguiTooltipSimple(`The speed at which the TV synchronises after
receiving a valid VSYNC signal`)

imgui.Spacing()
prefsCheckbox(&win.img.dbg.VCS().Env.Prefs.TV.VSYNCimmediateDesync, "Immediate Dysynchronisation")
win.img.imguiTooltipSimple(`Desynchronise the screen immediately
imgui.Spacing()
prefsCheckbox(&win.img.dbg.VCS().Env.Prefs.TV.VSYNCimmediateDesync, "Immediate Dysynchronisation")
win.img.imguiTooltipSimple(`Desynchronise the screen immediately
when a VSYNC signal is late`)

prefsCheckbox(&win.img.dbg.VCS().Env.Prefs.TV.VSYNCsyncedOnStart, "Synchronised on start")
win.img.imguiTooltipSimple(`The television is synchronised on start`)
}
prefsCheckbox(&win.img.dbg.VCS().Env.Prefs.TV.VSYNCsyncedOnStart, "Synchronised on start")
win.img.imguiTooltipSimple(`The television is synchronised on start`)
}
}
Loading

0 comments on commit 6728d37

Please sign in to comment.