@@ -73,29 +73,32 @@ void setup()
7373 // Needed for native USB port only
7474 // while(!Serial) {}
7575
76+ uint32_t tend, tstart;
77+ TSTART ();
78+
79+ // Try to randomize seed
80+ randomSeed ((analogRead (A5) << 16 ) + analogRead (A4));
81+ Serial.print (" Random: 0x" ); Serial.println (random (INT_MAX), HEX);
82+
7683 // Start TFT and fill black
7784 if (!arcada.arcadaBegin ()) {
7885 Serial.print (" Failed to begin" );
7986 while (1 );
8087 }
8188 arcada.displayBegin ();
8289 arcada.setBacklight (128 );
83-
84- arcada. display -> setCursor ( 0 , 0 );
85- arcada. display -> fillScreen (ARCADA_BLACK);
86- arcada.display ->setTextColor (ARCADA_WHITE);
87- arcada.display ->setTextSize ( 1 );
90+
91+ TFINISH ( " Arcada init " );
92+
93+ arcada.display ->fillScreen (ARCADA_WHITE);
94+ arcada.display ->setTextColor (ARCADA_BLACK );
8895 arcada.display ->setTextWrap (true );
89- arcada.display ->println (" Wasm3 v" M3_VERSION " (" M3_ARCH " )" );
90- arcada.display ->println (" build " __DATE__ " " __TIME__);
91- arcada.display ->println (" \n Dino game" );
92- arcada.display ->println (" by Ben Smith (binji)" );
93-
94- // Try to randomize seed
95- randomSeed ((analogRead (A5) << 16 ) + analogRead (A4));
96- Serial.print (" Random: " ); Serial.println (random (INT_MAX), HEX);
96+ arcada.display ->setCursor (0 , 5 );
97+ arcada.display ->println (" Wasm3 v" M3_VERSION " (" M3_ARCH " )" );
98+ arcada.display ->println ();
99+ arcada.display ->println (" Dino game" );
100+ arcada.display ->println (" by Ben Smith (binji)" );
97101
98- uint32_t tend, tstart;
99102 TSTART ();
100103
101104 M3Result result = m3Err_none;
@@ -116,11 +119,15 @@ void setup()
116119 result = LinkImports (runtime);
117120 if (result) FATAL (" LinkImports" , result);
118121
122+ TFINISH (" Wasm3 init+parse" );
123+
124+ TSTART ();
125+
119126 IM3Function f;
120127 result = m3_FindFunction (&f, runtime, " run" );
121128 if (result) FATAL (" FindFunction" , result);
122129
123- TFINISH (" Init " );
130+ TFINISH (" Compile run() " );
124131
125132 Serial.println (" Running WebAssembly..." );
126133
@@ -147,7 +154,7 @@ void setup()
147154 // Render frame
148155 result = m3_CallWithArgs (f, 0 , i_argv);
149156 if (result) break ;
150- arcada.display ->drawRGBBitmap (0 , 50 , (uint16_t *)(mem+0x5000 ), 160 , 75 );
157+ arcada.display ->drawRGBBitmap (0 , 40 , (uint16_t *)(mem+0x5000 ), 160 , 75 );
151158
152159 // Serial.print("FPS: "); Serial.println(1000/(millis() - framestart));
153160
0 commit comments