From: sparky4 Date: Sat, 30 Jul 2016 03:52:19 +0000 (-0500) Subject: 16.exe serial print debug X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=4c7ecb54bd2cb284aa34e72b80bf7c0de120026a;p=16.git 16.exe serial print debug --- diff --git a/makefile b/makefile index 2591d80f..92994fb8 100755 --- a/makefile +++ b/makefile @@ -92,7 +92,8 @@ FLAGS=$(CFLAGS) $(OFLAGS) $(DFLAGS) $(ZFLAGS) VGMSNDOBJ = vgmSnd.$(OBJ) 16_snd.$(OBJ) DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ) 16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) 16_ca.$(OBJ) 16_dbg.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) 16_timer.$(OBJ) -GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) 16_vrs.$(OBJ) $(DOSLIBLIBS) +GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) $(DOSLIBLIBS) +#16_vrs.$(OBJ) #planar.$(OBJ) 16planar.$(OBJ) DOSLIBLIBS=$(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)cpu$(DIRSEP)dos86h$(DIRSEP)cpu.lib $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)dos$(DIRSEP)dos86h$(DIRSEP)dos.lib $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga$(DIRSEP)dos86h$(DIRSEP)vga.lib diff --git a/planrpcx.exe b/planrpcx.exe new file mode 100755 index 00000000..14628932 Binary files /dev/null and b/planrpcx.exe differ diff --git a/src/16.c b/src/16.c index 5e512422..6ad5334f 100755 --- a/src/16.c +++ b/src/16.c @@ -81,6 +81,7 @@ main(int argc, char *argv[]) IN_ReadControl(0,&player); if(IN_KeyDown(sc_Escape)) engi_stat = ENGI_EXIT; shinku(&gvar); + _DEBUGF("Serial debug output printf test %u %u %u\n",1U,2U,3U); } switch(detectcpu()) { diff --git a/src/lib/16_head.h b/src/lib/16_head.h index 273cc60f..b7aab1bd 100755 --- a/src/lib/16_head.h +++ b/src/lib/16_head.h @@ -167,13 +167,6 @@ extern int profilehandle,debughandle; //make it into game global typedef union REGPACK regs_t; #endif -#ifdef __WATCOMC__ -typedef void __based(__self) * memptr; -#endif -#ifdef __BORLANDC__ -typedef void _seg * memptr; -#endif - #define INPUT_STATUS_1 0x03da /* local function */ diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h index de35b428..963eb3a4 100755 --- a/src/lib/16_mm.h +++ b/src/lib/16_mm.h @@ -44,7 +44,8 @@ #define BUFFERSIZE 0x1000 // miscelanious, allways available buffer -#define MAXBLOCKS 1024 +//moved to typdefst +//#define MAXBLOCKS 1024 @@ -88,10 +89,11 @@ //========================================================================== -typedef struct +//moved to typdefst +/*typedef struct { dword nearheap,farheap,EMSmem,XMSmem,mainmem; -} mminfotype; +} mminfotype;*/ //========================================================================== @@ -114,10 +116,12 @@ extern void (* XMSaddr) (void); // far pointer to XMS driver #define PURGEMASK 0xfffc #define BASEATTRIBUTES 0 // unlocked, non purgable -#define MAXUMBS 12 +//moved to typedefst +//#define MAXUMBS 12 #define MAPPAGES 4//mm->EMSpagesmapped -typedef struct mmblockstruct +//moved to typdefst +/*typedef struct mmblockstruct { word start,length; //word start; dword length; @@ -148,7 +152,7 @@ typedef struct //dword numUMBs,UMBbase[MAXUMBS]; //huge mmblocktype huge mmblocks[MAXBLOCKS],huge *mmhead,huge *mmfree,huge *mmrover,huge *mmnew; mmblocktype far mmblocks[MAXBLOCKS],far *mmhead,far *mmfree,far *mmrover,far *mmnew; -} mminfo_t; +} mminfo_t;*/ /* ============================================================================= diff --git a/src/lib/16_vrs.c b/src/lib/16_vrs.c index 054702f3..8cb41fa4 100755 --- a/src/lib/16_vrs.c +++ b/src/lib/16_vrs.c @@ -20,29 +20,26 @@ * */ #include "src/lib/16_vrs.h" -#include "src/lib/typedefst.h" - -extern global_game_variables_t gvar; // Read .vrs file into far memory -int read_vrs(char *filename, struct vrs_container *vrs_cont){ +int read_vrs(global_game_variables_t *gvar, char *filename, struct vrs_container *vrs_cont){ int fd; dword size; byte huge *buffer; // Open filename, get size of file, // populate the vrs_container if all tests pass - fd = open(filename, O_RDONLY|O_BINARY); + fd = open((filename), O_RDONLY|O_BINARY); size = filelength(fd); close(fd); // Insert sanity cheks later - CA_LoadFile(filename, buffer, gvar->mm, gvar->mmi); + CA_LoadFile(filename, buffer, &gvar->mm, &gvar->mmi); vrs_cont->size = size; vrs_cont->buffer = buffer; return 0; } // Seek and return a specified .vrl blob from .vrs blob in far memory -struct vrl_container get_vrl_by_id(struct vrs_container huge *vrs_cont, uint16_t id){ +struct vrl_container get_vrl_by_id(struct vrs_container /*huge*/ *vrs_cont, uint16_t id){ uint16_t huge *ids; uint32_t huge *vrl_list; struct vrl_container huge *vrl_cont; @@ -53,7 +50,7 @@ struct vrl_container get_vrl_by_id(struct vrs_container huge *vrs_cont, uint16_t return 0; } // Get id list from .vrs blob (base + offset) - ids = (uint16_t huge*)vrs_cont->buffer + + ids = (uint16_t huge*)vrs_cont->buffer + (dword)vrs_cont->vrs_hdr->offset_table[VRS_HEADER_OFFSET_SPRITE_ID_LIST]; // Loop through the id list until we found the right one or hit the end of the list // Counter is keeping track of the offset(in ids/vrl blobs) @@ -66,7 +63,7 @@ struct vrl_container get_vrl_by_id(struct vrs_container huge *vrs_cont, uint16_t return 0; } // Get vrl list from .vrs blob (base + offset) - vrl_list = (uint32_t huge *)(vrs_cont->buffer + + vrl_list = (uint32_t huge *)(vrs_cont->buffer + vrs_cont->vrs_hdr->offset_table[VRS_HEADER_OFFSET_VRS_LIST]); // Allocate memory for vrl_cont vrl_cont = (struct vrl_container)malloc(sizeof(struct vrl_container)); diff --git a/src/lib/16_vrs.h b/src/lib/16_vrs.h index 8e489964..8fb4ad12 100755 --- a/src/lib/16_vrs.h +++ b/src/lib/16_vrs.h @@ -58,7 +58,7 @@ struct vrl_container{ // to load the file into // Out: // + int - 0 on succes, 1 on failure -int read_vrs(char *filename, struct vrs_container *vrs_cont); +int read_vrs(global_game_variables_t *gvar, char *filename, struct vrs_container *vrs_cont); // Seek and return a specified .vrl blob from .vrs blob in memory // In: diff --git a/src/lib/typdefst.h b/src/lib/typdefst.h index 6dbfa213..76082c56 100755 --- a/src/lib/typdefst.h +++ b/src/lib/typdefst.h @@ -25,7 +25,6 @@ #include "src/lib/types.h" - #define AARED "\x1b[41;31m" #define AABLUE "\x1b[44;34m" #define AAGREEN "\x1b[42;32m" @@ -133,6 +132,52 @@ typedef struct //0000word startclk; float clk, tickclk; //timer } video_t; +typedef struct mmblockstruct +{ + word start,length; + //word start; dword length; + word blob; //for data larger than 64k + unsigned attributes; + memptr *useptr; // pointer to the segment start + //huge struct mmblockstruct huge *next; + struct mmblockstruct far *next; +} mmblocktype; + +//from 16_mm +//========================================================================== + +#define MAXBLOCKS 1024 +#define MAXUMBS 12 + +typedef struct +{ + dword nearheap,farheap,EMSmem,XMSmem,mainmem; +} mminfotype; + +typedef struct +{ + memptr bufferseg; + boolean mmstarted, bombonerror, mmerror; + //huge void huge *farheap; + void far *farheap; +#ifdef __BORLANDC__ + void *nearheap; +#endif +#ifdef __WATCOMC__ + void __near *nearheap; +#endif + //byte EMS_status; + unsigned totalEMSpages,freeEMSpages,EMSpageframe,EMSpagesmapped,EMShandle; + unsigned int EMSVer; + word numUMBs,UMBbase[MAXUMBS]; + //dword numUMBs,UMBbase[MAXUMBS]; + //huge mmblocktype huge mmblocks[MAXBLOCKS],huge *mmhead,huge *mmfree,huge *mmrover,huge *mmnew; + mmblocktype far mmblocks[MAXBLOCKS],far *mmhead,far *mmfree,far *mmrover,far *mmnew; +} mminfo_t; + +//========================================================================== + +//actual global game varables! typedef struct { video_t video; // video settings variable diff --git a/src/lib/types.h b/src/lib/types.h index cf6b4e9e..d5528daf 100755 --- a/src/lib/types.h +++ b/src/lib/types.h @@ -42,4 +42,11 @@ typedef signed long int sdiword; typedef enum {false,true} boolean; +#ifdef __WATCOMC__ +typedef void __based(__self) * memptr; +#endif +#ifdef __BORLANDC__ +typedef void _seg * memptr; +#endif + #endif/*_TYPE_H_*/ diff --git a/test2.exe b/test2.exe new file mode 100755 index 00000000..6d85c738 Binary files /dev/null and b/test2.exe differ