Browse code

Moved some variables to defines

neauoire authored on 05/08/2021 03:30:57
Showing 2 changed files
... ...
@@ -14,7 +14,6 @@ typedef unsigned int Uint32;
14 14
 typedef signed int Sint32;
15 15
 
16 16
 #define SAMPLE_FREQUENCY 44100
17
-#define POLYPHONY 4
18 17
 
19 18
 typedef struct {
20 19
 	Uint8 *addr;
... ...
@@ -21,6 +21,10 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
21 21
 WITH REGARD TO THIS SOFTWARE.
22 22
 */
23 23
 
24
+#define PAD 4
25
+#define POLYPHONY 4
26
+#define BENCH 0
27
+
24 28
 static SDL_AudioDeviceID audio_id;
25 29
 static SDL_Window *gWindow;
26 30
 static SDL_Surface *winSurface, *idxSurface, *rgbaSurface;
... ...
@@ -30,9 +34,7 @@ static Apu apu[POLYPHONY];
30 34
 static Device *devsystem, *devscreen, *devmouse, *devctrl, *devaudio0, *devconsole;
31 35
 static Uint32 stdin_event;
32 36
 
33
-#define PAD 4
34
-
35
-static Uint8 zoom = 1, reqdraw = 0, bench = 0;
37
+static Uint8 zoom = 1, reqdraw = 0;
36 38
 
37 39
 static Uint8 font[][8] = {
38 40
 	{0x00, 0x7c, 0x82, 0x82, 0x82, 0x82, 0x82, 0x7c},
... ...
@@ -434,7 +436,7 @@ run(Uxn *u)
434 436
 	while(1) {
435 437
 		SDL_Event event;
436 438
 		double elapsed, start = 0;
437
-		if(!bench)
439
+		if(!BENCH)
438 440
 			start = SDL_GetPerformanceCounter();
439 441
 		while(SDL_PollEvent(&event) != 0) {
440 442
 			switch(event.type) {
... ...
@@ -473,7 +475,7 @@ run(Uxn *u)
473 475
 		uxn_eval(u, mempeek16(devscreen->dat, 0));
474 476
 		if(reqdraw || devsystem->dat[0xe])
475 477
 			redraw(u);
476
-		if(!bench) {
478
+		if(!BENCH) {
477 479
 			elapsed = (SDL_GetPerformanceCounter() - start) / (double)SDL_GetPerformanceFrequency() * 1000.0f;
478 480
 			SDL_Delay(clamp(16.666f - elapsed, 0, 1000));
479 481
 		}