home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 4: Demo 1
/
almathera_demo1.bin
/
sourcecode
/
xmas
/
xmas.s
< prev
next >
Wrap
Text File
|
1995-03-17
|
8KB
|
456 lines
section merry-xmas,code_c ; Put into chip memory
opt c-,o+ ; No case sensitivity, Optimize on
lea gfxlib,a1
moveq #0,d0
move.l 4.w,a6
jsr -$228(a6) ; Open Graphics library
tst d0
beq error
move.l D0,gfxbse
; generate snow-fields
lea sprite0,a0
move.l #$2c002d00,d0 ; first longword
moveq #69,d1 ; 60 sprites
spr0lp swap d0
move.b $dff007,d2
eor.b d2,d0
swap d0
mulu d3,d3
mulu d3,d3
mulu d3,d3
mulu d3,d3
move.l d0,(a0)+
move.l #$10000,(a0)+
add.l #$02000200,d0
dbra d1,spr0lp
move.l #sprite0,d0
move.w d0,sp0l
swap d0
move.w d0,sp0h
lea sprite1,a0
move.l #$2d002e00,d0 ; first longword
moveq #69,d1 ; 60 sprites
spr1lp swap d0
move.b $dff007,d2
eor.b d2,d0
swap d0
mulu d3,d3
mulu d3,d3
mulu d3,d3
mulu d3,d3
move.l d0,(a0)+
move.l #$10000,(a0)+
add.l #$03000300,d0
dbra d1,spr1lp
move.l #sprite1,d0
move.w d0,sp1l
swap d0
move.w d0,sp1h
lea sprite2,a0
move.l #$2c002d00,d0 ; first longword
moveq #69,d1 ; 60 sprites
spr2lp swap d0
move.b $dff007,d2
eor.b d2,d0
swap d0
mulu d3,d3
mulu d3,d3
mulu d3,d3
mulu d3,d3
move.l d0,(a0)+
move.l #$10000,(a0)+
add.l #$02000200,d0
dbra d1,spr2lp
move.l #sprite2,d0
move.w d0,sp2l
swap d0
move.w d0,sp2h
lea sprite3,a0
move.l #$2d002e00,d0 ; first longword
moveq #69,d1 ; 60 sprites
spr3lp swap d0
move.b $dff007,d2
eor.b d2,d0
swap d0
mulu d3,d3
mulu d3,d3
mulu d3,d3
mulu d3,d3
move.l d0,(a0)+
move.l #$10000,(a0)+
add.l #$03000300,d0
dbra d1,spr3lp
move.l #sprite3,d0
move.w d0,sp3l
swap d0
move.w d0,sp3h
move.l #logo,d0 ; Store screen address in
move.w d0,pl0l ; Copper list
swap d0
move.w d0,pl0h
swap d0
add.l #3920,d0
move.w d0,pl1l
swap d0
move.w d0,pl1h
swap d0
add.l #3920,d0
move.w d0,pl2l
swap d0
move.w d0,pl2h
swap d0
add.l #3920,d0
move.w d0,pl3l
swap d0
move.w d0,pl3h
swap d0
add.l #3920,d0
lea topcols,a1
move.l d0,a0
move.w #$180,d0
moveq #15,d1
toplp move.w d0,(a1)+
move.w (a0)+,(a1)+
addq.w #2,d0
dbra d1,toplp
move.l #piccy,d0 ; Store screen address in
move.w d0,mp0l ; Copper list
swap d0
move.w d0,mp0h
swap d0
add.l #6440,d0
move.w d0,mp1l
swap d0
move.w d0,mp1h
swap d0
add.l #6440,d0
move.w d0,mp2l
swap d0
move.w d0,mp2h
swap d0
add.l #6440,d0
move.w d0,mp3l
swap d0
move.w d0,mp3h
swap d0
add.l #6440,d0
move.w d0,mp4l
swap d0
move.w d0,mp4h
swap d0
add.l #6440,d0
lea botcols,a1
move.l d0,a0
move.w #$180,d0
moveq #31,d1
botlp move.w d0,(a1)+
move.w (a0)+,(a1)+
addq.w #2,d0
dbra d1,botlp
move.l gfxbse,a6 ; Set up copper list
add.l #$32,a6
move.w #$80,$dff096
move.l (a6),oldcpr
move.l #newcpr,(a6)
move.w #$8080,$dff096
move.w #$8010,$dff09a
move.l $6c.w,old
move.l #new,$6c.w
WAIT: btst #6,$bfe001 ; Test for left mousebutton
bne.s wait
move.l old,$6c.w ; Return to workbench
move.l gfxbse,a6 ; copper list
add.l #$32,a6
move.w #$0080,$dff096
move.l oldcpr,(a6)
move.w #$8080,$dff096
move.l gfxbse,a1 ; Close graphics library
move.l $4.w,a6
jsr -$19e(a6)
error: clr.l d0 ; exit routine
rts
new: movem.l d0-d7/a0-a6,-(sp) ; save all registers
and.w #$10,$dff01e ; check if it is
beq.s out
move.w #$10,$dff09c
bsr starmov
bsr scroll
out: movem.l (sp)+,d0-d7/a0-a6
dc.w $4ef9 ; jsr instruction
old: dc.l 0
prnchr: lea font,a0
lea logo+40,a1 ; destination
sub.b #32,d0 ; de-ascii
mulu #512,d0 ; find position in font
add.l d0,a0
moveq #3,d1
lp1 moveq #31,d2
move.l a1,a2
lp2 move.l (a0)+,(a2)
add.l #44,a2
dbra d2,lp2
add.l #3920,a1
dbra d1,lp1
rts
SCROLL cmp.b #0,scrlctd
beq.s scrl2
subq.b #1,scrlctd
rts
scrl2 bsr blitscr
move.b scrlptr,d0
subq.b #1,d0
beq.s zero
move.b d0,scrlptr
rts
zero move.b #8,scrlptr
move.l txtptr,a0
moveq #0,d0
move.b (a0)+,d0
cmp.b #0,d0
bne.s charok
move.l #text,txtptr
bra.s zero
charok cmp.b #254,d0
bne.s notpuse
move.b #80,scrlctd
move.l a0,txtptr
moveq #32,d0
bsr prnchr
rts
notpuse move.l a0,txtptr
bsr prnchr
rts
blitscr
moveq #3,d0
lea logo,a0
blitlp btst #14,$dff002
bne.s blitlp
move.l a0,$dff050
move.l a0,a1
subq.l #2,a1
move.l a1,$dff054
clr.l $dff064
move.l #-1,$dff044
move.w #%1101100111110000,$dff040
clr.w $dff042
move.w #22+33*64,$dff058
add.l #3920,a0
dbra d0,blitlp
blitfin btst #14,$dff002
bne.s blitfin
rts
starmov bsr move0
bsr move1
bsr move2
bsr move3
rts
move0 lea sprite0+69*8,a0
moveq #68,d0
move.b 1(a0),saveval
mv0lp move.b -7(a0),1(a0)
subq.l #8,a0
dbra d0,mv0lp
move.b saveval,d0
move.b $dff007,d1
eor.b d1,d0
move.b d0,1(a0)
rts
move1 lea sprite1+69*8,a0
moveq #68,d0
move.b 1(a0),saveval
mv1lp move.b -7(a0),1(a0)
subq.l #8,a0
dbra d0,mv1lp
move.b saveval,d0
move.b $dff007,d1
eor.b d1,d0
move.b d0,1(a0)
rts
move2 lea sprite2+69*8,a0
moveq #68,d0
move.b 1(a0),saveval
mv2lp move.b -7(a0),1(a0)
subq.l #8,a0
dbra d0,mv2lp
move.b saveval,d0
move.b $dff007,d1
eor.b d1,d0
move.b d0,1(a0)
rts
move3 lea sprite3+69*8,a0
moveq #68,d0
move.b 1(a0),saveval
mv3lp move.b -7(a0),1(a0)
subq.l #8,a0
dbra d0,mv3lp
move.b saveval,d0
move.b $dff007,d1
eor.b d1,d0
move.b d0,1(a0)
rts
saveval dc.b 0
scrlptr dc.b 6
scrlctd dc.b 0
even
txtptr dc.l text
text dc.b " IT'S KRISTMAS TIME!,",254," AND TIME FOR A FAIRLY SEASONAL AMIGA COMPUTING DEMO. "
; 0123456789
dc.b " AMIGA! ",254
dc.b " FIRSTLY I "
DC.B "MUST APOLOGISE TO MY FAN FOR NOT DOING A DEMO LAST MONTH, BUT THINGS GOT TOO BUSY! SORRY! "
dc.b " SPECIAL MESSAGES AND ADVERTISMENTS.... HAVE YOU GOT A MODEM? PHONE THE BEST BBS IN THE WHOLE "
DC.B "WORLD, MAX! PHONE MAX ON (0905) 52536/56610/57822/754127/754151 NOW! ALL SPEEDS FROM 300 BAUD (SLOOOOOOW) "
DC.B "TO MEGA-SUPER-DOOPER FAST 19.2K BAUD WITH HST AND MNP LEVEL 5 ERROR CORRECTION (LOG ON AND SAY - I SAW THIS ADVERT "
DC.B " GET ON AND BOOGY DOWN TO THE HOTTEST BOARD THIS SIDE OF THE UKRAINE. "
dc.b " SORRY TO MARK FOR FORGETTING YOU IN THE LAST DEMO. ERM. SORRY I'VE FORGOTTEN WHAT YOU ASKED ME TO SAY. PERHAPS "
DC.B "THE NEXT ONE. ",0
DC.B "OH YES, THE CREDITS... CODE CODED BY THE ONE AND ONLY (EXCEPT FOR ALL THE OTHERS) ---- JOLYON RALPH ---- "
DC.B "MOST GRAPHICS BY THE MY GOOD OLE BUDDY ---- RUSS WARK ---- WATCH OUT FOR HIS WEIRD CARTOONS IN THE MAGAZINE - SMUT - "
DC.B 0
oldcpr: dc.l 0 ; Workbench copperlist
newcpr: dc.w $100,$4200,$102,$0,$104,0,$108,4,$10a,4
dc.w $92,$38,$94,$d0,$8e,$2c81,$90,$2cc1,$e0
pl0h: dc.w 0,$e2
pl0l: dc.w 0,$e4
pl1h: dc.w 0,$e6
pl1l: dc.w 0,$e8
pl2h: dc.w 0,$ea
pl2l: dc.w 0,$ec
pl3h: dc.w 0,$ee
pl3l: dc.w 0,$120
sp0h: dc.w 0,$122
sp0l: dc.w 0,$124
sp1h: dc.w 0,$126
sp1l: dc.w 0,$128
sp2h: dc.w 0,$12a
sp2l: dc.w 0,$12c
sp3h: dc.w 0,$12e
sp3l: dc.w 0
topcols ds.w 32
dc.w $180,0,$182,0
dc.w $3009,$fffe,$186,$1
dc.w $3109,$fffe,$186,$2
dc.w $3209,$fffe,$186,$3
dc.w $3309,$fffe,$186,$4
dc.w $3409,$fffe,$186,$5
dc.w $3509,$fffe,$186,$6
dc.w $3609,$fffe,$186,$7
dc.w $3709,$fffe,$186,$8
dc.w $3809,$fffe,$186,$9
dc.w $3909,$fffe,$186,$a
dc.w $4109,$fffe,$186,$1a
dc.w $4209,$fffe,$186,$3a
dc.w $4309,$fffe,$186,$4a
dc.w $4409,$fffe,$186,$5a
dc.w $4509,$fffe,$186,$6a
dc.w $4609,$fffe,$186,$7a
dc.w $4709,$fffe,$186,$8a
dc.w $4809,$fffe,$186,$9a
dc.w $4909,$fffe,$186,$aa
dc.w $7709,$fffe,$108,0,$10a,0,$104,$a
dc.w $7809,$fffe,$100,$5200
dc.w $e0
mp0h dc.w 0,$e2
mp0l dc.w 0,$e4
mp1h dc.w 0,$e6
mp1l dc.w 0,$e8
mp2h dc.w 0,$ea
mp2l dc.w 0,$ec
mp3h dc.w 0,$ee
mp3l dc.w 0,$f0
mp4h dc.w 0,$f2
mp4l dc.w 0
botcols ds.w 64
dc.w $f009,$fffe
dc.w $9c,$8010
dc.w $ffff,$fffe ; End copper
gfxlib: dc.b "graphics.library",0 ; library name
even
gfxbse: dc.l 0
dummy dc.l 0
sprite0 ds.l 2*70
sprite1 ds.l 2*70
sprite2 ds.l 2*70
sprite3 ds.l 2*70
logo ds.b 15712-32
dc.w 0,$fff,$eee,$ddd,$ccc,$bbb,$aaa,$999,$888,$777
dc.w $666,$555,$444,$333,$222,$111
ds.b 1000
font ds.b 512
incbin sources:xmas/font2
piccy incbin sources:xmas/mountains