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
IN_ReadControl(0,&player);\r
if(IN_KeyDown(sc_Escape)) engi_stat = ENGI_EXIT;\r
shinku(&gvar);\r
+ _DEBUGF("Serial debug output printf test %u %u %u\n",1U,2U,3U);\r
}\r
switch(detectcpu())\r
{\r
typedef union REGPACK regs_t;\r
#endif\r
\r
-#ifdef __WATCOMC__\r
-typedef void __based(__self) * memptr;\r
-#endif\r
-#ifdef __BORLANDC__\r
-typedef void _seg * memptr;\r
-#endif\r
-\r
#define INPUT_STATUS_1 0x03da\r
\r
/* local function */\r
#define BUFFERSIZE 0x1000 // miscelanious, allways available buffer
-#define MAXBLOCKS 1024
+//moved to typdefst
+//#define MAXBLOCKS 1024
//==========================================================================
-typedef struct
+//moved to typdefst
+/*typedef struct
{
dword nearheap,farheap,EMSmem,XMSmem,mainmem;
-} mminfotype;
+} mminfotype;*/
//==========================================================================
#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;
//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;*/
/*
=============================================================================
*
*/
#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;
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)
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));
// 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:
\r
#include "src/lib/types.h"\r
\r
-\r
#define AARED "\x1b[41;31m"\r
#define AABLUE "\x1b[44;34m"\r
#define AAGREEN "\x1b[42;32m"\r
//0000word startclk; float clk, tickclk; //timer\r
} video_t;\r
\r
+typedef struct mmblockstruct\r
+{\r
+ word start,length;\r
+ //word start; dword length;\r
+ word blob; //for data larger than 64k\r
+ unsigned attributes;\r
+ memptr *useptr; // pointer to the segment start\r
+ //huge struct mmblockstruct huge *next;\r
+ struct mmblockstruct far *next;\r
+} mmblocktype;\r
+\r
+//from 16_mm\r
+//==========================================================================\r
+\r
+#define MAXBLOCKS 1024\r
+#define MAXUMBS 12\r
+\r
+typedef struct\r
+{\r
+ dword nearheap,farheap,EMSmem,XMSmem,mainmem;\r
+} mminfotype;\r
+\r
+typedef struct\r
+{\r
+ memptr bufferseg;\r
+ boolean mmstarted, bombonerror, mmerror;\r
+ //huge void huge *farheap;\r
+ void far *farheap;\r
+#ifdef __BORLANDC__\r
+ void *nearheap;\r
+#endif\r
+#ifdef __WATCOMC__\r
+ void __near *nearheap;\r
+#endif\r
+ //byte EMS_status;\r
+ unsigned totalEMSpages,freeEMSpages,EMSpageframe,EMSpagesmapped,EMShandle;\r
+ unsigned int EMSVer;\r
+ word numUMBs,UMBbase[MAXUMBS];\r
+ //dword numUMBs,UMBbase[MAXUMBS];\r
+ //huge mmblocktype huge mmblocks[MAXBLOCKS],huge *mmhead,huge *mmfree,huge *mmrover,huge *mmnew;\r
+ mmblocktype far mmblocks[MAXBLOCKS],far *mmhead,far *mmfree,far *mmrover,far *mmnew;\r
+} mminfo_t;\r
+\r
+//==========================================================================\r
+\r
+//actual global game varables!\r
typedef struct\r
{\r
video_t video; // video settings variable\r
\r
typedef enum {false,true} boolean;\r
\r
+#ifdef __WATCOMC__\r
+typedef void __based(__self) * memptr;\r
+#endif\r
+#ifdef __BORLANDC__\r
+typedef void _seg * memptr;\r
+#endif\r
+\r
#endif/*_TYPE_H_*/\r