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 _context: CanvasRenderingContext2D | null;
|
||||||
private _left: number;
|
private _left: number;
|
||||||
private _top: number;
|
private _top: number;
|
||||||
|
private _refreshFlag: boolean = true;
|
||||||
|
|
||||||
public ready = Promise.resolve();
|
public ready = Promise.resolve();
|
||||||
|
|
||||||
@ -928,10 +929,7 @@ export class VideoModes2D implements VideoModes {
|
|||||||
mixedDHRMode = this._flag == 2 && doubleHiresMode;
|
mixedDHRMode = this._flag == 2 && doubleHiresMode;
|
||||||
monoDHRMode = this._flag == 3 && doubleHiresMode;
|
monoDHRMode = this._flag == 3 && doubleHiresMode;
|
||||||
|
|
||||||
this._grs[0].refresh();
|
this._refreshFlag = true;
|
||||||
this._grs[1].refresh();
|
|
||||||
this._hgrs[0].refresh();
|
|
||||||
this._hgrs[1].refresh();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh() {
|
refresh() {
|
||||||
@ -1092,6 +1090,12 @@ export class VideoModes2D implements VideoModes {
|
|||||||
const hgr = this._hgrs[pageMode - 1];
|
const hgr = this._hgrs[pageMode - 1];
|
||||||
const gr = this._grs[pageMode - 1];
|
const gr = this._grs[pageMode - 1];
|
||||||
|
|
||||||
|
if (this._refreshFlag) {
|
||||||
|
hgr.refresh();
|
||||||
|
gr.refresh();
|
||||||
|
this._refreshFlag = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (altData) {
|
if (altData) {
|
||||||
blitted = this.updateImage(
|
blitted = this.updateImage(
|
||||||
altData,
|
altData,
|
||||||
|
12
js/gl.ts
12
js/gl.ts
@ -603,6 +603,7 @@ export class VideoModesGL implements VideoModes {
|
|||||||
private _displayConfig: screenEmu.DisplayConfiguration;
|
private _displayConfig: screenEmu.DisplayConfiguration;
|
||||||
private _monoMode: boolean = false;
|
private _monoMode: boolean = false;
|
||||||
private _scanlines: boolean = false;
|
private _scanlines: boolean = false;
|
||||||
|
private _refreshFlag: boolean = true;
|
||||||
|
|
||||||
public ready: Promise<void>
|
public ready: Promise<void>
|
||||||
|
|
||||||
@ -663,10 +664,7 @@ export class VideoModesGL implements VideoModes {
|
|||||||
private _refresh() {
|
private _refresh() {
|
||||||
doubleHiresMode = !an3 && hiresMode && _80colMode;
|
doubleHiresMode = !an3 && hiresMode && _80colMode;
|
||||||
|
|
||||||
this._grs[0].refresh();
|
this._refreshFlag = true;
|
||||||
this._grs[1].refresh();
|
|
||||||
this._hgrs[0].refresh();
|
|
||||||
this._hgrs[1].refresh();
|
|
||||||
|
|
||||||
if (this._displayConfig) {
|
if (this._displayConfig) {
|
||||||
this._displayConfig.videoWhiteOnly = textMode || this._monoMode;
|
this._displayConfig.videoWhiteOnly = textMode || this._monoMode;
|
||||||
@ -817,6 +815,12 @@ export class VideoModesGL implements VideoModes {
|
|||||||
const hgr = this._hgrs[pageMode - 1];
|
const hgr = this._hgrs[pageMode - 1];
|
||||||
const gr = this._grs[pageMode - 1];
|
const gr = this._grs[pageMode - 1];
|
||||||
|
|
||||||
|
if (this._refreshFlag) {
|
||||||
|
hgr.refresh();
|
||||||
|
gr.refresh();
|
||||||
|
this._refreshFlag = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (altData) {
|
if (altData) {
|
||||||
blitted = this.updateImage(
|
blitted = this.updateImage(
|
||||||
altData,
|
altData,
|
||||||
|
Loading…
Reference in New Issue
Block a user