2017-06-04 17:55:19 -04:00
|
|
|
//
|
|
|
|
// CSZX8081.m
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 04/06/2017.
|
2018-05-13 15:19:52 -04:00
|
|
|
// Copyright 2017 Thomas Harte. All rights reserved.
|
2017-06-04 17:55:19 -04:00
|
|
|
//
|
|
|
|
|
|
|
|
#import "CSZX8081.h"
|
|
|
|
|
|
|
|
#include "ZX8081.hpp"
|
|
|
|
|
|
|
|
@implementation CSZX8081 {
|
2021-03-17 22:40:29 -04:00
|
|
|
Sinclair::ZX8081::Machine *_zx8081;
|
2018-02-12 21:46:21 -05:00
|
|
|
__weak CSMachine *_machine;
|
2017-06-04 17:55:19 -04:00
|
|
|
}
|
|
|
|
|
2018-02-12 21:46:21 -05:00
|
|
|
- (instancetype)initWithZX8081:(void *)zx8081 owner:(CSMachine *)machine {
|
|
|
|
self = [super init];
|
|
|
|
if(self) {
|
2021-03-17 22:40:29 -04:00
|
|
|
_zx8081 = (Sinclair::ZX8081::Machine *)zx8081;
|
2018-02-12 21:46:21 -05:00
|
|
|
_machine = machine;
|
|
|
|
}
|
|
|
|
return self;
|
2017-06-04 17:55:19 -04:00
|
|
|
}
|
|
|
|
|
2017-06-22 20:20:31 -04:00
|
|
|
#pragma mark - Options
|
|
|
|
|
2017-07-08 19:21:12 -04:00
|
|
|
- (void)setTapeIsPlaying:(BOOL)tapeIsPlaying {
|
2018-02-12 21:46:21 -05:00
|
|
|
@synchronized(_machine) {
|
|
|
|
_zx8081->set_tape_is_playing(tapeIsPlaying ? true : false);
|
2017-07-08 19:21:12 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-14 21:46:50 -05:00
|
|
|
- (BOOL)tapeIsPlaying {
|
|
|
|
@synchronized(_machine) {
|
|
|
|
return _zx8081->get_tape_is_playing();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-04 17:55:19 -04:00
|
|
|
@end
|