home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
programs
/
graphics
/
animtools
/
videotrackerdev
/
source.lha
/
source
/
Scroll.s
< prev
next >
Wrap
Text File
|
1995-02-10
|
57KB
|
2,973 lines
rout ;when this is off, the routine-file will be
;assembled, on=testing
;debug ;when this is on, colors in the background will
;show how much time the routine needs.
routinemode equ $0002 ;the routinemode !
; the first part of the source handles the things that are necessary to
; show the picture/copper and playing of the routine.
; the part between the "***" lines is the routine-source.
; at the bottom of the file, there are the necessary incbin-files who
; are needed to test the routine.
; these are saved with "save effect" in videotracker. they are raw
; data files which can be fonts,pictures,landscapes,vectorobjects
; etcetra.
; the incbin-files are put in the "variables" table, in the routine-
; player-handler
; the place where it's done can be found by searching for "!!!"
opt a+ ;devpac 3 optimize
opt o+
ifd rout
;videotracker routine-test
incdir "videotracker:include/"
include "exec/types.i"
include "graphics/gfxbase.i"
include "lvo/graphics_lib.i"
incdir 'videotracker:effect/'
vew_wid equ 44
vew_hgt equ 290
win_hgt equ 117
win_str equ $1a
SECTION 1,CODE_C
tus
lea var,a0 ;communication-table
move.l #rotincfon,var_fon1(a0) ;incbinfile !!!
move.l #rotincfon,4+var_fon1(a0) ;incbinfile !!!
move.l #rotinctxt,var_txt1(a0) ;incbinfile !!!
move.l ($4).w,a6
sub.l a1,a1
jsr -$126(a6) ;findtask
move.l d0,curtsk
move.l d0,a0
move.l $b8(a0),tskpri
lea dosnam,a1 ;doslib openen
moveq.l #0,d0
move.l (4).w,a6
jsr -408(a6) ;openlib
move.l d0,doslib
bsr.s label5 ;videotracker opstarten
move.l curtsk,a0
move.l tskpri,$b8(a0)
move.l ($4).w,a6
jsr -$84(a6) ;forbid
move.l doslib,a1
move.l (4).w,a6
jsr -414(a6) ;closelib
moveq.l #0,d0
rts
label5
move.l (4).w,a6 ;workbench gedoe
move.b 530(a6),ntscmode ;50/60 hertz halen
cmp.b #50,ntscmode ;ntsc ?
beq.s str.ntsc
move.l #vew_hgt-56,hogscr ;set NTSC screen hight
str.ntsc
move.l (4).w,a6 ;68030 cache off
jsr -120(a6)
btst.b #1,297(a6)
beq.s str.nfc
lea.l str.ft,a5
jsr -30(a6)
str.nfc
jsr -126(a6)
bra.s str.fc
str.ft
dc.w $4e7a,2
bclr #0,d0
bset #13,d0
dc.w $4e7b,2
rte
str.fc
lea cprjmp,a2 ;copjmp zetten !
move.l #cprbck-8,d0
move.w d0,6(a2)
swap d0
move.w d0,2(a2)
lea cprbck-8,a2 ;copstr zetten !
move.l #cpr,d0
move.w d0,6(a2)
swap d0
move.w d0,2(a2)
bsr cprsprrem ;sprites legen
lea gfxnam,a1 ;graphics lib openen
move.l (4).w,a6
jsr -408(a6) ;openlib
move.l d0,a6
move.l d0,gfxlib
move.l 38(a6),oldcprlist
bset #1,$bfe001
bsr copbuf ;copper vullen
bsr sysoff
gadrun
btst #6,($bfe001).l
bne gadrun
scrend
scrend.play
bsr syson
move.l gfxlib,a1
move.l (4).w,a6
jsr -414(a6) ;closelib
scrend.qb
moveq.l #0,d0
rts
;vertical blank interrupt, no blits.
;handles counters,interlace,sprite
;level 3
intvb
bra.s intvb.cnt
dc.l 'VIDU'
dc.l 'LOOP'
intvb.cnt
movem.l d0-d7/a0-a6,-(sp)
lea ($dff000).l,a6
move.w $01e(a6),d0
btst #5,d0 ;vblank ?
bne.s intvb.vb
bra.s intcop.end
intvb.vb
bsr grap
bsr palctr ;palette zetten
bsr.s copbuf ;copper vullen
intvb.end
move.w #$0020,$09c(a6) ;vb bit wissen
movem.l (sp)+,d0-d7/a0-a6 ;multitask uit, shit !
rte
intcop.end
movem.l (sp)+,d0-d7/a0-a6
move.l intvbold,-(sp)
rts
;transmission buffer empty routine, BLIT !
;handles routines,animations
inttbe ;tbe interrupt
movem.l d0-d7/a0-a6,-(sp)
lea ($dff000).l,a6
move.w $01e(a6),d0
btst #0,d0 ;no tbe ?
beq.s intdskblk
btst #6,($bfe001).l ;muis ingedrukt ?
beq.s inttbe.cop
btst #2,($dff016).l
beq.s inttbe.cop
ifd debug
move.w #$700,$dff180
endc
bsr rotply ;routineplayer BLIT !
bsr.s copbuf ;copper vullen
ifd debug
move.w #$070,$dff180
endc
inttbe.cop
inttbe.end
move.w #$0001,$09c(a6)
movem.l (sp)+,d0-d7/a0-a6
rte
intdskblk
move.w #$0001,$09c(a6) ;be sure for no tbe handling
movem.l (sp)+,d0-d7/a0-a6
move.l inttbeold,-(sp)
rts
;moves the copperbuffer to the copperlist
;sort of double buffering
copbuf
movem.l d0-d7/a0-a6,-(sp)
lea ($dff000).l,a6
copbuf.novb ;copperchange overslaan
moveq.l #0,d0
move.b $005(a6),d0
lsl.w #8,d0
moveq.l #0,d1
move.b $006(a6),d1
add.w d1,d0
cmp.w #$4,d0
blt copbuf.novb
cmp.b #50,ntscmode
beq.s copbuf.pal
cmp.w #$133-56-8,d0 ;ntsc grens
bge copbuf.novb
bra.s copbuf.cont
copbuf.pal
cmp.w #$133-8,d0 ;pal grens
bge copbuf.novb
copbuf.cont
lea gra.s,a0 ;buffer copieren
lea cprbuf,a1
move.w 00*4+2(a0),00*4+2(a1)
move.w 01*4+2(a0),01*4+2(a1)
move.w 02*4+2(a0),02*4+2(a1)
move.w 03*4+2(a0),03*4+2(a1)
move.w 04*4+2(a0),04*4+2(a1)
move.w 05*4+2(a0),05*4+2(a1)
move.w 06*4+2(a0),06*4+2(a1)
move.w 07*4+2(a0),07*4+2(a1)
move.w 08*4+2(a0),08*4+2(a1)
move.w 09*4+2(a0),09*4+2(a1)
move.w 10*4+2(a0),10*4+2(a1)
move.w 11*4+2(a0),11*4+2(a1)
move.w 12*4+2(a0),12*4+2(a1)
move.w 13*4+2(a0),13*4+2(a1)
move.w 14*4+2(a0),14*4+2(a1)
move.w 15*4+2(a0),15*4+2(a1)
move.w 16*4+2(a0),16*4+2(a1)
move.w 17*4+2(a0),17*4+2(a1)
move.w 18*4+2(a0),18*4+2(a1)
move.w 19*4+2(a0),19*4+2(a1)
move.w 20*4+2(a0),20*4+2(a1)
move.w 21*4+2(a0),21*4+2(a1)
move.w 22*4+2(a0),22*4+2(a1)
move.w 23*4+2(a0),23*4+2(a1)
move.w 24*4+2(a0),24*4+2(a1)
move.w 25*4+2(a0),25*4+2(a1)
move.w 26*4+2(a0),26*4+2(a1)
move.w 27*4+2(a0),27*4+2(a1)
move.w 28*4+2(a0),28*4+2(a1)
move.w 29*4+2(a0),29*4+2(a1)
move.w 30*4+2(a0),30*4+2(a1)
move.w 31*4+2(a0),31*4+2(a1)
move.w 32*4+2(a0),32*4+2(a1)
move.w 33*4+2(a0),33*4+2(a1)
move.w 34*4+2(a0),34*4+2(a1)
move.w 35*4+2(a0),35*4+2(a1)
move.w 36*4+2(a0),36*4+2(a1)
move.w 37*4+2(a0),37*4+2(a1)
move.w 38*4+2(a0),38*4+2(a1)
move.w 39*4+2(a0),39*4+2(a1)
move.w 40*4+2(a0),40*4+2(a1)
move.w 41*4+2(a0),41*4+2(a1)
move.w 42*4+2(a0),42*4+2(a1)
move.w 43*4+2(a0),43*4+2(a1)
move.w 44*4+2(a0),44*4+2(a1)
move.w 45*4+2(a0),45*4+2(a1)
move.w 46*4+2(a0),46*4+2(a1)
move.w 47*4+2(a0),47*4+2(a1)
move.w 48*4+2(a0),48*4+2(a1)
move.w 49*4+2(a0),49*4+2(a1)
move.w 50*4+2(a0),50*4+2(a1)
move.w 51*4+2(a0),51*4+2(a1)
move.w 52*4+2(a0),52*4+2(a1)
move.w 53*4+2(a0),53*4+2(a1)
move.w 54*4+2(a0),54*4+2(a1)
copbuf.end
movem.l (sp)+,d0-d7/a0-a6
rts
;goes back to the workbench
syson
movem.l d0-d7/a0-a6,-(sp)
move.w #$0001,$dff09a ;tbeint uit
move.l intvbold,($6c).w
move.l inttbeold,($64).w
move.l 4,a6
jsr -138(a6) ;permit
move.l gfxlib,a6
jsr -462(a6) ;disownblitter
move.l wbview,a1
move.l gfxlib,a6
jsr _LVOLoadView(a6) ; Fix view
jsr _LVOWaitTOF(a6)
jsr _LVOWaitTOF(a6) ; wait for LoadView()
syson.ras
cmp.b #$c0,$dff006 ;prevent copperjump
bne syson.ras
move.l gfxlib,a6
move.l gb_copinit(a6),$dff080 ; Kick it into life
movem.l (sp)+,d0-d7/a0-a6
rts
;goes back to the gadgetscreen
sysoff
movem.l d0-d7/a0-a6,-(sp)
move.l gfxlib,a6
move.l gb_ActiView(a6),wbview ;current view
sub.l a1,a1 ; clear a1
jsr _LVOLoadView(a6) ; Flush View to nothing
jsr _LVOWaitTOF(a6) ; Wait once
jsr _LVOWaitTOF(a6) ; Wait again.
move.l gfxlib,a6
jsr -456(a6) ;ownblitter
move.l 4,a6
jsr -132(a6) ;forbid
move.l ($6c).w,intvbold
move.l #intvb,($6c).w
move.l ($64).w,inttbeold
move.l #inttbe,($64).w
move.w #$8001,$dff09a ;tbeint aan
bsr gracpr ;reset copper
bsr copbuf ;copy copper
move.l #cpr,$dff080
movem.l (sp)+,d0-d7/a0-a6
rts
cprsprrem
movem.l d0-d7/a0-a6,-(sp)
lea cprspr,a0
move.l #sprdat,d0
move.w #7,d1
cprsprrem.a
move.w d0,3*2(a0)
swap d0
move.w d0,1*2(a0)
swap d0
add.l #8,a0
dbra d1,cprsprrem.a
movem.l (sp)+,d0-d7/a0-a6
rts
varset ;variablen neerzetten
movem.l d0-d7/a0-a6,-(sp)
move.l #var,a0
move.l #cprbck,var_cprbck(a0)
move.l gfxlib,var__GfxBase(a0)
move.b ntscmode,var_ntsc(a0)
move.l curpic1,var_pic1(a0) ;variabel
move.l curpic2,var_pic2(a0) ;variabel
move.w anispd1,var_anispd1(a0)
move.w anitel1,var_anitel1(a0)
movem.l (sp)+,d0-d7/a0-a6
rts
;this routine handles all videotracker-routines
rotply
movem.l d0-d7/a0-a6,-(sp)
moveq.l #0,d0
lea currot1,a2 ;routine 1
move.w rotinf1,d0 ;routine info
bsr.s rotplyr
rotply.end
movem.l (sp)+,d0-d7/a0-a6
rts
;this routine handles 1 routine, BLIT !
rotplyr
movem.l d0-d7/a1-a6,-(sp)
move.l #rot,(a2) ;routinestart address
move.b #50,ntscmode ;ntsc/pal hz
clr.l curpic2 ;background picture
move.w #1,anispd1 ;animationspeed
clr.w anitel1 ;animation position
lea var,a0 ;communication-table
move.l #routinemode,d0 ;routinemode !!!
sub.l a0,a0 ;picture info legen
tst.l (a2) ;is er een routine ?
beq rotplyr.end ;interlace handling
move.l intdel,d2 ;delay
move.l inttel,d1 ;teller
cmp.w d2,d1
blt rotplyr.end
clr.l inttel
bsr varset ;variabelen updaten
move.l (a2),a1 ;routine halen
move.l #var,a0 ;variablen tabel
movem.l d3-d7/a1-a6,-(sp)
moveq.l #0,d1 ;vars wissen
moveq.l #0,d2
moveq.l #0,d3
moveq.l #0,d4
moveq.l #0,d5
moveq.l #0,d6
moveq.l #0,d7
sub.l a2,a2
sub.l a3,a3
sub.l a4,a4
sub.l a5,a5
jsr 4(a1) ;routine afwerken
movem.l (sp)+,d3-d7/a1-a6
;Routine:
;
;Input:
;a0=variabelentabel
;d0=routinemode
;
;Output:
;a0=picture
;d1=copperlist
;d2=interruptdelay (NOT used till now)
move.w #$0020,$dff09a ;vb off !
move.l d2,intdel ;delay
lea cprjmp,a3
move.l #cprbck-8,d0
cmp.l (a2),a1 ;routine ondertussen gewipt ?
bne.s rotplyr.nocop
tst.l d1 ;copperlist ?
beq.s rotplyr.nocop
move.l d1,d0
rotplyr.nocop
move.w d0,6(a3)
swap d0
move.w d0,2(a3)
cmp.l #0,a0 ;picture ?
beq.s rotplyr.endvb
move.l a0,curpic1 ;current picture (cycle)
move.l a0,curpal1 ;current palette
tst.b rotdpl ;plane is geleverd
beq.s rotplyr.set
clr.b rotdpl
clr.l cycdel1 ;cycle info wissen
clr.l 4+cycdel1
clr.l curfrm1 ;curfrm1, altijd planes zetten
rotplyr.set
clr.b dplctr
bsr.s grap
bsr grac ;colorset
rotplyr.endvb
move.w #$8020,$dff09a
rotplyr.end
movem.l (sp)+,d0-d7/a1-a6
rts
;removes possible routine-coppers
gracpr
movem.l d0-d7/a0-a6,-(sp)
lea cprjmp,a3
move.l #cprbck-8,d0 ;copperlist resetten
move.w d0,6(a3)
swap d0
move.w d0,2(a3)
movem.l (sp)+,d0-d7/a0-a6
rts
;picture-to-copper routine, communicates with the
;anim-player
grap ;d7=anim
movem.l d0-d7/a0-a6,-(sp)
clr.l d7
tst.l curpic1 ;current picture ?
beq grap.end
move.l curpic1,a2 ;normal pic halen
lea gracprscr,a1 ;window neerzetten
move.l hogscr,d1
move.w pic_hgt(a2),d3 ;pic hoogte
move.w pic_vew(a2),d5
btst #2,d5 ;interlace ?
beq.s grap.nohi4
lsr.w #1,d3 ;/2
grap.nohi4
cmp.w d3,d1
bge.s grap.hog
move.w d1,d3
grap.hog
sub.w d3,d1
lsr.w #1,d1
add.w #win_str,d1
move.w d1,d2
add.w d3,d2
move.b d1,2(a1) ;y start
move.b d2,6(a1) ;y end
move.w pic_wid(a2),d4 ;pic breedte in bytes
lsl.l #3,d4
move.l #vew_wid*8,d0
move.l #0,d1
move.l #$71,d6
move.w pic_vew(a2),d5
btst #15,d5 ;hires ?
beq.s grap.nohi2
move.l #(vew_wid-4)*8*2,d0
move.l #1,d1
move.l #$81,d6
cmp.w #80,pic_wid(a2) ;overscan ?
ble.s grap.nohi2
move.l #(vew_wid)*8*2,d0
move.l #$61,d6
grap.nohi2
btst #6,d5 ;super hires ?
beq.s grap.noshi2
move.l #(vew_wid-4)*8*4,d0
move.l #2,d1
move.l #$81,d6
cmp.w #80*2,pic_wid(a2) ;overscan ?
ble.s grap.noshi2
move.l #(vew_wid)*8*4,d0
move.l #$61,d6
grap.noshi2
clr.w d5
cmp.w d0,d4 ;breeder dan scherm ?
ble.s grap.c
move.w d4,d5
move.w d0,d4
sub.w d0,d5 ;modulo
lsr.w #3,d5 ;/8
grap.c
lsr.w d1,d0
lsr.w d1,d4
move.w d0,d2
sub.w d4,d2
lsr.w #1,d2 ;/2
add.w d6,d2
move.b d2,3(a1) ;x start
move.w d2,d3 ;d3 bewaren !
add.w d4,d2 ;d4 bewaren !
move.b d2,7(a1) ;x end
move.w pic_vew(a2),d6
btst #15,d6 ;hires ?
beq.s grap.nohi5
add.l d4,d4 ;*2
grap.nohi5
btst #6,d6 ;super hires ?
beq.s grap.noshi5
add.l d4,d4 ;*4
grap.noshi5
move.l d7,-(sp)
move.w pic_vew(a2),d6
move.l #17,d0
move.l #1,d1
move.l #3,d7
btst #15,d6 ;hires ?
beq.s grap.nohi3
move.l #9,d0
move.l #2,d1
move.l #2,d7
grap.nohi3
btst #6,d6 ;super hires ?
beq.s grap.noshi3
move.l #9,d0
move.l #2,d1
move.l #1,d7
grap.noshi3
sub.w d0,d3
lsr.w #1,d3
move.w d3,10(a1) ;ddfstrt
move.w d4,d2 ;pic breedte in pixels
lsr.w #4,d2 ;/16
sub.w d1,d2 ;-1
lsl.w d7,d2 ;*8
add.w d2,d3
move.w d3,14(a1) ;ddfstop
move.l (sp)+,d7
lea pic_raw(a2),a0
moveq.l #0,d2
move.w pic_dpt(a2),d2
sub.l #1,d2
muls pic_wid(a2),d2
add.w d2,d5
move.w pic_vew(a2),d2 ;viewmode add
btst #2,d2
beq.s grap.nolace4
moveq.l #0,d2
move.w pic_dpt(a2),d2
muls pic_wid(a2),d2
add.w d2,d5 ;interlace gedoe
grap.nolace4
lea gracprbpl,a4 ;iffpln neerzetten
lea gracprpln,a0 ;iffpln neerzetten
moveq.l #0,d2
move.w pic_dpt(a2),d2 ;plnnummer 1 halen
move.l #8,d6 ;copper step !
tst.l curpic2 ;2de picture ?
bne.s grap.pic2
grap.nopic2
move.w d5,34(a1) ;modulo oneven zetten
bra grap.nodpl
grap.pic2
move.l curpic2,a3 ;oneven plane
move.l currot2,a5 ;oneven plane
clr.l curpic2 ;mischien niet goed
clr.l curpal2 ;mischien niet goed
clr.l currot2 ;mischien niet goed
cmp.l curpic1,a3 ;picture hetzelfde ?
beq grap.nopic2
cmp.l #0,currot1 ;routine ?
beq.s grap.norot
cmp.l currot1,a5 ;routine hetzelfde ?
beq grap.nopic2
grap.norot
cmp.b #3,d2 ;> 8 kleuren ?
bgt grap.nopic2
move.w pic_dpt(a3),d3 ;plnnummer 2 halen
cmp.b d2,d3 ;gelijke plnummers ?
bne grap.nopic2
move.w pic_vew(a2),d1
cmp.w pic_vew(a3),d1 ;view gelijk ?
bne grap.nopic2
move.w pic_vew(a2),d1 ;groter dan view test
btst #6,d1 ;super hires ?
beq.s grap.nohi2a
move.l #vew_wid*4,d1
bra.s grap.nohi2b
grap.nohi2a
btst #15,d1 ;hires ?
beq.s grap.noshi2a
move.l #vew_wid*2,d1
bra.s grap.nohi2b
grap.noshi2a
move.l #vew_wid,d1
grap.nohi2b
cmp.w pic_wid(a2),d1 ;breder dan view ?
bgt.s grap.small
cmp.w pic_wid(a3),d1 ;breder dan view ?
bgt.s grap.small
move.w pic_vew(a2),d1
btst #2,d1
beq.s grap.nolace8a
move.l hogscr,d1
add.l d1,d1
bra.s grap.nolace8b
grap.nolace8a
move.l hogscr,d1
grap.nolace8b
cmp.w pic_hgt(a2),d1 ;hoger dan view ?
bgt.s grap.small
cmp.w pic_hgt(a3),d1 ;hoger dan view ?
bgt.s grap.small
bra.s grap.big
grap.small
move.w pic_hgt(a2),d1 ;wid+hgt<vew
cmp.w pic_hgt(a3),d1 ;hoogte gelijk ?
bne grap.nopic2
move.w pic_wid(a2),d1
cmp.w pic_wid(a3),d1 ;breedte gelijk ?
bne grap.nopic2
grap.big
move.l a3,curpic2
move.l a3,curpal2
move.l a5,currot2
tst.b dplctr ;double playfield al gezet ?
beq.s grap.nocop
move.w 30(a1),34(a1) ;modulo copieren
move.w 2(a4),d1 ;bplcon0
btst #10,d1 ;al double playfield ?
beq.s grap.ta
move.w 2(a0),10(a0) ;plane 0>1 copieren
move.w 6(a0),14(a0)
move.w 18(a0),26(a0) ;plane 2>3 copieren
move.w 22(a0),30(a0)
move.w 34(a0),42(a0) ;plane 4>5 copieren
move.w 38(a0),46(a0)
bra.s grap.tb
grap.ta
move.w 18(a0),42(a0) ;plane 2>5 copieren
move.w 22(a0),46(a0)
move.w 10(a0),26(a0) ;plane 1>3 copieren
move.w 14(a0),30(a0)
move.w 2(a0),10(a0) ;plane 0>1 copieren
move.w 6(a0),14(a0)
grap.tb
move.l #palette,a3 ;palette copieren
move.w #8-1,d1
grap.pal
move.w (a3)+,14(a3)
dbra d1,grap.pal
grap.nocop
add.w d3,d2
lsl.w #8,d2
lsl.w #4,d2
or.w #$400,d2
move.w d2,2(a4) ;bplcon0
movem.l d0-d7/a0-a6,-(sp)
move.l curpic,a2 ;animpic ?
move.l curfrm,d7
cmp.l #0,a2
bne.s grap.noanipic
move.l curpic2,a2 ;normal pic ?
move.l curfrm2,d7
cmp.l #0,a2
beq.s grap.nodplpic
grap.noanipic
add.l d6,a0
add.w d6,d6
bsr.s grappln ;a2,d6,d7,d0
grap.nodplpic
movem.l (sp)+,d0-d7/a0-a6
add.w d6,d6
bra.s grap.nodpla
grap.nodpl ;geen double playfield
lsl.w #8,d2
lsl.w #4,d2
move.w d2,2(a4) ;bplcon0
grap.nodpla
move.w d5,30(a1) ;modulo even
moveq.l #0,d3
add.w pic_vew(a2),d3 ;viewmode add
moveq.l #0,d2
move.w 2(a4),d2
or.l d3,d2
or.l #$300,d2 ;genlock info
move.w d2,2(a4)
bsr.s grappln ;a2,d6,d7,d0
grap.end
movem.l (sp)+,d0-d7/a0-a6
rts
;sets on of the 2 possible pictures to the copper
;handles interlace
;d7=framenummer
;d6=copperliststap
;d0=raw planes positie
;a2=current picture
grappln ;planes invullen
movem.l d0-d7/a0-a6,-(sp)
lea pic_raw(a2),a1
move.l a1,d0 ;raw planes
moveq.l #0,d2 ;x*y
move.w pic_wid(a2),d2
lsr.l #1,d2 ;/2
moveq.l #0,d3
move.w pic_hgt(a2),d3
muls d3,d2
move.l d2,d4
add.l d2,d2
move.w pic_dpt(a2),d3
muls d3,d4 ;hele picture size
muls d7,d4 ;frame*size d7 !
add.l d4,d4
add.l d4,d0
move.l #vew_wid,d5 ;max x view
move.l hogscr,d4 ;max y view
move.w pic_vew(a2),d1 ;viewmode add
btst #2,d1
beq.s grappln.nolace
add.l d4,d4 ;max y view
grappln.nolace
btst #15,d1 ;hires ?
beq.s grappln.nohi
move.l #vew_wid*2,d5 ;max x view
grappln.nohi
btst #6,d1 ;super hires ?
beq.s grappln.noshi
move.l #vew_wid*4,d5 ;max x view
grappln.noshi
moveq.l #0,d3 ;scherm centreren
move.w pic_wid(a2),d3 ;pic breedte in bytes
cmp.w d5,d3 ;breder dan scherm ?
ble.s grappln.qa
sub.w d5,d3 ;-scherm breedte
lsr.w #2,d3 ;/4
add.l d3,d3
add.l d3,d0
grappln.qa
move.w pic_hgt(a2),d3 ;pic hoogte in bytes
cmp.w d4,d3 ;hoger dan scherm ?
ble.s grappln.qb
sub.w d4,d3 ;-scherm breedte
lsr.w #1,d3 ;/2
moveq.l #0,d5
move.w pic_wid(a2),d5 ;pic breedte in bytes
muls pic_dpt(a2),d5
muls d5,d3
add.l d3,d0
grappln.qb
moveq.l #0,d2
move.w pic_wid(a2),d2
move.w pic_vew(a2),d5 ;interlace flipping ?
btst #2,d5
beq.s grappln.nolac7b
move.w $04(a6),d5 ;even/oneven ?
btst #15,d5
beq.s grappln.nolac7b
moveq.l #0,d3
move.w pic_wid(a2),d3
muls pic_dpt(a2),d3
add.l d3,d0
grappln.nolac7b
move.w pic_dpt(a2),d1 ;plnnummer 1 halen
tst.w d1 ;0 planes ?
beq.s grappln.end
sub.w #1,d1
grappln.a
move.w d0,3*2(a0)
swap d0
move.w d0,1*2(a0)
swap d0
add.l d6,a0 ;d6=copper step !
add.l d2,d0
dbra d1,grappln.a
grappln.end
movem.l (sp)+,d0-d7/a0-a6
rts
;sets palettes to copper
grac
movem.l d0-d7/a0-a6,-(sp)
lea curpal1,a3 ;palette 1
move.l #palette,a1
bsr.s gracfrm
lea curpal2,a3 ;palette 2 (dpl)
move.l #8*2+palette,a1
bsr.s gracfrm
bsr.s palctr ;palette-buffer to copper
grac.end
movem.l (sp)+,d0-d7/a0-a6
rts
;moves palette from picture to palette-buffer
gracfrm
movem.l d0-d7/a0-a6,-(sp)
tst.l (a3) ;palette aanwezig ?
beq.s gracfrm.end
move.l (a3),a2 ;current palette
cmp.l #'PALE',(a2) ;palette ?
bne.s gracfrm.pict
lea 6(a2),a0 ;palette
move.w 4(a2),d0 ;aantal kleuren
bra.s gracfrm.col
gracfrm.pict
cmp.l #'ANIM',(a2) ;animatie ?
bne.s gracfrm.noanim
moveq.l #0,d1
move.w pic_ani(a2),d1
bclr #7,d1 ;behandelbit weghalen
moveq.l #0,d3
move.w pic_wid(a2),d3
lsr.w #1,d3 ;/2
muls pic_hgt(a2),d3
muls pic_dpt(a2),d3
add.l d3,d3
add.l #pic_raw,d3
move.l d3,d5
btst #0,d1
bne.s gracfrm.buf2
moveq.l #0,d5
gracfrm.buf2
add.l d5,a2
gracfrm.noanim
lea pic_pal(a2),a0 ;palette
move.w pic_palnum(a2),d0
cmp.w #32-1,d0 ;niet meer dan 32 kleuren
ble gracfrm.sub
move.w #32-1,d0
gracfrm.sub
tst.w d0 ;0 planes ?
beq.s gracfrm.end
gracfrm.col
gracfrm.fa
move.w (a0)+,(a1)+
dbra d0,gracfrm.fa
gracfrm.end
movem.l (sp)+,d0-d7/a0-a6
rts
;handles colorcycling in the palette-buffer
;and copies palette-buffer to copper
palctr
movem.l d0-d7/a0-a6,-(sp)
move.l curpic1,a2 ;current raw
cmp.l #0,a2
beq.s palctr.qb
lea cycdel1,a3 ;cycle delays
move.l #palette,a4
bsr palcyc
palctr.qb
move.l curpic2,a2 ;current raw
cmp.l #0,a2
beq.s palctr.c
lea cycdel2,a3 ;cycle delays
move.l #8*2+palette,a4
bsr palcyc
palctr.c
lea gracprcol,a1
move.l #palette,a0
move.w 00(a0),00*4+2(a1)
move.w 02(a0),01*4+2(a1)
move.w 04(a0),02*4+2(a1)
move.w 06(a0),03*4+2(a1)
move.w 08(a0),04*4+2(a1)
move.w 10(a0),05*4+2(a1)
move.w 12(a0),06*4+2(a1)
move.w 14(a0),07*4+2(a1)
move.w 16(a0),08*4+2(a1)
move.w 18(a0),09*4+2(a1)
move.w 20(a0),10*4+2(a1)
move.w 22(a0),11*4+2(a1)
move.w 24(a0),12*4+2(a1)
move.w 26(a0),13*4+2(a1)
move.w 28(a0),14*4+2(a1)
move.w 30(a0),15*4+2(a1)
move.w 32(a0),16*4+2(a1)
move.w 34(a0),17*4+2(a1)
move.w 36(a0),18*4+2(a1)
move.w 38(a0),19*4+2(a1)
move.w 40(a0),20*4+2(a1)
move.w 42(a0),21*4+2(a1)
move.w 44(a0),22*4+2(a1)
move.w 46(a0),23*4+2(a1)
move.w 48(a0),24*4+2(a1)
move.w 50(a0),25*4+2(a1)
move.w 52(a0),26*4+2(a1)
move.w 54(a0),27*4+2(a1)
move.w 56(a0),28*4+2(a1)
move.w 58(a0),29*4+2(a1)
move.w 60(a0),30*4+2(a1)
move.w 62(a0),31*4+2(a1)
movem.l (sp)+,d0-d7/a0-a6
rts
;colorcyclinghandling of a palette
palcyc
movem.l d0-d7/a0-a6,-(sp)
move.w #4-1,d7 ;4 cycles
palcyc.d
tst.w (a3)+ ;delay klaar ?
bne.s palcyc.c
moveq.l #0,d1
move.b pic_cycstr(a2),d1 ;start color
lsl.b #1,d1 ;*2
moveq.l #0,d2
move.b pic_cycend(a2),d2 ;end color
lsl.b #1,d2 ;*2
moveq.l #0,d3
move.b pic_cycadd(a2),d3 ;richting
move.l a4,a0 ;palette pointer
move.l a0,a1
add.l d1,a0 ;startcolor
add.l d2,a1 ;endcolor
cmp.b #1,d3 ;omhoog
beq.s palcyc.up
cmp.b #3,d3 ;omlaag
beq.s palcyc.down
bra.s palcyc.i
palcyc.up ;kleuren copieren
move.w (a1),d4 ;laatst color bewaren
palcyc.f ;kleuren copieren
cmp.l a0,a1
beq.s palcyc.fa
move.w -(a1),2(a1)
bra palcyc.f
palcyc.fa
move.w d4,(a1)
bra.s palcyc.g
palcyc.down
move.w (a0),d4 ;laatst color bewaren
palcyc.h ;kleuren copieren
cmp.l a0,a1
beq.s palcyc.ha
move.w 2(a0),(a0)+
bra palcyc.h
palcyc.ha
move.w d4,(a1)
palcyc.g
move.b pic_cycspd(a2),-1(a3) ;delay zetten
bra.s palcyc.i
palcyc.c
sub.w #1,-2(a3) ;cycle delay aftellen
palcyc.i
add.l #4,a2 ;next cycle info
dbra d7,palcyc.d
palcyc.qb
movem.l (sp)+,d0-d7/a0-a6
rts
; SECTION variabelen,DATA_c
cnop 0,2
curtsk dc.l 0
tskpri dc.l 0
duplok dc.l 0
inttel dc.l 0
intdel dc.l 0
form dc.l 0
ifffil dc.l 0
intvbold dc.l 0
inttbeold dc.l 0
patpos dc.l 0
gfxlib dc.l 0
doslib dc.l 0
wbview dc.l 0
mt_data dc.l 0
memvid dc.l 0
oldcprlist dc.l 0
hogscr dc.l vew_hgt
inspos dc.l -1
anispd1 dc.w 1 ;nooit op 0 !
anispd2 dc.w 1
cnop 0,2
varclr.s ;start wissen
oldrot dc.l 0
curpic dc.l 0
curfrm dc.l 0
cycdel1 ds.w 4
cycdel2 ds.w 4
rotinf1 dc.w 0
rotinf2 dc.w 0
effspd dc.w 0
efflop dc.b 0
anilop1 dc.b 0
anilop2 dc.b 0
anipal1 dc.b 0
anipal2 dc.b 0
rotdpl dc.b 1
dplctr dc.b 0
cnop 0,2
insdat ds.l 4
inspri dc.l 0
instel dc.w 0
cureff dc.l 0
efftel dc.w 0
curpal1 dc.l 0
curpal2 dc.l 0
currot1 dc.l 0
currot2 dc.l 0
curpic1 dc.l 0
curpic2 dc.l 0
anitel1 dc.w 0
anitel2 dc.w 0
curfrm1 dc.l 0
curfrm2 dc.l 0
oldfrm1 dc.l 0
oldfrm2 dc.l 0
varclr.e
dc.l 0 ;wisruimte
varclr.ql equ varclr.e-varclr.s ;wislengte
;ownblit dc.b 0
ntscmode dc.b 0
end dc.b 0
pronam dc.b 'VideoTracker',0
cnop 0,2
dosnam dc.b 'dos.library',0
cnop 0,4
gfxnam dc.b 'graphics.library',0
cnop 0,4
cnop 0,4
gra.s
gracprscr
dc.w $8e,$3381,$90,$81c1,$92,$003c,$94,$00d0
gracprbpl
dc.w $100,$9000,$102,$0000,$104,$0020
dc.w $108,$0000,$10a,$0000
gracprpln
dc.w $e0,$0000,$e2,$0000
dc.w $e4,$0000,$e6,$0000
dc.w $e8,$0000,$ea,$0000
dc.w $ec,$0000,$ee,$0000
dc.w $f0,$0000,$f2,$0000
dc.w $f4,$0000,$f6,$0000
gracprcol
dc.w $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
dc.w $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
dc.w $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
dc.w $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
cprjmp
dc.w $080,0,$082,0
gra.e
gra.ql equ gra.e-gra.s ;block lengte
cpr
dc.w $0001,$fffe
dc.w $09c,$8001 ;tbeint
cprspr
dc.w $120,$0000,$122,$0000
dc.w $124,$0000,$126,$0000
dc.w $128,$0000,$12a,$0000
dc.w $12c,$0000,$12e,$0000
dc.w $130,$0000,$132,$0000
dc.w $134,$0000,$136,$0000
dc.w $138,$0000,$13a,$0000
dc.w $13c,$0000,$13e,$0000
cprbuf
dc.w $8e,$3381,$90,$81c1,$92,$003c,$94,$00d0
dc.w $100,$9000,$102,$0000,$104,$0020
dc.w $108,$0000,$10a,$0000
dc.w $e0,$0000,$e2,$0000
dc.w $e4,$0000,$e6,$0000
dc.w $e8,$0000,$ea,$0000
dc.w $ec,$0000,$ee,$0000
dc.w $f0,$0000,$f2,$0000
dc.w $f4,$0000,$f6,$0000
dc.w $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
dc.w $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
dc.w $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
dc.w $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
dc.w $080,0,$082,0
cprbuf.e
dc.w $088,$0000 ;copjmp2
dc.w $080,0,$082,0 ;moet achter cprbck blijven !
cprbck
sprdat
dc.w $ffff,$fffe
prf_pat equ 7 ;pref sample size
prf_patnum equ 128 ;aantal songpos's
prf_len equ ((prf_pat*prf_patnum)+1)
prf_pos equ 0 ;eff position (teller)
prf_effs equ 1 ;start effect (*prf_patnum)
prf_effe equ 2 ;end effect (*prf_patnum)
prf_pri equ 3 ;priority (*prf_patnum)
prf_spd equ 4 ;eff speed (*prf_patnum)
prf_ani equ 5 ;ani speed (*prf_patnum)
prf_roth equ 6 ;routine info (*prf_patnum)
prf_rotl equ 7 ;routine info (*prf_patnum)
eff_num equ 256 ;aantal effects
pic_wid equ 4 ;wide in bytes
pic_hgt equ 6 ;hoogte
pic_dpt equ 8 ;number planes
pic_ani equ 10 ;aantal effes (anim)
pic_vew equ 12 ;viewmode
pic_cycstr equ 14 ;cycle start (*4)
pic_cycend equ 15 ;cycle end (*4)
pic_cycspd equ 16 ;cycle speed (*4)
pic_cycadd equ 17 ;cycle add (*4)
pic_palnum equ 30 ;aantal kleuren
pic_pal equ 32 ;palette start
pic_palsiz equ 256*2 ;vaste palette size
pic_raw equ pic_pal+pic_palsiz ;palette start
fil_namlen equ 24 ;naamlengte
fil_len equ (fil_namlen+4+4) ;effect info length
fil_num equ 2+eff_num ;aantal files
fil_fil equ 0 ;file naam
fil_dir equ 24 ;pointer naar directory
fil_pnt equ 28 ;pointer naar meminfo
palette ds.w 64 ;palette
var_len equ $300 ;lengte vartabel
var__GfxBase equ $000 ;graphics lib
var_pic1 equ $004 ;current picture
var_anispd1 equ $008 ;animspeed
var_anitel1 equ $00c ;animspeed
var_cprbck equ $010 ;copperback
var_bck equ $014 ;background
var_pic2 equ $018 ;current picture
var_ntsc equ $01c ;ntsc/pal frequence
var_lnd equ $020 ;landscape
var_txt1 equ $040 ;text
var_txt16 equ 15*4+var_txt1
var_vec1 equ $080 ;vectors
var_vec16 equ 15*4+var_vec1
var_fon1 equ $0c0 ;fonts
var_fon16 equ 15*4+var_fon1
var_cols1 equ $100 ;colorsets
var_cols16 equ 15*4+var_cols1
var_obj1 equ $180 ;objects
var_obj16 equ 15*4+var_obj1
fon_hgt equ 4 ;font hoogte
fon_wid equ 8 ;plane breedte in bytes
fon_dpt equ 12 ;depth
fon_chrf equ 16 ;eerste character
fon_chrl equ 20 ;laatste character
fon_widtab equ 24 ;font breedte per char
fon_rawpos equ 256*2+fon_widtab ;start raw char position
fon_raw equ 256*4+fon_rawpos ;start raw planes
cnop 0,2
var ds.b $300 ;variabelen voor routines
; SECTION 10,CODE_C
endc
; this is the routine-source
;**********************************************************************
ifnd rout
pic_wid equ 4 ;wide in bytes
pic_hgt equ 6 ;hoogte
pic_dpt equ 8 ;number planes
pic_ani equ 10 ;aantal effes (anim)
pic_vew equ 12 ;viewmode
pic_cycstr equ 14 ;cycle start (*4)
pic_cycend equ 15 ;cycle end (*4)
pic_cycspd equ 16 ;cycle speed (*4)
pic_cycadd equ 17 ;cycle add (*4)
pic_palnum equ 30 ;aantal kleuren
pic_pal equ 32 ;palette start
pic_palsiz equ 256*2 ;vaste palette size
pic_raw equ pic_pal+pic_palsiz ;palette start
var_len equ $300 ;lengte vartabel
var__GfxBase equ $000 ;graphics lib
var_pic1 equ $004 ;current picture
var_anispd1 equ $008 ;animspeed
var_anitel1 equ $00c ;animspeed
var_cprbck equ $010 ;copperback
var_bck equ $014 ;background
var_pic2 equ $018 ;current picture
var_ntsc equ $01c ;ntsc/pal frequence
var_lnd equ $020 ;landscape
var_txt1 equ $040 ;text
var_txt16 equ 15*4+var_txt1
var_vec1 equ $080 ;vectors
var_vec16 equ 15*4+var_vec1
var_fon1 equ $0c0 ;fonts
var_fon16 equ 15*4+var_fon1
var_cols1 equ $100 ;colorsets
var_cols16 equ 15*4+var_cols1
var_obj1 equ $180 ;objects
var_obj16 equ 15*4+var_obj1
fon_hgt equ 4 ;font hoogte
fon_wid equ 8 ;plane breedte in bytes
fon_dpt equ 12 ;depth
fon_chrf equ 16 ;eerste character
fon_chrl equ 20 ;laatste character
fon_widtab equ 24 ;font breedte per char
fon_rawpos equ 256*2+fon_widtab ;start raw char position
fon_raw equ 256*4+fon_rawpos ;start raw planes
vew_wid equ 44
vew_hgt equ 290
win_hgt equ 117
win_str equ $1a
endc
; a0=variabelen tabel
; d0=routinfo
;rotbigscroll
;ntscver
rots_high equ 0;$8000
rots_lace equ 0;$0004
rots_vew equ rots_high+rots_lace
rots_dpt equ 1
rots_del equ 0
ifeq rots_high-0
rotv_wid equ (48/1) ;actual view lores
rots_cen equ 0
endc
ifeq rots_high-$8000
rotv_wid equ (96/1) ;actual view hires
rots_cen equ 8
endc
ifnd ntscver
ifeq rots_lace-0
rotv_hgt equ 290+64 ;actual view nolace
endc
ifeq rots_lace-4
rotv_hgt equ (290*2)+64 ;actual view lace
endc
endc
ifd ntscver
ifeq rots_lace-0
rotv_hgt equ 290+64-56 ;actual view nolace
endc
ifeq rots_lace-4
rotv_hgt equ ((290-56)*2)+64 ;actual view lace
endc
endc
ifeq rots_vew-0 ;lo-res
ifeq rots_dpt-1
ifnd ntscver
rotc_hgtx equ 160 ;maximale characterhoogte
rotc_hgty equ 80+8 ;maximale characterhoogte
rotc_wid equ ((rotc_hgtx*2)+15)/16*2 ;maximale characterbreedte
rots_scrwid equ (0/1) ;aantal -bytes voor y-scroll
endc
ifd ntscver
rotc_hgtx equ 144 ;maximale characterhoogte
rotc_hgty equ 24+8 ;maximale characterhoogte
rotc_wid equ ((rotc_hgtx*2)+15)/16*2 ;maximale characterbreedte
rots_scrwid equ 16 ;aantal -bytes voor y-scroll
endc
endc
ifeq rots_dpt-2
rotc_hgtx equ 80 ;maximale characterhoogte
rotc_hgty equ 88+8 ;maximale characterhoogte
rotc_wid equ ((rotc_hgtx*2)+15)/16*2 ;maximale characterbreedte
rots_scrwid equ (0/1) ;aantal -bytes voor y-scroll
endc
ifeq rots_dpt-3
ifnd rotbigscroll
ifnd ntscver
rotc_hgtx equ 36 ;maximale characterhoogte
rotc_hgty equ 40+8 ;maximale characterhoogte
rots_scrwid equ 8 ;aantal -bytes voor y-scroll
endc
ifd ntscver
rotc_hgtx equ 16 ;maximale characterhoogte
rotc_hgty equ 16+8 ;maximale characterhoogte
rots_scrwid equ 8 ;aantal -bytes voor y-scroll
endc
endc
ifd rotbigscroll
ifnd ntscver
rotc_hgtx equ 80 ;maximale characterhoogte
rotc_hgty equ 88+8 ;maximale characterhoogte
rots_scrwid equ 0 ;aantal -bytes voor y-scroll
endc
ifd ntscver
rotc_hgtx equ 110 ;maximale characterhoogte
rotc_hgty equ 88+8 ;maximale characterhoogte
rots_scrwid equ 0 ;aantal -bytes voor y-scroll
endc
endc
rotc_wid equ ((rotc_hgtx*2)+15)/16*2 ;maximale characterbreedte
endc
ifeq rots_dpt-4
ifnd ntscver
rotc_hgtx equ 56 ;maximale characterhoogte
rotc_hgty equ 56+8 ;maximale characterhoogte
rotc_wid equ ((rotc_hgtx*2)+15)/16*2 ;maximale characterbreedte
rots_scrwid equ (0/1) ;aantal -bytes voor y-scroll
endc
ifd ntscver
rotc_hgtx equ 40 ;maximale characterhoogte
rotc_hgty equ 40+8 ;maximale characterhoogte
rotc_wid equ ((rotc_hgtx*2)+15)/16*2 ;maximale characterbreedte
rots_scrwid equ (0/1) ;aantal -bytes voor y-scroll
endc
endc
ifeq rots_dpt-5
ifnd ntscver
rotc_hgtx equ 36 ;maximale characterhoogte
rotc_hgty equ 40+8 ;maximale characterhoogte
rotc_wid equ ((rotc_hgtx*2)+15)/16*2 ;maximale characterbreedte
rots_scrwid equ (0/1) ;aantal -bytes voor y-scroll
endc
ifd ntscver
rotc_hgtx equ 32 ;maximale characterhoogte
rotc_hgty equ 40+8 ;maximale characterhoogte
rotc_wid equ ((rotc_hgtx*2)+15)/16*2 ;maximale characterbreedte
rots_scrwid equ (0/1) ;aantal -bytes voor y-scroll
endc
endc
endc
ifeq rots_vew-$8004 ;hi-res interlace
ifeq rots_dpt-1
rotc_hgtx equ 80 ;maximale characterhoogte
rotc_hgty equ 56+8 ;maximale characterhoogte
rotc_wid equ ((rotc_hgtx*2)+15)/16*2 ;maximale characterbreedte
rots_scrwid equ 16 ;aantal -bytes voor y-scroll
endc
ifeq rots_dpt-2
ifnd ntscver
rotc_hgtx equ 72 ;maximale characterhoogte
rotc_hgty equ 72+8 ;maximale characterhoogte
rotc_wid equ ((rotc_hgtx*2)+15)/16*2 ;maximale characterbreedte
rots_scrwid equ 16 ;aantal -bytes voor y-scroll
endc
ifd ntscver
rotc_hgtx equ 48 ;maximale characterhoogte
rotc_hgty equ 48+8 ;maximale characterhoogte
rotc_wid equ ((rotc_hgtx*2)+15)/16*2 ;maximale characterbreedte
rots_scrwid equ 16 ;aantal -bytes voor y-scroll
endc
endc
ifeq rots_dpt-3
rotc_hgtx equ 48 ;maximale characterhoogte
rotc_hgty equ 48+8 ;maximale characterhoogte
rotc_wid equ ((rotc_hgtx*2)+15)/16*2 ;maximale characterbreedte
rots_scrwid equ 16 ;aantal -bytes voor y-scroll
endc
ifeq rots_dpt-4
rotc_hgtx equ 48 ;maximale characterhoogte
rotc_hgty equ 48+8 ;maximale characterhoogte
rotc_wid equ ((rotc_hgtx*2)+15)/16*2 ;maximale characterbreedte
rots_scrwid equ 16 ;aantal -bytes voor y-scroll
endc
endc
rots_hgt equ (rotv_hgt+(2*rotc_hgty))
rots_wid equ (rotv_wid+(2*rotc_wid))
rots_blit equ 8 ;aantal -bytes voor y-scroll
SECTION 3,CODE_C
rot
dc.l 'ROUT'
movem.l d3-d7/a1-a6,-(sp)
lea ($dff000).l,a6 ;hardware
lea rot,a5 ;prog base
; ifeq rots_dpt-1
; eor.l #rotpic2-rotpic1,rotdub-rot(a5)
; endc
move.l a0,rotvar-rot(a5) ;var table
moveq.l #0,d1 ;info ombouwen
bsr rotfonset ;set current font
lea var_txt1(a0),a0
move.l #0,d2 ;test bit
lea rottnew,a1 ;new text
lea rottpos,a2 ;pos text
lea rotscr,a4 ;rout scroll
bsr rotctr
lea rotpic1,a0
add.l rotdub-rot(a5),a0
moveq.l #0,d1
; ifne rots_dpt-1
eor.l #rotpic2-rotpic1,rotdub-rot(a5)
; endc
move.l #rots_del,d2 ;interrupt delay
cmp.l #3,rotmod-rot(a5) ;y scroll ?
beq rotstr.y
cmp.l #4,rotmod-rot(a5) ;y scroll ?
beq rotstr.y
moveq.l #0,d2 ;no delay
rotstr.y
movem.l (sp)+,d3-d7/a1-a6
rts
rotctr
move.l (a0)+,d0
tst.l d0
beq rotctr.end ;leeg ?
cmp.l (a1),d0 ;zelfde text ?
beq rotctr.aa
move.l d0,(a1) ;nieuwe text
move.l d0,(a2) ;start text
rotctr.aa
jsr (a4) ;scrollen
rotctr.end
rts
rotchg ;change font (a2 komt terug)
movem.l d0-d7/a0/a1/a3-a6,-(sp)
move.b (a2)+,d1
bsr rotnum ;a2=string = d0=nummer
cmp.b #'F',d1
beq rotchg.bb
cmp.b #'f',d1
beq rotchg.bb
cmp.b #'C',d1
beq rotchg.c
cmp.b #'c',d1
beq rotchg.c
cmp.b #'S',d1
beq rotchg.d
cmp.b #'s',d1
beq rotchg.d
cmp.b #'M',d1
beq rotchg.e
cmp.b #'m',d1
beq rotchg.e
cmp.b #'X',d1
beq rotchg.f
cmp.b #'x',d1
beq rotchg.f
cmp.b #'Y',d1
beq rotchg.g
cmp.b #'y',d1
beq rotchg.g
cmp.b #'E',d1
beq rotchg.h
cmp.b #'e',d1
beq rotchg.h
cmp.b #'D',d1
beq rotchg.i
cmp.b #'d',d1
beq rotchg.i
bra rotchg.end
rotchg.bb ;change font
; lsl.l #2,d0 ;*4
add.l d0,d0
add.l d0,d0
move.l d0,rotc_fonnum-rot(a5)
bsr rotfonset
bra rotchg.end
rotchg.c ;change color
move.l d0,rotcol-rot(a5)
bra rotchg.end
rotchg.d ;change speed
move.l d0,rotspd-rot(a5)
bra rotchg.end
rotchg.e ;change mode
move.l d0,rotmod-rot(a5)
bra rotchg.end
rotchg.f ;change x pos
add.l #rotc_wid*8,d0
move.l d0,rotpsx-rot(a5)
bra rotchg.end
rotchg.g ;change y pos
add.l #rotc_hgty,d0
move.l #rotv_hgt+rotc_hgty,d1 ;max check
cmp.w d1,d0
ble rotchg.ga
move.l d1,d0
rotchg.ga
move.l d0,rotpsy-rot(a5)
bra rotchg.end
rotchg.h ;screenclear
; lea rotpln1,a1
; move.l #rots_hgt*rots_wid*rots_dpt,d0
; move.l rotvar-rot(a5),a0 ;vartab
; move.l var_gfxlib(a0),a6 ;graphics lib halen
; move.l #$0000,d1 ;fill ?
; movem.l d0-d7/a0-a6,-(sp)
; jsr -$12c(a6) ;blitter clear scherm 1
; movem.l (sp)+,d0-d7/a0-a6
; bsr rotwit ;blitwait
; lea rotpln1,a1
; add.l #rotpln2-rotpln1,a1
; movem.l d0-d7/a0-a6,-(sp)
; jsr -$12c(a6) ;blitter clear scherm 1
; movem.l (sp)+,d0-d7/a0-a6
; bsr rotwit ;blitwait
lea rotpln1,a0
add.l #(rots_wid-rotv_wid)/2,a0 ;xstart
add.l #rotc_hgty*rots_wid*rots_dpt,a0 ;ystart
move.l rotdub-rot(a5),d0
add.l d0,a0 ;destination
move.l #rotv_hgt/rots_blit,d5 ;in rots_blit stappen
muls #rots_dpt,d5
move.l d5,d1
muls #rots_wid,d1
lsl.l #6,d5 ;*64
add.l #(rotv_wid)/2,d5
move.w #0,$042(a6)
move.w #$100+$f0,$040(a6)
move.w #rots_wid-rotv_wid,$064(a6)
move.w #rots_wid-rotv_wid,$066(a6)
; move.w #0,$070(a6) ;c dat
; move.w #0,$072(a6) ;b dat
move.w #0,$074(a6) ;a dat
move.l #0,$044(a6) ;mask
move.w #rots_blit-1,d0
rotchg.blit
move.l a0,$054(a6) ;destination
move.w d5,$058(a6)
bsr rotwit
add.l d1,a0
dbra d0,rotchg.blit
bra rotchg.end
rotchg.i ;set delay
move.l d0,rotdel-rot(a5)
bra rotchg.end
rotchg.end
movem.l (sp)+,d0-d7/a0/a1/a3-a6
rts
rotchgc ;change font (a2 komt terug)
movem.l d0-d7/a0/a1/a3-a6,-(sp)
move.b (a2)+,d1
bsr rotnum
cmp.b #'F',d1 ;fontchange
beq rotchgc.bb
cmp.b #'f',d1
beq rotchgc.bb
cmp.b #'R',d1 ;reverse centreren
beq rotchgc.j
cmp.b #'r',d1
beq rotchgc.j
bra rotchgc.end
rotchgc.bb ;change font
; lsl.l #2,d0 ;*4
add.l d0,d0
add.l d0,d0
move.l d0,rotc_fonnum-rot(a5)
bsr rotfonset
bra rotchgc.end
rotchgc.j ;reverse centering
add.l #rotc_wid*8,d0
move.l d0,rotrev-rot(a5)
bra rotchgc.end
rotchgc.end
movem.l (sp)+,d0-d7/a0/a1/a3-a6
rts
rotfonset ;set current font
movem.l d0-d7/a0-a6,-(sp)
move.l rotvar-rot(a5),a1 ;vartab
add.l rotc_fonnum-rot(a5),a1 ;fontnummer
move.l var_fon1(a1),a2 ;fonttabel
clr.l rotc_fon-rot(a5) ;huidige font wissen
cmp.l #'FONT',(a2) ;is ut fontje ?
bne rotfonset.end
move.l a2,rotc_fon-rot(a5) ;huidige font zetten
; move.l fon_wid(a2),rotc_maxx-rot(a5)
rotfonset.bb
rotfonset.end
movem.l (sp)+,d0-d7/a0-a6
rts
rotscr
movem.l d0-d7/a0-a6,-(sp)
tst.l rotdel-rot(a5) ;delay ?
beq rotscr.nodel
sub.l #1,rotdel-rot(a5) ;delay aftellen
rotscr.nodel
tst.l rottnew-rot(a5) ;leeg text ?
bne rotscr.a
tst.l rottpos-rot(a5) ;leeg text ?
beq rotscr.end
clr.l rottpos-rot(a5)
bra rotscr.end
rotscr.a
cmp.l #3,rotmod-rot(a5) ;y scroll ?
beq rotscr.y
cmp.l #4,rotmod-rot(a5) ;y scroll ?
bne rotscr.noy
rotscr.y
bsr roty
bra rotscr.end
rotscr.noy
cmp.l #5,rotmod-rot(a5) ;page ?
bne rotscr.nop
bsr rotp
bra rotscr.end
rotscr.nop
clr.l rotchrn-rot(a5) ;geen geblerk met y
bsr rotx ;x scroll
rotscr.end
movem.l (sp)+,d0-d7/a0-a6
rts
rotp
movem.l d0-d7/a0-a6,-(sp) ;page
tst.l rotc_fon-rot(a5) ;font leeg ?
beq rotp.end
move.l rotc_fon-rot(a5),a1
lea rotpln1,a2
add.l #(rots_wid-rotv_wid)/2,a2;xstart
add.l #rotc_hgty*rots_wid*rots_dpt,a2 ;ystart
move.l a2,a0 ;destination
move.l rotdub-rot(a5),d0
add.l d0,a0 ;destination
eor.l #rotpic2-rotpic1,d0
add.l d0,a2 ;source
move.l #rotv_hgt/rots_blit,d5 ;in rots_blit stappen
muls #rots_dpt,d5
move.l d5,d1
muls #rots_wid,d1
lsl.l #6,d5 ;*64
add.l #(rotv_wid)/2,d5
; move.w #$4000,$09a(a6) ;masterinterrupt
move.w #0,$042(a6)
move.w #$900+$f0,$040(a6)
move.w #rots_wid-rotv_wid,$064(a6)
move.w #rots_wid-rotv_wid,$066(a6)
move.w #%1111111111111111,$044(a6)
move.w #%1111111111111111,$046(a6)
move.w #rots_blit-1,d0
rotp.blit
move.l a2,$050(a6) ;source
move.l a0,$054(a6) ;destination
move.w d5,$058(a6)
bsr rotwit
; move.w #$c000,$09a(a6) ;masterinterrupt
add.l d1,a0
add.l d1,a2
dbra d0,rotp.blit
tst.l rotdel-rot(a5) ;delay ?
bne rotp.end
rotp.char
move.l rottpos-rot(a5),a2 ;textpos
move.l #8,rotmaxr-rot(a5) ;max regelhoogte wissen
lea fon_widtab(a1),a3
moveq.l #0,d1 ;text lengte
moveq.l #0,d2 ;aantal chars
moveq.l #0,d3 ;reverse
rotp.a ;text lengte tellen
tst.b (a2)+ ;einde text ?
beq rotp.bb
cmp.b #$a,-1(a2)
beq rotp.bb
moveq.l #0,d7
move.b -1(a2),d7
cmp.b #'_',d7
bne rotp.nocom
bsr rotchgc ;handle command
tst.l rotrev-rot(a5) ;reverse centreren ?
beq rotp.norev
move.l rotrev-rot(a5),d0 ;reverse punt
clr.l rotrev-rot(a5) ;reverse wissen
sub.l d1,d0 ;-huidige lengte
cmp.w #0,d0
bge rotp.revk
moveq.l #0,d0
rotp.revk
move.l d0,d3
rotp.norev
tst.l rotc_fon-rot(a5) ;font opnieuw halen
beq rotp.end
move.l rotc_fon-rot(a5),a1
lea fon_widtab(a1),a3
bra rotp.a
rotp.nocom
move.l fon_hgt(a1),d0
cmp.w 2+rotmaxr-rot(a5),d0 ;maxy check
blt rotp.notbigger2
move.l d0,rotmaxr-rot(a5)
rotp.notbigger2
; lsl.l #1,d7
add.l d7,d7
add.w (a3,d7),d1 ;breedte karakter optellen
add.l #1,d2 ;aantal karakters
bra rotp.a
rotp.bb
cmp.l #(rotv_wid)*8,d1 ;beeld breedte
ble rotp.cx
move.l #(rotv_wid)*8,d1
rotp.cx
tst.l d3 ;reverse centreren ?
beq rotp.mid
move.l d3,rotpsx-rot(a5)
bra rotp.rev
rotp.mid
move.l #(rots_wid+rots_cen)*4,d5 ;beeld breedte
lsr.l #1,d1 ;/2
sub.l d1,d5 ;xpos
move.l d5,rotpsx-rot(a5)
rotp.rev
move.l d2,rotchrn-rot(a5) ;aantal characters
move.l rotmaxr-rot(a5),d0 ;hoogte regel
move.l rotspd-rot(a5),d1 ;snelheid
add.l #1,d1
divs d1,d0 ;hoogte/snelheid
and.l #$ffff,d0
divs d0,d2 ;aantal chars/(hoogte/snelheid)
add.w #1,d2
move.w d2,2+rotchrvb-rot(a5) ;aantal per vb
clr.l rotchrp-rot(a5)
rotp.print
lea fon_widtab(a1),a3
lea rotpln1,a0 ;text printen
add.l rotdub-rot(a5),a0
move.l rotchrvb-rot(a5),d1 ;aantal chars per keer
move.l rottpos-rot(a5),a2 ;textpos
move.l rotchrp-rot(a5),d3 ;hoogte aanpassing
move.l rotspd-rot(a5),d0
add.l #1,d0
muls d0,d3
add.l #1,rotchrp-rot(a5)
rotp.c
tst.b (a2)+
beq rotp.gb
cmp.b #$a,-1(a2)
beq rotp.d
moveq.l #0,d7
move.b -1(a2),d7
cmp.b #'_',d7
bne rotp.nocom2
bsr rotchg ;handle command
cmp.l #5,rotmod-rot(a5) ;andere mode ?
bne rotp.reset
tst.l rotc_fon-rot(a5) ;font opnieuw halen
beq rotp.end
move.l rotc_fon-rot(a5),a1
lea fon_widtab(a1),a3 ;breedte opnieuw halen
bra rotp.c
rotp.nocom2
move.l d7,d2
; lsl.l #1,d2
add.l d2,d2
tst.w (a3,d2) ;karakter leeg ?
beq rotp.c
move.l fon_hgt(a1),d4
cmp.w 2+rotmaxr-rot(a5),d4 ;maxy check
blt rotp.notbigger
move.l d4,rotmaxr-rot(a5)
rotp.notbigger
move.l rotpsx-rot(a5),d4 ;huidige x-positie
add.w (a3,d2),d4
cmp.w #(rotc_wid+rotv_wid)*8,d4 ;beeld breedte
bgt rotp.caa ;randje bereikt ?
move.l rotmaxr-rot(a5),d6 maxy
sub.l fon_hgt(a1),d6 ;-huidige y
lsr.l #1,d6 ;/2
add.l rotpsy-rot(a5),d6 ;huidig ypos
sub.l d3,d6 ;hoogte aanpassing
move.l #rotv_hgt+rotc_hgty,d4
cmp.l d4,d6
ble rotp.nomaxy
move.l d4,d6
rotp.nomaxy
move.l rotcol-rot(a5),d4 ;kleur
move.l rotpsx-rot(a5),d5 ;huidge x-pos halen
bsr rotchr
rotp.caa
move.w (a3,d2),d4
add.w d4,2+rotpsx-rot(a5) ;xpos
sub.l #1,rotchrn-rot(a5) ;chars aftellen
tst.l rotchrn-rot(a5)
beq rotp.d ;klaar voor nu
bra rotp.c
rotp.gb
move.l rottnew-rot(a5),rottpos-rot(a5) ;einde scroll
bra rotp.end
rotp.d
clr.l rotchrvb-rot(a5)
clr.l rotchrn-rot(a5)
move.l a2,rottpos-rot(a5)
move.l rotmaxr-rot(a5),d0 ;max hoogte
add.l d0,rotpsy-rot(a5) ;huidig ypos
tst.l rotdel-rot(a5) ;geen delay=volgend regel
beq rotp.char
bra rotp.end
rotp.reset
bsr rotres
rotp.end
movem.l (sp)+,d0-d7/a0-a6
rts
roty
movem.l d0-d7/a0-a6,-(sp) ;y scroll
tst.l rotc_fon-rot(a5) ;font leeg ?
beq roty.end
move.l rotc_fon-rot(a5),a1
lea rotpln1,a2
add.l #(rots_wid-(rotv_wid-rots_scrwid-rots_cen))/2,a2;xstart
add.l #rotc_hgty*rots_wid*rots_dpt,a2 ;ystart
move.l a2,a0 ;destination
move.l rotdub-rot(a5),d0
add.l d0,a0 ;destination
eor.l #rotpic2-rotpic1,d0
add.l d0,a2 ;source
moveq.l #0,d6
tst.l rotdel-rot(a5) ;delay ?
bne roty.nomov
move.l rotspd-rot(a5),d6
add.l #1,d6
roty.nomov
move.l #(rotv_hgt+rotc_hgty)/rots_blit,d5 ;in rots_blit stappen
move.l d6,d0
divs #rots_blit,d0
and.l #$ffff,d0
add.l #1,d0
sub.l d0,d5
muls #rots_dpt,d5
move.l d5,d1
muls #rots_wid,d1
lsl.l #6,d5 ;*64
add.l #(rotv_wid-rots_scrwid)/2,d5
muls #rots_dpt*rots_wid,d6
add.l d6,a2
; move.w #$4000,$09a(a6) ;masterinterrupt
move.w #0,$042(a6)
move.w #$900+$f0,$040(a6)
move.w #rots_wid-(rotv_wid-rots_scrwid),$064(a6)
move.w #rots_wid-(rotv_wid-rots_scrwid),$066(a6)
move.w #%1111111111111111,$044(a6)
move.w #%1111111111111111,$046(a6)
move.w #rots_blit-1,d0
roty.blit
move.l a2,$050(a6) ;source
move.l a0,$054(a6) ;destination
move.w d5,$058(a6)
bsr rotwit
; move.w #$c000,$09a(a6) ;masterinterrupt
add.l d1,a0
add.l d1,a2
dbra d0,roty.blit
tst.l rotdel-rot(a5) ;delay ?
bne roty.end
tst.b rotwaitx-rot(a5) ;regel voorbij ?
beq roty.char
tst.l rotchrn-rot(a5) ;nog karakters printen ?
beq roty.ga
bra roty.print
roty.char
move.l rottpos-rot(a5),a2 ;textpos
move.l #8,rotmaxr-rot(a5) ;max regelhoogte wissen
lea fon_widtab(a1),a3
moveq.l #0,d1 ;text lengte
moveq.l #0,d2 ;aantal chars
moveq.l #0,d3 ;reverse point
roty.a ;text lengte tellen
tst.b (a2)+ ;einde text ?
beq roty.bb
cmp.b #$a,-1(a2)
beq roty.bb
moveq.l #0,d7
move.b -1(a2),d7
cmp.b #'_',d7
bne roty.nocom
bsr rotchgc ;handle command
tst.l rotrev-rot(a5) ;reverse centreren ?
beq roty.norev
move.l rotrev-rot(a5),d0 ;reverse punt
clr.l rotrev-rot(a5) ;reverse wissen
sub.l d1,d0 ;-huidige lengte
cmp.w #0,d0
bge roty.revk
moveq.l #0,d0
roty.revk
move.l d0,d3
roty.norev
tst.l rotc_fon-rot(a5) ;font opnieuw halen
beq roty.end
move.l rotc_fon-rot(a5),a1
lea fon_widtab(a1),a3
bra roty.a
roty.nocom
move.l fon_hgt(a1),d0
cmp.w 2+rotmaxr-rot(a5),d0 ;maxy check
blt roty.notbigger2
move.l d0,rotmaxr-rot(a5)
roty.notbigger2
; lsl.l #1,d7
add.l d7,d7
add.w (a3,d7),d1 ;breedte karakter optellen
add.l #1,d2 ;aantal karakters
bra roty.a
roty.bb
cmp.l #(rotv_wid-rots_scrwid)*8,d1 ;beeld breedte
ble roty.cx
move.l #(rotv_wid-rots_scrwid)*8,d1
roty.cx
tst.l d3 ;reverse centreren ?
beq roty.mid
move.l d3,rotpsx-rot(a5)
bra roty.rev
roty.mid
move.l #(rots_wid+rots_cen)*4,d5 ;midden centreren
lsr.l #1,d1 ;/2
sub.l d1,d5 ;xpos
move.l d5,rotpsx-rot(a5)
roty.rev
move.l d2,rotchrn-rot(a5) ;aantal characters
move.l rotmaxr-rot(a5),d0 ;hoogte regel
cmp.w #32,d0 ;maximaal 32 stappen
ble roty.nocut
move.l #32,d0
roty.nocut
move.l rotspd-rot(a5),d1 ;snelheid
add.l #1,d1
divs d1,d0 ;hoogte/snelheid
and.l #$ffff,d0
divs d0,d2 ;aantal chars/(hoogte/snelheid)
add.w #1,d2
move.w d2,2+rotchrvb-rot(a5) ;aantal per vb
clr.l rotchrp-rot(a5)
roty.print
lea fon_widtab(a1),a3
lea rotpln1,a0 ;text printen
add.l rotdub-rot(a5),a0
move.l rotchrvb-rot(a5),d1 ;aantal chars per keer
move.l rottpos-rot(a5),a2 ;textpos
move.l rotchrp-rot(a5),d3 ;hoogte aanpassing
move.l rotspd-rot(a5),d0
add.l #1,d0
muls d0,d3
add.l #1,rotchrp-rot(a5) ;1 lijn hoger printen
roty.c
tst.b (a2)+
beq roty.gb
cmp.b #$a,-1(a2)
beq roty.d
moveq.l #0,d7
move.b -1(a2),d7
cmp.b #'_',d7
bne roty.nocom2
bsr rotchg ;handle command
cmp.l #3,rotmod-rot(a5) ;y scroll ?
beq roty.cont
cmp.l #4,rotmod-rot(a5) ;y scroll ?
bne roty.reset
roty.cont
tst.l rotc_fon-rot(a5) ;font opnieuw halen
beq roty.end
move.l rotc_fon-rot(a5),a1
lea fon_widtab(a1),a3 ;breedte opnieuw halen
bra roty.c
roty.nocom2
move.l d7,d2
; lsl.l #1,d2
add.l d2,d2
tst.w (a3,d2) ;karakter leeg ?
beq roty.c
move.l fon_hgt(a1),d4
cmp.w 2+rotmaxr-rot(a5),d4 ;maxy check
blt roty.notbigger
move.l d4,rotmaxr-rot(a5)
roty.notbigger
move.l rotpsx-rot(a5),d4 ;huidige x-positie
add.w (a3,d2),d4
cmp.w #(rotc_wid+rotv_wid)*8,d4 ;beeld breedte
bgt roty.caa ;randje bereikt ?
move.l rotmaxr-rot(a5),d6 ;maxy
sub.l fon_hgt(a1),d6 ;-huidige y
lsr.l #1,d6 ;/2
add.l #rotv_hgt+rotc_hgty,d6 ;ypos
sub.l d3,d6 ;hoogte aanpassing
move.l rotcol-rot(a5),d4 ;kleur
move.l rotpsx-rot(a5),d5 ;huidge x-pos halen
bsr rotchr
roty.caa
move.w (a3,d2),d4
add.w d4,2+rotpsx-rot(a5) ;xpos
sub.l #1,rotchrn-rot(a5) ;chars aftellen
tst.l rotchrn-rot(a5)
beq roty.d ;klaar voor nu
sub.l #1,d1 ;vblank aftellen
tst.l d1
beq roty.dj
bra roty.c
roty.gb
move.l rottnew-rot(a5),rottpos-rot(a5) ;einde scroll
bra roty.gj
roty.d
clr.l rotchrvb-rot(a5)
clr.l rotchrn-rot(a5)
roty.dj
move.l a2,rottpos-rot(a5)
roty.gc
tst.b rotwaitx-rot(a5) ;regel voorbij ?
bne roty.ga
roty.gj
move.l rotmaxr-rot(a5),d0 ;max hoogte
move.l rotspd-rot(a5),d1
add.l #1,d1
divs d1,d0
move.b d0,rotwaitx-rot(a5)
bra roty.end
roty.ga
sub.b #1,rotwaitx-rot(a5) ;teller aftellen
;roty.gt
bra roty.end
roty.reset
bsr rotres
roty.end
movem.l (sp)+,d0-d7/a0-a6
rts
rotx
movem.l d0-d7/a0-a6,-(sp)
bsr rotxc
bsr rotxb
movem.l (sp)+,d0-d7/a0-a6
rts
rotxc ;karakter zetten
movem.l d0-d7/a0-a6,-(sp)
rotxc.a
tst.l rotdel-rot(a5) ;delay ?
bne rotxc.end
move.l rottpos-rot(a5),a2 ;huidige scroll pointer
rotxc.f
tst.b (a2) ;einde scroll ?
bne rotxc.g
move.l rottnew-rot(a5),rottpos-rot(a5) ;scroll opnieuw
bra rotxc.a
rotxc.g
tst.b rotwaitx-rot(a5) ;karakter voorbij ?
bne rotxc.c
rotxc.zb
moveq.l #0,d7
move.b (a2)+,d7
cmp.b #'_',d7 ;commando ?
bne rotxc.za
bsr rotchg ;handle command
tst.l rotdel-rot(a5) ;delay ?
bne rotxc.store
cmp.l #3,rotmod-rot(a5) ;y scroll ?
beq rotxc.reset
cmp.l #4,rotmod-rot(a5) ;y scroll ?
beq rotxc.reset
cmp.l #5,rotmod-rot(a5) ;page ?
beq rotxc.reset
bra rotxc.zb
rotxc.za
tst.l rotc_fon-rot(a5) ;font leeg ?
beq rotxc.end
move.l rotc_fon-rot(a5),a1
move.l rotpsy-rot(a5),d6 ;ypos & centreren
move.l #rotv_hgt+rotc_hgty,d1
cmp.l d1,d6
ble rotxc.nomaxy2
move.l d1,d6
rotxc.nomaxy2
move.l fon_hgt(a1),d1
lsr.l #1,d1
sub.l d1,d6
moveq.l #0,d1
lea fon_widtab(a1),a3
move.l d7,d2
; lsl.l #1,d2 ;*2
add.l d2,d2
move.w (a3,d2),d1 ;karakter breedte
tst.w d1 ;karakter is leeg ?
beq rotxc.zb ;next karakter
move.l #(rots_wid+rotv_wid)*4,d5 ;xpos
cmp.l #2,rotmod-rot(a5) ;> scroll ?
bne rotxc.nor
move.l #(rots_wid-rotv_wid)*4,d5 ;xpos
sub.l d1,d5 ;-breedte
rotxc.nor
move.l rotcol-rot(a5),d4 ;kleur
lea rotpln1,a0
move.l rotdub-rot(a5),d0
eor.l #rotpic2-rotpic1,d0
add.l d0,a0
bsr rotchr ;print karakter
move.l rotspd-rot(a5),d0
add.l #1,d0
divs d0,d1
move.b d1,rotwaitx-rot(a5) ;karakter breedte
bra rotxc.store
rotxc.c
sub.b #1,rotwaitx-rot(a5) ;karakter delay
bra rotxc.end
rotxc.reset
bsr rotres
rotxc.store
move.l a2,rottpos-rot(a5)
rotxc.end
movem.l (sp)+,d0-d7/a0-a6
rts
rotxb
movem.l d0-d7/a0-a6,-(sp)
tst.l rotc_fon-rot(a5) ;font leeg ?
beq rotxb.end
move.l rotc_fon-rot(a5),a1
lea rotpln1,a0 ;ycentreren
move.l rotpsy-rot(a5),d0
; move.l #rotv_hgt+rotc_hgty,d1
; cmp.l d1,d0
; ble rotxb.nomaxy
; move.l d1,d0
;rotxb.nomaxy
move.l #rotc_hgtx/2,d1
sub.l d1,d0
muls #rots_wid*rots_dpt,d0
add.l d0,a0
add.l #(rots_wid-rotv_wid)/2,a0 ;xcentreren
move.l a0,a2 ;destination !!!
move.l rotdub-rot(a5),d0
add.l d0,a2 ;destination
eor.l #rotpic2-rotpic1,d0
add.l d0,a0 ;source
move.l rotspd-rot(a5),d6 ;rotate word berekenen
cmp.l #1,rotmod-rot(a5) ;rechts scroll
beq rotxb.left
moveq.l #0,d0
tst.l rotdel-rot(a5) ;delay ?
bne rotxb.del1
add.l #1,d6
divs #16,d6
; lsl.w #1,d6
add.w d6,d6
moveq.l #0,d5
move.w d6,d5
clr.w d6
lsr.l #4,d6
sub.l d5,a0
move.l d6,d0
rotxb.del1
move.w #%1111111111111111,$044(a6)
move.w #%0,$046(a6)
sub.l rotc_maxx-rot(a5),a0
sub.l rotc_maxx-rot(a5),a2
bra rotxb.xblit
rotxb.left
moveq.l #0,d0
tst.l rotdel-rot(a5) ;delay ?
bne rotxb.del2
divs #16,d6
; lsl.w #1,d6
add.w d6,d6
moveq.l #0,d5
move.w d6,d5
clr.w d6
lsr.l #4,d6
add.l d5,a0 ;links scroll
add.l #2,a0
move.l #$f000,d0
sub.l d6,d0
rotxb.del2
move.w #%1111111111111111,$044(a6)
move.w #%1111111111111111,$046(a6)
rotxb.xblit
; move.w #$4000,$09a(a6) ;masterinterrupt
move.w d0,$042(a6)
add.w #$900+$f0,d0
move.w d0,$040(a6)
move.l #rots_wid-rotv_wid,d0 ;modulos
sub.l rotc_maxx-rot(a5),d0
move.w d0,$064(a6)
move.w d0,$066(a6)
move.l #rotc_hgtx*rots_dpt*64,d1 ;*depth
; move.l rotc_maxy-rot(a5),d1 ;hoogte regel
; lsl.l #6,d1
move.l #rotv_wid,d0
add.l rotc_maxx-rot(a5),d0
lsr.l #1,d0
add.w d1,d0
rotxb.ka
move.l a0,$050(a6) ;source
move.l a2,$054(a6) ;destination
move.w d0,$058(a6)
bsr rotwit
; move.w #$c000,$09a(a6) ;masterinterrupt
rotxb.end
movem.l (sp)+,d0-d7/a0-a6
rts
rotres
movem.l d0-d7/a0-a6,-(sp)
clr.l rotmaxr-rot(a5)
clr.l rotmaxx-rot(a5)
clr.l rotchrn-rot(a5)
clr.l rotchrvb-rot(a5)
clr.l rotchrp-rot(a5)
movem.l (sp)+,d0-d7/a0-a6
rts
rotnum ;a2=string = d0=nummer
movem.l d1-d7/a0-a1/a3-a6,-(sp)
moveq.l #0,d0
move.l a2,a0
rotnum.gb
cmp.b #'0',(a2)+ ;einde nummer zoeken
blt rotnum.ga
cmp.b #'9',-1(a2)
ble rotnum.gb
rotnum.ga
sub.l #1,a2
move.l a2,a1 ;einde nummer bewaren
cmp.l a0,a1 ;helemaal niets ?
beq rotnum.end
move.l #1,d3 ;hoogte ascii naar decimaal
rotnum.c
moveq.l #0,d1
move.b -(a1),d1
cmp.b #'0',d1 ;nummer ?
blt rotnum.ca
cmp.b #'9',d1
bgt rotnum.ca
sub.w #'0',d1
muls d3,d1
add.l d1,d0
muls #10,d3
bra rotnum.c
rotnum.ca
rotnum.end
movem.l (sp)+,d1-d7/a0-a1/a3-a6
rts
; Karakter op scherm
; a0=bitplane
; a1=fontfile
; d4=kleur
; d5=x
; d6=y
; d7=karakter
rotchr
movem.l d0-d7/a0-a6,-(sp)
lea fon_rawpos(a1),a3
moveq.l #0,d0
move.b d7,d0
; lsl.l #2,d0 ;*4
add.l d0,d0
add.l d0,d0
move.l a1,a2
tst.l (a3,d0) ;is er char ?
beq rotchr.end
add.l (a3,d0),a2 ;raw planes
lea fon_widtab(a1),a3
lsr.l #1,d0 ;/2
move.w (a3,d0),d3
add.w 2+fon_wid(a1),d3 ;+xpos
add.w #16+15,d3 ;wordboven afrond+blitruimte
lsr.w #4,d3 ;/16
; lsl.w #1,d3 ;*2 D3=wid !!!!!!
add.w d3,d3
move.l d3,d2
muls 2+fon_hgt(a1),d2 ;d3=x*y
muls #rots_wid*rots_dpt,d6 ;y
add.l d6,a0
divs #16,d5 ;x
; lsl.w #1,d5
add.w d5,d5
moveq.l #0,d0
move.w d5,d0
add.l d0,a0 ;destination !
clr.w d5
lsr.l #4,d5
; move.w #$4000,$09a(a6)
move.l #-1,$044(a6)
move.w d5,$042(a6) ;x-rol
add.w #$f00+$ca,d5
move.w d5,$040(a6) ;x-rol
move.l #rots_wid*rots_dpt,d0
sub.l d3,d0
move.w d0,$060(a6)
move.w #0,$062(a6)
move.w #0,$064(a6)
move.w d0,$066(a6)
move.l fon_dpt(a1),d7 ;font depth
move.l a2,a3 ;source=mask
cmp.w #1,d7 ;mask handling
beq rotchr.aa
move.l d2,d0 ;x*y
muls 2+fon_dpt(a1),d0 ;*d
add.l d0,a3 ;mask
rotchr.aa
move.l #rots_dpt,d6
cmp.w d6,d7 ;fontdpt>screendpt ?
ble rotchr.ab
move.w d6,d7
rotchr.ab
sub.w #1,d6
sub.w #1,d7
move.l fon_hgt(a1),d0 ;bltsiz
lsl.l #6,d0
move.l d3,d1
lsr.l #1,d1
add.l d1,d0
tst.w d7 ;geen colorfont ?
beq rotchr.msk
rotchr.a
move.l a0,$048(a6) ;destination
move.l a2,$04c(a6) ;source ?
move.l a3,$050(a6) ;(a3) mask ?
move.l a0,$054(a6) ;destination
move.w d0,$058(a6)
bsr rotwit
add.l d2,a2 ;x*y
add.l #rots_wid,a0
sub.l #1,d6
dbra d7,rotchr.a
rotchr.msk
cmp.w #-1,d6 ;alle screenframes gehad ?
beq rotchr.ax
moveq.l #0,d1
rotchr.ac
btst d1,d4 ;kleur ?
beq rotchr.ad
move.l a0,$048(a6) ;destination
move.l a3,$04c(a6) ;mask
move.l a3,$050(a6) ;mask
move.l a0,$054(a6) ;destination
move.w d0,$058(a6)
bsr rotwit
rotchr.ad
add.l #1,d1
add.l #rots_wid,a0
dbra d6,rotchr.ac
rotchr.ax
; move.w #$c000,$09a(a6)
rotchr.end
movem.l (sp)+,d0-d7/a0-a6
rts
rotwit
rotwit.a
btst #14-8,($dff002).l
bne rotwit.a
rts
rotdub dc.l 0
rotc_fon dc.l 0 ;currentfont
rotc_fonnum dc.l 0 ;currentfontnumber
rotc_maxy dc.l rotc_hgty ;maximale y-waarde
rotc_maxx dc.l rotc_wid ;maximale x-waarde
rotrev dc.l 0 ;delay
rotdel dc.l 0 ;delay
rotpsx dc.l 0 ;huidige xpos
rotpsy dc.l (rots_hgt/2);huidige ypos
rotmaxx dc.l 0 ;
rotmaxr dc.l 0 ;maximale regelhoogte
rotchrn dc.l 0 ;aantal chars per vb
rotchrvb dc.l 0 ;aantal chars per regel
rotchrp dc.l 0 ;hoogte aanpassing
rotvar dc.l 0
rotspd dc.l 0
rotcol dc.l 0 ;huidige karakterkleur
rotmod dc.l 0
rottnew dc.l 0
rottpos dc.l 0
rotwaitx dc.b 0
;pic_wid equ 4 ;wide in bytes
;pic_hgt equ 6 ;hoogte
;pic_dpt equ 8 ;number planes
;pic_ani equ 10 ;aantal effes (anim)
;pic_vew equ 12 ;viewmode
;pic_cycstr equ 14 ;cycle start (*4)
;pic_cycend equ 15 ;cycle end (*4)
;pic_cycspd equ 16 ;cycle speed (*4)
;pic_cycadd equ 17 ;cycle add (*4)
;pic_palnum equ 30 ;aantal kleuren
;pic_pal equ 32 ;palette start
;pic_palsiz equ 256*2 ;vaste palette size
;pic_raw equ pic_pal+pic_palsiz ;palette start
cnop 0,2
rotpic1
dc.l 'PICT'
dc.w rots_wid,rots_hgt,rots_dpt,1,rots_vew
dc.b 0,0,0,0
dc.b 0,0,0,0
dc.b 0,0,0,0
dc.b 0,0,0,0
ifeq rots_dpt-1
dc.w 2-1
dc.w $000,$fff
ds.w 256-2
endc
ifeq rots_dpt-2
dc.w 4-1
dc.w $000,$fff,$bbb,$555
ds.w 256-4
endc
ifeq rots_dpt-3
dc.w 8-1
dc.w $000,$fff,$ddd,$bbb,$999,$777,$555,$333
ds.w 256-8
endc
ifeq rots_dpt-4
dc.w 16-1
dc.w $000,$fff,$ddd,$bbb,$999,$777,$555,$333
dc.w $000,$ff0,$dd0,$bb0,$990,$770,$550,$330
ds.w 256-16
endc
ifeq rots_dpt-5
dc.w 32-1
dc.w $000,$fff,$ddd,$bbb,$999,$777,$555,$333
dc.w $000,$ff0,$dd0,$bb0,$990,$770,$550,$330
dc.w $000,$0ff,$0dd,$0bb,$099,$077,$055,$033
dc.w $000,$f0f,$d0d,$b0b,$909,$707,$505,$303
ds.w 256-32
endc
rotpln1
ds.b rots_dpt*rots_wid*rots_hgt
rotpic2
dc.l 'PICT'
dc.w rots_wid,rots_hgt,rots_dpt,1,rots_vew
dc.b 0,0,0,0
dc.b 0,0,0,0
dc.b 0,0,0,0
dc.b 0,0,0,0
ifeq rots_dpt-1
dc.w 2-1
dc.w $000,$fff
ds.w 256-2
endc
ifeq rots_dpt-2
dc.w 4-1
dc.w $000,$fff,$bbb,$555
ds.w 256-4
endc
ifeq rots_dpt-3
dc.w 8-1
dc.w $000,$fff,$ddd,$bbb,$999,$777,$555,$333
ds.w 256-8
endc
ifeq rots_dpt-4
dc.w 16-1
dc.w $000,$fff,$ddd,$bbb,$999,$777,$555,$333
dc.w $000,$ff0,$dd0,$bb0,$990,$770,$550,$330
ds.w 256-16
endc
ifeq rots_dpt-5
dc.w 32-1
dc.w $000,$fff,$ddd,$bbb,$999,$777,$555,$333
dc.w $000,$ff0,$dd0,$bb0,$990,$770,$550,$330
dc.w $000,$0ff,$0dd,$0bb,$099,$077,$055,$033
dc.w $000,$f0f,$d0d,$b0b,$909,$707,$505,$303
ds.w 256-32
endc
rotpln2
ds.b rots_dpt*rots_wid*rots_hgt
rot.e
;**********************************************************************
;and here are the incbin-files....
ifd rout
cnop 0,2
rotincfon
incbin 'videotracker:effect/platinum_13.fon'
cnop 0,2
rotinctxt
incbin 'videotracker:effect/scroll_l2.txt'
endc