mirror of
https://github.com/whscullin/apple1js.git
synced 2025-01-02 12:30:05 +00:00
Enable strict
This commit is contained in:
parent
88bd7836bc
commit
0216e75e7f
@ -22,8 +22,8 @@ import type { byte } from './types';
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export class TextPage {
|
export class TextPage {
|
||||||
_page: ImageData;
|
_page: ImageData | undefined;
|
||||||
_context: CanvasRenderingContext2D;
|
_context: CanvasRenderingContext2D | undefined;
|
||||||
|
|
||||||
_buffer: byte[][] = [];
|
_buffer: byte[][] = [];
|
||||||
_greenMode = false;
|
_greenMode = false;
|
||||||
@ -98,6 +98,9 @@ export class TextPage {
|
|||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
writeAt(row: byte, col: byte, val: byte): void {
|
writeAt(row: byte, col: byte, val: byte): void {
|
||||||
|
if (!this._page) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this._buffer[row][col] = val;
|
this._buffer[row][col] = val;
|
||||||
const data = this._page.data;
|
const data = this._page.data;
|
||||||
let color;
|
let color;
|
||||||
@ -169,6 +172,9 @@ export class TextPage {
|
|||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
blit() {
|
blit() {
|
||||||
|
if (!this._page || !this._context) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this._dirty) {
|
if (this._dirty) {
|
||||||
this._context.putImageData(
|
this._context.putImageData(
|
||||||
this._page,
|
this._page,
|
||||||
|
1056
js/cpu6502.ts
1056
js/cpu6502.ts
File diff suppressed because it is too large
Load Diff
@ -214,19 +214,17 @@ export class KeyBoard {
|
|||||||
return span;
|
return span;
|
||||||
}
|
}
|
||||||
|
|
||||||
const _mouseup = (
|
const _mouseup = (event: Event) => {
|
||||||
event: MouseEvent & {
|
if (!(event.currentTarget instanceof HTMLElement)) {
|
||||||
currentTarget: HTMLElement;
|
return;
|
||||||
}
|
}
|
||||||
) => {
|
|
||||||
event.currentTarget.classList.remove('pressed');
|
event.currentTarget.classList.remove('pressed');
|
||||||
};
|
};
|
||||||
|
|
||||||
const _mousedown = (
|
const _mousedown = (event: Event) => {
|
||||||
event: MouseEvent & {
|
if (!(event.currentTarget instanceof HTMLElement)) {
|
||||||
currentTarget: HTMLElement;
|
return;
|
||||||
}
|
}
|
||||||
) => {
|
|
||||||
event.currentTarget.classList.add('pressed');
|
event.currentTarget.classList.add('pressed');
|
||||||
let key = event.currentTarget.dataset[this.shifted ? 'key2' : 'key1'];
|
let key = event.currentTarget.dataset[this.shifted ? 'key2' : 'key1'];
|
||||||
if (!key) {
|
if (!key) {
|
||||||
@ -262,7 +260,7 @@ export class KeyBoard {
|
|||||||
case 'SHIFT':
|
case 'SHIFT':
|
||||||
this.shifted = !this.shifted;
|
this.shifted = !this.shifted;
|
||||||
this.kb
|
this.kb
|
||||||
.querySelectorAll('.key-SHIFT')
|
.querySelectorAll<HTMLElement>('.key-SHIFT')
|
||||||
.forEach(function (el: HTMLElement) {
|
.forEach(function (el: HTMLElement) {
|
||||||
el.classList.toggle('active');
|
el.classList.toggle('active');
|
||||||
});
|
});
|
||||||
|
@ -8,15 +8,13 @@
|
|||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"target": "es6",
|
"target": "es6",
|
||||||
"lib": ["DOM", "ES6"],
|
"lib": ["DOM", "ES6"],
|
||||||
"noImplicitAny": true,
|
"strict": true,
|
||||||
"noImplicitThis": true,
|
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true,
|
||||||
"exactOptionalPropertyTypes": true,
|
"exactOptionalPropertyTypes": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"strictNullChecks": true,
|
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
|
Loading…
Reference in New Issue
Block a user