mirror of
https://github.com/irmen/prog8.git
synced 2024-11-18 19:12:44 +00:00
refreshed examples
This commit is contained in:
parent
1de328b2e8
commit
d28dd92b47
@ -16,7 +16,7 @@ sub start() {
|
||||
void c64.CHRIN()
|
||||
c64.CLEARSCR()
|
||||
|
||||
while true {
|
||||
forever {
|
||||
uword note
|
||||
for note in notes {
|
||||
ubyte note1 = lsb(note)
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
examples/compiled/lines-circles.prg
Normal file
BIN
examples/compiled/lines-circles.prg
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -19,7 +19,7 @@ main {
|
||||
|
||||
sub start() {
|
||||
float time=0.0
|
||||
while true {
|
||||
forever {
|
||||
rotate_vertices(time)
|
||||
c64scr.clear_screenchars(32)
|
||||
draw_edges()
|
||||
@ -78,7 +78,7 @@ main {
|
||||
for i in 0 to len(xcoor)-1 {
|
||||
rz = rotatedz[i]
|
||||
if rz >= 0.1 {
|
||||
persp = (5.0+rz)/height
|
||||
persp = (5.0+rz)/(height as float)
|
||||
sx = rotatedx[i] / persp + width/2.0 as ubyte
|
||||
sy = rotatedy[i] / persp + height/2.0 as ubyte
|
||||
c64scr.setcc(sx, sy, 46, i+2)
|
||||
@ -88,7 +88,7 @@ main {
|
||||
for i in 0 to len(xcoor)-1 {
|
||||
rz = rotatedz[i]
|
||||
if rz < 0.1 {
|
||||
persp = (5.0+rz)/height
|
||||
persp = (5.0+rz)/(height as float)
|
||||
sx = rotatedx[i] / persp + width/2.0 as ubyte
|
||||
sy = rotatedy[i] / persp + height/2.0 as ubyte
|
||||
c64scr.setcc(sx, sy, 81, i+2)
|
||||
|
@ -82,7 +82,7 @@ main {
|
||||
uword angley
|
||||
uword anglez
|
||||
word rz=33
|
||||
while true {
|
||||
forever {
|
||||
c64.TIME_LO=0
|
||||
rotate_vertices(msb(anglex), msb(angley), msb(anglez))
|
||||
position_sprites()
|
||||
|
@ -22,7 +22,7 @@ main {
|
||||
uword angley
|
||||
uword anglez
|
||||
word rz=33
|
||||
while true {
|
||||
forever {
|
||||
rotate_vertices(msb(anglex), msb(angley), msb(anglez))
|
||||
c64scr.clear_screenchars(32)
|
||||
draw_edges()
|
||||
|
@ -46,7 +46,7 @@ main {
|
||||
|
||||
if dx >= dy {
|
||||
; TODO fix assembler problem when defining label here
|
||||
while true {
|
||||
forever {
|
||||
c64scr.setcc(x, y, 42, 5)
|
||||
if x==x2
|
||||
return
|
||||
@ -59,7 +59,7 @@ main {
|
||||
}
|
||||
} else {
|
||||
; TODO fix assembler problem when defining label here
|
||||
while true {
|
||||
forever {
|
||||
c64scr.setcc(x, y, 42, 5)
|
||||
if y == y2
|
||||
return
|
||||
|
@ -12,7 +12,7 @@ main {
|
||||
; calculate primes
|
||||
c64scr.print("prime numbers up to 255:\n\n")
|
||||
ubyte amount=0
|
||||
while true {
|
||||
forever {
|
||||
ubyte prime = find_next_prime()
|
||||
if prime==0
|
||||
break
|
||||
|
@ -8,7 +8,7 @@ main {
|
||||
c64.SCROLY &= %11101111 ; blank the screen
|
||||
c64utils.set_rasterirq_excl(40) ; register exclusive raster irq handler
|
||||
|
||||
while true {
|
||||
forever {
|
||||
; enjoy the moving bars :)
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@ main {
|
||||
float t
|
||||
ubyte color
|
||||
|
||||
while true {
|
||||
forever {
|
||||
float x = sin(t)
|
||||
float y = cos(t*1.1356)
|
||||
ubyte xx=(x * width/2.2) + width/2.0 as ubyte
|
||||
|
@ -15,7 +15,7 @@ main {
|
||||
|
||||
Ball ball
|
||||
|
||||
while true {
|
||||
forever {
|
||||
ubyte x = msb(sin8u(msb(ball.anglex)) as uword * width)
|
||||
ubyte y = msb(cos8u(msb(ball.angley)) as uword * height)
|
||||
c64scr.setcc(x, y, 81, ball.color)
|
||||
|
Loading…
Reference in New Issue
Block a user