just some more comments for SI :)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2515 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2009-03-02 05:55:39 +00:00
parent 5586c964bb
commit 2726a2acb9
4 changed files with 33 additions and 24 deletions

View File

@ -123,16 +123,16 @@ union USIPoll
u32 Hex; u32 Hex;
struct struct
{ {
unsigned VBCPY3 : 1; unsigned VBCPY3 : 1; // 1: write to output buffer only on vblank
unsigned VBCPY2 : 1; unsigned VBCPY2 : 1;
unsigned VBCPY1 : 1; unsigned VBCPY1 : 1;
unsigned VBCPY0 : 1; unsigned VBCPY0 : 1;
unsigned EN3 : 1; unsigned EN3 : 1; // Enable polling of channel
unsigned EN2 : 1; unsigned EN2 : 1; // does not affect communication RAM transfers
unsigned EN1 : 1; unsigned EN1 : 1;
unsigned EN0 : 1; unsigned EN0 : 1;
unsigned Y : 10; unsigned Y : 10; // Polls per frame
unsigned X : 10; unsigned X : 10; // Polls per X lines. begins at vsync, min 7, max depends on video mode
unsigned : 6; unsigned : 6;
}; };
}; };
@ -143,13 +143,17 @@ union USIComCSR
u32 Hex; u32 Hex;
struct struct
{ {
unsigned TSTART : 1; unsigned TSTART : 1; // write: start transfer read: transfer status
unsigned CHANNEL : 2; // determines which SI channel will be used the communication interface. unsigned CHANNEL : 2; // determines which SI channel will be used on the communication interface.
unsigned : 5; unsigned : 3;
unsigned CALLBEN : 1; // Callback enable
unsigned CMDEN : 1; // Command enable?
unsigned INLNGTH : 7; unsigned INLNGTH : 7;
unsigned : 1; unsigned : 1;
unsigned OUTLNGTH : 7; // Communication Channel Output Length in bytes unsigned OUTLNGTH : 7; // Communication Channel Output Length in bytes
unsigned : 4; unsigned : 1;
unsigned CHANEN : 1; // Channel enable?
unsigned CHANNUM : 2; // Channel number?
unsigned RDSTINTMSK : 1; // Read Status Interrupt Status Mask unsigned RDSTINTMSK : 1; // Read Status Interrupt Status Mask
unsigned RDSTINT : 1; // Read Status Interrupt Status unsigned RDSTINT : 1; // Read Status Interrupt Status
unsigned COMERR : 1; // Communication Error (set 0) unsigned COMERR : 1; // Communication Error (set 0)
@ -206,7 +210,7 @@ union USIEXIClockCount
u32 Hex; u32 Hex;
struct struct
{ {
unsigned LOCK : 1; unsigned LOCK : 1; // 1: prevents CPU from setting EXI clock to 32MHz
unsigned : 30; unsigned : 30;
}; };
}; };

View File

@ -52,6 +52,7 @@ int ISIDevice::RunBuffer(u8* _pBuffer, int _iLength)
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// Just a dummy that logs reads and writes // Just a dummy that logs reads and writes
// to be used for SI devices we haven't emulated // to be used for SI devices we haven't emulated
// and hopefully as an "emtpy" device
class CSIDevice_Dummy : public ISIDevice class CSIDevice_Dummy : public ISIDevice
{ {
public: public:

View File

@ -34,12 +34,16 @@ CSIDevice_GCController::CSIDevice_GCController(int _iDeviceNumber) :
{ {
memset(&m_origin, 0, sizeof(SOrigin)); memset(&m_origin, 0, sizeof(SOrigin));
m_origin.uCommand = 0x41; // Resetting to origin is a function of the controller itself
m_origin.uOriginStickX = 0x80; // press X+Y+Start for three seconds to trigger a reset
// probably this is meant to read current pad status and use it as
// the origin, but we just use these:
m_origin.uCommand = CMD_ORIGIN;
m_origin.uOriginStickX = 0x80; // center
m_origin.uOriginStickY = 0x80; m_origin.uOriginStickY = 0x80;
m_origin.uSubStickStickX = 0x80; m_origin.uSubStickStickX = 0x80;
m_origin.uSubStickStickY = 0x80; m_origin.uSubStickStickY = 0x80;
m_origin.uTrigger_L = 0x1F; m_origin.uTrigger_L = 0x1F; // 0-30 is the lower deadzone
m_origin.uTrigger_R = 0x1F; m_origin.uTrigger_R = 0x1F;
} }
@ -60,7 +64,7 @@ int CSIDevice_GCController::RunBuffer(u8* _pBuffer, int _iLength)
{ {
case CMD_RESET: case CMD_RESET:
{ {
*(u32*)&_pBuffer[0] = SI_GC_CONTROLLER; // | SI_GC_NOMOTOR; *(u32*)&_pBuffer[0] = SI_GC_CONTROLLER;
iPosition = _iLength; // Break the while loop iPosition = _iLength; // Break the while loop
} }
break; break;
@ -126,7 +130,7 @@ CSIDevice_GCController::GetData(u32& _Hi, u32& _Low)
_Hi = (u32)((u8)PadStatus.stickY); _Hi = (u32)((u8)PadStatus.stickY);
_Hi |= (u32)((u8)PadStatus.stickX << 8); _Hi |= (u32)((u8)PadStatus.stickX << 8);
_Hi |= (u32)((u16)PadStatus.button << 16); // Dunno were/if we should set any of the top 3bits... _Hi |= (u32)((u16)PadStatus.button << 16);
_Hi |= 0x00800000; // F|RES: means that the pad must be "combined" with the origin to math the "final" OSPad-Struct _Hi |= 0x00800000; // F|RES: means that the pad must be "combined" with the origin to math the "final" OSPad-Struct
//_Hi |= 0x20000000; // ? //_Hi |= 0x20000000; // ?

View File

@ -37,14 +37,14 @@ private:
struct SOrigin struct SOrigin
{ {
u8 uCommand; u8 uCommand;// Maybe should be button bits?
u8 unk_1; u8 unk_1; // ..and this would be the other half
u8 uOriginStickX; u8 uOriginStickX;
u8 uOriginStickY; u8 uOriginStickY;
u8 uSubStickStickX; // ??? u8 uSubStickStickX;
u8 uSubStickStickY; // ??? u8 uSubStickStickY;
u8 uTrigger_L; // ??? u8 uTrigger_L;
u8 uTrigger_R; // ??? u8 uTrigger_R;
u8 unk_4; u8 unk_4;
u8 unk_5; u8 unk_5;
u8 unk_6; u8 unk_6;