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 {EventEmitter} from 'angular2/core'; | |
import {IConsoleService} from './interfaces'; | |
import {Constants} from '../globalConstants'; | |
export class ConsoleService implements IConsoleService { | |
public lines: string[]; | |
public logEvent: EventEmitter<string> = new EventEmitter<string>(); |
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 {Component, Inject, ElementRef} from 'angular2/core'; | |
import {IConsoleService} from '../services/interfaces'; | |
import {ConsoleService} from '../services/consoleService'; | |
@Component({ | |
selector: 'console', | |
templateUrl: 'templates/console.html' | |
}) |
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) => {}; | |
} | |
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
<div class="column"> | |
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" [attr.width]="canvasWidth" [attr.height]="canvasHeight"> | |
<rect x="0" y="0" [attr.width]="canvasWidth" [attr.height]="canvasHeight" | |
style="fill:white;"/> | |
<rect *ngFor="#pixel of pixelBuffer" [attr.x]="pixel.x" [attr.y]="pixel.y" | |
[attr.width]="pixel.width" [attr.height]="pixel.height" [style.fill]="pixel.fill"/> | |
</svg> | |
</div> |
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 {OpCodes} from './opsCodes'; | |
import {IOperation, ICpu} from '../emulator/interfaces'; | |
export class BaseOpCode implements IOperation { | |
constructor( | |
public opName: string, | |
public sizeBytes: number, | |
public addressingMode: number, | |
public opCode: number) { |
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 {Component, Inject} from 'angular2/core'; | |
import {Hexadecimal} from '../pipes/hexadecimal'; | |
import {EightBits} from '../pipes/eightbits'; | |
import {ICpu} from '../emulator/interfaces'; | |
import {Cpu} from '../emulator/cpu'; | |
@Component({ | |
selector: 'cpuStats', |
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
<div class="column"> | |
<table> | |
<tr><th>PC</th><th>SP</th><th>A</th><th>X</th><th>Y</th><td>NV-BDIZC</td><th>Runtime</th><th>IPS</th></tr> | |
<tr> | |
<td>{{cpu.rPC | hexadecimal}}</td> | |
<td>{{cpu.rSP | hexadecimal}}</td> | |
<td>{{cpu.rA | hexadecimal}}</td> | |
<td>{{cpu.rX | hexadecimal}}</td> | |
<td>{{cpu.rY | hexadecimal}}</td> | |
<td>{{cpu.rP | eightbits}}</td> |
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 {beforeEachProviders, it, describe, expect, inject} from '@angular/core/testing'; | |
import {QuotesService} from './quotes.service'; | |
describe('Quotes Service', () => { | |
beforeEachProviders(() => [QuotesService]); | |
it('should return a quote when getQuotes is called', | |
inject([QuotesService], (service: QuotesService) => { | |
var quote = service.getQuote(); |
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 {Injectable} from '@angular/core'; | |
@Injectable() | |
export class QuotesService { | |
public quotes: string[] = | |
[ | |
"This is a Hollywood square.", | |
"Pick me! Ooh, ooh, pick me!", | |
"Are you thinking hard?", | |
"Tap. Tap. Tap.", |
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
it('should set the row and column', inject([], () => { | |
return builder.createAsync(CellComponentTestController) | |
.then((fixture: ComponentFixture<any>) => { | |
fixture.detectChanges(); | |
let query = fixture.debugElement.query(By.directive(CellComponent)); | |
expect(query).toBeTruthy(); | |
expect(query.componentInstance).toBeTruthy(); | |
expect(query.componentInstance.col).toBe(1); | |
expect(query.componentInstance.row).toBe(2); | |
}); |
OlderNewer