From: sparky4 Date: Wed, 10 Dec 2014 22:15:43 +0000 (-0600) Subject: Trying to figure out how EMS memory works X-Git-Url: http://4ch.mooo.com/gitweb/?p=16.git;a=commitdiff_plain;h=402f342c692f8a8cc1713e0f195435133dd128ea Trying to figure out how EMS memory works modified: scroll.exe modified: src/scroll.c --- diff --git a/scroll.exe b/scroll.exe index 5240d41e..aea24d63 100644 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/src/scroll.c b/src/scroll.c index 557b1a07..04d817f5 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -83,27 +83,29 @@ void main() { byte *pal; byte *ptr; actor_t player; - //actor_t npc0; + //actor_t npc0; + + if(isEMS()) printf("%d\n", coretotalEMS()); + if(isEMS()) + { + emmhandle = alloc_emem(1024); + move_emem((XMOVE *)&map); +// printf("%d\n", emmhandle); + printf("%d\n", coretotalEMS()); + } /* create the map */ map = allocMap(MAPX,MAPY); //20x15 is the resolution of the screen you can make maps smaller than 20x15 but the null space needs to be drawn properly initMap(&map); mv.map = ↦ mv2.map = ↦ - mv3.map = ↦ - + mv3.map = ↦ + /* draw the tiles */ ptr = map.data; /* data */ ptmp = bitmapLoadPcx("ptmp.pcx"); // load sprite //npctmp = bitmapLoadPcx("ptmp1.pcx"); // load sprite - - if(isEMS()) printf("%d\n", coretotalEMS()); - if(isEMS()) - { - emmhandle = alloc_emem(256); - printf("%d\n", emmhandle); - } /* save the palette */ pal = modexNewPal(); @@ -490,7 +492,12 @@ void main() { //xmsfree(spri); //xmsfree(mask); //xmsreport(); - if(isEMS()) dealloc_emem(emmhandle); + if(isEMS()) + { + printf("%d\n", coretotalEMS()); + dealloc_emem(emmhandle); + printf("%d\n", coretotalEMS()); + } switch(detectcpu()) { case 0: cpus = "8086/8088 or 186/88"; break;