• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

wwww


Commit MetaInfo

Revision4c7ecb54bd2cb284aa34e72b80bf7c0de120026a (tree)
Time2016-07-30 12:52:19
Authorsparky4 <sparky4@cock...>
Commitersparky4

Log Message

16.exe serial print debug

Change Summary

Incremental Difference

--- a/makefile
+++ b/makefile
@@ -92,7 +92,8 @@ FLAGS=$(CFLAGS) $(OFLAGS) $(DFLAGS) $(ZFLAGS)
9292 VGMSNDOBJ = vgmSnd.$(OBJ) 16_snd.$(OBJ)
9393 DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ)
9494 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)
9697 #planar.$(OBJ) 16planar.$(OBJ)
9798 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
9899
Binary files /dev/null and b/planrpcx.exe differ
--- a/src/16.c
+++ b/src/16.c
@@ -81,6 +81,7 @@ main(int argc, char *argv[])
8181 IN_ReadControl(0,&player);
8282 if(IN_KeyDown(sc_Escape)) engi_stat = ENGI_EXIT;
8383 shinku(&gvar);
84+ _DEBUGF("Serial debug output printf test %u %u %u\n",1U,2U,3U);
8485 }
8586 switch(detectcpu())
8687 {
--- 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
167167 typedef union REGPACK regs_t;
168168 #endif
169169
170-#ifdef __WATCOMC__
171-typedef void __based(__self) * memptr;
172-#endif
173-#ifdef __BORLANDC__
174-typedef void _seg * memptr;
175-#endif
176-
177170 #define INPUT_STATUS_1 0x03da
178171
179172 /* local function */
--- a/src/lib/16_mm.h
+++ b/src/lib/16_mm.h
@@ -44,7 +44,8 @@
4444
4545 #define BUFFERSIZE 0x1000 // miscelanious, allways available buffer
4646
47-#define MAXBLOCKS 1024
47+//moved to typdefst
48+//#define MAXBLOCKS 1024
4849
4950
5051
@@ -88,10 +89,11 @@
8889
8990 //==========================================================================
9091
91-typedef struct
92+//moved to typdefst
93+/*typedef struct
9294 {
9395 dword nearheap,farheap,EMSmem,XMSmem,mainmem;
94-} mminfotype;
96+} mminfotype;*/
9597
9698 //==========================================================================
9799
@@ -114,10 +116,12 @@ extern void (* XMSaddr) (void); // far pointer to XMS driver
114116 #define PURGEMASK 0xfffc
115117 #define BASEATTRIBUTES 0 // unlocked, non purgable
116118
117-#define MAXUMBS 12
119+//moved to typedefst
120+//#define MAXUMBS 12
118121 #define MAPPAGES 4//mm->EMSpagesmapped
119122
120-typedef struct mmblockstruct
123+//moved to typdefst
124+/*typedef struct mmblockstruct
121125 {
122126 word start,length;
123127 //word start; dword length;
@@ -148,7 +152,7 @@ typedef struct
148152 //dword numUMBs,UMBbase[MAXUMBS];
149153 //huge mmblocktype huge mmblocks[MAXBLOCKS],huge *mmhead,huge *mmfree,huge *mmrover,huge *mmnew;
150154 mmblocktype far mmblocks[MAXBLOCKS],far *mmhead,far *mmfree,far *mmrover,far *mmnew;
151-} mminfo_t;
155+} mminfo_t;*/
152156
153157 /*
154158 =============================================================================
--- a/src/lib/16_vrs.c
+++ b/src/lib/16_vrs.c
@@ -20,29 +20,26 @@
2020 *
2121 */
2222 #include "src/lib/16_vrs.h"
23-#include "src/lib/typedefst.h"
24-
25-extern global_game_variables_t gvar;
2623
2724 // 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){
2926 int fd;
3027 dword size;
3128 byte huge *buffer;
3229 // Open filename, get size of file,
3330 // populate the vrs_container if all tests pass
34- fd = open(filename, O_RDONLY|O_BINARY);
31+ fd = open((filename), O_RDONLY|O_BINARY);
3532 size = filelength(fd);
3633 close(fd);
3734 // Insert sanity cheks later
38- CA_LoadFile(filename, buffer, gvar->mm, gvar->mmi);
35+ CA_LoadFile(filename, buffer, &gvar->mm, &gvar->mmi);
3936 vrs_cont->size = size;
4037 vrs_cont->buffer = buffer;
4138 return 0;
4239 }
4340
4441 // 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){
4643 uint16_t huge *ids;
4744 uint32_t huge *vrl_list;
4845 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
5350 return 0;
5451 }
5552 // Get id list from .vrs blob (base + offset)
56- ids = (uint16_t huge*)vrs_cont->buffer +
53+ ids = (uint16_t huge*)vrs_cont->buffer +
5754 (dword)vrs_cont->vrs_hdr->offset_table[VRS_HEADER_OFFSET_SPRITE_ID_LIST];
5855 // Loop through the id list until we found the right one or hit the end of the list
5956 // 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
6663 return 0;
6764 }
6865 // 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 +
7067 vrs_cont->vrs_hdr->offset_table[VRS_HEADER_OFFSET_VRS_LIST]);
7168 // Allocate memory for vrl_cont
7269 vrl_cont = (struct vrl_container)malloc(sizeof(struct vrl_container));
--- a/src/lib/16_vrs.h
+++ b/src/lib/16_vrs.h
@@ -58,7 +58,7 @@ struct vrl_container{
5858 // to load the file into
5959 // Out:
6060 // + 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);
6262
6363 // Seek and return a specified .vrl blob from .vrs blob in memory
6464 // In:
--- a/src/lib/typdefst.h
+++ b/src/lib/typdefst.h
@@ -25,7 +25,6 @@
2525
2626 #include "src/lib/types.h"
2727
28-
2928 #define AARED "\x1b[41;31m"
3029 #define AABLUE "\x1b[44;34m"
3130 #define AAGREEN "\x1b[42;32m"
@@ -133,6 +132,52 @@ typedef struct
133132 //0000word startclk; float clk, tickclk; //timer
134133 } video_t;
135134
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!
136181 typedef struct
137182 {
138183 video_t video; // video settings variable
--- a/src/lib/types.h
+++ b/src/lib/types.h
@@ -42,4 +42,11 @@ typedef signed long int sdiword;
4242
4343 typedef enum {false,true} boolean;
4444
45+#ifdef __WATCOMC__
46+typedef void __based(__self) * memptr;
47+#endif
48+#ifdef __BORLANDC__
49+typedef void _seg * memptr;
50+#endif
51+
4552 #endif/*_TYPE_H_*/
Binary files /dev/null and b/test2.exe differ