From 9d4df5b6430754a880e13605b22462a286d07720 Mon Sep 17 00:00:00 2001 From: Ivan Izaguirre Date: Fri, 16 Oct 2020 17:13:14 +0200 Subject: [PATCH] Screenmode in debug mode --- cardDisk2.go | 1 + izapple2fyne/main.go | 2 +- izapple2sdl/main.go | 2 +- screen.go | 2 +- screenDebugParts.go | 14 +++++++------- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/cardDisk2.go b/cardDisk2.go index 8a9cfcf..e666b23 100644 --- a/cardDisk2.go +++ b/cardDisk2.go @@ -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 diff --git a/izapple2fyne/main.go b/izapple2fyne/main.go index 144195e..9dd279b 100644 --- a/izapple2fyne/main.go +++ b/izapple2fyne/main.go @@ -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) diff --git a/izapple2sdl/main.go b/izapple2sdl/main.go index 15923f6..85d0123 100644 --- a/izapple2sdl/main.go +++ b/izapple2sdl/main.go @@ -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) diff --git a/screen.go b/screen.go index 9998d1f..7d6acc6 100644 --- a/screen.go +++ b/screen.go @@ -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) } diff --git a/screenDebugParts.go b/screenDebugParts.go index 3874500..c7bc632 100644 --- a/screenDebugParts.go +++ b/screenDebugParts.go @@ -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) } }