added 3dsx support

This adds 3dsx support
Please try to find better names for your loop variables. In this case, I think `u32 patch = 0` would be more appropriate? Same thing for the other for loops in this function.