mirror of
https://github.com/ksherlock/ample.git
synced 2025-02-21 07:29:14 +00:00
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_3_5;
|
||||
unsigned pseudo_disk;
|
||||
unsigned bitbanger;
|
||||
} Media;
|
||||
|
||||
struct Media MediaFromDictionary(NSDictionary *);
|
||||
|
@ -22,6 +22,7 @@ struct Media MediaFromDictionary(NSDictionary *dict) {
|
||||
_(floppy_3_5);
|
||||
_(floppy_5_25);
|
||||
_(pseudo_disk);
|
||||
_(bitbanger);
|
||||
|
||||
return m;
|
||||
#undef _
|
||||
@ -38,6 +39,7 @@ void MediaAdd(Media *dest, const Media *src) {
|
||||
_(floppy_3_5);
|
||||
_(floppy_5_25);
|
||||
_(pseudo_disk);
|
||||
_(bitbanger);
|
||||
#undef _
|
||||
}
|
||||
|
||||
@ -53,6 +55,7 @@ BOOL MediaEqual(const Media *lhs, const Media *rhs) {
|
||||
_(floppy_3_5);
|
||||
_(floppy_5_25);
|
||||
_(pseudo_disk);
|
||||
_(bitbanger);
|
||||
return YES;
|
||||
#undef _
|
||||
}
|
||||
|
@ -179,6 +179,8 @@
|
||||
|
||||
@implementation MediaItem
|
||||
|
||||
|
||||
|
||||
-(instancetype)initWithURL: (NSURL *)url {
|
||||
[self setUrl: url];
|
||||
return self;
|
||||
@ -219,7 +221,7 @@
|
||||
@end
|
||||
|
||||
|
||||
#define CATEGORY_COUNT 6
|
||||
#define CATEGORY_COUNT 7
|
||||
#define SIZEOF(x) (sizeof(x) / sizeof(x[0]))
|
||||
|
||||
@interface MediaViewController () {
|
||||
@ -242,6 +244,7 @@ enum {
|
||||
kIndexCDROM,
|
||||
kIndexCassette,
|
||||
kIndexDiskImage,
|
||||
kIndexBitBanger,
|
||||
};
|
||||
|
||||
|
||||
@ -258,6 +261,7 @@ enum {
|
||||
_data[kIndexCDROM] = [MediaCategory categoryWithTitle: @"CD-ROMs"];
|
||||
_data[kIndexCassette] = [MediaCategory categoryWithTitle: @"Cassettes"];
|
||||
_data[kIndexDiskImage] = [MediaCategory categoryWithTitle: @"Hard Disk Images"]; // Mac Nubus psuedo image device
|
||||
_data[kIndexBitBanger] = [MediaCategory categoryWithTitle: @"Serial Bit Banger"]; // null_modem
|
||||
|
||||
_root = @[];
|
||||
|
||||
@ -268,7 +272,7 @@ enum {
|
||||
-(void)rebuildArgs {
|
||||
|
||||
static char* prefix[] = {
|
||||
"flop", "flop", "hard", "cdrm", "cass", "disk"
|
||||
"flop", "flop", "hard", "cdrm", "cass", "disk", "bitb",
|
||||
};
|
||||
static_assert(SIZEOF(prefix) == CATEGORY_COUNT, "Missing item");
|
||||
NSMutableArray *args = [NSMutableArray new];
|
||||
@ -337,6 +341,7 @@ x = media.name; cat = _data[index]; delta |= [cat setItemCount: x]
|
||||
_(floppy_3_5, kIndexFloppy35);
|
||||
_(floppy_5_25, kIndexFloppy525);
|
||||
_(pseudo_disk, kIndexDiskImage);
|
||||
_(bitbanger, kIndexBitBanger);
|
||||
|
||||
|
||||
if (delta) {
|
||||
|
@ -485,6 +485,7 @@ https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/KeyVa
|
||||
_(floppy_3_5);
|
||||
_(floppy_5_25);
|
||||
_(pseudo_disk);
|
||||
_(bitbanger);
|
||||
#undef _
|
||||
|
||||
for (Slot *s in _children) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user