-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Screen Dump: Fix corruption of "File" on menu bar
It appears that initializing and other calls to the Super Serial Card firmware while 80-column mode is active causes the text screen to be cleared. MGTK uses that memory for pattern caches which are then corrupted, leading to mispaints if unless GrafPorts are swapped. Work around this by saving/restoring the text page (main and aux) around the SSC usage, and proactively apply the same logic to the Print Catalog accessory. Understanding exactly what causes the SSC to do this would be ideal; I have not spotted the culprit in the firmware. Also note that the issue only occurs with real SSC firmware; the problem reproduces in MAME but not in Virtual ][. Fixes #810
- Loading branch information
1 parent
25431d3
commit 5d54e40
Showing
5 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
;;; ============================================================ | ||
;;; Save/Restore Text Page | ||
;;; | ||
;;; Used in accessories to preserve MGTK caches when operations | ||
;;; might trash the text page (e.g. initializing SSC) | ||
;;; ============================================================ | ||
|
||
;;; Saves text page (except screen holes) | ||
.proc SaveTextPage | ||
lda RD80STORE | ||
pha | ||
sta SET80STORE | ||
|
||
ldx #0 | ||
loop: | ||
.repeat 8, i | ||
sta PAGE2ON | ||
lda $400 + (i*$80),x | ||
sta _textpage_aux_buf + (i*$78),x | ||
sta PAGE2OFF | ||
lda $400 + (i*$80),x | ||
sta _textpage_main_buf + (i*$78),x | ||
.endrepeat | ||
inx | ||
cpx #$78 | ||
jne loop | ||
|
||
pla | ||
bmi :+ | ||
sta CLR80STORE | ||
: rts | ||
.endproc | ||
|
||
;;; Restores text page (except screen holes) | ||
.proc RestoreTextPage | ||
lda RD80STORE | ||
pha | ||
sta SET80STORE | ||
|
||
ldx #0 | ||
loop: | ||
.repeat 8, i | ||
sta PAGE2ON | ||
lda _textpage_aux_buf + (i*$78),x | ||
sta $400 + (i*$80),x | ||
sta PAGE2OFF | ||
lda _textpage_main_buf + (i*$78),x | ||
sta $400 + (i*$80),x | ||
.endrepeat | ||
inx | ||
cpx #$78 | ||
jne loop | ||
|
||
pla | ||
bmi :+ | ||
sta CLR80STORE | ||
: rts | ||
.endproc | ||
|
||
_textpage_main_buf: .res 40*24 | ||
_textpage_aux_buf: .res 40*24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters