diff --git a/Mini vMac/EmulatorProtocol.h b/Mini vMac/EmulatorProtocol.h index 7429265..cd572a6 100644 --- a/Mini vMac/EmulatorProtocol.h +++ b/Mini vMac/EmulatorProtocol.h @@ -22,7 +22,6 @@ @property (nonatomic, readonly) NSString *insertDiskNotification, *ejectDiskNotification; @property (nonatomic, readonly) NSInteger initialSpeed; -@property (nonatomic, readonly) NSData *RAM; @property (nonatomic, readonly) BOOL anyDiskInserted; @property (nonatomic, readonly) NSString *currentApplication; diff --git a/Mini vMac/MYOSGLUE.m b/Mini vMac/MYOSGLUE.m index 8c664dc..b5984bf 100644 --- a/Mini vMac/MYOSGLUE.m +++ b/Mini vMac/MYOSGLUE.m @@ -36,6 +36,8 @@ #define kRAM_Size (kRAMa_Size + kRAMb_Size) EXPORTVAR(ui3p, RAM) +EXPORTVAR(ui3p, VidROM) +EXPORTVAR(ui3p, VidMem) @interface Emulator : NSObject @@ -1512,6 +1514,13 @@ LOCALFUNC blnr AllocMyMemory(void) { LOCALPROC UnallocMyMemory(void) { if (nullpr != ReserveAllocBigBlock) { free((char *)ReserveAllocBigBlock); + RAM = nullpr; +#if EmVidCard + VidROM = nullpr; +#endif +#if IncludeVidMem + VidMem = nullpr; +#endif } } @@ -1772,12 +1781,11 @@ static dispatch_once_t onceToken; WantMacReset = trueblnr; } -- (NSData *)RAM { - return [NSData dataWithBytesNoCopy:RAM length:kRAM_Size freeWhenDone:NO]; -} - - (NSString *)currentApplication { - NSData *curApName = [self.RAM subdataWithRange:NSMakeRange(0x910, 32)]; + if (RAM == nullpr) { + return nil; + } + NSData *curApName = [NSData dataWithBytes:RAM + 0x910 length:32]; uint8_t curApNameLength = *(uint8_t*)curApName.bytes; if (curApNameLength == 0 || curApNameLength > 31) { return nil;