This commit is contained in:
Will Scullin 2023-08-19 15:07:00 -07:00
parent 0216e75e7f
commit f7ba798bba
No known key found for this signature in database
GPG Key ID: 26DCD1042C6638CD
11 changed files with 1083 additions and 523 deletions

View File

@ -1,27 +1,19 @@
{
// Global
"root": true,
"plugins": [
"prettier"
],
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:jest/recommended"
],
"globals": {
"tapes": "writable"
},
"rules": {
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
"quotes": [
"error",
"single",
{ "avoidEscape": true }
],
"linebreak-style": [
"error",
"unix"
@ -45,6 +37,7 @@
]
}
],
"prettier/prettier": "error",
// Jest configuration
"jest/expect-expect": [
"error",

View File

@ -143,7 +143,7 @@ export function doLoadLocal(files: FileList) {
},
function () {
window.alert('Unable to read tape file: ' + file.name);
}
},
)
.catch(console.error);
};

View File

@ -6,7 +6,7 @@ const B64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
export function base64_encode(data: null | undefined): undefined;
export function base64_encode(data: memory): string;
export function base64_encode(
data: memory | null | undefined
data: memory | null | undefined,
): string | undefined {
// Twacked by Will Scullin to handle arrays of 'bytes'
@ -82,7 +82,7 @@ export function base64_decode(data: null | undefined): undefined;
export function base64_decode(data: string): memory;
/** Returns an array of bytes from the given base64-encoded string. */
export function base64_decode(
data: string | null | undefined
data: string | null | undefined,
): memory | undefined {
// Twacked by Will Scullin to handle arrays of 'bytes'

View File

@ -183,7 +183,7 @@ export class TextPage {
0,
0,
7 * 40 * 2,
8 * 24 * 2
8 * 24 * 2,
);
}
}

View File

@ -38,7 +38,10 @@ export default class ACI {
_beKind = false;
_progress = 0;
constructor(private cpu: CPU6502, private cb: ACICallback) {
constructor(
private cpu: CPU6502,
private cb: ACICallback,
) {
this._last = cpu.getCycles();
this._next = this._last;
}

View File

@ -1,3 +1,15 @@
/*
* Copyright 2010-2023 Will Scullin <scullin@scullinsteel.com>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation. No representations are made about the suitability of this
* software for any purpose. It is provided "as is" without express or
* implied warranty.
*/
import { Memory, MemberOf, MemoryPages, byte, word } from './types';
import { toHex } from './util';
@ -124,7 +136,7 @@ interface ResettablePageHandler extends MemoryPages {
}
function isResettablePageHandler(
pageHandler: MemoryPages | ResettablePageHandler
pageHandler: MemoryPages | ResettablePageHandler,
): pageHandler is ResettablePageHandler {
return (pageHandler as ResettablePageHandler).reset !== undefined;
}

View File

@ -1,3 +1,3 @@
import * as Apple1 from './apple1';
import * as Apple1 from "./apple1";
window.Apple1 = Apple1;

View File

@ -22,7 +22,10 @@ export interface RAMState {
export default class RAM {
mem: Uint8Array | byte[];
constructor(private start_page: byte, private end_page: byte) {
constructor(
private start_page: byte,
private end_page: byte,
) {
this.mem = allocMemPages(end_page - start_page + 1);
for (let page = 0; page <= end_page; page++) {

View File

@ -175,7 +175,7 @@ export class KeyBoard {
id: string,
private cpu: CPU6502,
private io: Apple1IO,
private text: TextPage
private text: TextPage,
) {
this.kb = document.querySelector<HTMLDivElement>(id)!;
}

1549
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -30,10 +30,13 @@
"@babel/preset-env": "^7.4.2",
"@types/micromodal": "^0.3.3",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@types/jest": "^29.5.3",
"ajv": "^6.9.2",
"babel-jest": "^29.5.0",
"eslint": "^8.3.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.5.0",
"node-forge": "^1.3.0",
"ts-jest": "^29.1.1",
@ -44,7 +47,6 @@
"webpack-dev-server": "^4.6.0"
},
"dependencies": {
"@types/jest": "^29.5.3",
"micromodal": "^0.4.9"
}
}