Ported AdamN's Wireless Adapter code from 1030e.
Known Issue : * Instability with 3-4 players on pokemon games due to another client interfering a client and host communication, causing both clients to think their data never reached the host and repeatedly resending the data again (a few retries before dropping the connection) TODO : * Host may need to send the ACK data to the Client who send the data instead of broadcasting to all clients, to prevent other Clients from getting the wrong ACK data and thinking their data never reached the Host. git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@1240 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
parent
c9d56fd063
commit
027d8f76ed
1347
src/gba/GBALink.cpp
1347
src/gba/GBALink.cpp
File diff suppressed because it is too large
Load Diff
|
@ -138,22 +138,23 @@ extern void CleanLocalLink();
|
|||
extern const char *MakeInstanceFilename(const char *Input);
|
||||
|
||||
// register definitions
|
||||
#define COMM_SIODATA32_L 0x120
|
||||
#define COMM_SIODATA32_H 0x122
|
||||
#define COMM_SIODATA32_L 0x120 // Lower 16bit on Normal mode
|
||||
#define COMM_SIODATA32_H 0x122 // Higher 16bit on Normal mode
|
||||
#define COMM_SIOCNT 0x128
|
||||
#define COMM_SIODATA8 0x12a
|
||||
#define COMM_SIOMLT_SEND 0x12a
|
||||
#define COMM_SIOMULTI0 0x120
|
||||
#define COMM_SIOMULTI1 0x122
|
||||
#define COMM_SIOMULTI2 0x124
|
||||
#define COMM_SIOMULTI3 0x126
|
||||
#define COMM_RCNT 0x134
|
||||
#define COMM_SIODATA8 0x12a // 8bit on Normal/UART mode, (up to 4x8bit with FIFO)
|
||||
#define COMM_SIOMLT_SEND 0x12a // SIOMLT_SEND (16bit R/W) on MultiPlayer mode (local outgoing)
|
||||
#define COMM_SIOMULTI0 0x120 // SIOMULTI0 (16bit) on MultiPlayer mode (Parent/Master)
|
||||
#define COMM_SIOMULTI1 0x122 // SIOMULTI1 (16bit) on MultiPlayer mode (Child1/Slave1)
|
||||
#define COMM_SIOMULTI2 0x124 // SIOMULTI2 (16bit) on MultiPlayer mode (Child2/Slave2)
|
||||
#define COMM_SIOMULTI3 0x126 // SIOMULTI3 (16bit) on MultiPlayer mode (Child3/Slave3)
|
||||
#define COMM_RCNT 0x134 // SIO Mode (4bit data) on GeneralPurpose mode
|
||||
#define COMM_IR 0x136 // Infrared Register (16bit) 1bit data at a time(LED On/Off)?
|
||||
#define COMM_JOYCNT 0x140
|
||||
#define COMM_JOY_RECV_L 0x150
|
||||
#define COMM_JOY_RECV_L 0x150 // Send/Receive 8bit Lower first then 8bit Higher
|
||||
#define COMM_JOY_RECV_H 0x152
|
||||
#define COMM_JOY_TRANS_L 0x154
|
||||
#define COMM_JOY_TRANS_L 0x154 // Send/Receive 8bit Lower first then 8bit Higher
|
||||
#define COMM_JOY_TRANS_H 0x156
|
||||
#define COMM_JOYSTAT 0x158
|
||||
#define COMM_JOYSTAT 0x158 // Send/Receive 8bit lower only
|
||||
|
||||
#define JOYSTAT_RECV 2
|
||||
#define JOYSTAT_SEND 8
|
||||
|
@ -163,4 +164,33 @@ extern const char *MakeInstanceFilename(const char *Input);
|
|||
#define JOYCNT_SEND_COMPLETE 4
|
||||
#define JOYCNT_INT_ENABLE 0x40
|
||||
|
||||
#define LINK_PARENTLOST 0x80
|
||||
|
||||
#define UNSUPPORTED -1
|
||||
#define MULTIPLAYER 0
|
||||
#define NORMAL8 1
|
||||
#define NORMAL32 2 // wireless use normal32 also
|
||||
#define UART 3
|
||||
#define JOYBUS 4
|
||||
#define GP 5
|
||||
#define INFRARED 6 // Infrared Register at 4000136h
|
||||
|
||||
#define RFU_INIT 0
|
||||
#define RFU_COMM 1
|
||||
#define RFU_SEND 2
|
||||
#define RFU_RECV 3
|
||||
|
||||
#define RF_RECVCMD 0x278 // Unknown, Seems to be related to Wireless Adapter(RF_RCNT or armMode/CPSR or CMD sent by the adapter when RF_SIOCNT=0x83 or when RCNT=0x80aX?)
|
||||
#define RF_CNT 0x27a // Unknown, Seems to be related to Wireless Adapter(RF_SIOCNT?)
|
||||
|
||||
typedef struct {
|
||||
u8 len; //data len in 32bit words
|
||||
u8 idx; //client idx
|
||||
u8 gbaid; //source id
|
||||
u8 qid; //target ids
|
||||
u32 sign; //signal
|
||||
u32 time; //linktime
|
||||
u32 data[255];
|
||||
} rfu_datarec;
|
||||
|
||||
#endif /* GBA_GBALINK_H */
|
||||
|
|
Loading…
Reference in New Issue