{$M 32768,0,158000} {Viewer for ASC23DP by ECH/ATC and Joker/ATC} uses dos,math3d,MSE_TP,crt,lzh; Var SinTable,CosTable: Array[0..255] of integer; Time : Longint ABSOLUTE $0040:$006C; time2 : longint; Sin2Table,Cos2Table: Array[0..255] of integer; letter :char; bitp :pointer; nomusic : boolean; bitm :word; filein :file; fileout :file; const Black =0; Blue =1; Green =2; Cyan =3; Red =4; Magenta =5; Brown =6; LightGray =7; DarkGray =8; LightBlue =9; LightGreen =10; LightCyan =11; LightRed =12; LightMagenta =13; Yellow =14; White =15; const felles=7; forsinkelse=0; modname='musikk.gdm'; Type FaceType = Record Null, {Is just set to nill, so FaceType = 8 byte} A, B, C : Word; End; VertexType = Record X, Y, Z, Dist : Word; {Dist = Distance from Origo} End; type tScr = array[0..63999] of Byte; Const MaxFaces = 700; MaxVertices = 700; var colorarr : array[0..256] of char; textbuffer : pointer; txtbuff : word; screensht1 : pointer; y80 : array[0..50] of word; shot1 : word; screensht2 : pointer; shot2 : word; democounter: integer; col : array[0..256] of byte; x,y,z : word; r,g,b : byte; f : text; x1,x2,y1,y2 : integer; hy1,hy2,hx1,hx2 : char; x1p,x2p : shortint; y1p,y2p : shortint; startx,endx : array[0..1100] of integer; startcol,endcol : array[0..1100] of integer; t,t2,t3,t4,t5 : integer; tab1,tab2 : array[0..511] of byte; moded : array[0..255] of byte; color : byte; i1,j1 : byte; a1,a2 : word; i4,j5 : byte; a4,a5 : word; i2,j2 : word; c,qc : word; xax : integer; FaceList : Array[0..MaxFaces] of FaceType; VertexList : Array[0..MaxVertices] of VertexType; NbrOfFace, NbrOfVertex : Word; pind : array[0..maxfaces] of integer; coords : array[0..MaxVertices] of record x,y,z,z2,col:integer;hid:boolean end; triangles : record xs,ys,x,y,pos,rotspeed : integer end; SoundCardName : String; DMA, IRQ : Byte; BaseIO : Word; SampleRate : Word; DMABuffer : Word; Handle : File; Header : GDMHeader; EMSFlag : Word; MusicChannels : Word; ChannelCount : Word; ExitProgram : Boolean; Type TE = Record X : Integer; px, py : Byte; End; Table = Array[0..599] of TE; PTable = ^Table; const size=70; pointnum=7; planenum=5; points:array[0..pointnum,0..2] of integer=( (-size,-size,-size),( size,-size,-size),( size, size,-size),(-size, size,-size), (-size,-size, size),( size,-size, size),( size, size, size),(-size, size, size)); planes:array[0..planenum,0..3] of byte=( (0,1,2,3),(5,4,7,6),(1,5,6,2),(4,0,3,7), (3,2,6,7),(4,5,1,0)); var bitmap : array[0..49,0..49] of byte; unicolor : byte; pxstep,pystep : integer; pxval ,pyval : integer; o1 : integer; count : integer; Left, Right : Table; point : array[0..pointnum] of record x,y,z :integer; end; function sar(num:integer;LR:byte):integer; var tt:integer; begin asm mov ax,num mov bl,lr sar ax,cl mov tt,ax end; sar:=tt; end; procedure writemusic; begin gotoxy(1,1); writeln(musicorder($ff)); writeln(musicrow); end; function sal(num:integer;LR:byte):integer; var tt:integer; begin asm mov ax,num mov cl,lr sal ax,cl mov tt,ax end; sal:=tt; end; function DeleteFile(FN : PathStr) : Boolean; var Regs : Registers; begin FN := FN + #0; { Add NUL chr for DOS } Regs.AH := $41; Regs.DX := Ofs(FN) + 1; { Add 1 to bypass length byte } Regs.DS := Seg(FN); MsDos(Regs); DeleteFile := NOT (Regs.Flags AND $0 = $0) end; procedure flip(fra,til:word); assembler; asm mov ax,til mov es,ax mov dx,ds mov ax,fra mov ds,ax xor si,si xor di,di mov cx,2080 db $66; rep movsw mov ds,dx end; procedure clrscr2(segment:word); begin asm mov es,segment xor di,di mov cx,2080 db $66; xor ax,ax db $66; rep stosw end; end; function getchar(x,y,segment:word) :char; var temp:char; begin asm mov ax,y shl ax,4 mov bx,ax shl ax,2 add ax,bx add ax,x mov es,segment mov si,ax mov al,[es:si] mov temp,al end; getchar:=temp; end; PROCEDURE RETRACE; ASSEMBLER; ASM mov dx,3dah @@vert1: in al,dx test al,8 jz @@vert1 @@vert2: in al,dx test al,8 jnz @@vert2 END; procedure switch(one,two:longint); var temp:longint; begin temp:=one; one:=two; two:=temp; end; procedure plot(position:word; value:char;color:byte); assembler; asm mov ax,txtbuff mov es,ax mov al,value mov ah,color mov si,position shl si,1 mov [es:si],ax end; PROCEDURE Cursor(On: Boolean); BEGIN IF On=FALSE THEN BEGIN ASM mov ah, 01h mov cl, 20h mov ch, 20h int 10h END; END ELSE BEGIN ASM mov ah, 01h mov cl, 06h mov ch, 07h int 10h END; END; END; procedure plotxy(position:word;x,y:byte;value:char;color:byte;segment:word); assembler; asm mov si,position cmp si,65535 jne @@pos xor dh,dh mov dl,y shl dx,4 mov ax,dx shl dx,2 add dx,ax mov al,x xor ah,ah add dx,ax mov si,dx @@pos: mov es,segment mov al,value mov ah,color shl si,1 mov [es:si],ax end; function moded255(value:integer):byte; begin repeat if value<0 then inc(value,255); if value>255 then dec(value,255); until (value>=0) and (value<=255); moded255:=moded[value]; end; function changecol :char; begin case (c mod 32) of 0: changecol:=' '; 1: changecol:=' '; 2: changecol:=''; 3: changecol:=''; 4: changecol:=':'; 5: changecol:=';'; 6: changecol:=''; 7: changecol:=''; 8: changecol:='O'; 9: changecol:=''; 10: changecol:='&'; 11: changecol:='#'; 12: changecol:=''; 13: changecol:=''; 14: changecol:=''; 15: changecol:=''; 16: changecol:=''; 17: changecol:=''; 18: changecol:=''; 19: changecol:=''; 20: changecol:='#'; 21: changecol:='&'; 22: changecol:=''; 23: changecol:='O'; 24: changecol:=''; 25: changecol:=''; 26: changecol:=';'; 27: changecol:=':'; 28: changecol:=''; 29: changecol:=''; 30: changecol:=' '; 31: changecol:=' '; end; color:=(c div 32)+1; end; function synced(patt,row:byte):boolean; begin if nomusic then begin if (time2+(patt shl 7)+(row shl 1))