summaryrefslogtreecommitdiff
path: root/include/gba/macro.h
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2016-01-08 12:49:23 -0800
committerYamaArashi <shadow962@live.com>2016-01-08 12:49:23 -0800
commitbc10815b94083bde9a4fa034a647e294ce2022cc (patch)
treea3cbf873d5bf1c720402c45a7f718fb744230da1 /include/gba/macro.h
parentb06f500539b64acb7db2bc7daa439be4a2cad2f2 (diff)
reorganize headers and add CpuFill macros
Diffstat (limited to 'include/gba/macro.h')
-rw-r--r--include/gba/macro.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/gba/macro.h b/include/gba/macro.h
new file mode 100644
index 000000000..5578f90ba
--- /dev/null
+++ b/include/gba/macro.h
@@ -0,0 +1,15 @@
+#ifndef GUARD_GBA_MACRO_H
+#define GUARD_GBA_MACRO_H
+
+#define CPU_FILL(dest, value, size, bit) \
+do { \
+ vu##bit tmp = (vu##bit)(value); \
+ CpuSet((void *)&tmp, \
+ dest, \
+ CPU_SET_##bit##BIT | CPU_SET_SRC_FIXED | ((size)/(bit/8) & 0x1FFFFF)); \
+} while (0)
+
+#define CpuFill16(dest, value, size) CPU_FILL(dest, value, size, 16)
+#define CpuFill32(dest, value, size) CPU_FILL(dest, value, size, 32)
+
+#endif // GUARD_GBA_MACRO_H