2016-01-05 04:16:37 +00:00
|
|
|
//
|
|
|
|
// CSElectron.m
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 04/01/2016.
|
|
|
|
// Copyright © 2016 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "CSElectron.h"
|
|
|
|
|
|
|
|
#import "Electron.hpp"
|
|
|
|
#import "CSMachine+Subclassing.h"
|
|
|
|
|
|
|
|
@implementation CSElectron {
|
|
|
|
Electron::Machine _electron;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)doRunForNumberOfCycles:(int)numberOfCycles {
|
|
|
|
_electron.run_for_cycles(numberOfCycles);
|
|
|
|
}
|
|
|
|
|
2016-01-07 04:14:36 +00:00
|
|
|
- (void)setOSROM:(nonnull NSData *)rom {
|
2016-01-08 02:01:13 +00:00
|
|
|
_electron.set_rom(Electron::ROMSlotOS, rom.length, (const uint8_t *)rom.bytes);
|
2016-01-07 04:14:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setBASICROM:(nonnull NSData *)rom {
|
2016-01-08 02:01:13 +00:00
|
|
|
_electron.set_rom(Electron::ROMSlotBASIC, rom.length, (const uint8_t *)rom.bytes);
|
2016-01-07 04:14:36 +00:00
|
|
|
}
|
|
|
|
|
2016-01-08 03:26:49 +00:00
|
|
|
- (void)setCRTDelegate:(Outputs::CRT::CRTDelegate *)delegate{
|
|
|
|
_electron.get_crt()->set_delegate(delegate);
|
|
|
|
}
|
|
|
|
|
2016-01-05 04:16:37 +00:00
|
|
|
@end
|