Thoroughly clean up the code to vastly reduce the number of compiler warnings and found and fixed several bugs in the process; Applied all mainline PCem commits; Added SCSI hard disk emulation; Commented out all unfinished machines and graphics cards; Added the AOpen AP53 and ASUS P/I-P55T2 machines as well as another Tyan 440FX machine, all three with AMI WinBIOS (patch from TheCollector1995); Added the Diamond Stealth 3D 3000 (S3 ViRGE/VX) graphics card (patch from TheCollector1995); Added the PS/2 XT IDE (AccuLogic) HDD Controller (patch from TheCollector1995); Added Microsoft/Logitech Bus Mouse emulation (patch from waltje); Overhauled the makefiles (patch from waltje); Added the Adaptec AHA-1542CF SCSI controller (patch from waltje); Added preliminary (but still unfinished) Adaptec AHA-154x SCSI controller BIOS support (patch from waltje); Added an ISABugger debugging device (patch from waltje); Added sanity checks to the Direct3D code.
49 lines
1.2 KiB
C
49 lines
1.2 KiB
C
/* Copyright holders: Melissa Goad
|
|
see COPYING for more details
|
|
*/
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "ibm.h"
|
|
#include "io.h"
|
|
#include "mem.h"
|
|
|
|
#include "usb.h"
|
|
|
|
void (*usb_packet_handle[32])(usb_packet_t* packet, void *priv);
|
|
void *usb_priv[32];
|
|
static int usb_min_card, usb_max_card;
|
|
|
|
void usb_init(int min_card, int max_card)
|
|
{
|
|
int c;
|
|
|
|
for (c = 0; c < 32; c++)
|
|
usb_packet_handle[c] = usb_priv[c] = NULL;
|
|
|
|
usb_min_card = min_card;
|
|
usb_max_card = max_card;
|
|
}
|
|
|
|
void usb_add_specific(int card, void (*packet_handle)(usb_packet_t *packet, void *priv), void *priv)
|
|
{
|
|
usb_packet_handle[card] = packet_handle;
|
|
usb_priv[card] = priv;
|
|
}
|
|
|
|
void usb_add(void (*packet_handle)(usb_packet_t *packet, void *priv), void *priv)
|
|
{
|
|
int c;
|
|
|
|
for (c = usb_min_card; c <= usb_max_card; c++)
|
|
{
|
|
if (!usb_packet_handle[c])
|
|
{
|
|
usb_packet_handle[c] = packet_handle;
|
|
usb_priv[c] = priv;
|
|
// pclog("USB device added to card: %i\n", c);
|
|
return;
|
|
}
|
|
}
|
|
}
|