TRLog
[Top] [All Lists]

Re: [Trlog] DOSBox on OS/X

To: trlog@contesting.com
Subject: Re: [Trlog] DOSBox on OS/X
From: Kevin Schmidt <w9cf@arrl.net>
Date: Fri, 12 Apr 2013 15:16:45 -0700
List-post: <trlog@contesting.com">mailto:trlog@contesting.com>
On Thu, Apr 11, 2013 at 06:30:38PM -0500, Mark Shaum wrote:
> 
> Kevin,  I believe that thread is referring to dosemu, which is not the 
> same as dosbox.  I'm using dosbox v0.74 here on my win 7 pro sp1 64 bit 
> machine to run a bunch of really old 16 and 32 bit programs. There is an 
> OSX version of dosbox 0.74 available, but I can't speak for it specifically.
> 
> Mark K9TR

I'm pretty sure it is referring to Dosbox. The versions of Dosemu
I'm familiar with don't have C++ files, and specifically don't have a
dos.cpp file.  The thread I linked to says:

BEGIN QUOTE

DosBox runs fine but has the date problem. I patched dos.cpp to return
the server time:

Code:
        case 0x2a:              /* Get System Date */
                {
                        struct timeval tv;
                        struct timezone tz;
                        struct tm *loctime;

                        gettimeofday(&tv, &tz);
                        loctime=localtime(&tv.tv_sec);

                        reg_al=loctime->tm_wday;
                        reg_cx=1900+loctime->tm_year;
                        reg_dh=1+loctime->tm_mon;
                        reg_dl=loctime->tm_mday;

//                      int a = (14 - dos.date.month)/12;
//                      int y = dos.date.year - a;
//                      int m = dos.date.month + 12*a - 2;
//                      reg_al=(dos.date.day+y+(y/4)-(y/100)+(y/400)+(31*m)/12) 
% 7;
//                      reg_cx=dos.date.year;
//                      reg_dh=dos.date.month;
//                      reg_dl=dos.date.day;
                }

and
Code:
        case 0x2c:              /* Get System Time */
//TODO Get time through bios calls date is fixed
                {
                        struct timeval tv;
                        struct timezone tz;
                        struct tm *loctime;

                        gettimeofday(&tv, &tz);
                        loctime=localtime(&tv.tv_sec);

                        reg_ch=(Bit8u)(loctime->tm_hour);
                        reg_cl=(Bit8u)(loctime->tm_min);
                        reg_dh=(Bit8u)(loctime->tm_sec);
                        reg_dl=(Bit8u)(tv.tv_usec/10000);
/*      Calculate how many miliseconds have passed */
//                      Bitu ticks=5*mem_readd(BIOS_TIMER);
//                      ticks = ((ticks / 59659u) << 16) + ((ticks % 59659u) << 
16) / 59659u;
//                      Bitu seconds=(ticks/100);
//                      reg_ch=(Bit8u)(seconds/3600);
//                      reg_cl=(Bit8u)((seconds % 3600)/60);
//                      reg_dh=(Bit8u)(seconds % 60);
//                      reg_dl=(Bit8u)(ticks % 100);
                }

Now my application runs fine. I hope the code is useful for someone else too.

Nyh

END QUOTE

73 Kevin w9cf
_______________________________________________
Trlog mailing list
Trlog@contesting.com
http://lists.contesting.com/mailman/listinfo/trlog

<Prev in Thread] Current Thread [Next in Thread>