Screenmode in debug mode

This commit is contained in:
Ivan Izaguirre 2020-10-16 17:13:14 +02:00 committed by Iván Izaguirre
parent 4ec3bff858
commit 9d4df5b643
5 changed files with 11 additions and 10 deletions

View File

@ -20,6 +20,7 @@ NIB: 35 tracks 6656 bytes, 232960 bytes
*/
// CardDisk2 is a DiskII interface card
type CardDisk2 struct {
cardBase
selected int // q5, Only 0 and 1 supported

View File

@ -81,7 +81,7 @@ func fyneRun(s *state) {
if !s.a.IsPaused() {
var img *image.RGBA
if s.showPages {
img = s.a.SnapshotParts()
img = s.a.SnapshotParts(s.screenMode)
s.win.SetTitle(fmt.Sprintf("%v %v %vx%v", s.a.Name, s.a.VideoModeName(), img.Rect.Dx()/2, img.Rect.Dy()/2))
} else {
img = s.a.Snapshot(s.screenMode)

View File

@ -85,7 +85,7 @@ func sdlRun(a *izapple2.Apple2) {
if !a.IsPaused() {
var img *image.RGBA
if kp.showPages {
img = a.SnapshotParts()
img = a.SnapshotParts(izapple2.ScreenModeNTSC)
window.SetTitle(fmt.Sprintf("%v %v %vx%v", a.Name, a.VideoModeName(), img.Rect.Dx()/2, img.Rect.Dy()/2))
} else {
img = a.Snapshot(izapple2.ScreenModeNTSC)

View File

@ -190,7 +190,7 @@ func (a *Apple2) Snapshot(screenMode int) *image.RGBA {
videoMode := getCurrentVideoMode(a)
snap := snapshotByMode(a, videoMode, screenMode)
if screenMode == ScreenModeNTSC && snap.Bounds().Dy() == hiResHeight {
if screenMode != ScreenModePlain && snap.Bounds().Dy() == hiResHeight {
// Apply the filter to regular CRT snapshots with 192 lines. Not to SHR
snap = linesSeparatedFilter(snap)
}

View File

@ -5,16 +5,16 @@ import (
)
// SnapshotParts the currently visible screen
func (a *Apple2) SnapshotParts() *image.RGBA {
func (a *Apple2) SnapshotParts(screenMode int) *image.RGBA {
videoMode := getCurrentVideoMode(a)
isSecondPage := (videoMode & videoSecondPage) != 0
videoBase := videoMode & videoBaseMask
mixMode := videoMode & videoMixTextMask
modifiers := videoMode & videoModifiersMask
snapScreen := snapshotByMode(a, videoMode, ScreenModePlain)
snapPage1 := snapshotByMode(a, videoMode&^videoSecondPage, ScreenModePlain)
snapPage2 := snapshotByMode(a, videoMode|videoSecondPage, ScreenModePlain)
snapScreen := snapshotByMode(a, videoMode, screenMode)
snapPage1 := snapshotByMode(a, videoMode&^videoSecondPage, screenMode)
snapPage2 := snapshotByMode(a, videoMode|videoSecondPage, screenMode)
var snapAux *image.RGBA
/*
@ -28,11 +28,11 @@ func (a *Apple2) SnapshotParts() *image.RGBA {
} else {
switch mixMode {
case videoMixText80:
snapAux = snapshotByMode(a, videoText80|modifiers, ScreenModePlain)
snapAux = snapshotByMode(a, videoText80|modifiers, screenMode)
case videoMixText40RGB:
snapAux = snapshotByMode(a, videoText40RGB|modifiers, ScreenModePlain)
snapAux = snapshotByMode(a, videoText40RGB|modifiers, screenMode)
default:
snapAux = snapshotByMode(a, videoText40|modifiers, ScreenModePlain)
snapAux = snapshotByMode(a, videoText40|modifiers, screenMode)
}
}