From: sparky4 Date: Tue, 9 Dec 2014 22:28:00 +0000 (-0600) Subject: wwww XMS library expewrimentation X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=a3c3026ef9a11550e4796db258e73c14f5f0b0da;p=16.git wwww XMS library expewrimentation We seriously need a proper XMS library! modified: scroll.exe modified: src/scroll.c --- diff --git a/scroll.exe b/scroll.exe index cb6e3697..8912afb4 100644 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/src/scroll.c b/src/scroll.c index e67fe514..80b6fc3b 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -84,12 +84,6 @@ void main() { actor_t player; //actor_t npc0; - /* save the palette */ - pal = modexNewPal(); - modexPalSave(pal); - modexFadeOff(4, pal); - modexPalBlack(); - /* 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); @@ -101,7 +95,14 @@ void main() { ptr = map.data; /* data */ ptmp = bitmapLoadPcx("ptmp.pcx"); // load sprite - //npctmp = bitmapLoadPcx("ptmp1.pcx"); // load sprite + //npctmp = bitmapLoadPcx("ptmp1.pcx"); // load sprite + + /* save the palette */ + pal = modexNewPal(); + modexPalSave(pal); + modexFadeOff(4, pal); + modexPalBlack(); + setkb(1); modexEnter(); modexPalBlack(); @@ -498,7 +499,7 @@ allocMap(int w, int h) { result.height=h; if(initxms()>0) result.data = malloc(sizeof(byte) * w * h); - else result.data = xmsmalloc(sizeof(byte) * w * h); + else (void huge*)result.data = xmsmalloc(sizeof(byte) * w * h); return result; } @@ -512,17 +513,17 @@ initMap(map_t *map) { int tile = 1; if(initxms()>0) map->tiles = malloc(sizeof(tiles_t)); - else map->tiles = xmsmalloc(sizeof(tiles_t)); + else (void huge*)map->tiles = xmsmalloc(sizeof(tiles_t)); /* create the tile set */ if(initxms()>0) map->tiles->data = malloc(sizeof(bitmap_t)); - else map->tiles->data = xmsmalloc(sizeof(bitmap_t)); + else (void huge*)map->tiles->data = xmsmalloc(sizeof(bitmap_t)); map->tiles->data->width = (TILEWH*2); map->tiles->data->height= TILEWH; if(initxms()>0) map->tiles->data->data = malloc((TILEWH*2)*TILEWH); - else map->tiles->data->data = xmsmalloc((TILEWH*2)*TILEWH); + else (void huge*)map->tiles->data->data = xmsmalloc((TILEWH*2)*TILEWH); map->tiles->tileHeight = TILEWH; map->tiles->tileWidth =TILEWH; map->tiles->rows = 1;