mirror of
https://github.com/whscullin/apple2js.git
synced 2024-01-12 14:14:38 +00:00
Guard against videomode DOS
This commit is contained in:
parent
90fc5fb7fc
commit
bf67d9dca4
12
js/canvas.ts
12
js/canvas.ts
@ -903,6 +903,7 @@ export class VideoModes2D implements VideoModes {
|
||||
private _context: CanvasRenderingContext2D | null;
|
||||
private _left: number;
|
||||
private _top: number;
|
||||
private _refreshFlag: boolean = true;
|
||||
|
||||
public ready = Promise.resolve();
|
||||
|
||||
@ -928,10 +929,7 @@ export class VideoModes2D implements VideoModes {
|
||||
mixedDHRMode = this._flag == 2 && doubleHiresMode;
|
||||
monoDHRMode = this._flag == 3 && doubleHiresMode;
|
||||
|
||||
this._grs[0].refresh();
|
||||
this._grs[1].refresh();
|
||||
this._hgrs[0].refresh();
|
||||
this._hgrs[1].refresh();
|
||||
this._refreshFlag = true;
|
||||
}
|
||||
|
||||
refresh() {
|
||||
@ -1092,6 +1090,12 @@ export class VideoModes2D implements VideoModes {
|
||||
const hgr = this._hgrs[pageMode - 1];
|
||||
const gr = this._grs[pageMode - 1];
|
||||
|
||||
if (this._refreshFlag) {
|
||||
hgr.refresh();
|
||||
gr.refresh();
|
||||
this._refreshFlag = false;
|
||||
}
|
||||
|
||||
if (altData) {
|
||||
blitted = this.updateImage(
|
||||
altData,
|
||||
|
12
js/gl.ts
12
js/gl.ts
@ -603,6 +603,7 @@ export class VideoModesGL implements VideoModes {
|
||||
private _displayConfig: screenEmu.DisplayConfiguration;
|
||||
private _monoMode: boolean = false;
|
||||
private _scanlines: boolean = false;
|
||||
private _refreshFlag: boolean = true;
|
||||
|
||||
public ready: Promise<void>
|
||||
|
||||
@ -663,10 +664,7 @@ export class VideoModesGL implements VideoModes {
|
||||
private _refresh() {
|
||||
doubleHiresMode = !an3 && hiresMode && _80colMode;
|
||||
|
||||
this._grs[0].refresh();
|
||||
this._grs[1].refresh();
|
||||
this._hgrs[0].refresh();
|
||||
this._hgrs[1].refresh();
|
||||
this._refreshFlag = true;
|
||||
|
||||
if (this._displayConfig) {
|
||||
this._displayConfig.videoWhiteOnly = textMode || this._monoMode;
|
||||
@ -817,6 +815,12 @@ export class VideoModesGL implements VideoModes {
|
||||
const hgr = this._hgrs[pageMode - 1];
|
||||
const gr = this._grs[pageMode - 1];
|
||||
|
||||
if (this._refreshFlag) {
|
||||
hgr.refresh();
|
||||
gr.refresh();
|
||||
this._refreshFlag = false;
|
||||
}
|
||||
|
||||
if (altData) {
|
||||
blitted = this.updateImage(
|
||||
altData,
|
||||
|
Loading…
Reference in New Issue
Block a user