1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00
wine/miscemu/int1a.c
Alexandre Julliard 7e50df392b Release 940804
Thu Aug  4 07:18:02 1994  Michael Patra  <micky@marie.physik.tu-berlin.de>

        * [windows/message.c]
	Implemented WaitMessage() (USER.112).

        * [if1632/user.spec]
	Added WaitMessage.

	* [windows/defwnd.c]
	WM_ERASEBKGND: Added support for hbrBackground=COLOR_xxx.

   	* [miscemu/int{13,21,2a}.c]
        * [miscemu/Imakefile]
	* [signal/loader.c]
	Added a few basic disk information and diagnostic functions to
	prevent programs using this function from crashing. All drives
	are claimed to be remote ones, so direct I/O isn't allowed.

	* [controls/edit.c]
	EDIT_WriteText(): Added code to correctly erase the remaining space
	of the edit-control if the size of the control has changed sinced it's
	creation.

Tue Jul 26 22:05:54 MET DST 1994 Erik Bos <erik@hacktic.nl>

	* [if1632/mouse.spec]
	Added mouse.dll entry, no functions.

	* [loader/resource.c]
	Bug fix in AccessResource(). 

	* [misc/keyboard.c], added [include/keyboard.h]
	Changed functions to return more useful values.

	* [windows/dialog.c]
	Hacked DIALOG_GetControl() to support resources which
	have 0xff00 - 0xffff as id. ** Needs to be done properly by
	someone who knows the NE fileformat **

Jul 29, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)

	* [windows/event.c]
	Add new stub for EnableHGardwareInput() function.

	* [windows/message.c]
	Add coding for HWND_BROADCAST in PostMessage().

	* [misc/file.c]
	Add coding for OpenFile() also search in WindowPaths.

	* [misc/mmsystem.c]
	* [misc/audio.c]
	* [misc/mmaux.c]
	* [misc/mcicda.c]
	Change #include "linux/soundcard.h" by #include "sys/soundcard.h"
	Add coding in MMIO functions. Now, mmioDescend() can find WAV chunks.
	SndPlaySound & MCI_ELEMENT now use MMIO and adjust to proper formats.
1994-08-06 11:22:41 +00:00

68 lines
1.5 KiB
C

#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include "msdos.h"
#include "wine.h"
#include "options.h"
#ifdef linux
#include <linux/sched.h> /* needed for HZ */
#endif
#define BCD_TO_BIN(x) ((x&15) + (x>>4)*10)
#define BIN_TO_BCD(x) ((x%10) + ((x/10)<<4))
int do_int1A(struct sigcontext_struct * context){
time_t ltime;
struct tm *bdtime;
int ticks;
if (Options.relay_debug) {
printf("int1A: AX %04x, BX %04x, CX %04x, DX %04x, "
"SI %04x, DI %04x, DS %04x, ES %04x\n",
AX, BX, CX, DX, SI, DI, DS, ES);
}
switch((context->sc_eax >> 8) & 0xff){
case 0:
ltime = time(NULL);
ticks = (int) (ltime * HZ);
context->sc_ecx = ticks >> 16;
context->sc_edx = ticks & 0x0000FFFF;
context->sc_eax = 0; /* No midnight rollover */
printf("int1a_00 // ltime=%ld ticks=%ld\n", ltime, ticks);
break;
case 2:
ltime = time(NULL);
bdtime = localtime(&ltime);
context->sc_ecx = (BIN_TO_BCD(bdtime->tm_hour)<<8) | BIN_TO_BCD(bdtime->tm_min);
context->sc_edx = (BIN_TO_BCD(bdtime->tm_sec)<<8);
case 4:
ltime = time(NULL);
bdtime = localtime(&ltime);
context->sc_ecx = (BIN_TO_BCD(bdtime->tm_year/100)<<8) | BIN_TO_BCD((bdtime->tm_year-1900)%100);
context->sc_edx = (BIN_TO_BCD(bdtime->tm_mon)<<8) | BIN_TO_BCD(bdtime->tm_mday);
break;
/* setting the time,date or RTC is not allow -EB */
case 1:
/* set system time */
case 3:
/* set RTC time */
case 5:
/* set RTC date */
case 6:
/* set ALARM */
case 7:
/* cancel ALARM */
break;
default:
IntBarf(0x1a, context);
return 1;
};
return 1;
}