2019-01-05 02:42:58 +01:00
|
|
|
%import c64utils
|
2019-01-20 17:45:57 +01:00
|
|
|
%import c64lib
|
2019-02-03 00:14:56 +01:00
|
|
|
%zeropage basicsafe
|
2019-01-05 02:42:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
~ spritedata $0a00 {
|
|
|
|
; this memory block contains the sprite data
|
|
|
|
; it must start on an address aligned to 64 bytes.
|
|
|
|
%option force_output ; make sure the data in this block appears in the resulting program
|
|
|
|
|
|
|
|
ubyte[63] balloonsprite = [ %00000000,%01111111,%00000000,
|
|
|
|
%00000001,%11111111,%11000000,
|
|
|
|
%00000011,%11111111,%11100000,
|
|
|
|
%00000011,%11100011,%11100000,
|
|
|
|
%00000111,%11011100,%11110000,
|
|
|
|
%00000111,%11011101,%11110000,
|
|
|
|
%00000111,%11011100,%11110000,
|
|
|
|
%00000011,%11100011,%11100000,
|
|
|
|
%00000011,%11111111,%11100000,
|
|
|
|
%00000011,%11111111,%11100000,
|
|
|
|
%00000010,%11111111,%10100000,
|
|
|
|
%00000001,%01111111,%01000000,
|
|
|
|
%00000001,%00111110,%01000000,
|
|
|
|
%00000000,%10011100,%10000000,
|
|
|
|
%00000000,%10011100,%10000000,
|
|
|
|
%00000000,%01001001,%00000000,
|
|
|
|
%00000000,%01001001,%00000000,
|
|
|
|
%00000000,%00111110,%00000000,
|
|
|
|
%00000000,%00111110,%00000000,
|
|
|
|
%00000000,%00111110,%00000000,
|
|
|
|
%00000000,%00011100,%00000000 ]
|
|
|
|
}
|
|
|
|
|
|
|
|
~ main {
|
|
|
|
|
|
|
|
sub start() {
|
|
|
|
|
2019-01-09 00:25:02 +01:00
|
|
|
for ubyte i in 0 to 7 {
|
2019-01-09 22:01:47 +01:00
|
|
|
c64.SPRPTR[i] = $0a00/64
|
2019-01-09 00:25:02 +01:00
|
|
|
}
|
2019-01-15 21:35:15 +01:00
|
|
|
c64.SPENA = 255 ; enable all sprites
|
2019-01-11 02:35:57 +01:00
|
|
|
c64utils.set_rasterirq(220) ; enable animation
|
2019-01-05 02:42:58 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
~ irq {
|
|
|
|
|
2019-01-11 09:26:59 +01:00
|
|
|
sub irq() {
|
|
|
|
ubyte angle ; no initialization value so it keeps the previous one.
|
2019-01-05 02:42:58 +01:00
|
|
|
|
2019-01-11 09:26:59 +01:00
|
|
|
c64.EXTCOL--
|
2019-01-11 02:35:57 +01:00
|
|
|
|
2019-01-11 09:26:59 +01:00
|
|
|
angle++
|
|
|
|
c64.MSIGX=0
|
2019-01-05 02:42:58 +01:00
|
|
|
|
2019-01-27 22:59:40 +01:00
|
|
|
for ubyte @zp i in 7 to 0 step -1 {
|
|
|
|
uword @zp x = sin8u(angle*2-i*16) as uword + 50
|
|
|
|
ubyte @zp y = cos8u(angle*3-i*16) / 2 + 70
|
2019-01-11 09:26:59 +01:00
|
|
|
c64.SPXYW[i] = mkword(lsb(x), y)
|
|
|
|
lsl(c64.MSIGX)
|
|
|
|
if msb(x) c64.MSIGX++
|
|
|
|
c64.EXTCOL++
|
|
|
|
}
|
2019-01-12 01:59:32 +01:00
|
|
|
c64.EXTCOL-=7
|
2019-01-06 03:09:29 +01:00
|
|
|
|
2019-01-10 23:09:58 +01:00
|
|
|
}
|
2019-01-05 02:42:58 +01:00
|
|
|
|
|
|
|
}
|