From ab4bcdf12d0d17a208d5ac377ad168f64e582a82 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Mon, 20 Nov 2023 00:20:48 +0100 Subject: [PATCH] emudbg no longer clobbers r1 --- compiler/res/prog8lib/cx16/emudbg.p8 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/res/prog8lib/cx16/emudbg.p8 b/compiler/res/prog8lib/cx16/emudbg.p8 index c8b55e625..71d15f8d1 100644 --- a/compiler/res/prog8lib/cx16/emudbg.p8 +++ b/compiler/res/prog8lib/cx16/emudbg.p8 @@ -31,10 +31,13 @@ emudbg { sub console_write(str isoString) { ; note: make sure the text is in Iso encoding. if is_emulator() { - cx16.r1 = isoString - while @(cx16.r1) { - EMU_CPUCLK_U = @(cx16.r1) - cx16.r1++ + ubyte chr + repeat { + chr = @(isoString) + if_z + break + EMU_CPUCLK_U = chr + isoString++ } } }