2021-05-25 19:08:10 +00:00
|
|
|
import { MemoryPages, Restorable, memory } from './types';
|
2021-02-22 02:38:21 +00:00
|
|
|
|
|
|
|
export type bank = 0 | 1;
|
|
|
|
export type pageNo = 1 | 2;
|
|
|
|
|
|
|
|
export interface Region {
|
2022-05-10 15:04:20 +00:00
|
|
|
top: number;
|
|
|
|
bottom: number;
|
|
|
|
left: number;
|
|
|
|
right: number;
|
2021-02-22 02:38:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface GraphicsState {
|
2021-02-28 03:17:36 +00:00
|
|
|
buffer: memory[];
|
2021-02-22 02:38:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface VideoModesState {
|
2022-05-10 15:04:20 +00:00
|
|
|
grs: [gr1: GraphicsState, gr2: GraphicsState];
|
|
|
|
hgrs: [hgr1: GraphicsState, hgr2: GraphicsState];
|
|
|
|
textMode: boolean;
|
|
|
|
mixedMode: boolean;
|
|
|
|
hiresMode: boolean;
|
|
|
|
pageMode: pageNo;
|
|
|
|
_80colMode: boolean;
|
|
|
|
altCharMode: boolean;
|
|
|
|
an3State: boolean;
|
|
|
|
flag: number;
|
2021-02-22 02:38:21 +00:00
|
|
|
}
|
|
|
|
|
2021-03-06 23:04:13 +00:00
|
|
|
export interface VideoPage extends MemoryPages, Restorable<GraphicsState> {
|
2022-05-10 15:04:20 +00:00
|
|
|
imageData: ImageData;
|
2021-02-22 02:38:21 +00:00
|
|
|
dirty: Region;
|
|
|
|
|
2022-05-10 15:04:20 +00:00
|
|
|
bank0(): MemoryPages;
|
|
|
|
bank1(): MemoryPages;
|
2021-02-22 02:38:21 +00:00
|
|
|
|
2022-05-10 15:04:20 +00:00
|
|
|
refresh: () => void;
|
2021-02-22 02:38:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface LoresPage extends VideoPage {
|
2022-05-10 15:04:20 +00:00
|
|
|
getText: () => string;
|
2021-02-22 02:38:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface HiresPage extends VideoPage {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface VideoModes extends Restorable<VideoModesState> {
|
2022-05-10 15:04:20 +00:00
|
|
|
textMode: boolean;
|
|
|
|
mixedMode: boolean;
|
|
|
|
hiresMode: boolean;
|
|
|
|
pageMode: pageNo;
|
|
|
|
_80colMode: boolean;
|
|
|
|
altCharMode: boolean;
|
|
|
|
an3State: boolean;
|
|
|
|
doubleHiresMode: boolean;
|
|
|
|
|
|
|
|
flag: number;
|
|
|
|
monoMode: boolean;
|
2021-05-25 19:08:10 +00:00
|
|
|
|
|
|
|
context: CanvasRenderingContext2D;
|
|
|
|
|
2022-05-10 15:04:20 +00:00
|
|
|
page(pageNo: number): void;
|
2021-02-22 02:38:21 +00:00
|
|
|
|
2022-05-10 15:04:20 +00:00
|
|
|
blit(altData?: ImageData): boolean;
|
2021-02-22 02:38:21 +00:00
|
|
|
|
2022-05-10 15:04:20 +00:00
|
|
|
reset(): void;
|
2021-02-22 02:38:21 +00:00
|
|
|
|
2022-05-10 15:04:20 +00:00
|
|
|
setLoresPage(page: pageNo, lores: LoresPage): void;
|
|
|
|
setHiresPage(page: pageNo, lores: HiresPage): void;
|
2021-05-25 19:08:10 +00:00
|
|
|
|
2022-05-10 15:04:20 +00:00
|
|
|
_80col(on: boolean): void;
|
|
|
|
altChar(on: boolean): void;
|
|
|
|
an3(on: boolean): void;
|
|
|
|
doubleHires(on: boolean): void;
|
|
|
|
hires(on: boolean): void;
|
|
|
|
mixed(on: boolean): void;
|
|
|
|
text(on: boolean): void;
|
2021-02-22 02:38:21 +00:00
|
|
|
|
2022-05-10 15:04:20 +00:00
|
|
|
is80Col(): boolean;
|
|
|
|
isAltChar(): boolean;
|
|
|
|
isDoubleHires(): boolean;
|
|
|
|
isHires(): boolean;
|
|
|
|
isMixed(): boolean;
|
|
|
|
isPage2(): boolean;
|
|
|
|
isText(): boolean;
|
2021-03-31 00:27:44 +00:00
|
|
|
|
2022-05-10 15:04:20 +00:00
|
|
|
mono(on: boolean): void;
|
|
|
|
scanlines(on: boolean): void;
|
2021-03-31 00:27:44 +00:00
|
|
|
|
2022-05-10 15:04:20 +00:00
|
|
|
getText(): string;
|
2021-03-31 00:27:44 +00:00
|
|
|
|
2022-05-10 15:04:20 +00:00
|
|
|
ready: Promise<void>;
|
2021-02-22 02:38:21 +00:00
|
|
|
}
|