preview emulation uses TV spec from command line option

this fixes a problem where some ROMs when given the command line
directive to use the PAL spec is contradicted by the preview emulation.
this seems to be a particular problem with PAL ROMs that never set a
valid VSYNC signal. Nightstalker is a good example of such a ROM
This commit is contained in:
JetSetIlly 2024-05-18 16:57:47 +01:00
parent f9cdb366dd
commit 1c95bc94b8
4 changed files with 9 additions and 4 deletions

View file

@ -374,7 +374,7 @@ func NewDebugger(opts CommandLineOptions, create CreateUserInterface) (*Debugger
}
// create preview emulation
dbg.preview, err = preview.NewEmulation(dbg.vcs.Env.Prefs)
dbg.preview, err = preview.NewEmulation(dbg.vcs.Env.Prefs, opts.Spec)
if err != nil {
return nil, fmt.Errorf("debugger: %w", err)
}

View file

@ -57,6 +57,11 @@ import (
// * bottom of screen needs careful consideration
// - Ladybug
// - Man Goes Down
//
// finally, the following conditions are worth documenting as being important:
//
// * PAL ROMs without VSYNC cannot be sized or changed to the correct spec automatically
// - Nightstalker
type resizer struct {
// candidate top/bottom values for an actual resize.
//

View file

@ -34,11 +34,11 @@ type Emulation struct {
const previewLabel = environment.Label("preview")
// NewEmulation is the preferred method of initialisation for the Emulation type
func NewEmulation(prefs *preferences.Preferences) (*Emulation, error) {
func NewEmulation(prefs *preferences.Preferences, spec string) (*Emulation, error) {
em := &Emulation{}
// the VCS and not referred to directly again
tv, err := television.NewTelevision("AUTO")
tv, err := television.NewTelevision(spec)
if err != nil {
return nil, fmt.Errorf("preview: %w", err)
}

View file

@ -101,7 +101,7 @@ func NewAnim(prefs *preferences.Preferences) (*Anim, error) {
thmb.Reset()
// create preview emulation
thmb.preview, err = preview.NewEmulation(thmb.vcs.Env.Prefs)
thmb.preview, err = preview.NewEmulation(thmb.vcs.Env.Prefs, "AUTO")
if err != nil {
return nil, fmt.Errorf("thumbnailer: %w", err)
}