]> 4ch.mooo.com Git - 16.git/commitdiff
wwww XMS library expewrimentation
authorsparky4 <sparky4@lappy4.4ch.mooo.com>
Tue, 9 Dec 2014 22:28:00 +0000 (16:28 -0600)
committersparky4 <sparky4@lappy4.4ch.mooo.com>
Tue, 9 Dec 2014 22:28:00 +0000 (16:28 -0600)
We seriously need a proper XMS library!

modified:   scroll.exe
modified:   src/scroll.c

scroll.exe
src/scroll.c

index cb6e36971f7e3921b048cc3b49eaae37eb0833f7..8912afb4be416bc624556647bd611d1efe2c8da9 100644 (file)
Binary files a/scroll.exe and b/scroll.exe differ
index e67fe514553dfa0c021a75354aa124539a9f9279..80b6fc3b245859597d54a7988f6cb14b2faa0491 100644 (file)
@@ -84,12 +84,6 @@ void main() {
        actor_t player;\r
        //actor_t npc0;\r
 \r
-       /* save the palette */\r
-       pal  = modexNewPal();\r
-       modexPalSave(pal);\r
-       modexFadeOff(4, pal);\r
-       modexPalBlack();\r
-\r
        /* 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;\r
        /* data */\r
        ptmp = bitmapLoadPcx("ptmp.pcx"); // load sprite
-       //npctmp = bitmapLoadPcx("ptmp1.pcx"); // load sprite\r
+       //npctmp = bitmapLoadPcx("ptmp1.pcx"); // load sprite
+
+       /* save the palette */\r
+       pal  = modexNewPal();\r
+       modexPalSave(pal);\r
+       modexFadeOff(4, pal);\r
+       modexPalBlack();
+\r
        setkb(1);\r
        modexEnter();\r
        modexPalBlack();\r
@@ -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);
 \r
        return result;\r
 }\r
@@ -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));\r
+       else (void huge*)map->tiles = xmsmalloc(sizeof(tiles_t));\r
 \r
        /* 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);\r
        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);\r
+       else (void huge*)map->tiles->data->data = xmsmalloc((TILEWH*2)*TILEWH);\r
        map->tiles->tileHeight = TILEWH;\r
        map->tiles->tileWidth =TILEWH;\r
        map->tiles->rows = 1;\r