summaryrefslogtreecommitdiff
path: root/include/command_macros_base.h
diff options
context:
space:
mode:
authorKenix3 <kenixwhisperwind@gmail.com>2021-04-29 18:56:18 -0400
committerGitHub <noreply@github.com>2021-04-29 18:56:18 -0400
commitc40bb119e1f64972e6a0879110826c455a28437b (patch)
treefb1a29a657a985bcd707004a31d43086310d9d95 /include/command_macros_base.h
parente97f10a6fa573e8b817ed03a4674d52b1818dafa (diff)
Adds in scene support (#117)
* 1 scene done, Z2_SOUGEN OK * All scenes OK * Makefile improvements * Use WIP ZAPD branch as submodule * Add spawn rotation flag macro * Fix bad merge * Move scenes to be in their own subfolders * Rename and restructure extracted baserom files * Progress tracking for assets * Add asset progress to csv * Use master ZAPD * Use distclean like in OOT * Fix up a few things with the makefile * Fix scenes not being dumped from ELF Co-authored-by: Rozelette <Uberpanzermensch@gmail.com>
Diffstat (limited to 'include/command_macros_base.h')
-rw-r--r--include/command_macros_base.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/command_macros_base.h b/include/command_macros_base.h
new file mode 100644
index 000000000..8d0a3917a
--- /dev/null
+++ b/include/command_macros_base.h
@@ -0,0 +1,19 @@
+#ifndef _COMMAND_MACROS_BASE_H_
+#define _COMMAND_MACROS_BASE_H_
+
+/**
+ * Command Base macros intended for use in designing of more specific command macros
+ * Each macro packs bytes (B), halfowrds (H) and words (W, for consistency) into a single word
+ */
+
+#define CMD_BBBB(a, b, c, d) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 8, 8) | _SHIFTL(d, 0, 8))
+
+#define CMD_BBH(a, b, c) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 0, 16))
+
+#define CMD_HBB(a, b, c) (_SHIFTL(a, 16, 16) | _SHIFTL(b, 8, 8) | _SHIFTL(c, 0, 8))
+
+#define CMD_HH(a, b) (_SHIFTL(a, 16, 16) | _SHIFTL(b, 0, 16))
+
+#define CMD_W(a) (a)
+
+#endif