From 08fb3e7f0aa2741c2e0a777ceda25ff266f690fa Mon Sep 17 00:00:00 2001 From: neauoire Date: Sat, 2 Oct 2021 12:06:50 -0700 Subject: [PATCH] Close uxnemu on System/halt --- projects/examples/demos/piano.tal | 3 +++ src/uxnemu.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/examples/demos/piano.tal b/projects/examples/demos/piano.tal index a052eb7..e12e257 100644 --- a/projects/examples/demos/piano.tal +++ b/projects/examples/demos/piano.tal @@ -6,6 +6,8 @@ %<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 } %!~ { NEQk NIP } +%HALT { #01 #0f DEO } + %RTN { JMP2r } %TOS { #00 SWP } %MOD { DUP2 / * - } @@ -130,6 +132,7 @@ BRK #3b .octave LDZ #0c * + ;play JSR2 &no-b [ LIT 'k ] !~ ,&no-c2 JCN #3c .octave LDZ #0c * + ;play JSR2 &no-c2 + [ #1b ] !~ ,&no-esc JCN HALT &no-esc POP ( release ) diff --git a/src/uxnemu.c b/src/uxnemu.c index 950d334..552001b 100644 --- a/src/uxnemu.c +++ b/src/uxnemu.c @@ -497,7 +497,7 @@ run(Uxn *u) { uxn_eval(u, PAGE_PROGRAM); redraw(u); - while(1) { + while(!devsystem->dat[0xf]) { SDL_Event event; double elapsed, start = 0; if(!BENCH)