From: sparky4 Date: Mon, 31 Oct 2016 16:42:41 +0000 (-0500) Subject: ==== OK i removed all warnings wwww X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=fb900d77df687bfa549995e15a762017c381e552;p=16.git ==== OK i removed all warnings wwww --- diff --git a/.makefile.kate-swp b/.makefile.kate-swp deleted file mode 100755 index d00c921e..00000000 Binary files a/.makefile.kate-swp and /dev/null differ diff --git a/makefile b/makefile index 7eacf644..3a190a4f 100755 --- a/makefile +++ b/makefile @@ -4,23 +4,23 @@ # # Possible optimizations for 8088 class processors # -# -oa Relax alias checking -# -ob Try to generate straight line code +# -oaRelax alias checking +# -obTry to generate straight line code # -oe - expand user functions inline (-oe=20 is default, adds lots of code) -# -oh Enable repeated optimizations -# -oi generate certain lib funcs inline -# -oi+ Set max inline depth (C++ only, use -oi for C) -# -ok Flowing of register save into function flow graph -# -ol loop optimizations -# -ol+ loop optimizations plus unrolling -# -or Reorder for pipelined (486+ procs); not sure if good to use -# -os Favor space over time -# -ot Favor time over space -# -ei Allocate an "int" for all enum types -# -zp2 Allow compiler to add padding to structs -# -zpw Use with above; make sure you are warning free! -# -0 8088/8086 class code generation -# -s disable stack overflow checking +# -ohEnable repeated optimizations +# -oigenerate certain lib funcs inline +# -oi+Set max inline depth (C++ only, use -oi for C) +# -okFlowing of register save into function flow graph +# -olloop optimizations +# -ol+loop optimizations plus unrolling +# -orReorder for pipelined (486+ procs); not sure if good to use +# -osFavor space over time +# -otFavor time over space +# -eiAllocate an "int" for all enum types +# -zp2Allow compiler to add padding to structs +# -zpwUse with above; make sure you are warning free! +# -0 8088/8086 class code generation +# -s disable stack overflow checking # -zk0u translate kanji to unicode... wwww # -zk0 kanji support~ @@ -107,7 +107,7 @@ LIBFLAGS=$(WLIBQ) -b -n # VGMSNDOBJ = vgmSnd.$(OBJ) 16_snd.$(OBJ) GFXLIBOBJS = 16_vl.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) 16_vrs.$(OBJ) 16_sprit.$(OBJ) -OLDGFXLIBOBJS=bitmap.$(OBJ) +OLDLIBOBJS=bitmap.$(OBJ) mapread.$(OBJ) 16LIBOBJS = 16_mm.$(OBJ) 16_pm.$(OBJ) 16_ca.$(OBJ) 16_tail.$(OBJ) 16_in.$(OBJ) 16_head.$(OBJ) 16_dbg.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) wcpu.$(OBJ) 16_timer.$(OBJ) 16_map.$(OBJ) jsmn.$(OBJ) #16planar.$(OBJ) planar.$(OBJ) DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ) @@ -155,31 +155,31 @@ DOSLIBLIBS += $(DOSLIB_8250)/dos86h/8250.lib # List of executables to build # TESTEXEC = & - tesuto.exe & - 0.exe & - scroll.exe & - zcroll.exe & - exmmtest.exe & - vrstest.exe + tesuto.exe & + 0.exe & + zcroll.exe & + exmmtest.exe & + vrstest.exe TESTEXEC2 = & - vgmtest.exe & - inputest.exe & - maptest.exe & - fmemtest.exe & - fonttest.exe & - fontgfx.exe & - test.exe & - test0.exe & - pcxtest.exe & - pcxtest2.exe + scroll.exe & + vgmtest.exe & + inputest.exe & + maptest.exe & + fmemtest.exe & + fonttest.exe & + fontgfx.exe & + test.exe & + test0.exe & + pcxtest.exe & + pcxtest2.exe UTILEXEC = & - palettel.exe & - palettec.exe + palettel.exe & + palettec.exe EXEC = & - 16.exe & - bakapi.exe & - $(UTILEXEC) & - $(TESTEXEC) + 16.exe & + bakapi.exe & + $(UTILEXEC) & + $(TESTEXEC) all: $(EXEC) joytest.exe testexec: $(EXEC) joytest.exe $(TESTEXEC2) @@ -187,70 +187,70 @@ testexec: $(EXEC) joytest.exe $(TESTEXEC2) # # game and bakapi executables # -16.exe: 16.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS) -bakapi.exe: bakapi.$(OBJ) gfx.lib $(DOSLIBLIBS) +16.exe: 16.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS) +bakapi.exe: bakapi.$(OBJ) gfx.lib $(DOSLIBLIBS) # # Test Executables! # -scroll.exe: scroll.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS) $(OLDGFXLIBOBJS) -scroll.$(OBJ): $(SRC)/scroll.c -zcroll.exe: zcroll.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS) -zcroll.$(OBJ): $(SRC)/zcroll.c -tesuto.exe: tesuto.$(OBJ) 16_head.$(OBJ) gfx.lib $(DOSLIBLIBS) -tesuto.$(OBJ): $(SRC)/tesuto.c -0.exe: 0.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS) -0.$(OBJ): $(SRC)/0.c -test.exe: test.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS) -#test2.exe: test2.$(OBJ) gfx.lib $(DOSLIBLIBS) -test0.exe: test0.$(OBJ) -fonttest.exe: fonttest.$(OBJ) gfx.lib -#fonttes0.exe: fonttes0.$(OBJ) $(16LIB) -fontgfx.exe: fontgfx.$(OBJ) gfx.lib $(DOSLIBLIBS) -inputest.exe: inputest.$(OBJ) $(16LIB) $(DOSLIBLIBS) -#sountest.exe: sountest.$(OBJ) $(16LIB) -pcxtest.exe: pcxtest.$(OBJ) gfx.lib $(DOSLIBLIBS) $(OLDGFXLIBOBJS) -vrstest.exe: vrstest.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS) -#vgacamm.exe: vgacamm.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS) -palettec.exe: palettec.$(OBJ) gfx.lib $(DOSLIBLIBS) -palettel.exe: palettel.$(OBJ) gfx.lib $(DOSLIBLIBS) -pcxtest2.exe: pcxtest2.$(OBJ) gfx.lib $(DOSLIBLIBS) $(OLDGFXLIBOBJS) -#planrpcx.exe: planrpcx.$(OBJ) gfx.lib -maptest.exe: maptest.$(OBJ) 16_map.$(OBJ) 16_head.$(OBJ) gfx.lib $(DOSLIBLIBS) -fmemtest.exe: fmemtest.$(OBJ) -exmmtest.exe: exmmtest.$(OBJ) $(16LIB) $(DOSLIBLIBS) -vgmtest.exe: vgmtest.$(OBJ) vgmsnd.lib $(16LIB) $(DOSLIBLIBS) +scroll.exe: scroll.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS) $(OLDLIBOBJS) +scroll.$(OBJ): $(SRC)/scroll.c +zcroll.exe: zcroll.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS) +zcroll.$(OBJ): $(SRC)/zcroll.c +tesuto.exe: tesuto.$(OBJ) 16_head.$(OBJ) gfx.lib $(DOSLIBLIBS) +tesuto.$(OBJ): $(SRC)/tesuto.c +0.exe: 0.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS) +0.$(OBJ): $(SRC)/0.c +test.exe: test.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS) +#test2.exe: test2.$(OBJ) gfx.lib $(DOSLIBLIBS) +test0.exe: test0.$(OBJ) +fonttest.exe: fonttest.$(OBJ) gfx.lib +#fonttes0.exe: fonttes0.$(OBJ) $(16LIB) +fontgfx.exe: fontgfx.$(OBJ) gfx.lib $(DOSLIBLIBS) +inputest.exe: inputest.$(OBJ) $(16LIB) $(DOSLIBLIBS) +#sountest.exe: sountest.$(OBJ) $(16LIB) +pcxtest.exe: pcxtest.$(OBJ) gfx.lib $(DOSLIBLIBS) $(OLDLIBOBJS) +vrstest.exe: vrstest.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS) +#vgacamm.exe: vgacamm.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS) +palettec.exe: palettec.$(OBJ) gfx.lib $(DOSLIBLIBS) +palettel.exe: palettel.$(OBJ) gfx.lib $(DOSLIBLIBS) +pcxtest2.exe: pcxtest2.$(OBJ) gfx.lib $(DOSLIBLIBS) $(OLDLIBOBJS) +#planrpcx.exe: planrpcx.$(OBJ) gfx.lib +maptest.exe: maptest.$(OBJ) 16_map.$(OBJ) 16_head.$(OBJ) gfx.lib $(DOSLIBLIBS) +fmemtest.exe: fmemtest.$(OBJ) +exmmtest.exe: exmmtest.$(OBJ) $(16LIB) $(DOSLIBLIBS) +vgmtest.exe: vgmtest.$(OBJ) vgmsnd.lib $(16LIB) $(DOSLIBLIBS) # # executable's objects # -16.$(OBJ): $(SRC)/16.c $(SRC)/16.h -bakapi.$(OBJ): $(SRC)/bakapi.c $(SRC)/bakapi.h -test.$(OBJ): $(SRC)/test.c $(SRCLIB)/16_vl.h -#test2.$(OBJ): $(SRC)/test2.c $(SRCLIB)/16_vl.h -test0.$(OBJ): $(SRC)/test0.c -pcxtest.$(OBJ): $(SRC)/pcxtest.c $(SRCLIB)/16_vl.h -vrstest.$(OBJ): $(SRC)/vrstest.c $(SRCLIB)/16_vl.h -#vgacamm.$(OBJ): $(SRC)/vgacamm.c $(SRCLIB)/16_vl.h +16.$(OBJ): $(SRC)/16.c $(SRC)/16.h +bakapi.$(OBJ): $(SRC)/bakapi.c $(SRC)/bakapi.h +test.$(OBJ): $(SRC)/test.c $(SRCLIB)/16_vl.h +#test2.$(OBJ): $(SRC)/test2.c $(SRCLIB)/16_vl.h +test0.$(OBJ): $(SRC)/test0.c +pcxtest.$(OBJ):$(SRC)/pcxtest.c $(SRCLIB)/16_vl.h +vrstest.$(OBJ):$(SRC)/vrstest.c $(SRCLIB)/16_vl.h +#vgacamm.$(OBJ):$(SRC)/vgacamm.c $(SRCLIB)/16_vl.h #planrpcx.$(OBJ): $(SRC)/planrpcx.c $(SRCLIB)/16_vl.h -pcxtest2.$(OBJ): $(SRC)/pcxtest2.c $(SRCLIB)/16_vl.h -palettec.$(OBJ): $(SRC)/palettec.c -palettel.$(OBJ): $(SRC)/palettel.c -maptest.$(OBJ): $(SRC)/maptest.c $(SRCLIB)/16_vl.h -#emmtest.$(OBJ): $(SRC)/emmtest.c -#emsdump.$(OBJ): $(SRC)/emsdump.c -fmemtest.$(OBJ): $(SRC)/fmemtest.c -fonttest.$(OBJ): $(SRC)/fonttest.c +pcxtest2.$(OBJ):$(SRC)/pcxtest2.c $(SRCLIB)/16_vl.h +palettec.$(OBJ):$(SRC)/palettec.c +palettel.$(OBJ):$(SRC)/palettel.c +maptest.$(OBJ):$(SRC)/maptest.c $(SRCLIB)/16_vl.h +#emmtest.$(OBJ):$(SRC)/emmtest.c +#emsdump.$(OBJ):$(SRC)/emsdump.c +fmemtest.$(OBJ):$(SRC)/fmemtest.c +fonttest.$(OBJ):$(SRC)/fonttest.c #fonttes0.$(OBJ): $(SRC)/fonttes0.c -fontgfx.$(OBJ): $(SRC)/fontgfx.c -inputest.$(OBJ): $(SRC)/inputest.c +fontgfx.$(OBJ):$(SRC)/fontgfx.c +inputest.$(OBJ):$(SRC)/inputest.c #sountest.$(OBJ): $(SRC)/sountest.c #miditest.$(OBJ): $(SRC)/miditest.c -#testemm.$(OBJ): $(SRC)/testemm.c +#testemm.$(OBJ):$(SRC)/testemm.c #testemm0.$(OBJ): $(SRC)/testemm0.c #tsthimem.$(OBJ): $(SRC)/tsthimem.c -exmmtest.$(OBJ): $(SRC)/exmmtest.c -vgmtest.$(OBJ): $(SRC)/vgmtest.c +exmmtest.$(OBJ):$(SRC)/exmmtest.c +vgmtest.$(OBJ):$(SRC)/vgmtest.c # # non executable objects libraries @@ -280,36 +280,36 @@ joytest.exe: cd $(DOSLIB_JOYSTICK:$(to_os_path)) && $(DOSLIBMAKE) && cd $(BUILD_ROOT) $(COPYCOMMAND) $(DOSLIB_JOYSTICK:$(to_os_path))$(DIRSEP)dos86h$(DIRSEP)test.exe joytest.exe -16_vl.$(OBJ): $(SRCLIB)/16_vl.c $(SRCLIB)/16_vl.h -bakapee.$(OBJ): $(SRCLIB)/bakapee.c $(SRCLIB)/bakapee.h -16render.$(OBJ): $(SRCLIB)/16render.c $(SRCLIB)/16render.h -16planar.$(OBJ): $(MODEXLIB16)/16planar.c $(MODEXLIB16)/16planar.h -16_vrs.$(OBJ): $(SRCLIB)/16_vrs.c $(SRCLIB)/16_vrs.h $(DOSLIBLIBS) -16_sprit.$(OBJ): $(SRCLIB)/16_sprit.c $(SRCLIB)/16_sprit.h -bitmap.$(OBJ): $(SRCLIB)/bitmap.c $(SRCLIB)/bitmap.h -planar.$(OBJ): $(SRCLIB)/planar.c $(SRCLIB)/planar.h -scroll16.$(OBJ): $(SRCLIB)/scroll16.c $(SRCLIB)/scroll16.h -16text.$(OBJ): $(SRCLIB)/16text.c -mapread.$(OBJ): $(SRCLIB)/mapread.c $(SRCLIB)/mapread.h -16_map.$(OBJ): $(SRCLIB)/16_map.c $(SRCLIB)/16_map.h -16_timer.$(OBJ): $(SRCLIB)/16_timer.c $(SRCLIB)/16_timer.h -16_in.$(OBJ): $(SRCLIB)/16_in.c $(SRCLIB)/16_in.h -16_mm.$(OBJ): $(SRCLIB)/16_mm.c $(SRCLIB)/16_mm.h -16_pm.$(OBJ): $(SRCLIB)/16_pm.c $(SRCLIB)/16_pm.h -16_ca.$(OBJ): $(SRCLIB)/16_ca.c $(SRCLIB)/16_ca.h -16_dbg.$(OBJ): $(SRCLIB)/16_dbg.c $(SRCLIB)/16_dbg.h -midi.$(OBJ): $(SRCLIB)/midi.c $(SRCLIB)/midi.h -16_head.$(OBJ): $(SRCLIB)/16_head.c $(SRCLIB)/16_head.h -16_tail.$(OBJ): $(SRCLIB)/16_tail.c $(SRCLIB)/16_tail.h -16_hc.$(OBJ): $(SRCLIB)/16_hc.c $(SRCLIB)/16_hc.h -16_snd.$(OBJ): $(SRCLIB)/16_snd.c $(SRCLIB)/16_snd.h -jsmn.$(OBJ): $(JSMNLIB)/jsmn.c $(JSMNLIB)/jsmn.h -kitten.$(OBJ): $(NYANLIB)/kitten.c $(NYANLIB)/kitten.h -vgmSnd.$(OBJ): $(VGMSNDLIB)/vgmSnd.c $(VGMSNDLIB)/vgmSnd.h -wcpu.$(OBJ): $(WCPULIB)/wcpu.c $(WCPULIB)/wcpu.h -#memory.$(OBJ): $(EXMMLIB)/memory.c $(EXMMLIB)/memory.h -c_utils.$(OBJ): $(MODEXLIB)/c_utils.asm -modex.$(OBJ): $(MODEXLIB)/modex.asm +16_vl.$(OBJ):$(SRCLIB)/16_vl.c $(SRCLIB)/16_vl.h +bakapee.$(OBJ):$(SRCLIB)/bakapee.c $(SRCLIB)/bakapee.h +16render.$(OBJ):$(SRCLIB)/16render.c $(SRCLIB)/16render.h +16planar.$(OBJ):$(MODEXLIB16)/16planar.c $(MODEXLIB16)/16planar.h +16_vrs.$(OBJ): $(SRCLIB)/16_vrs.c $(SRCLIB)/16_vrs.h $(DOSLIBLIBS) +16_sprit.$(OBJ):$(SRCLIB)/16_sprit.c $(SRCLIB)/16_sprit.h +bitmap.$(OBJ): $(SRCLIB)/bitmap.c $(SRCLIB)/bitmap.h +planar.$(OBJ): $(SRCLIB)/planar.c $(SRCLIB)/planar.h +scroll16.$(OBJ):$(SRCLIB)/scroll16.c $(SRCLIB)/scroll16.h +16text.$(OBJ): $(SRCLIB)/16text.c +mapread.$(OBJ):$(SRCLIB)/mapread.c $(SRCLIB)/mapread.h +16_map.$(OBJ):$(SRCLIB)/16_map.c $(SRCLIB)/16_map.h +16_timer.$(OBJ):$(SRCLIB)/16_timer.c $(SRCLIB)/16_timer.h +16_in.$(OBJ): $(SRCLIB)/16_in.c $(SRCLIB)/16_in.h +16_mm.$(OBJ): $(SRCLIB)/16_mm.c $(SRCLIB)/16_mm.h +16_pm.$(OBJ): $(SRCLIB)/16_pm.c $(SRCLIB)/16_pm.h +16_ca.$(OBJ): $(SRCLIB)/16_ca.c $(SRCLIB)/16_ca.h +16_dbg.$(OBJ): $(SRCLIB)/16_dbg.c $(SRCLIB)/16_dbg.h +midi.$(OBJ): $(SRCLIB)/midi.c $(SRCLIB)/midi.h +16_head.$(OBJ):$(SRCLIB)/16_head.c $(SRCLIB)/16_head.h +16_tail.$(OBJ):$(SRCLIB)/16_tail.c $(SRCLIB)/16_tail.h +16_hc.$(OBJ): $(SRCLIB)/16_hc.c $(SRCLIB)/16_hc.h +16_snd.$(OBJ): $(SRCLIB)/16_snd.c $(SRCLIB)/16_snd.h +jsmn.$(OBJ): $(JSMNLIB)/jsmn.c $(JSMNLIB)/jsmn.h +kitten.$(OBJ): $(NYANLIB)/kitten.c $(NYANLIB)/kitten.h +vgmSnd.$(OBJ): $(VGMSNDLIB)/vgmSnd.c $(VGMSNDLIB)/vgmSnd.h +wcpu.$(OBJ): $(WCPULIB)/wcpu.c $(WCPULIB)/wcpu.h +#memory.$(OBJ):$(EXMMLIB)/memory.c $(EXMMLIB)/memory.h +c_utils.$(OBJ):$(MODEXLIB)/c_utils.asm +modex.$(OBJ): $(MODEXLIB)/modex.asm # #other~ @@ -376,7 +376,7 @@ getwww: .symbolic *x4get.bat $(EXEC) vomitchan: .symbolic - @$(DUMP) *.err + @if exist *.err $(DUMP) *.err ## ## External library management~ ^^ diff --git a/scroll.exe b/scroll.exe new file mode 100755 index 00000000..f715e3a9 Binary files /dev/null and b/scroll.exe differ diff --git a/src/lib/16_ca.c b/src/lib/16_ca.c index 74fb0f67..bf89531f 100755 --- a/src/lib/16_ca.c +++ b/src/lib/16_ca.c @@ -223,7 +223,7 @@ void CAL_GetGrChunkLength (int chunk) boolean CA_FarRead(int handle, byte huge *dest, dword length, global_game_variables_t *gvar) { - boolean flag; + boolean flag=0; //dword fat=0; //word segm=0; if(gvar->pm.emm.EMSVer<0x40) @@ -295,7 +295,7 @@ End: boolean CA_FarWrite(int handle, byte huge *source, dword length, global_game_variables_t *gvar) { - boolean flag; + boolean flag=0; //dword fat=0; //word segm=0; if(gvar->pm.emm.EMSVer<0x40) @@ -398,7 +398,7 @@ boolean CA_ReadFile(char *filename, memptr *ptr, global_game_variables_t *gvar) boolean CA_WriteFile (char *filename, void far *ptr, long length, global_game_variables_t *gvar) { int handle; - sdword size; + //sdword size; //long size; handle = open(filename,O_CREAT | O_BINARY | O_WRONLY, @@ -1102,8 +1102,8 @@ dinorm: void CAL_SetupMapFile (global_game_variables_t *gvar) { - int handle; - long length; +// int handle; +// long length; // // load maphead.ext (offsets and tileinfo for map file) diff --git a/src/lib/16_in.c b/src/lib/16_in.c index 0851baa9..72dcadf5 100755 --- a/src/lib/16_in.c +++ b/src/lib/16_in.c @@ -751,7 +751,7 @@ IN_SetKeyHook(void (*hook)()) void IN_ClearKeysDown() { - int i; + //int i; inpu.LastScan = sc_None; inpu.LastASCII = key_None; @@ -821,7 +821,9 @@ void near IN_ReadControl(int pn,player_t *player) { boolean realdelta; +#if DEMO0 byte dbyte; +#endif word buttons; int dx,dy; Motion mx,my; diff --git a/src/lib/16_map.c b/src/lib/16_map.c index 24ded39c..1afb7bc8 100755 --- a/src/lib/16_map.c +++ b/src/lib/16_map.c @@ -33,9 +33,9 @@ int jsoneq(const char *json, jsmntok_t *tok, const char *s) { } void extract_map(const char *js, jsmntok_t *t, size_t count, map_t *map) { - int i, j, k, indent, inner_end; + int i, j, k, indent=0, inner_end; bitmap_t bp; - char *s; + //char *s; i = 0; while(imm.mmhead->next; @@ -1175,8 +1175,8 @@ void MM_SortMem(global_game_variables_t *gvar) { //huge mmblocktype huge *scan,huge *last,huge *next; mmblocktype far *scan,far *last,far *next; - unsigned start,length,source,dest,oldborder; - int playing; + unsigned start,length,source,dest;//++++,oldborder; + //++++int playing; // // lock down a currently playing sound @@ -1286,18 +1286,18 @@ void MM_ShowMemory(global_game_variables_t *gvar) { //huge mmblocktype huge *scan; mmblocktype far *scan; - word temp; + //word temp; sdword end,owner; //word chx,chy; word w; //dword wwww; - byte scratch[160],scratch0[4096],scratch1[160],str[16]; + byte scratch[160],scratch0[4096],str[16];//[[[[scratch1[160], //byte d = '#'; -//**** VW_SetDefaultColors(); -//**** VW_SetLineWidth(40); +//[[[[ VW_SetDefaultColors(); +//[[[[ VW_SetLineWidth(40); //++++mh temp = bufferofs; //++++mh bufferofs = 0; -//**** VW_SetScreen (0,0); +//[[[[ VW_SetScreen (0,0); scan = gvar->mm.mmhead; end = -1; diff --git a/src/lib/16_pm.c b/src/lib/16_pm.c index ac61e20d..7ecab1eb 100755 --- a/src/lib/16_pm.c +++ b/src/lib/16_pm.c @@ -104,9 +104,9 @@ static char *ParmStrings[] = {"nomain","noems","noxms",nil}; byte PML_MapEMS(word logical, byte physical, global_game_variables_t *gvar) { - byte err, str[160]; + byte err=0, str[160]; unsigned EMShandle; - int i; + //int i; boolean errorflag=false; EMShandle=gvar->pm.emm.EMSHandle; @@ -161,12 +161,12 @@ PML_StartupEMS(global_game_variables_t *gvar) { int i; //long size; - byte err, str[64]; + byte err=0, str[64]; boolean errorflag=false; static char emmname[] = "EMMXXXX0"; //fix by andrius4669 unsigned int EMSVer = 0; - unsigned totalEMSpages,freeEMSpages,EMSPageFrame,EMSHandle,EMSAvail; + unsigned totalEMSpages,freeEMSpages,EMSPageFrame,EMSHandle=0,EMSAvail=0; totalEMSpages = freeEMSpages = EMSPageFrame = 0; gvar->pm.emm.EMSPresent = false; // Assume that we'll fail gvar->pm.emm.EMSAvail = 0; @@ -319,7 +319,7 @@ void PML_ShutdownEMS(global_game_variables_t *gvar) { word EMSHandle; - byte err,str[64]; + byte err=0, str[64]; boolean errorflag=false; EMSHandle=gvar->pm.emm.EMSHandle; @@ -747,7 +747,7 @@ PM_CheckMainMem(global_game_variables_t *gvar) void PML_StartupMainMem(global_game_variables_t *gvar) { - int i,n; + int i;//,n; memptr *p; gvar->pm.mm.MainPagesAvail = 0; @@ -1305,15 +1305,15 @@ PM_SetPageLock(int pagenum,PMLockType lock, global_game_variables_t *gvar) void PM_Preload(boolean (*update)(word current,word total), global_game_variables_t *gvar) { - int i,j, + int i,//j, page,oogypage; word current,total, - totalnonxms,totalxms, + //totalnonxms,totalxms, mainfree,maintotal, - emsfree,emstotal, + //emstotal,emsfree, xmsfree,xmstotal; memptr addr; - PageListStruct far *p; + PageListStruct __far *p; mainfree = (gvar->pm.mm.MainPagesAvail - gvar->pm.MainPagesUsed) + (gvar->pm.emm.EMSPagesAvail - gvar->pm.EMSPagesUsed); xmsfree = (gvar->pm.xmm.XMSPagesAvail - gvar->pm.XMSPagesUsed); diff --git a/src/lib/16_tail.c b/src/lib/16_tail.c index f63dddc1..b2acec13 100755 --- a/src/lib/16_tail.c +++ b/src/lib/16_tail.c @@ -76,7 +76,7 @@ void Startup16(global_game_variables_t *gvar) CA_Startup(gvar); #ifdef __WATCOMC__ start_timer(gvar); - + #endif } @@ -155,8 +155,8 @@ void DebugMemory_(global_game_variables_t *gvar, boolean q) void Quit (char *error) { - unsigned finscreen; - memptr screen; + //unsigned finscreen; + memptr screen=0; union REGS in, out; //ClearMemory (); diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c index 503cad06..0c8c5571 100755 --- a/src/lib/16_vl.c +++ b/src/lib/16_vl.c @@ -78,7 +78,7 @@ vgaSetMode(byte mode) byte/*FIXME: why long? "long" is 32-bit datatype, VGA modes are 8-bit numbers. */ vgaGetMode() { - return int10_getmode(); + return int10_getmode(); } /* -========================= Entry Points ==========================- */ @@ -86,7 +86,7 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) { word i; struct vga_mode_params cm; - int CRTParmCount; + //int CRTParmCount; vgaSetMode(VGA_256_COLOR_MODE); vga_enable_256color_modex(); @@ -116,8 +116,8 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) cm.word_mode = 0; cm.dword_mode = 0; // 320x240 mode 60Hz - cm.horizontal_total=0x5f + 5; /* CRTC[0] -5 */ - cm.horizontal_display_end=0x4f + 1; /* CRTC[1] -1 */ + cm.horizontal_total=0x5f + 5; /* CRTC[0] -5 */ + cm.horizontal_display_end=0x4f + 1; /* CRTC[1] -1 */ cm.horizontal_blank_start=0x50 + 1; /* CRTC[2] */ // cm.horizontal_blank_end=0x82 + 1; /* CRTC[3] bit 0-4 & CRTC[5] bit 7 *///skewing ^^; cm.horizontal_start_retrace=0x54;/* CRTC[4] */ @@ -155,7 +155,7 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) { case 1: { /* clear video memory */ - dword far*ptr=(dword far*)vga_state.vga_graphics_ram;//VGA; /* used for faster screen clearing */ + dword far*ptr=(dword far*)vga_state.vga_graphics_ram;//VGA; /* used for faster screen clearing */ vga_write_sequencer(2/*map mask register*/,0xf/*all 4 planes*/); for(i = 0;i < 0x4000; i++) ptr[i] = 0x0000; // 0x4000 x dword = 64KB } @@ -179,14 +179,14 @@ modexLeave() { page_t modexDefaultPage(page_t *p) { - page_t page; + page_t page; - /* default page values */ + /* default page values */ //page.data = VGA; //page.data = (byte far *)(vga_state.vga_graphics_ram); page.data = (vga_state.vga_graphics_ram); - page.dx = 0; - page.dy = 0; + page.dx = 0; + page.dy = 0; page.sw = p->sw; page.sh = p->sh; page.width = p->sw+TILEWHD; @@ -202,7 +202,7 @@ modexDefaultPage(page_t *p) page.pi=page.width*4; page.id = 0; - return page; + return page; } /* returns the next page in contiguous memory @@ -210,15 +210,15 @@ modexDefaultPage(page_t *p) */ page_t modexNextPage(page_t *p) { - page_t result; + page_t result; - result.data = p->data + (p->pagesize); - result.dx = 0; - result.dy = 0; + result.data = p->data + (p->pagesize); + result.dx = 0; + result.dy = 0; result.sw = p->sw; result.sh = p->sh; - result.width = p->width; - result.height = p->height; + result.width = p->width; + result.height = p->height; result.tw = p->tw; result.th = p->th; result.tilesw = p->tilesw; @@ -296,78 +296,78 @@ void modexHiganbanaPageSetup(video_t *video) void modexShowPage(page_t *page) { - word high_address; - word low_address; - word offset; - byte crtcOffset; - - /* calculate offset */ - offset = (word) page->data; - offset += page->dy * (page->width >> 2 ); - offset += page->dx >> 2; - - /* calculate crtcOffset according to virtual width */ - crtcOffset = page->width >> 3; - - high_address = HIGH_ADDRESS | (offset & 0xff00); - low_address = LOW_ADDRESS | (offset << 8); - - /* wait for appropriate timing and then program CRTC */ - //while ((inp(INPUT_STATUS_1) & DISPLAY_ENABLE)); - outpw(CRTC_INDEX, high_address); - outpw(CRTC_INDEX, low_address); - outp(CRTC_INDEX, 0x13); - outp(CRTC_DATA, crtcOffset); - - /* wait for one retrace */ - //while (!(inp(INPUT_STATUS_1) & VRETRACE)); - - /* do PEL panning here */ - outp(AC_INDEX, 0x33); - outp(AC_INDEX, (page->dx & 0x03) << 1); + word high_address; + word low_address; + word offset; + byte crtcOffset; + + /* calculate offset */ + offset = (word) page->data; + offset += page->dy * (page->width >> 2 ); + offset += page->dx >> 2; + + /* calculate crtcOffset according to virtual width */ + crtcOffset = page->width >> 3; + + high_address = HIGH_ADDRESS | (offset & 0xff00); + low_address = LOW_ADDRESS | (offset << 8); + + /* wait for appropriate timing and then program CRTC */ + //while ((inp(INPUT_STATUS_1) & DISPLAY_ENABLE)); + outpw(CRTC_INDEX, high_address); + outpw(CRTC_INDEX, low_address); + outp(CRTC_INDEX, 0x13); + outp(CRTC_DATA, crtcOffset); + + /* wait for one retrace */ + //while (!(inp(INPUT_STATUS_1) & VRETRACE)); + + /* do PEL panning here */ + outp(AC_INDEX, 0x33); + outp(AC_INDEX, (page->dx & 0x03) << 1); } void modexPanPage(page_t *page, int dx, int dy) { - page->dx = dx; - page->dy = dy; + page->dx = dx; + page->dy = dy; } void modexSelectPlane(byte plane) { - outp(SC_INDEX, MAP_MASK); /* select plane */ - outp(SC_DATA, plane); + outp(SC_INDEX, MAP_MASK); /* select plane */ + outp(SC_DATA, plane); } void modexClearRegion(page_t *page, int x, int y, int w, int h, byte color) { - word pageOff = (word) page->data; - word xoff=x/4; /* xoffset that begins each row */ - word scanCount=w/4; /* number of iterations per row (excluding right clip)*/ - word poffset = pageOff + y*(page->stridew) + xoff; /* starting offset */ - word nextRow = page->stridew-scanCount-1; /* loc of next row */ - byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; /* clips for rectangles not on 4s */ - byte rclip[] = {0x00, 0x01, 0x03, 0x07}; - byte left = lclip[x&0x03]; - byte right = rclip[(x+w)&0x03]; - - /* handle the case which requires an extra group */ - if((x & 0x03) && !((x+w) & 0x03)) { - right=0x0f; - } + word pageOff = (word) page->data; + word xoff=x/4; /* xoffset that begins each row */ + word scanCount=w/4; /* number of iterations per row (excluding right clip)*/ + word poffset = pageOff + y*(page->stridew) + xoff; /* starting offset */ + word nextRow = page->stridew-scanCount-1; /* loc of next row */ + byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; /* clips for rectangles not on 4s */ + byte rclip[] = {0x00, 0x01, 0x03, 0x07}; + byte left = lclip[x&0x03]; + byte right = rclip[(x+w)&0x03]; + + /* handle the case which requires an extra group */ + if((x & 0x03) && !((x+w) & 0x03)) { + right=0x0f; + } //printf("modexClearRegion(x=%u, y=%u, w=%u, h=%u, left=%u, right=%u)\n", x, y, w, h, left, right); - __asm { - PUSHF - PUSH ES - PUSH AX - PUSH BX - PUSH CX - PUSH DX - PUSH SI - PUSH DI - MOV AX, SCREEN_SEG ; go to the VGA memory + __asm { + PUSHF + PUSH ES + PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH SI + PUSH DI + MOV AX, SCREEN_SEG ; go to the VGA memory MOV ES, AX MOV DI, poffset ; go to the first pixel MOV DX, SC_INDEX ; point to the map mask @@ -376,39 +376,39 @@ modexClearRegion(page_t *page, int x, int y, int w, int h, byte color) { INC DX MOV AL, color ; get ready to write colors SCAN_START: - MOV CX, scanCount ; count the line - MOV BL, AL ; remember color - MOV AL, left ; do the left clip - OUT DX, AL ; set the left clip - MOV AL, BL ; restore color + MOV CX, scanCount ; count the line + MOV BL, AL ; remember color + MOV AL, left ; do the left clip + OUT DX, AL ; set the left clip + MOV AL, BL ; restore color STOSB ; write the color DEC CX - JZ SCAN_DONE ; handle 1 group stuff + JZ SCAN_DONE ; handle 1 group stuff ;-- write the main body of the scanline - MOV BL, AL ; remember color - MOV AL, 0x0f ; write to all pixels + MOV BL, AL ; remember color + MOV AL, 0x0f ; write to all pixels OUT DX, AL - MOV AL, BL ; restore color - REP STOSB ; write the color + MOV AL, BL ; restore color + REP STOSB ; write the color SCAN_DONE: - MOV BL, AL ; remeber color + MOV BL, AL ; remeber color MOV AL, right - OUT DX, AL ; do the right clip - MOV AL, BL ; restore color + OUT DX, AL ; do the right clip + MOV AL, BL ; restore color STOSB ; write pixel ADD DI, nextRow ; go to the next row DEC h JNZ SCAN_START - POP DI - POP SI - POP DX - POP CX - POP BX - POP AX - POP ES - POPF - } + POP DI + POP SI + POP DX + POP CX + POP BX + POP AX + POP ES + POPF + } } /* moved to src/lib/modex16/16render.c */ @@ -419,19 +419,19 @@ modexClearRegion(page_t *page, int x, int y, int w, int h, byte color) { */ void modexCopyPageRegion(page_t *dest, page_t *src, - word sx, word sy, - word dx, word dy, - word width, word height) + word sx, word sy, + word dx, word dy, + word width, word height) { - word doffset = (word)dest->data + dy*(dest->stridew) + dx/4; - word soffset = (word)src->data + sy*(src->stridew) + sx/4; - word scans = vga_state.vga_stride; //++++0000 the quick and dirty fix of the major issue with p16 video display wwww - word nextSrcRow = src->stridew - scans - 1; - word nextDestRow = dest->stridew - scans - 1; - byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; /* clips for rectangles not on 4s */ - byte rclip[] = {0x00, 0x01, 0x03, 0x07}; - byte left = lclip[sx&0x03]; - byte right = rclip[(sx+width)&0x03]; + word doffset = (word)dest->data + dy*(dest->stridew) + dx/4; + word soffset = (word)src->data + sy*(src->stridew) + sx/4; + word scans = vga_state.vga_stride; //++++0000 the quick and dirty fix of the major issue with p16 video display wwww + word nextSrcRow = src->stridew - scans - 1; + word nextDestRow = dest->stridew - scans - 1; + byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; /* clips for rectangles not on 4s */ + byte rclip[] = {0x00, 0x01, 0x03, 0x07}; + byte left = lclip[sx&0x03]; + byte right = rclip[(sx+width)&0x03]; /* handle the case which requires an extra group */ if((sx & 0x03) && !((sx+width) & 0x03)) { @@ -440,18 +440,18 @@ modexCopyPageRegion(page_t *dest, page_t *src, // printf("modexCopyPageRegion(src->stridew=%u, dest->stridew=%u, sx=%u, sy=%u, dx=%u, dy=%u, width=%u, height=%u, left=%u, right=%u)\n", src->stridew, dest->stridew, sx, sy, dx, dy, width, height, left, right); - __asm { - PUSHF - PUSH ES - PUSH AX - PUSH BX - PUSH CX - PUSH DX - PUSH SI - PUSH DI - - MOV AX, SCREEN_SEG ; work in the vga space - MOV ES, AX ; + __asm { + PUSHF + PUSH ES + PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH SI + PUSH DI + + MOV AX, SCREEN_SEG ; work in the vga space + MOV ES, AX ; MOV DI, doffset ; MOV SI, soffset ; @@ -460,9 +460,9 @@ modexCopyPageRegion(page_t *dest, page_t *src, OUT DX, AX MOV AX, SC_INDEX ; point to the mask register - MOV DX, AX ; + MOV DX, AX ; MOV AL, MAP_MASK ; - OUT DX, AL ; + OUT DX, AL ; INC DX ; ROW_START: @@ -471,183 +471,183 @@ modexCopyPageRegion(page_t *dest, page_t *src, MOV DS, AX MOV CX, scans ; the number of latches - MOV AL, left ; do the left column - OUT DX, AL ; + MOV AL, left ; do the left column + OUT DX, AL ; MOVSB ; DEC CX ; - MOV AL, 0fh ; do the inner columns + MOV AL, 0fh ; do the inner columns OUT DX, AL - REP MOVSB ; copy the pixels + REP MOVSB ; copy the pixels MOV AL, right ; do the right column OUT DX, AL MOVSB POP DS - MOV AX, SI ; go the start of the next row - ADD AX, nextSrcRow ; - MOV SI, AX ; - MOV AX, DI ; - ADD AX, nextDestRow ; - MOV DI, AX ; + MOV AX, SI ; go the start of the next row + ADD AX, nextSrcRow ; + MOV SI, AX ; + MOV AX, DI ; + ADD AX, nextDestRow ; + MOV DI, AX ; - DEC height ; do the rest of the actions + DEC height ; do the rest of the actions JNZ ROW_START ; - MOV DX, GC_INDEX+1 ; go back to CPU data - MOV AL, 0ffh ; none from latches - OUT DX, AL ; - - POP DI - POP SI - POP DX - POP CX - POP BX - POP AX - POP ES - POPF - } + MOV DX, GC_INDEX+1 ; go back to CPU data + MOV AL, 0ffh ; none from latches + OUT DX, AL ; + + POP DI + POP SI + POP DX + POP CX + POP BX + POP AX + POP ES + POPF + } } /* fade and flash */ void modexFadeOn(word fade, byte *palette) { - fadePalette(-fade, 64, 64/fade+1, palette); + fadePalette(-fade, 64, 64/fade+1, palette); } void modexFadeOff(word fade, byte *palette) { - fadePalette(fade, 0, 64/fade+1, palette); + fadePalette(fade, 0, 64/fade+1, palette); } void modexFlashOn(word fade, byte *palette) { - fadePalette(fade, -64, 64/fade+1, palette); + fadePalette(fade, -64, 64/fade+1, palette); } void modexFlashOff(word fade, byte *palette) { - fadePalette(-fade, 0, 64/fade+1, palette); + fadePalette(-fade, 0, 64/fade+1, palette); } static void fadePalette(sbyte fade, sbyte start, word iter, byte *palette) { - word i; - byte dim = start; + word i; + byte dim = start; - /* handle the case where we just update */ - if(iter == 0) { + /* handle the case where we just update */ + if(iter == 0) { modexPalUpdate1(palette); return; - } + } - while(iter > 0) { /* FadeLoop */ + while(iter > 0) { /* FadeLoop */ for(i=0; i 127) { + tmppal[i] = palette[i] - dim; + if(tmppal[i] > 127) { tmppal[i] = 0; - } else if(tmppal[i] > 63) { + } else if(tmppal[i] > 63) { tmppal[i] = 63; - } + } } modexPalUpdate1(tmppal); iter--; dim += fade; - } + } } /* save and load */ void modexPalSave(byte *palette) { - int i; + int i; - outp(PAL_READ_REG, 0); /* start at palette entry 0 */ - for(i=0; i0 && (*i)>=(qp) && (*i)<((qp)+3)) { //printf("qp=%d\n", qp); - //printf(" (*i)=%d a[%d]=%d\n", (*i), qp, a[qp]); + //printf(" (*i)=%d a[%d]=%d\n", (*i), qp, a[qp]); printf(" %d's color=%d\n", (*i), (a[qp])-(bmp->offset*3)+qp); //outp(PAL_DATA_REG, p[((a[qp])-(bmp->offset*3)+qp)]);// fix this shit! if((*i)+1==(qp)+3){ w++; /*(*i)++;*/ break; } @@ -711,7 +711,7 @@ modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset) } } //if(qp>0) printf("qp=%d\n", qp); - //if(qp>0) printf(" (*i)=%d\n", (*i)/3); + //if(qp>0) printf(" (*i)=%d\n", (*i)/3); } //modexWaitBorder(); /* waits one retrace -- less flicker */ vga_wait_for_vsync(); @@ -728,7 +728,7 @@ modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset) else if(qp>0 && (*i)>=(qp) && (*i)<((qp)+3)) { //printf("qp=%d\n", qp); - //printf(" (*i)=%d a[%d]=%d\n", (*i), qp, a[qp]); + //printf(" (*i)=%d a[%d]=%d\n", (*i), qp, a[qp]); printf(" %d's color=%d\n", (*i), (a[qp]-(bmp->offset*3)+qp)); //outp(PAL_DATA_REG, p[((a[qp])-(bmp->offset*3)+qp)]);// fix this shit! if((*i)+1==(qp)+3){ w++; /*(*i)++;*/ break; } @@ -740,7 +740,7 @@ modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset) printf("p[]=%d qp=%d p[]-qp=%d\n", ((*i)-(bmp->offset*3)), qp, ((*i)-(bmp->offset*3))+qp); } } } - //printf(" (*i)=%d\n", (*i)/3); + //printf(" (*i)=%d\n", (*i)/3); } printf("\nqqqqqqqq\n\n"); @@ -760,7 +760,7 @@ printf("\nqqqqqqqq\n\n"); aqpee: while(aq<=aa) { -// printf("a[%02d]=(%d)\n", aq, a[aq]); +// printf("a[%02d]=(%d)\n", aq, a[aq]); if(a[aq]==-1) aq++; else { aqoffset++; break; } } @@ -788,12 +788,12 @@ aqpee: //printf("%02d", bmp->data[lq]); //printf("\n%02d\n", bmp->offset); printf("aq=%02d ", aq); - printf("a[aq]=%02d ", a[aq]); + printf("a[aq]=%02d ", a[aq]); printf("a[aq]+aqpp=%02d ", a[aq]+aqpp); printf("a[aq]-aqpp=%02d\n", a[aq]-aqpp); //bmp->data[lq]=((bmp->data[lq]+bmp->offset)-a[aq]); //++++ bmp->data[lq]=a[aq]-aqpp; -// printf("_%d ", bmp->data[lq]); +// printf("_%d ", bmp->data[lq]); //if(lq > 0 && lq%bmp->width==0) printf("\n"); } else if(bmp->data[lq]+bmp->offset < ((*i)/3)-aqpp) @@ -810,8 +810,8 @@ aqpee: //if(lq > 0 && lq%bmp->width==0) printf("\n"); } -//printf(" aq=%02d\n", aq); -//printf(" aa=%02d\n", aa); +//printf(" aq=%02d\n", aq); +//printf(" aa=%02d\n", aa); //update the palette~ modexPalUpdate(bmp, &pp, aq, aqoffset); @@ -878,23 +878,23 @@ void modexchkcolor(bitmap_t *bmp, word *q, word *a, word *aa, word *z, word *i/* modexPalSave(pal); //printf("q: %02d\n", (*q)); printf("chkcolor start~\n"); - printf("1 (*z): %d\n", (*z)/3); - printf("1 (*i): %d\n", (*i)/3); -// printf("1 offset of color in palette (*q): %d\n", (*q)/3); + printf("1 (*z): %d\n", (*z)/3); + printf("1 (*i): %d\n", (*i)/3); +// printf("1 offset of color in palette (*q): %d\n", (*q)/3); printf("wwwwwwwwwwwwwwww\n"); //check palette for dups for(; (*z)width >> 2; + } + + m1 >>= 1; + m2 >>= 1; + if ((++plane) == 4) { + addr++; + plane = 0; + } + } +} + void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str) { word s, o, w; word x_draw = x; - word addr = (word) romFontsData.l; + //word addr = (word) romFontsData.l; word addrq = (page->width/4) * y + (x / 4) + ((word)page->data); word addrr = addrq; byte c; @@ -1068,14 +1105,14 @@ void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, c } //load the letter 'A' __asm { - PUSHF - PUSH ES - PUSH AX - PUSH BX - PUSH CX - PUSH DX - PUSH SI - PUSH DI + PUSHF + PUSH ES + PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH SI + PUSH DI MOV DI, addr MOV SI, o @@ -1092,14 +1129,14 @@ void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, c DEC CX JNZ L1 - POP DI - POP SI - POP DX - POP CX - POP BX - POP AX - POP ES - POPF + POP DI + POP SI + POP DX + POP CX + POP BX + POP AX + POP ES + POPF } for(i=0; ibuffer = buffer; // Calculate vrl offsets - + // Count sprites vrl_id_iter = (uint16_t huge *)(buffer + vrs_cont->vrs_hdr->offset_table[VRS_HEADER_OFFSET_SPRITE_ID_LIST]); while(vrl_id_iter[num_of_vrl]){ @@ -101,7 +94,7 @@ int get_vrl_by_id(struct vrs_container /*huge*/ *vrs_cont, uint16_t id, struct v } // Get id list from .vrs blob (base + offset) - ids = (uint16_t huge*)(vrs_cont->buffer + + ids = (uint16_t huge*)(vrs_cont->buffer + 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 diff --git a/src/lib/16render.c b/src/lib/16render.c index 091775b7..4118f17e 100755 --- a/src/lib/16render.c +++ b/src/lib/16render.c @@ -151,7 +151,7 @@ modexDrawBmpRegion(page_t *page, int x, int y, word scanCount = width/4 + (width%4 ? 1 :0); word nextPageRow = page->width/4 - scanCount; word nextBmpRow = (word) bmp->width - width; - word rowCounter; + word rowCounter=0; byte planeCounter = 4; __asm { @@ -218,7 +218,7 @@ modexDrawSpriteRegion(page_t *page, int x, int y, word scanCount = width/4 + (width%4 ? 1 :0); word nextPageRow = page->width/4 - scanCount; word nextBmpRow = (word) bmp->width - width; - word rowCounter; + word rowCounter=0; byte planeCounter = 4; __asm { @@ -297,7 +297,7 @@ modexDrawBmpPBufRegion(page_t *page, int x, int y, word scanCount = width/4 + (width%4 ? 1 :0); word nextPageRow = page->width/4 - scanCount; word nextBmpRow = (word) bmp->width - width; - word rowCounter; + word rowCounter=0; byte planeCounter = 4; __asm { @@ -375,7 +375,7 @@ modexDrawSpritePBufRegion(page_t *page, int x, int y, word scanCount = width/4 + (width%4 ? 1 :0); word nextPageRow = page->width/4 - scanCount; word nextBmpRow = (word) bmp->width - width; - word rowCounter; + word rowCounter=0; byte planeCounter = 4; __asm { @@ -434,40 +434,3 @@ modexDrawSpritePBufRegion(page_t *page, int x, int y, JNZ PLANE_LOOP ; do all 4 planes } } - -void modexDrawChar(page_t *page, int x/*for planar selection only*/, word t, word col, word bgcol, word addr) -{ - /* vertical drawing routine by joncampbell123. - * - * optimize for VGA mode X planar memory to minimize the number of times we do I/O write to map mask register. - * so, we enumerate over columns (not rows!) to draw every 4th pixel. bit masks are used because of the font bitmap. - * - * NTS: addr defines what VGA memory address we use, "x" is redundant except to specify which of the 4 pixels we select in the map mask register. */ - word rows = romFonts[t].charSize; - word drawaddr; - word colm, row; - byte fontbyte; - byte plane; - byte m1,m2; - - plane = x & 3; - m1 = 0x80; // left half - m2 = 0x08; // right half - for (colm=0;colm < 4;colm++) { - drawaddr = addr; - modexSelectPlane(PLANE(plane)); - for (row=0;row < rows;row++) { - fontbyte = romFontsData.l[row]; - vga_state.vga_graphics_ram[drawaddr ] = (fontbyte & m1) ? col : bgcol; - vga_state.vga_graphics_ram[drawaddr+1] = (fontbyte & m2) ? col : bgcol; - drawaddr += page->width >> 2; - } - - m1 >>= 1; - m2 >>= 1; - if ((++plane) == 4) { - addr++; - plane = 0; - } - } -} diff --git a/src/lib/16render.h b/src/lib/16render.h index de842416..32cb7e0f 100755 --- a/src/lib/16render.h +++ b/src/lib/16render.h @@ -36,6 +36,5 @@ void modexDrawBmpPBuf(page_t *page, int x, int y, planar_buf_t *bmp); /*pbuf ver void modexDrawBmpPBufRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, planar_buf_t *bmp); void modexDrawSpritePBuf(page_t *page, int x, int y, planar_buf_t *bmp); void modexDrawSpritePBufRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, planar_buf_t *bmp); -void modexDrawChar(page_t *page, int x/*for planar selection only*/, word t, word col, word bgcol, word addr); #endif diff --git a/src/lib/16text.c b/src/lib/16text.c index 7f725992..0f946510 100755 --- a/src/lib/16text.c +++ b/src/lib/16text.c @@ -27,8 +27,8 @@ font_t romFonts[4]; fontdata_t romFontsData; static void getRomFontAddr(char fontNum, int index) { - word fontSeg; - word fontOff; + word fontSeg=0; + word fontOff=0; __asm { PUSH AX diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index 6f1c450e..cb014fd0 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -362,7 +362,7 @@ initMap(map_t *map) { void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid) { - word x, y; /* coordinate for drawing */ + word x;//, y; /* coordinate for drawing */ /* increment the pixel position and update the page */ mv[id].page->dx += player[plid].speed; @@ -392,7 +392,7 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid) void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid) { - word x, y; /* coordinate for drawing */ + word x;//,y; /* coordinate for drawing */ /* decrement the pixel position and update the page */ mv[id].page->dx -= player[plid].speed; @@ -422,7 +422,7 @@ void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid) void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid) { - word x, y; /* coordinate for drawing */ + word y;//x, /* coordinate for drawing */ /* decrement the pixel position and update the page */ mv[id].page->dy -= player[plid].speed; @@ -451,7 +451,7 @@ void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid) void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid) { - word x, y; /* coordinate for drawing */ + word y;//x, /* coordinate for drawing */ /* increment the pixel position and update the page */ mv[id].page->dy += player[plid].speed; @@ -594,7 +594,7 @@ sword chkmap(map_t *map, word q) //TODO: player position here void mapGoTo(map_view_t *mv, int tx, int ty) { - int px, py; + int py;//px, unsigned int i; /* set up the coordinates */ @@ -634,8 +634,7 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) { word rx; word ry; - word textx=0; - word texty=0; + //word textx=0, texty=0; //if(i==0) i=2; if(i==0) { @@ -761,8 +760,8 @@ void shinku(global_game_variables_t *gv) { word x = (0) + gv->video.page[/*!*/(gv->video.p)].dx; // follow the screen word y = (0) + gv->video.page[/*!*/(gv->video.p)].dy; // follow the screen - word w = 64, h = 8, col = 7, bgcol = 0, type = 1; - byte o,o2,i; + word col = 7, bgcol = 0, type = 1;//w = 64, h = 8, + //byte o,o2,i; //modexCopyPageRegion(pip[1].page, pip[2].page, 16, 16, 16, 16, (14*8)+4, 8+4); /* block copy to visible RAM from offscreen */ // vga_setup_wm1_block_copy(); diff --git a/src/lib/scroll16.h b/src/lib/scroll16.h index 534f5c23..7cd0e941 100755 --- a/src/lib/scroll16.h +++ b/src/lib/scroll16.h @@ -42,6 +42,8 @@ #define SPRITE //#define TILERENDER +extern void modexDrawSpriteRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp); + //modexDrawSpritePBufRegion //modexDrawBmpPBufRegion #define PBUFSFUN modexDrawSpriteRegion diff --git a/src/lib/wcpu/wcpu.c b/src/lib/wcpu/wcpu.c index 8a0be98c..92b91919 100755 --- a/src/lib/wcpu/wcpu.c +++ b/src/lib/wcpu/wcpu.c @@ -25,7 +25,7 @@ byte detectcpu() { - byte cputype; + byte cputype=0; __asm { PUSHF ; we gonna modify flags, so back them up diff --git a/src/zcroll.c b/src/zcroll.c index caa94c23..d2786c16 100755 --- a/src/zcroll.c +++ b/src/zcroll.c @@ -23,6 +23,7 @@ #include "src/lib/scroll16.h" #include "src/lib/16_timer.h" #include "src/lib/wcpu/wcpu.h" +#include "src/lib/16render.h" //word far *clock= (word far*) 0x046C; /* 18.2hz clock */ //bitmap_t *p; diff --git a/wbuild.sh b/wbuild.sh index af9d4da0..67df5751 100755 --- a/wbuild.sh +++ b/wbuild.sh @@ -2,12 +2,12 @@ wmake -h clean wmake -h wmake -h comp -if [[ -f *.err ]] -then - echo dumping *.err +#if [[ -f *.err ]] +#then +# echo dumping *.err #cat *.err wmake vomitchan -fi +#fi #if [ -f 16_head.o ] #then # rm *.o