From e9e21fdca956febac1bf358aeefb23e3ef93ad6d Mon Sep 17 00:00:00 2001 From: sparky4 Date: Thu, 13 Apr 2017 17:59:50 -0500 Subject: [PATCH] p16 is being worked on a bunch by me wwww [16_ca needs huge amounts of work and I should remember what needs to be done soon][OpenVGMFile needs to be ported to 16_snd.c]going to port rest of code to borland c some time so we can use the core components of id engine here [going to add 16_us.c eventually but the debug system and CA_ PM_ and MM_ usage is priority now]older zcroll renamed to xcroll][zcroll is now the pre menu game loop system with PROPER data usage with CAMMPM] MM_ShowMemory is quite buggy on real machines. i need to debug it and fix added a struct printer[gvar.mm is FUCKING HUGE 14402 bytes FAT\!]16_rf now compiles BT UNKNOWN ON WHAT IT DOSE\! text box creates a ghost because page 1 do not have bg info thus it is stored and saved.... wwww fizzfade being worked on and no idea how to make it work...[exmmtest.exe fixed stack was just too small] --- makefile | 2 +- src/bakapi.c | 6 +++--- src/exmmtest.c | 19 +++++++++++-------- src/lib/16_ca.c | 11 +++++++++++ src/lib/16_ca.h | 2 +- src/lib/16_dbg.h | 2 +- src/lib/bakapee.c | 2 ++ 7 files changed, 30 insertions(+), 14 deletions(-) diff --git a/makefile b/makefile index f8c1871e..50c4ffcb 100755 --- a/makefile +++ b/makefile @@ -117,7 +117,7 @@ UPXQ=-qqq # # compile flags # -S_FLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k24576#32768 +S_FLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k32768#24576 Z_FLAGS=-zk0 -zc -zm#### -zp4 -ei O_FLAGS=-opnr -oe=24 -oil+ -outback -ohm T_FLAGS=-bt=dos -wx -m$(MEMORYMODE) -0 -fpi87 -d1 -fo=.$(OBJ)## -e=65536 diff --git a/src/bakapi.c b/src/bakapi.c index b03f294a..034649c4 100755 --- a/src/bakapi.c +++ b/src/bakapi.c @@ -150,12 +150,12 @@ main(int argc, char *argvar[]) ding(&gvar.video.page[1], &bakapee, 2); } #ifdef BAKAFIZZUNSIGNED - if(!baka_FizzleFade (gvar.video.ofs.bufferofs, gvar.video.ofs.displayofs, vga_state.vga_width, vga_state.vga_height, 70, true, &gvar)) + baka_FizzleFade (gvar.video.ofs.bufferofs, gvar.video.ofs.displayofs, vga_state.vga_width, vga_state.vga_height, 70, true, &gvar); #else - if(!baka_FizzleFade (&gvar.video.page[1], &gvar.video.page[0], vga_state.vga_width, vga_state.vga_height, 70, true, &gvar)) + baka_FizzleFade (&gvar.video.page[1], &gvar.video.page[0], vga_state.vga_width, vga_state.vga_height, 70, true, &gvar); #endif //ding(&gvar.video.page[showpage], &bakapee, 9); - modexprint(&gvar.video.page[0], gvar.video.page[0].sw/2, gvar.video.page[0].sh/2, 1, 0, 47, 0, 1, "bakapi ok"); +// modexprint(&gvar.video.page[0], gvar.video.page[0].sw/2, gvar.video.page[0].sh/2, 1, 0, 47, 0, 1, "bakapi ok"); } while(!kbhit()){} diff --git a/src/exmmtest.c b/src/exmmtest.c index 0b5a4ab8..9fb1730b 100755 --- a/src/exmmtest.c +++ b/src/exmmtest.c @@ -44,7 +44,12 @@ //#define EXMMVERBOSE__ // #define PRINTBBDUMP #define BUFFDUMP +#ifdef __BORLANDC__ #define NOVID +#endif +#ifdef __WATCOMC__ +#define NOVID +#endif #define KEYP IN_Shutdown(&gvar); printf("\n\npress any key to continue!\n"); getch(); IN_Startup(&gvar); @@ -63,7 +68,7 @@ #endif //////////////////////////////////////////////////////////////////////////// -//#ifdef __BORLANDC__ +#ifdef NOVID //void VL_Startup (global_game_variables_t *gvar){} void VL_Shutdown (global_game_variables_t *gvar){} void VGAmodeX(sword vq, boolean cmem, global_game_variables_t *gv) @@ -82,7 +87,7 @@ void TL_VidInit(global_game_variables_t *gvar) { gvar->video.old_mode = 3; } -//#endif +#endif //printf("* %Fp\t", *BBUF); //printf("* %04x\t", *BBUF); @@ -185,9 +190,7 @@ main(int argc, char *argv[]) #ifndef NOVID Startup16(&gvar); // save the palette - #ifdef __WATCOMC__ modexPalSave(&gvar.video.dpal); modexFadeOff(4, &gvar.video.dpal); //modexPalBlack(); - #endif #else //NOVID //printf("main()=%Fp start MM\n", *argv[0]); MM_Startup(&gvar); @@ -271,12 +274,12 @@ PRINTBB; KEYP IN_ClearKey(scan); switch (scan) { -// case sc_Space: -// MM_ShowMemory(&gvar); -// break; + case sc_Space: + MM_ShowMemory(&gvar); + break; //#ifdef __WATCOMC__ case sc_O: - modexPalUpdate0(&gvar.video.palette); modexpdump(&gvar.video.page); + VL_modexPalScramble(&gvar.video.palette); modexpdump(&gvar.video.page); break; case sc_P: modexpdump(&gvar.video.page[0]); diff --git a/src/lib/16_ca.c b/src/lib/16_ca.c index 867b2099..1b302079 100755 --- a/src/lib/16_ca.c +++ b/src/lib/16_ca.c @@ -375,6 +375,17 @@ boolean CA_ReadFile(char *filename, memptr *ptr, global_game_variables_t *gvar) return false; size = filelength(handle); +#ifdef __DEBUG_CA__ + if(dbg_debugca>0){ + printf("===============================================================================\n"); + printf(" CA_ReadFile\n"); + printf("===============================================================================\n"); + //%04x + printf(" ptr=%Fp\n", ptr); + printf(" *ptr=%Fp\n", *ptr); + printf(" &ptr=%Fp\n", &ptr); + } +#endif if(!CA_FarRead(handle,*ptr,size, gvar)) { close(handle); diff --git a/src/lib/16_ca.h b/src/lib/16_ca.h index bd762016..7c6cf37f 100755 --- a/src/lib/16_ca.h +++ b/src/lib/16_ca.h @@ -27,7 +27,7 @@ //=========================================================================== -//#define NOMAPS +#define NOMAPS #define NOGRAPHICS #define NOAUDIO diff --git a/src/lib/16_dbg.h b/src/lib/16_dbg.h index ede5c359..e545bdcd 100755 --- a/src/lib/16_dbg.h +++ b/src/lib/16_dbg.h @@ -10,7 +10,7 @@ #define __DEBUG_InputMgr__ #define __DEBUG_MAP__ //#define __DEBUG_2__ -//#define __DEBUG_CA__ +#define __DEBUG_CA__ //#define __DEBUG_PM__ //#define __DEBUG_MM__ //#define __DEBUG_RF__ diff --git a/src/lib/bakapee.c b/src/lib/bakapee.c index 2026ed12..39eb569e 100755 --- a/src/lib/bakapee.c +++ b/src/lib/bakapee.c @@ -136,6 +136,7 @@ noxor: continue; //drawofs = source+(gvar->video.ofs.ylookup[y]) + (x>>2); drawofs = source+(y*gvar->video.page[0].stridew) + (x>>2); +/* sprintf(global_temp_status_text, "draw - %Fp", drawofs); modexprint(&(gvar->video.page[0]), PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8; sprintf(global_temp_status_text, "pdet - %Fp", pagedelta); @@ -144,6 +145,7 @@ sprintf(global_temp_status_text, "srce - %Fp", source); modexprint(&(gvar->video.page[0]), PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8; sprintf(global_temp_status_text, "dest - %Fp", dest); modexprint(&(gvar->video.page[0]), PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q=16; +*/ // // copy one pixel -- 2.39.5