diff --git a/Ample/Slot.h b/Ample/Slot.h index 952b6c7..6302136 100644 --- a/Ample/Slot.h +++ b/Ample/Slot.h @@ -10,6 +10,17 @@ #import #import "Media.h" +/* number of slot types. bitmask used so should be < sizeof(unsigned *8) */ +#define SLOT_COUNT 23 +static_assert(SLOT_COUNT <= sizeof(unsigned) * 8, "too many slot types"); + +#define kSMARTPORT_SLOT 21 +#define kBIOS_SLOT 22 + +#ifndef SIZEOF +#define SIZEOF(x) (sizeof(x) / sizeof(x[0])) +#endif + //NS_ASSUME_NONNULL_BEGIN @class Slot, SlotOption, SlotTableCellView; diff --git a/Ample/Slot.m b/Ample/Slot.m index 835698f..89daef4 100644 --- a/Ample/Slot.m +++ b/Ample/Slot.m @@ -101,9 +101,10 @@ static NSDictionary *IndexMap = nil; @"nbe": @20, @"smartport": @21, -#define kSMARTPORT 21 + @"bios": @22, }; - + static_assert(kSMARTPORT_SLOT == 21, "Smartport != 21"); + static_assert(kBIOS_SLOT == 22, "Bios != 22"); } -(void)reset { @@ -156,7 +157,7 @@ static NSDictionary *IndexMap = nil; // { 'sl3' : 'uthernet' } // special case for smartport since the name isn't used. - if (_index == kSMARTPORT) { + if (_index == kSMARTPORT_SLOT) { SlotOption *option = [_options objectAtIndex: _selectedIndex]; [option reserialize: dict]; return; @@ -387,7 +388,7 @@ static NSDictionary *IndexMap = nil; // [menu setItemArray: ] doesn't work prior to 10.14, apparently. [menu removeAllItems]; - if (_index == kSMARTPORT) { + if (_index == kSMARTPORT_SLOT) { //[menu setItemArray: @[]]; [button setHidden: YES]; } else { diff --git a/Ample/SlotViewController.m b/Ample/SlotViewController.m index f6550db..1573069 100644 --- a/Ample/SlotViewController.m +++ b/Ample/SlotViewController.m @@ -16,11 +16,7 @@ #import -/* number of slot types. bitmask used so should be < sizeof(unsigned *8) */ -#define SLOT_COUNT 22 -static_assert(SLOT_COUNT <= sizeof(unsigned) * 8, "too many slot types"); -#define SIZEOF(x) (sizeof(x) / sizeof(x[0])) static unsigned RootKey = 0; @@ -120,6 +116,7 @@ static unsigned RootKey = 0; _slot_object[i] = nil; } + _slot_value[kBIOS_SLOT] = nil; // don't copy over to other machines. extern NSArray *BuildSlots(NSString *name, NSDictionary *data); _root = BuildSlots(_machine, d);