uxn

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

commit cba316cf3ab694a128e9f321cd68ff7fefbec200
parent 734f0a3fbbfd1174473bc46d38f70eacd9c73a20
Author: neauoire <aliceffekt@gmail.com>
Date:   Fri, 17 Sep 2021 11:25:31 -0700

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

Diffstat:
Mmkfile | 4++--
Msrc/devices/ppu.c | 4++--
Msrc/devices/ppu.h | 2+-
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/mkfile b/mkfile @@ -1,9 +1,9 @@ </$objtype/mkfile TARG=bin/uxncli bin/uxnasm bin/uxnemu -USM=`{walk -f projects/ | grep '\.tal$' | grep -v blank.tal} +USM=`{walk -f projects/ | grep '\.tal$' | grep -v blank.tal | grep -v /library/} ROM=${USM:%.tal=%.rom} -CFLAGS=$CFLAGS -D__plan9__ -DNO_PORTMIDI -I/sys/include/npe -I/sys/include/npe/SDL2 +CFLAGS=$CFLAGS -D__plan9__ -I/sys/include/npe -I/sys/include/npe/SDL2 HFILES=\ /sys/include/npe/stdio.h\ src/devices/apu.h\ diff --git a/src/devices/ppu.c b/src/devices/ppu.c @@ -76,7 +76,7 @@ ppu_init(Ppu *p, Uint8 hor, Uint8 ver) { p->width = 8 * hor; p->height = 8 * ver; - p->bg = malloc(p->width / 4 * p->height * sizeof(Uint8)); - p->fg = malloc(p->width / 4 * p->height * sizeof(Uint8)); + p->bg = calloc(1, p->width / 4 * p->height * sizeof(Uint8)); + p->fg = calloc(1, p->width / 4 * p->height * sizeof(Uint8)); return 1; } diff --git a/src/devices/ppu.h b/src/devices/ppu.h @@ -19,7 +19,7 @@ typedef unsigned int Uint32; typedef struct Ppu { Uint16 width, height; - Uint8 *pixels, *bg, *fg; + Uint8 *bg, *fg; } Ppu; int ppu_init(Ppu *p, Uint8 hor, Uint8 ver);