mirror of https://github.com/PCSX2/pcsx2.git
USB: importing some references, updating handlers and c exports
This commit is contained in:
parent
2788198b75
commit
de314d253e
|
@ -285,6 +285,7 @@ typedef void(CALLBACK *_PADgsDriverInfo)(GSdriverInfo *info);
|
|||
typedef s32(CALLBACK *_PADsetSlot)(u8 port, u8 slot);
|
||||
typedef s32(CALLBACK *_PADqueryMtap)(u8 port);
|
||||
typedef void(CALLBACK *_PADWriteEvent)(keyEvent &evt);
|
||||
#endif
|
||||
|
||||
#ifdef PLUGINfuncs
|
||||
|
||||
|
|
|
@ -350,7 +350,7 @@ set(pcsx2USBSources
|
|||
USB/usb-mic/usb-mic-logitech.cpp
|
||||
USB/usb-mic/usb-headset.cpp
|
||||
USB/usb-eyetoy/jpgd/jpgd.cpp
|
||||
USB/usb-eyetoy/jo_mpeg.c
|
||||
USB/usb-eyetoy/jo_mpeg.cpp
|
||||
USB/usb-eyetoy/usb-eyetoy-webcam.cpp
|
||||
USB/usb-hid/usb-hid.cpp
|
||||
USB/shared/shared.cpp
|
||||
|
|
|
@ -41,5 +41,3 @@ extern void spu2DMA7Irq();
|
|||
|
||||
extern void iopIntcIrq( uint irqType );
|
||||
extern void iopTestIntc();
|
||||
|
||||
extern USBhandler usbHandler;
|
||||
|
|
|
@ -60,7 +60,6 @@ typedef struct {
|
|||
} USBfreezeData;
|
||||
|
||||
u8 *ram = 0;
|
||||
USBcallback _USBirq;
|
||||
FILE *usbLog;
|
||||
int64_t usb_frame_time;
|
||||
int64_t usb_bit_time;
|
||||
|
@ -83,13 +82,6 @@ Config::Config(): Log(0)
|
|||
memset(&WheelType, 0, sizeof(WheelType));
|
||||
}
|
||||
|
||||
void USBirq(int cycles)
|
||||
{
|
||||
//USB_LOG("USBirq.\n");
|
||||
|
||||
_USBirq(cycles);
|
||||
}
|
||||
|
||||
void __Log(const char *fmt, ...) {
|
||||
va_list list;
|
||||
|
||||
|
@ -195,7 +187,7 @@ void CreateDevices()
|
|||
}
|
||||
}
|
||||
|
||||
EXPORT_C_(s32) USBinit() {
|
||||
s32 USBinit() {
|
||||
OSDebugOut(TEXT("USBinit\n"));
|
||||
|
||||
RegisterDevice::Register();
|
||||
|
@ -223,7 +215,7 @@ EXPORT_C_(s32) USBinit() {
|
|||
return 0;
|
||||
}
|
||||
|
||||
EXPORT_C_(void) USBshutdown() {
|
||||
void USBshutdown() {
|
||||
|
||||
OSDebugOut(TEXT("USBshutdown\n"));
|
||||
DestroyDevices();
|
||||
|
@ -241,7 +233,7 @@ EXPORT_C_(void) USBshutdown() {
|
|||
//#endif
|
||||
}
|
||||
|
||||
EXPORT_C_(s32) USBopen(void *pDsp) {
|
||||
s32 USBopen(void *pDsp) {
|
||||
|
||||
if (conf.Log && !usbLog)
|
||||
{
|
||||
|
@ -299,7 +291,7 @@ EXPORT_C_(s32) USBopen(void *pDsp) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
EXPORT_C_(void) USBclose() {
|
||||
void USBclose() {
|
||||
OSDebugOut(TEXT("USBclose\n"));
|
||||
|
||||
if(usb_device[0] && usb_device[0]->klass.close)
|
||||
|
@ -312,17 +304,17 @@ EXPORT_C_(void) USBclose() {
|
|||
|
||||
}
|
||||
|
||||
EXPORT_C_(u8) USBread8(u32 addr) {
|
||||
u8 USBread8(u32 addr) {
|
||||
USB_LOG("* Invalid 8bit read at address %lx\n", addr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
EXPORT_C_(u16) USBread16(u32 addr) {
|
||||
u16 USBread16(u32 addr) {
|
||||
USB_LOG("* Invalid 16bit read at address %lx\n", addr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
EXPORT_C_(u32) USBread32(u32 addr) {
|
||||
u32 USBread32(u32 addr) {
|
||||
u32 hard;
|
||||
|
||||
hard=ohci_mem_read(qemu_ohci,addr);
|
||||
|
@ -332,42 +324,27 @@ EXPORT_C_(u32) USBread32(u32 addr) {
|
|||
return hard;
|
||||
}
|
||||
|
||||
EXPORT_C_(void) USBwrite8(u32 addr, u8 value) {
|
||||
void USBwrite8(u32 addr, u8 value) {
|
||||
USB_LOG("* Invalid 8bit write at address %lx value %x\n", addr, value);
|
||||
}
|
||||
|
||||
EXPORT_C_(void) USBwrite16(u32 addr, u16 value) {
|
||||
void USBwrite16(u32 addr, u16 value) {
|
||||
USB_LOG("* Invalid 16bit write at address %lx value %x\n", addr, value);
|
||||
}
|
||||
|
||||
EXPORT_C_(void) USBwrite32(u32 addr, u32 value) {
|
||||
void USBwrite32(u32 addr, u32 value) {
|
||||
USB_LOG("* Known 32bit write at address %lx value %lx\n", addr, value);
|
||||
ohci_mem_write(qemu_ohci,addr,value);
|
||||
}
|
||||
|
||||
EXPORT_C_(void) USBirqCallback(USBcallback callback) {
|
||||
_USBirq = callback;
|
||||
}
|
||||
|
||||
extern u32 bits;
|
||||
|
||||
EXPORT_C_(int) _USBirqHandler(void)
|
||||
{
|
||||
//fprintf(stderr," * USB: IRQ Acknowledged.\n");
|
||||
//qemu_ohci->intr_status&=~bits;
|
||||
return 1;
|
||||
}
|
||||
|
||||
EXPORT_C_(USBhandler) USBirqHandler(void) {
|
||||
return (USBhandler)_USBirqHandler;
|
||||
}
|
||||
|
||||
EXPORT_C_(void) USBsetRAM(void *mem) {
|
||||
void USBsetRAM(void *mem) {
|
||||
ram = (u8*)mem;
|
||||
Reset();
|
||||
}
|
||||
|
||||
EXPORT_C_(s32) USBfreeze(int mode, freezeData *data) {
|
||||
s32 USBfreeze(int mode, freezeData *data) {
|
||||
USBfreezeData usbd = { 0 };
|
||||
|
||||
//TODO FREEZE_SIZE mismatch causes loading to fail in PCSX2 beforehand
|
||||
|
@ -608,7 +585,7 @@ EXPORT_C_(s32) USBfreeze(int mode, freezeData *data) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
EXPORT_C_(void) USBasync(u32 cycles)
|
||||
void USBasync(u32 cycles)
|
||||
{
|
||||
remaining += cycles;
|
||||
clocks += remaining;
|
||||
|
@ -643,10 +620,6 @@ EXPORT_C_(void) USBasync(u32 cycles)
|
|||
//}
|
||||
}
|
||||
|
||||
EXPORT_C_(s32) USBtest() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cpu_physical_memory_rw(u32 addr, u8 *buf, size_t len, int is_write)
|
||||
{
|
||||
//OSDebugOut(TEXT("%s addr %08X, len %d\n"), is_write ? TEXT("write") : TEXT("read "), addr, len);
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifndef __PS2USB_H__
|
||||
#define __PS2USB_H__
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
@ -36,12 +33,26 @@ extern u8 *ram;
|
|||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
extern USBcallback _USBirq;
|
||||
void USBirq(int);
|
||||
|
||||
void DestroyDevices();
|
||||
void CreateDevices();
|
||||
|
||||
s32 USBinit();
|
||||
void USBasync(u32 cycles);
|
||||
void USBshutdown();
|
||||
void USBclose();
|
||||
s32 USBopen(void *pDsp);
|
||||
s32 USBfreeze(int mode, freezeData *data);
|
||||
|
||||
u8 USBread8(u32 addr);
|
||||
u16 USBread16(u32 addr);
|
||||
u32 USBread32(u32 addr);
|
||||
void USBwrite8(u32 addr, u8 value);
|
||||
void USBwrite16(u32 addr, u16 value);
|
||||
void USBwrite32(u32 addr, u32 value);
|
||||
|
||||
|
||||
void USBsetRAM(void *mem);
|
||||
|
||||
extern FILE *usbLog;
|
||||
s64 get_clock();
|
||||
|
||||
|
@ -55,4 +66,3 @@ void UninitWindow();
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue