#include "util.h"
#include "debug.h"
+#ifdef BUILD_GBA
extern char __iheap_start;
+#else
+#define IWRAM_POOL_SZ 32768
+#define __iheap_start iwram[0]
+static char iwram[IWRAM_POOL_SZ];
+#endif
static char *top = &__iheap_start;
int iwram_brk(void *addr)
memcpy(res, s, len + 1);
return res;
}
+
+#ifndef BUILD_GBA
+/* utility functions which are implemented in assembly on GBA builds */
+
+void fillblock_16byte(void *dest, uint32_t val, int count)
+{
+ int i;
+ uint32_t *p = dest;
+
+ for(i=0; i<count; i++) {
+ p[0] = val;
+ p[1] = val;
+ p[2] = val;
+ p[3] = val;
+ p += 4;
+ }
+}
+
+void *get_pc(void)
+{
+ return 0; /* not useful on PC builds */
+}
+
+void *get_sp(void)
+{
+ return (void*)-1; /* not useful on PC builds */
+}
+#endif