mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-07 23:25:00 +00:00
Cleaned up pre-analysis code.
This commit is contained in:
@@ -1487,13 +1487,13 @@
|
|||||||
4BB73EDC1B587CA500552FC2 /* Machines */ = {
|
4BB73EDC1B587CA500552FC2 /* Machines */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
4B4DC81D1D2C2425003C5BF8 /* Commodore */,
|
|
||||||
4B046DC31CFE651500E9E45E /* CRTMachine.hpp */,
|
|
||||||
4B2E2D961C3A06EC00138695 /* Atari2600 */,
|
|
||||||
4B2E2D9E1C3A070900138695 /* Electron */,
|
|
||||||
4B1E85731D170228001EF87D /* Typer.cpp */,
|
4B1E85731D170228001EF87D /* Typer.cpp */,
|
||||||
4B1E85741D170228001EF87D /* Typer.hpp */,
|
|
||||||
4BA9C3CF1D8164A9002DDB61 /* ConfigurationTarget.hpp */,
|
4BA9C3CF1D8164A9002DDB61 /* ConfigurationTarget.hpp */,
|
||||||
|
4B046DC31CFE651500E9E45E /* CRTMachine.hpp */,
|
||||||
|
4B1E85741D170228001EF87D /* Typer.hpp */,
|
||||||
|
4B2E2D961C3A06EC00138695 /* Atari2600 */,
|
||||||
|
4B4DC81D1D2C2425003C5BF8 /* Commodore */,
|
||||||
|
4B2E2D9E1C3A070900138695 /* Electron */,
|
||||||
);
|
);
|
||||||
name = Machines;
|
name = Machines;
|
||||||
path = ../../Machines;
|
path = ../../Machines;
|
||||||
|
@@ -30,11 +30,6 @@ typedef NS_ENUM(NSInteger, CSVic20MemorySize)
|
|||||||
- (void)setCharactersROM:(nonnull NSData *)rom;
|
- (void)setCharactersROM:(nonnull NSData *)rom;
|
||||||
- (void)setDriveROM:(nonnull NSData *)rom;
|
- (void)setDriveROM:(nonnull NSData *)rom;
|
||||||
|
|
||||||
- (BOOL)openPRGAtURL:(nonnull NSURL *)URL;
|
|
||||||
- (BOOL)openTAPAtURL:(nonnull NSURL *)URL;
|
|
||||||
- (BOOL)openG64AtURL:(nonnull NSURL *)URL;
|
|
||||||
- (BOOL)openD64AtURL:(nonnull NSURL *)URL;
|
|
||||||
|
|
||||||
@property (nonatomic, assign) BOOL useFastLoadingHack;
|
@property (nonatomic, assign) BOOL useFastLoadingHack;
|
||||||
@property (nonatomic, assign) BOOL shouldLoadAutomatically;
|
@property (nonatomic, assign) BOOL shouldLoadAutomatically;
|
||||||
@property (nonatomic, assign) CSVic20Region region;
|
@property (nonatomic, assign) CSVic20Region region;
|
||||||
|
@@ -46,54 +46,6 @@ using namespace Commodore::Vic20;
|
|||||||
[self setROM:rom slot:Drive];
|
[self setROM:rom slot:Drive];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)openTAPAtURL:(NSURL *)URL {
|
|
||||||
@synchronized(self) {
|
|
||||||
try {
|
|
||||||
std::shared_ptr<Storage::Tape::CommodoreTAP> tape(new Storage::Tape::CommodoreTAP([URL fileSystemRepresentation]));
|
|
||||||
_vic20.set_tape(tape);
|
|
||||||
return YES;
|
|
||||||
} catch(...) {
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)openG64AtURL:(NSURL *)URL {
|
|
||||||
return [self openDisk:^std::shared_ptr<Storage::Disk::Disk>{
|
|
||||||
return std::shared_ptr<Storage::Disk::Disk>(new Storage::Disk::G64([URL fileSystemRepresentation]));
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)openD64AtURL:(NSURL *)URL {
|
|
||||||
return [self openDisk:^std::shared_ptr<Storage::Disk::Disk>{
|
|
||||||
return std::shared_ptr<Storage::Disk::Disk>(new Storage::Disk::D64([URL fileSystemRepresentation]));
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)openDisk:(std::shared_ptr<Storage::Disk::Disk> (^)())opener {
|
|
||||||
@synchronized(self) {
|
|
||||||
try {
|
|
||||||
std::shared_ptr<Storage::Disk::Disk> disk = opener();
|
|
||||||
_vic20.set_disk(disk);
|
|
||||||
return YES;
|
|
||||||
} catch(...) {
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)openPRGAtURL:(NSURL *)URL {
|
|
||||||
NSData *prg = [NSData dataWithContentsOfURL:URL];
|
|
||||||
@synchronized(self) {
|
|
||||||
try {
|
|
||||||
_vic20.set_prg(URL.fileSystemRepresentation, prg.length, (const uint8_t *)prg.bytes);
|
|
||||||
return YES;
|
|
||||||
} catch(...) {
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)setKey:(uint16_t)key isPressed:(BOOL)isPressed {
|
- (void)setKey:(uint16_t)key isPressed:(BOOL)isPressed {
|
||||||
static NSDictionary<NSNumber *, NSNumber *> *vicKeysByKeys = @{
|
static NSDictionary<NSNumber *, NSNumber *> *vicKeysByKeys = @{
|
||||||
@(VK_ANSI_1): @(Key::Key1), @(VK_ANSI_2): @(Key::Key2),
|
@(VK_ANSI_1): @(Key::Key1), @(VK_ANSI_2): @(Key::Key2),
|
||||||
|
Reference in New Issue
Block a user