mirror of https://github.com/ksherlock/ample.git
bitbanger support for media.
it still needs work to allow sockets and opt-out of disk image drag-and-drop.
This commit is contained in:
parent
a5a6222c9f
commit
4c003007f5
|
@ -17,6 +17,7 @@ typedef struct Media {
|
||||||
unsigned floppy_5_25;
|
unsigned floppy_5_25;
|
||||||
unsigned floppy_3_5;
|
unsigned floppy_3_5;
|
||||||
unsigned pseudo_disk;
|
unsigned pseudo_disk;
|
||||||
|
unsigned bitbanger;
|
||||||
} Media;
|
} Media;
|
||||||
|
|
||||||
struct Media MediaFromDictionary(NSDictionary *);
|
struct Media MediaFromDictionary(NSDictionary *);
|
||||||
|
|
|
@ -22,6 +22,7 @@ struct Media MediaFromDictionary(NSDictionary *dict) {
|
||||||
_(floppy_3_5);
|
_(floppy_3_5);
|
||||||
_(floppy_5_25);
|
_(floppy_5_25);
|
||||||
_(pseudo_disk);
|
_(pseudo_disk);
|
||||||
|
_(bitbanger);
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
#undef _
|
#undef _
|
||||||
|
@ -38,6 +39,7 @@ void MediaAdd(Media *dest, const Media *src) {
|
||||||
_(floppy_3_5);
|
_(floppy_3_5);
|
||||||
_(floppy_5_25);
|
_(floppy_5_25);
|
||||||
_(pseudo_disk);
|
_(pseudo_disk);
|
||||||
|
_(bitbanger);
|
||||||
#undef _
|
#undef _
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,6 +55,7 @@ BOOL MediaEqual(const Media *lhs, const Media *rhs) {
|
||||||
_(floppy_3_5);
|
_(floppy_3_5);
|
||||||
_(floppy_5_25);
|
_(floppy_5_25);
|
||||||
_(pseudo_disk);
|
_(pseudo_disk);
|
||||||
|
_(bitbanger);
|
||||||
return YES;
|
return YES;
|
||||||
#undef _
|
#undef _
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,6 +179,8 @@
|
||||||
|
|
||||||
@implementation MediaItem
|
@implementation MediaItem
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-(instancetype)initWithURL: (NSURL *)url {
|
-(instancetype)initWithURL: (NSURL *)url {
|
||||||
[self setUrl: url];
|
[self setUrl: url];
|
||||||
return self;
|
return self;
|
||||||
|
@ -219,7 +221,7 @@
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
#define CATEGORY_COUNT 6
|
#define CATEGORY_COUNT 7
|
||||||
#define SIZEOF(x) (sizeof(x) / sizeof(x[0]))
|
#define SIZEOF(x) (sizeof(x) / sizeof(x[0]))
|
||||||
|
|
||||||
@interface MediaViewController () {
|
@interface MediaViewController () {
|
||||||
|
@ -242,6 +244,7 @@ enum {
|
||||||
kIndexCDROM,
|
kIndexCDROM,
|
||||||
kIndexCassette,
|
kIndexCassette,
|
||||||
kIndexDiskImage,
|
kIndexDiskImage,
|
||||||
|
kIndexBitBanger,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -258,6 +261,7 @@ enum {
|
||||||
_data[kIndexCDROM] = [MediaCategory categoryWithTitle: @"CD-ROMs"];
|
_data[kIndexCDROM] = [MediaCategory categoryWithTitle: @"CD-ROMs"];
|
||||||
_data[kIndexCassette] = [MediaCategory categoryWithTitle: @"Cassettes"];
|
_data[kIndexCassette] = [MediaCategory categoryWithTitle: @"Cassettes"];
|
||||||
_data[kIndexDiskImage] = [MediaCategory categoryWithTitle: @"Hard Disk Images"]; // Mac Nubus psuedo image device
|
_data[kIndexDiskImage] = [MediaCategory categoryWithTitle: @"Hard Disk Images"]; // Mac Nubus psuedo image device
|
||||||
|
_data[kIndexBitBanger] = [MediaCategory categoryWithTitle: @"Serial Bit Banger"]; // null_modem
|
||||||
|
|
||||||
_root = @[];
|
_root = @[];
|
||||||
|
|
||||||
|
@ -268,7 +272,7 @@ enum {
|
||||||
-(void)rebuildArgs {
|
-(void)rebuildArgs {
|
||||||
|
|
||||||
static char* prefix[] = {
|
static char* prefix[] = {
|
||||||
"flop", "flop", "hard", "cdrm", "cass", "disk"
|
"flop", "flop", "hard", "cdrm", "cass", "disk", "bitb",
|
||||||
};
|
};
|
||||||
static_assert(SIZEOF(prefix) == CATEGORY_COUNT, "Missing item");
|
static_assert(SIZEOF(prefix) == CATEGORY_COUNT, "Missing item");
|
||||||
NSMutableArray *args = [NSMutableArray new];
|
NSMutableArray *args = [NSMutableArray new];
|
||||||
|
@ -337,6 +341,7 @@ x = media.name; cat = _data[index]; delta |= [cat setItemCount: x]
|
||||||
_(floppy_3_5, kIndexFloppy35);
|
_(floppy_3_5, kIndexFloppy35);
|
||||||
_(floppy_5_25, kIndexFloppy525);
|
_(floppy_5_25, kIndexFloppy525);
|
||||||
_(pseudo_disk, kIndexDiskImage);
|
_(pseudo_disk, kIndexDiskImage);
|
||||||
|
_(bitbanger, kIndexBitBanger);
|
||||||
|
|
||||||
|
|
||||||
if (delta) {
|
if (delta) {
|
||||||
|
|
|
@ -485,6 +485,7 @@ https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/KeyVa
|
||||||
_(floppy_3_5);
|
_(floppy_3_5);
|
||||||
_(floppy_5_25);
|
_(floppy_5_25);
|
||||||
_(pseudo_disk);
|
_(pseudo_disk);
|
||||||
|
_(bitbanger);
|
||||||
#undef _
|
#undef _
|
||||||
|
|
||||||
for (Slot *s in _children) {
|
for (Slot *s in _children) {
|
||||||
|
|
Loading…
Reference in New Issue