Quote:
Originally Posted by hitchhikr
The source (to be improved):
Code:
/*
* Frees approx 21k of chip memory
* (Also speeds up the CLI a bit).
* Probably not a good idea to use this on anything
* else than a 1.x KickStarts.
*/
/*
* Includes
*/
#include <libraries/dos.h>
#include <exec/types.h>
#include <exec/memory.h>
#include <intuition/intuitionbase.h>
#include <clib/all_protos.h>
/*
* Variables
*/
struct IntuitionBase *IntuitionBase;
struct DOSBase *DOSBase;
struct Screen *scr;
struct BitMap *bm;
struct Window *win;
ULONG orig_height;
/*
* Program entry point
*/
int main(int argc, char *argv[])
{
PLANEPTR pl0;
PLANEPTR pl1;
PLANEPTR plb;
PLANEPTR ple;
IntuitionBase = (struct IntuitionBase *) OpenLibrary("intuition.library", 0);
DOSBase = (struct DOSBase *) OpenLibrary("dos.library", 0);
scr = IntuitionBase->ActiveScreen;
win = IntuitionBase->ActiveWindow;
orig_height = scr->Height;
SizeWindow(win, 0, 56);
Delay(1 * 50);
scr->Height = 256;
bm = &scr->BitMap;
bm->Rows = 256;
bm->Depth = 1;
pl0 = bm->Planes[0];
pl1 = bm->Planes[1];
bm->Planes[1] = NULL;
plb = pl0 + (640 * 256 / 8);
ple = pl1 + (640 * orig_height / 8);
RemakeDisplay();
FreeMem(plb, ple - plb);
CloseLibrary((struct Library *) DOSBase);
CloseLibrary((struct Library *) IntuitionBase);
return (RETURN_OK);
}
And the binary: http://franck.charlet.pagesperso-ora...emp/add21k.zip
|
Thanks, I'll give this a try.
Today I tried EndRun and while it does close the cli window it doesn't result in me being able to load a larger chip segment. I'm guessing it frees some ram but it must be fragmented and not able to be allocated in one larger chunk.