MM::PurgeSpace call

This commit is contained in:
Kelvin Sherlock 2014-12-14 19:51:49 -05:00
parent fed6e9b172
commit 91e142446b
3 changed files with 21 additions and 0 deletions

View File

@ -1469,4 +1469,20 @@ namespace MM
return 0;
}
uint32_t PurgeSpace(uint16_t trap)
{
// PROCEDURE PurgeSpace (VAR total: LongInt; VAR contig: LongInt);
/*
* Registers on exit:
* A0 Maximum number of contiguous bytes after purge
* D0 Total free memory after purge
*/
Log("%04x PurgeSpace()\n", trap);
SetMemError(0);
cpuSetAReg(0, mplite_maxmem(&pool));
return mplite_freemem(&pool);
}
}

View File

@ -41,6 +41,7 @@ namespace MM
uint32_t MaxBlock(uint16_t trap);
uint32_t FreeMem(uint16_t trap);
uint16_t ReserveMem(uint16_t trap);
uint32_t PurgeSpace(uint16_t trap);
uint16_t DisposeHandle(uint16_t trap);

View File

@ -263,6 +263,10 @@ namespace ToolBox {
d0 = MM::MaxApplZone(trap);
break;
case 0xa162:
d0 = MM::PurgeSpace(trap);
break;
// ReadDateTime (VAR sees: LONGINT) : OSErr;
case 0xa039:
d0 = OS::ReadDateTime(trap);