home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 4: Demo 1
/
almathera_demo1.bin
/
sourcecode
/
dexion
/
bootmaker.s
< prev
next >
Wrap
Text File
|
1995-03-17
|
5KB
|
379 lines
execbase=4
findtask=-294
addport=-354
remport=-360
openlib=-408
opendev=-444
closedev=-450
doio=-456
bsr getgfx
bsr cleanitdown
move.l #scr,a0
move.l #7999,d0
aa:
move.b #0,(a0)+
dbra d0,aa
move.l #scr,a0
move.l a0,struc+8
move.l #struc,a0
moveq #1,d0
move.l #320,d1
move.l #200,d2
move.l gfxbase,a6
jsr -390(a6)
move.l #rastport,a1
jsr -198(a6)
move.l #struc,rastport+4
move.l #copper0,newcop
bsr changecop
move.l #coords,a2
fstcoor:
move.l #end,d1
sub.l a2,d1
ror.l #2,d1
mulu #40,d1
addi.l #scr,d1
move.l d1,a3
move.b #255,-8(a3)
clr.l d1
move.b $bfe00b,d4
move.b $bfe00a,d5
jsr getcoors
btst #7,$bfe001
beq quit2
move d4,d0
move d5,d1
jsr changebit
move.b (a2),d0
move.b 1(a2),d1
jsr changebit
btst #6,$bfe001
bne fstcoor
move.b (a2),d0
move.b 1(a2),d1
addi.l #2,a2
jsr changebit
move.l #7999,d0
move.l #scr,a0
move.l #screen,a3
cpylp:
move.b (a0)+,(a3)+
dbra d0,cpylp
woof:
btst #6,$bfe001
beq woof
move.b d4,(a2)
move.b d5,1(a2)
secondcoor:
jsr getcoors
move.l #7999,d0
move.l #scr,a0
move.l #screen,a3
cplp:
move.b (a3)+,(a0)+
dbra d0,cplp
clr.l d0
clr.l d1
move.b -2(a2),d0
move.b -1(a2),d1
jsr move(a6)
clr.l d0
clr.l d1
move.b (a2),d0
move.b 1(a2),d1
jsr draw(a6)
btst #6,$bfe001
bne secondcoor
hg:
btst #6,$bfe001
beq hg
addi.l #2,a2
move.b d4,(a2)
move.b d5,1(a2)
cmp.l #end,a2
bne fstcoor
quit:
jmp wboot
quit2:
move.b #222,1(a2)
jmp wboot
changebit:
move.l #0,a3
cmpi #200,d1
blt ok1
move #0,d1
ok1:
mulu #40,d1
move d1,a3
ror.l #3,d0
add d0,a3
clr d0
rol.l #3,d0
move.l #7,d1
sub d0,d1
add.l #scr,a3
bchg d1,(a3)
rts
getcoors:
btst #0,$dff004
bne getcoors
move.b (a2),d4
move.b 1(a2),d5
clr.l d0
clr.l d1
btst #6,$bfe001
beq changed
move.b $dff00b,d0
cmp.b d4,d0
bne changed
move.b $dff00a,d1
cmp.b d5,d1
beq getcoors
changed:
move.b $dff00b,(a2)
move.b $dff00a,1(a2)
rts
WBOOT: LEA BOOTSECTOR,A0
MOVE.L #$FFFFFFFF,D0
MOVE.L #$FF,D1
CLR.L D2
WBOOT1: SUB.L (A0)+,D0
SUBX.L D2,D0
DBRA D1,WBOOT1
MOVE.L D0,BOOTSECTOR+$4
MOVE.L EXECBASE,A6
MOVE.L #0,A1
JSR FINDTASK(A6)
MOVE.L D0,WPORT+$10
LEA WPORT,A1
JSR ADDPORT(A6)
LEA WIO,A1
MOVE.L #0,D0
CLR.L D1
LEA WTRDDEVICE,A0
JSR OPENDEV(A6)
TST.L D0
BNE WERROR
LEA WIO,A1
MOVE.L #WPORT,14(A1)
MOVE.W #3,28(A1)
MOVE.L #BOOTSECTOR,40(A1)
MOVE.L #2*512,36(A1)
MOVE.L #0*512,44(A1)
JSR DOIO(A6)
MOVE.W #4,28(A1)
JSR DOIO(A6)
MOVE.W #9,28(A1)
MOVE.L #0,36(A1)
JSR DOIO(A6)
LEA WPORT,A1
JSR REMPORT(A6)
LEA WIO,A1
JSR CLOSEDEV(A6)
WERROR: RTS
WTRDDEVICE:DC.B 'trackdisk.device',0
EVEN
WIO: BLK.L 20,0
WPORT: BLK.L 8,0
bootsector:
dc.b 'DOS',0
dc.l 0
dc.l 880
bootprog:
scr=$7a000
struc=$7d000
rastport=struc+100
setupsystem:
jsr getgfx
jsr cleanitdown
move.w #8000-1 ,d0
move.l #scr ,a0
slet: move.b #0 ,(a0)+
dbra d0 ,slet
move.l #scr ,a0
move.l a0 ,struc+8
move.l #struc ,a0
moveq #1 ,d0
move.l #320 ,d1
move.l #200 ,d2
move.l gfxbase ,a6
jsr -390(a6)
move.l #rastport ,a1
jsr -198(a6)
move.l #struc,rastport+4
move.l #copper0,newcop
jsr changecop
;--DEMO
move=-240
draw=-246
even
setapen=-342
move.l #rastport,a1
;/////// my demo!!! ///////
clr.l d0
clr.l d1
move.l #coords,a2
line:
moveq #10,d0
warte:
cmpi.b #255,$dff006
bne line
dbra d0,warte
btst #6,$bfe001
beq stoproutine
move.b (a2)+,d0
move.b (a2)+,d1
cmpi.b #222,d1
bne cntlp1
addi.l #2,a2
jmp ndlp
cntlp1:
jsr move(a6)
move.b (a2)+,d0
move.b (a2)+,d1
jsr draw(a6)
cmp.l #end,a2
bne line
ndlp:
subi.l #4,a2
jmp line
;/////// my demo's over. //
copper0:dc.w $0100,$1200
dc.w $008e,$2c81
dc.w $0090,$f4c1
dc.w $0092,$38
dc.w $0094,$d0
dc.w $0108,$0000
dc.w $010a,$0000
dc.w $00e0,$0007
dc.w $00e2,$a000
dc.w $0180,$bbb
dc.w $0182,$00f
dc.w $2c01,$ff00,$180,$ddd
dc.w $2d01,$ff00,$180,$fff
dc.w $2e01,$ff00,$180,$ddd
dc.w $2f01,$ff00,$180,$bbb
dc.w $f101,$ff00,$180,$999
dc.w $f201,$ff00,$180,$777
dc.w $f301,$ff00,$180,$888
dc.w $f401,$ff00,$180,$bbb
dc.w $ffff,$fffe
;*** gfx ***
gfxbase: dc.l 0
gfxname: dc.b 'graphics.library',0,0
getgfx:
move.l 4 ,a6
move.l #gfxname,a1
jsr -408(a6)
move.l d0 ,gfxbase
rts
;*** change copper list ***
newcop: dc.l 0
;***
changecop:
move.l gfxbase ,a0
move.l newcop ,50(a0)
rts
;*********
forbid =-132
oldcopper: dc.l 0
cleanitdown:
move.l 4,a6
jsr -132(a6)
rts
coords:
blk.b 560,0
end:
stoproutine:
rts
;move.l execbase,a6
;lea dosname(pc),a1
;jsr -96(a6)
;tst.l d0
;beq negative
;move.l d0,a0
;move.l 22(a0),a0
;moveq #0,d0
;send:
;rts
;negative:
;move.w #$ff,d0
;bra send
;dosname: dc.b 'dos.library',0
nd: dc.b 'Svein Berge, 2920 LEIRA I VALDRES, NORWAY'
screen:
blk.b 8000,0