summaryrefslogtreecommitdiff
path: root/macros.asm
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2015-07-28 13:42:15 -0700
committeryenatch <yenatch@gmail.com>2015-07-28 13:46:00 -0700
commit87f4f4eb44f16cdf23a8cb7a67efd69ad4a34d75 (patch)
tree48cf98fb20efe51c4891ca1dbe08a40c6e9f7842 /macros.asm
parent35e724e03e3d34630ec872a2f12e04196b73d59b (diff)
fix tmlearn
Diffstat (limited to 'macros.asm')
-rw-r--r--macros.asm65
1 files changed, 8 insertions, 57 deletions
diff --git a/macros.asm b/macros.asm
index 307121ff..20a82007 100644
--- a/macros.asm
+++ b/macros.asm
@@ -635,61 +635,12 @@ EAST_MAP_CONNECTION: MACRO
ENDM
tmlearn: MACRO
-if 0 == \1
-tm1 = 0
-tm1_ = 0
-else
-tm1 = %111 & (\1 - 1)
-tm1_ = 1
+x = 0
+ rept _NARG
+if \1 != 0
+x = x | (1 << ((\1 - 1) % 8))
endc
-if 2 <= _NARG
-tm2 = %111 & (\2 - 1)
-tm2_ = 1
-else
-tm2 = 0
-tm2_ = 0
-endc
-if 3 <= _NARG
-tm3 = %111 & (\3 - 1)
-tm3_ = 1
-else
-tm3 = 0
-tm3_ = 0
-endc
-if 4 <= _NARG
-tm4 = %111 & (\4 - 1)
-tm4_ = 1
-else
-tm4 = 0
-tm4_ = 0
-endc
-if 5 <= _NARG
-tm5 = %111 & (\5 - 1)
-tm5_ = 1
-else
-tm5 = 0
-tm5_ = 0
-endc
-if 6 <= _NARG
-tm6 = %111 & (\6 - 1)
-tm6_ = 1
-else
-tm6 = 0
-tm6_ = 0
-endc
-if 7 <= _NARG
-tm7 = %111 & (\7 - 1)
-tm7_ = 1
-else
-tm7 = 0
-tm7_ = 0
-endc
-if 8 <= _NARG
-tm8 = %111 & (\8 - 1)
-tm8_ = 1
-else
-tm8 = 0
-tm8_ = 0
-endc
-db tm8_ << tm8 | tm7_ << tm7 | tm6_ << tm6 | tm5_ << tm5 | tm4_ << tm4 | tm3_ << tm3 | tm2_ << tm2 | tm1_ << tm1
-ENDM \ No newline at end of file
+ shift
+ endr
+ db x
+ENDM