home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 4: Demo 1
/
almathera_demo1.bin
/
sourcecode
/
german
/
sprite.s
< prev
next >
Wrap
Text File
|
1995-03-17
|
15KB
|
755 lines
PicBuffer=$40000
SndBuffer=$40000
BitPlane1=$60000 ;Adresse Bitplane 1
BitPlane2=$64000 ;Adresse Bitplane 2
BitPlane3=$68000 ;Adresse Bitplane 3
BitPlane4=$6c000 ;Adresse Bitplane 4
BitPlane5=$70000 ;Adresse BItplane 5
Exec=4 ;Basisadresse Execbase
Permit=-138 ;Stop Multitasking
Open= -30
Close= -30 -6
Read= -30 -12
Forbid=-132 ;Start Multitasking
OpenLibrary=-408
CloseLibrary=-414
InitRastPort=-198
InitBitMap=-390
SetRast= -30 -204
Move= -30 -210
Draw= -30 -216
Text= -30 -30
RectFill= -30 -276
ScrollRaster= -30 -366
WritePixel= -30 -294
SetAPen= -30 -312
WaitTOF= -30 -240
exit= -30 -114
start:
jsr setup ;Initialisiert die Bitmaps und
jsr pic
jsr initirq
* jmp grafik
move.l dos_base,a6
move.l #Soundname,d1
move.l #1005,d2
jsr Open(a6) ; open file
move.l d0,d6
move.l d6,d1
move.l #SndBuffer,d2 ; read file in buffer
move.l #115331,d3
jsr Read(a6)
move.l d0,d7
move.l d6,d1
jsr Close(a6) ; close file
move.l a6,a1
move.l 4,a6
jsr CloseLibrary(a6) ; close dos.library
move.l #SndBuffer,$dff0a0
move.l #Sndbuffer,$dff0b0
move.l #SndBuffer+300,$dff0c0
move.l #Sndbuffer,$dff0d0
lsr.l #1,d7
move.w d7,$dff0a4
move.w d7,$dff0b4
move.w d7,$dff0c4
move.w d7,$dff0d4
move.w #240,$dff0a6
move.w #240,$dff0c6
move.w #240,$dff0b6
move.b #240,$dff0d6
move.w #64,$dff0a8
move.w #64,$dff0c8
move.w #64,$dff0b8
move.w #64,$dff0d8
jmp grafik
pic:
jsr open_file ;File auf Diskette oeffnen
move.l #col_buf,d2
move #64,d3
jsr load
move.l #PicBuffer,d2 ;Adresse der 1. Bitmap
move.l #40000,d3 ;Anzahl der Bytes fuer
jsr load ;Loadroutine
jsr close_file
move.l #Bitplane1,a2
move.l #picbuffer,a0
move #4,d3
l3: move.l a2,a1
move #200,d1
l2: move #20,d0
l1: move.w (a0)+,(a1)+
sub #1,d0
bne l1
add.w #40,a1
sub #1,d1
bne l2
add #$4000,a2
sub #1,d3
bne l3
move.l #col_buf,a0
move.l #co0,a1
move #32,d1
w1: move.w (a0),(a1)+
add.w #2,a1
add.w #2,a0
sub #1,d1
bne w1
rts
open_file:
move.l dos_base,a6
move.l #picname,d1
move.l #1005,d2
jsr Open(a6)
beq wait
move.l d0,bif
rts
load:
move.l dos_base,a6
move.l bif,d1
jsr Read(a6)
rts
close_file:
move.l dos_base,a6
move.l bif,d1
jsr Close(a6)
rts
farbe:
cmp.b #1,flag
bne nein
cmp.b #15,co30
bne n1
move.b #0,flag
rts
n1: add.b #1,co30
sub.b #1,co31+1
rts
nein: cmp.b #5,co30
bne n2
move.b #1,flag
rts
n2: sub.b #1,co30
add.b #1,co31+1
rts
grafik:
move.w #$fff,co17
move.w #$f00,co18
move.w #$444,co19
move.w #$fff,co20
move.w #$f00,co21
move.w #$fff,co22
move.w #$f06,co30
move.w #$075,co31
move.b #1,flag
jsr setcopper
move.w #%1000000000100101,$dff096
move.l gfxbase,a6
lea rastport,a1
init: move.l #text1,a2
move.l #len1-text1,d7
sub #1,d7
move.b #1,dauer
ll2:
sub.b #1,dauer
bne no
move.b #3,dauer
eor.b #2,$bfe001
no: jsr set1
move.l a2,a0
move.l gfxbase,a6
lea rastport,a1
move.l #30,d0
jsr setapen(a6)
move.w #1,d0
jsr text(a6)
jsr set2
move.l a2,a0
move.l gfxbase,a6
move.w #31,d0
jsr setapen(a6)
lea rastport,a1
move.w #1,d0
jsr text(a6)
jsr scroll
jsr farbe
add.l #1,a2
jmp wait
nomouse:
dbra d7,ll2
jmp init
scroll:
move #4,d6
ll1: move.l gfxbase,a6
jsr waittof(a6)
lea rastport,a1
move.w #2,d0
move.w #0,d1
move.w #0,d2
move.w #180,d3
move.w #330,d4
move.w #187,d5
jsr scrollraster(a6)
move.l gfxbase,a6
lea rastport,a1
move.w #3,d0
move.w #0,d1
move.w #0,d2
move.w #191,d3
move.w #330,d4
move.w #200,d5
jsr scrollraster(a6)
dbra d6,ll1
rts
set1: move.l gfxbase,a6
lea rastport,a1
move.l #321,d0
move.l #197,d1
jsr move(a6)
rts
set2: move.l gfxbase,a6
lea rastport,a1
move.l #321,d0
move.l #186,d1
jsr move(a6)
rts
wait:
andi.b #64,$bfe001 ;Bit 7 (linke Maustaste)
beq stop
jmp nomouse
stop:
jsr stopirq
move.w #%0000000000000101,$dff096
move.l copptr,a0
move.l oldcop,(a0) ;Alte Copperliste wieder bereit-
move.l exec,a6
move.l GfxBase,a1 ;stellen und Gfxlibrary
jsr CloseLibrary(a6);schliessen
move.l exec,a6
move.l dos_base,a1
jsr closelibrary(a6)
move.l exec,a6
jsr Permit(a6) ;Multitasking wieder zulassen
illegal
rts ;ende
initirq:
move.b #190,s1y
move.b #206,s1e
move.b #3,loop
move.b #0,loop1
move.w #$4000,$dff09a
move.l $6c,OldVector
move.l #Neuirq,$6c
move.w #$c000,$dff09a
rts
stopirq:
move.w #$4000,$dff09a
move.l OldVector,$6c
move.w #$c000,$dff09a
rts
Neuirq:
movem.l d0-d2/a0-a1,-(a7)
move SR,-(sp)
move.w $dff01e,d0
btst #5,d0
bne.s makeirq
bra Endirq
Makeirq:
move.l loop1,d0
move.l #x0,a0
add.l d0,a0
move.b (a0),d1
cmp.b #0,d1
beq lab2
move.b (a0),d2
move.b d2,s0x
neg d2
move.b d2,s1x
sub.b #18,s0x
add.b #40,s1x
move.l #y0,a0
add.l d0,a0
move.b (a0),s0y
move.b (a0),d0
neg d0
move.b d0,s1y
add.b #30,s0y
sub.b #30,s1y
move.b s0y,d0
add.b #16,d0
move.b d0,s0e
move.b s1y,d0
add.b #16,d0
move.b d0,s1e
add.l #1,loop1
jmp lab1
lab2: move.l #0,loop1
lab1:
sub.b #1,loop
bne endirq
move.w spr0l,d0
move.w spr0h,d1
move.w spr1l,spr0l
move.w spr1h,spr0h
move.w d0,spr1l
move.w d1,spr1h
col1: move.w co16,d0
move.w co15,co16
move.w co14,co15
move.w co13,co14
move.w co12,co13
move.w co11,co12
move.w co10,co11
move.w co9,co10
move.w co8,co9
move.w co7,co8
move.w co6,co7
move.w co5,co6
move.w co4,co5
move.w co3,co4
move.w co2,co3
move.w co1,co2
move.w d0,co1
move.b #3,loop
Endirq:
move (sp)+,SR
movem.l (sp)+,d0-d2/a0-a1
DC.W $4ef9
OldVector: DC.L $0000
setup:
move.l Exec,a6 ;Exebase-Adresse nach a6
jsr Forbid(a6) ;Stop Multitasking
move.l exec,a6
lea.l dosname,a1
jsr Openlibrary(a6)
move.l d0,dos_base
lea GrName,a1 ;Gfxname nach a1
jsr OpenLibrary(a6) ;Gfxlibrary oeffnen
move.l d0,GfxBase ;Basisadresse buffern
move.l d0,a6
add.l #$32,d0
move.l d0,copptr
; ---- Setup the BitMap
lea BitMap,a0 ;Bitmapstruktur nach a0
moveq #5,d0 ;Tiefe (5 Bitplanes)
move.l #640,d1 ;320 Pixel nach x
move.l #200,d2 ;200 Pixel nach y
jsr InitBitMap(a6) ;Bitmap Initialisieren
lea RastPort,a1 ;erhaltenen Rastport nach a1
jsr InitRastPort(a6);Rastport initialisieren
move.l #BitMap,R_BitMap
move.l #BitPlane1,d0 ;Adresse Bitplane nach d0
move.l d0,Plane1 ;Adresse auch nach Plane1
move.l d0,a0 ;und nach Adressregister a0
move.w d0,lo1 ;sowie in Copperliste speichern
swap d0 ;Hi-Nibble isolieren und eben-
move.w d0,hi1 ;falls nach Copperliste
move.l #16000,d0 ;8000 Bytes fuer Bitplane bele-
move.b #$00,d1 ;gen
cl1: move.b d1,(a0)+
dbf d0,cl1
move.l #BitPlane2,d0
move.l d0,Plane2
move.l d0,a0
move.w d0,lo2
swap d0
move.w d0,hi2
move.l #16000,d0
move.b #$00,d1
cl2: move.b d1,(a0)+
dbf d0,cl2
move.l #BitPlane3,d0
move.l d0,Plane3
move.l d0,a0
move.w d0,lo3
swap d0
move.w d0,hi3
move.l #16000,d0
move.b #$00,d1
cl3: move.b d1,(a0)+
dbf d0,cl3
move.l #BitPlane4,d0
move.l d0,Plane4
move.l d0,a0
move.w d0,lo4
swap d0
move.w d0,hi4
move.l #16000,d0
move.b #$00,d1
cl4: move.b d1,(a0)+
dbf d0,cl4
move.l #BitPlane5,d0
move.l d0,Plane5
move.l d0,a0
move.w d0,lo5
swap d0
move.w d0,hi5
move.l #16000,d0
move.b #$00,d1
cl5: move.b d1,(a0)+
dbf d0,cl5
makesprite:
move.l #sprite0,d0
move.w d0,spr0l
swap d0
move.w d0,spr0h
move.b #50,d0
move.b d0,s0y
add.b #16,d0
move.b d0,s0e
move.b #100,s0x
move.l #sprite1,d0
move.w d0,spr1l
swap d0
move.w d0,spr1h
rts
setcopper:
move.l copptr,a0 ;Adresse der Copperliste nach a0
move.l (a0),oldcop ;Alte Liste zwischenspeichern
move.l #Copper,(a0) ;Neue Liste fue Copper
rts
Copper:
DC.W $0180
co0: dc.w $0000
DC.W $0182
co1: dc.w $0fff
DC.W $0184
co2: dc.w $000f
DC.W $0186
co3: dc.w $0f00
DC.W $0188
co4: dc.w $000f
DC.W $018a
co5: dc.w $0f0f
DC.W $018c
co6: dc.w $00ff
DC.W $018e
co7: dc.w $f0ff
DC.W $0190
co8: dc.w $0620
DC.W $0192
co9: dc.w $0e50
DC.W $0194
co10: dc.w $09f1
DC.W $0196
co11: dc.w $0eb0
dc.w $0198
co12: dc.w $055f
dc.w $019a
co13: dc.w $092f
dc.w $019c
co14: dc.w $00f8
dc.w $019e
co15: dc.w $0ccc
dc.w $01a0
co16: dc.w $0000
dc.w $01a2
co17: dc.w $0d22
dc.w $01a4
co18: dc.w $0000
dc.w $01a6
co19: dc.w $0fca
dc.w $01a8
co20: dc.w $0444
dc.w $01aa
co21: dc.w $0555
dc.w $01ac
co22: dc.w $0666
dc.w $01ae
co23: dc.w $0777
dc.w $01b0
co24: dc.w $0888
dc.w $01b2
co25: dc.w $0999
dc.w $01b4
co26: dc.w $0aaa
dc.w $01b6
co27: dc.w $0bbb
dc.w $01b8
co28: dc.w $0ccc
dc.w $01ba
co29: dc.w $0ddd
dc.w $01bc
co30: dc.w $0eee
dc.w $01be
co31: dc.w $0fff
DC.W $00e0
hi1: DC.W $0002
DC.W $00e2
lo1: DC.W $1000
DC.W $00e4
hi2: DC.W $0002
DC.W $00e6
lo2: DC.W $1000
DC.W $00e8
hi3: DC.W $0002
DC.W $00ea
lo3: DC.W $1000
DC.W $00ec
hi4: DC.W $0002
DC.W $00ee
lo4: DC.W $1000
DC.W $00f0
hi5: DC.W $0002
DC.W $00f2
lo5: DC.W $1000
DC.W $0100,%0101000000000000
DC.W $0102
delay: DC.W $ff
DC.W $0108,38
DC.W $010a,38
DC.W $0092,$0030
DC.W $0094,$00d0
DC.W $008e,$3681
DC.W $0090,$fdc1
dc.w $0120
spr0h: dc.w $0000
dc.w $0122
spr0l: dc.w $0000
dc.w $0128
spr1h: dc.w $0000
dc.w $012a
spr1l: dc.w $0000
dc.w %0010000000000001,$ff00
dc.w $0180,$00f
dc.w %0011000000000001,$ff00
dc.w $0180,$00e
dc.w %0100000000000001,$ff00
dc.w $0180,$00d
dc.w %0101000000000001,$ff00
dc.w $0180,$00c
dc.w %0110000000000001,$ff00
dc.w $0180,$00b
dc.w %0111000000000001,$ff00
dc.w $0180,$00a
dc.w %1000000000000001,$ff00
dc.w $0180,$009
dc.w %1001000000000001,$ff00
dc.w $0180,$008
dc.w %1010000000000001,$ff00
dc.w $0180,$007
dc.w %1011000000000001,$ff00
dc.w $0180,$006
dc.w %1100001100000001,$ff00
dc.w $0180,$005
dc.w %1101000000000001,$ff00
dc.w $0180,$004
dc.w %1110000000000001,$ff00
dc.w $0180,$003
dc.w %1111000000000001,$ff00
dc.w $0180,$002
dc.w %1111111100000001,$ff00
dc.w $0180,$001
DC.W $ffff,$fffe
BitMap:
BytesPerRow: blk.w 1,0
Bytes: blk.w 1,0
Flags: blk.b 1,0
Depth: blk.b 1,0
Pad: blk.w 1,0
Plane1: blk.l 1,0
Plane2: blk.l 1,0
Plane3: blk.l 1,0
Plane4: blk.l 1,0
Plane5: blk.l 1,0
Planes: blk.l 1,0
RastPort:
blk.l 1,0
R_BitMap: blk.l 1,0
blk.b 2+4+4+4+8,0
blk.b 4,0
cp_x: blk.w 1,0
cp_y: blk.w 1,0
blk.b 8+22+[7*2]+[2*4]+8,0
blk.w 6,0
even
grname: dc.b 'graphics.library',0
dosname: dc.b 'dos.library',0
even
copptr: blk.l 1,0
oldcop: blk.l 1,0
GfxBase: blk.l 1,0
Dos_base: blk.l 1,0
bif: blk.l 1,0
Disk_buf: blk.l 1,0
col_buf: blk.l 25,0
buffer1: blk.l 25,0
align 4
text1:
dc.b ' '
dc.b 'THE BLADE RUNNERS in 2012 present '
dc.b '....'
dc.b ' Greetings to HEADBANGER, ERROR-SOFT, IRATA, '
dc.b 'LIGHT-CIRCLE and RADWAR (Hi Markus!)... '
dc.b 'Special greetings to ZIP-S0FT (in member of '
dc.b 'The Innocent Devils)... '
dc.b 'This scroll-demo is written in 68000 Assembler '
dc.b 'with full Copper and Interrupt control !!! '
dc.b 'Look for flashing POWER-LAMP !!! '
dc.b 'Soon coming from TBR: TBR Intro-Disk 1 and '
dc.b 'TBR-Slideshow 1.... '
dc.b ' '
len1: equ *
dauer: dc.b 1,0
loop: dc.b 1,0
flag: dc.b 1,0
Sprite0:
s0y: DC.B $00
s0x: DC.B $00
s0e: DC.B $00
DC.B $00
DC.W $0700,$00E0
DC.W $0718,$18E0
DC.W $071C,$38E0
DC.W $38E2,$471C
DC.W $38E2,$471C
DC.W $38E3,$C71C
DC.W $C71C,$38E3
DC.W $C71C,$38E3
DC.W $C71C,$38E3
DC.W $38E3,$C71C
DC.W $38E3,$C71C
DC.W $38E2,$471C
DC.W $471C,$38E2
DC.W $071C,$38E0
DC.W $0718,$18E0
DC.W $00E0,$0700
DC.W $0000,$0000
Sprite1:
s1y: DC.B $00
s1x: DC.B $00
s1e: DC.B $00
DC.B $00
DC.W $0700,$00E0
DC.W $0718,$18E0
DC.W $071C,$38E0
DC.W $38E2,$471C
DC.W $38E2,$471C
DC.W $38E3,$C71C
DC.W $C71C,$38E3
DC.W $C71C,$38E3
DC.W $C71C,$38E3
DC.W $38E3,$C71C
DC.W $38E3,$C71C
DC.W $38E2,$471C
DC.W $471C,$38E2
DC.W $071C,$38E0
DC.W $0718,$18E0
DC.W $00E0,$0700
DC.W $0000,$0000
x0:
DC.B $50,$50,$51,$53,$56,$5a,$5e,$63,$68,$6e,$74,$7b,$82
DC.B $89,$91,$98,$9f,$a7,$ad,$b4,$ba,$c0,$c5,$ca,$ce
DC.B $d1,$d4,$d6,$d7,$d8,$d8,$d8,$d6,$d5,$d2,$d0,$cd
DC.B $c9,$c5,$c1,$bd,$b9,$b5,$b1,$ad,$a9,$a6,$a2,$a0
DC.B $9d,$9b,$99,$98,$97,$97,$97,$97,$98,$99,$9b,$9c
DC.B $9e,$a0,$a2,$a4,$a6,$a8,$aa,$ab,$ac,$ad,$ae,$ae
Dc.B $ae,$ad,$ac,$aa,$a8,$a6,$a3,$a0,$9c,$98,$94,$8f
DC.B $8b,$86,$81,$7d,$78,$74,$70,$6c,$69,$66,$64,$62
DC.B $61,$61,$61,$62,$64,$66,$6a,$6d,$72,$77,$7d,$83
DC.B $89,$90,$97,$9f,$a6,$ae,$b6,$bd,$c4,$cb,$d1,$d7
DC.B $dd,$e2,$e6,$e9,$ec,$ee,$ef,$ef,$ee,$ed,$eb,$e8
DC.B $e4,$e0,$db,$d6,$d0,$ca,$c3,$bc,$b5,$ae,$a7,$a0
DC.B $9a,$93,$8d,$87,$82,$7d,$79,$76,$73,$70,$6f,$6e
DC.B $6d,$6d,$6e,$70,$71,$74,$76,$79,$7c,$80,$83,$87
DC.B $8b,$8e,$92,$95,$98,$9b,$9d,$9f,$a1,$a2,$a3,$a3
DC.B $a3,$a3,$a2,$a1,$a0,$9e,$9c,$9a,$98,$96,$94,$92
DC.B $90,$8e,$8d,$8b,$8b,$8a,$8a,$8b,$8b,$8d,$8f,$91
DC.B $94,$97,$9b,$9f,$a3,$a8,$ad,$b2,$b7,$bc,$c2,$c7
DC.B $cc,$d0,$d4,$d8,$dc,$de,$e1,$e2,$e3,$e3,$e3,$e1
DC.B $df,$dd,$d9,$d5,$d0,$cb,$c5,$be,$b7,$b0,$a9,$a1
DC.B $99,$91,$8a,$82,$7b,$74,$6e,$68,$63,$5e,$5a,$57
DC.B $54,$53,$52,$00,$00
y0:
DC.B $56,$52,$4f,$4b,$48,$44,$41,$3e,$3c,$39,$37,$36
DC.B $35,$34,$33,$33,$33,$34,$35,$36,$37,$39,$3b,$3e
DC.B $40,$43,$45,$48,$4b,$4e,$51,$53,$56,$59,$5b,$5d
DC.B $5f,$61,$62,$63,$64,$65,$65,$66,$65,$65,$65,$64
DC.B $63,$62,$61,$60,$5f,$5e,$5c,$5b,$5a,$59,$58,$57
DC.B $57,$56,$56,$56,$56,$56,$57,$58,$58,$59,$5a,$5c
DC.B $5d,$5e,$60,$61,$63,$64,$65,$66,$67,$68,$69,$69
DC.B $69,$69,$69,$68,$67,$66,$64,$62,$60,$5e,$5c,$59
DC.B $56,$53,$50,$4d,$4a,$47,$44,$41,$3f,$3c,$3a,$38
DC.B $36,$34,$33,$32,$32,$32,$32,$32,$33,$35,$37,$39
DC.B $3b,$3e,$41,$44,$47,$4b,$4e,$52,$56,$59,$5d,$61
DC.B $64,$67,$6a,$6d,$6f,$72,$73,$75,$76,$77,$77,$77
DC.B $77,$77,$76,$74,$73,$71,$6f,$6d,$6b,$68,$66,$63
DC.B $60,$5e,$5b,$59,$56,$54,$52,$50,$4f,$4d,$4c,$4b
DC.B $4b,$4a,$4a,$4a,$4b,$4b,$4c,$4c,$4d,$4e,$4f,$50
DC.B $51,$52,$53,$54,$55,$56,$57,$57,$57,$57,$57,$57
DC.B $56,$56,$55,$54,$52,$51,$50,$4e,$4c,$4b,$49,$48
DC.B $46,$45,$43,$42,$41,$41,$40,$40,$40,$40,$41,$42
DC.B $43,$44,$46,$48,$4a,$4d,$50,$53,$56,$59,$5c,$5f
DC.B $62,$66,$69,$6c,$6f,$71,$74,$76,$78,$79,$7a,$7b
DC.B $7c,$7c,$7b,$7b,$79,$78,$76,$74,$72,$6f,$6c,$69
DC.B $65,$62,$5e,$5b
dc.b $00,$00
loop1: dc.b 1,0
soundname: dc.b 'tbr-sound',0
picname: dc.b 'tbr-pic',0