Editing Template:Ps2configrev
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 69: | Line 69: | ||
== hex2dec conversion way around 16 bits == | == hex2dec conversion way around 16 bits == | ||
This trick would allow to pass the value in hex format to this template | This trick would allow to pass the value in hex format to this template | ||
* | * #expr: W*16^3 + X*16^2 + Y*16^1 + Z*16^0 | ||
*Example 0x5555 | |||
*Example 0x5555 (21845 dec) | |||
** <nowiki>{{#expr: 5*16^3 + 5*16^2 + 5*16^1 + 5*16^0}}</nowiki> = {{#expr: 5*16^3 + 5*16^2 + 5*16^1 + 5*16^0}} | |||
** 5*16^3 + 5*16^2 + 5*16^1 + 5*16^0 | ** 5*16^3 + 5*16^2 + 5*16^1 + 5*16^0 | ||
** 5*4096 + 5*256 + 5*16 + 5*1 | ** 5*4096 + 5*256 + 5*16 + 5*1 | ||
Line 76: | Line 78: | ||
** 21845 | ** 21845 | ||
For this to work it would be needed also to split the original hex value in digits ( | *For this to work it would be needed also to split the original hex value in digits (half a byte). And pass the digits individually to another template containing a "switch" statement that should return 16 posible values in decimal (if 0=0, 1=1, 2=2, 3=3, 4=4, 5=5, 6=6, 7=7, 8=8, 9=9, A=10, B=11, C=12, D=13, E=14, F=15) | ||
[[Category:Games]]</noinclude> | [[Category:Games]]</noinclude> |