version 3.1

This commit is contained in:
Irmen de Jong 2020-08-18 16:26:23 +02:00
parent 53e9ad5088
commit 9cbb8e1a64
4 changed files with 4 additions and 165 deletions

View File

@ -1 +1 @@
3.1-SNAPSHOT
3.1

View File

@ -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 {
}
}
}

View File

@ -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)
}
}

View File

@ -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)
}
}