skippable logo splash
authorJohn Tsiombikas <nuclear@member.fsf.org>
Fri, 28 Oct 2022 19:15:51 +0000 (22:15 +0300)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Fri, 28 Oct 2022 19:15:51 +0000 (22:15 +0300)
src/gamescr.c
src/logoscr.c

index fa74c94..b148d22 100644 (file)
@@ -268,8 +268,17 @@ static int update(void)
                        pos[1] += fwd[1];
                }
                if(keystate & BN_B) {
-                       pos[0] -= fwd[0];
-                       pos[1] -= fwd[1];
+                       for(i=0; i<num_enemies; i++) {
+                               if(enemies[i].hp && enemies[i].vobj.px >= 0) {
+                                       int dx = enemies[i].vobj.px - 120;
+                                       int dy = enemies[i].vobj.py - 80;
+                                       if(abs(dx) < 10 && abs(dy) < 10) {
+                                               emuprint("pow");
+                                               enemies[i].hp--;
+                                               break;
+                                       }
+                               }
+                       }
                }
                if(keystate & BN_UP) {
                        if(horizon > 40) horizon -= ELEV_SPEED;
index 3b822e0..7269743 100644 (file)
@@ -7,6 +7,7 @@
 #include "xgl.h"
 #include "polyfill.h"
 #include "timer.h"
+#include "input.h"
 #include "data.h"
 #include "meshdata.h"
 #include "debug.h"
@@ -95,12 +96,20 @@ static void logoscr_stop(void)
 
 static int32_t tm, tgoat, tname, tout;
 
+#define end_screen()   change_screen(find_screen("menu")); return
+
 static void logoscr_frame(void)
 {
        int i;
        struct xvertex *vptr;
        int32_t x, y;
 
+       update_keyb();
+
+       if(KEYPRESS(BN_START)) {
+               end_screen();
+       }
+
        tgoat = 0x10000 - tm;
        if(tgoat < 0) tgoat = 0;
 
@@ -109,8 +118,7 @@ static void logoscr_frame(void)
 
                if(tout > X_HPI + 0x1800) {
                        tout = X_HPI + 0x1800;
-                       change_screen(find_screen("menu"));
-                       return;
+                       end_screen();
                }
        }
 
@@ -144,15 +152,6 @@ static void logoscr_frame(void)
 
        wait_vblank();
        present(backbuf);
-
-       if(!(nframes & 15)) {
-               emuprint("vbl: %d", vblperf_count);
-       }
-#ifdef VBLBAR
-       vblperf_begin();
-#else
-       vblperf_count = 0;
-#endif
 }
 
 ARM_IWRAM