wwww
Revision | 4c7ecb54bd2cb284aa34e72b80bf7c0de120026a (tree) |
---|---|
Time | 2016-07-30 12:52:19 |
Author | sparky4 <sparky4@cock...> |
Commiter | sparky4 |
16.exe serial print debug
@@ -92,7 +92,8 @@ FLAGS=$(CFLAGS) $(OFLAGS) $(DFLAGS) $(ZFLAGS) | ||
92 | 92 | VGMSNDOBJ = vgmSnd.$(OBJ) 16_snd.$(OBJ) |
93 | 93 | DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ) |
94 | 94 | 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) |
95 | -GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) 16_vrs.$(OBJ) $(DOSLIBLIBS) | |
95 | +GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) $(DOSLIBLIBS) | |
96 | +#16_vrs.$(OBJ) | |
96 | 97 | #planar.$(OBJ) 16planar.$(OBJ) |
97 | 98 | 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 |
98 | 99 |
@@ -81,6 +81,7 @@ main(int argc, char *argv[]) | ||
81 | 81 | IN_ReadControl(0,&player); |
82 | 82 | if(IN_KeyDown(sc_Escape)) engi_stat = ENGI_EXIT; |
83 | 83 | shinku(&gvar); |
84 | + _DEBUGF("Serial debug output printf test %u %u %u\n",1U,2U,3U); | |
84 | 85 | } |
85 | 86 | switch(detectcpu()) |
86 | 87 | { |
@@ -167,13 +167,6 @@ extern int profilehandle,debughandle; //make it into game global | ||
167 | 167 | typedef union REGPACK regs_t; |
168 | 168 | #endif |
169 | 169 | |
170 | -#ifdef __WATCOMC__ | |
171 | -typedef void __based(__self) * memptr; | |
172 | -#endif | |
173 | -#ifdef __BORLANDC__ | |
174 | -typedef void _seg * memptr; | |
175 | -#endif | |
176 | - | |
177 | 170 | #define INPUT_STATUS_1 0x03da |
178 | 171 | |
179 | 172 | /* local function */ |
@@ -44,7 +44,8 @@ | ||
44 | 44 | |
45 | 45 | #define BUFFERSIZE 0x1000 // miscelanious, allways available buffer |
46 | 46 | |
47 | -#define MAXBLOCKS 1024 | |
47 | +//moved to typdefst | |
48 | +//#define MAXBLOCKS 1024 | |
48 | 49 | |
49 | 50 | |
50 | 51 |
@@ -88,10 +89,11 @@ | ||
88 | 89 | |
89 | 90 | //========================================================================== |
90 | 91 | |
91 | -typedef struct | |
92 | +//moved to typdefst | |
93 | +/*typedef struct | |
92 | 94 | { |
93 | 95 | dword nearheap,farheap,EMSmem,XMSmem,mainmem; |
94 | -} mminfotype; | |
96 | +} mminfotype;*/ | |
95 | 97 | |
96 | 98 | //========================================================================== |
97 | 99 |
@@ -114,10 +116,12 @@ extern void (* XMSaddr) (void); // far pointer to XMS driver | ||
114 | 116 | #define PURGEMASK 0xfffc |
115 | 117 | #define BASEATTRIBUTES 0 // unlocked, non purgable |
116 | 118 | |
117 | -#define MAXUMBS 12 | |
119 | +//moved to typedefst | |
120 | +//#define MAXUMBS 12 | |
118 | 121 | #define MAPPAGES 4//mm->EMSpagesmapped |
119 | 122 | |
120 | -typedef struct mmblockstruct | |
123 | +//moved to typdefst | |
124 | +/*typedef struct mmblockstruct | |
121 | 125 | { |
122 | 126 | word start,length; |
123 | 127 | //word start; dword length; |
@@ -148,7 +152,7 @@ typedef struct | ||
148 | 152 | //dword numUMBs,UMBbase[MAXUMBS]; |
149 | 153 | //huge mmblocktype huge mmblocks[MAXBLOCKS],huge *mmhead,huge *mmfree,huge *mmrover,huge *mmnew; |
150 | 154 | mmblocktype far mmblocks[MAXBLOCKS],far *mmhead,far *mmfree,far *mmrover,far *mmnew; |
151 | -} mminfo_t; | |
155 | +} mminfo_t;*/ | |
152 | 156 | |
153 | 157 | /* |
154 | 158 | ============================================================================= |
@@ -20,29 +20,26 @@ | ||
20 | 20 | * |
21 | 21 | */ |
22 | 22 | #include "src/lib/16_vrs.h" |
23 | -#include "src/lib/typedefst.h" | |
24 | - | |
25 | -extern global_game_variables_t gvar; | |
26 | 23 | |
27 | 24 | // Read .vrs file into far memory |
28 | -int read_vrs(char *filename, struct vrs_container *vrs_cont){ | |
25 | +int read_vrs(global_game_variables_t *gvar, char *filename, struct vrs_container *vrs_cont){ | |
29 | 26 | int fd; |
30 | 27 | dword size; |
31 | 28 | byte huge *buffer; |
32 | 29 | // Open filename, get size of file, |
33 | 30 | // populate the vrs_container if all tests pass |
34 | - fd = open(filename, O_RDONLY|O_BINARY); | |
31 | + fd = open((filename), O_RDONLY|O_BINARY); | |
35 | 32 | size = filelength(fd); |
36 | 33 | close(fd); |
37 | 34 | // Insert sanity cheks later |
38 | - CA_LoadFile(filename, buffer, gvar->mm, gvar->mmi); | |
35 | + CA_LoadFile(filename, buffer, &gvar->mm, &gvar->mmi); | |
39 | 36 | vrs_cont->size = size; |
40 | 37 | vrs_cont->buffer = buffer; |
41 | 38 | return 0; |
42 | 39 | } |
43 | 40 | |
44 | 41 | // Seek and return a specified .vrl blob from .vrs blob in far memory |
45 | -struct vrl_container get_vrl_by_id(struct vrs_container huge *vrs_cont, uint16_t id){ | |
42 | +struct vrl_container get_vrl_by_id(struct vrs_container /*huge*/ *vrs_cont, uint16_t id){ | |
46 | 43 | uint16_t huge *ids; |
47 | 44 | uint32_t huge *vrl_list; |
48 | 45 | 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 | ||
53 | 50 | return 0; |
54 | 51 | } |
55 | 52 | // Get id list from .vrs blob (base + offset) |
56 | - ids = (uint16_t huge*)vrs_cont->buffer + | |
53 | + ids = (uint16_t huge*)vrs_cont->buffer + | |
57 | 54 | (dword)vrs_cont->vrs_hdr->offset_table[VRS_HEADER_OFFSET_SPRITE_ID_LIST]; |
58 | 55 | // Loop through the id list until we found the right one or hit the end of the list |
59 | 56 | // 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 | ||
66 | 63 | return 0; |
67 | 64 | } |
68 | 65 | // Get vrl list from .vrs blob (base + offset) |
69 | - vrl_list = (uint32_t huge *)(vrs_cont->buffer + | |
66 | + vrl_list = (uint32_t huge *)(vrs_cont->buffer + | |
70 | 67 | vrs_cont->vrs_hdr->offset_table[VRS_HEADER_OFFSET_VRS_LIST]); |
71 | 68 | // Allocate memory for vrl_cont |
72 | 69 | vrl_cont = (struct vrl_container)malloc(sizeof(struct vrl_container)); |
@@ -58,7 +58,7 @@ struct vrl_container{ | ||
58 | 58 | // to load the file into |
59 | 59 | // Out: |
60 | 60 | // + int - 0 on succes, 1 on failure |
61 | -int read_vrs(char *filename, struct vrs_container *vrs_cont); | |
61 | +int read_vrs(global_game_variables_t *gvar, char *filename, struct vrs_container *vrs_cont); | |
62 | 62 | |
63 | 63 | // Seek and return a specified .vrl blob from .vrs blob in memory |
64 | 64 | // In: |
@@ -25,7 +25,6 @@ | ||
25 | 25 | |
26 | 26 | #include "src/lib/types.h" |
27 | 27 | |
28 | - | |
29 | 28 | #define AARED "\x1b[41;31m" |
30 | 29 | #define AABLUE "\x1b[44;34m" |
31 | 30 | #define AAGREEN "\x1b[42;32m" |
@@ -133,6 +132,52 @@ typedef struct | ||
133 | 132 | //0000word startclk; float clk, tickclk; //timer |
134 | 133 | } video_t; |
135 | 134 | |
135 | +typedef struct mmblockstruct | |
136 | +{ | |
137 | + word start,length; | |
138 | + //word start; dword length; | |
139 | + word blob; //for data larger than 64k | |
140 | + unsigned attributes; | |
141 | + memptr *useptr; // pointer to the segment start | |
142 | + //huge struct mmblockstruct huge *next; | |
143 | + struct mmblockstruct far *next; | |
144 | +} mmblocktype; | |
145 | + | |
146 | +//from 16_mm | |
147 | +//========================================================================== | |
148 | + | |
149 | +#define MAXBLOCKS 1024 | |
150 | +#define MAXUMBS 12 | |
151 | + | |
152 | +typedef struct | |
153 | +{ | |
154 | + dword nearheap,farheap,EMSmem,XMSmem,mainmem; | |
155 | +} mminfotype; | |
156 | + | |
157 | +typedef struct | |
158 | +{ | |
159 | + memptr bufferseg; | |
160 | + boolean mmstarted, bombonerror, mmerror; | |
161 | + //huge void huge *farheap; | |
162 | + void far *farheap; | |
163 | +#ifdef __BORLANDC__ | |
164 | + void *nearheap; | |
165 | +#endif | |
166 | +#ifdef __WATCOMC__ | |
167 | + void __near *nearheap; | |
168 | +#endif | |
169 | + //byte EMS_status; | |
170 | + unsigned totalEMSpages,freeEMSpages,EMSpageframe,EMSpagesmapped,EMShandle; | |
171 | + unsigned int EMSVer; | |
172 | + word numUMBs,UMBbase[MAXUMBS]; | |
173 | + //dword numUMBs,UMBbase[MAXUMBS]; | |
174 | + //huge mmblocktype huge mmblocks[MAXBLOCKS],huge *mmhead,huge *mmfree,huge *mmrover,huge *mmnew; | |
175 | + mmblocktype far mmblocks[MAXBLOCKS],far *mmhead,far *mmfree,far *mmrover,far *mmnew; | |
176 | +} mminfo_t; | |
177 | + | |
178 | +//========================================================================== | |
179 | + | |
180 | +//actual global game varables! | |
136 | 181 | typedef struct |
137 | 182 | { |
138 | 183 | video_t video; // video settings variable |
@@ -42,4 +42,11 @@ typedef signed long int sdiword; | ||
42 | 42 | |
43 | 43 | typedef enum {false,true} boolean; |
44 | 44 | |
45 | +#ifdef __WATCOMC__ | |
46 | +typedef void __based(__self) * memptr; | |
47 | +#endif | |
48 | +#ifdef __BORLANDC__ | |
49 | +typedef void _seg * memptr; | |
50 | +#endif | |
51 | + | |
45 | 52 | #endif/*_TYPE_H_*/ |