summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-04-18 15:50:39 +0200
committerBad Diode <bd@badd10de.dev>2021-04-18 15:50:39 +0200
commit36706012b126bacc7c208108d9c328a810321bab (patch)
treee2f9629f7f11cd696b2160f1034f023d8d6b6789
parent627f8611c87b2d911f369a86d7a28457dbbb6839 (diff)
downloadgba-experiments-36706012b126bacc7c208108d9c328a810321bab.tar.gz
gba-experiments-36706012b126bacc7c208108d9c328a810321bab.zip
Try sprites with bitmap modes (MODE_3)
-rw-r--r--src/main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 0cbc544..7dd8dcd 100644
--- a/src/main.c
+++ b/src/main.c
@@ -425,10 +425,10 @@ draw_logo() {
425int main(void) { 425int main(void) {
426 // Configure the display in mode 0 to show OBJs, where tile memory is 426 // Configure the display in mode 0 to show OBJs, where tile memory is
427 // sequential. 427 // sequential.
428 DISP_CTRL = DISP_MODE_0 | DISP_OBJ | DISP_OBJ_1D; 428 DISP_CTRL = DISP_MODE_3 | DISP_OBJ | DISP_OBJ_1D | DISP_BG_2;
429 429
430 // Create two 4bpp tiles, one filled with color 1 and another with color 2. 430 // Create two 4bpp tiles, one filled with color 1 and another with color 2.
431 Tile *tile_mem = &TILE_MEM[4][0]; 431 Tile *tile_mem = &TILE_MEM[4][512];
432 size_t n_tiles = 8; 432 size_t n_tiles = 8;
433 u32 colors[] = { 433 u32 colors[] = {
434 0x11111111, 434 0x11111111,
@@ -459,10 +459,10 @@ int main(void) {
459 459
460 int x_a = 100; 460 int x_a = 100;
461 int y_a = 100; 461 int y_a = 100;
462 int tile_id_a = 0; 462 int tile_id_a = 512;
463 int x_b = 50; 463 int x_b = 50;
464 int y_b = 50; 464 int y_b = 50;
465 int tile_id_b = 1; 465 int tile_id_b = 513;
466 466
467 // Initialize all attributes by disabling rendering. If we don't do this, 467 // Initialize all attributes by disabling rendering. If we don't do this,
468 // glitches may appear. 468 // glitches may appear.
@@ -478,6 +478,8 @@ int main(void) {
478 OBJ_ATTR_1(1) = x_b; 478 OBJ_ATTR_1(1) = x_b;
479 OBJ_ATTR_2(1) = tile_id_b; 479 OBJ_ATTR_2(1) = tile_id_b;
480 480
481 draw_logo();
482
481 int frame_counter = 0; 483 int frame_counter = 0;
482 int active_sprite = 0; 484 int active_sprite = 0;
483 while(true) { 485 while(true) {