public inbox for linux-msdos@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [ 671573 ] Cosmo locks up
@ 2003-01-26 23:50 Clarence Dang
  0 siblings, 0 replies; 3+ messages in thread
From: Clarence Dang @ 2003-01-26 23:50 UTC (permalink / raw)
  To: linux-msdos

[-- Attachment #1: Type: text/plain, Size: 673 bytes --]


Hi,

> download Cosmo's Cosmic Adventure from 
> http://www.apogee1.com/downloads.html. it goes into 
> infinite loop waiting for global variable to be set to 0 but 
> the int8 timer that increments variable seems to fire at just 
> wrong time. sounds like a PIC problem...but works in NT? 
> :( not a DPMI app either. 
For anyone whose interested, please try Stas' patch at sourceforge and the 
attached one.  Please report any observations and problems with the patches 
(on Cosmo and other programs).

I'm posting this patch here because sf doesn't let you attach files to closed 
bug reports it seems.  You will have to "make clean" before using this patch.

Clarence

[-- Attachment #2: pit_apogee_trigger.patch --]
[-- Type: text/x-diff, Size: 4978 bytes --]

--- 1147pr/etc/dosemu.conf	2003-01-23 17:02:07.000000000 +1100
+++ 1147/etc/dosemu.conf	2003-01-24 22:57:31.000000000 +1100
@@ -181,7 +181,10 @@
 #$_pic_watchdog = (off) # try setting this to some positive value (eg. 5)
 #                       # if you get problems with some DOS program
 #			# freezing after some time.
+#$_pit_apogee_trigger = (off)	# set this to 'on' if you want to play certain
+#			# Apogee/ID/Softdisk games (eg. Cosmo & Keen 6)
 #
+#  Joystick settings
 #$_joy_device = "/dev/js0 /dev/js1"     # 1st and 2nd joystick device 
 #                       # e.g. "/dev/js0" or "/dev/js0 /dev/js1"
 #                       #      (or "" if you don't want joystick support)
--- 1147pr/etc/global.conf	2003-01-23 17:02:07.000000000 +1100
+++ 1147/etc/global.conf	2003-01-24 22:58:20.000000000 +1100
@@ -168,7 +168,8 @@
     ## with 'dosemu_' prefixed will overwrite those without the prefix.
 
     checkuservar $_debug,
-      $_features, $_mapping, $_hogthreshold, $_cli_timeout, $_pic_force_count,
+      $_features, $_mapping, $_hogthreshold,
+      $_cli_timeout, $_pic_watchdog, $_pit_apogee_trigger,
       $_timint, $_mathco, $_cpu, $_rdtsc, $_cpuspeed, $_xms, $_ems, $_ems_frame,
       $_dpmi, $_emusys, $_emuini, $_dosmem
     checkuservar
@@ -396,6 +397,7 @@
   ## hacks
   cli_timeout $_cli_timeout
   pic_watchdog $_pic_watchdog
+  pit_apogee_trigger $_pit_apogee_trigger
 
   ## serial
   if (strlen($_ttylocks))
--- 1147pr/src/base/dev/misc/timers.c	2003-01-17 05:19:00.000000000 +1100
+++ 1147/src/base/dev/misc/timers.c	2003-01-24 22:57:05.000000000 +1100
@@ -430,13 +430,21 @@
     pit[port].time.td = GETtickTIME(0);
 
     if (port == 0) {
+      if (config.pit_apogee_trigger) {
+         /* Cosmo, Keen 6,... */
+         if (pit[0].cntr == 1192) {
+            pit[0].cntr = 0x10000; /* 18.2 Hz */
+            error ("PIT: Apogee HACK: Changing from 1000Hz to 18.2Hz\n");
+         }
+      }
+
       ticks_accum   = 0;
       timer_div     = (pit[0].cntr * 10000) / PIT_TICK_RATE;
       if (timer_div == 0)
-	timer_div = 1;
-#if 0
-      i_printf("timer_interrupt_rate requested %.3g Hz, granted %.3g Hz\n",
-	       PIT_TICK_RATE/(double)pit[0].cntr, 10000.0/timer_div);
+         timer_div = 1;
+#if 1
+      i_printf("timer_interrupt_rate count %i, requested %.6g Hz, granted %.6g Hz\n",
+	       pit[0].cntr, PIT_TICK_RATE/(double)pit[0].cntr, 10000.0/timer_div);
 #endif
     }
     else if (port == 2 && config.speaker == SPKR_EMULATED) {
--- 1147pr/src/base/init/config.c	2003-01-23 17:02:08.000000000 +1100
+++ 1147/src/base/init/config.c	2003-01-24 22:58:35.000000000 +1100
@@ -306,6 +306,7 @@
         config.sb_base, config.sb_dma, config.sb_irq, config.mpu401_base, config.sb_dsp, config.sb_mixer);
     (*print)("\ncli_timeout %d\n", config.cli_timeout);
     (*print)("\npic_watchdog %d\n", config.pic_watchdog);
+    (*print)("\npit_apogee_trigger %d\n", config.pit_apogee_trigger);
     (*print)("\nJOYSTICK:\njoy_device0 \"%s\"\njoy_device1 \"%s\"\njoy_dos_min %i\njoy_dos_max %i\njoy_granularity %i\njoy_latency %i\n",
         config.joy_device[0], config.joy_device[1], config.joy_dos_min, config.joy_dos_max, config.joy_granularity, config.joy_latency);
 
--- 1147pr/src/base/init/lexer.l.in	2003-01-23 17:02:08.000000000 +1100
+++ 1147/src/base/init/lexer.l.in	2003-01-24 22:59:12.000000000 +1100
@@ -668,6 +668,7 @@
 	/* hacks */
 cli_timeout		RETURN(CLI_TIMEOUT);
 pic_watchdog		RETURN(PIC_WATCHDOG);
+pit_apogee_trigger	RETURN(PIT_APOGEE_TRIGGER);
 
 	/* strings */
 
--- 1147pr/src/base/init/parser.y.in	2003-01-23 17:02:08.000000000 +1100
+++ 1147/src/base/init/parser.y.in	2003-01-24 23:15:51.000000000 +1100
@@ -305,7 +305,7 @@
 	/* joystick */
 %token JOYSTICK JOY_DEVICE JOY_DOS_MIN JOY_DOS_MAX JOY_GRANULARITY JOY_LATENCY
 	/* Hacks */
-%token CLI_TIMEOUT PIC_WATCHDOG
+%token CLI_TIMEOUT PIC_WATCHDOG PIT_APOGEE_TRIGGER
 
 	/* we know we have 1 shift/reduce conflict :-( 
 	 * and tell the parser to ignore that */
@@ -732,6 +732,11 @@
 		    { config.cli_timeout = $2; }
 		| PIC_WATCHDOG int_bool
 		    { config.pic_watchdog = $2; }
+		| PIT_APOGEE_TRIGGER bool
+		    {
+		    config.pit_apogee_trigger = ($2!=0);
+		    c_printf("CONF: pit_apogee_trigger %s\n", ($2) ? "on" : "off");
+		    }
 		| STRING
 		    { yyerror("unrecognized command '%s'", $1); free($1); }
 		| error
--- 1147pr/src/include/emu.h	2003-01-23 17:02:08.000000000 +1100
+++ 1147/src/include/emu.h	2003-01-24 23:01:37.000000000 +1100
@@ -369,8 +369,10 @@
        int joy_granularity;	/* the higher, the less sensitive - for wobbly joysticks */
        int joy_latency;		/* delay between nonblocking linux joystick reads */
 
+       /* hacks */
        int cli_timeout;		/* cli timeout hack */
-       int pic_watchdog;        /* pic watchdog reschedule hack */      
+       int pic_watchdog;	/* pic watchdog reschedule hack */
+       boolean pit_apogee_trigger;	/* enable trigger for apogee hack */
      }
 
 config_t;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ 671573 ] Cosmo locks up
@ 2003-01-27  1:19 Stas Sergeev
  0 siblings, 0 replies; 3+ messages in thread
From: Stas Sergeev @ 2003-01-27  1:19 UTC (permalink / raw)
  To: linux-msdos

Hello.

Clarence Dang wrote:
> For anyone whose interested, please try Stas' patch at sourceforge and 
> the attached one.
Oh please, there is no need.
Let's finish our private discussion
before appealing to public, can we?

2 everybody: There is no need to try
my patch at SF because it needs work
and I am doing that work *right now*.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ 671573 ] Cosmo locks up
@ 2003-01-28  2:24 Clarence Dang
  0 siblings, 0 replies; 3+ messages in thread
From: Clarence Dang @ 2003-01-28  2:24 UTC (permalink / raw)
  To: linux-msdos

On Mon, 27 Jan 2003 12:19 pm, Stas Sergeev wrote:
> Hello.
>
> Clarence Dang wrote:
> > For anyone whose interested, please try Stas' patch at sourceforge and
> > the attached one.
>
> Oh please, there is no need.
Sorry.  Please ignore all these patches...just wait until we figure out a 
better (even cleaner?) solution.

> Let's finish our private discussion
> before appealing to public, can we?
>
Yes, I'll test your new patch and continue the discussion off-list.

But _you_ told me to make it public (I just couldn't attach it to the SF bug 
perhaps because it was closed) so don't blame me :)

On Mon, 27 Jan 2003 07:40 am, Stas Sergeev wrote:
> I closed the bug on SF almost immediately,
(...)
> Btw, you could attach you patch to
> that report in that case, so that the
> reporter could do the comparisions
> himself.
>

Clarence


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-01-28  2:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-28  2:24 [ 671573 ] Cosmo locks up Clarence Dang
  -- strict thread matches above, loose matches on Subject: below --
2003-01-27  1:19 Stas Sergeev
2003-01-26 23:50 Clarence Dang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox