From 65507545d31295802b4aff4a2c6ff80b3919d1ae Mon Sep 17 00:00:00 2001 From: sparky4 Date: Wed, 21 Jun 2017 13:58:21 -0500 Subject: [PATCH] 16_ca needs huge amounts of work and I should remember what needs to be done soon[going to port rest of code to borland c some time so we can use the core components of id engine here ][going to add 16_us.c eventually but the debug system and CA_ PM_ and MM_ usage is priority now]older zcroll renamed to xcroll][zcroll is now the pre menu game loop system with PROPER data usage with CAMMPM] added 1st scroll back [i work on CA] palette debug show values added wwww and i need to know how to see vrs/vrl imaage data palette index numbers [i am trying to find out how the hell you get the index number values of VRL/VRS] [CA_CacheMap added seems to be used in start a new game] what is mapsegs? bcexmm reports normally again... it acts funny with a unsigned long being assigned coreleft()'s value[vrldbg.exe added for a dirivative of vrldbg thanks johncampbell321\!] i did some small things here and there. and shrinked the stack. and fixed some little warnings... i may move to model medium like wolf3d --- HEAP.16W | 72 +++++++++++++++++++++++++++------------------ MMDUMP.16W | Bin 2222 -> 2288 bytes makefile | 1 + src/lib/16_ca.c | 8 ++--- src/lib/16_hc.c | 14 +-------- src/lib/16_spri.c | 4 +-- src/lib/16_spri.h | 2 +- src/lib/16_timer.c | 2 +- src/vrldbg.c | 2 +- 9 files changed, 54 insertions(+), 51 deletions(-) diff --git a/HEAP.16W b/HEAP.16W index aab6eb8e..35aa4f0d 100755 --- a/HEAP.16W +++ b/HEAP.16W @@ -1,41 +1,55 @@ == near == - USED block at 12c6:c706 of size 12 - USED block at 12c6:c712 of size 322 - USED block at 12c6:c854 of size 52 - USED block at 12c6:c888 of size 20 - USED block at 12c6:c89c of size 20 - USED block at 12c6:c8b0 of size 20 - USED block at 12c6:c8c4 of size 20 - USED block at 12c6:c8d8 of size 20 - FREE block at 12c6:c8ec of size 14096 + USED block at 1e27:da06 of size 12 + USED block at 1e27:da12 of size 320 + USED block at 1e27:db52 of size 52 + USED block at 1e27:db86 of size 20 + USED block at 1e27:db9a of size 20 + USED block at 1e27:dbae of size 20 + USED block at 1e27:dbc2 of size 20 + USED block at 1e27:dbd6 of size 20 + FREE block at 1e27:dbea of size 9234 OK - end of heap == far == - USED block at 22c7:0016 of size 136 - FREE block at 22c7:009e of size 48840 - USED block at 22c7:bf66 of size 20 - FREE block at 22c7:bf7a of size 16514 - FREE block at 32c8:0016 of size 65510 - FREE block at 42c9:0016 of size 65510 - FREE block at 52ca:0016 of size 65510 - FREE block at 62cb:0016 of size 65510 - FREE block at 72cc:0016 of size 65510 - FREE block at 82cd:0016 of size 65510 - FREE block at 92ce:0016 of size 49174 -OK - end of heap + USED block at 2e28:0016 of size 65342 + USED block at 2e28:ff54 of size 20 + USED block at 2e28:ff68 of size 136 + FREE block at 2e28:fff0 of size 12 + USED block at 3e29:0016 of size 66 + USED block at 3e29:0058 of size 50 + USED block at 3e29:008a of size 50 + USED block at 3e29:00bc of size 50 + USED block at 3e29:00ee of size 50 + USED block at 3e29:0120 of size 50 + USED block at 3e29:0152 of size 50 + USED block at 3e29:0184 of size 50 + USED block at 3e29:01b6 of size 50 + USED block at 3e29:01e8 of size 50 + USED block at 3e29:021a of size 50 + USED block at 3e29:024c of size 50 + USED block at 3e29:027e of size 50 + FREE block at 3e29:02b0 of size 29552 + USED block at 3e29:7620 of size 1202 + USED block at 3e29:7ad2 of size 1202 + USED block at 3e29:7f84 of size 1202 + USED block at 3e29:8436 of size 22 + FREE block at 3e29:844c of size 8202 + FREE block at 3e29:a456 of size 3148 + FREE block at 3e29:b0a2 of size 0 +ERROR - bad node in heap Memory Type Total Used Free ---------------- -------- -------- -------- -Near 14582 486 14096 -Far 48992 156 48836 +Near 9718 484 9234 +Far 45170 4256 40914 ---------------- -------- -------- -------- -HC_coreleft = 14094 -HC_farcoreleft = 521664 -HC_GetNearFreeSize = 14096 -HC_GetFarFreeSize = 507588 -coreleft = 14094 -farcoreleft = 521664 +HC_coreleft = 9232 +HC_farcoreleft = 396888 +HC_GetNearFreeSize = 9234 +HC_GetFarFreeSize = 40914 +coreleft = 9232 +farcoreleft = 396888 stackavail = 23262 diff --git a/MMDUMP.16W b/MMDUMP.16W index eae154cb111d33b75a0e6d5a0af86f445a779b93..88de7f7c7b678e57833f2ab3c80bd27af99aded2 100755 GIT binary patch literal 2288 zcmZwJJ5B>J6hKiVIwbZmWhf$fqQv$fu?M!`@n->4Y=a%+NU1WXy@h>T`00h;5H9U= zO{FZS^UuffwS@P#@Th&i&ieXP$F(k}@0UaEs<*&;VV$=f&%H&~%sO9z6X?Cs8|jVo zMtUQ?k={seq&L!==uPw{dK0~g-b8PrH_@Bv&Gcq^GrgJKOmC())4S2T(Yw*R(Yw*R z(Yw*R(Oc*(^cH#xy@lTU)HwdPLT{mWr+26KK8=pI?ey;S?)2{T?(|lAE4`K8N^hmN z(p%}R^fr1My^Y>RZ=<)-+vsidc6vL#o!(Awr?=DF>Fx9mdI!CO-a+r6chEcN9q?X4 rfOl4SXN7lGcxQ!oR(NNHcUF2=dRKVkx=z{oX)lTEeO90U9^1-4vM$sD literal 2222 zcmZwJxlKed06;}@ z>CNDox6oVYE%X+83%!-zN^hmN(p%}R^j3N+y^Y>RZ=<)-+vsidHhLSq zo!(Awr?=DF>FxA(dON*?-a+r6chEcN9rO-*2fdTtN$;e0(mUy$^iFywy^G#O@1l3n syXal?E_xTeo8C?Drgzi3>D}~hdN;j?-b3%9_t1ObE$95o-v7Sj2MMslnE(I) diff --git a/makefile b/makefile index 2e6ec7e4..2fccbe85 100755 --- a/makefile +++ b/makefile @@ -654,6 +654,7 @@ mx_: .symbolic !ifdef __LINUX__ vrs: .symbolic +vrl: .symbolic $(SPRIUTILEXEC): @cd $(DOSLIB_VGA:$(to_os_path)) #@make clean diff --git a/src/lib/16_ca.c b/src/lib/16_ca.c index d48a46df..9bbdbb7c 100755 --- a/src/lib/16_ca.c +++ b/src/lib/16_ca.c @@ -1889,7 +1889,7 @@ void CA_CacheGrChunk (int chunk) CAL_ExpandGrChunk (chunk,source); if (compressed>BUFFERSIZE) - MM_FreePtr(&bigbufferseg); + MM_FreePtr (MEMPTRCONV bigbufferseg); } */ @@ -1982,8 +1982,8 @@ void CA_CacheMap (global_game_variables_t *gvar) source = gvar->mm.bufferseg; else { - MM_GetPtr(&bigbufferseg,compressed, gvar); - MM_SetLock (&bigbufferseg,true, gvar); + MM_GetPtr(MEMPTRCONV bigbufferseg,compressed, gvar); + MM_SetLock (MEMPTRCONV bigbufferseg,true, gvar); source = bigbufferseg; } @@ -2012,7 +2012,7 @@ void CA_CacheMap (global_game_variables_t *gvar) #endif if (compressed>BUFFERSIZE) - MM_FreePtr(&bigbufferseg, gvar); + MM_FreePtr(MEMPTRCONV bigbufferseg, gvar); } } diff --git a/src/lib/16_hc.c b/src/lib/16_hc.c index 2d747f67..a2590cfa 100755 --- a/src/lib/16_hc.c +++ b/src/lib/16_hc.c @@ -52,22 +52,10 @@ long HC_Newfarcoreleft() #endif //from: https://stackoverflow.com/questions/14386856/c-check-available-ram -void -#ifdef __BORLANDC__ - * -#endif -#ifdef __WATCOMC__ - __near* -#endif -HC_LargestFreeBlock(size_t* Size) +void __near* HC_LargestFreeBlock(size_t* Size) { size_t s0, s1; -#ifdef __BORLANDC__ - void * p; -#endif -#ifdef __WATCOMC__ void __near* p; -#endif s0 = ~(size_t)0 ^ (~(size_t)0 >> 1); while (s0 && (p = _nmalloc(s0)) == NULL) diff --git a/src/lib/16_spri.c b/src/lib/16_spri.c index 326be10b..82c83c50 100755 --- a/src/lib/16_spri.c +++ b/src/lib/16_spri.c @@ -96,7 +96,7 @@ void VRS_OpenVRS(char *filename, entity_t *enti, boolean rlsw, global_game_varia #ifndef VRS_USECAMMPM vrl_line_offsets[i] = vrl1_vgax_genlineoffsets(curr_vrl, (byte *)curr_vrl + sizeof(struct vrl1_vgax_header), vrl_size); #else - enti->spri.spritesheet.vrl_line_offsets[i] = vrl1_vgax_genlineoffsets(curr_vrl, (byte *)curr_vrl + sizeof(struct vrl1_vgax_header), vrl_size); + enti->spri.spritesheet.vrl_line_offsets[i] = vrl1_vgax_genlineoffsets((struct vrl1_vgax_header *)curr_vrl, (byte *)curr_vrl + sizeof(struct vrl1_vgax_header), vrl_size); #endif } #ifndef VRS_USECAMMPM @@ -294,7 +294,7 @@ void init_anim(struct sprite *spri, int anim_index) spri->curr_spri_id = anim_list[0].sprite_id; spri->delay = anim_list[0].delay; - spri->curr_anim_list = anim_list; + spri->curr_anim_list = (struct vrs_animation_list_entry_t *)anim_list; } int set_anim_by_id(struct sprite *spri, int anim_id) diff --git a/src/lib/16_spri.h b/src/lib/16_spri.h index 0d23f3c8..9426ef2b 100755 --- a/src/lib/16_spri.h +++ b/src/lib/16_spri.h @@ -81,7 +81,7 @@ void VRS_OpenVRL(char *filename, entity_t *enti, boolean rlsw, global_game_varia * int - operation status * to the requested .vrl blob */ -int get_vrl_by_id(struct vrs_container *vrs_cont, uint16_t id, struct vrl_container * vrl_cont); +int get_vrl_by_id(struct vrs_container far *vrs_cont, uint16_t id, struct vrl_container *vrl_cont); void DrawVRL (unsigned int x,unsigned int y,struct vrl1_vgax_header *hdr,vrl1_vgax_offset_t *lineoffs/*array hdr->width long*/,unsigned char *data,unsigned int datasz); diff --git a/src/lib/16_timer.c b/src/lib/16_timer.c index d6301c68..35ddd0b1 100755 --- a/src/lib/16_timer.c +++ b/src/lib/16_timer.c @@ -29,7 +29,7 @@ clock_t start_timer(global_game_variables_t *gv) gv->kurokku.t = clock(); gv->kurokku.tiku = 0; gv->video.sfip = 0; gv->kurokku.clock_start = *clockw; - gv->kurokku.clock = clockw; + gv->kurokku.clock = (word *)clockw; gv->kurokku.wcpu = WCPU_detectcpu(); //turn this off if XT diff --git a/src/vrldbg.c b/src/vrldbg.c index e6a409fc..084f5349 100755 --- a/src/vrldbg.c +++ b/src/vrldbg.c @@ -15,7 +15,7 @@ #include "src/lib/doslib/hw/vga/vrl.h" #include "src/lib/doslib/hw/vga/vrs.h" #include "src/lib/doslib/hw/vga/pcxfmt.h" -#include "src/lib/doslib/hw/vga/comshtps.h" +//#include "src/lib/doslib/hw/vga/comshtps.h" #ifndef O_BINARY #define O_BINARY (0) -- 2.39.2