summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSimponic <loganthebean222@gmail.com>2020-08-07 22:40:00 -0600
committerSimponic <loganthebean222@gmail.com>2020-08-07 22:40:00 -0600
commit6a44a34e0ebb867753df26f1cb0a38f53420a606 (patch)
tree42eef181966046e4e3108b149738e70479e48c35 /source
downloadgeometry-dash-gba-6a44a34e0ebb867753df26f1cb0a38f53420a606.tar.gz
geometry-dash-gba-6a44a34e0ebb867753df26f1cb0a38f53420a606.zip
Added files
Diffstat (limited to 'source')
-rw-r--r--source/main.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/source/main.c b/source/main.c
new file mode 100644
index 0000000..a36688d
--- /dev/null
+++ b/source/main.c
@@ -0,0 +1,46 @@
+#include <string.h>
+#include "../include/input.h"
+#include "../include/toolbox.h"
+#include "../include/memmap.h"
+#include "../include/types.h"
+#include "../include/memdef.h"
+#include "../sprites/player.h"
+
+OBJ_ATTR obj_buffer[128];
+OBJ_AFFINE *obj_aff_buffer= (OBJ_AFFINE*)obj_buffer; // Object affine-buffer
+
+void obj_test() {
+ int x= 96, y= 32;
+ u32 tid= 0, pb= 0;
+ OBJ_ATTR *player = &obj_buffer[0];
+
+ obj_set_attr(player,
+ ATTR0_SQUARE,
+ ATTR1_SIZE_16,
+ ATTR2_PALBANK(pb) | tid
+ );
+
+ obj_set_pos(player, x, y);
+
+ while(1) {
+ vid_vsync();
+ key_poll();
+
+ oam_copy(oam_mem, obj_buffer, 1);
+ }
+}
+
+int main() {
+ memcpy(&tile_mem[4][0], playerTiles, playerTilesLen);
+ memcpy(pal_obj_mem, playerPal, playerPalLen);
+
+ oam_init(obj_buffer, 128);
+
+ REG_DISPCNT= DCNT_OBJ | DCNT_OBJ_1D;
+
+ obj_test();
+
+ while(1);
+
+ return 0;
+}