sdrawkcab
05-23-2012, 06:47 PM
32bit button value dma controller address and code
lui t0 $xxxx //first 16 bits controller pointer (real)
lw t1 $xxxx(t0) //second 16 bits controller pointer
lw t1 $xxxx(t1) //controller offset
lui t2 $xxxx //first half button value
ori t2 t2 $xxxx //second half button value
lui t3 $xxxx //first 16 bits codes pointer (real)
lw t3 $xxxx(t3) //second 16 bits codes pointer
bne t1 t2 $xxxxxxxx //jr ra
nop
lui t4 $xxxx //first 16 bits codes value
ori t4 t4 $xxxx // second 16 bits codes value
sw t4 $xxxx(t3) //codes offset
jr ra
nop
lui t0 $xxxx //first 16 bits controller pointer (real)
lw t1 $xxxx(t0) //second 16 bits controller pointer
lw t1 $xxxx(t1) //controller offset
lui t2 $xxxx //first half button value
ori t2 t2 $xxxx //second half button value
lui t3 $xxxx //first 16 bits codes pointer (real)
lw t3 $xxxx(t3) //second 16 bits codes pointer
bne t1 t2 $xxxxxxxx //jr ra
nop
lui t4 $xxxx //first 16 bits codes value
ori t4 t4 $xxxx // second 16 bits codes value
sw t4 $xxxx(t3) //codes offset
jr ra
nop