uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 352ae83858dfb9aa6514f3603463fe71e48da77e
parent 44d584dfdbe3da53dbb65a8bc3e3a1f3788c3a1a
Author: neauoire <aliceffekt@gmail.com>
Date:   Wed,  4 Aug 2021 20:30:57 -0700

Moved some variables to defines

Diffstat:
Msrc/devices/apu.h | 1-
Msrc/uxnemu.c | 12+++++++-----
2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/devices/apu.h b/src/devices/apu.h @@ -14,7 +14,6 @@ typedef unsigned int Uint32; typedef signed int Sint32; #define SAMPLE_FREQUENCY 44100 -#define POLYPHONY 4 typedef struct { Uint8 *addr; diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -21,6 +21,10 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE. */ +#define PAD 4 +#define POLYPHONY 4 +#define BENCH 0 + static SDL_AudioDeviceID audio_id; static SDL_Window *gWindow; static SDL_Surface *winSurface, *idxSurface, *rgbaSurface; @@ -30,9 +34,7 @@ static Apu apu[POLYPHONY]; static Device *devsystem, *devscreen, *devmouse, *devctrl, *devaudio0, *devconsole; static Uint32 stdin_event; -#define PAD 4 - -static Uint8 zoom = 1, reqdraw = 0, bench = 0; +static Uint8 zoom = 1, reqdraw = 0; static Uint8 font[][8] = { {0x00, 0x7c, 0x82, 0x82, 0x82, 0x82, 0x82, 0x7c}, @@ -434,7 +436,7 @@ run(Uxn *u) while(1) { SDL_Event event; double elapsed, start = 0; - if(!bench) + if(!BENCH) start = SDL_GetPerformanceCounter(); while(SDL_PollEvent(&event) != 0) { switch(event.type) { @@ -473,7 +475,7 @@ run(Uxn *u) uxn_eval(u, mempeek16(devscreen->dat, 0)); if(reqdraw || devsystem->dat[0xe]) redraw(u); - if(!bench) { + if(!BENCH) { elapsed = (SDL_GetPerformanceCounter() - start) / (double)SDL_GetPerformanceFrequency() * 1000.0f; SDL_Delay(clamp(16.666f - elapsed, 0, 1000)); }