Changes since v0.7 : - Major CPU reorganisation. This has possibly broken some stuff, though I fixed all the regressions I could find - Lazy flags. This brought 10% speed improvement at one point, but that's probably been lost now - 430 VX chipset emulation - IDT Winchip emulation (currently sans MMX). Timing is probably wrong - Fixed a few FPU bugs - Timer reorganisation - Sound reorganisation - Other general reorganisation - AdLib Gold emulation - Windows Sound System emulation - Pro Audio Spectrum 16 emulation. This currently works with most DOS stuff, but not in Windows - Major improvements to GUS emulation. Has the downside that it now conflicts with SB emulation, so probably best to not enable both simultaneously - New graphics cards : - ATI-18800 (VGA Edge-16) - ATI-28800 (VGA Charger) - ATI Mach64GX (Graphics Pro Turbo). Quite a few features missing, but Windows doesn't seem to use half the features of this card - Cirrus Logic CL-GD5429. Blitter is a bit broken - Oak OTI-067 - S3 Trio64 (Number Nine 9FX) - S3 Virge. Only framebuffer stuff at the minute, Windows won't recognise the card - Trident TGUI-9440 - VGA. Doesn't work yet - Beginnings of 3DFX emulation, however this is in extremely early stages and doesn't do anything useful - Fixed DMA bug stopping floppy drives working in Windows 3.x - Fixed some other stuff probably - Broke some other stuff probably as well
70 lines
1.7 KiB
C
70 lines
1.7 KiB
C
#include "ibm.h"
|
|
#include "mouse.h"
|
|
#include "pic.h"
|
|
#include "serial.h"
|
|
#include "timer.h"
|
|
|
|
static int oldb=0;
|
|
|
|
void mouse_serial_poll(int x, int y, int b)
|
|
{
|
|
uint8_t mousedat[3];
|
|
|
|
if (!(serial.ier&1)) return;
|
|
if (!x && !y && b==oldb) return;
|
|
|
|
oldb=b;
|
|
if (x>127) x=127;
|
|
if (y>127) y=127;
|
|
if (x<-128) x=-128;
|
|
if (y<-128) y=-128;
|
|
|
|
/*Use Microsoft format*/
|
|
mousedat[0]=0x40;
|
|
mousedat[0]|=(((y>>6)&3)<<2);
|
|
mousedat[0]|=((x>>6)&3);
|
|
if (b&1) mousedat[0]|=0x20;
|
|
if (b&2) mousedat[0]|=0x10;
|
|
mousedat[1]=x&0x3F;
|
|
mousedat[2]=y&0x3F;
|
|
|
|
if (!(serial.mctrl&0x10))
|
|
{
|
|
serial_write_fifo(mousedat[0]);
|
|
serial_write_fifo(mousedat[1]);
|
|
serial_write_fifo(mousedat[2]);
|
|
}
|
|
}
|
|
|
|
void mouse_serial_rcr()
|
|
{
|
|
mousepos=-1;
|
|
mousedelay=5000 * (1 << TIMER_SHIFT);
|
|
}
|
|
|
|
void mousecallback()
|
|
{
|
|
mousedelay = 0;
|
|
if (mousepos == -1)
|
|
{
|
|
mousepos = 0;
|
|
serial_fifo_read = serial_fifo_write = 0;
|
|
serial.linestat &= ~1;
|
|
serial_write_fifo('M');
|
|
}
|
|
else if (serial_fifo_read != serial_fifo_write)
|
|
{
|
|
serial.iir=4;
|
|
serial.linestat|=1;
|
|
if (serial.mctrl&8) picint(0x10);
|
|
}
|
|
// printf("Mouse callback\n");
|
|
}
|
|
|
|
void mouse_serial_init()
|
|
{
|
|
mouse_poll = mouse_serial_poll;
|
|
serial_rcr = mouse_serial_rcr;
|
|
timer_add(mousecallback, &mousedelay, &mousedelay, NULL);
|
|
}
|
|
|