2021-03-06 23:04:13 +00:00
|
|
|
import { MemoryPages, Restorable, byte, memory } from './types';
|
2021-02-22 02:38:21 +00:00
|
|
|
|
|
|
|
export type bank = 0 | 1;
|
|
|
|
export type pageNo = 1 | 2;
|
|
|
|
|
|
|
|
export interface Region {
|
|
|
|
top: number,
|
|
|
|
bottom: number,
|
|
|
|
left: number,
|
|
|
|
right: number,
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GraphicsState {
|
|
|
|
page: byte;
|
|
|
|
mono: boolean;
|
2021-02-28 03:17:36 +00:00
|
|
|
buffer: memory[];
|
2021-02-22 02:38:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface VideoModesState {
|
|
|
|
grs: [gr1: GraphicsState, gr2: GraphicsState],
|
|
|
|
hgrs: [hgr1: GraphicsState, hgr2: GraphicsState],
|
|
|
|
textMode: boolean,
|
|
|
|
mixedMode: boolean,
|
|
|
|
hiresMode: boolean,
|
|
|
|
pageMode: pageNo,
|
|
|
|
_80colMode: boolean,
|
|
|
|
altCharMode: boolean,
|
|
|
|
an3: boolean,
|
|
|
|
}
|
|
|
|
|
2021-03-06 23:04:13 +00:00
|
|
|
export interface VideoPage extends MemoryPages, Restorable<GraphicsState> {
|
2021-02-22 02:38:21 +00:00
|
|
|
imageData: ImageData
|
|
|
|
dirty: Region;
|
|
|
|
|
2021-03-06 23:04:13 +00:00
|
|
|
bank0(): MemoryPages
|
|
|
|
bank1(): MemoryPages
|
2021-02-22 02:38:21 +00:00
|
|
|
|
|
|
|
mono: (on: boolean) => void
|
|
|
|
refresh: () => void
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface LoresPage extends VideoPage {
|
|
|
|
getText: () => string
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface HiresPage extends VideoPage {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface VideoModes extends Restorable<VideoModesState> {
|
|
|
|
page(pageNo: number): void
|
|
|
|
|
|
|
|
blit(altData?: ImageData): boolean
|
|
|
|
|
|
|
|
reset(): void
|
|
|
|
|
|
|
|
_80col(on: boolean): void
|
|
|
|
altchar(on: boolean): void
|
|
|
|
doubleHires(on: boolean): void
|
|
|
|
enhanced(on: boolean): void
|
|
|
|
|
|
|
|
is80Col(): boolean
|
|
|
|
isAltChar(): boolean
|
|
|
|
isDoubleHires(): boolean
|
|
|
|
isHires(): boolean
|
|
|
|
isMixed(): boolean
|
|
|
|
isPage2(): boolean
|
|
|
|
isText(): boolean
|
|
|
|
}
|