Luigi's notes about WiFi
(→NSMB wifi code) |
(→NSMB wifi code) |
||
Line 15: | Line 15: | ||
Packet handling or whatever procedure, 0x037F9F88 -> 0x037FA3C0 (ARM7)<br> | Packet handling or whatever procedure, 0x037F9F88 -> 0x037FA3C0 (ARM7)<br> | ||
− | [[Image:Proc1_1.PNG | + | <font face="Lucida Console"> |
− | [[Image:Proc1_2.PNG | + | [[Image:Proc1_1.PNG]]<br> |
− | [[Image:Proc1_3.PNG | + | [[Image:Proc1_2.PNG]]<br> |
− | [[Image:Proc1_4.PNG | + | [[Image:Proc1_3.PNG]]<br> |
− | [[Image:Proc1_5.PNG | + | [[Image:Proc1_4.PNG]]<br> |
− | [[Image:Proc1_6.PNG | + | [[Image:Proc1_5.PNG]]<br> |
− | [[Image:Proc1_7.PNG | + | [[Image:Proc1_6.PNG]]<br> |
− | [[Image:Proc1_8.PNG | + | [[Image:Proc1_7.PNG]]<br> |
− | [[Image:Proc1_9.PNG | + | [[Image:Proc1_8.PNG]]<br> |
− | [[Image:Proc1_10.PNG | + | [[Image:Proc1_9.PNG]]<br> |
− | [[Image:Proc1_11.PNG | + | [[Image:Proc1_10.PNG]]<br> |
− | [[Image:Proc1_12.PNG | + | [[Image:Proc1_11.PNG]]<br> |
− | [[Image:Proc1_13.PNG | + | [[Image:Proc1_12.PNG]]<br> |
− | [[Image:Proc1_14.PNG | + | [[Image:Proc1_13.PNG]]<br> |
− | [[Image:Proc1_15.PNG | + | [[Image:Proc1_14.PNG]]<br> |
− | [[ | + | [[Image:Proc1_15.PNG]]<br> |
− | [[Image:Proc1_17.PNG | + | 037F:A348 E1C800B0 STRH R0, [R8, #0]<br> |
+ | 037F:A34C E1A00807 MOV R0, R7, LSL #10<br> | ||
+ | 037F:A350 E1A00820 MOV R0, R0, LSR #10<br> | ||
+ | 037F:A354 E1C900B4 STRH R0, [R9, #4]<br> | ||
+ | 037F:A358 E1C400B0 STRH R0, [R4, #0]<br> | ||
+ | 037F:A35C EAFFFF20 B 037F9FE4<br> | ||
+ | label_037fa360:<br> | ||
+ | 037F:A360 E3550000 CMP R5, #0<br> | ||
+ | 037F:A364 0A00000A BEQ 037FA394<br> | ||
+ | 037F:A368 E59F0060 LDR R0, [037FA3D0]<br> | ||
+ | 037F:A36C E1D040B0 LDRH R4, [R0, #0]<br> | ||
+ | 037F:A370 EB000192 <b>BL 037FA9C0</b><br> | ||
+ | 037F:A374 E3500000 CMP R0, #0<br> | ||
+ | 037F:A378 0A000005 BEQ 037FA394<br> | ||
+ | 037F:A37C E59F004C LDR R0, [037FA3D0]<br> | ||
+ | 037F:A380 E1D000B0 LDRH R0, [R0, #0]<br> | ||
+ | 037F:A384 E1540000 CMP R4, R0<br> | ||
+ | [[Image:Proc1_17.PNG]]<br> | ||
+ | </font> |
Revision as of 12:33, 17 January 2010
Current Wifi state
Wifi is WIP and highly experimental, keep it in mind
- Ad-hoc: Nintendo multiplayer games fail to connect together. At one point the host sends data frames, the client receives them right but seems to not care about them or throw them out for some reason. Quite possibly a timing problem.
- SoftAP, WFC: doesn't work. Seems to be due to timing issues. Anyway we don't want to have DeSmuME contact Nintendo's servers for now.
- SoftAP, homebrew: wifi lib test successfully connects to SoftAP, DHCP succeeds and all is right. But anything past that fails. It isn't DeSmuME's fault: the DSWifi lib used by the test doesn't implement TCP; and the function that translates an IP string to a number is buggy, hence UDP and DNS failing.
- SoftAP, ndsmail: ndsmail requires DLDI to store its settings on.
NSMB wifi code
NOTE: THIS CODE IS COPYRIGHT NINTENDO!!! DO NOT PUT IT IN YOUR PROJECTS!!!
ARM assembly code, and, if I amn't too lazy, translation to C++ pseudocode
Packet handling or whatever procedure, 0x037F9F88 -> 0x037FA3C0 (ARM7)
037F:A348 E1C800B0 STRH R0, [R8, #0]
037F:A34C E1A00807 MOV R0, R7, LSL #10
037F:A350 E1A00820 MOV R0, R0, LSR #10
037F:A354 E1C900B4 STRH R0, [R9, #4]
037F:A358 E1C400B0 STRH R0, [R4, #0]
037F:A35C EAFFFF20 B 037F9FE4
label_037fa360:
037F:A360 E3550000 CMP R5, #0
037F:A364 0A00000A BEQ 037FA394
037F:A368 E59F0060 LDR R0, [037FA3D0]
037F:A36C E1D040B0 LDRH R4, [R0, #0]
037F:A370 EB000192 BL 037FA9C0
037F:A374 E3500000 CMP R0, #0
037F:A378 0A000005 BEQ 037FA394
037F:A37C E59F004C LDR R0, [037FA3D0]
037F:A380 E1D000B0 LDRH R0, [R0, #0]
037F:A384 E1540000 CMP R4, R0