fixed % operator bug

This commit is contained in:
Irmen de Jong 2020-12-28 00:08:22 +01:00
parent 9e2c52e1ec
commit 69780ecde9
3 changed files with 11 additions and 13 deletions

View File

@ -850,8 +850,8 @@ internal class AugmentableAssignmentAsmGen(private val program: Program,
ldy #>$value
jsr math.divmod_uw_asm
lda P8ZP_SCRATCH_W2
ldy P8ZP_SCRATCH_W2+1
sta $name
lda P8ZP_SCRATCH_W2+2
sty $name+1
""")
}

View File

@ -76,11 +76,8 @@ main {
cx16.wait(2*60)
repeat 255 {
xx=rndw() % 640 ; TODO doesn't work correctly, truncates
yy=rndw() % 480 ; TODO doesn't work correctly, truncates
gfx2.line(xx, yy, rndw() % 640, rndw() % 480, 1)
}
repeat 255
gfx2.line(rndw() % 640, rndw() % 480, rndw() % 640, rndw() % 480, 1)
cx16.wait(1*60)
}

View File

@ -1,5 +1,6 @@
%import test_stack
%import textio
%import floats
%zeropage basicsafe
%option no_sysinit
@ -8,13 +9,13 @@ main {
sub start () {
; TODO uword var = rndw() % 640 doesn't work??? works if its in an expression.
x_f = -300.0
for ww in -300 to 300 {
;fl = ww as float / 10.0 ; TODO doesn't work???
y_f = cos(x_f/30)*60 - x_f/1.7
gfx2.plot(ww + 320 as uword, (y_f + 240) as uword, 1)
word ww
float x_f = -300.0
float y_f
for ww in -300 to 300 { ; TODO fix crash if ww is not defined
;fl = ww as float ; TODO doesn't work???
y_f = cos(x_f/30.0)*60 - x_f/1.7
; gfx2.plot(ww + 320 as uword, (y_f + 240) as uword, 1)
x_f += 1.0
}