Skip to content

Commit

Permalink
Commit as-is. Mouse funtional but very laggy for some odd reason
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 committed Nov 13, 2023
1 parent 910a523 commit f44cd05
Show file tree
Hide file tree
Showing 9 changed files with 698 additions and 33 deletions.
9 changes: 7 additions & 2 deletions src/chipset/via_pipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1629,10 +1629,14 @@ static void *
pipc_init(const device_t *info)
{
pipc_t *dev = (pipc_t *) malloc(sizeof(pipc_t));
usb_params_t params;
memset(dev, 0, sizeof(pipc_t));

pipc_log("PIPC: init()\n");

params.pci_slot = dev->pci_slot;
params.pci_regs = dev->usb_regs[0];

dev->local = info->local;
pci_add_card(PCI_ADD_SOUTHBRIDGE, pipc_read, pipc_write, dev, &dev->pci_slot);

Expand All @@ -1659,9 +1663,10 @@ pipc_init(const device_t *info)
acpi_set_trap_update(dev->acpi, pipc_trap_update_586, dev);
}

dev->usb[0] = device_add_inst(&usb_device, 1);
dev->usb[0] = device_add_inst_parameters(&usb_device, 1, &params);
if (dev->local >= VIA_PIPC_686A) {
dev->usb[1] = device_add_inst(&usb_device, 2);
params.pci_regs = dev->usb_regs[1];
dev->usb[1] = device_add_inst_parameters(&usb_device, 2, &params);

dev->ac97 = device_add(&ac97_via_device);

Expand Down
2 changes: 1 addition & 1 deletion src/device/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ add_library(dev OBJECT bugger.c cassette.c cartridge.c hasp.c hwm.c hwm_lm75.c h
smbus_piix4.c smbus_ali7101.c keyboard.c keyboard_xt.c
kbc_at.c kbc_at_dev.c
keyboard_at.c
mouse.c mouse_bus.c mouse_serial.c mouse_ps2.c phoenix_486_jumper.c
mouse.c mouse_bus.c mouse_serial.c mouse_ps2.c mouse_usb.c phoenix_486_jumper.c
serial_passthrough.c)

if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Expand Down
6 changes: 6 additions & 0 deletions src/device/mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ static mouse_t mouse_devices[] = {
{ &mouse_msserial_device },
{ &mouse_ltserial_device },
{ &mouse_ps2_device },
{ &mouse_usb_device },
#ifdef USE_WACOM
{ &mouse_wacom_device },
{ &mouse_wacom_artpad_device },
Expand Down Expand Up @@ -508,6 +509,8 @@ mouse_set_sample_rate(double new_rate)
sample_rate = new_rate;
if (mouse_timed)
timer_on_auto(&mouse_timer, 1000000.0 / sample_rate);

pclog("New sample rate is %f\n", new_rate);
}

/* Callback from the hardware driver. */
Expand Down Expand Up @@ -645,6 +648,9 @@ mouse_reset(void)

if ((mouse_type > 1) && (mouse_curr != NULL))
mouse_priv = device_add(mouse_curr);

if (mouse_priv == NULL)
mouse_curr = NULL;
}

void
Expand Down
Loading

0 comments on commit f44cd05

Please sign in to comment.