Skip to contentSkip to conversation

bug in pic_prot.diff (was Re: Bootfile)

DISCUSSION Stas Sergeev 2 participants 2 messages Feb 6, 2003

lore
Share & tools
lore
#0 lore raw

Hello.

Quoted 3 lines · Bart Oldeman
Quoted 1 line

BTW, release 1.1.4.5 was the last where snake.com is working under xdos/xdosemu.

after some binary searches I found out that Stas' pic_prot.diff is guilty for doing this.

There might be something wrong here. The report states that this game stopped working under "xdos/xdosemu", and I am sure my patch have nothing to do with an X code (that's why I haven't even tried the game - I was sure I couldn't break the X code). Now I tried, and indeed it doesn't work. However it misses the Eric A's userfont patch, so I think it never worked under xdosemu unless someone applied a userfont patch manually.

Quoted 1 line

Stas, can you figure out why?

I can only figure out why it doesn't work under console, but that's an entirely different story. Anyway, it seems to me that the watchdog patch was flawed:
if I set the $_pic_watchdog=(1) or 2 or 3, the game works perfectly (under console of course), but if I set it to 10 and more - it locks up. That looks like a problem.
The attached patch fixes it: now setting $_pic_watchdog to any reasonable value (within a range of 1-100 approx) will work for that game.
However I have found my test-case for that problem screwed up by an XMS changes of 1.1.4.1. For now I just reverted an XMS changes to test the attached patch. I'll return to that problem when I'll have more time.

Background: this game works inside a keyboard interrupt handler (probably many pop-up progs do so if they use a hot-key), so essentially it needs a reentrancy, which was restricted due to the timer jerkiness discussed recently around the Cosmo problem. That's why we need (sometimes) a $_pic_watchdog.

base/dev/pic/pic.c +3 -4
@@ -733,7 +733,6 @@
      if (test_bit(ilevel, &pic_irqall)) {
        pic_push(ilevel);
        set_bit(ilevel, &pic_irqs_active);
-       pic_wcount = 0;
      }
 
      if (!in_dpmi || in_dpmi_dos_int) {
@@ -838,7 +837,8 @@
         pic_wirr&=~pic_newirr;        /* clear watchdog timer */
 	pic_activate();
     }
-    pic_wcount = 0;
+    if (!pic_icount)
+      pic_wcount = 0;
 }
 
 /* DANG_BEGIN_FUNCTION pic_request
@@ -1031,9 +1031,8 @@
       if(++pic_wcount >= config.pic_watchdog) {
         error("PIC: force reschedule\n");
         pic_resched();
+	pic_wcount = 0;
       }
-    } else {
-      pic_wcount = 0;
     }
   }
 }      
#1 lore raw
Quoted 4 lines · Stas Sergeev

There might be something wrong here. The report states that this game stopped working under "xdos/xdosemu", and I am sure my patch have nothing to do with an X code (that's why I haven't even tried the game - I was sure I couldn't break the X code).

yes, this is what confused me too (I thought it would be a vgaemu bug), but it was really a keyboard related problem.

Quoted 3 lines

Now I tried, and indeed it doesn't work. However it misses the Eric A's userfont patch, so I think it never worked under xdosemu unless someone applied a userfont patch manually.

maybe "working" just meant "playing with funny characters". As that's how it worked in 1.1.4.5.

Quoted 7 lines

I can only figure out why it doesn't work under console, but that's an entirely different story. Anyway, it seems to me that the watchdog patch was flawed: if I set the $_pic_watchdog=(1) or 2 or 3, the game works perfectly (under console of course), but if I set it to 10 and more - it locks up. That looks like a problem. The attached patch fixes it: now setting $_pic_watchdog to any reasonable value (within a range of 1-100 approx) will work for that game.

Hmm why do you now need to enable the hack in the first place where it was unnecessary before? That doesn't sound like a good thing to me.

Quoted 3 lines

However I have found my test-case for that problem screwed up by an XMS changes of 1.1.4.1. For now I just reverted an XMS changes to test the attached patch. I'll return to that problem when I'll have more time.

i'll look at the XMS changes again to see if I missed something there.

Bart