From: sparky4 Date: Fri, 16 Dec 2016 15:11:24 +0000 (-0600) Subject: trying to figure out the issue with player sprite with pcx X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=c7e6c3d9447e917f4149be3885f0c3bedf9bec67;p=16.git trying to figure out the issue with player sprite with pcx --- diff --git a/DEBUG.16W b/DEBUG.16W new file mode 100755 index 00000000..56e1b237 --- /dev/null +++ b/DEBUG.16W @@ -0,0 +1,210 @@ +Seg:0 Size:10340 Owner:0x0 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++0000 +Seg:294f Size:37 Owner:0x0 ++ +Seg:2974 Size:256 Owner:0x1650 +++++ +Seg:2a74 Size:256 Owner:0x1442 ++++++ +Seg:2b74 Size:256 Owner:0x1444 +++++ +Seg:2c74 Size:256 Owner:0x1446 +++++ +Seg:2d74 Size:256 Owner:0x1448 +++++ +Seg:2e74 Size:256 Owner:0x144a +++++ +Seg:2f74 Size:256 Owner:0x144c ++++++ +Seg:3074 Size:256 Owner:0x144e +++++ +Seg:3174 Size:256 Owner:0x1450 +++++ +Seg:3274 Size:256 Owner:0x1452 +++++ +Seg:3374 Size:256 Owner:0x1454 +++++ +Seg:3474 Size:256 Owner:0x1456 ++++++ +Seg:3574 Size:256 Owner:0x1458 +++++ +Seg:3674 Size:256 Owner:0x145a +++++ +Seg:3774 Size:256 Owner:0x145c +++++ +Seg:3874 Size:256 Owner:0x145e +++++ +Seg:3974 Size:256 Owner:0x1460 ++++++ +Seg:3a74 Size:256 Owner:0x1462 +++++ +Seg:3b74 Size:256 Owner:0x1464 +++++ +Seg:3c74 Size:256 Owner:0x1466 +++++ +Seg:3d74 Size:256 Owner:0x1468 +++++ +Seg:3e74 Size:256 Owner:0x146a ++++++ +Seg:3f74 Size:256 Owner:0x146c +++++ +Seg:4074 Size:256 Owner:0x146e +++++ +Seg:4174 Size:256 Owner:0x1470 +++++ +Seg:4274 Size:256 Owner:0x1472 +++++ +Seg:4374 Size:256 Owner:0x1474 ++++++ +Seg:4474 Size:256 Owner:0x1476 +++++ +Seg:4574 Size:256 Owner:0x1478 +++++ +Seg:4674 Size:256 Owner:0x147a +++++ +Seg:4774 Size:256 Owner:0x147c +++++ +Seg:4874 Size:256 Owner:0x147e ++++++ +Seg:4974 Size:256 Owner:0x1480 +++++ +Seg:4a74 Size:256 Owner:0x1482 +++++ +Seg:4b74 Size:256 Owner:0x1484 +++++ +Seg:4c74 Size:256 Owner:0x1486 +++++ +Seg:4d74 Size:256 Owner:0x1488 ++++++ +Seg:4e74 Size:256 Owner:0x148a +++++ +Seg:4f74 Size:256 Owner:0x148c +++++ +Seg:5074 Size:256 Owner:0x148e +++++ +Seg:5174 Size:256 Owner:0x1490 +++++ +Seg:5274 Size:256 Owner:0x1492 ++++++ +Seg:5374 Size:256 Owner:0x1494 +++++ +Seg:5474 Size:256 Owner:0x1496 +++++ +Seg:5574 Size:256 Owner:0x1498 +++++ +Seg:5674 Size:256 Owner:0x149a +++++ +Seg:5774 Size:256 Owner:0x149c ++++++ +Seg:5874 Size:256 Owner:0x149e +++++ +Seg:5974 Size:256 Owner:0x14a0 +++++ +Seg:5a74 Size:256 Owner:0x14a2 +++++ +Seg:5b74 Size:256 Owner:0x14a4 +++++ +Seg:5c74 Size:256 Owner:0x14a6 ++++++ +Seg:5d74 Size:256 Owner:0x14a8 +++++ +Seg:5e74 Size:256 Owner:0x14aa +++++ +Seg:5f74 Size:256 Owner:0x14ac +++++ +Seg:6074 Size:256 Owner:0x14ae +++++ +Seg:6174 Size:256 Owner:0x14b0 ++++++ +Seg:6274 Size:256 Owner:0x14b2 +++++ +Seg:6374 Size:256 Owner:0x14b4 +++++ +Seg:6474 Size:256 Owner:0x14b6 +++++ +Seg:6574 Size:256 Owner:0x14b8 +++++ +Seg:6674 Size:256 Owner:0x14ba ++++++ +Seg:6774 Size:256 Owner:0x14bc +++++ +Seg:6874 Size:256 Owner:0x14be +++++ +Seg:6974 Size:256 Owner:0x14c0 +++++ +Seg:6a74 Size:256 Owner:0x14c2 +++++ +Seg:6b74 Size:256 Owner:0x14c4 ++++++ +Seg:6c74 Size:256 Owner:0x14c6 +++++ +Seg:6d74 Size:256 Owner:0x14c8 +++++ +Seg:6e74 Size:256 Owner:0x14ca +++++ +Seg:6f74 Size:256 Owner:0x14cc +++++ +Seg:7074 Size:256 Owner:0x14ce ++++++ +Seg:7174 Size:256 Owner:0x14d0 +++++ +Seg:7274 Size:256 Owner:0x14d2 +++++ +Seg:7374 Size:256 Owner:0x14d4 +++++ +Seg:7474 Size:256 Owner:0x14d6 +++++ +Seg:7574 Size:256 Owner:0x14d8 ++++++ +Seg:7674 Size:256 Owner:0x14da +++++ +Seg:7774 Size:256 Owner:0x14dc +++++ +Seg:7874 Size:256 Owner:0x14de +++++ +Seg:7974 Size:256 Owner:0x14e0 +++++ +Seg:7a74 Size:256 Owner:0x14e2 ++++++ +Seg:7b74 Size:256 Owner:0x14e4 +++++ +Seg:7c74 Size:256 Owner:0x14e6 +++++ +Seg:7d74 Size:256 Owner:0x14e8 +++++ +Seg:7e74 Size:256 Owner:0x14ea +++++ +Seg:7f74 Size:256 Owner:0x14ec ++++++ +Seg:8074 Size:256 Owner:0x14ee +++++ +Seg:8174 Size:256 Owner:0x14f0 +++++ +Seg:8274 Size:256 Owner:0x14f2 +++++ +Seg:8374 Size:256 Owner:0x14f4 +++++ +Seg:8474 Size:256 Owner:0x14f6 ++++++ +Seg:8574 Size:256 Owner:0x14f8 +++++ +Seg:8674 Size:256 Owner:0x14fa +++++ +Seg:8774 Size:256 Owner:0x14fc +++++ +Seg:8874 Size:256 Owner:0x14fe +++++ +Seg:8974 Size:256 Owner:0x1500 ++++++ +Seg:8a74 Size:256 Owner:0x1502 +++++ +Seg:8b74 Size:256 Owner:0x1504 +++++ +Seg:8c74 Size:256 Owner:0x1506 +++++ +Seg:8d74 Size:256 Owner:0x1508 +++++ +Seg:8e74 Size:401 Owner:0xec10 +++++++ +Seg:b974 Size:18059 Owner:0x0 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file diff --git a/HEAP.16W b/HEAP.16W new file mode 100755 index 00000000..16af83b8 --- /dev/null +++ b/HEAP.16W @@ -0,0 +1,71 @@ + + == default == + + FREE block at 29720016 of size 18 + USED block at 29720028 of size 50 + USED block at 2972005a of size 50 + USED block at 2972008c of size 50 + USED block at 297200be of size 50 + USED block at 297200f0 of size 50 + USED block at 29720122 of size 50 + USED block at 29720154 of size 50 + USED block at 29720186 of size 50 + USED block at 297201b8 of size 50 + USED block at 297201ea of size 50 + USED block at 2972021c of size 50 + USED block at 2972024e of size 50 + USED block at 29720280 of size 50 + FREE block at 297202b2 of size 14 + USED block at 297202c0 of size 20 + USED block at 297202d4 of size 136 + FREE block at 2972035c of size 7328 +OK - end of heap + + == near == + + USED block at 1971ec66 of size 12 + USED block at 1971ec72 of size 528 + USED block at 1971ee82 of size 72 + USED block at 1971eeca of size 20 + USED block at 1971eede of size 20 + USED block at 1971eef2 of size 20 + USED block at 1971ef06 of size 20 + USED block at 1971ef1a of size 20 + USED block at 1971ef2e of size 4302 +OK - end of heap + + == far == + + USED block at 29720016 of size 18 + USED block at 29720028 of size 50 + USED block at 2972005a of size 50 + USED block at 2972008c of size 50 + USED block at 297200be of size 50 + USED block at 297200f0 of size 50 + USED block at 29720122 of size 50 + USED block at 29720154 of size 50 + USED block at 29720186 of size 50 + USED block at 297201b8 of size 50 + USED block at 297201ea of size 50 + USED block at 2972021c of size 50 + USED block at 2972024e of size 50 + USED block at 29720280 of size 50 + USED block at 297202b2 of size 14 + USED block at 297202c0 of size 20 + USED block at 297202d4 of size 136 + USED block at 2972035c of size 7328 +OK - end of heap + +Memory Type Total Used Free +---------------- -------- -------- -------- +Default 8166 806 7360 +Near 5014 712 4302 +Far 8166 806 7360 +---------------- -------- -------- -------- +coreleft = 4300 +farcoreleft = 27888 +GetFreeSize = 23610 +GetNearFreeSize = 4302 +GetFarFreeSize = 23610 +memavl = 4300 +stackavail = 31527 diff --git a/MEMINFO.16W b/MEMINFO.16W new file mode 100755 index 00000000..e69de29b diff --git a/MMDUMP.16W b/MMDUMP.16W new file mode 100755 index 00000000..ca7b1727 Binary files /dev/null and b/MMDUMP.16W differ diff --git a/data/G.PAL b/data/G.PAL new file mode 100755 index 00000000..0ecbac33 Binary files /dev/null and b/data/G.PAL differ diff --git a/pcxtest.exe b/pcxtest.exe index 5febf452..94d4b68a 100755 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/src/lib/16_in.h b/src/lib/16_in.h index 9e4bfc2e..e0efe8cf 100755 --- a/src/lib/16_in.h +++ b/src/lib/16_in.h @@ -227,7 +227,7 @@ typedef struct memptr gr; entity_t *ent; #endif - bitmap_t *data; //supposively the sprite sheet data//old format + bitmap_t __far *data; //supposively the sprite sheet data//old format sword hp; //hitpoints of the player int persist_aniframe; /* gonna be increased to 1 before being used, so 0 is ok for default */ CursorInfo info; diff --git a/src/lib/bitmap.c b/src/lib/bitmap.c index 7f9df1f0..b030b379 100755 --- a/src/lib/bitmap.c +++ b/src/lib/bitmap.c @@ -111,7 +111,7 @@ bitmapLoadPcx(char *filename) { /* allocate the buffer */ //printf("%zu\n", _memmax()); bufSize = (/*(dword)*/result.width * result.height); - result.data = malloc(bufSize); + result.data = _fmalloc(bufSize); // result.data = (byte far *)_fmalloc(bufSize); // result.data = (byte __huge *)halloc(bufSize, sizeof(byte)); /*printf("&bufSize=%p\n", &bufSize); diff --git a/src/scroll.c b/src/scroll.c index 776c3a16..716c7dcf 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -77,7 +77,7 @@ void main(int argc, char *argv[]) //mappalptr = map.tiles->btdata->palette; /* data */ - player[0].data = malloc(48*128); //TODO use exmm + //player[0].data = _fmalloc(48*128); //TODO use exmm *player[0].data = bitmapLoadPcx("data/chikyuu.pcx"); // load sprite /* create the planar buffer */ @@ -217,7 +217,8 @@ void main(int argc, char *argv[]) } //p #ifdef MODEX #ifdef FADE - if(IN_KeyDown(24)){ modexPalUpdate0(gpal); paloffset=0; modexpdump(mv[0].page); modexpdump(mv[1].page); IN_UserInput(1,1); } + if(IN_KeyDown(24)){ modexPalUpdate0(gpal); paloffset=0; modexpdump(mv[0].page); modexpdump(mv[1].page); IN_UserInput(1,1); } //p + if(IN_KeyDown(23)){ modexDrawSprite(mv[1].page, 160, 120, player[0].data); IN_UserInput(1,1); } //o if(IN_KeyDown(22)){ paloffset=0; modexPalBlack(); modexPalUpdate(player[0].data, &paloffset, 0, 0); printf("1paloffset = %d\n", paloffset/3); diff --git a/src/zcroll.c b/src/zcroll.c index 32342529..97b45e60 100755 --- a/src/zcroll.c +++ b/src/zcroll.c @@ -76,6 +76,8 @@ void main(int argc, char *argv[]) // data read_vrs(&gvar, "data/spri/chikyuu.vrs", player[0].ent->spri->spritesheet); + player[0].data = malloc(48*128); //TODO use exmm + *player[0].data = bitmapLoadPcx("data/chikyuu.pcx"); // load sprite // input! IN_Default(0, &player,ctrl_Keyboard1); @@ -141,9 +143,9 @@ void main(int argc, char *argv[]) #ifdef FADE modexFadeOn(4, gpal); #endif - strcpy(global_temp_status_text, "press enter for the loop of zcroll\nescape to quit"); + /*strcpy(global_temp_status_text, "press enter for the loop of zcroll\nescape to quit"); modexprint(&gvar.video.page[0], 144, 72, 1, 7, 0, global_temp_status_text); - while(!IN_KeyDown(sc_Enter)){ if(IN_KeyDown(sc_Escape)) goto quit; } IN_UserInput(1,1); //wwww + while(!IN_KeyDown(sc_Enter)){ if(IN_KeyDown(sc_Escape)) goto quit; } IN_UserInput(1,1);*///wwww while(!IN_KeyDown(sc_Escape))// && player[0].hp>0) { shinku(&gvar); @@ -175,7 +177,8 @@ void main(int argc, char *argv[]) IN_UserInput(1,1); } //p #ifdef FADE - if(IN_KeyDown(24)){ modexPalUpdate0(gpal); paloffset=0; modexpdump(mv[0].page); IN_UserInput(1,1); } + if(IN_KeyDown(24)){ modexPalUpdate0(gpal); paloffset=0; modexpdump(mv[0].page); IN_UserInput(1,1); } //p + if(IN_KeyDown(23)){ modexDrawSprite(mv[1].page, 160, 120, player[0].data); IN_UserInput(1,1); } //o if(IN_KeyDown(22)){ printf("2paloffset = %d\n", paloffset/3); IN_UserInput(1,1); @@ -222,7 +225,7 @@ void main(int argc, char *argv[]) /* fade back to text mode */ /* but 1st lets save the game palette~ */ - quit: + //quit: #ifdef FADE modexPalSave(gpal); modexSavePalFile("data/g.pal", gpal);