From 000a5cfe909325dc25f978aaa81e48a2f3df70f7 Mon Sep 17 00:00:00 2001 From: Arne van Iterson Date: Thu, 19 Dec 2019 19:56:26 +0100 Subject: [PATCH] The enemy is moving! --- obj/gfx/baddie.src | 1372 ++++++++++++++++++------------------ obj/gfx/bullet.src | 288 ++++---- obj/gfx/spaceship.src | 1556 ++++++++++++++++++++--------------------- obj/gfx/sprites.src | 14 +- obj/main.src | 980 ++++++++++++++++---------- src/baddie.h | 50 +- src/bullet.h | 76 +- src/controls.h | 72 +- src/gfx/baddie.c | 64 +- src/gfx/baddie.png | Bin 235 -> 408 bytes src/gfx/bullet.c | 32 +- src/gfx/spaceship.c | 64 +- src/gfx/sprites.c | 22 +- src/gfx/sprites.h | 4 +- src/main.c | 140 ++-- src/player.h | 38 +- 16 files changed, 2560 insertions(+), 2212 deletions(-) diff --git a/obj/gfx/baddie.src b/obj/gfx/baddie.src index d9bf151..b700c88 100644 --- a/obj/gfx/baddie.src +++ b/obj/gfx/baddie.src @@ -7,272 +7,78 @@ _baddie_data: DB 32 DB 32 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 DB 1 DB 1 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 DB 1 DB 1 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 DB 1 DB 1 DB 1 @@ -285,26 +91,26 @@ _baddie_data: DB 2 DB 2 DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 DB 1 DB 1 DB 1 @@ -317,86 +123,24 @@ _baddie_data: DB 2 DB 2 DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 DB 1 DB 1 DB 1 DB 1 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 + DB 12 + DB 12 DB 1 DB 1 DB 1 DB 1 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 DB 1 DB 1 DB 2 @@ -415,24 +159,22 @@ _baddie_data: DB 2 DB 2 DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 DB 1 DB 1 DB 2 DB 2 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 DB 2 DB 2 DB 2 @@ -449,138 +191,20 @@ _baddie_data: DB 2 DB 2 DB 2 + DB 1 + DB 1 DB 2 DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 DB 2 DB 2 DB 2 @@ -591,10 +215,188 @@ _baddie_data: DB 6 DB 2 DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 DB 6 DB 6 DB 2 DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 6 + DB 6 + DB 6 + DB 6 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 6 + DB 6 + DB 6 + DB 6 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 6 + DB 6 + DB 6 + DB 6 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 6 + DB 6 + DB 6 + DB 6 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 12 + DB 12 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 DB 6 DB 6 DB 2 @@ -617,14 +419,14 @@ _baddie_data: DB 2 DB 2 DB 2 + DB 10 + DB 10 + DB 1 + DB 1 + DB 1 + DB 1 DB 2 DB 2 - DB 6 - DB 6 - DB 2 - DB 2 - DB 6 - DB 6 DB 2 DB 2 DB 6 @@ -647,20 +449,14 @@ _baddie_data: DB 2 DB 2 DB 2 - DB 8 - DB 8 DB 2 DB 2 - DB 3 - DB 3 - DB 2 - DB 2 - DB 6 - DB 6 - DB 2 - DB 2 - DB 6 - DB 6 + DB 10 + DB 10 + DB 1 + DB 1 + DB 1 + DB 1 DB 2 DB 2 DB 2 @@ -677,22 +473,6 @@ _baddie_data: DB 2 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 3 - DB 3 - DB 2 - DB 2 - DB 6 - DB 6 - DB 2 - DB 2 - DB 6 - DB 6 DB 2 DB 2 DB 2 @@ -703,28 +483,16 @@ _baddie_data: DB 2 DB 2 DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 DB 3 DB 3 - DB 2 - DB 2 - DB 6 - DB 6 + DB 1 + DB 1 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 DB 2 DB 2 DB 2 @@ -741,10 +509,6 @@ _baddie_data: DB 2 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 DB 2 DB 2 DB 2 @@ -753,10 +517,10 @@ _baddie_data: DB 2 DB 3 DB 3 - DB 2 - DB 2 - DB 6 - DB 6 + DB 1 + DB 1 + DB 1 + DB 1 DB 2 DB 2 DB 2 @@ -773,78 +537,72 @@ _baddie_data: DB 2 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 DB 2 DB 2 DB 2 DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 10 + DB 10 DB 3 DB 3 + DB 1 + DB 1 + DB 1 + DB 1 DB 2 DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 10 + DB 10 DB 3 DB 3 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 + DB 1 + DB 1 + DB 1 + DB 1 DB 2 DB 2 DB 2 DB 2 DB 8 DB 8 + DB 2 + DB 2 DB 8 DB 8 - DB 8 - DB 8 + DB 2 + DB 2 DB 8 DB 8 DB 2 DB 2 DB 2 DB 2 - DB 3 - DB 3 - DB 2 - DB 2 - DB 3 - DB 3 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 DB 2 DB 2 DB 2 @@ -853,30 +611,30 @@ _baddie_data: DB 2 DB 3 DB 3 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 + DB 4 + DB 4 + DB 1 + DB 1 + DB 1 + DB 1 DB 2 DB 2 DB 2 DB 2 DB 8 DB 8 + DB 2 + DB 2 DB 8 DB 8 + DB 2 + DB 2 DB 8 DB 8 - DB 8 - DB 8 + DB 2 + DB 2 + DB 2 + DB 2 DB 2 DB 2 DB 2 @@ -885,12 +643,26 @@ _baddie_data: DB 2 DB 3 DB 3 + DB 4 + DB 4 + DB 1 + DB 1 + DB 12 + DB 12 + DB 1 + DB 1 DB 2 DB 2 + DB 9 + DB 9 DB 2 DB 2 + DB 8 + DB 8 DB 2 DB 2 + DB 8 + DB 8 DB 2 DB 2 DB 2 @@ -899,16 +671,28 @@ _baddie_data: DB 2 DB 2 DB 2 + DB 10 + DB 10 + DB 3 + DB 3 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 2 + DB 2 + DB 9 + DB 9 DB 2 DB 2 DB 8 DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 + DB 2 + DB 2 DB 8 DB 8 DB 2 @@ -919,12 +703,26 @@ _baddie_data: DB 2 DB 2 DB 2 + DB 10 + DB 10 + DB 3 + DB 3 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 DB 2 DB 2 DB 2 DB 2 DB 2 DB 2 + DB 9 + DB 9 DB 2 DB 2 DB 8 @@ -933,104 +731,306 @@ _baddie_data: DB 2 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 DB 2 DB 2 + DB 10 + DB 10 + DB 3 + DB 3 + DB 4 + DB 4 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 DB 2 DB 2 DB 2 DB 2 DB 2 DB 2 + DB 9 + DB 9 DB 2 DB 2 + DB 8 + DB 8 DB 2 DB 2 DB 2 DB 2 DB 2 DB 2 - DB 8 - DB 8 + DB 11 + DB 10 + DB 3 + DB 3 + DB 4 + DB 4 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 DB 2 DB 2 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 + DB 9 + DB 9 DB 2 DB 2 + DB 9 + DB 9 DB 2 DB 2 DB 2 DB 2 + DB 3 + DB 3 + DB 3 + DB 3 + DB 4 + DB 4 + DB 4 + DB 4 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 + DB 9 + DB 9 DB 2 DB 2 + DB 9 + DB 9 DB 2 DB 2 DB 2 DB 2 + DB 3 + DB 3 + DB 3 + DB 3 + DB 4 + DB 4 + DB 4 + DB 4 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 DB 2 DB 2 + DB 2 + DB 2 + DB 9 + DB 9 + DB 2 + DB 2 + DB 3 + DB 3 + DB 4 + DB 4 + DB 4 + DB 4 + DB 1 + DB 1 + DB 4 + DB 4 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 9 + DB 9 + DB 2 + DB 2 + DB 3 + DB 3 + DB 4 + DB 4 + DB 4 + DB 4 + DB 1 + DB 1 + DB 4 + DB 4 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 3 + DB 3 + DB 4 + DB 4 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 3 + DB 3 + DB 4 + DB 4 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 XDEF _baddie_data ; 1 // convpng v7.2 ; 2 #include diff --git a/obj/gfx/bullet.src b/obj/gfx/bullet.src index d3b505c..d85fc2d 100644 --- a/obj/gfx/bullet.src +++ b/obj/gfx/bullet.src @@ -7,72 +7,72 @@ _bullet_data: DB 16 DB 16 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 DB 0 DB 0 DB 0 DB 0 DB 0 DB 0 - DB 5 - DB 5 - DB 5 - DB 5 - DB 2 - DB 2 - DB 8 - DB 8 - DB 2 - DB 2 + DB 7 + DB 7 + DB 7 + DB 7 + DB 1 + DB 1 + DB 12 + DB 12 + DB 1 + DB 1 DB 0 DB 0 DB 0 DB 0 DB 0 DB 0 - DB 5 - DB 5 - DB 5 - DB 5 - DB 2 - DB 2 - DB 8 - DB 8 - DB 2 - DB 2 + DB 7 + DB 7 + DB 7 + DB 7 + DB 1 + DB 1 + DB 12 + DB 12 + DB 1 + DB 1 DB 0 DB 0 DB 0 @@ -83,12 +83,12 @@ _bullet_data: DB 0 DB 0 DB 0 - DB 5 - DB 5 - DB 2 - DB 2 - DB 2 - DB 2 + DB 7 + DB 7 + DB 1 + DB 1 + DB 1 + DB 1 DB 0 DB 0 DB 0 @@ -99,12 +99,12 @@ _bullet_data: DB 0 DB 0 DB 0 - DB 5 - DB 5 - DB 2 - DB 2 - DB 2 - DB 2 + DB 7 + DB 7 + DB 1 + DB 1 + DB 1 + DB 1 DB 0 DB 0 DB 0 @@ -117,10 +117,10 @@ _bullet_data: DB 0 DB 0 DB 0 - DB 2 - DB 2 - DB 2 - DB 2 + DB 1 + DB 1 + DB 1 + DB 1 DB 0 DB 0 DB 0 @@ -133,10 +133,10 @@ _bullet_data: DB 0 DB 0 DB 0 - DB 2 - DB 2 - DB 2 - DB 2 + DB 1 + DB 1 + DB 1 + DB 1 DB 0 DB 0 DB 0 @@ -149,10 +149,10 @@ _bullet_data: DB 0 DB 0 DB 0 - DB 2 - DB 2 - DB 2 - DB 2 + DB 1 + DB 1 + DB 1 + DB 1 DB 0 DB 0 DB 0 @@ -165,10 +165,10 @@ _bullet_data: DB 0 DB 0 DB 0 - DB 2 - DB 2 - DB 2 - DB 2 + DB 1 + DB 1 + DB 1 + DB 1 DB 0 DB 0 DB 0 @@ -179,12 +179,12 @@ _bullet_data: DB 0 DB 0 DB 0 - DB 5 - DB 5 - DB 2 - DB 2 - DB 2 - DB 2 + DB 7 + DB 7 + DB 1 + DB 1 + DB 1 + DB 1 DB 0 DB 0 DB 0 @@ -195,74 +195,74 @@ _bullet_data: DB 0 DB 0 DB 0 - DB 5 - DB 5 - DB 2 - DB 2 - DB 2 - DB 2 + DB 7 + DB 7 + DB 1 + DB 1 + DB 1 + DB 1 DB 0 DB 0 DB 0 DB 0 DB 0 DB 0 - DB 5 - DB 5 - DB 5 - DB 5 - DB 2 - DB 2 - DB 8 - DB 8 - DB 2 - DB 2 + DB 7 + DB 7 + DB 7 + DB 7 + DB 1 + DB 1 + DB 12 + DB 12 + DB 1 + DB 1 DB 0 DB 0 DB 0 DB 0 DB 0 DB 0 - DB 5 - DB 5 - DB 5 - DB 5 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 + DB 7 + DB 7 + DB 7 + DB 7 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 XDEF _bullet_data ; 1 // convpng v7.2 ; 2 #include diff --git a/obj/gfx/spaceship.src b/obj/gfx/spaceship.src index 3dd6252..12853b3 100644 --- a/obj/gfx/spaceship.src +++ b/obj/gfx/spaceship.src @@ -7,138 +7,86 @@ _spaceship_data: DB 32 DB 32 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 DB 1 DB 1 - DB 2 - DB 2 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 DB 1 DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 DB 1 DB 1 DB 2 DB 2 DB 1 DB 1 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 1 - DB 1 - DB 2 - DB 2 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 + DB 12 + DB 12 DB 1 DB 1 DB 1 DB 1 DB 2 DB 2 - DB 1 - DB 1 DB 2 DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 1 - DB 1 DB 1 DB 1 DB 2 @@ -147,8 +95,318 @@ _spaceship_data: DB 1 DB 1 DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 DB 1 DB 1 + DB 2 + DB 2 + DB 1 + DB 1 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 2 + DB 2 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 2 + DB 2 + DB 1 + DB 1 + DB 2 + DB 2 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 2 + DB 2 + DB 1 + DB 1 + DB 2 + DB 2 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 2 + DB 2 + DB 1 + DB 1 + DB 3 + DB 3 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 2 + DB 2 + DB 1 + DB 1 + DB 3 + DB 3 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 3 + DB 3 + DB 1 + DB 1 + DB 5 + DB 5 + DB 1 + DB 1 + DB 2 + DB 2 + DB 1 + DB 1 + DB 12 + DB 12 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 3 + DB 3 + DB 1 + DB 1 + DB 5 + DB 5 + DB 1 + DB 1 + DB 2 + DB 2 + DB 1 + DB 1 + DB 12 + DB 12 + DB 1 + DB 1 + DB 3 + DB 3 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 5 + DB 5 + DB 1 + DB 1 + DB 5 + DB 5 + DB 1 + DB 1 + DB 5 + DB 5 + DB 1 + DB 1 + DB 12 + DB 12 + DB 1 + DB 1 + DB 3 + DB 3 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 5 + DB 5 + DB 1 + DB 1 + DB 5 + DB 5 + DB 1 + DB 1 + DB 5 + DB 5 + DB 1 + DB 1 + DB 12 + DB 12 + DB 1 + DB 1 + DB 3 + DB 3 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 DB 1 DB 1 DB 2 @@ -161,26 +419,26 @@ _spaceship_data: DB 1 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 3 + DB 3 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 DB 2 DB 2 - DB 1 - DB 1 - DB 1 - DB 1 DB 2 DB 2 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 DB 1 DB 1 DB 2 @@ -193,98 +451,144 @@ _spaceship_data: DB 1 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 DB 1 DB 1 DB 1 DB 1 DB 1 DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 - DB 1 - DB 1 - DB 2 - DB 2 DB 4 DB 4 + DB 3 + DB 3 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 DB 2 DB 2 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 DB 2 DB 2 DB 1 DB 1 DB 1 DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 - DB 1 - DB 1 - DB 2 - DB 2 DB 4 DB 4 + DB 3 + DB 3 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 DB 2 DB 2 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 DB 2 DB 2 DB 1 DB 1 DB 1 DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 DB 4 DB 4 + DB 3 + DB 3 DB 2 DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 1 + DB 1 + DB 4 + DB 4 + DB 3 + DB 3 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 1 + DB 1 + DB 4 + DB 4 + DB 3 + DB 3 DB 3 DB 3 DB 2 @@ -293,30 +597,30 @@ _spaceship_data: DB 1 DB 2 DB 2 - DB 8 - DB 8 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 DB 2 DB 2 DB 1 DB 1 DB 1 DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 DB 4 DB 4 - DB 2 - DB 2 + DB 3 + DB 3 DB 3 DB 3 DB 2 @@ -325,712 +629,408 @@ _spaceship_data: DB 1 DB 2 DB 2 - DB 8 - DB 8 DB 2 DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 12 + DB 12 + DB 1 + DB 1 DB 4 DB 4 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 - DB 3 - DB 3 - DB 2 - DB 2 - DB 3 - DB 3 - DB 2 - DB 2 - DB 3 - DB 3 - DB 2 - DB 2 - DB 8 - DB 8 - DB 2 - DB 2 - DB 4 - DB 4 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 - DB 3 - DB 3 - DB 2 - DB 2 - DB 3 - DB 3 - DB 2 - DB 2 - DB 3 - DB 3 - DB 2 - DB 2 - DB 8 - DB 8 - DB 2 - DB 2 - DB 4 - DB 4 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 - DB 1 - DB 1 - DB 2 - DB 2 - DB 1 - DB 1 - DB 2 - DB 2 - DB 1 - DB 1 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 4 - DB 4 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 - DB 1 - DB 1 - DB 2 - DB 2 - DB 1 - DB 1 - DB 2 - DB 2 - DB 1 - DB 1 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 7 - DB 7 - DB 4 - DB 4 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 - DB 2 - DB 2 - DB 7 - DB 7 - DB 4 - DB 4 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 - DB 2 - DB 2 - DB 7 - DB 7 - DB 4 - DB 4 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 - DB 2 - DB 2 - DB 7 - DB 7 - DB 4 - DB 4 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 - DB 2 - DB 2 - DB 7 - DB 7 - DB 4 - DB 4 - DB 4 - DB 4 - DB 1 - DB 1 - DB 2 - DB 2 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 - DB 2 - DB 2 - DB 7 - DB 7 - DB 4 - DB 4 - DB 4 - DB 4 - DB 1 - DB 1 - DB 2 - DB 2 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 - DB 8 - DB 8 - DB 2 - DB 2 - DB 7 - DB 7 - DB 4 - DB 4 - DB 2 - DB 2 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 DB 3 DB 3 DB 1 DB 1 - DB 1 - DB 1 - DB 1 - DB 1 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 DB 2 DB 2 - DB 7 - DB 7 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 5 + DB 5 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 DB 4 DB 4 - DB 2 - DB 2 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 DB 3 DB 3 DB 1 DB 1 - DB 1 - DB 1 - DB 1 - DB 1 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 DB 2 DB 2 - DB 7 - DB 7 + DB 2 + DB 2 DB 2 DB 2 DB 1 DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 + DB 5 + DB 5 DB 2 DB 2 - DB 3 - DB 3 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 DB 4 DB 4 DB 1 DB 1 - DB 1 - DB 1 - DB 1 - DB 1 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 DB 2 DB 2 - DB 7 - DB 7 + DB 2 + DB 2 DB 2 DB 2 DB 1 DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 + DB 5 + DB 5 DB 3 DB 3 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 DB 4 DB 4 DB 1 DB 1 - DB 1 - DB 1 - DB 1 - DB 1 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 + DB 2 + DB 2 + DB 2 + DB 2 DB 2 DB 2 DB 1 DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 + DB 5 + DB 5 DB 3 DB 3 - DB 4 - DB 4 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 + DB 2 + DB 2 DB 2 DB 2 DB 1 DB 1 - DB 1 - DB 1 - DB 1 - DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 DB 1 DB 1 DB 2 DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 5 + DB 5 DB 3 DB 3 - DB 4 - DB 4 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 + DB 2 + DB 2 DB 2 DB 2 DB 1 DB 1 - DB 1 - DB 1 - DB 1 - DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 DB 1 DB 1 DB 2 DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 5 + DB 5 DB 3 DB 3 - DB 4 - DB 4 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 + DB 2 + DB 2 DB 2 DB 2 DB 1 DB 1 - DB 1 - DB 1 - DB 1 - DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 DB 1 DB 1 DB 2 DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 5 + DB 5 DB 3 DB 3 - DB 4 - DB 4 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 + DB 2 + DB 2 DB 2 DB 2 DB 1 DB 1 - DB 1 - DB 1 - DB 1 - DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 DB 1 DB 1 DB 2 DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 1 + DB 1 + DB 5 + DB 5 DB 3 DB 3 - DB 4 - DB 4 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 + DB 2 DB 1 DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 DB 1 DB 1 DB 2 DB 2 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 + DB 2 + DB 2 DB 2 DB 2 DB 1 DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 1 - DB 2 - DB 2 + DB 5 + DB 5 DB 3 DB 3 - DB 4 - DB 4 + DB 2 + DB 2 + DB 2 + DB 2 DB 1 DB 1 DB 1 DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 DB 2 DB 2 DB 2 DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 DB 2 DB 2 DB 2 DB 2 + DB 1 + DB 1 + DB 5 + DB 5 + DB 3 + DB 3 DB 2 DB 2 DB 2 DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 2 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 - DB 8 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 1 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 + DB 12 XDEF _spaceship_data ; 1 // convpng v7.2 ; 2 #include diff --git a/obj/gfx/sprites.src b/obj/gfx/sprites.src index d2e10c6..7fb722f 100644 --- a/obj/gfx/sprites.src +++ b/obj/gfx/sprites.src @@ -6,18 +6,22 @@ SEGMENT DATA _sprites_pal: DW 65535 - DW 63421 DW 0 - DW 46509 + DW 63421 DW 23254 - DW 23254 - DW 61307 DW 19026 + DW 46509 + DW 2114 + DW 23254 + DW 4228 + DW 19026 + DW 26425 + DW 60250 DW 0 XDEF _sprites_pal ; 1 // convpng v7.2 ; 2 #include ; 3 #include "sprites.h" ; 4 -; 5 uint16_t sprites_pal[9] = { +; 5 uint16_t sprites_pal[13] = { END diff --git a/obj/main.src b/obj/main.src index 5590532..dcceea7 100644 --- a/obj/main.src +++ b/obj/main.src @@ -3,47 +3,107 @@ ; -localcse -const=ROM FILE "SRC\MAIN.C" .assume ADL=1 - SEGMENT BSS -_key: - DS 1 + SEGMENT TEXT +_bulletAmount: + DW 5 + DB 0 +_baddieAmount: + DW 32 + DB 0 SEGMENT DATA +_spriteActive: + DW 0 + DB 0 _speed: DF 0.5 SEGMENT BSS _i: DS 3 -_bulletSpawned: - DS 3 -_baddieSpawned: - DS 3 - SEGMENT DATA -_gameloop: - DW 0 - DB 0 - SEGMENT BSS _player: DS 16 SEGMENT CODE _updatePlayer: - LD HL,-3 + LD HL,-18 CALL __frameset + LD BC,_player+8 + LD (IX+-12),BC LD BC,_player - LD (IX+-3),BC + LD (IX+-9),BC + LD (IX+-6),BC + LD BC,_player+8 + LD (IX+-15),BC + LD A,(_player+3) + LD E,A + LD A,(_player+11) + LD HL,(_player) + LD BC,(_player+8) + CALL __fsub + CALL __ftol + PUSH BC + CALL _abs + POP BC + LD BC,1 + OR A,A + SBC HL,BC + CALL __setflag + JP P,L_2 + LD BC,(IX+-9) + LD (IX+-6),BC + LD BC,(IX+-12) + LD (IX+-15),BC + LD IY,(IX+-9) + LD HL,(IY+4) + LD E,(IY+7) + LD IY,(IX+-12) + LD BC,(IY+4) + LD A,(IY+7) + CALL __fsub + CALL __ftol + PUSH BC + CALL _abs + POP BC + LD BC,1 + OR A,A + SBC HL,BC + CALL __setflag + JP P,L_2 LD HL,(IX+6) - LD E,(IX+9) + OR A,A + SBC HL,BC + JR NZ,L_3 +L_2: + LD BC,(IX+-6) + LD (IX+-3),BC + LD IY,(IX+-3) + LD BC,(IY+4) + LD A,(IY+7) + CALL __ftol + PUSH BC + LD BC,(IY+0) + LD A,(IY+3) + CALL __ftol + PUSH BC + LD BC,_spaceship_data + PUSH BC + CALL _gfx_Sprite + POP BC + POP BC + POP BC + LD BC,(IX+-15) + LD (IX+-18),BC LD IY,(IX+-3) LD BC,(IY+0) LD A,(IY+3) - CALL __fadd + LD IY,(IX+-18) LD (IY+0),BC LD (IY+3),A - LD HL,(IX+12) - LD E,(IX+15) + LD IY,(IX+-3) LD BC,(IY+4) LD A,(IY+7) - CALL __fadd + LD IY,(IX+-18) LD (IY+4),BC LD (IY+7),A +L_3: LD SP,IX POP IX RET @@ -51,31 +111,35 @@ _updatePlayer: ;**************************** _updatePlayer *************************** ;Name Addr/Register Size Type +;_spaceship_data IMPORT 1026 variable +;_gfx_Sprite IMPORT ----- function +;_abs IMPORT ----- function ;_player STATIC 16 variable -;dy IX+12 4 parameter -;dx IX+6 4 parameter +;G_4 IX-15 3 variable +;G_0 IX-12 3 variable +;G_1 IX-9 3 variable +;G_2 IX-6 3 variable +;G_3 IX-3 3 variable +;bulletsAlive IX+6 3 parameter -; Stack Frame Size: 21 (bytes) +; Stack Frame Size: 27 (bytes) ; Spill Code: 0 (instruction) SEGMENT BSS +_bulletSpawned: + DS 3 _bullets: DS 45 SEGMENT CODE _spawnBullet: LD HL,-6 CALL __frameset - LD BC,1 - LD HL,(_gameloop) - OR A,A - SBC HL,BC - JR NZ,L_8 LD BC,0 LD (_i),BC - JR L_5 -L_3: + JR L_8 +L_6: LD HL,(_i) LD A,9 CALL __imul_b @@ -85,7 +149,7 @@ L_3: LD IY,HL LD A,(IY+0) CP A,1 - JR NZ,L_4 + JR NZ,L_7 LD HL,(IX+-3) ADD HL,BC LD (IX+-6),HL @@ -100,24 +164,21 @@ L_3: LD (IY+8),A LD (IY+0),0 LD HL,1 - JR L_9 -L_4: + JR L_10 +L_7: LD BC,(_i) INC BC LD (_i),BC -L_5: +L_8: LD BC,5 LD HL,(_i) OR A,A SBC HL,BC CALL __setflag - JP M,L_3 - LD HL,1 - JR L_9 -L_8: + JP M,L_6 OR A,A SBC HL,HL -L_9: +L_10: LD SP,IX POP IX RET @@ -127,8 +188,7 @@ L_9: ;Name Addr/Register Size Type ;_bullets STATIC 45 variable ;_i STATIC 3 variable -;_gameloop STATIC 3 variable -;G_0 IX-3 3 variable +;G_5 IX-3 3 variable ;posY IX+12 4 parameter ;posX IX+6 4 parameter @@ -137,14 +197,10 @@ L_9: ; Spill Code: 0 (instruction) -_updateBullets: +_updateBullet: LD HL,-12 CALL __frameset - LD BC,0 - LD (_i),BC - JR L_16 -L_14: - LD HL,(_i) + LD HL,(IX+6) LD A,9 CALL __imul_b LD (IX+-3),HL @@ -154,7 +210,7 @@ L_14: LD IY,(IX+-6) LD A,(IY+0) OR A,A - JR NZ,L_15 + JR NZ,L_14 LD IY,(IX+-6) LD HL,(IY+1) LD E,(IY+4) @@ -192,244 +248,218 @@ L_14: POP BC POP BC POP BC + LD HL,1 JR L_15 L_12: LD IY,(IX+-6) LD (IY+0),1 -L_15: - LD BC,(_i) - INC BC - LD (_i),BC -L_16: - LD BC,45 - LD HL,(_i) + LD HL,1 + JR L_15 +L_14: OR A,A - SBC HL,BC - JR C,L_14 + SBC HL,HL +L_15: LD SP,IX POP IX RET -;**************************** _updateBullets *************************** +;**************************** _updateBullet *************************** ;Name Addr/Register Size Type ;_bullet_data IMPORT 258 variable ;_gfx_Sprite IMPORT ----- function ;_speed STATIC 4 variable ;_bullets STATIC 45 variable -;_i STATIC 3 variable -;G_1 IX-6 3 variable -;G_2 IX-3 3 variable +;G_6 IX-6 3 variable +;G_7 IX-3 3 variable +;i IX+6 3 parameter -; Stack Frame Size: 18 (bytes) +; Stack Frame Size: 21 (bytes) ; Spill Code: 0 (instruction) SEGMENT BSS +_baddieSpawned: + DS 3 _baddies: DS 288 SEGMENT CODE -; 1 // Libraries lol -; 2 #include -; 3 #include -; 4 #include -; 5 #include -; 6 #include -; 7 #include -; 8 #include -; 9 #include -; 10 #include -; 11 #include -; 12 #include -; 13 -; 14 // Graphics -; 15 #include "gfx/sprites.h" -; 16 -; 17 // set global vars -; 18 kb_key_t key; -; 19 float speed = 0.5; -; 20 int i; -; 21 int bulletSpawned; -; 22 int baddieSpawned; -; 23 int gameloop = 0; -; 24 -; 25 // Include entity headers -; 26 #include "player.h" -; 27 #include "bullet.h" -; 28 #include "baddie.h" -; 29 -; 30 void setup() { -_setup: - LD HL,-9 +_spawnBaddie: + LD HL,-6 CALL __frameset -; 31 boot_Set48MHzModeI(); - CALL _boot_Set48MHzModeI -; 32 -; 33 /* Initialize the 8bpp graphics */ -; 34 gfx_Begin(); - CALL _gfx_Begin -; 35 dbg_sprintf(dbgout, "This is the start of a CEmu debugging test\n"); -; 36 dbg_Debugger(); -; 37 -; 38 /* Set up the palette for our sprites */ -; 39 gfx_SetPalette(sprites_pal, sizeof_sprites_pal, 0); - LD BC,0 - PUSH BC - LD BC,18 - PUSH BC - LD BC,_sprites_pal - PUSH BC - CALL _gfx_SetPalette - POP BC - POP BC - POP BC -; 40 -; 41 // Clear screen -; 42 gfx_FillScreen(02); - LD BC,2 - PUSH BC - CALL _gfx_FillScreen - POP BC -; 43 -; 44 // Player starting position -; 45 player.pos.x = 10; - LD BC,_player - LD (IX+-6),BC - LD IY,(IX+-6) - LD BC,2097152 - LD (IY+0),BC - LD A,65 - LD (IY+3),A -; 46 player.pos.y = 136; - LD BC,524288 - LD (IY+4),BC - LD (IY+7),67 -; 47 player.oldPos.x = 10; - LD BC,_player+8 - LD (IX+-3),BC - LD IY,(IX+-3) - LD BC,2097152 - LD (IY+0),BC - LD (IY+3),A -; 48 player.oldPos.y = 10; - LD (IY+4),BC - LD (IY+7),A -; 49 -; 50 // Reset all bullets -; 51 for (i = 0; i < 5; i++) LD BC,0 LD (_i),BC - JR L_23 -L_21: -; 52 { -; 53 bullets[i].dead = true; + JR L_20 +L_18: LD HL,(_i) LD A,9 CALL __imul_b - LD BC,_bullets + LD (IX+-3),HL + LD BC,_baddies ADD HL,BC - LD (IX+-9),HL - LD IY,(IX+-9) - LD (IY+0),1 -; 54 bullets[i].pos.x = 0; - LD BC,0 + LD IY,HL + LD A,(IY+0) + CP A,1 + JR NZ,L_19 + LD HL,(IX+-3) + ADD HL,BC + LD (IX+-6),HL + LD BC,(IX+6) + LD A,(IX+9) + LD IY,(IX+-6) LD (IY+1),BC - LD (IY+4),0 -; 55 bullets[i].pos.y = 0; + LD (IY+4),A + LD BC,(IX+12) + LD A,(IX+15) LD (IY+5),BC - LD (IY+8),0 + LD (IY+8),A + LD (IY+0),0 + LD HL,1 + JR L_22 +L_19: LD BC,(_i) INC BC LD (_i),BC -; 56 } -L_23: - LD BC,5 +L_20: + LD BC,32 LD HL,(_i) OR A,A SBC HL,BC - JP M,L_21 -; 57 } + JP M,L_18 + OR A,A + SBC HL,HL +L_22: LD SP,IX POP IX RET -;**************************** _setup *************************** +;**************************** _spawnBaddie *************************** ;Name Addr/Register Size Type -;_bullets STATIC 45 variable +;_baddies STATIC 288 variable ;_i STATIC 3 variable -;_player STATIC 16 variable -;_gfx_FillScreen IMPORT ----- function -;_sprites_pal IMPORT 18 variable -;_gfx_SetPalette IMPORT ----- function -;_gfx_Begin IMPORT ----- function -;_boot_Set48MHzModeI IMPORT ----- function +;G_9 IX-3 3 variable +;posY IX+12 4 parameter +;posX IX+6 4 parameter -; Stack Frame Size: 15 (bytes) +; Stack Frame Size: 24 (bytes) ; Spill Code: 0 (instruction) -; 58 -; 59 void main(void) { -_main: - LD HL,-39 +_updateBaddie: + LD HL,-12 + CALL __frameset + LD HL,(IX+6) + LD A,9 + CALL __imul_b + LD (IX+-3),HL + LD BC,_baddies + ADD HL,BC + LD (IX+-6),HL + LD IY,(IX+-6) + LD A,(IY+0) + OR A,A + JR NZ,L_26 + LD IY,(IX+-6) + LD BC,(IY+1) + LD A,(IY+4) + OR A,A + SBC HL,HL + LD E,194 + CALL __fcmp + JP P,L_24 + LD BC,_baddies + LD HL,(IX+-3) + ADD HL,BC + LD (IX+-12),HL + LD IY,(IX+-12) + LEA BC,IY+1 + LD (IX+-9),BC + LD HL,(_speed) + LD A,(_speed+3) + LD IY,(IX+-9) + LD BC,(IY+0) + LD E,A + LD A,(IY+3) + CALL __fsub + LD (IY+0),BC + LD (IY+3),A + LD BC,(IY+4) + LD A,(IY+7) + CALL __ftol + PUSH BC + LD BC,(IY+0) + LD A,(IY+3) + CALL __ftol + PUSH BC + LD BC,_baddie_data + PUSH BC + CALL _gfx_Sprite + POP BC + POP BC + POP BC + LD HL,1 + JR L_27 +L_24: + LD IY,(IX+-6) + LD (IY+0),1 + LD HL,1 + JR L_27 +L_26: + OR A,A + SBC HL,HL +L_27: + LD SP,IX + POP IX + RET + + +;**************************** _updateBaddie *************************** +;Name Addr/Register Size Type +;_baddie_data IMPORT 1026 variable +;_gfx_Sprite IMPORT ----- function +;_speed STATIC 4 variable +;_baddies STATIC 288 variable +;G_11 IX-6 3 variable +;G_12 IX-3 3 variable +;i IX+6 3 parameter + + +; Stack Frame Size: 21 (bytes) +; Spill Code: 0 (instruction) + + +_handleInput: + LD HL,-21 CALL __frameset -; 60 setup(); - CALL _setup -; 61 gameloop = 1; - LD BC,1 - LD (_gameloop),BC -; 62 do { -L_45: -; 63 // Scan keyboard for button presses -; 64 kb_Scan(); CALL _kb_Scan -; 65 -; 66 // Move all alive bullets -; 67 updateBullets(); - CALL _updateBullets -; 68 -; 69 // set key to keyboard memory adress row 7 -; 70 key = kb_Data[7]; LD A,(16056350) - LD (_key),A -; 71 -; 72 // Move player -; 73 //// Down -; 74 if (key & kb_Down) { AND A,1 - JR Z,L_29 -; 75 if (!(player.pos.y >= (LCD_HEIGHT - 32))) { + JR Z,L_32 LD BC,_player - LD (IX+-21),BC - LD IY,(IX+-21) + LD (IX+-3),BC + LD IY,(IX+-3) LD HL,(IY+4) LD E,(IY+7) LD BC,5242880 LD A,67 CALL __fcmp - JP P,L_29 -; 76 player.pos.y += speed; + JP P,L_32 LD HL,(_speed) LD A,(_speed+3) - LD IY,(IX+-21) + LD IY,(IX+-3) LD BC,(IY+4) LD E,A LD A,(IY+7) CALL __fadd LD (IY+4),BC LD (IY+7),A -; 77 } -; 78 } -L_29: -; 79 //// Up -; 80 if (key & kb_Up) { - LD A,(_key) +L_32: + LD A,(16056350) AND A,8 - JR Z,L_32 -; 81 if (!(player.pos.y <= 0)) { + JR Z,L_35 LD BC,_player LD (IX+-6),BC LD IY,(IX+-6) @@ -439,8 +469,7 @@ L_29: SBC HL,HL LD E,0 CALL __fcmp - JP P,L_32 -; 82 player.pos.y -= speed; + JP P,L_35 LD HL,(_speed) LD A,(_speed+3) LD IY,(IX+-6) @@ -450,15 +479,10 @@ L_29: CALL __fsub LD (IY+4),BC LD (IY+7),A -; 83 } -; 84 } -L_32: -; 85 //// Left -; 86 if (key & kb_Left) { - LD A,(_key) +L_35: + LD A,(16056350) AND A,2 - JR Z,L_35 -; 87 if (!(player.pos.x <= 0)) { + JR Z,L_38 LD BC,_player LD (IX+-9),BC LD IY,(IX+-9) @@ -468,8 +492,7 @@ L_32: SBC HL,HL LD E,0 CALL __fcmp - JP P,L_35 -; 88 player.pos.x -= speed; + JP P,L_38 LD HL,(_speed) LD A,(_speed+3) LD IY,(IX+-9) @@ -479,15 +502,10 @@ L_32: CALL __fsub LD (IY+0),BC LD (IY+3),A -; 89 } -; 90 } -L_35: -; 91 //// Right -; 92 if (key & kb_Right) { - LD A,(_key) +L_38: + LD A,(16056350) AND A,4 - JR Z,L_38 -; 93 if (!(player.pos.x >= (LCD_WIDTH - 32))) { + JR Z,L_41 LD BC,_player LD (IX+-12),BC LD IY,(IX+-12) @@ -496,8 +514,7 @@ L_35: LD BC,9437184 LD A,67 CALL __fcmp - JP P,L_38 -; 94 player.pos.x += speed; + JP P,L_41 LD HL,(_speed) LD A,(_speed+3) LD IY,(IX+-12) @@ -507,40 +524,32 @@ L_35: CALL __fadd LD (IY+0),BC LD (IY+3),A -; 95 } -; 96 } -L_38: -; 97 -; 98 // Spawn bullet on 2nd press -; 99 if (kb_Data[1] & kb_2nd) { +L_41: LD A,(16056338) AND A,32 - JR Z,L_40 -; 100 // If bullet has already been spawned (You cannot hold the button) -; 101 if (bulletSpawned == 0){ + JR Z,L_43 LD HL,(_bulletSpawned) CALL __icmpzero - JR NZ,L_40 -; 102 spawnBullet((player.pos.x + 16), (player.pos.y + 8)); + JR NZ,L_43 LD BC,_player - LD (IX+-30),BC - LD IY,(IX+-30) + LD (IX+-15),BC + LD IY,(IX+-15) LD BC,(IY+4) LD A,(IY+7) OR A,A SBC HL,HL LD E,65 CALL __fadd - LD (IX+-39),BC ; spill + LD (IX+-21),BC ; spill LD C,A LD HL,8388608 LD E,65 LD B,0 PUSH BC - LD (IX+-36),HL ; spill - LD HL,(IX+-39) ; unspill + LD (IX+-18),HL ; spill + LD HL,(IX+-21) ; unspill PUSH HL - LD HL,(IX+-36) ; unspill + LD HL,(IX+-18) ; unspill LD BC,(IY+0) LD A,(IY+3) CALL __fadd @@ -554,153 +563,365 @@ L_38: POP BC POP BC POP BC -; 103 bulletSpawned = 1; LD BC,1 LD (_bulletSpawned),BC -; 104 } -; 105 } -L_40: -; 106 -; 107 // Set bulletSpawned to false if button is let loose -; 108 if (kb_Data[1] != kb_2nd){ +L_43: LD A,(16056338) CP A,32 - JR Z,L_44 -; 109 bulletSpawned = 0; + JR Z,L_46 LD BC,0 LD (_bulletSpawned),BC -; 110 } -L_44: -; 111 -; 112 // Redraw all sprites if player pos has changed or a bullet has been spawned -; 113 if ( (abs(player.oldPos.x - player.pos.x) >= 1) || (abs(player.oldPos.y - player.pos.y) >= 1) || bulletSpawned == 1) { - LD BC,_player+8 - LD (IX+-18),BC - LD BC,_player - LD (IX+-15),BC - LD (IX+-24),BC - LD BC,(IX+-18) - LD (IX+-27),BC - LD IY,(IX+-15) - LD HL,(IY+0) - LD E,(IY+3) - LD IY,(IX+-18) - LD BC,(IY+0) - LD A,(IY+3) - CALL __fsub - CALL __ftol +L_46: + LD A,(16056338) + AND A,64 + JR Z,L_48 + LD HL,(_baddieSpawned) + CALL __icmpzero + JR NZ,L_48 + CALL _random + LD BC,209 + CALL __iremu + LD BC,HL + XOR A,A + CALL __ultof + LD DE,BC + LD C,A + LD B,0 PUSH BC - CALL _abs + PUSH DE + LD C,67 + PUSH BC + LD BC,11534336 + PUSH BC + CALL _spawnBaddie + POP BC + POP BC + POP BC POP BC LD BC,1 + LD (_baddieSpawned),BC +L_48: + LD A,(16056338) + CP A,64 + JR Z,L_49 + LD BC,0 + LD (_baddieSpawned),BC +; 1 // Libraries lol +; 2 #include +; 3 #include +; 4 #include +; 5 #include +; 6 #include +; 7 #include +; 8 #include +; 9 #include +; 10 #include +; 11 #include +; 12 +; 13 // Graphics +; 14 #include "gfx/sprites.h" +; 15 +; 16 // set global vars +; 17 const int bulletAmount = 5; +; 18 const int baddieAmount = 32; +; 19 int spriteActive = 0; +; 20 float speed = 0.5; +; 21 int i; +; 22 +; 23 // Include entity headers +; 24 #include "player.h" +; 25 #include "bullet.h" +; 26 #include "baddie.h" +; 27 #include "controls.h" +; 28 +; 29 void setup() +; 30 { +; 31 boot_Set48MHzModeI(); +; 32 +; 33 /* Initialize the 8bpp graphics */ +; 34 gfx_Begin(); +; 35 dbg_sprintf(dbgout, "This is the start of a CEmu debugging test\n"); +; 36 dbg_Debugger(); +; 37 +; 38 /* Set up the palette for our sprites */ +; 39 gfx_SetPalette(sprites_pal, sizeof_sprites_pal, 0); +; 40 +; 41 // Clear screen +; 42 gfx_FillScreen(01); +; 43 +; 44 // Player starting position +; 45 player.pos.x = 10; +; 46 player.pos.y = 136; +; 47 player.oldPos.x = 10; +; 48 player.oldPos.y = 10; +; 49 +; 50 // Reset all bullets +; 51 for (i = 0; i < bulletAmount; i++) +; 52 { +; 53 bullets[i].dead = true; +; 54 bullets[i].pos.x = 0; +; 55 bullets[i].pos.y = 0; +; 56 } +; 57 +; 58 // Reset all baddies +; 59 for (i = 0; i < baddieAmount; i++) +; 60 { +; 61 baddies[i].dead = true; +; 62 baddies[i].pos.x = 0; +; 63 baddies[i].pos.y = 0; +; 64 } +; 65 } +; 66 +; 67 void main(void) +; 68 { +; 69 setup(); +; 70 do +; 71 { +; 72 +; 73 // Handle user input +L_49: + LD SP,IX + POP IX + RET + + +;**************************** _handleInput *************************** +;Name Addr/Register Size Type +;_random IMPORT ----- function +;_baddieSpawned STATIC 3 variable +;_bulletSpawned STATIC 3 variable +;_speed STATIC 4 variable +;_player STATIC 16 variable +;_kb_Scan IMPORT ----- function +;G_18 IX-12 3 variable +;G_17 IX-9 3 variable +;G_16 IX-6 3 variable +;G_15 IX-3 3 variable + + +; Stack Frame Size: 27 (bytes) +; Spill Code: 0 (instruction) + + +_setup: + LD HL,-12 + CALL __frameset + CALL _boot_Set48MHzModeI + CALL _gfx_Begin + LD BC,0 + PUSH BC + LD BC,26 + PUSH BC + LD BC,_sprites_pal + PUSH BC + CALL _gfx_SetPalette + POP BC + POP BC + POP BC + LD BC,1 + PUSH BC + CALL _gfx_FillScreen + POP BC + LD BC,_player + LD (IX+-6),BC + LD IY,(IX+-6) + LD BC,2097152 + LD (IY+0),BC + LD A,65 + LD (IY+3),A + LD BC,524288 + LD (IY+4),BC + LD (IY+7),67 + LD BC,_player+8 + LD (IX+-3),BC + LD IY,(IX+-3) + LD BC,2097152 + LD (IY+0),BC + LD (IY+3),A + LD (IY+4),BC + LD (IY+7),A + LD BC,0 + LD (_i),BC + JR L_55 +L_53: + LD HL,(_i) + LD A,9 + CALL __imul_b + LD BC,_bullets + ADD HL,BC + LD (IX+-9),HL + LD IY,(IX+-9) + LD (IY+0),1 + LD BC,0 + LD (IY+1),BC + LD (IY+4),0 + LD (IY+5),BC + LD (IY+8),0 + LD BC,(_i) + INC BC + LD (_i),BC +L_55: + LD BC,5 + LD HL,(_i) OR A,A SBC HL,BC - JP P,L_43 - LD BC,(IX+-15) - LD (IX+-24),BC - LD BC,(IX+-18) - LD (IX+-27),BC - LD IY,(IX+-15) - LD HL,(IY+4) - LD E,(IY+7) - LD IY,(IX+-18) - LD BC,(IY+4) - LD A,(IY+7) - CALL __fsub - CALL __ftol - PUSH BC - CALL _abs - POP BC - LD BC,1 + JP M,L_53 + LD BC,0 + LD (_i),BC + JR L_59 +L_57: + LD HL,(_i) + LD A,9 + CALL __imul_b + LD BC,_baddies + ADD HL,BC + LD (IX+-12),HL + LD IY,(IX+-12) + LD (IY+0),1 + LD BC,0 + LD (IY+1),BC + LD (IY+4),0 + LD (IY+5),BC + LD (IY+8),0 + LD BC,(_i) + INC BC + LD (_i),BC +L_59: + LD BC,32 + LD HL,(_i) OR A,A SBC HL,BC CALL __setflag - JP P,L_43 - LD HL,(_bulletSpawned) - OR A,A - SBC HL,BC - JR NZ,L_46 -L_43: -; 114 gfx_Sprite(spaceship, player.pos.x, player.pos.y); - LD BC,(IX+-24) - LD (IX+-3),BC - LD IY,(IX+-3) - LD BC,(IY+4) - LD A,(IY+7) - CALL __ftol - PUSH BC - LD BC,(IY+0) - LD A,(IY+3) - CALL __ftol - PUSH BC - LD BC,_spaceship_data - PUSH BC - CALL _gfx_Sprite - POP BC - POP BC - POP BC -; 115 player.oldPos.x = player.pos.x; - LD BC,(IX+-27) - LD (IX+-33),BC - LD IY,(IX+-3) - LD BC,(IY+0) - LD A,(IY+3) - LD IY,(IX+-33) - LD (IY+0),BC - LD (IY+3),A -; 116 player.oldPos.y = player.pos.y; - LD IY,(IX+-3) - LD BC,(IY+4) - LD A,(IY+7) - LD IY,(IX+-33) - LD (IY+4),BC - LD (IY+7),A -; 117 } -; 118 } while (kb_Data[6] != kb_Enter); -L_46: - LD A,(16056348) - CP A,1 - JR NZ,L_45 -; 119 -; 120 // Close the graphics -; 121 gfx_End(); - CALL _gfx_End + JP M,L_57 LD SP,IX POP IX RET +;**************************** _setup *************************** +;Name Addr/Register Size Type +;_baddies STATIC 288 variable +;_bullets STATIC 45 variable +;_i STATIC 3 variable +;_player STATIC 16 variable +;_gfx_FillScreen IMPORT ----- function +;_sprites_pal IMPORT 26 variable +;_gfx_SetPalette IMPORT ----- function +;_gfx_Begin IMPORT ----- function +;_boot_Set48MHzModeI IMPORT ----- function + + +; Stack Frame Size: 18 (bytes) +; Spill Code: 0 (instruction) + + +_main: + CALL _setup +L_74: +; 74 handleInput(); + CALL _handleInput +; 75 +; 76 // Move all alive bullets +; 77 for (i = 0; i < bulletAmount; i++) + LD BC,0 + LD (_i),BC + JR L_66 +L_64: +; 78 { +; 79 if (updateBullet(i) == 1) + LD BC,(_i) + PUSH BC + CALL _updateBullet + POP BC + LD BC,1 + OR A,A + SBC HL,BC + JR NZ,L_65 +; 80 { +; 81 spriteActive = 1; + LD (_spriteActive),BC +; 82 } +; 83 } +L_65: + LD BC,(_i) + INC BC + LD (_i),BC +L_66: + LD BC,5 + LD HL,(_i) + OR A,A + SBC HL,BC + CALL __setflag + JP M,L_64 +; 84 +; 85 // Move all alive baddies +; 86 for (i = 0; i < baddieAmount; i++) + LD BC,0 + LD (_i),BC + JR L_71 +L_69: +; 87 { +; 88 if (updateBaddie(i) == 1) + LD BC,(_i) + PUSH BC + CALL _updateBaddie + POP BC + LD BC,1 + OR A,A + SBC HL,BC + JR NZ,L_70 +; 89 { +; 90 spriteActive = 1; + LD (_spriteActive),BC +; 91 } +; 92 +; 93 } +L_70: + LD BC,(_i) + INC BC + LD (_i),BC +L_71: + LD BC,32 + LD HL,(_i) + OR A,A + SBC HL,BC + CALL __setflag + JP M,L_69 +; 94 +; 95 // Redraw player if position has changed or if a bullet has been fired +; 96 updatePlayer(spriteActive); + LD BC,(_spriteActive) + PUSH BC + CALL _updatePlayer + POP BC +; 97 +; 98 } while (kb_Data[6] != kb_Enter); + LD A,(16056348) + CP A,1 + JR NZ,L_74 +; 99 +; 100 // Close the graphics +; 101 gfx_End(); + CALL _gfx_End + RET + + ;**************************** _main *************************** ;Name Addr/Register Size Type ;_gfx_End IMPORT ----- function -;_spaceship_data IMPORT 1026 variable -;_gfx_Sprite IMPORT ----- function -;_abs IMPORT ----- function -;_bulletSpawned STATIC 3 variable -;_speed STATIC 4 variable -;_player STATIC 16 variable -;_key STATIC 1 variable -;_kb_Scan IMPORT ----- function -;_gameloop STATIC 3 variable -;G_12 IX-27 3 variable -;G_10 IX-24 3 variable -;G_4 IX-21 3 variable -;G_8 IX-18 3 variable -;G_9 IX-15 3 variable -;G_7 IX-12 3 variable -;G_6 IX-9 3 variable -;G_5 IX-6 3 variable -;G_11 IX-3 3 variable +;_spriteActive STATIC 3 variable +;_i STATIC 3 variable -; Stack Frame Size: 45 (bytes) +; Stack Frame Size: 6 (bytes) ; Spill Code: 0 (instruction) + XREF _kb_Scan:ROM XREF _sprites_pal:ROM + XREF _baddie_data:ROM XREF _bullet_data:ROM XREF _spaceship_data:ROM - XREF _kb_Scan:ROM XREF _gfx_Sprite:ROM XREF _gfx_FillScreen:ROM XREF _gfx_SetPalette:ROM @@ -708,26 +929,33 @@ L_46: XREF _gfx_Begin:ROM XREF _abs:ROM XREF _boot_Set48MHzModeI:ROM + XREF _random:ROM + XREF __iremu:ROM XREF __fadd:ROM XREF __fsub:ROM XREF __fcmp:ROM XREF __ftol:ROM + XREF __ultof:ROM XREF __frameset:ROM XREF __setflag:ROM XREF __icmpzero:ROM XREF __imul_b:ROM XDEF _main XDEF _setup + XDEF _handleInput + XDEF _updateBaddie + XDEF _spawnBaddie XDEF _baddies - XDEF _updateBullets + XDEF _baddieSpawned + XDEF _updateBullet XDEF _spawnBullet XDEF _bullets + XDEF _bulletSpawned XDEF _updatePlayer XDEF _player - XDEF _gameloop - XDEF _baddieSpawned - XDEF _bulletSpawned XDEF _i XDEF _speed - XDEF _key + XDEF _spriteActive + XDEF _baddieAmount + XDEF _bulletAmount END diff --git a/src/baddie.h b/src/baddie.h index 315f6a5..3203354 100644 --- a/src/baddie.h +++ b/src/baddie.h @@ -1,8 +1,46 @@ // baddie.h +int baddieSpawned; + struct Baddie { - bool dead; - struct pos { - float x; - float y; - } pos; -} baddies[32]; \ No newline at end of file + bool dead; + struct pos { + float x; + float y; + } pos; +} baddies[baddieAmount]; + +int spawnBaddie(float posX, float posY) +{ + for (i = 0; i < baddieAmount; i++) + { + if (baddies[i].dead == true) + { + baddies[i].pos.x = posX; + baddies[i].pos.y = posY; + baddies[i].dead = false; + return 1; + } + } + return 0; +} + +int updateBaddie(int i) +{ + if (baddies[i].dead == false) + { + if (!(baddies[i].pos.x <= (0 - 32))) + { + baddies[i].pos.x -= speed; + gfx_Sprite(baddie, baddies[i].pos.x, baddies[i].pos.y); + return 1; + } + else + { + baddies[i].dead = true; + return 1; + } + } + else { + return 0; + } +} \ No newline at end of file diff --git a/src/bullet.h b/src/bullet.h index 8a3ce7e..b7fd92a 100644 --- a/src/bullet.h +++ b/src/bullet.h @@ -1,41 +1,47 @@ // bullet.h -struct Bullet { - bool dead; - struct pos { - float x; - float y; - } pos; -} bullets[5]; +int bulletSpawned; -// Reset all bullets -for (i = 0; i < sizeof(bullets); i++) +struct Bullet { - bullets[i].dead = true; - bullets[i].pos.x = 0; - bullets[i].pos.y = 0; + bool dead; + struct pos + { + float x; + float y; + } pos; +} bullets[bulletAmount]; + +int spawnBullet(float posX, float posY) +{ + for (i = 0; i < bulletAmount; i++) + { + if (bullets[i].dead == true) + { + bullets[i].pos.x = posX; + bullets[i].pos.y = posY; + bullets[i].dead = false; + return 1; + } + } + return 0; } -int spawnBullet(float posX, float posY) { - for (i = 0; i < sizeof(bullets); i++) { - if (bullets[i].dead == true) { - bullets[i].pos.x = posX; - bullets[i].pos.y = posY; - bullets[i].dead = false; - return 1; - } - } -} - -void updateBullets() { - for (i = 0; i < sizeof(bullets); i++) { - if (bullets[i].dead == false) { - if (!(bullets[i].pos.x >= (LCD_WIDTH + 16))) - { - bullets[i].pos.x += speed; - gfx_Sprite(bullet, bullets[i].pos.x, bullets[i].pos.y); - } else { - bullets[i].dead = true; - } - } - } +int updateBullet(int i) +{ + if (bullets[i].dead == false) + { + if (!(bullets[i].pos.x >= (LCD_WIDTH + 16))) + { + bullets[i].pos.x += speed; + gfx_Sprite(bullet, bullets[i].pos.x, bullets[i].pos.y); + return 1; + } + else + { + bullets[i].dead = true; + return 1; + } + } else { + return 0; + } } \ No newline at end of file diff --git a/src/controls.h b/src/controls.h index ada14f0..4a08ec9 100644 --- a/src/controls.h +++ b/src/controls.h @@ -1,3 +1,73 @@ // controls.h // Scan keyboard for button presses -kb_Scan(); \ No newline at end of file +#include + +void handleInput() +{ + // Scan keyboard for button presses + kb_Scan(); + + // Move player + if (kb_Data[7] & kb_Down) + { + if (!(player.pos.y >= (LCD_HEIGHT - 32))) + { + player.pos.y += speed; + } + } + if (kb_Data[7] & kb_Up) + { + if (!(player.pos.y <= 0)) + { + player.pos.y -= speed; + } + } + if (kb_Data[7] & kb_Left) + { + if (!(player.pos.x <= 0)) + { + player.pos.x -= speed; + } + } + if (kb_Data[7] & kb_Right) + { + if (!(player.pos.x >= (LCD_WIDTH - 32))) + { + player.pos.x += speed; + } + } + + // Spawn bullet on 2nd press + if (kb_Data[1] & kb_2nd) + { + // If bullet has already been spawned (You cannot hold the button) + if (bulletSpawned == 0) + { + spawnBullet((player.pos.x + 16), (player.pos.y + 8)); + bulletSpawned = 1; + } + } + + // Set bulletSpawned to false if button is let loose + if (kb_Data[1] != kb_2nd) + { + bulletSpawned = 0; + } + + // Spawn baddie on 2nd press + if (kb_Data[1] & kb_Mode) + { + // If baddie has already been spawned (You cannot hold the button) + if (baddieSpawned == 0) + { + spawnBaddie((LCD_WIDTH + 32), randInt(0, (LCD_HEIGHT - 32))); + baddieSpawned = 1; + } + } + + // Set baddieSpawned to false if button is let loose + if (kb_Data[1] != kb_Mode) + { + baddieSpawned = 0; + } +} \ No newline at end of file diff --git a/src/gfx/baddie.c b/src/gfx/baddie.c index a44c1a6..5ab35d9 100644 --- a/src/gfx/baddie.c +++ b/src/gfx/baddie.c @@ -5,36 +5,36 @@ // 8 bpp image uint8_t baddie_data[1026] = { 32,32, // width,height - 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02, - 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02, - 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x08,0x08, - 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x08,0x08, - 0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, - 0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, - 0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, - 0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, - 0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, - 0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, - 0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, - 0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, - 0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, - 0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, - 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, - 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, - 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, - 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, - 0x02,0x02,0x02,0x02,0x06,0x06,0x02,0x02,0x06,0x06,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, - 0x02,0x02,0x02,0x02,0x06,0x06,0x02,0x02,0x06,0x06,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, - 0x08,0x08,0x02,0x02,0x03,0x03,0x02,0x02,0x06,0x06,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, - 0x08,0x08,0x02,0x02,0x03,0x03,0x02,0x02,0x06,0x06,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, - 0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, - 0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, - 0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x03,0x03,0x02,0x02,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, - 0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x03,0x03,0x02,0x02,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, - 0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, - 0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, - 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x08,0x08, - 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x08,0x08, - 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02, - 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02, + 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01, + 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01, + 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x0C,0x0C,0x01,0x01,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x0C,0x0C,0x01,0x01,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x06,0x06,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x06,0x06,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x06,0x06,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x06,0x06,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C, + 0x01,0x01,0x02,0x02,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x0A,0x0A,0x01,0x01, + 0x01,0x01,0x02,0x02,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x0A,0x0A,0x01,0x01, + 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x01,0x01, + 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x01,0x01, + 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x0A,0x0A,0x03,0x03,0x01,0x01, + 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x0A,0x0A,0x03,0x03,0x01,0x01, + 0x01,0x01,0x02,0x02,0x02,0x02,0x08,0x08,0x02,0x02,0x08,0x08,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01, + 0x01,0x01,0x02,0x02,0x02,0x02,0x08,0x08,0x02,0x02,0x08,0x08,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01, + 0x0C,0x0C,0x01,0x01,0x02,0x02,0x09,0x09,0x02,0x02,0x08,0x08,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x0A,0x0A,0x03,0x03,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x01,0x01,0x02,0x02,0x09,0x09,0x02,0x02,0x08,0x08,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x0A,0x0A,0x03,0x03,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x09,0x09,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x0A,0x0A,0x03,0x03,0x04,0x04,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x09,0x09,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x0B,0x0A,0x03,0x03,0x04,0x04,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x09,0x09,0x02,0x02,0x09,0x09,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03,0x04,0x04,0x04,0x04,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x09,0x09,0x02,0x02,0x09,0x09,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03,0x04,0x04,0x04,0x04,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x09,0x09,0x02,0x02,0x03,0x03,0x04,0x04,0x04,0x04,0x01,0x01,0x04,0x04,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x09,0x09,0x02,0x02,0x03,0x03,0x04,0x04,0x04,0x04,0x01,0x01,0x04,0x04,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x0C,0x0C,0x01,0x01,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x0C,0x0C,0x01,0x01,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01, + 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01, }; diff --git a/src/gfx/baddie.png b/src/gfx/baddie.png index 4fbd7537c2ed715cb7a05662a56bd884af3ede2d..7ed27c714654a765fbf6d63fcf379f89c19bc02d 100644 GIT binary patch delta 381 zcmV-@0fPSP0hj}jB!2;OQb$4nuFf3k00004XF*Lt006O%3;baP00009a7bBm000id z000id0mpBsWB>pF7<5HgbW?9;ba!ELWdLwtX>N2bZe?^JG%hhNHDpIvQUCw}2}wjj zR9Hvll^tQLw`Exl@%TOe zEYv$v6+#7yZjCxmb2d0vHjw1Egu1MCoo1^#<5${C@$yWi09opaTlOWk|+xOvtz10B11_L*oAe=;^N$ zpl#d4-hK-icXnNus3(B?5cPeZQ2%KF_w?agZ2+A9h>|h&Zcm)6aB%SF0SFfn>K!ptx?Cd$4b(ec b`rC2`hdzr&PywA&00000NkvXXu0mjfZseK= delta 207 zcmV;=05JcU1M2~hB!99=L_t(oh3%KY4S*mFML&iK7@QOHbp%$>lZl{6kqV9Rogfj1CN(XK;k1+xOoO2>Er#oN|YgXn0 z>~VC|fUW(IXWnu5mrQrSpm6sB)y_h%1EZMkz%Sq=fQUdu>`1-1fYDfF9gFvVRBWYh zK?ot)zwL-B2TI**f`B7>JEEP$iM%ER(A5$BlM#24J@T#Tcmpv`HXaZ~p+W!v002ov JPDHLkV1jmdTebiI diff --git a/src/gfx/bullet.c b/src/gfx/bullet.c index 13dbdf9..1dfbf32 100644 --- a/src/gfx/bullet.c +++ b/src/gfx/bullet.c @@ -5,20 +5,20 @@ // 8 bpp image uint8_t bullet_data[258] = { 16,16, // width,height - 0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, - 0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, - 0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,0x05,0x05,0x02,0x02,0x08,0x08, - 0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,0x05,0x05,0x02,0x02,0x08,0x08, - 0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,0x02,0x02, - 0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,0x02,0x02, - 0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02, - 0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02, - 0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02, - 0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02, - 0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,0x02,0x02, - 0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,0x02,0x02, - 0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,0x05,0x05,0x02,0x02,0x08,0x08, - 0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,0x05,0x05,0x02,0x02,0x08,0x08, - 0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, - 0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, + 0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C, + 0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C, + 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x07,0x07,0x01,0x01,0x0C,0x0C, + 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x07,0x07,0x01,0x01,0x0C,0x0C, + 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x01,0x01, + 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x01,0x01, + 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01, + 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01, + 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01, + 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01, + 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x01,0x01, + 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x01,0x01, + 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x07,0x07,0x01,0x01,0x0C,0x0C, + 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x07,0x07,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C, + 0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C, }; diff --git a/src/gfx/spaceship.c b/src/gfx/spaceship.c index a91a446..2cfd095 100644 --- a/src/gfx/spaceship.c +++ b/src/gfx/spaceship.c @@ -5,36 +5,36 @@ // 8 bpp image uint8_t spaceship_data[1026] = { 32,32, // width,height - 0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, - 0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, - 0x02,0x02,0x01,0x01,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, - 0x02,0x02,0x01,0x01,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, - 0x02,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08, - 0x02,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08, - 0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x04,0x04,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, - 0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x04,0x04,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, - 0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x04,0x04,0x02,0x02,0x03,0x03,0x02,0x02,0x01,0x01,0x02,0x02,0x08,0x08, - 0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x04,0x04,0x02,0x02,0x03,0x03,0x02,0x02,0x01,0x01,0x02,0x02,0x08,0x08, - 0x02,0x02,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x02,0x02,0x03,0x03,0x02,0x02,0x03,0x03,0x02,0x02,0x08,0x08, - 0x02,0x02,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x02,0x02,0x03,0x03,0x02,0x02,0x03,0x03,0x02,0x02,0x08,0x08, - 0x02,0x02,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02, - 0x02,0x02,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02, - 0x02,0x02,0x07,0x07,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02, - 0x02,0x02,0x07,0x07,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02, - 0x02,0x02,0x07,0x07,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02, - 0x02,0x02,0x07,0x07,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02, - 0x02,0x02,0x07,0x07,0x04,0x04,0x04,0x04,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02, - 0x02,0x02,0x07,0x07,0x04,0x04,0x04,0x04,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02, - 0x08,0x08,0x02,0x02,0x07,0x07,0x04,0x04,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x08,0x08, - 0x08,0x08,0x02,0x02,0x07,0x07,0x04,0x04,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x08,0x08, - 0x08,0x08,0x02,0x02,0x07,0x07,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x08,0x08, - 0x08,0x08,0x02,0x02,0x07,0x07,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x08,0x08, - 0x08,0x08,0x08,0x08,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x08,0x08,0x08,0x08, - 0x08,0x08,0x08,0x08,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x08,0x08,0x08,0x08, - 0x08,0x08,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08, - 0x08,0x08,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08, - 0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, - 0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, - 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, - 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, + 0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, + 0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, + 0x01,0x01,0x02,0x02,0x01,0x01,0x0C,0x0C,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, + 0x01,0x01,0x02,0x02,0x01,0x01,0x0C,0x0C,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, + 0x01,0x01,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, + 0x01,0x01,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, + 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x03,0x03,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C, + 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x03,0x03,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C, + 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x03,0x03,0x01,0x01,0x05,0x05,0x01,0x01,0x02,0x02,0x01,0x01,0x0C,0x0C, + 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x03,0x03,0x01,0x01,0x05,0x05,0x01,0x01,0x02,0x02,0x01,0x01,0x0C,0x0C, + 0x01,0x01,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x01,0x01,0x05,0x05,0x01,0x01,0x05,0x05,0x01,0x01,0x0C,0x0C, + 0x01,0x01,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x01,0x01,0x05,0x05,0x01,0x01,0x05,0x05,0x01,0x01,0x0C,0x0C, + 0x01,0x01,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01, + 0x01,0x01,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01, + 0x01,0x01,0x04,0x04,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01, + 0x01,0x01,0x04,0x04,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01, + 0x01,0x01,0x04,0x04,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01, + 0x01,0x01,0x04,0x04,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01, + 0x01,0x01,0x04,0x04,0x03,0x03,0x03,0x03,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01, + 0x01,0x01,0x04,0x04,0x03,0x03,0x03,0x03,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01, + 0x0C,0x0C,0x01,0x01,0x04,0x04,0x03,0x03,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x01,0x01,0x04,0x04,0x03,0x03,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x01,0x01,0x04,0x04,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x01,0x01,0x04,0x04,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C, + 0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C,0x0C,0x0C, + 0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C,0x0C,0x0C, + 0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, + 0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, + 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x03,0x03,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, + 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x03,0x03,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, }; diff --git a/src/gfx/sprites.c b/src/gfx/sprites.c index 22ae3b9..a90c521 100644 --- a/src/gfx/sprites.c +++ b/src/gfx/sprites.c @@ -2,14 +2,18 @@ #include #include "sprites.h" -uint16_t sprites_pal[9] = { +uint16_t sprites_pal[13] = { 0xFFFF, // 00 :: rgb(255,255,255) - 0xF7BD, // 01 :: rgb(238,238,238) - 0x0000, // 02 :: rgb(0,0,0) - 0xB5AD, // 03 :: rgb(108,108,108) - 0x5AD6, // 04 :: rgb(178,178,178) - 0x5AD6, // 05 :: rgb(179,179,179) - 0xEF7B, // 06 :: rgb(222,222,222) - 0x4A52, // 07 :: rgb(146,146,146) - 0x0000, // 08 :: rgb(0,0,0) + 0x0000, // 01 :: rgb(0,0,0) + 0xF7BD, // 02 :: rgb(238,238,238) + 0x5AD6, // 03 :: rgb(178,178,178) + 0x4A52, // 04 :: rgb(146,146,146) + 0xB5AD, // 05 :: rgb(108,108,108) + 0x0842, // 06 :: rgb(17,17,17) + 0x5AD6, // 07 :: rgb(179,179,179) + 0x1084, // 08 :: rgb(33,33,33) + 0x4A52, // 09 :: rgb(147,147,147) + 0x6739, // 10 :: rgb(203,203,203) + 0xEB5A, // 11 :: rgb(215,215,215) + 0x0000, // 12 :: rgb(0,0,0) }; diff --git a/src/gfx/sprites.h b/src/gfx/sprites.h index 4c90b0d..130fd79 100644 --- a/src/gfx/sprites.h +++ b/src/gfx/sprites.h @@ -21,7 +21,7 @@ extern uint8_t bullet_data[258]; #define baddie_size 1026 extern uint8_t baddie_data[1026]; #define baddie ((gfx_sprite_t*)baddie_data) -#define sizeof_sprites_pal 18 -extern uint16_t sprites_pal[9]; +#define sizeof_sprites_pal 26 +extern uint16_t sprites_pal[13]; #endif diff --git a/src/main.c b/src/main.c index 7c30589..d3a15d9 100644 --- a/src/main.c +++ b/src/main.c @@ -9,98 +9,94 @@ #include #include #include -#include // Graphics #include "gfx/sprites.h" // set global vars -kb_key_t key; +const int bulletAmount = 5; +const int baddieAmount = 32; +int spriteActive = 0; float speed = 0.5; int i; -int bulletSpawned; -int baddieSpawned; // Include entity headers #include "player.h" #include "bullet.h" #include "baddie.h" +#include "controls.h" -void setup() { - boot_Set48MHzModeI(); +void setup() +{ + boot_Set48MHzModeI(); - /* Initialize the 8bpp graphics */ - gfx_Begin(); - dbg_sprintf(dbgout, "This is the start of a CEmu debugging test\n"); - dbg_Debugger(); + /* Initialize the 8bpp graphics */ + gfx_Begin(); + dbg_sprintf(dbgout, "This is the start of a CEmu debugging test\n"); + dbg_Debugger(); - /* Set up the palette for our sprites */ - gfx_SetPalette(sprites_pal, sizeof_sprites_pal, 0); - - // Clear screen - gfx_FillScreen(02); + /* Set up the palette for our sprites */ + gfx_SetPalette(sprites_pal, sizeof_sprites_pal, 0); + + // Clear screen + gfx_FillScreen(01); + + // Player starting position + player.pos.x = 10; + player.pos.y = 136; + player.oldPos.x = 10; + player.oldPos.y = 10; + + // Reset all bullets + for (i = 0; i < bulletAmount; i++) + { + bullets[i].dead = true; + bullets[i].pos.x = 0; + bullets[i].pos.y = 0; + } + + // Reset all baddies + for (i = 0; i < baddieAmount; i++) + { + baddies[i].dead = true; + baddies[i].pos.x = 0; + baddies[i].pos.y = 0; + } } -void main(void) { - setup(); - do { - // Scan keyboard for button presses - kb_Scan(); +void main(void) +{ + setup(); + do + { - // Move all alive bullets - updateBullets(); + // Handle user input + handleInput(); - // set key to keyboard memory adress row 7 - key = kb_Data[7]; + // Move all alive bullets + for (i = 0; i < bulletAmount; i++) + { + if (updateBullet(i) == 1) + { + spriteActive = 1; + } + } - // Move player - //// Down - if (key & kb_Down) { - if (!(player.pos.y >= (LCD_HEIGHT - 32))) { - player.pos.y += speed; - } - } - //// Up - if (key & kb_Up) { - if (!(player.pos.y <= 0)) { - player.pos.y -= speed; - } - } - //// Left - if (key & kb_Left) { - if (!(player.pos.x <= 0)) { - player.pos.x -= speed; - } - } - //// Right - if (key & kb_Right) { - if (!(player.pos.x >= (LCD_WIDTH - 32))) { - player.pos.x += speed; - } - } + // Move all alive baddies + for (i = 0; i < baddieAmount; i++) + { + if (updateBaddie(i) == 1) + { + spriteActive = 1; + } - // Spawn bullet on 2nd press - if (kb_Data[1] & kb_2nd) { - // If bullet has already been spawned (You cannot hold the button) - if (bulletSpawned == 0){ - spawnBullet((player.pos.x + 16), (player.pos.y + 8)); - bulletSpawned = 1; - } - } - - // Set bulletSpawned to false if button is let loose - if (kb_Data[1] != kb_2nd){ - bulletSpawned = 0; - } - - // Redraw all sprites if player pos has changed or a bullet has been spawned - if ( (abs(player.oldPos.x - player.pos.x) >= 1) || (abs(player.oldPos.y - player.pos.y) >= 1) || bulletSpawned == 1) { - gfx_Sprite(spaceship, player.pos.x, player.pos.y); - player.oldPos.x = player.pos.x; - player.oldPos.y = player.pos.y; - } - } while (kb_Data[6] != kb_Enter); + } - // Close the graphics - gfx_End(); + // Redraw player if position has changed or if a bullet has been fired + updatePlayer(spriteActive); + + } while (kb_Data[6] != kb_Enter); + + // Close the graphics + gfx_End(); } \ No newline at end of file diff --git a/src/player.h b/src/player.h index fdc4f21..44f7dff 100644 --- a/src/player.h +++ b/src/player.h @@ -1,22 +1,24 @@ // player.h -struct Player { - struct pos { - float x; - float y; - } pos; - struct oldPos { - float x; - float y; - } oldPos; +struct Player +{ + struct pos + { + float x; + float y; + } pos; + struct oldPos + { + float x; + float y; + } oldPos; } player; -// Player starting position -player.pos.x = 10; -player.pos.y = 136; -player.oldPos.x = 10; -player.oldPos.y = 10; - -void updatePlayer(float dx, float dy) { - player.pos.x = player.pos.x + dx; - player.pos.y = player.pos.y + dy; +void updatePlayer(int bulletsAlive) +{ + if ((abs(player.oldPos.x - player.pos.x) >= 1) || (abs(player.oldPos.y - player.pos.y) >= 1) || bulletsAlive == 1) + { + gfx_Sprite(spaceship, player.pos.x, player.pos.y); + player.oldPos.x = player.pos.x; + player.oldPos.y = player.pos.y; + } } \ No newline at end of file