MM::MaxMem / MM::FreeMem (68k Pascal)

This commit is contained in:
Kelvin Sherlock 2013-03-30 18:45:20 -04:00
parent 6f93bd0826
commit 231e34627d
3 changed files with 48 additions and 3 deletions

View File

@ -270,10 +270,45 @@ namespace MM
Log("%04x CompactMem(%08x)\n", trap, cbNeeded); Log("%04x CompactMem(%08x)\n", trap, cbNeeded);
// todo -- add mplite call to return total free mem, largest block.
return 0x0f0000; return mplite_maxmem(&pool);
} }
uint32_t MaxMem(uint16_t trap)
{
// return largest contiguous free block size.
/*
* on entry:
* (nothing)
*
* on exit:
* D0: function result (long word)
*
*/
Log("%04x MaxMem()\n", trap);
return mplite_maxmem(&pool);
}
uint32_t FreeMem(uint16_t trap)
{
// total free memory.
/*
* on entry:
* (nothing)
*
* on exit:
* D0: function result (long word)
*
*/
Log("%04x FreeMem()\n", trap);
return mplite_freemem(&pool);
}
uint16_t MoveHHi(uint16_t trap) uint16_t MoveHHi(uint16_t trap)
{ {
/* /*

View File

@ -26,7 +26,9 @@ namespace MM
uint16_t BlockMove(uint16_t trap); uint16_t BlockMove(uint16_t trap);
uint32_t CompactMem(uint16_t trap); uint32_t CompactMem(uint16_t trap);
uint32_t MaxMem(uint16_t trap);
uint32_t FreeMem(uint16_t trap);
uint16_t DisposeHandle(uint16_t trap); uint16_t DisposeHandle(uint16_t trap);
uint16_t DisposePtr(uint16_t trap); uint16_t DisposePtr(uint16_t trap);

View File

@ -128,6 +128,14 @@ namespace ToolBox {
d0 = MM::HPurge(trap); d0 = MM::HPurge(trap);
break; break;
case 0xA11D:
d0 = MM::MaxMem(trap);
break;
case 0xA01C:
d0 = MM::FreeMem(trap);
break;
// CompactMem (cbNeeded: Size) : Size; // CompactMem (cbNeeded: Size) : Size;
case 0xa04c: case 0xa04c:
d0 = MM::CompactMem(trap); d0 = MM::CompactMem(trap);