uxn

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

commit 28cfb143ca8a20a77a8f245a24ccd4bf7bc1cb70
parent bca5562eeca8a9e2f34ddb11cc082c5a6215e118
Author: neauoire <aliceffekt@gmail.com>
Date:   Sat, 18 Sep 2021 16:51:50 -0700

Merge branch 'main' of git.sr.ht:~rabbits/uxn

Diffstat:
Msrc/uxnemu.c | 5+----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -187,7 +187,6 @@ quit(void) static int init(void) { - int i; SDL_AudioSpec as; SDL_zero(as); as.freq = SAMPLE_FREQUENCY; @@ -217,10 +216,8 @@ init(void) gTexture = SDL_CreateTexture(gRenderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STATIC, ppu.width + PAD * 2, ppu.height + PAD * 2); if(gTexture == NULL || SDL_SetTextureBlendMode(gTexture, SDL_BLENDMODE_NONE)) return error("sdl_texture", SDL_GetError()); - if(!(ppu_screen = malloc(ppu.width * ppu.height * sizeof(Uint32)))) + if(!(ppu_screen = calloc(1, ppu.width * ppu.height * sizeof(Uint32)))) return 0; - for(i = ppu.width + ppu.height + PAD * 4 - 1; i >= 0; --i) - ppu_screen[i] = 0; SDL_UpdateTexture(gTexture, NULL, ppu_screen, sizeof(Uint32)); SDL_StartTextInput(); SDL_ShowCursor(SDL_DISABLE);