From 8fa84de28e99626df57e157809e7c17dce18c415 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Wed, 22 Dec 2021 22:59:36 +0100 Subject: [PATCH] fix c128 clearscreen and bdmusic sound issue --- compiler/res/prog8lib/c128/syslib.p8 | 7 ++++--- compiler/res/prog8lib/cx16/syslib.p8 | 2 +- examples/bdmusic.p8 | 18 +++++------------- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/compiler/res/prog8lib/c128/syslib.p8 b/compiler/res/prog8lib/c128/syslib.p8 index b5f59f2a8..b149ae8a1 100644 --- a/compiler/res/prog8lib/c128/syslib.p8 +++ b/compiler/res/prog8lib/c128/syslib.p8 @@ -177,9 +177,10 @@ c64 { ; ---- kernal routines, these are the same as on the Commodore-64 (hence the same block name) ---- -; STROUT -> use txt.print -romsub $C07B = CLEARSCR() clobbers(A,X,Y) ; clear the screen -romsub $C150 = HOMECRSR() clobbers(A,X,Y) ; cursor to top left of screen +; STROUT --> use txt.print +; CLEARSCR -> use txt.clear_screen +; HOMECRSR -> use txt.home or txt.plot + romsub $FA65 = IRQDFRT() clobbers(A,X,Y) ; default IRQ routine romsub $FF33 = IRQDFEND() clobbers(A,X,Y) ; default IRQ end/cleanup diff --git a/compiler/res/prog8lib/cx16/syslib.p8 b/compiler/res/prog8lib/cx16/syslib.p8 index 2a04ac5cb..cb10c0553 100644 --- a/compiler/res/prog8lib/cx16/syslib.p8 +++ b/compiler/res/prog8lib/cx16/syslib.p8 @@ -11,7 +11,7 @@ c64 { ; STROUT --> use txt.print ; CLEARSCR -> use txt.clear_screen -; HOMECRSR -> use txt.plot +; HOMECRSR -> use txt.home or txt.plot romsub $FF81 = CINT() clobbers(A,X,Y) ; (alias: SCINIT) initialize screen editor and video chip romsub $FF84 = IOINIT() clobbers(A, X) ; initialize I/O devices (CIA, SID, IRQ) diff --git a/examples/bdmusic.p8 b/examples/bdmusic.p8 index b96bb83c7..cef220be6 100644 --- a/examples/bdmusic.p8 +++ b/examples/bdmusic.p8 @@ -15,7 +15,7 @@ sub start() { txt.print("will play the music from boulderdash,\nmade in 1984 by peter liepa.\npress enter to start: ") void c64.CHRIN() - c64.CLEARSCR() + txt.clear_screen() repeat { uword note @@ -32,27 +32,19 @@ sub start() { c64.CR2 = waveform <<4 | 1 print_notes(note1, note2) - delay() - } - } -} - -sub delay() { - repeat 8 { - ubyte jiffy = c64.TIME_LO - while c64.TIME_LO==jiffy { + sys.wait(8) } } } sub print_notes(ubyte n1, ubyte n2) { - c64.CHROUT('\n') + txt.nl() txt.plot(n1/2, 24) txt.color(7) - c64.CHROUT('Q') + txt.chrout('Q') txt.plot(n2/2, 24) txt.color(4) - c64.CHROUT('Q') + txt.chrout('Q') }