mirror of
https://github.com/zydeco/minivmac4ios.git
synced 2024-06-16 19:29:32 +00:00
fix crash when showing insert disk menu after shutting down the emulated machine
This commit is contained in:
parent
bf7e9e0479
commit
9217b4ebcd
|
@ -22,7 +22,6 @@
|
||||||
@property (nonatomic, readonly) NSString *insertDiskNotification, *ejectDiskNotification;
|
@property (nonatomic, readonly) NSString *insertDiskNotification, *ejectDiskNotification;
|
||||||
@property (nonatomic, readonly) NSInteger initialSpeed;
|
@property (nonatomic, readonly) NSInteger initialSpeed;
|
||||||
|
|
||||||
@property (nonatomic, readonly) NSData *RAM;
|
|
||||||
@property (nonatomic, readonly) BOOL anyDiskInserted;
|
@property (nonatomic, readonly) BOOL anyDiskInserted;
|
||||||
@property (nonatomic, readonly) NSString *currentApplication;
|
@property (nonatomic, readonly) NSString *currentApplication;
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
|
|
||||||
#define kRAM_Size (kRAMa_Size + kRAMb_Size)
|
#define kRAM_Size (kRAMa_Size + kRAMb_Size)
|
||||||
EXPORTVAR(ui3p, RAM)
|
EXPORTVAR(ui3p, RAM)
|
||||||
|
EXPORTVAR(ui3p, VidROM)
|
||||||
|
EXPORTVAR(ui3p, VidMem)
|
||||||
|
|
||||||
@interface Emulator : NSObject <Emulator, UIAlertViewDelegate>
|
@interface Emulator : NSObject <Emulator, UIAlertViewDelegate>
|
||||||
|
|
||||||
|
@ -1512,6 +1514,13 @@ LOCALFUNC blnr AllocMyMemory(void) {
|
||||||
LOCALPROC UnallocMyMemory(void) {
|
LOCALPROC UnallocMyMemory(void) {
|
||||||
if (nullpr != ReserveAllocBigBlock) {
|
if (nullpr != ReserveAllocBigBlock) {
|
||||||
free((char *)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;
|
WantMacReset = trueblnr;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSData *)RAM {
|
|
||||||
return [NSData dataWithBytesNoCopy:RAM length:kRAM_Size freeWhenDone:NO];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString *)currentApplication {
|
- (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;
|
uint8_t curApNameLength = *(uint8_t*)curApName.bytes;
|
||||||
if (curApNameLength == 0 || curApNameLength > 31) {
|
if (curApNameLength == 0 || curApNameLength > 31) {
|
||||||
return nil;
|
return nil;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user