Skip to content

Instantly share code, notes, and snippets.

@JeremyLikness
Created March 19, 2016 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeremyLikness/7708a43a228112cbf0e0 to your computer and use it in GitHub Desktop.
Save JeremyLikness/7708a43a228112cbf0e0 to your computer and use it in GitHub Desktop.
import {IDisplayService} from './interfaces';
import {Constants} from '../globalConstants';
export class DisplayService implements IDisplayService {
constructor() {
this.pixels = new Array<number>(Constants.Display.Size);
this.callback = (address: number, value: number) => {};
}
public pixels: number[];
public callback: (address: number, value: number) => void;
public draw(address: number, value: number): void {
var target: number = address & Constants.Display.Max;
this.pixels[target] = value & Constants.Memory.ByteMask;
this.callback(address, value);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment