]> 4ch.mooo.com Git - 16.git/commitdiff
modified: scroll.exe
authorsparky4 <sparky4@lappy4.4ch.mooo.com>
Fri, 12 Dec 2014 19:57:49 +0000 (13:57 -0600)
committersparky4 <sparky4@lappy4.4ch.mooo.com>
Fri, 12 Dec 2014 19:57:49 +0000 (13:57 -0600)
modified:   src/lib/ems.c
modified:   src/lib/lib_head.h
modified:   src/scroll.c

scroll.exe
src/lib/ems.c
src/lib/lib_head.h
src/scroll.c

index c2c6c3fc1ecbe1e9eef169b0f4d1fb3ea0adf0c8..93b99f1f41501c26158d7978bec310d603913088 100644 (file)
Binary files a/scroll.exe and b/scroll.exe differ
index 52658e56ef689c237e8e8a8257e6414abec2ae1a..9883f60c4c173acab50af9748d3729bca00923ff 100644 (file)
@@ -287,33 +287,3 @@ int mem_emem(unsigned int *total, unsigned int *freeall)
 \r
  return( 1 );\r
 }\r
-
-void emmmove(int page, short *str, int n)\r
-     {\r
-          /*\r
-          Move 'n' bytes from conventional memory to the specified\r
-     expanded memory\r
-          page\r
-          */\r
-     \r
-          char far *ptr;\r
-     \r
-          ptr = pageframeEMS() + page * 16384;\r
-          while(n-- > 0)\r
-               *ptr++ = *str++;\r
-     }\r
-     \r
-     void emmget(int page, short *str, int n)\r
-     {\r
-          /*\r
-          Move 'n' bytes from the specified expanded memory page into\r
-     conventional\r
-          memory\r
-          */\r
-     \r
-          char far *ptr;\r
-     \r
-          ptr = pageframeEMS() + page * 16384;\r
-          while(n-- > 0)\r
-               *str++ = *ptr++;\r
-     }
index 19b59f182080f5ee2b7040e355fcf4a5160b9eb1..560ea8adf4e4c8d9b4da77c152c50428b772387b 100644 (file)
 
 void wait(clock_t wait);
 
+/* THIS FUNCTION CONVERTS A POINTER TO AN INTEL LONG              */\r
+//int long ptr2long(char *p);
+
 #endif/*_LIBHEAD_H_*/
index 6868320210a3922857fe022d45002a45adf10b76..fb0cde5258f25beca36888c98e20762ea273b91a 100644 (file)
@@ -5,8 +5,10 @@
 #include "src\lib\wtest\wtest.c"\r
 #include "src\lib\ems.c"\r
 \r
-//word far *clock= (word far*) 0x046C; /* 18.2hz clock */\r
-\r
+//word far *clock= (word far*) 0x046C; /* 18.2hz clock */
+
+int emmhandle,ist;
+
 typedef struct {\r
        bitmap_t *data;\r
        word tileHeight;\r
@@ -43,11 +45,11 @@ typedef struct {
        int setx; //NOT USED YET! player sprite sheet set on the image x\r
        int sety; //NOT USED YET! player sprite sheet set on the image y\r
        word q; //loop variable\r
-       word d; //direction\r
+       word d; //direction
+       bitmap_t data; //supposively the sprite sheet data\r
        int hp; //hitpoints of the player\r
 } actor_t;\r
 \r
-\r
 map_t allocMap(int w, int h);\r
 void initMap(map_t *map);\r
 void mapScrollRight(map_view_t *mv, byte offset);\r
@@ -66,17 +68,15 @@ void animatePlayer(map_view_t *src, map_view_t *dest, /*map_view_t *top, */sword
 //#define LOOPMAX (TILEWH/SPEED)\r
 \r
 //place holder definitions\r
-#define MAPX 200\r
-#define MAPY 150\r
+#define MAPX 40\r
+#define MAPY 30\r
 #define TRIGGX 10\r
-#define TRIGGY 9\r
-\r
+#define TRIGGY 9
+
 void main() {\r
        bitmap_t ptmp;//, npctmp; // player sprite\r
        const char *cpus;\r
        static int persist_aniframe = 0;    /* gonna be increased to 1 before being used, so 0 is ok for default */
-       int emmhandle;
-       XMOVE mm;\r
        page_t screen, screen2, screen3;\r
        map_t map;\r
        map_view_t mv, mv2, mv3;\r
@@ -84,21 +84,13 @@ void main() {
        byte *pal;\r
        byte *ptr;\r
        actor_t player;\r
-       //actor_t npc0;
+       //actor_t npc0;\r
 
-       if(isEMS()) printf("%d\n", coretotalEMS());
-       if(isEMS())
-       {
-               emmhandle = mallocEMS(coretotalEMS());
-               mapEMS(emmhandle, 0, 0);
-               //halp!
-               //move_emem((XMOVE *)&map);
-               //printf("%d\n", emmhandle);
-               printf("%d\n", coretotalEMS());
-       }\r
+       if(isEMS() || checkEMS()){ printf("%d\n", coretotalEMS()); emmhandle = mallocEMS(coretotalEMS()); }
 \r
        /* create the map */\r
        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\r
+       //if(isEMS()) printf("%d tesuto\n", coretotalEMS());
        initMap(&map);\r
        mv.map = &map;\r
        mv2.map = &map;\r
@@ -107,10 +99,39 @@ void main() {
        /* draw the tiles */\r
        ptr = map.data;\r
        /* data */\r
-       ptmp = bitmapLoadPcx("ptmp.pcx"); // load sprite
-       //if(isEMS()) emmmove(emmhandle,ptmp,sizeof(ptmp)+ 1);\r
-       //npctmp = bitmapLoadPcx("ptmp1.pcx"); // load sprite\r
-\r
+       ptmp = bitmapLoadPcx("ptmp.pcx"); // load sprite\r
+       //npctmp = bitmapLoadPcx("ptmp1.pcx"); // load sprite
+
+       /*if(isEMS())
+       {
+               XMOVE mm;
+               mm.length=sizeof(map);
+               mm.sourceH=0;
+               mm.sourceOff=(long)&map;
+               mm.destH=emmhandle;
+               mm.destOff=1;
+               //halp!
+               ist = move_emem(&mm);
+               printf("%d\n", coretotalEMS());
+               if(!ist){ dealloc_emem(emmhandle); exit(5); }
+               //printf("%d\n", emmhandle);
+       }
+
+       if(isEMS())
+       {
+               XMOVE mm;
+               mm.length=emmhandle;
+               mm.sourceH=0;
+               mm.sourceOff=(long)&ptmp;
+               mm.destH=emmhandle;
+               mm.destOff=0;
+               //halp!
+               ist = move_emem(&mm);
+               printf("%d\n", coretotalEMS());
+               if(!ist){ dealloc_emem(emmhandle); exit(5); }
+               //printf("%d\n", emmhandle);
+       }
+*/\r
        /* save the palette */\r
        pal  = modexNewPal();\r
        modexPalSave(pal);\r
@@ -171,7 +192,7 @@ void main() {
        modexClearRegion(bg->page, 5*16, 5*16, 16, 16, 255);\r
 \r
        modexShowPage(spri->page);\r
-       while(!keyp(1) && player.hp!=0)\r
+       while(!keyp(1) && player.hp>0)\r
        {\r
        //top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square\r
        //to stop scrolling and have the player position data move to the edge of the screen with respect to the direction\r
@@ -474,7 +495,8 @@ void main() {
        modexFadeOff(4, ptmp.palette);\r
        modexPalBlack();\r
        modexLeave();\r
-       setkb(0);\r
+       setkb(0);
+       //system("mem /E /P");\r
        printf("Project 16 scroll.exe\n");\r
        printf("tx: %d\n", bg->tx);\r
        printf("ty: %d\n", bg->ty);\r
@@ -498,11 +520,10 @@ void main() {
        //xmsreport();
        if(isEMS())
        {
-       printf("%d\n", get_emem());
-       printf("%d\n", coretotalEMS());
-       dealloc_emem(emmhandle);
-       //freeEMS(emmtotal);
-       printf("%d\n", coretotalEMS());
+               printf("%d\n", get_emem());
+               printf("%d\n", coretotalEMS());
+               dealloc_emem(emmhandle);
+               printf("%d\n", coretotalEMS());
        }\r
        switch(detectcpu())\r
        {\r
@@ -523,15 +544,25 @@ allocMap(int w, int h) {
 \r
        result.width =w;\r
        result.height=h;\r
-       //if(!isEMS() || !checkEMS())\r
-               result.data = malloc(sizeof(byte) * w * h);\r
-       //else
-       //      result.data = (byte *)alloc_emem(sizeof(byte) * w * h);
+       result.data = malloc(sizeof(byte) * w * h);
+       //result.data = (byte *)alloc_emem(((int)sizeof(byte) * w * h)/1024);\r
+       /*if(isEMS() || checkEMS())
+       {
+               XMOVE mm;
+               //emmhandle = mallocEMS(coretotalEMS());//alloc_emem((int)sizeof(map))
+               mm.length=sizeof(result);
+               mm.sourceH=0;
+               mm.sourceOff=ptr2long(&result);
+               mm.destH=emmhandle;
+               mm.destOff=0;
+               ist = move_emem(&mm);
+               if(!ist){ dealloc_emem(emmhandle); exit(5); }
+               printf("%d\n", coretotalEMS());
+       }*/
 \r
        return result;\r
 }\r
 \r
-\r
 void\r
 initMap(map_t *map) {\r
        /* just a place holder to fill out an alternating pattern */\r
@@ -748,7 +779,7 @@ mapDrawCol(map_view_t *mv, int tx, int ty, word x) {
 /*void npcmove(map_view_t bg, map_view_t fg, )\r
 {\r
        \r
-}*/\r
+}*/
 \r
 void\r
 animatePlayer(map_view_t *src, map_view_t *dest, /*map_view_t *top, */sword d, short scrolloffsetswitch, int x, int y, int ls, int lp, bitmap_t *bmp)\r