; twirl v2
; Twirl + Mpt-Music ; fuer party
; start: 03.01.97
; ende: 19.02.97
; (c) by heaven of TQA
; 1. start twirlgen2!
; include files:
; sin3c40.obj
; mpttwirl.obj
; greg23.mpt
; bufflo.obj
; kreistab.obj
; unreal.pic
; font at $2800
ORG $3000
Nmien: EQU $d40e
Dlistv: EQU 560
Dlist: EQU $7900
Dliv: EQU 512
Wsync: EQU $d40a
Screen: EQU $b000
V0: EQU $80
V1: EQU $82
Start1: EQU $3f
Start1l: EQU $3d
Start2: EQU $40
Start2l: EQU $3e
Count: EQU $0e
Countl: EQU $0f
Count2: EQU $12
Count2l: EQU $13
Add1: EQU $00
Add1l: EQU $04
Add2: EQU $01
Add2l: EQU $05
Off1: EQU $02
Off1l: EQU $06
Off2: EQU $03
Off2l: EQU $07
Sinl: EQU $3d00
Sin: EQU $3c00
Cosl: EQU $3f00
Cos: EQU $3e00
Max: EQU 35
;
; feuer-variablen
;
Fbuff: EQU $4000
Firetabl: EQU $7c00
Firetabh: EQU $7d00
Scrtabl: EQU $7e00
Scrtabh: EQU $7f00
Kreisx: EQU $ba00
Kreisy: EQU $ba80
Multab: EQU $bb00
X1: EQU 0
X2: EQU 1
Y1: EQU 2
Y2: EQU 3
M: EQU 4
S: EQU 5
I: EQU 6
J: EQU 7
P0: EQU $5400
P1: EQU $5500
P2: EQU $5600
P3: EQU $5700
;
Init: JSR Dlinit
JSR Copy
LDA #$28
STA $d409
LDX #$a0
LDA #0
STA $fa
JSR $7891
LDA #0
STA Nmien
STA Fx
LDA #Dli
STA 512
LDA #>Dli
STA 513
LDA #Vbi
STA 546
LDA #>Vbi
STA 547
LDA #$40
STA Nmien
LDA #Dlist
STA Dlistv
LDA #>Dlist
STA Dlistv+1
LDA #$40
STA $d01b
; JMP Fire
JSR Effekt0
LDA #0
STA Fx2
LDA #$40
STA $d01b
Main: LDA #0
STA Zaehler
JSR Setpara99
Main1:
Twirl:
Loop:
LDA #0
STA Vbifertig
Loop0: LDA Vbifertig
BEQ Loop0
JSR $4000
CLC
LDA Start1
ADC Add1
STA Start1
STA Count
CLC
LDA Start2
ADC Add2
STA Start2
STA Count2
LDX #0
Loop1: LDY Count
CLC
LDA Sin,Y
LDY Count2
ADC Cos,Y
Setand: AND #$3f
STA $80,X
CLC
LDA Count
ADC Off1
STA Count
CLC
LDA Count2
ADC Off2
STA Count2
INX
CPX #Max
BNE Loop1
Loop33: LDA Zaehler
CMP #2
BCS Loop34
JMP Loop
Loop34: ; JSR Fade
LDA #0
STA Zaehler
INC Fx2
LDA #$40
STA $d01b
LDA $fa
CMP #$49
BCS Loop36
LDA Fx2
CMP #4
BNE Loop35
LDA #$00
STA $d01b
LDA #Dlist0
STA Dlistv
LDA #>Dlist0
STA Dlistv+1
LDA #Text1
STA Lms+1
JSR Fade
LDA #0
STA Fx2
JSR Credits
JSR Buffinit
; 2. patch
; center-pixel aproximation
LDA #$65
STA $5985
LDA #$88
STA $5986
CLC
LDA Setpara990+1
ADC #16
STA Setpara990+1
BCC L87
INC Setpara990+2
L87:
LDA #$ea
STA Setand
STA Setand+1
LDA #15
STA Maxwert
INC Fx
LDA #$3c
JSR Wait_mus
JSR Fade
LDA #Dlist
STA Dlistv
STA $d402
LDA #>Dlist
STA $d403
STA Dlistv+1
LDA #$40
STA $d01b
JSR Setlines
Loop35: LDA $fa
CMP #$48
BCS Loop36
JMP Main
Loop36:
; JMP $e474
JMP Fire
; JMP Main
Dli: PHA
Col2: LDA #$00
STA Wsync
STA $d01a
LDA #$00
STA $d00d
STA $d00e
Col: LDA #0
STA Wsync
STA $d01a
LDA #$ff
STA $d00d
STA $d00e
Colpm0: LDA #$00
STA $d012
Colpm1: LDA #0
STA $d013
LDA #Dli00
STA Dliv
LDA #>Dli00
STA Dliv+1
PLA
RTI
Dli00: PHA
Col3: LDA #0
STA Wsync
STA $d01a
LDA #0
STA $d00d
STA $d00e
STA Wsync
STA $d01a
LDA #Dli
STA Dliv
LDA #>Dli
STA Dliv+1
PLA
RTI
Dli2: PHA
Col5: LDA #$0f
STA Wsync
STA $d01a
Col4: LDA #$00
STA Wsync
STA $d01a
PLA
RTI
Wait: LDA #1
STA 540
Wait0: LDA 540
BNE Wait0
RTS
Dlinit: LDA #Screen
STA Adr
LDA #>Screen
STA Adr+1
LDA #Dlist+5
STA V0
LDA #>Dlist
STA V0+1
LDA #$70
STA Dlist
STA Dlist+1
LDA #$50
STA Dlist+2
LDA #$80
STA Dlist+3
LDA #$00
STA Dlist+4
LDX #48
Dlinit0: LDA #$4f
LDY #0
STA (V0),Y
LDY #3
STA (V0),Y
LDY #6
STA (V0),Y
LDY #9
STA (V0),Y
LDA Adr
LDY #1
STA (V0),Y
LDY #4
STA (V0),Y
LDY #7
STA (V0),Y
LDY #10
STA (V0),Y
LDA Adr+1
LDY #2
STA (V0),Y
LDY #5
STA (V0),Y
LDY #8
STA (V0),Y
LDY #11
STA (V0),Y
CLC
LDA V0
ADC #12
STA V0
BCC Dl99
INC V0+1
Dl99:
CLC
LDA Adr
ADC #40
STA Adr
BCC Dl98
INC Adr+1
Dl98: DEX
BEQ Dlinit1
JMP Dlinit0
Dlinit1: LDY #0
SEC
LDA V0
SBC #15
STA V0
LDA V0+1
SBC #0
STA V0+1
LDA #$cf
STA (V0),Y
INY
INY
INY
LDA #$41
STA (V0),Y
LDA #Dlist
INY
STA (V0),Y
INY
LDA #>Dlist
STA (V0),Y
RTS
Buffinit: LDY #16
Buff0: LDX #0
TXA
Buffart: LSR
AND #$1f
TAX
LDA Muster,X
Buff3: STA $8000
LDA Muster,X
ASL
ASL
ASL
ASL
Buff4: STA $9000
INC Buff3+1
INC Buff4+1
INC Buff0+1
LDA Buff0+1
BNE Buff0
INC Buff3+2
INC Buff4+2
DEY
BNE Buff0 ; buff2
LDA #$80
STA Buff3+2
LDA #$90
STA Buff4+2
RTS
Copy: LDA #0
STA Copy0+1
STA Copy1+1
LDA #$80
STA Copy0+2
LDA #$90
STA Copy1+2
Copy3: LDX #0
Copy0: LDA $ffff,X
CLC
ASL
ASL
ASL
ASL
Copy1: STA $ffff,X
INX
BNE Copy0
INC Copy0+2
INC Copy1+2
LDA Copy0+2
CMP #$8f
BCC Copy3
LDX #0
LDA #0
Copy2: STA $8a00,X
STA $9a00,X
INX
BNE Copy2
LDA #$00
STA $5985
LDA #$8a
STA $5986
RTS
Vbi:
DEC 540
LDA Dlistv
STA $d402
LDA Dlistv+1
STA $d403
Vbiplay: JSR $7500
LDA #$40
STA Vbifertig
LDA $fa
CMP Old
BEQ Vbiend
INC Zaehler
LDA $fa
STA Old
Vbiend:
PLA
TAY
PLA
TAX
PLA
RTI
Effekt0: LDA #0
STA $d400
STA $d01a
LDA #4
JSR Wait_mus
LDA #15
STA Merk
LDA #Dlist0
STA Dlistv
LDA #>Dlist0
STA Dlistv+1
JSR Fade
LDA #0
STA Col2+1
LDA #15
STA $d016
LDX #0
Effekt01: LDA #0
STA $80,X
INX
CPX #Max
BNE Effekt01
LDA #$c0
STA Nmien
LDA #$06
JSR Wait_mus
LDA #0
STA $d012
STA $d013
LDA #3
STA 53256
STA 53257
LDA #$2f
STA 53248
LDA #$b1
STA 53249
JSR Setlines
LDA #Dlist
STA Dlistv
LDA #>Dlist
STA Dlistv+1
LDA #$40
STA $d01b
JSR $4000
LDA #$08
JSR Wait_mus
JSR Fadeline
LDA #15
STA Setcol+1
LDA #$12
JSR Wait_mus
LDA #0
STA 53248
STA 53249
JSR Fade
LDA #1
STA Wait+1
LDA #$40
STA $d01b
Eff02: JSR Wait
JSR $4000
LDX #0
Eff03: INC $80,X
INC $80,X
LDA $80,X
AND #$3f
STA $80,X
INX
CPX #Max
BNE Eff03
LDA $fa
CMP #$19
BCC Eff02
JSR Fade
LDA #$40
STA $d01b
Eff04: JSR Wait
JSR $4000
LDX #0
Eff05: DEC $80,X
DEC $80,X
LDA $80,X
AND #$3f
STA $80,X
INX
CPX #Max
BNE Eff05
LDA $fa
CMP #$22
BNE Eff04
RTS
Fadeline: LDA #1
STA Wait+1
Fadeline0: JSR Wait
INC Col2+1
INC Col3+1
LDA Col2+1
STA $d014
STA $d015
LDA Col2+1
CMP #15
BCC Fadeline0
LDA #$0a
JSR Wait_mus
LDX #0
Fadeline1: JSR Wait
STX Colpm0+1
INX
CPX #15
BCC Fadeline1
LDA #0
TAX
STA 53248
LDA #$0c
JSR Wait_mus
Fadeline2: JSR Wait
STX Colpm1+1
INX
CPX #15
BCC Fadeline2
LDA #0
STA 53249
Fadeline3: LDA Wsync+1
BPL Fadeline3
LDA #Dli2
STA Dliv
LDA #>Dli2
STA Dliv+1
RTS
Setlines: LDA #%10100000
STA $d011
LDA #0
STA $d00c
Setcol: LDA #0
STA $d014
STA $d015
LDA #$4f
STA 53254
LDA #$b0
STA 53255
RTS
Fade: LDA #1
STA Wait+1
LDA #15
STA Merk
LDA #$00
STA $d01b
STA $d400
STA 53254
STA 53255
Fade0: JSR Wait
DEC Merk
LDA Merk
STA $d017
STA $d018
STA $d01a
STA $d014
STA $d015
STA Col2+1
BNE Fade0
LDA #15
STA $d017
STA Col2+1
STA $d014
STA $d015
LDA #$4f
STA 53254
LDA #$b0
STA 53255
LDA #34
STA $d400
RTS
Zaehler: DFW 0
Adr: DFW 0
Muster: DFB 0,1,2,3,4,5,6,7
DFB 8,9,10,11,12,13,14,15
DFB 15,14,13,12,11,10,9,8
DFB 7,6,5,4,3,2,1,0
Fx2: DFB 0
Old: DFB 0
Merk: DFB 0
Wert: DFB 0
Maxwert: DFB 31
Vbifertig: DFB 0
Fx: DFB 0
; Dummy: DFB 0,0,0,0,0,0,0,0
Dlist0: DFB $70,$70,$70,$70,$70,$70,$42
Lms: DFW Text0
DFB $42
DFW Trenn
DFB $20,32,2,$60
DFB $42
Lms2: DFW Text00
DFB 32,2
DFB $41
DFW Dlist0
Text0: ASC % Welcome to a new Taquart-Intro !!! %
Trenn: ASC %-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=%
ASC % %
Text00: ASC %(This intro is esp. for Competition at %
ASC %RuSH-HouR-Party by Shadows and Freezers)%
Text1: ASC %CrEdItS: %
ASC % %
Text10: ASC %coDE: %
ASC % HeAvEn %
ASC %muSIc: %
ASC % Gr3G %
ASC %grAFix: %
ASC % logo:Dracon,pic:Toxic at Assembly %
ASC %D-SIgn: %
ASC % HeAvEn and Slaves %
ASC %Greetinx to:LBS,GREG,DRACON,Waldi,CHRIS,%
ASC %Gumi,Mith,Dhor,Jaskier,T.Bene,SCG,Q'Modos%
Twirldata: DFB 254,2,0,0
DFB 1,2,2,1
DFB 255,1,254,253
DFB 255,1,2,0
; DFB 0,1,254,254
; DFB 0,255,1,254
; DFB 1,2,2,1
; fuer wasser-twirl
DFB $04,$09,$f9,$07
DFB $fa,$fb,$f9,$f5
DFB $03,$fe,$00,$fd
DFB $0c,$0a,$0d,$0b
; DFB $05,$07,$05,$00
; DFB $00,$f9,$fa,$06
; DFB $ff,$00,$fc,$06
; DFB $fa,$fb,$08,$06
; DFB $05,$07,$05,$00
; DFB $00,$f9,$fa,$06
Setpara99: LDA Fx2
CLC
ASL
ASL
TAX
LDY #0
Setpara990: LDA Twirldata,X
STA Add1,Y
INY
INX
CPY #4
BCC Setpara990
RTS
Draw_line:
; u=x2-x1
SEC
LDA X2
SBC X1
STA U
; v=y2-y1
SEC
LDA Y2
SBC Y1
STA V
BPL Line1
LDA #-1 ;
STA D1y+1
CLC
LDA V
EOR #$ff
ADC #1
STA N+1
BNE Line2
Line1:
STA N+1
LDA #1
STA D1y+1
Line2:
LDA U
BPL Line3
LDA #-1
STA D1x+1
STA D2x+1
CLC
LDA U
EOR #$ff
ADC #1
STA M
BNE Line4
Line3: STA M
LDA #1
STA D1x+1
STA D2x+1
Line4: LDA #0
STA D2y+1
; if not (m>n)
LDA N+1
CMP M
BCC Line5
LDA #0
STA D2x+1
LDA D1y+1
STA D2y+1
LDX N+1
LDA M
STA N+1
STX M
Line5: LDA M
LSR
STA S
LDA #0
STA I
Lineloop:
LDY X1
LDX Y1
LDA Firetabl,X
STA Putpixel+1
LDA Firetabh,X
STA Putpixel+2
LDA #15
Putpixel: STA $ffff,Y
CLC
LDA S
N: ADC #0
STA S
; if not (sFbuff
STA V0+1
LDA #Screen+8
STA V1
LDA #>Screen
STA V1+1
LDX #0
Tab0: LDA V0
STA Firetabl,X
LDA V0+1
STA Firetabh,X
LDA V1
STA Scrtabl,X
LDA V1+1
STA Scrtabh,X
CLC
LDA V0
ADC #48
STA V0
LDA V0+1
ADC #0
STA V0+1
CLC
LDA V1
ADC #40
STA V1
LDA V1+1
ADC #0
STA V1+1
INX
BNE Tab0
Tab1: TXA
CLC
ASL
ASL
ASL
ASL
STA Multab,X
INX
BNE Tab1
RTS
U: DFB 0
V: DFB 0
Fcount: DFB 0
Fire:
JSR Tabinit
JSR Clsfire
JSR Fade
LDA #$40
STA $d01b
LDA #$f0
STA Col4+1
JSR Pminit
Fireloop: LDA #0
STA Fcount
LDA #1
STA Wait+1
Fireloop0: INC Fcount
LDA Fcount
AND #$3f
TAX
LDA Kreisx,X
STA X1
STA Fireloop1+1
STA Fireloop9+1
LDA Kreisy,X
ADC #4
STA Y1
STA Fireloop2+1
STA Fireloop10+1
LDA #23
STA X2
LDA #47
STA Y2
JSR Draw_line
LDA Fcount
CLC
ADC #16
AND #$3f
TAX
LDA Kreisx,X
STA X1
STA Fireloop3+1
LDA Kreisy,X
ADC #4
STA Y1
STA Fireloop4+1
JSR Draw_line
LDA Fcount
CLC
ADC #32
AND #$3f
TAX
LDA Kreisx,X
STA X1
STA Fireloop5+1
STA Fireloop7+1
LDA Kreisy,X
ADC #4
STA Y1
STA Fireloop6+1
STA Fireloop8+1
JSR Draw_line
Fireloop1: LDA #0
STA X1
Fireloop2: LDA #0
STA Y1
Fireloop3: LDA #0
STA X2
Fireloop4: LDA #0
STA Y2
JSR Draw_line
Fireloop5: LDA #0
STA X1
Fireloop6: LDA #0
STA Y1
JSR Draw_line
Fireloop7: LDA #0
STA X1
Fireloop8: LDA #0
STA Y1
Fireloop9: LDA #0
STA X2
Fireloop10: LDA #0
STA Y2
JSR Draw_line
INC Fcount
Firemain: LDA #Fbuff
STA V0
LDA #>Fbuff
STA V0+1
LDX #0
Fire0: LDA 53770
Firemode: AND #$00
STA Fbuff+48*48,X
INX
CPX #48*3
BNE Fire0
LDX #48 ; 48 zeilen
Fire1: CLC
LDY #49
LDA (V0),Y
LDY #95
ADC (V0),Y
LDY #96
ADC (V0),Y
LDY #97
ADC (V0),Y
BEQ Fire2
SEC
SBC #1
LSR
LSR
Fire2: LDY #1
STA (V0),Y
INC V0
BNE Fire3
INC V0+1
Fire3: LDA V0+1
CMP #$49
BCC Fire1
; JSR Wait
Firecopy: LDA #0
STA J
Firecopy0: LDX J
LDA Scrtabl,X
STA V0
LDA Scrtabh,X
STA V0+1
LDA Firetabl,X
STA V1
LDA Firetabh,X
STA V1+1
LDA #0
STA Firecopy1+1
LDA #0
STA I
Firecopy1: LDY #0
LDA (V1),Y
TAX
LDA Multab,X
INY
ORA (V1),Y
LDY I
STA (V0),Y
INC Firecopy1+1
INC Firecopy1+1
INC I
LDA I
CMP #24
BCC Firecopy1
INC J
LDA J
CMP #48
BCC Firecopy0
LDA $fa
CMP #$4a
BNE Fire99
LDA #$12
STA Firemode+1
LDA #72
Fire66: STA Fcount2
Fire99:
DEC Fcount2
Fire100:
BEQ Introend
Fire98: JMP Fireloop0
Introend: LDA #0
STA Firemode+1
LDA #$60
STA 53248
LDA #$70
STA 53249
LDA #$80
STA 53250
LDA #$90
STA 53251
LDA #$ea
STA Fire66
STA Fire66+1
LDA #$60
STA Fire98
Introend0: JSR Firemain
LDA $fa
CMP #$5c
BCC Introend0
Introend9: LDA $fb
CMP #$3f
BCC Introend9
LDA #15
STA FCount2
LDA #2
STA Wait+1
Introend1: JSR Wait
LDA Fcount2
STA $d012
STA $d013
STA $d014
STA $d015
STA Col5+1
DEC Fcount2
BNE Introend1
JSR Fade
LDX #0
LDA #0
Introend2:
STA $d400
STA 53248,X
INX
CPX #8
BCC Introend2
JSR $78dd
Ende: JMP Ende
Pminit: LDX #0
Pminit0: LDA #0
STA P0,X
STA P1,X
STA P2,X
STA P3,X
LDA #%1010000
STA $5300,X
INX
BNE Pminit0
LDY #$60
Pminit1: LDA Pmdata0,X
STA P0,Y
STA P0+1,Y
LDA Pmdata1,X
STA P1,Y
STA P1+1,Y
LDA Pmdata2,X
STA P2,Y
STA P2+1,Y
LDA Pmdata3,X
STA P3,Y
STA P3+1,Y
INX
INY
INY
CPX #21
BCC Pminit1
LDX #0
Setpm99: LDA #1
STA 53256,X
LDA #15
STA $d012,X
INX
CPX #4
BCC Setpm99
LDA #3
STA 53277
LDA #$50
STA 54279
LDA #62
STA $d400
LDA #$4e
STA 53254
LDA #$af
STA 53255
RTS
Clsfire: LDX #0
TXA
Clsfire0: STA $4000,X
STA $4100,X
STA $4200,X
STA $4300,X
STA $4400,X
STA $4500,X
STA $4600,X
STA $4700,X
STA $4800,X
; STA $4900,X
INX
BNE Clsfire0
RTS
Wait_mus: STA Wait_mus1+1
Wait_mus1: LDA #0
CMP $fa
BNE Wait_mus1
RTS
Pmdata0: DFB %00000001
DFB %00001111
DFB %00111111
DFB %11110000
DFB %11110000
DFB %11000000
DFB 0
DFB 0
DFB 0
DFB %00000011
DFB %00001111
DFB %00001111
DFB 0
DFB %00000001
DFB %00000001
DFB %00000011
DFB %00001110
DFB %00111100
DFB %01100000
DFB 0,0,0
Pmdata1: DFB %11111111
DFB %11111111
DFB %11110011
DFB %00000011
DFB %00000011
DFB %00000110
DFB %00000110
DFB %00001100
DFB %00001100
DFB %01111110
DFB %11111100
DFB %11111100
DFB %11110000
DFB %11100000
DFB %11000001
DFB %10000001
DFB 1,1,0,0,0
Pmdata2: DFB %10000000
DFB %10000000
DFB %10000000
DFB 0
DFB 0
DFB 0
DFB %00000110
DFB %00001110
DFB %00000100
DFB %00010000
DFB %00111000
DFB %01110001
DFB %11110011
DFB %11100011
DFB %11000011
DFB %10001111
DFB %10011111
DFB %11110111
DFB %11100000
DFB 0,0
Pmdata3: DFB 0,0,0,0,0,0,0,0,0,0
DFB %00001111
DFB %11011110
DFB %10111110
DFB %00101100
DFB %01001000
DFB %10011010
DFB %00111110
DFB %00111100
DFB %00111000
DFB 0,0
Credits: LDA #Text10
STA Lms2
LDA #>Text10
STA Lms2+1
LDA #0
STA 53254
STA 53255
LDA #$80
STA Col4+1
LDA #90
STA Wait+1
JSR Wait
Credits0:
LDA $a5
CMP #15
BCC Credits1
CLC
LDA Lms2
ADC #80
STA Lms2
BCC Credits98
INC Lms2+1
Credits98:
LDA #20
STA Wait+1
JSR Wait
Credits2: LDA $a5
CMP #15
BCC Credits2
; JSR Wait
Credits1:
LDA $fa
CMP #$37
BCC Credits0
Credits3: LDA $fa
CMP #$39
BCC Credits3
RTS
Fcount2: DFB 0