VOGONS


First post, by bat

User metadata
Rank Newbie
Rank
Newbie

I use DosBox for simulating some of my application (not game) that run under dos.
Here a small thing that seem to be wrong : the month of the date get from the CMOS RTC is not correct, it should be +1

I have source from archive (not CVS), it's in [hardware\cmos.cpp]
static Bitu cmos_readreg(Bitu port,Bitu iolen) {
...
case 0x08: /* Month */
return MAKE_RETURN(loctime->tm_mon+1);

Sorry if my post is not in the right place or with the right way ... but I can't spending too much time on it.

Reply 2 of 2, by TeaRex

User metadata
Rank Member
Rank
Member

See also the "date" thread I have just started. The MAKE_RETURN macro *must* be modified (macro parameter must be put in parantheses in macro body, really always a god idea 😀) for this to work! The weekday function should be corrected too, localtime uses 0-6, but RTC chip uses 1-7. And year should be split up between century byte and 2-digit-year byte. See my patch in the other thread.

tearex