diff options
Diffstat (limited to 'project/text-files/kcl.inc/kcl-flag-template-cr.inc')
| -rw-r--r-- | project/text-files/kcl.inc/kcl-flag-template-cr.inc | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/project/text-files/kcl.inc/kcl-flag-template-cr.inc b/project/text-files/kcl.inc/kcl-flag-template-cr.inc new file mode 100644 index 0000000..8394619 --- /dev/null +++ b/project/text-files/kcl.inc/kcl-flag-template-cr.inc @@ -0,0 +1,48 @@ + +############################################################################## +##### All behind a '#' on the same line is a comment and ignored. ##### +##### See https://szs.wiimm.de/doc/kcl/flagfile for more details. ##### +############################################################################## +# function f() + +# First, we define a flag function named f(). +# This allows us to define type and variant as 2 values. + +@function f # (type,variant) + @return $1 & 0x1f | $2 << 5 +@endfunction + +############################################################################## +# function a() + +# Here we define function a() to support the flag variant type A. +# For details see http://wiimm.de/r/ctw/KCL_flag + +@function a # (type,w,x,y,z) + @return $1 & 0x1f # type (5 bits) + > | ( $2 & 7 ) << 13 # W (3 bits) + > | ( $3 & 3 ) << 11 # X (2 bits) + > | ( $4 & 7 ) << 8 # Y (3 bits) + > | ( $5 & 7 ) << 5 # Z (3 bits) +@endfunction + +############################################################################## +# function i() + +# The function i() supports fall boundaries. + +@function i # (type,z,index) + @return $1 & 0x1f # type (5 bits) + > | ( $2 & 7 ) << 5 # Z (3 bits) + > | ( $3 & 0xff ) << 8 # index (8 bits) +@endfunction + +############################################################################## +# table + +#----------------------------------------------------------------------------- +# group_name = flag_or_expression +# = f(type,variant) +# = a(type,w,x,y,z) +# = i(type,z,index) +#----------------------------------------------------------------------------- |
