From 9cbb8e1a643a966847897cbff22cd826be41ae66 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Tue, 18 Aug 2020 16:26:23 +0200 Subject: [PATCH] version 3.1 --- compiler/res/version.txt | 2 +- examples/bdmusic.p8 | 5 +- examples/mfbench/romsum-p8.p8 | 74 ----------------------------- examples/mfbench/sieve-p8.p8 | 88 ----------------------------------- 4 files changed, 4 insertions(+), 165 deletions(-) delete mode 100644 examples/mfbench/romsum-p8.p8 delete mode 100644 examples/mfbench/sieve-p8.p8 diff --git a/compiler/res/version.txt b/compiler/res/version.txt index 6625b85d1..8c50098d8 100644 --- a/compiler/res/version.txt +++ b/compiler/res/version.txt @@ -1 +1 @@ -3.1-SNAPSHOT +3.1 diff --git a/examples/bdmusic.p8 b/examples/bdmusic.p8 index cc688ca86..f72e35c36 100644 --- a/examples/bdmusic.p8 +++ b/examples/bdmusic.p8 @@ -37,8 +37,9 @@ sub start() { } sub delay() { - repeat 32 { - while c64.RASTER { + repeat 8 { + ubyte jiffy = c64.TIME_LO + while c64.TIME_LO==jiffy { } } } diff --git a/examples/mfbench/romsum-p8.p8 b/examples/mfbench/romsum-p8.p8 deleted file mode 100644 index 05c4567ad..000000000 --- a/examples/mfbench/romsum-p8.p8 +++ /dev/null @@ -1,74 +0,0 @@ -%import c64utils - -main { - - const uword rom = $e000 - - sub sumrom() -> uword { - uword p = rom - uword s = 0 - ubyte i - repeat $20 { - for i in 0 to $ff { - s += @(p+i) - } - p += $100 - } - return s - } - - sub start() { - benchcommon.begin() - ubyte i - for i in 0 to 5 { - c64scr.print_uw(sumrom()) - c64.CHROUT('\n') - } - benchcommon.end() - } -} - - -benchcommon { - ubyte last_time0 = 0 - ubyte last_time1 = 0 - ubyte last_time2 = 0 - ubyte time_start0 = 0 - ubyte time_start1 = 0 - ubyte time_start2 = 0 - - - asmsub read_time () clobbers(A,X,Y) { - %asm {{ - jsr $FFDE - sta last_time0 - stx last_time1 - sty last_time2 - rts - }} - } - - sub begin() { - benchcommon.read_time() - benchcommon.time_start0 = benchcommon.last_time0 - benchcommon.time_start1 = benchcommon.last_time1 - benchcommon.time_start2 = benchcommon.last_time2 - } - - sub end() { - benchcommon.read_time() - - c64scr.print_ubhex(benchcommon.time_start2, false) - c64scr.print_ubhex(benchcommon.time_start1, false) - c64scr.print_ubhex(benchcommon.time_start0, false) - c64.CHROUT('\n') - - c64scr.print_ubhex(benchcommon.last_time2, false) - c64scr.print_ubhex(benchcommon.last_time1, false) - c64scr.print_ubhex(benchcommon.last_time0, false) - c64.CHROUT('\n') - - void c64scr.input_chars($c000) - } -} - diff --git a/examples/mfbench/sieve-p8.p8 b/examples/mfbench/sieve-p8.p8 deleted file mode 100644 index ba937654b..000000000 --- a/examples/mfbench/sieve-p8.p8 +++ /dev/null @@ -1,88 +0,0 @@ -%import c64utils - -main { - - const uword COUNT = 16384 - const uword SQRT_COUNT = 128 - const uword Sieve = $4000 - - sub sieve_round() { - uword S - ubyte I = 2 - memset(Sieve, COUNT, 0) - while I < SQRT_COUNT { - if @(Sieve + I) == 0 { - S = Sieve + (I << 1) - while S < Sieve + COUNT { - @(S) = 1 - S += I - } - } - I ++ - } - } - - sub start() { - benchcommon.begin() - - sieve_round() - sieve_round() - sieve_round() - sieve_round() - sieve_round() - - sieve_round() - sieve_round() - sieve_round() - sieve_round() - sieve_round() - - benchcommon.end() - } -} - - - -benchcommon { - ubyte last_time0 = 0 - ubyte last_time1 = 0 - ubyte last_time2 = 0 - ubyte time_start0 = 0 - ubyte time_start1 = 0 - ubyte time_start2 = 0 - - - asmsub read_time () clobbers(A,X,Y) { - %asm {{ - jsr $FFDE - sta last_time0 - stx last_time1 - sty last_time2 - rts - }} - } - - sub begin() { - benchcommon.read_time() - benchcommon.time_start0 = benchcommon.last_time0 - benchcommon.time_start1 = benchcommon.last_time1 - benchcommon.time_start2 = benchcommon.last_time2 - } - - sub end() { - benchcommon.read_time() - - c64scr.print_ubhex(benchcommon.time_start2, false) - c64scr.print_ubhex(benchcommon.time_start1, false) - c64scr.print_ubhex(benchcommon.time_start0, false) - c64.CHROUT('\n') - - c64scr.print_ubhex(benchcommon.last_time2, false) - c64scr.print_ubhex(benchcommon.last_time1, false) - c64scr.print_ubhex(benchcommon.last_time0, false) - c64.CHROUT('\n') - - void c64scr.input_chars($c000) - } -} -