Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const SCREEN = 1024
- const RASTER = 53266
- const BALL = 81
- const SPACE = 32
- const BACK = 53280
- const COLLOC = 54272
- x = 1
- y = 1
- dx = 1
- dy = 1
- m = 0
- posy=12
- posx=0
- dposy=1
- dposx=1
- colorch=0
- xx=0
- dxx=1
- goto start
- origin $1000
- incbin "Nightshift1.sid"
- proc start_music
- asm " sei"
- doke $314, @irq_routine
- poke $d011, $1b
- poke $d012, $e4
- poke $dc0d, %01111111
- poke $d01a, %00000001
- poke $d019, %00000001
- asm "
- lda #$00
- jsr $1000
- cli"
- return
- irq_routine:
- asm "
- lda #$01
- sta $d019
- jsr $1003
- asl $d019
- jmp $ea31"
- endproc
- start:
- print "{CLR}"
- call start_music
- for colorch=0to1000:pokecolorch+SCREEN+COLLOC,7:nextcolorch
- main:
- charat x, y, BALL
- gosub wait_frame
- charat x, y, SPACE
- textat xx,posy, "xc=basic demo"
- textat xx,posy-1," "
- textat xx,posy+1," "
- posy=posy+dposy
- ifposy>12thendposy=-1
- ifposy<1 thendposy=1
- textat posx,24," by felix "
- i=1
- repeat
- pokeSCREEN+24*40+posx+i,peek(SCREEN+24*40+posx+i)+128
- inci
- untili=9
- posx=posx+dposx
- ifposx+5>x thendposx=-1
- ifposx+4<x thendposx=1
- ifposx<-1thenposx=-1
- ifposx>31thenposx=31
- if x = 0 then dx = 1 : poke BACK, m:xx=xx+dxx
- if x = 39 then dx = -1 : poke BACK, m:xx=xx+dxx
- if y = 0 then dy = 1 : poke BACK, m:xx=xx+dxx
- if y = 23 then dy = -1:poke BACK, m:xx=xx+dxx
- inc m
- if m > 255 then m=0
- x = x + dx
- y = y + dy
- if peek(SCREEN+x+40*y+1)<> SPACE then dx =-1
- if peek(SCREEN+x+40*y-1)<> SPACE then dx =1
- if peek(SCREEN+x+40*y+40)<> SPACE then dy =-1
- if peek(SCREEN+x+40*y-40)<> SPACE then dy =1
- ifxx>26thendxx=-1
- ifxx<1thendxx=1
- goto main
- wait_frame:
- if peek(RASTER) < 250 then goto wait_frame
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement