You can change the order as well:
out = (input & $0000FF00 ) shr 08
out = (input & $00FF0000 ) shr 16
ect...
This is the same method that im using for storing oppcodes in my emulator, and its realy fast. But then I can compare it to using entire ints.
Also as another speedup, avoid function calls. I have only two function calls and 3 masking operations for most instructions.
Also try and use the select statement, not successive Ifs because the compiler can them optimise more.
out = (input & $0000FF00 ) shr 08
out = (input & $00FF0000 ) shr 16
ect...
This is the same method that im using for storing oppcodes in my emulator, and its realy fast. But then I can compare it to using entire ints.
Also as another speedup, avoid function calls. I have only two function calls and 3 masking operations for most instructions.
Also try and use the select statement, not successive Ifs because the compiler can them optimise more.