home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fujiology Archive
/
fujiology_archive_v1_0.iso
/
!FALCON
/
LINEOUT
/
DELTA.ZIP
/
DELTASRC.ZIP
/
DELTA.SRC
/
TNLBLOB2.SO
< prev
next >
Wrap
Text File
|
2003-01-02
|
7KB
|
433 lines
; Tunnelblobs. A screen for delta.
;======= OBJECT EQUATES ========
;======= OBJECT TABLE ========
; Must be first in object!!
TunnelBlob.table:
DC.L TunnelBlob.mainLoop
DC.L TunnelBlob.init
DC.L TunnelBlob.setRes
DC.L TunnelBlob.resetTime
DC.L TunnelBlob.setToghether
DC.L TunnelBlob.setSeparated
DC.L 0
;======= RESOLUTION SETTING ROUTINE ========
TunnelBlob.setRes:
IFEQ testmode
move.l frmcnt,d0
sub.l lastframecount,d0
beq.s .end
move.l #rts,vbl_gfx
move.w monitormode,d0
cmpi.w #vga60,d0
beq.s .vga60
cmpi.w #vga100,d0
beq.s .vga100
cmpi.w #rgb50,d0
beq.s .rgb50
; Unknown monitormode..
rts
.vga60: bra.l vga60_16bit_160_200
.vga100:bra.l vga100_16bit_160_100
.rgb50: bra.l rgb50_16bit_320_100
ENDC
.end: rts
;======= INIT SUBROUTINE ========
; OUTPUT: d0.l: 0 = All clear.
; neg = Error! Not initialized!
TunnelBlob.init:
.success:
moveq #0,d0
rts
.error: moveq #-1,d0
rts
;======= REALTIME INIT SUBROUTINE ========
TunnelBlob.realtimeInit:
move.l #TunnelBlob.setRes,vbl_gfx
bsr TunnelBlob.resetTime
bsr TunnelBlob.setToghether
clr.w TunnelBlob.trajMode
rts
;======= MAINLOOP SUBROUTINE ========
TunnelBlob.mainLoop:
move.w $0468.w,.old468
move.l frmcnt,d0
sub.l lastframecount,d0
bne.s .end_realtime_init
bsr TunnelBlob.realtimeInit
.end_realtime_init:
bsr TunnelBlob.paint
IFEQ testmode
lea scr,a0
move.l (a0)+,d0
move.l (a0)+,d1
move.l (a0),-4(a0)
move.l d0,(a0)
move.l d1,-8(a0)
move.l d0,d1
lsr.w #8,d0
move.l d0,$ffff8200.w
move.b d1,$ffff820d.w
move.w .old468(pc),d0
.wait: cmp.w $0468.w,d0
beq.s .wait
ENDC
rts
.old468:DC.W 0
;======= OBJECT SUBROUTINES ========
TunnelBlob.resetTime:
move.l $04BA.w,TunnelBlob.time
rts
TunnelBlob.setToghether:
move.l #TunnelBlob.moveToghether,TunnelBlob.trajectRout
rts
TunnelBlob.setSeparated:
move.l #TunnelBlob.moveShit,TunnelBlob.trajectRout
bsr TunnelBlob.getTime
move.l d0,TunnelBlob.sepStart
not.w TunnelBlob.trajMode
rts
TunnelBlob.calcScales:
move.w d0,d1
subi.w #$0100,d1
neg.w d1
move.w #160,d2
move.w #100,d3
move.w d2,d4
move.w d3,d5
mulu.w d0,d2
mulu.w d0,d3
mulu.w d1,d4
mulu.w d1,d5
lsr.l #8,d2
lsr.l #8,d3
lsr.l #8,d4
lsr.l #8,d5
move.w d2,TunnelBlob.scaleX
move.w d3,TunnelBlob.scaleY
move.w d4,TunnelBlob.invScaleX
move.w d5,TunnelBlob.invScaleY
rts
TunnelBlob.moveToghether:
move.w d0,d1
mulu.w #3,d0
lsr.l #1,d0
mulu.w #5,d1
lsr.l #2,d1
Do_SinModulo d0
Do_SinModulo d1
lea sine_tbl,a6
Get_Sin a6,d0,d0
Get_Sin a6,d1,d1
; Multiply with x - amplitude.
muls.w #160,d0
swap d0
ext.l d0
; Multiply with y - amplitude.
muls.w #100,d1
swap d1
ext.l d1
move.l d0,d2
move.l d0,d4
move.l d1,d3
move.l d1,d5
rts
TunnelBlob.moveShit:
movem.l d0-d5,-(sp)
bsr TunnelBlob.getTime
sub.l TunnelBlob.sepStart,d0
lsr.l #2,d0
move.w TunnelBlob.trajMode,d1
beq.s .big
.small: cmpi.l #$00000080,d0
bls.s .s_oki
move.w #$0080,d0
.s_oki: bsr TunnelBlob.calcScales
bra.s .end_get_scale
.big: addi.l #$00000080,d0
cmpi.l #$00000100,d0
bls.s .oki
move.w #$0100,d0
.oki: bsr TunnelBlob.calcScales
.end_get_scale:
movem.l (sp)+,d0-d5
move.w d0,d1
move.w d0,d2
mulu.w #3,d0
lsr.l #1,d0
mulu.w #5,d1
lsr.l #2,d1
Do_SinModulo d0
Do_SinModulo d1
lea sine_tbl,a6
Get_Sin a6,d0,d0
Get_Sin a6,d1,d1
; Multiply with x - amplitude.
muls.w TunnelBlob.invScaleX,d0
; Multiply with y - amplitude.
muls.w TunnelBlob.invScaleY,d1
move.w d2,d3
move.w d2,d4
move.w d2,d5
move.w d2,d6
move.w d2,d7
mulu.w #29,d2
lsr.l #4,d2
mulu.w #5,d3
lsr.l #1,d3
mulu.w #7,d4
lsr.l #2,d4
neg.l d4
mulu.w #11,d5
lsr.l #2,d5
mulu.w #13,d6
lsr.l #2,d6
mulu.w #17,d7
lsr.l #3,d7
neg.l d7
Do_SinModulo d2
Do_SinModulo d3
Do_SinModulo d4
Do_SinModulo d5
Do_SinModulo d6
Do_SinModulo d7
lea sine_tbl,a6
Get_Sin a6,d2,d2
Get_Sin a6,d3,d3
Get_Sin a6,d4,d4
Get_Sin a6,d5,d5
Get_Sin a6,d6,d6
Get_Sin a6,d7,d7
; Multiply with x - amplitude.
muls.w TunnelBlob.scaleX,d2
muls.w TunnelBlob.scaleX,d4
muls.w TunnelBlob.scaleX,d6
add.l d0,d2
add.l d0,d4
add.l d0,d6
swap d2
swap d4
swap d6
ext.l d2
ext.l d4
ext.l d6
; Multiply with y - amplitude.
muls.w TunnelBlob.scaleY,d3
muls.w TunnelBlob.scaleY,d5
muls.w TunnelBlob.scaleY,d7
add.l d1,d3
add.l d1,d5
add.l d1,d7
swap d3
swap d5
swap d7
ext.l d3
ext.l d5
ext.l d7
move.l d2,d0
move.l d3,d1
move.l d4,d2
move.l d5,d3
move.l d6,d4
move.l d7,d5
rts
; OUTPUT:
; d0.l=time
TunnelBlob.getTime:
move.l $04BA.w,d0
sub.l TunnelBlob.time,d0
rts
TunnelBlob.paint:
; Move texture..
bsr TunnelBlob.getTime
move.l d0,d1
lea Texture.16bTexture2,a2
lsl.l #7,d0
andi.l #$00007F00,d0
lea (a2,d0.l*2),a2
move.l d1,d0
Do_SinModulo d0
Get_Sin sine_tbl,d0,d0
asr.w #6,d0
andi.l #$0000007F,d0
lea (a2,d0.l*2),a2
; Move tunnels.
bsr TunnelBlob.getTime
movea.l TunnelBlob.trajectRout,a0
jsr (a0)
lea Tunnel.offsetMap+(320*50+80)*2,a3
lea Tunnel.offsetMap+(320*50+80)*2,a4
lea Tunnel.offsetMap+(320*50+80)*2,a5
muls.w #320,d1
muls.w #320,d3
muls.w #320,d5
add.l d0,d1
add.l d2,d3
add.l d4,d5
lea (a3,d1.l*2),a3
lea (a4,d3.l*2),a4
lea (a5,d5.l*2),a5
clr.l d0
move.l #$7F7F7F7F,d1
clr.l d2
clr.l d3
moveq #100-1,d7
movea.w #160*2,a6
movea.l scr,a0
move.w monitormode,d0
cmpi.w #vga60,d0
beq TunnelBlob.paintVga60
cmpi.w #vga100,d0
beq.s TunnelBlob.paintVga100
cmpi.w #rgb50,d0
beq TunnelBlob.paintRgb50
* Unknown monitormode..
rts
TunnelBlob.paintVga100:
.yloop: moveq #160/10-1,d6
.paint_loop:
REPT 5
move.l (a3)+,d0
add.l (a4)+,d0
add.l (a5)+,d0
and.l d1,d0
move.w d0,d2
swap d0
move.w (a2,d0.w*2),(a0)+
move.w (a2,d2.l*2),(a0)+
ENDR
dbf d6,.paint_loop
adda.l a6,a3
adda.l a6,a4
adda.l a6,a5
dbf d7,.yloop
rts
TunnelBlob.paintVga60:
lea 160*2(a0),a1
.yloop: moveq #160/10-1,d6
.paint_loop:
REPT 5
move.l (a3)+,d0
add.l (a4)+,d0
add.l (a5)+,d0
and.l d1,d0
move.w (a2,d0.w*2),2(a0)
swap d0
move.w (a2,d0.w*2),(a0)
move.l (a0)+,(a1)+
ENDR
dbf d6,.paint_loop
adda.l a6,a0
adda.l a6,a1
adda.l a6,a3
adda.l a6,a4
adda.l a6,a5
dbf d7,.yloop
rts
TunnelBlob.paintRgb50:
.yloop: moveq #160/10-1,d6
.paint_loop:
REPT 5
move.l (a3)+,d0
add.l (a4)+,d0
add.l (a5)+,d0
and.l d1,d0
move.w (a2,d0.w*2),4(a0)
swap d0
move.w (a2,d0.w*2),(a0)
move.w (a0)+,(a0)+
move.w (a0)+,(a0)+
ENDR
dbra d6,.paint_loop
adda.l a6,a3
adda.l a6,a4
adda.l a6,a5
dbra d7,.yloop
rts
;======= OBJECT DATA ========
DATA
TunnelBlob.trajectRout:
DC.L TunnelBlob.moveToghether
;======= OBJECT RESERVES ========
BSS
TunnelBlob.time:
DS.L 1
TunnelBlob.sepStart:
DS.L 1
TunnelBlob.scaleX:
DS.W 1
TunnelBlob.scaleY:
DS.W 1
TunnelBlob.invScaleX:
DS.W 1
TunnelBlob.invScaleY:
DS.W 1
TunnelBlob.trajMode:
DS.W 1