bin2res: Clean output files when aborting on an error or signal.
[wine/multimedia.git] / dlls / winedos / int1a.c
blobc4e3919dcaa3ae5b89391afc6d3fea02a126ac37
1 /*
2 * BIOS interrupt 1ah handler
4 * Copyright 1993 Erik Bos
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "config.h"
22 #include "wine/debug.h"
23 #include "dosexe.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(int);
27 #define BCD_TO_BIN(x) ((x&15) + (x>>4)*10)
28 #define BIN_TO_BCD(x) ((x%10) + ((x/10)<<4))
31 /**********************************************************************
32 * DOSVM_Int1aHandler
34 * Handler for int 1ah.
36 void WINAPI DOSVM_Int1aHandler( CONTEXT86 *context )
38 switch(AH_reg(context))
40 case 0x00: /* GET SYSTEM TIME */
42 BIOSDATA *data = DOSVM_BiosData();
43 SET_CX( context, HIWORD(data->Ticks) );
44 SET_DX( context, LOWORD(data->Ticks) );
45 SET_AL( context, 0 ); /* FIXME: midnight flag is unsupported */
46 TRACE( "GET SYSTEM TIME - ticks=%ld\n", data->Ticks );
48 break;
50 case 0x01: /* SET SYSTEM TIME */
51 FIXME( "SET SYSTEM TIME - not allowed\n" );
52 break;
54 case 0x02: /* GET REAL-TIME CLOCK TIME */
55 TRACE( "GET REAL-TIME CLOCK TIME\n" );
57 SYSTEMTIME systime;
58 GetLocalTime( &systime );
59 SET_CH( context, BIN_TO_BCD(systime.wHour) );
60 SET_CL( context, BIN_TO_BCD(systime.wMinute) );
61 SET_DH( context, BIN_TO_BCD(systime.wSecond) );
62 SET_DL( context, 0 ); /* FIXME: assume no daylight saving */
63 RESET_CFLAG(context);
65 break;
67 case 0x03: /* SET REAL-TIME CLOCK TIME */
68 FIXME( "SET REAL-TIME CLOCK TIME - not allowed\n" );
69 break;
71 case 0x04: /* GET REAL-TIME CLOCK DATE */
72 TRACE( "GET REAL-TIME CLOCK DATE\n" );
74 SYSTEMTIME systime;
75 GetLocalTime( &systime );
76 SET_CH( context, BIN_TO_BCD(systime.wYear / 100) );
77 SET_CL( context, BIN_TO_BCD(systime.wYear % 100) );
78 SET_DH( context, BIN_TO_BCD(systime.wMonth) );
79 SET_DL( context, BIN_TO_BCD(systime.wDay) );
80 RESET_CFLAG(context);
82 break;
84 case 0x05: /* SET REAL-TIME CLOCK DATE */
85 FIXME( "SET REAL-TIME CLOCK DATE - not allowed\n" );
86 break;
88 case 0x06: /* SET ALARM */
89 FIXME( "SET ALARM - unimplemented\n" );
90 break;
92 case 0x07: /* CANCEL ALARM */
93 FIXME( "CANCEL ALARM - unimplemented\n" );
94 break;
96 case 0x08: /* SET RTC ACTIVATED POWER ON MODE */
97 case 0x09: /* READ RTC ALARM TIME AND STATUS */
98 case 0x0a: /* READ SYSTEM-TIMER DAY COUNTER */
99 case 0x0b: /* SET SYSTEM-TIMER DAY COUNTER */
100 case 0x0c: /* SET RTC DATE/TIME ACTIVATED POWER-ON MODE */
101 case 0x0d: /* RESET RTC DATE/TIME ACTIVATED POWER-ON MODE */
102 case 0x0e: /* GET RTC DATE/TIME ALARM AND STATUS */
103 case 0x0f: /* INITIALIZE REAL-TIME CLOCK */
104 INT_BARF( context, 0x1a );
105 break;
107 case 0xb0:
108 if (CX_reg(context) == 0x4d52 &&
109 DX_reg(context) == 0x4349 &&
110 AL_reg(context) == 0x01)
113 * Microsoft Real-Time Compression Interface (MRCI).
114 * Ignoring this call indicates MRCI is not supported.
116 TRACE( "Microsoft Real-Time Compression Interface - not supported\n" );
118 else
120 INT_BARF(context, 0x1a);
122 break;
124 default:
125 INT_BARF( context, 0x1a );