Hi everybody,

I made a patch to fix the speed of NGE Nibbles,
but it does not come with a makefile: Instead,
it comes with a RHIDE (DJGPP C/C++ IDE) config
file to compile it with the DJGPP C++ compiler,
also making assumptions about the source path.

Does anybody use RHIDE already and would be
willing to make a new binary for me? Rugxulo?

Toolchain: http://delorie.com/djgpp/zip-picker.html

The patch applies to the SOURCE directory of
the ZIP linked in our 1.3rc4 inventory list,
after recursively copying NGE_NIBB to NGEPATCH:

http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/repositories/1.3/pkg-html/nge_nibb.html

Note that NGE Nibbles originally used mixed
case file names. Somebody has changed this
to all uppercase in the ZIP, so you should
probably compile with LFN *disabled* in DOS.

Thank you in advance :-)

Regards, Eric



diff -Naur NGE_NIBB/NGENGINE/VGA256.CPP NGEPATCH/NGENGINE/VGA256.CPP
--- NGE_NIBB/NGENGINE/VGA256.CPP        2021-03-18 19:19:13.000000000 +0100
+++ NGEPATCH/NGENGINE/VGA256.CPP        2021-06-12 14:15:13.642979808 +0200
@@ -65,9 +65,14 @@
 //---------------------------------------------------------------------------
 void WaitForRetrace() {

-  char out=inportb(0x3da);
+  char out=inportb(0x3da); // color EGA/VGA input status 1 register

-  while(!(out&0x8)) {
+  // for VSYNC paced game: if retrace ongoing, wait for retrace end first
+  while(out & 0x8) { // while VGA vertical retrace in progress
+   out=inportb(0x3da);
+  }
+
+  while(!(out & 0x8)) { // while VGA vertical retrace not yet in progress
    out=inportb(0x3da);
   }

diff -Naur NGE_NIBB/NIBBLES/BODY.CPP NGEPATCH/NIBBLES/BODY.CPP
--- NGE_NIBB/NIBBLES/BODY.CPP   2021-03-18 19:19:13.000000000 +0100
+++ NGEPATCH/NIBBLES/BODY.CPP   2021-06-12 14:00:30.632513438 +0200
@@ -320,7 +320,7 @@

  if(t==0) {  y0=y;   x0=x;  }

- /*sequenza di morte 1*/
+ /* death sequence 1 */

   y=(int)(y0+0.4/mass*(t*t));

diff -Naur NGE_NIBB/NIBBLES/INTRO.CPP NGEPATCH/NIBBLES/INTRO.CPP
--- NGE_NIBB/NIBBLES/INTRO.CPP  2021-03-18 19:19:13.000000000 +0100
+++ NGEPATCH/NIBBLES/INTRO.CPP  2021-06-12 14:05:35.188627836 +0200
@@ -73,30 +73,30 @@
 unsigned char flipRed,flipGreen,flipBlue;
 bool flip=false,morph_1=false,morph_2=true;

-int flipCol_1=48;
-int flipCol_2=48;
-int delta_t=60000;
+int flipCol_1 = 48;
+int flipCol_2 = 48;
+int delta_t = 3 * FADEDELAY; // will be ignored if flip is true
 int c=0;

   LoadPalette(NULL,&palFX[0]);
   SetPalette(&palFX[0]);

-  /*ptrCalisto->GotoXY(100,165);
+  /* ptrCalisto->GotoXY(100,165);
   ptrCalisto->Print("press ENTER key...",ptrLogo->PtrSprite); */

   DBuffer->ClearBufPat(ptrLogo->PtrSprite);
   DBuffer->Flip();

-  while(c!=7181) {
+  while(c!=7181) { // 0x1c0d, ENTER


     if(kbhit())
      c=bioskey(0);

-    if(c==283) return EXIT_FROM_LOGO;
+    if(c==283) return EXIT_FROM_LOGO; // 0x011b, ESCAPE

     if(!flip)
-     flip=FadingFX(&pal[0],&palFX[0],FADING_INTRO);
+     flip=FadingFX(&pal[0],&palFX[0],FADING_INTRO); // fade palette data

     if(flip) {

@@ -176,7 +176,7 @@

     WaitForRetrace();
     SetPalette(&palFX[0]);
-    usleep(60000);
+    usleep(3 * FADEDELAY);

   };

@@ -186,7 +186,7 @@

     WaitForRetrace();
     SetPalette(&palFX[0]);
-    usleep(60000);
+    usleep(3 * FADEDELAY);

   };

diff -Naur NGE_NIBB/NIBBLES/INTRO.H NGEPATCH/NIBBLES/INTRO.H
--- NGE_NIBB/NIBBLES/INTRO.H    2021-03-18 19:19:13.000000000 +0100
+++ NGEPATCH/NIBBLES/INTRO.H    2021-06-12 14:07:53.806090496 +0200
@@ -26,6 +26,10 @@
 #include "DblBuf.h"

 #define EXIT_FROM_LOGO 1
+
+// Palette fade delay in microseconds, was 20000 in MAIN, 3 * that in INTRO
+#define FADEDELAY 10000
+
 //---------------------------------------------------------------------------
 extern int Intro(DblBuf *DBuffer,unsigned char *scr);
 //---------------------------------------------------------------------------
diff -Naur NGE_NIBB/NIBBLES/MAIN.CPP NGEPATCH/NIBBLES/MAIN.CPP
--- NGE_NIBB/NIBBLES/MAIN.CPP   2021-03-18 19:19:13.000000000 +0100
+++ NGEPATCH/NIBBLES/MAIN.CPP   2021-06-12 14:04:54.854597620 +0200
@@ -109,12 +109,12 @@

      while(!FadingFX(&pal1[0],&palblack[0],FADING_INTRO)) {
       SetPalette(&palblack[0]);
-      usleep(20000);
+      usleep(FADEDELAY);
      }

      while(!FadingFX(NULL,&palblack[0],FADING_THE_END)) {
       SetPalette(&palblack[0]);
-      usleep(20000);
+      usleep(FADEDELAY);
      }

     memset(&palblack[0],0,768);
@@ -126,7 +126,7 @@

      while(!FadingFX(&pal1[0],&palblack[0],FADING_INTRO)) {
       SetPalette(&palblack[0]);
-      usleep(20000);
+      usleep(FADEDELAY);
      }

      memset(&palblack[0],0,768);
@@ -153,12 +153,12 @@

      while(!FadingFX(&pal1[0],&palblack[0],FADING_INTRO)) {
       SetPalette(&palblack[0]);
-      usleep(20000);
+      usleep(FADEDELAY);
      }

      while(!FadingFX(NULL,&palblack[0],FADING_THE_END)) {
       SetPalette(&palblack[0]);
-      usleep(20000);
+      usleep(FADEDELAY);
      }

     memset(&palblack[0],0,768);
@@ -175,7 +175,7 @@

      while(!FadingFX(&pal1[0],&palblack[0],FADING_INTRO)) {
       SetPalette(&palblack[0]);
-      usleep(20000);
+      usleep(FADEDELAY);
      }

      memset(&palblack[0],0,768);
@@ -193,7 +193,7 @@
  while(!FadingFX(NULL,&pal1[0],FADING_THE_END)) {

   SetPalette(&pal1[0]);
-  usleep(20000);
+  usleep(FADEDELAY);

  }


Attachment: nge_nibbles_speed_patch.diff.gz
Description: application/gzip

_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to