Created
March 19, 2016 20:44
-
-
Save JeremyLikness/7708a43a228112cbf0e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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