1
0
Fork 0

Date and time patch #1117179

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2118
This commit is contained in:
Peter Veenstra 2005-02-24 17:51:00 +00:00
parent 8beb996996
commit b91563ec45
2 changed files with 20 additions and 16 deletions

View file

@ -71,6 +71,7 @@ static void cmos_writereg(Bitu port,Bitu val,Bitu iolen) {
case 0x07: /* Date of month */
case 0x08: /* Month */
case 0x09: /* Year */
case 0x32: /* Century */
/* Ignore writes to change alarm */
break;
case 0x01: /* Seconds Alarm */
@ -102,7 +103,7 @@ static void cmos_writereg(Bitu port,Bitu val,Bitu iolen) {
}
#define MAKE_RETURN(_VAL) (cmos.bcd ? (((_VAL / 10) << 4) | (_VAL % 10)) : _VAL);
#define MAKE_RETURN(_VAL) (cmos.bcd ? ((((_VAL) / 10) << 4) | ((_VAL) % 10)) : (_VAL));
static Bitu cmos_readreg(Bitu port,Bitu iolen) {
if (cmos.reg>0x3f) {
@ -128,13 +129,15 @@ static Bitu cmos_readreg(Bitu port,Bitu iolen) {
case 0x04: /* Hours */
return MAKE_RETURN(loctime->tm_hour);
case 0x06: /* Day of week */
return MAKE_RETURN(loctime->tm_wday);
return MAKE_RETURN(loctime->tm_wday + 1);
case 0x07: /* Date of month */
return MAKE_RETURN(loctime->tm_mday);
case 0x08: /* Month */
return MAKE_RETURN(loctime->tm_mon);
return MAKE_RETURN(loctime->tm_mon + 1);
case 0x09: /* Year */
return MAKE_RETURN(loctime->tm_year);
return MAKE_RETURN(loctime->tm_year % 100);
case 0x32: /* Century */
return MAKE_RETURN(loctime->tm_year / 100 + 19);
case 0x01: /* Seconds Alarm */
case 0x03: /* Minutes Alarm */
case 0x05: /* Hours Alarm */

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: bios.cpp,v 1.39 2005-02-10 10:21:11 qbix79 Exp $ */
/* $Id: bios.cpp,v 1.40 2005-02-24 17:50:58 qbix79 Exp $ */
#include <time.h>
#include "dosbox.h"
@ -79,19 +79,20 @@ static Bitu INT1A_Handler(void) {
reg_cl=IO_Read(0x71);
IO_Write(0x70,0x00); //Seconds
reg_dh=IO_Read(0x71);
reg_dl=0; //Daylight saving disabled
reg_dl=0; //Daylight saving disabled
CALLBACK_SCF(false);
break;
case 0x04: /* GET REAL-TIME ClOCK DATE (AT,XT286,PS) */
IO_Write(0x70,0x32); //Centuries
reg_ch=IO_Read(0x71);
IO_Write(0x70,0x09); //Years
reg_cl=IO_Read(0x71);
IO_Write(0x70,0x08); //Months
reg_dh=IO_Read(0x71);
IO_Write(0x70,0x07); //Days
reg_dl=IO_Read(0x71);
CALLBACK_SCF(false);
break;
case 0x04: /* GET REAL-TIME ClOCK DATA (AT,XT286,PS) */
reg_dx=0;
reg_cx=0x2003;
CALLBACK_SCF(false);
LOG(LOG_BIOS,LOG_ERROR)("INT1A:04:Faked RTC get date call");
break;
// reg_dx=reg_cx=0;
// CALLBACK_SCF(false);
// LOG(LOG_BIOS,LOG_ERROR)("INT1A:04:Faked RTC get date call");
// break;
case 0x80: /* Pcjr Setup Sound Multiplexer */
LOG(LOG_BIOS,LOG_ERROR)("INT1A:80:Setup tandy sound multiplexer to %d",reg_al);
break;