#23785 - Daniel Andersen - Wed Jul 21, 2004 3:28 pm
I am struggling to get some simple multiplayer code to work, but it seems only to work in no$gba, not on real hardware. On the real thing, it detects who are slave and master, though.
It seams that after initializing a send, the SIOCNT is always signalizing busy, no matter how long both master and slave waits.
Here is some code:
Actually, in my code it loops until indata of master is not equal to 0xFFFF. Master sends #0.
Hope someone can figure it out! :)
_________________
In a world without fences and walls you will never need gates and windows.
It seams that after initializing a send, the SIOCNT is always signalizing busy, no matter how long both master and slave waits.
Here is some code:
Code: |
;; Setup multiplayer mode
; Address link MOV R0, #0x04000000 ADD R0, R0, #0x120 ; Initialize RCNT MOV R1, #0 STRH R1, [R0, #0x14] ; Initialize SIOCNT MOV R1, #0x2000 ; ORR R1, R1, #0x3 STRH R1, [R0, #0x8] ; Wait for all players to enter multiplayer mode ; <snap - works fine> ; Just keep looping Loop ;; Wait for inactivity SpaceDust_SendPacket_Wait1 ; Get activity LDRH R1, [R0, #0x8] ANDS R10, R1, #0x80 BNE SpaceDust_SendPacket_Wait1 ;; Start transfer ; Write outgoing data to SIODATA_SEND LDR R1, [R12, -4] STRH R1, [R0, #0xA] ; Get status LDRH R1, [R0, #0x8] ; Check master ANDS R10, R1, #0x4 BNE SpaceDust_SendPacket_Wait2 ; Set start bit ORR R1, R1, #0x80 STRH R1, [R0, #0x8] ;; Wait for transfer to start SpaceDust_SendPacket_Wait2 ; Get activity LDRH R1, [R0, #0x8] ANDS R1, R1, #0x80 BEQ SpaceDust_SendPacket_Wait2 ;; Wait for transfer to finish SpaceDust_SendPacket_Wait3 ; Get activity LDRH R1, [R0, #0x8] ANDS R1, R1, #0x80 BNE SpaceDust_SendPacket_Wait3 B Loop |
Actually, in my code it loops until indata of master is not equal to 0xFFFF. Master sends #0.
Hope someone can figure it out! :)
_________________
In a world without fences and walls you will never need gates and windows.