From: sparky4 Date: Wed, 3 Aug 2016 14:32:13 +0000 (-0500) Subject: wwww X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=d1afc5ac72e8a6ef18d244d66788fce7b783e9a8;p=plz.git wwww --- diff --git a/PLZPART/ASMYT.OBJ b/PLZPART/ASMYT.OBJ deleted file mode 100755 index cccfe42..0000000 Binary files a/PLZPART/ASMYT.OBJ and /dev/null differ diff --git a/PLZPART/COPPER.OBJ b/PLZPART/COPPER.OBJ deleted file mode 100755 index 211743a..0000000 Binary files a/PLZPART/COPPER.OBJ and /dev/null differ diff --git a/PLZPART/INCLUDE.OBJ b/PLZPART/INCLUDE.OBJ deleted file mode 100755 index 399b9e2..0000000 Binary files a/PLZPART/INCLUDE.OBJ and /dev/null differ diff --git a/PLZPART/MAIN.C b/PLZPART/MAIN.C index bf421c4..5bf875e 100755 --- a/PLZPART/MAIN.C +++ b/PLZPART/MAIN.C @@ -1,13 +1,26 @@ -#include "..\dis\dis.h" +#include +#include "../dis/dis.h" +#include "graphics.h" +#include "opengl.h" +#include "common.h" -extern plz(); -extern vect(); +extern void plz(); +extern void vect(); -main() { +int main(int argc, char **argv) { + int a = adjust_framerate(); dis_partstart(); + + if (init_graphics("Plzpart", argc, argv) < 0) { + fprintf(stderr, "Can't init graphics\n"); + return -1; + }; + + init_opengl(); init_copper(); initvect(); plz(); - vect(); + //vect(); close_copper(); - } \ No newline at end of file + return 0; + } diff --git a/PLZPART/Makefile b/PLZPART/Makefile new file mode 100755 index 0000000..ab5b059 --- /dev/null +++ b/PLZPART/Makefile @@ -0,0 +1,21 @@ + +PLZPART_OBJS = plz.o copper.o asmyt.o tweak.o vect.o vga.o opengl.o \ + plza.o plzfill.o sinit.o spline.o main.o + +PLZPART_PATH = plzpart + +PLZPART_PATH_OBJS = $(addprefix $(PLZPART_PATH)/,$(PLZPART_OBJS)) + +PLZPART_BIN = plzpart + +OBJS += $(PLZPART_PATH_OBJS) + +default-plzpart: + $(MAKE) -C .. plzpart-all + +plzpart-all: $(PLZPART_PATH)/$(PLZPART_BIN) + +$(PLZPART_PATH)/$(PLZPART_BIN): $(PLZPART_PATH_OBJS) + $(LD) -o $@ $(LDFLAGS) $(PLZPART_PATH_OBJS) $(LIBS) + +plz.c: tweak.h ptau.pre diff --git a/PLZPART/PLZ.C b/PLZPART/PLZ.C index 420736d..085fa8d 100755 --- a/PLZPART/PLZ.C +++ b/PLZPART/PLZ.C @@ -1,11 +1,17 @@ #include +#include +#include #include -#include -#include +//#include +//#include #include "tweak.h" +#include "../dis/dis.h" +#include "opengl.h" +#include "graphics.h" +#include "common.h" -//#define DO_TABLES -//#define DPII (3.1415926535*2.0) +#define DO_TABLES +#define DPII (3.1415926535*2.0) #define LINELEN 41 #define MAXY 280 @@ -28,9 +34,13 @@ extern far int do_pal; extern int plzline(int y, int vseg); extern int setplzparas(int c1, int c2, int c3, int c4); extern int set_plzstart(int y); -extern char far psini[16384]; -extern int far lsini4[8192]; -extern int far lsini16[8192]; +//extern char far psini[16384]; +//extern int far lsini4[8192]; +//extern int far lsini16[8192]; + +unsigned char *psini; +short *lsini4; +short *lsini16; //int (* vmem)[LINELEN]=MK_FP(0x0a000,0); //char psini[16384]= @@ -38,10 +48,12 @@ extern int far lsini16[8192]; //char lsini[16384]= //#include "lsini.pre" +void init_plz(void); + char ptau[256]= #include "ptau.pre" -int pals[6][768]; +int16_t pals[6][768]; int curpal=0; int timetable[10]={64*6*2-45,64*6*4-45,64*6*5-45,64*6*6-45,64*6*7+90,0}; int ttptr=0; @@ -59,28 +71,35 @@ int inittable[10][8]={{1000,2000,3000,4000,3500,2300,3900,3670}, {1000,2000,3000,4000,3500,2300,3900,3670}, {1000,2000,3000,4000,3500,2300,3900,3670}}; -plz(){ - register int x,y; - int *ptr; +int fixme_dis_getmframe() +{ + static int s_nResult = 0; + s_nResult++; + return s_nResult; +} + +void plz(){ + register int /*x,*/y; + //int *ptr; long tim=0,count=0; - int ch=0,sync=2; + //int ch=0,sync=2; while(dis_musplus()<0 && !dis_exit()); dis_setmframe(0); init_plz(); cop_drop=128; - cop_fadepal=pals[curpal++]; + cop_fadepal=(char *)pals[curpal++]; frame_count=0; while(!dis_exit()) { tim+=frame_count; frame_count=0; count++; - if(dis_getmframe()>timetable[ttptr]) + if(fixme_dis_getmframe()>timetable[ttptr]) { memset(fadepal,0,768); cop_drop=1; - cop_fadepal=pals[curpal++]; + cop_fadepal=(char *)pals[curpal++]; ttptr++; il1=inittable[ttptr][0]; il2=inittable[ttptr][1]; @@ -93,47 +112,53 @@ plz(){ } if(curpal==5 && cop_drop>64) break; - asm mov dx, 3c4h - asm mov ax, 0a02h - asm out dx, ax + // [nk] VGA: select bit planes 0,2 (?) + //asm mov dx, 3c4h + //asm mov ax, 0a02h + //asm out dx, ax + + vga_select_bitplanes_02(); setplzparas(k1,k2,k3,k4); for(y=0;y -#include -#include +//#include +//#include #include #include "tweak.h" -extern far do_line(char far *to, int dx, int dy, int cnt, char far *from, long txx1, long txy1, long txx2, long txy2, int dseg); -extern far do_block(int ycnt); -extern far do_clear(char far *vmem, int far *otau, int far *ntau); +extern far void do_line(char far *to, int dx, int dy, int cnt, char far *from, long txx1, long txy1, long txx2, long txy2, int dseg); +extern far void do_block(int ycnt); +extern far void do_clear(char far *vmem, int far *otau, int far *ntau); extern int acstau[256]; int sini[2000]; char (* far vmem)[160]=MK_FP(0x0a000,0); -extern char far kuva1[128][256]; -extern char far kuva2[128][256]; -extern char far kuva3[128][256]; -extern char far dist1[128][256]; +/*extern*/ char far kuva1[128][256]; +/*extern*/ char far kuva2[128][256]; +/*extern*/ char far kuva3[128][256]; +/*extern*/ char far dist1[128][256]; char far buu[1000]; char sinx[128], siny[128]; char pal[768]; @@ -22,8 +22,8 @@ char pal[768]; int clrtau[8][256][2]; int clrptr=0; -initvect() { - int a,b,x,y,s,d=0,p=0,ch; +void initvect() { + int a/*,b*/,x,y,s/*,d=0,p=0,ch*/; for(a=0;a<1524;a++) { @@ -76,13 +76,13 @@ extern far long ay1,ay2,ax1,ax2,xx1,yy1,xx2,yy2; extern far long txx1,txy1,tay1,tax1; extern far long txx2,txy2,tay2,tax2; -int kuvataus[]={FP_SEG(kuva1),FP_SEG(kuva2),FP_SEG(kuva3),FP_SEG(kuva1)}; -int disttaus[]={FP_SEG(dist1),FP_SEG(dist1),FP_SEG(dist1),FP_SEG(dist1)}; +char* kuvataus[]={&kuva1[0][0],&kuva2[0][0],&kuva3[0][0],&kuva1[0][0]}; +char* disttaus[]={&dist1[0][0],&dist1[0][0],&dist1[0][0],&dist1[0][9]}; -do_poly(x1,y1,x2,y2,x3,y3,x4,y4,color, dd) +void do_poly(x1,y1,x2,y2,x3,y3,x4,y4,color, dd) int x1,y1,x2,y2,x3,y3,x4,y4,color, dd; { - int a,b,c,d,n=0,m,s1,s2,d1,d2,dx1,dy1,dx2,dy2; + int a,/*b,c,d,*/n=0,m,s1,s2,d1,d2,dx1,dy1,dx2,dy2; struct points { int x,y; } pnts[4],txt[4]={{64,4},{190,4},{190,60},{64,60}}; @@ -175,7 +175,7 @@ int x1,y1,x2,y2,x3,y3,x4,y4,color, dd; } } -clear() +void clear() { int *otau=clrtau[(clrptr-3)&7], *ntau=clrtau[clrptr]; diff --git a/PLZPART/PLZPART.MAP b/PLZPART/PLZPART.MAP deleted file mode 100755 index aaefa76..0000000 --- a/PLZPART/PLZPART.MAP +++ /dev/null @@ -1,827 +0,0 @@ - - Start Stop Length Name Class - - 00000H 027C3H 027C4H _TEXT CODE - 027C4H 027C4H 00000H ASMYT_TEXT CODE - 027D0H 0FC7BH 0D4ACH PORO CODE - 0FC7CH 10605H 0098AH COPPER_TEXT CODE - 10606H 10606H 00000H INCLUDE_TEXT CODE - 10606H 10606H 00000H PLZA_TEXT CODE - 10610H 12CCDH 026BEH LERSSICODE CODE - 12CCEH 12EA6H 001D9H TWEAK_TEXT CODE - 12EA7H 136D0H 0082AH PLZ_TEXT CODE - 136D1H 14382H 00CB2H PLZFILL_TEXT CODE - 14383H 14D78H 009F6H VECT_TEXT CODE - 14D79H 14D9BH 00023H MAIN_TEXT CODE - 14DA0H 14E73H 000D4H text_disc CODE - 14E74H 160EDH 0127AH SPLINE_TEXT CODE - 160F0H 18866H 02777H EMU_PROG CODE - 18870H 18E37H 005C8H E87_PROG CODE - 18E40H 18E40H 00000H _FARDATA FAR_DATA - 18E40H 1CE3FH 04000H KAKKA2 FAR_DATA - 1CE40H 24E3FH 08000H KAKKA6 FAR_DATA - 24E40H 28E3FH 04000H KAKKA3 FAR_DATA - 28E40H 2CE3FH 04000H KAKKA4 FAR_DATA - 2CE40H 2D84EH 00A0FH KAKKA5 FAR_DATA - 2D850H 2DC3BH 003ECH PLZFILL5_DATA FAR_DATA - 2DC40H 2DF3FH 00300H VECT5_DATA FAR_DATA - 2DF40H 2DF40H 00000H _FARBSS FAR_BSS - 2DF40H 2DF40H 00000H _OVERLAY_ OVRINFO - 2DF40H 2DF40H 00000H _1STUB_ STUBSEG - 2DF40H 31025H 030E6H _DATA DATA - 31026H 31029H 00004H _CVTSEG DATA - 3102AH 31035H 0000CH _SCNSEG DATA - 31036H 31036H 00000H _CONST CONST - 31036H 31041H 0000CH _INIT_ INITDATA - 31042H 31042H 00000H _INITEND_ INITDATA - 31042H 31047H 00006H _EXIT_ EXITDATA - 31048H 31048H 00000H _EXITEND_ EXITDATA - 31048H 36C7FH 05C38H _BSS BSS - 36C80H 36C80H 00000H _BSSEND BSSEND - 36C80H 36D8FH 00110H _STACK STACK - - -Detailed map of segments - - 0000:0000 0295 C=CODE S=_TEXT G=(none) M=c0.ASM ACBP=28 - 0000:0295 0258 C=CODE S=_TEXT G=(none) M=FPINIT ACBP=28 - 0000:04ED 0000 C=CODE S=_TEXT G=(none) M=E87TRAP ACBP=28 - 0000:04ED 0000 C=CODE S=_TEXT G=(none) M=PROTFLAG ACBP=28 - 0000:04ED 0000 C=CODE S=_TEXT G=(none) M=DEFLT87 ACBP=28 - 0000:04ED 0000 C=CODE S=_TEXT G=(none) M=HUGEVAL ACBP=28 - 0000:04ED 009A C=CODE S=_TEXT G=(none) M=LDTRUNC ACBP=28 - 0000:0587 0000 C=CODE S=_TEXT G=(none) M=MATHWHY ACBP=28 - 0000:0587 01BD C=CODE S=_TEXT G=(none) M=REALCVT ACBP=28 - 0000:0744 0395 C=CODE S=_TEXT G=(none) M=SCANTOD ACBP=28 - 0000:0AD9 020C C=CODE S=_TEXT G=(none) M=XCVT ACBP=28 - 0000:0CE5 00B1 C=CODE S=_TEXT G=(none) M=FPERR ACBP=28 - 0000:0D96 00C9 C=CODE S=_TEXT G=(none) M=_POW10 ACBP=28 - 0000:0E5F 000B C=CODE S=_TEXT G=(none) M=POW10D ACBP=28 - 0000:0E6A 002A C=CODE S=_TEXT G=(none) M=MATHERR ACBP=28 - 0000:0E94 0052 C=CODE S=_TEXT G=(none) M=SIN ACBP=28 - 0000:0EE6 00A9 C=CODE S=_TEXT G=(none) M=_MATHERR ACBP=28 - 0000:0F8F 002C C=CODE S=_TEXT G=(none) M=FFTOL ACBP=28 - 0000:0FBB 002D C=CODE S=_TEXT G=(none) M=ATEXIT ACBP=28 - 0000:0FE8 0000 C=CODE S=_TEXT G=(none) M=CTYPE ACBP=28 - 0000:0FE8 0093 C=CODE S=_TEXT G=(none) M=EXIT ACBP=28 - 0000:107B 0000 C=CODE S=_TEXT G=(none) M=FILES ACBP=28 - 0000:107B 0000 C=CODE S=_TEXT G=(none) M=FILES2 ACBP=28 - 0000:107B 0000 C=CODE S=_TEXT G=(none) M=FPSTKLEN ACBP=28 - 0000:107B 001C C=CODE S=_TEXT G=(none) M=F_SCOPY ACBP=28 - 0000:1097 0021 C=CODE S=_TEXT G=(none) M=H_LLSH ACBP=28 - 0000:10B8 0060 C=CODE S=_TEXT G=(none) M=H_PADD ACBP=28 - 0000:1118 004B C=CODE S=_TEXT G=(none) M=IOERROR ACBP=28 - 0000:1163 0011 C=CODE S=_TEXT G=(none) M=ISATTY ACBP=28 - 0000:1174 00A2 C=CODE S=_TEXT G=(none) M=LONGTOA ACBP=28 - 0000:1216 0029 C=CODE S=_TEXT G=(none) M=LSEEK ACBP=28 - 0000:123F 0021 C=CODE S=_TEXT G=(none) M=N_PCMP ACBP=28 - 0000:1260 00BA C=CODE S=_TEXT G=(none) M=SETUPIO ACBP=28 - 0000:131A 0000 C=CODE S=_TEXT G=(none) M=SIGDATA ACBP=28 - 0000:131A 0000 C=CODE S=_TEXT G=(none) M=STKLEN ACBP=28 - 0000:131A 04DB C=CODE S=_TEXT G=(none) M=VPRINTER ACBP=28 - 0000:17F5 001F C=CODE S=_TEXT G=(none) M=CVTFAK ACBP=28 - 0000:1814 0432 C=CODE S=_TEXT G=(none) M=FARHEAP ACBP=28 - 0000:1C46 0140 C=CODE S=_TEXT G=(none) M=FBRK ACBP=28 - 0000:1D86 0004 C=CODE S=_TEXT G=(none) M=REALCVT ACBP=28 - 0000:1D8A 001C C=CODE S=_TEXT G=(none) M=SETBLOCK ACBP=28 - 0000:1DA6 00CD C=CODE S=_TEXT G=(none) M=FFLUSH ACBP=28 - 0000:1E73 0042 C=CODE S=_TEXT G=(none) M=FLUSHALL ACBP=28 - 0000:1EB5 001C C=CODE S=_TEXT G=(none) M=FPRINTF ACBP=28 - 0000:1ED1 01E2 C=CODE S=_TEXT G=(none) M=FSEEK ACBP=28 - 0000:20B3 0024 C=CODE S=_TEXT G=(none) M=MEMCPY ACBP=28 - 0000:20D7 0043 C=CODE S=_TEXT G=(none) M=MEMSET ACBP=28 - 0000:211A 03C8 C=CODE S=_TEXT G=(none) M=PUTC ACBP=28 - 0000:24E2 011D C=CODE S=_TEXT G=(none) M=SETVBUF ACBP=28 - 0000:25FF 0151 C=CODE S=_TEXT G=(none) M=WRITE ACBP=28 - 0000:2750 003C C=CODE S=_TEXT G=(none) M=WRITEA ACBP=28 - 0000:278C 0038 C=CODE S=_TEXT G=(none) M=XFFLUSH ACBP=28 - 027C:0004 0000 C=CODE S=ASMYT_TEXT G=(none) M=ASMYT.ASM ACBP=48 - 027D:0000 D4AC C=CODE S=PORO G=(none) M=ASMYT.ASM ACBP=60 - 0FC7:000C 098A C=CODE S=COPPER_TEXT G=(none) M=COPPER.ASM ACBP=48 - 1060:0006 0000 C=CODE S=INCLUDE_TEXT G=(none) M=INCLUDE.ASM ACBP=48 - 1060:0006 0000 C=CODE S=PLZA_TEXT G=(none) M=PLZA.ASM ACBP=48 - 1061:0000 26BE C=CODE S=LERSSICODE G=(none) M=PLZA.ASM ACBP=68 - 12CC:000E 01D9 C=CODE S=TWEAK_TEXT G=(none) M=TWEAK.ASM ACBP=48 - 12EA:0007 082A C=CODE S=PLZ_TEXT G=(none) M=PLZ.C ACBP=28 - 136D:0001 0CB2 C=CODE S=PLZFILL_TEXT G=(none) M=PLZFILL.C ACBP=28 - 1438:0003 09F6 C=CODE S=VECT_TEXT G=(none) M=VECT.C ACBP=28 - 14D7:0009 0023 C=CODE S=MAIN_TEXT G=(none) M=MAIN.C ACBP=28 - 14DA:0000 00D4 C=CODE S=text_disc G=(none) M=disc.asm ACBP=68 - 14E7:0004 127A C=CODE S=SPLINE_TEXT G=(none) M=SPLINE.ASM ACBP=48 - 160F:0000 0000 C=CODE S=EMU_PROG G=(none) M=FPINIT ACBP=68 - 160F:0000 2777 C=CODE S=EMU_PROG G=(none) M=EMU086 ACBP=68 - 1887:0000 0000 C=CODE S=E87_PROG G=(none) M=FPINIT ACBP=68 - 1887:0000 03E3 C=CODE S=E87_PROG G=(none) M=EMU087 ACBP=68 - 1887:03F0 01D8 C=CODE S=E87_PROG G=(none) M=E87TRAP ACBP=68 - 18E4:0000 0000 C=FAR_DATA S=_FARDATA G=(none) M=c0.ASM ACBP=68 - 18E4:0000 4000 C=FAR_DATA S=KAKKA2 G=(none) M=INCLUDE.ASM ACBP=60 - 1CE4:0000 8000 C=FAR_DATA S=KAKKA6 G=(none) M=INCLUDE.ASM ACBP=60 - 24E4:0000 4000 C=FAR_DATA S=KAKKA3 G=(none) M=INCLUDE.ASM ACBP=60 - 28E4:0000 4000 C=FAR_DATA S=KAKKA4 G=(none) M=INCLUDE.ASM ACBP=60 - 2CE4:0000 0A0F C=FAR_DATA S=KAKKA5 G=(none) M=INCLUDE.ASM ACBP=60 - 2D85:0000 03EC C=FAR_DATA S=PLZFILL5_DATA G=(none) M=PLZFILL.C ACBP=68 - 2DC4:0000 0300 C=FAR_DATA S=VECT5_DATA G=(none) M=VECT.C ACBP=68 - 2DF4:0000 0000 C=FAR_BSS S=_FARBSS G=(none) M=c0.ASM ACBP=68 - 2DF4:0000 0000 C=OVRINFO S=_OVERLAY_ G=(none) M=c0.ASM ACBP=68 - 2DF4:0000 0000 C=STUBSEG S=_1STUB_ G=(none) M=c0.ASM ACBP=68 - 2DF4:0000 0093 C=DATA S=_DATA G=DGROUP M=c0.ASM ACBP=68 - 2DF4:0094 0000 C=DATA S=_DATA G=DGROUP M=ASMYT.ASM ACBP=48 - 2DF4:0094 0000 C=DATA S=_DATA G=DGROUP M=COPPER.ASM ACBP=48 - 2DF4:0094 0000 C=DATA S=_DATA G=DGROUP M=INCLUDE.ASM ACBP=48 - 2DF4:0094 0000 C=DATA S=_DATA G=DGROUP M=PLZA.ASM ACBP=48 - 2DF4:0094 0000 C=DATA S=_DATA G=DGROUP M=TWEAK.ASM ACBP=48 - 2DF4:0094 01D8 C=DATA S=_DATA G=DGROUP M=PLZ.C ACBP=48 - 2DF4:026C 0036 C=DATA S=_DATA G=DGROUP M=PLZFILL.C ACBP=48 - 2DF4:02A2 28A4 C=DATA S=_DATA G=DGROUP M=VECT.C ACBP=48 - 2DF4:2B46 0000 C=DATA S=_DATA G=DGROUP M=MAIN.C ACBP=48 - 2DF4:2B46 0000 C=DATA S=_DATA G=DGROUP M=SPLINE.ASM ACBP=48 - 2DF4:2B50 0002 C=DATA S=_DATA G=DGROUP M=FPINIT ACBP=68 - 2DF4:2B60 0000 C=DATA S=_DATA G=DGROUP M=E87TRAP ACBP=68 - 2DF4:2B60 0003 C=DATA S=_DATA G=DGROUP M=PROTFLAG ACBP=48 - 2DF4:2B64 0002 C=DATA S=_DATA G=DGROUP M=DEFLT87 ACBP=48 - 2DF4:2B66 0024 C=DATA S=_DATA G=DGROUP M=HUGEVAL ACBP=48 - 2DF4:2B8A 0000 C=DATA S=_DATA G=DGROUP M=LDTRUNC ACBP=48 - 2DF4:2B8A 0043 C=DATA S=_DATA G=DGROUP M=MATHWHY ACBP=48 - 2DF4:2BCE 0000 C=DATA S=_DATA G=DGROUP M=REALCVT ACBP=48 - 2DF4:2BCE 0018 C=DATA S=_DATA G=DGROUP M=SCANTOD ACBP=48 - 2DF4:2BE6 0000 C=DATA S=_DATA G=DGROUP M=XCVT ACBP=48 - 2DF4:2BE6 009A C=DATA S=_DATA G=DGROUP M=FPERR ACBP=48 - 2DF4:2C80 0080 C=DATA S=_DATA G=DGROUP M=_POW10 ACBP=48 - 2DF4:2D00 0000 C=DATA S=_DATA G=DGROUP M=POW10D ACBP=48 - 2DF4:2D00 0000 C=DATA S=_DATA G=DGROUP M=MATHERR ACBP=48 - 2DF4:2D00 000C C=DATA S=_DATA G=DGROUP M=SIN ACBP=48 - 2DF4:2D0C 000E C=DATA S=_DATA G=DGROUP M=_MATHERR ACBP=48 - 2DF4:2D1A 0000 C=DATA S=_DATA G=DGROUP M=FFTOL ACBP=48 - 2DF4:2D1A 0002 C=DATA S=_DATA G=DGROUP M=ATEXIT ACBP=48 - 2DF4:2D1C 0101 C=DATA S=_DATA G=DGROUP M=CTYPE ACBP=48 - 2DF4:2E1E 000C C=DATA S=_DATA G=DGROUP M=EXIT ACBP=48 - 2DF4:2E2A 0190 C=DATA S=_DATA G=DGROUP M=FILES ACBP=48 - 2DF4:2FBA 002A C=DATA S=_DATA G=DGROUP M=FILES2 ACBP=48 - 2DF4:2FE4 0002 C=DATA S=_DATA G=DGROUP M=FPSTKLEN ACBP=48 - 2DF4:2FE6 0000 C=DATA S=_DATA G=DGROUP M=F_SCOPY ACBP=48 - 2DF4:2FE6 0000 C=DATA S=_DATA G=DGROUP M=H_LLSH ACBP=48 - 2DF4:2FE6 0000 C=DATA S=_DATA G=DGROUP M=H_PADD ACBP=48 - 2DF4:2FE6 005B C=DATA S=_DATA G=DGROUP M=IOERROR ACBP=48 - 2DF4:3042 0000 C=DATA S=_DATA G=DGROUP M=ISATTY ACBP=48 - 2DF4:3042 0000 C=DATA S=_DATA G=DGROUP M=LONGTOA ACBP=48 - 2DF4:3042 0000 C=DATA S=_DATA G=DGROUP M=LSEEK ACBP=48 - 2DF4:3042 0000 C=DATA S=_DATA G=DGROUP M=N_PCMP ACBP=48 - 2DF4:3042 0000 C=DATA S=_DATA G=DGROUP M=SETUPIO ACBP=48 - 2DF4:3042 0000 C=DATA S=_DATA G=DGROUP M=SIGDATA ACBP=48 - 2DF4:3042 0002 C=DATA S=_DATA G=DGROUP M=STKLEN ACBP=48 - 2DF4:3044 0067 C=DATA S=_DATA G=DGROUP M=VPRINTER ACBP=48 - 2DF4:30AC 0031 C=DATA S=_DATA G=DGROUP M=CVTFAK ACBP=48 - 2DF4:30DE 0000 C=DATA S=_DATA G=DGROUP M=FARHEAP ACBP=48 - 2DF4:30DE 0002 C=DATA S=_DATA G=DGROUP M=FBRK ACBP=48 - 2DF4:30E0 0000 C=DATA S=_DATA G=DGROUP M=REALCVT ACBP=48 - 2DF4:30E0 0000 C=DATA S=_DATA G=DGROUP M=SETBLOCK ACBP=48 - 2DF4:30E0 0000 C=DATA S=_DATA G=DGROUP M=FFLUSH ACBP=48 - 2DF4:30E0 0000 C=DATA S=_DATA G=DGROUP M=FLUSHALL ACBP=48 - 2DF4:30E0 0000 C=DATA S=_DATA G=DGROUP M=FPRINTF ACBP=48 - 2DF4:30E0 0000 C=DATA S=_DATA G=DGROUP M=FSEEK ACBP=48 - 2DF4:30E0 0000 C=DATA S=_DATA G=DGROUP M=MEMCPY ACBP=48 - 2DF4:30E0 0000 C=DATA S=_DATA G=DGROUP M=MEMSET ACBP=48 - 2DF4:30E0 0001 C=DATA S=_DATA G=DGROUP M=PUTC ACBP=48 - 2DF4:30E2 0004 C=DATA S=_DATA G=DGROUP M=SETVBUF ACBP=48 - 2DF4:30E6 0000 C=DATA S=_DATA G=DGROUP M=WRITE ACBP=48 - 2DF4:30E6 0000 C=DATA S=_DATA G=DGROUP M=WRITEA ACBP=48 - 2DF4:30E6 0000 C=DATA S=_DATA G=DGROUP M=XFFLUSH ACBP=48 - 2DF4:30E6 0000 C=DATA S=_CVTSEG G=DGROUP M=c0.ASM ACBP=48 - 2DF4:30E6 0002 C=DATA S=_CVTSEG G=DGROUP M=REALCVT ACBP=48 - 2DF4:30E8 0002 C=DATA S=_CVTSEG G=DGROUP M=CVTFAK ACBP=48 - 2DF4:30EA 0000 C=DATA S=_CVTSEG G=DGROUP M=REALCVT ACBP=48 - 2DF4:30EA 0000 C=DATA S=_SCNSEG G=DGROUP M=c0.ASM ACBP=48 - 2DF4:30EA 0006 C=DATA S=_SCNSEG G=DGROUP M=SCANTOD ACBP=48 - 2DF4:30F0 0006 C=DATA S=_SCNSEG G=DGROUP M=CVTFAK ACBP=48 - 2DF4:30F6 0000 C=CONST S=_CONST G=DGROUP M=c0.ASM ACBP=48 - 2DF4:30F6 0000 C=INITDATA S=_INIT_ G=DGROUP M=c0.ASM ACBP=48 - 2DF4:30F6 0006 C=INITDATA S=_INIT_ G=DGROUP M=FPINIT ACBP=48 - 2DF4:30FC 0006 C=INITDATA S=_INIT_ G=DGROUP M=SETUPIO ACBP=48 - 2DF4:3102 0000 C=INITDATA S=_INITEND_ G=DGROUP M=c0.ASM ACBP=28 - 2DF4:3102 0000 C=EXITDATA S=_EXIT_ G=DGROUP M=c0.ASM ACBP=48 - 2DF4:3102 0006 C=EXITDATA S=_EXIT_ G=DGROUP M=FPINIT ACBP=48 - 2DF4:3108 0000 C=EXITDATA S=_EXITEND_ G=DGROUP M=c0.ASM ACBP=28 - 2DF4:3108 0000 C=BSS S=_BSS G=DGROUP M=c0.ASM ACBP=48 - 2DF4:3108 2400 C=BSS S=_BSS G=DGROUP M=PLZ.C ACBP=48 - 2DF4:5508 33A0 C=BSS S=_BSS G=DGROUP M=PLZFILL.C ACBP=48 - 2DF4:88A8 0412 C=BSS S=_BSS G=DGROUP M=VECT.C ACBP=48 - 2DF4:8CBA 0000 C=BSS S=_BSS G=DGROUP M=MAIN.C ACBP=48 - 2DF4:8CBA 0000 C=BSS S=_BSS G=DGROUP M=LDTRUNC ACBP=48 - 2DF4:8CBA 0000 C=BSS S=_BSS G=DGROUP M=REALCVT ACBP=48 - 2DF4:8CBA 0000 C=BSS S=_BSS G=DGROUP M=SCANTOD ACBP=48 - 2DF4:8CBA 0000 C=BSS S=_BSS G=DGROUP M=XCVT ACBP=48 - 2DF4:8CBA 0000 C=BSS S=_BSS G=DGROUP M=_POW10 ACBP=48 - 2DF4:8CBA 0000 C=BSS S=_BSS G=DGROUP M=SIN ACBP=48 - 2DF4:8CBA 0080 C=BSS S=_BSS G=DGROUP M=ATEXIT ACBP=48 - 2DF4:8D3A 0000 C=BSS S=_BSS G=DGROUP M=IOERROR ACBP=48 - 2DF4:8D3A 0000 C=BSS S=_BSS G=DGROUP M=ISATTY ACBP=48 - 2DF4:8D3A 0000 C=BSS S=_BSS G=DGROUP M=LONGTOA ACBP=48 - 2DF4:8D3A 0000 C=BSS S=_BSS G=DGROUP M=LSEEK ACBP=48 - 2DF4:8D3A 0000 C=BSS S=_BSS G=DGROUP M=SETUPIO ACBP=48 - 2DF4:8D3A 0004 C=BSS S=_BSS G=DGROUP M=SIGDATA ACBP=48 - 2DF4:8D3E 0000 C=BSS S=_BSS G=DGROUP M=VPRINTER ACBP=48 - 2DF4:8D3E 0000 C=BSS S=_BSS G=DGROUP M=SETBLOCK ACBP=48 - 2DF4:8D3E 0000 C=BSS S=_BSS G=DGROUP M=MEMCPY ACBP=48 - 2DF4:8D3E 0000 C=BSS S=_BSS G=DGROUP M=MEMSET ACBP=48 - 2DF4:8D3E 0001 C=BSS S=_BSS G=DGROUP M=PUTC ACBP=48 - 2DF4:8D40 0000 C=BSS S=_BSS G=DGROUP M=WRITEA ACBP=48 - 2DF4:8D40 0000 C=BSSEND S=_BSSEND G=DGROUP M=c0.ASM ACBP=28 - 36C8:0000 0110 C=STACK S=_STACK G=(none) M=c0.ASM ACBP=74 - 36C8:0000 0080 C=STACK S=_STACK G=(none) M=EMUVARS ACBP=78 - - Address Publics by Name - - 2DF4:0000 idle DATASEG@ - 0000:0291 idle DGROUP@ - 160F:2152 e086_Entry - 160F:26E0 e086_Shortcut - 1887:0306 e087_Entry - 1887:03C6 e087_Shortcut - 1887:0430 e087_Trap - 0000:FE32 idle FIARQQ - 0000:0E32 idle FICRQQ - 0000:5C32 Abs FIDRQQ - 0000:1632 Abs FIERQQ - 0000:0632 idle FISRQQ - 0000:A23D Abs FIWRQQ - 0000:4000 idle FJARQQ - 0000:C000 idle FJCRQQ - 0000:8000 idle FJSRQQ - 0000:0F8F idle FTOL@ - 0000:0F8F F_FTOL@ - 0000:109A idle F_LXLSH@ - 0000:10BB idle F_PADD@ - 0000:10EA idle F_PSUB@ - 0000:107B F_SCOPY@ - 0000:109A idle LXLSH@ - 0000:1097 N_LXLSH@ - 0000:10B8 N_PADD@ - 0000:123F N_PCMP@ - 0000:10E7 idle N_PSUB@ - 0000:10BB idle PADD@ - 0000:10EA idle PSUB@ - 0000:107B idle SCOPY@ - 0000:027A _abort - 0000:0FBB idle _atexit - 1061:07E8 _ax1 - 1061:07F0 _ax2 - 1061:07E4 idle _ay1 - 1061:07EC idle _ay2 - 2D85:0004 idle _buu - 1438:00B4 idle _calculate - 136D:0C5C _clear - 0FC7:001C _close_copper - 2DF4:026C idle _clrptr - 2DF4:5508 idle _clrtau - 0FC7:000E _cop_drop - 0FC7:07E8 _cop_fadepal - 0FC7:0010 _cop_pal - 0FC7:001A _cop_plz - 0FC7:0018 _cop_scrl - 0FC7:0016 _cop_start - 1438:0177 idle _count_const - 1061:081E _ctau - 2DF4:0194 idle _curpal - 2DF4:88B8 idle _cxx - 2DF4:88B6 idle _cxy - 2DF4:88B4 idle _cxz - 2DF4:88B2 idle _cyx - 2DF4:88B0 idle _cyy - 2DF4:88AE idle _cyz - 2DF4:88AC idle _czx - 2DF4:88AA idle _czy - 2DF4:88A8 idle _czz - 2DF4:2B2C _dis - 1CE4:0000 _dist1 - 2DF4:0276 idle _disttaus - 14DA:005A _dis_exit - 14DA:00BE _dis_getmframe - 14DA:0060 idle _dis_indemo - 14DA:0066 idle _dis_msgarea - 14DA:0073 idle _dis_muscode - 14DA:0080 _dis_musplus - 14DA:008F idle _dis_musrow - 14DA:0040 _dis_partstart - 14DA:009B idle _dis_setcopper - 14DA:00AE _dis_setmframe - 14DA:00CA idle _dis_sync - 14DA:0000 idle _dis_version - 14DA:0023 idle _dis_waitb - 1061:0824 _do_block - 1061:2612 _do_clear - 0FC7:0014 _do_pal - 136D:02D7 _do_poly - 1438:079F idle _draw - 1061:081C _dseg - 2DF4:007F _errno - 0000:1040 _exit - 0FC7:01E8 _fadepal - 0000:1954 idle _farfree - 0000:1A68 idle _farmalloc - 0000:1BCC idle _farrealloc - 0000:1DA6 _fflush - 0000:1E73 _flushall - 2DC4:0000 idle _fpal - 0000:1EB5 _fprintf - 0000:2136 idle _fputc - 0000:22CB idle _fputchar - 2DF4:2B40 idle _frames - 0FC7:000C _frame_count - 0000:1954 _free - 1061:0818 _from - 0000:1F53 _fseek - 0000:1FD3 idle _ftell - 14E7:1084 _getspl - 2DF4:01C4 _ik1 - 2DF4:01C6 _ik2 - 2DF4:01C8 _ik3 - 2DF4:01CA _ik4 - 2DF4:01BC _il1 - 2DF4:01BE _il2 - 2DF4:01C0 _il3 - 2DF4:01C2 _il4 - 2DF4:01CC idle _inittable - 136D:0001 _initvect - 0FC7:0047 _init_copper - 12EA:02B1 idle _init_plz - 0000:1163 _isatty - 1061:0000 idle _jmp_tau - 2DF4:01B4 _k1 - 2DF4:01B6 _k2 - 2DF4:01B8 _k3 - 2DF4:01BA _k4 - 2CE4:0200 _kosinit - 18E4:0000 _kuva1 - 24E4:0000 _kuva2 - 28E4:0000 _kuva3 - 2DF4:026E idle _kuvataus - 2DF4:2B26 _kx - 2DF4:2B28 _ky - 2DF4:2B2A _kz - 2DF4:01AC _l1 - 2DF4:01AE _l2 - 2DF4:01B0 _l3 - 2DF4:01B2 _l4 - 2DF4:2B0E idle _light_src - 2DF4:2B1A idle _lls - 0000:1216 _lseek - 027D:8000 idle _lsini16 - 027D:4000 idle _lsini4 - 2DF4:2B32 _ls_kx - 2DF4:2B34 _ls_ky - 2DF4:2B36 _ls_kz - 2DF4:2B38 idle _ls_x - 2DF4:2B3A idle _ls_y - 2DF4:2B3C idle _ls_z - 14D7:0009 _main - 0000:1A5E _malloc - 0000:0E6A _matherr - 0000:20B3 _memcpy - 0000:20FB _memset - 0FC7:0107 idle _moveplz - 2DF4:02A2 idle _object - 2DF4:2B3E idle _page - 2DF4:7508 _pal - 2DF4:3108 idle _pals - 12EA:0007 _plz - 027D:C000 _plzline - 2DF4:2B0C idle _polys - 0FC7:00D9 idle _pompota - 0000:0E5F _pow10 - 027D:0000 idle _psini - 2DF4:0094 idle _ptau - 2DF4:88BA idle _ptodraw - 0000:1BC5 idle _realloc - 1438:043C idle _rotate - 12CC:0012 idle _scr_seg - 0000:1D8A _setblock - 0000:20D7 idle _setmem - 027D:C618 _setplzparas - 0000:24E2 _setvbuf - 027D:D48E _set_plzstart - 1061:2584 _shadepal - 0000:0E94 _sin - 2DF4:7908 idle _sini - 2CE4:0000 _sinit - 2DF4:7888 idle _sinx - 2DF4:7808 idle _siny - 1438:0556 idle _sort_faces - 1438:08C5 idle _swappage - 1061:0804 _tax1 - 1061:080C _tax2 - 1061:0808 _tay1 - 1061:0810 _tay2 - 2DF4:0196 idle _timetable - 1061:0814 _to - 2DF4:01AA idle _ttptr - 12CC:007C idle _tw_closegraph - 12CC:0062 idle _tw_clrscr - 12CC:00BB idle _tw_getpixel - 12CC:0014 _tw_opengraph - 12CC:0035 _tw_opengraph2 - 12CC:0141 idle _tw_pictovmem - 12CC:0082 idle _tw_putpixel - 12CC:010B idle _tw_setpalarea - 12CC:00F2 idle _tw_setpalette - 12CC:01CD _tw_setrgbpalette - 12CC:012C idle _tw_setstart - 12CC:01BF idle _tw_waitvr - 2DF4:2B2E _tx - 1061:07F4 _txx1 - 1061:07FC _txx2 - 1061:07F8 _txy1 - 1061:0800 _txy2 - 2DF4:2B30 _ty - 1438:0003 _vect - 2D85:0000 _vmem - 1061:07D0 idle _xx - 1061:07D8 _xx1 - 1061:07E0 _xx2 - 1061:07D2 _yy - 1061:07D4 idle _yy1 - 1061:07DC idle _yy2 - 2DF4:2B50 __8087 - 0000:1000 idle __AHINCR - 0000:000C idle __AHSHIFT - 2DF4:2D1A __atexitcnt - 2DF4:8CBA __atexittbl - 0000:1CBC __brk - 2DF4:008B __brklvl - 2DF4:006B idle __C0argc - 2DF4:006D idle __C0argv - 2DF4:0071 idle __C0environ - 0000:1061 idle __cexit - 0000:016A __checknull - 0000:0157 __cleanup - 2DF4:2D1C __ctype - 0000:0000 Abs __cvtfak - 0000:106F idle __c_exit - 2DF4:2B64 __default87 - 2DF4:2FE6 idle __doserrno - 0000:1151 idle __DOSERROR - 2DF4:2FE8 idle __dosErrorToSV - 36C8:0000 __emu - 2DF4:0075 idle __envLng - 2DF4:0077 idle __envseg - 2DF4:0079 idle __envSize - 0000:104F __exit - 2DF4:2E1E __exitbuf - 2DF4:2E22 idle __exitfopen - 2DF4:2E26 idle __exitopen - 0000:8087 idle __floatconvert - 0000:0CE5 __fperror - 2DF4:2FE4 __fpstklen - 0000:04E9 __fpuint - 0000:211A idle __fputc - 0000:22DF __FPUTN - 2DF4:0087 __heapbase - 2DF4:008F __heaptop - 2DF4:2B6A __huge_dble - 2DF4:2B66 idle __huge_flt - 2DF4:2B72 idle __huge_ldble - 2DF4:2B7C idle __indefinite - 2DF4:005B idle __Int0Vector - 2DF4:005F idle __Int4Vector - 2DF4:0063 idle __Int5Vector - 2DF4:0067 idle __Int6Vector - 0000:1118 __IOERROR - 2DF4:2B61 __LDT - 0000:04ED __LDTRUNC - 0000:1174 __LONGTOA - 0000:0EE6 __matherr - 2DF4:2B8A __mathwhy - 0000:0293 idle __MMODEL - 2DF4:2FBA __nfile - 2DF4:2FBC __openfd - 2DF4:007D idle __osmajor - 2DF4:007E idle __osminor - 2DF4:007D idle __osversion - 0000:0D96 __POW10 - 2DF4:2B60 __protected - 2DF4:007B __psp - 0000:1D86 __REALCVT - 2DF4:30E6 __RealCvtVector - 0000:01C0 __restorezero - 0000:1CFB __sbrk - 2DF4:30EA idle __ScanTodVector - 0000:1260 __setupio - 2DF4:0081 idle __StartTime - 2DF4:3042 __stklen - 2DF4:2E2A __streams - 0000:016B __terminate - 2DF4:2B80 idle __tiny_ldble - 0000:0000 Abs __turboCvt - 0000:8087 Abs __turboFloat - 0000:11F6 idle __UTOA - 2DF4:007D __version - 0000:1332 __VPRINTER - 0000:2750 __write - 0000:0AD9 __XCVT - 0000:278C __xfflush - 2DF4:0085 idle ___brklvl - 0000:1814 idle ___first - 0000:0402 idle ___fpreset - 0000:1816 idle ___last - 0000:1818 idle ___rover - 2DF4:8D3A ___SignalPtr - 0000:25FF ___write - - Address Publics by Value - - 0000:0000 Abs __turboCvt - 0000:0000 Abs __cvtfak - 0000:000C idle __AHSHIFT - 0000:0157 __cleanup - 0000:016A __checknull - 0000:016B __terminate - 0000:01C0 __restorezero - 0000:027A _abort - 0000:0291 idle DGROUP@ - 0000:0293 idle __MMODEL - 0000:0402 idle ___fpreset - 0000:04E9 __fpuint - 0000:04ED __LDTRUNC - 0000:0632 idle FISRQQ - 0000:0AD9 __XCVT - 0000:0CE5 __fperror - 0000:0D96 __POW10 - 0000:0E32 idle FICRQQ - 0000:0E5F _pow10 - 0000:0E6A _matherr - 0000:0E94 _sin - 0000:0EE6 __matherr - 0000:0F8F F_FTOL@ - 0000:0F8F idle FTOL@ - 0000:0FBB idle _atexit - 0000:1000 idle __AHINCR - 0000:1040 _exit - 0000:104F __exit - 0000:1061 idle __cexit - 0000:106F idle __c_exit - 0000:107B F_SCOPY@ - 0000:107B idle SCOPY@ - 0000:1097 N_LXLSH@ - 0000:109A idle LXLSH@ - 0000:109A idle F_LXLSH@ - 0000:10B8 N_PADD@ - 0000:10BB idle F_PADD@ - 0000:10BB idle PADD@ - 0000:10E7 idle N_PSUB@ - 0000:10EA idle F_PSUB@ - 0000:10EA idle PSUB@ - 0000:1118 __IOERROR - 0000:1151 idle __DOSERROR - 0000:1163 _isatty - 0000:1174 __LONGTOA - 0000:11F6 idle __UTOA - 0000:1216 _lseek - 0000:123F N_PCMP@ - 0000:1260 __setupio - 0000:1332 __VPRINTER - 0000:1632 Abs FIERQQ - 0000:1814 idle ___first - 0000:1816 idle ___last - 0000:1818 idle ___rover - 0000:1954 _free - 0000:1954 idle _farfree - 0000:1A5E _malloc - 0000:1A68 idle _farmalloc - 0000:1BC5 idle _realloc - 0000:1BCC idle _farrealloc - 0000:1CBC __brk - 0000:1CFB __sbrk - 0000:1D86 __REALCVT - 0000:1D8A _setblock - 0000:1DA6 _fflush - 0000:1E73 _flushall - 0000:1EB5 _fprintf - 0000:1F53 _fseek - 0000:1FD3 idle _ftell - 0000:20B3 _memcpy - 0000:20D7 idle _setmem - 0000:20FB _memset - 0000:211A idle __fputc - 0000:2136 idle _fputc - 0000:22CB idle _fputchar - 0000:22DF __FPUTN - 0000:24E2 _setvbuf - 0000:25FF ___write - 0000:2750 __write - 0000:278C __xfflush - 0000:4000 idle FJARQQ - 0000:5C32 Abs FIDRQQ - 0000:8000 idle FJSRQQ - 0000:8087 Abs __turboFloat - 0000:8087 idle __floatconvert - 0000:A23D Abs FIWRQQ - 0000:C000 idle FJCRQQ - 0000:FE32 idle FIARQQ - 027D:0000 idle _psini - 027D:4000 idle _lsini4 - 027D:8000 idle _lsini16 - 027D:C000 _plzline - 027D:C618 _setplzparas - 027D:D48E _set_plzstart - 0FC7:000C _frame_count - 0FC7:000E _cop_drop - 0FC7:0010 _cop_pal - 0FC7:0014 _do_pal - 0FC7:0016 _cop_start - 0FC7:0018 _cop_scrl - 0FC7:001A _cop_plz - 0FC7:001C _close_copper - 0FC7:0047 _init_copper - 0FC7:00D9 idle _pompota - 0FC7:0107 idle _moveplz - 0FC7:01E8 _fadepal - 0FC7:07E8 _cop_fadepal - 1061:0000 idle _jmp_tau - 1061:07D0 idle _xx - 1061:07D2 _yy - 1061:07D4 idle _yy1 - 1061:07D8 _xx1 - 1061:07DC idle _yy2 - 1061:07E0 _xx2 - 1061:07E4 idle _ay1 - 1061:07E8 _ax1 - 1061:07EC idle _ay2 - 1061:07F0 _ax2 - 1061:07F4 _txx1 - 1061:07F8 _txy1 - 1061:07FC _txx2 - 1061:0800 _txy2 - 1061:0804 _tax1 - 1061:0808 _tay1 - 1061:080C _tax2 - 1061:0810 _tay2 - 1061:0814 _to - 1061:0818 _from - 1061:081C _dseg - 1061:081E _ctau - 1061:0824 _do_block - 1061:2584 _shadepal - 1061:2612 _do_clear - 12CC:0012 idle _scr_seg - 12CC:0014 _tw_opengraph - 12CC:0035 _tw_opengraph2 - 12CC:0062 idle _tw_clrscr - 12CC:007C idle _tw_closegraph - 12CC:0082 idle _tw_putpixel - 12CC:00BB idle _tw_getpixel - 12CC:00F2 idle _tw_setpalette - 12CC:010B idle _tw_setpalarea - 12CC:012C idle _tw_setstart - 12CC:0141 idle _tw_pictovmem - 12CC:01BF idle _tw_waitvr - 12CC:01CD _tw_setrgbpalette - 12EA:0007 _plz - 12EA:02B1 idle _init_plz - 136D:0001 _initvect - 136D:02D7 _do_poly - 136D:0C5C _clear - 1438:0003 _vect - 1438:00B4 idle _calculate - 1438:0177 idle _count_const - 1438:043C idle _rotate - 1438:0556 idle _sort_faces - 1438:079F idle _draw - 1438:08C5 idle _swappage - 14D7:0009 _main - 14DA:0000 idle _dis_version - 14DA:0023 idle _dis_waitb - 14DA:0040 _dis_partstart - 14DA:005A _dis_exit - 14DA:0060 idle _dis_indemo - 14DA:0066 idle _dis_msgarea - 14DA:0073 idle _dis_muscode - 14DA:0080 _dis_musplus - 14DA:008F idle _dis_musrow - 14DA:009B idle _dis_setcopper - 14DA:00AE _dis_setmframe - 14DA:00BE _dis_getmframe - 14DA:00CA idle _dis_sync - 14E7:1084 _getspl - 160F:2152 e086_Entry - 160F:26E0 e086_Shortcut - 1887:0306 e087_Entry - 1887:03C6 e087_Shortcut - 1887:0430 e087_Trap - 18E4:0000 _kuva1 - 1CE4:0000 _dist1 - 24E4:0000 _kuva2 - 28E4:0000 _kuva3 - 2CE4:0000 _sinit - 2CE4:0200 _kosinit - 2D85:0000 _vmem - 2D85:0004 idle _buu - 2DC4:0000 idle _fpal - 2DF4:0000 idle DATASEG@ - 2DF4:005B idle __Int0Vector - 2DF4:005F idle __Int4Vector - 2DF4:0063 idle __Int5Vector - 2DF4:0067 idle __Int6Vector - 2DF4:006B idle __C0argc - 2DF4:006D idle __C0argv - 2DF4:0071 idle __C0environ - 2DF4:0075 idle __envLng - 2DF4:0077 idle __envseg - 2DF4:0079 idle __envSize - 2DF4:007B __psp - 2DF4:007D idle __osversion - 2DF4:007D idle __osmajor - 2DF4:007D __version - 2DF4:007E idle __osminor - 2DF4:007F _errno - 2DF4:0081 idle __StartTime - 2DF4:0085 idle ___brklvl - 2DF4:0087 __heapbase - 2DF4:008B __brklvl - 2DF4:008F __heaptop - 2DF4:0094 idle _ptau - 2DF4:0194 idle _curpal - 2DF4:0196 idle _timetable - 2DF4:01AA idle _ttptr - 2DF4:01AC _l1 - 2DF4:01AE _l2 - 2DF4:01B0 _l3 - 2DF4:01B2 _l4 - 2DF4:01B4 _k1 - 2DF4:01B6 _k2 - 2DF4:01B8 _k3 - 2DF4:01BA _k4 - 2DF4:01BC _il1 - 2DF4:01BE _il2 - 2DF4:01C0 _il3 - 2DF4:01C2 _il4 - 2DF4:01C4 _ik1 - 2DF4:01C6 _ik2 - 2DF4:01C8 _ik3 - 2DF4:01CA _ik4 - 2DF4:01CC idle _inittable - 2DF4:026C idle _clrptr - 2DF4:026E idle _kuvataus - 2DF4:0276 idle _disttaus - 2DF4:02A2 idle _object - 2DF4:2B0C idle _polys - 2DF4:2B0E idle _light_src - 2DF4:2B1A idle _lls - 2DF4:2B26 _kx - 2DF4:2B28 _ky - 2DF4:2B2A _kz - 2DF4:2B2C _dis - 2DF4:2B2E _tx - 2DF4:2B30 _ty - 2DF4:2B32 _ls_kx - 2DF4:2B34 _ls_ky - 2DF4:2B36 _ls_kz - 2DF4:2B38 idle _ls_x - 2DF4:2B3A idle _ls_y - 2DF4:2B3C idle _ls_z - 2DF4:2B3E idle _page - 2DF4:2B40 idle _frames - 2DF4:2B50 __8087 - 2DF4:2B60 __protected - 2DF4:2B61 __LDT - 2DF4:2B64 __default87 - 2DF4:2B66 idle __huge_flt - 2DF4:2B6A __huge_dble - 2DF4:2B72 idle __huge_ldble - 2DF4:2B7C idle __indefinite - 2DF4:2B80 idle __tiny_ldble - 2DF4:2B8A __mathwhy - 2DF4:2D1A __atexitcnt - 2DF4:2D1C __ctype - 2DF4:2E1E __exitbuf - 2DF4:2E22 idle __exitfopen - 2DF4:2E26 idle __exitopen - 2DF4:2E2A __streams - 2DF4:2FBA __nfile - 2DF4:2FBC __openfd - 2DF4:2FE4 __fpstklen - 2DF4:2FE6 idle __doserrno - 2DF4:2FE8 idle __dosErrorToSV - 2DF4:3042 __stklen - 2DF4:30E6 __RealCvtVector - 2DF4:30EA idle __ScanTodVector - 2DF4:3108 idle _pals - 2DF4:5508 idle _clrtau - 2DF4:7508 _pal - 2DF4:7808 idle _siny - 2DF4:7888 idle _sinx - 2DF4:7908 idle _sini - 2DF4:88A8 idle _czz - 2DF4:88AA idle _czy - 2DF4:88AC idle _czx - 2DF4:88AE idle _cyz - 2DF4:88B0 idle _cyy - 2DF4:88B2 idle _cyx - 2DF4:88B4 idle _cxz - 2DF4:88B6 idle _cxy - 2DF4:88B8 idle _cxx - 2DF4:88BA idle _ptodraw - 2DF4:8CBA __atexittbl - 2DF4:8D3A ___SignalPtr - 36C8:0000 __emu - -Program entry point at 0000:0000 - diff --git a/PLZPART/TWEAK.H b/PLZPART/TWEAK.H index 07b36c4..5722bf1 100755 --- a/PLZPART/TWEAK.H +++ b/PLZPART/TWEAK.H @@ -1,4 +1,9 @@ +#define far +#define MK_FP(x,y) ((void *)x) +#define FP_SEG(x) (x) + extern void tw_opengraph(); +extern void tw_opengraph2(); extern void tw_closegraph(); extern void tw_putpixel(int x, int y, int color); extern int tw_getpixel(int x, int y); @@ -9,4 +14,4 @@ extern void tw_setstart(int start); extern void tw_pictovmem(void far *pic, int to, int len); extern void tw_crlscr(); -extern int far scr_seg; \ No newline at end of file +extern int far scr_seg; diff --git a/PLZPART/TWEAK.OBJ b/PLZPART/TWEAK.OBJ deleted file mode 100755 index eb8059f..0000000 Binary files a/PLZPART/TWEAK.OBJ and /dev/null differ diff --git a/PLZPART/VECT.C b/PLZPART/VECT.C index ea006eb..5a581f4 100755 --- a/PLZPART/VECT.C +++ b/PLZPART/VECT.C @@ -1,10 +1,11 @@ #include -#include -#include +//#include +//#include #include -#include +//#include #include #include "tweak.h" +#include "../dis/dis.h" #define SX sinit[kx] #define SY sinit[ky] @@ -16,11 +17,11 @@ extern far char (* far vmem)[160]; extern char far pal[768]; -extern clear(); -extern init(); -extern shadepal(char far *fpal, char far *ppal, int shade); -extern init_copper(); -extern close_copper(); +extern void clear(); +//extern init(); +extern void shadepal(char far *fpal, char far *ppal, int shade); +extern int init_copper(); +extern int close_copper(); extern int far cop_rotatev; extern far int frame_count; extern far char * far cop_pal; @@ -107,13 +108,21 @@ int ls_kx=0,ls_ky=0,ls_kz=0,ls_x=0,ls_y=0,ls_z=128; int page=0; int frames=0; -vect() +void sort_faces(void); +void draw(int); +void swappage(void); +void rotate(void); +void count_const(void); +void calculate(int); + +void vect() { - int c=0,a; + int /*c=0,*/a; tw_opengraph(); - while(dis_musplus()<13 && !dis_exit()); frame_count=0; + //while(dis_musplus()<13 && !dis_exit()); + frame_count=0; while(!dis_exit()) { a=dis_musplus(); @@ -129,10 +138,10 @@ vect() // tw_closegraph(); } -calculate(int k) +void calculate(int k) { - int a; - static int px=0,py=256; + //int a; + //static int px=0,py=256; getspl(4*256+frames*4); kx=kx&1023; @@ -150,7 +159,7 @@ calculate(int k) sort_faces(); } -count_const() +void count_const() { //matrix equations: //X Y Z -> nX @@ -163,31 +172,31 @@ count_const() //12=Xcos*Zcos*Ysin 14=Xcos*Ysin*Zsin 16=Ycos*Xcos // +Xsin*Zsin -Xsin*Zcos - cxx=(long)CY*(long)CZ>>15+7; - cxy=(long)CY*(long)SZ>>15+7; - cxz=-(long)SY>>7; + cxx=CY*CZ>>(15+7); + cxy=CY*SZ>>(15+7); + cxz=-SY>>7; - cyx=((long)SX*(long)CZ+16384L>>15)*(long)SY - (long)CX*(long)SZ>>15+7; - cyy=((long)SX*(long)SY+16384L>>15)*(long)SZ + (long)CX*(long)CZ>>15+7; - cyz=(long)CY*(long)SX>>15+7; + cyx=(((SX*CZ+16384L)>>15)*SY - CX*SZ)>>(15+7); + cyy=(((SX*SY+16384L)>>15)*SZ + CX*CZ)>>(15+7); + cyz=CY*SX>>(15+7); - czx=((long)CX*(long)CZ+16384L>>15)*(long)SY + (long)SX*(long)SZ>>15+7; - czy=((long)CX*(long)SY+16384L>>15)*(long)SZ - (long)SX*(long)CZ>>15+7; - czz=(long)CY*(long)CX>>15+7; + czx=(((CX*CZ+16384L)>>15)*SY + SX*SZ)>>(15+7); + czy=(((CX*SY+16384L)>>15)*SZ - SX*CZ)>>(15+7); + czz=CY*CX>>(15+7); } -rotate() +void rotate() { - int a,b,x,y,z,xx,yy,zz; + int a,/*b,*/x,y,z,xx,yy,zz; for(a=0;a>1) + (y*cxy>>1) + (z*cxz>>1)>>7)+tx; - object.point[a].yy=yy=((x*cyx>>1) + (y*cyy>>1) + (z*cyz>>1)>>7)+ty; - object.point[a].zz=zz=((x*czx>>1) + (y*czy>>1) + (z*czz>>1)>>7)+dis; + object.point[a].xx=xx=(((x*cxx>>1) + (y*cxy>>1) + (z*cxz>>1))>>7)+tx; + object.point[a].yy=yy=(((x*cyx>>1) + (y*cyy>>1) + (z*cyz>>1))>>7)+ty; + object.point[a].zz=zz=(((x*czx>>1) + (y*czy>>1) + (z*czz>>1))>>7)+dis; /* 1000,1000,1000 @@ -200,10 +209,10 @@ rotate() } } -sort_faces() +void sort_faces() { - int a=0,b,c,x,y,z,p=0; - long ax,ay,az,bx,by,bz,kx,ky,kz,nx,ny,nz,s,l; + int a=0,/*b,*/c,x,y,z,p=0; + long ax,ay,az,bx,by,bz,/*kx,ky,kz,*/nx,ny,nz,s/*,l*/; while(a + + +uint16_t psini_read16(int); +uint8_t psini_read8(int); +void psini_write16(int, uint16_t); +void psini_write8(int, uint8_t); + +void vga_select_bitplanes_02(void); +void vga_select_bitplanes_13(void); +void vga_select_bitplanes_0123(void); +void vga_write32(int, int); +void vga_set_line_compare(int); +void vga_set_palette_entry(int, int, int, int); +void vga_show_framebuffer(void); +void vga_set_hscroll_offset(int); +void vga_upload_palette(uint8_t *); + +void initvect(void); + +int init_copper(void); +int close_copper(void); +void copper1(void); +void copper2(void); diff --git a/PLZPART/copper.c b/PLZPART/copper.c new file mode 100755 index 0000000..836fa7e --- /dev/null +++ b/PLZPART/copper.c @@ -0,0 +1,204 @@ +/* + * Written by Nick Kovac with minor changes by Claudio Matsuoka + */ + +#include "common.h" + +int frame_count = 0; +int cop_drop = 0; +uint8_t *cop_pal; +int do_pal = 0; +int cop_start = 0; +int cop_scrl = 0; +int cop_plz = 1; + +static int dtau[65]; + +uint8_t fadepal[768 * 2]; +uint8_t *cop_fadepal; + +extern int l1, l2, l3, l4; +extern int k1, k2, k3, k4; +extern int il1, il2, il3, il4; +extern int ik1, ik2, ik3, ik4; +extern int ttptr; + + +void pompota(void); +void moveplz(void); +void do_drop(void); +void initpparas(void); + + +int init_copper() +{ + int ccc; + + for (ccc = 0; ccc < 65; ccc++) { + dtau[ccc] = ccc * ccc / 4 * 43 / 128 + 60; + } + + return 0; +} + +int close_copper() +{ + return 0; +} + +// [nk] just before retrace +void copper1() +{ + // There is also assembly code to set the first pixel of + // display memory here, but it may not be necessary. + + vga_set_hscroll_offset(cop_scrl); +} + +// [nk] in retrace +void copper2() +{ + // [nk] Don't think this is used. + frame_count++; + + if (do_pal != 0) { + do_pal = 0; + vga_upload_palette(cop_pal); + } + + pompota(); + moveplz(); + + if (cop_drop != 0) + { + do_drop(); + } +} + +void pompota() +{ + + // [NK 18/1/2014] Disable this for now, as it looks a bit jittery. + return; + +#if 0 + // [NK] This function toggles the horizontal split point every frame + // [NK] between line 60 and 61, and toggles the horizontal offset between 0 and 4. + // [NK] I think the original intention of this code was to give more variation + // [NK] cheaply, almost like a cheap alpha blend between two plasmas, but + // [NK] it seems to cause a lot of flicker in the port. Perhaps more precise timing is + // [NK] required to give the original effect? In any case I disabled this code + // [NK] temporarily. + + vga_set_line_compare(60); + cop_scrl = 4; + + pompi++; + + if ((pompi & 1) != 0) + { + // [NK 12/1/2014] Moving the starting line up and down each alternate frame + // [NK 12/1/2014] doesn't look good in windowed mode. + // [NK 13/1/2014] Seems to work okay in fullscreen mode though. + vga_set_line_compare(61); + cop_scrl = 0; + } +#endif +} + +void moveplz() +{ + k1 += -3; + k1 &= 4095; + k2 += -2; + k2 &= 4095; + k3 += 1; + k3 &= 4095; + k4 += 2; + k4 &= 4095; + + l1 += -1; + l1 &= 4095; + l2 += -2; + l2 &= 4095; + l3 += 2; + l3 &= 4095; + l4 += 3; + l4 &= 4095; +} + +void do_drop() +{ + cop_drop++; + + if (cop_drop <= 64) { + vga_set_line_compare(dtau[cop_drop]); + } else { + //@@over + + int bShouldFade = 0; + + if (cop_drop >= 256) { + } else if (cop_drop >= 128) { + bShouldFade = 1; + } else if (cop_drop > 96) { + } else /*if (cop_drop > 64) */{ + bShouldFade = 1; + } + + if (bShouldFade) { + cop_pal = fadepal; + do_pal = 1; + + if (cop_drop == 65) { + vga_set_line_compare(400); + initpparas(); + } else { + int i, ccc; + + vga_set_line_compare(60); + + // [NK 9/1/2014] Fade the palette using 8.8 fixed point numbers. + + uint8_t* pcop_fadepal = cop_fadepal; + uint8_t* pfadepal = fadepal; + + for (i = 0; i < (768 / 16); i++) { + for (ccc = 0; ccc < 16; ccc++) { + uint8_t al = pcop_fadepal[ccc*2]; + uint8_t ah = pcop_fadepal[(ccc*2) + 1]; + + uint8_t oldval = pfadepal[ccc + 768]; + pfadepal[ccc + 768] += al; + uint8_t newval = pfadepal[ccc + 768]; + uint8_t carry = 0; + if (newval < oldval) { + carry = 1; + } + + pfadepal[ccc] += ah + carry; + } + + pcop_fadepal += 32; + pfadepal += 16; + } + } + } else { + cop_drop = 0; + } + } +} + +void initpparas() +{ + l1 = il1; + l2 = il2; + l3 = il3; + l4 = il4; + + k1 = ik1; + k2 = ik2; + k3 = ik3; + k4 = ik4; +} + diff --git a/PLZPART/opengl.c b/PLZPART/opengl.c new file mode 100755 index 0000000..f8eca9b --- /dev/null +++ b/PLZPART/opengl.c @@ -0,0 +1,153 @@ +#include +#include +#include +#include +#include +#include "u2gl.h" +#include "opengl.h" + +static int view_width; +static int view_height; + +static struct u2gl_program bg_program; + +float obj[9]; + +float bg_obj[12] = { + 0.0f, 0.0f, 0.0f, + 320.0f, 0.0f, 0.0f, + 0.0f, 200.0f, 0.0f, + 320.0f, 200.0f, 0.0f +}; + +static const char vertex_shader_texture[] = +"uniform mat4 pMatrix;\n" +"uniform mat4 uMatrix;\n" +"attribute vec4 aPosition;\n" +"varying vec3 vPosition;\n" +"attribute vec2 aTexPosition;\n" +"varying vec2 vTexPosition;\n" +"\n" +"void main() {\n" +" mat4 Matrix = pMatrix * uMatrix;\n" +" vec4 position = Matrix * aPosition;\n" +" gl_Position = position;\n" +" vTexPosition = aTexPosition;\n" +" vPosition = vec3(position);\n" +"}\n"; + +static const char fragment_shader_texture[] = +"precision mediump float;\n" +"uniform sampler2D uTexture;\n" +"uniform vec4 uColor;\n" +"varying vec3 vPosition;\n" +"varying vec2 vTexPosition;\n" +"\n" +"void main() {\n" +" gl_FragColor = texture2D(uTexture, vTexPosition);\n" +"}\n"; + + +int uTime_location; +int uPos_location; +int uTexPos_location; +int uRadius_location; +int uLensTex_location; +int uRotTex_location; + +static float tex_coords[] = { + 0.0f, 1.0f, + 1.0f, 1.0f, + 0.0f, 0.0f, + 1.0f, 0.0f +}; + +static float color[256][4]; + +unsigned char *image; + + +#define CC 32 + +void setrgb(int c, int r, int g, int b) +{ + float alpha = 0.5f; + + color[c][0] = (float)r / CC; + color[c][1] = (float)g / CC; + color[c][2] = (float)b / CC; + color[c][3] = alpha; +} + +void getrgb(int c, char *p) +{ + p[0] = color[c][0] * CC; + p[1] = color[c][1] * CC; + p[2] = color[c][2] * CC; +} + +void draw_bg() +{ + //glActiveTexture(GL_TEXTURE0); + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 320, 400, GL_RGB, + GL_UNSIGNED_BYTE, image); + glUseProgram(bg_program.program); + u2gl_draw_textured_triangle_strip(&bg_program, bg_obj, 4); +} + +static void init_texture() +{ + GLuint tex[3]; + + u2gl_set_tex_coords(tex_coords); + + glGenTextures(1, tex); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, tex[0]); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + + image = calloc(3, 320 * 400); + + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 320, 400, 0, GL_RGB, + GL_UNSIGNED_BYTE, image); + glGenerateMipmap(GL_TEXTURE_2D); + u2gl_check_error("init_texture 1"); +} + + +int init_opengl() +{ + GLuint v, f; + + view_width = 320; + view_height = 200; + + v = u2gl_compile_vertex_shader(vertex_shader_texture); + f = u2gl_compile_fragment_shader(fragment_shader_texture); + u2gl_create_program(&bg_program, f, v); + u2gl_check_error("create program bg"); + + glDisable(GL_DEPTH_TEST); + glEnable(GL_BLEND); + + //glBlendFunc(GL_SRC_ALPHA, GL_ONE); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glClearColor(.0, .0, .0, 0); + u2gl_check_error("init_opengl"); + + init_texture(); + u2gl_check_error("init_texture"); + + u2gl_projection(0, view_width, 0, view_height, &bg_program); + + return 0; +} + +void clear_screen() +{ + glClear(GL_COLOR_BUFFER_BIT); +} diff --git a/PLZPART/opengl.h b/PLZPART/opengl.h new file mode 100755 index 0000000..1ee399c --- /dev/null +++ b/PLZPART/opengl.h @@ -0,0 +1,4 @@ + +int init_opengl(void); +void clear_screen(void); +void draw_bg(void); diff --git a/PLZPART/plza.c b/PLZPART/plza.c new file mode 100755 index 0000000..a9e434b --- /dev/null +++ b/PLZPART/plza.c @@ -0,0 +1,38 @@ + + +int xx; +int yy; +int yy1; +int xx1; +int yy2; +int xx2; +int ay1; +int ax1; +int ay2; +int ax2; +int txx1; +int txy1; +int txx2; +int txy2; +int tax1; +int tay1; +int tax2; +int tay2; +int to = 0x0a0000000; +int from; +int dseg = 0; +int ctau; + +void do_block(int ycnt) +{ +} + +void shadepal(char *fpal, char *ppal, int shade) +{ +} + +int ycnt = 0; + +void do_clear(char *vmem, int *otau, int *ntau) +{ +} diff --git a/PLZPART/sinit.c b/PLZPART/sinit.c new file mode 100755 index 0000000..a4ef28a --- /dev/null +++ b/PLZPART/sinit.c @@ -0,0 +1,167 @@ + +unsigned char sinit[] = { + 0,0,201,0,146,1,91,2,36,3,237,3,182,4,127, + 5,72,6,17,7,217,7,162,8,106,9,51,10,251,10,195, + 11,140,12,84,13,28,14,227,14,171,15,114,16,58,17,1, + 18,200,18,143,19,85,20,28,21,226,21,168,22,109,23,51, + 24,248,24,189,25,130,26,71,27,11,28,207,28,147,29,86, + 30,25,31,220,31,159,32,97,33,35,34,229,34,166,35,103, + 36,39,37,232,37,168,38,103,39,38,40,229,40,163,41,97, + 42,31,43,220,43,152,44,85,45,16,46,204,46,135,47,65, + 48,251,48,181,49,110,50,38,51,222,51,150,52,77,53,3, + 54,185,54,111,55,36,56,216,56,140,57,63,58,242,58,164, + 59,86,60,7,61,183,61,103,62,22,63,197,63,115,64,32, + 65,205,65,121,66,37,67,208,67,122,68,35,69,204,69,116, + 70,28,71,195,71,105,72,14,73,179,73,87,74,250,74,157, + 75,63,76,224,76,128,77,32,78,191,78,93,79,250,79,151, + 80,51,81,206,81,104,82,1,83,154,83,50,84,201,84,95, + 85,244,85,137,86,29,87,175,87,65,88,211,88,99,89,242, + 89,129,90,15,91,156,91,40,92,179,92,61,93,198,93,79, + 94,214,94,93,95,226,95,103,96,235,96,110,97,239,97,112, + 98,240,98,112,99,238,99,107,100,231,100,98,101,220,101,86, + 102,206,102,69,103,187,103,49,104,165,104,24,105,138,105,252, + 105,108,106,219,106,73,107,182,107,34,108,142,108,248,108,96, + 109,200,109,47,110,149,110,250,110,93,111,192,111,33,112,130, + 112,225,112,63,113,156,113,248,113,83,114,173,114,6,115,94, + 115,180,115,10,116,94,116,177,116,3,117,84,117,164,117,242, + 117,64,118,140,118,215,118,34,119,106,119,178,119,249,119,62, + 120,131,120,198,120,8,121,73,121,136,121,199,121,4,122,64, + 122,123,122,181,122,237,122,37,123,91,123,144,123,196,123,247, + 123,40,124,88,124,135,124,181,124,226,124,13,125,56,125,97, + 125,136,125,175,125,212,125,249,125,28,126,61,126,94,126,125, + 126,155,126,184,126,212,126,238,126,8,127,32,127,54,127,76, + 127,96,127,115,127,133,127,150,127,165,127,179,127,192,127,204, + 127,215,127,224,127,232,127,239,127,244,127,248,127,252,127,253, + 127,254,127,253,127,252,127,248,127,244,127,239,127,232,127,224, + 127,215,127,204,127,192,127,179,127,165,127,150,127,133,127,115, + 127,96,127,76,127,54,127,32,127,8,127,238,126,212,126,184, + 126,155,126,125,126,94,126,61,126,28,126,249,125,212,125,175, + 125,136,125,97,125,56,125,13,125,226,124,181,124,135,124,88, + 124,40,124,247,123,196,123,144,123,91,123,37,123,237,122,181, + 122,123,122,64,122,4,122,199,121,136,121,73,121,8,121,198, + 120,131,120,62,120,249,119,178,119,106,119,34,119,215,118,140, + 118,64,118,242,117,164,117,84,117,3,117,177,116,94,116,10, + 116,180,115,94,115,6,115,173,114,83,114,248,113,156,113,63, + 113,225,112,130,112,33,112,192,111,93,111,250,110,149,110,47, + 110,200,109,96,109,248,108,142,108,34,108,182,107,73,107,219, + 106,108,106,252,105,138,105,24,105,165,104,49,104,187,103,69, + 103,206,102,86,102,220,101,98,101,231,100,107,100,238,99,112, + 99,240,98,112,98,239,97,110,97,235,96,103,96,226,95,93, + 95,214,94,79,94,198,93,61,93,179,92,40,92,156,91,15, + 91,129,90,242,89,99,89,211,88,65,88,175,87,29,87,137, + 86,244,85,95,85,201,84,50,84,154,83,1,83,104,82,206, + 81,51,81,151,80,250,79,93,79,191,78,32,78,128,77,224, + 76,63,76,157,75,250,74,87,74,179,73,14,73,105,72,195, + 71,28,71,116,70,204,69,35,69,122,68,208,67,37,67,121, + 66,205,65,32,65,115,64,197,63,22,63,103,62,183,61,7, + 61,86,60,164,59,242,58,63,58,140,57,216,56,36,56,111, + 55,185,54,3,54,77,53,150,52,222,51,38,51,110,50,181, + 49,251,48,65,48,135,47,204,46,16,46,85,45,152,44,220, + 43,31,43,97,42,163,41,229,40,38,40,103,39,168,38,232, + 37,39,37,103,36,166,35,229,34,35,34,97,33,159,32,220, + 31,25,31,86,30,147,29,207,28,11,28,71,27,130,26,189, + 25,248,24,51,24,109,23,168,22,226,21,28,21,85,20,143, + 19,200,18,1,18,58,17,114,16,171,15,227,14,28,14,84, + 13,140,12,195,11,251,10,51,10,106,9,162,8,217,7,17, + 7,72,6,127,5,182,4,237,3,36,3,91,2,146,1,201, + 0,0,0,56,255,111,254,166,253,221,252,20,252,75,251,130, + 250,185,249,240,248,40,248,95,247,151,246,206,245,6,245,62, + 244,117,243,173,242,229,241,30,241,86,240,143,239,199,238,0, + 238,57,237,114,236,172,235,229,234,31,234,89,233,148,232,206, + 231,9,231,68,230,127,229,186,228,246,227,50,227,110,226,171, + 225,232,224,37,224,98,223,160,222,222,221,28,221,91,220,154, + 219,218,218,25,218,89,217,154,216,219,215,28,215,94,214,160, + 213,226,212,37,212,105,211,172,210,241,209,53,209,122,208,192, + 207,6,207,76,206,147,205,219,204,35,204,107,203,180,202,254, + 201,72,201,146,200,221,199,41,199,117,198,194,197,15,197,93, + 196,171,195,250,194,74,194,154,193,235,192,60,192,142,191,225, + 190,52,190,136,189,220,188,49,188,135,187,222,186,53,186,141, + 185,229,184,62,184,152,183,243,182,78,182,170,181,7,181,100, + 180,194,179,33,179,129,178,225,177,66,177,164,176,7,176,106, + 175,206,174,51,174,153,173,0,173,103,172,207,171,56,171,162, + 170,13,170,120,169,228,168,82,168,192,167,46,167,158,166,15, + 166,128,165,242,164,101,164,217,163,78,163,196,162,59,162,178, + 161,43,161,164,160,31,160,154,159,22,159,147,158,18,158,145, + 157,17,157,145,156,19,156,150,155,26,155,159,154,37,154,171, + 153,51,153,188,152,70,152,208,151,92,151,233,150,119,150,5, + 150,149,149,38,149,184,148,75,148,223,147,115,147,9,147,161, + 146,57,146,210,145,108,145,7,145,164,144,65,144,224,143,127, + 143,32,143,194,142,101,142,9,142,174,141,84,141,251,140,163, + 140,77,140,247,139,163,139,80,139,254,138,173,138,93,138,15, + 138,193,137,117,137,42,137,223,136,151,136,79,136,8,136,195, + 135,126,135,59,135,249,134,184,134,121,134,58,134,253,133,193, + 133,134,133,76,133,20,133,220,132,166,132,113,132,61,132,10, + 132,217,131,169,131,122,131,76,131,31,131,244,130,201,130,160, + 130,121,130,82,130,45,130,8,130,229,129,196,129,163,129,132, + 129,102,129,73,129,45,129,19,129,249,128,225,128,203,128,181, + 128,161,128,142,128,124,128,107,128,92,128,78,128,65,128,53, + 128,42,128,33,128,25,128,18,128,13,128,9,128,5,128,4, + 128,3,128,4,128,5,128,9,128,13,128,18,128,25,128,33, + 128,42,128,53,128,65,128,78,128,92,128,107,128,124,128,142, + 128,161,128,181,128,203,128,225,128,249,128,19,129,45,129,73, + 129,102,129,132,129,163,129,196,129,229,129,8,130,45,130,82, + 130,121,130,160,130,201,130,244,130,31,131,76,131,122,131,169, + 131,217,131,10,132,61,132,113,132,166,132,220,132,20,133,76, + 133,134,133,193,133,253,133,58,134,121,134,184,134,249,134,59, + 135,126,135,195,135,8,136,79,136,151,136,223,136,42,137,117, + 137,193,137,15,138,93,138,173,138,254,138,80,139,163,139,247, + 139,77,140,163,140,251,140,84,141,174,141,9,142,101,142,194, + 142,32,143,127,143,224,143,65,144,164,144,7,145,108,145,210, + 145,57,146,161,146,9,147,115,147,223,147,75,148,184,148,38, + 149,149,149,5,150,119,150,233,150,92,151,208,151,70,152,188, + 152,51,153,171,153,37,154,159,154,26,155,150,155,19,156,145, + 156,17,157,145,157,18,158,147,158,22,159,154,159,31,160,164, + 160,43,161,178,161,59,162,196,162,78,163,217,163,101,164,242, + 164,128,165,15,166,158,166,46,167,192,167,82,168,228,168,120, + 169,13,170,162,170,56,171,207,171,103,172,0,173,153,173,51, + 174,206,174,106,175,7,176,164,176,66,177,225,177,129,178,33, + 179,194,179,100,180,7,181,170,181,78,182,243,182,152,183,62, + 184,229,184,141,185,53,186,222,186,135,187,49,188,220,188,136, + 189,52,190,225,190,142,191,60,192,235,192,154,193,74,194,250, + 194,171,195,93,196,15,197,194,197,117,198,41,199,221,199,146, + 200,72,201,254,201,180,202,107,203,35,204,219,204,147,205,76, + 206,6,207,192,207,122,208,53,209,241,209,172,210,105,211,37, + 212,226,212,160,213,94,214,28,215,219,215,154,216,89,217,25, + 218,218,218,154,219,91,220,28,221,222,221,160,222,98,223,37, + 224,232,224,171,225,110,226,50,227,246,227,186,228,127,229,68, + 230,9,231,206,231,148,232,89,233,31,234,229,234,172,235,114, + 236,57,237,0,238,199,238,143,239,86,240,30,241,229,241,173, + 242,117,243,62,244,6,245,206,245,151,246,95,247,40,248,240, + 248,185,249,130,250,75,251,20,252,221,252,166,253,111,254,56, + 255, + 0,0,201,0,146,1,91,2,36,3,237,3,182,4,127, + 5,72,6,17,7,217,7,162,8,106,9,51,10,251,10,195, + 11,140,12,84,13,28,14,227,14,171,15,114,16,58,17,1, + 18,200,18,143,19,85,20,28,21,226,21,168,22,109,23,51, + 24,248,24,189,25,130,26,71,27,11,28,207,28,147,29,86, + 30,25,31,220,31,159,32,97,33,35,34,229,34,166,35,103, + 36,39,37,232,37,168,38,103,39,38,40,229,40,163,41,97, + 42,31,43,220,43,152,44,85,45,16,46,204,46,135,47,65, + 48,251,48,181,49,110,50,38,51,222,51,150,52,77,53,3, + 54,185,54,111,55,36,56,216,56,140,57,63,58,242,58,164, + 59,86,60,7,61,183,61,103,62,22,63,197,63,115,64,32, + 65,205,65,121,66,37,67,208,67,122,68,35,69,204,69,116, + 70,28,71,195,71,105,72,14,73,179,73,87,74,250,74,157, + 75,63,76,224,76,128,77,32,78,191,78,93,79,250,79,151, + 80,51,81,206,81,104,82,1,83,154,83,50,84,201,84,95, + 85,244,85,137,86,29,87,175,87,65,88,211,88,99,89,242, + 89,129,90,15,91,156,91,40,92,179,92,61,93,198,93,79, + 94,214,94,93,95,226,95,103,96,235,96,110,97,239,97,112, + 98,240,98,112,99,238,99,107,100,231,100,98,101,220,101,86, + 102,206,102,69,103,187,103,49,104,165,104,24,105,138,105,252, + 105,108,106,219,106,73,107,182,107,34,108,142,108,248,108,96, + 109,200,109,47,110,149,110,250,110,93,111,192,111,33,112,130, + 112,225,112,63,113,156,113,248,113,83,114,173,114,6,115,94, + 115,180,115,10,116,94,116,177,116,3,117,84,117,164,117,242, + 117,64,118,140,118,215,118,34,119,106,119,178,119,249,119,62, + 120,131,120,198,120,8,121,73,121,136,121,199,121,4,122,64, + 122,123,122,181,122,237,122,37,123,91,123,144,123,196,123,247, + 123,40,124,88,124,135,124,181,124,226,124,13,125,56,125,97, + 125,136,125,175,125,212,125,249,125,28,126,61,126,94,126,125, + 126,155,126,184,126,212,126,238,126,8,127,32,127,54,127,76, + 127,96,127,115,127,133,127,150,127,165,127,179,127,192,127,204, + 127,215,127,224,127,232,127,239,127,244,127,248,127,252,127,253, + 127,254,127,253,127,252,127,248,127,244,127,239,127,232,127,224 +}; + +unsigned char *kosinit = sinit + 512; diff --git a/PLZPART/spline.c b/PLZPART/spline.c new file mode 100755 index 0000000..ae14450 --- /dev/null +++ b/PLZPART/spline.c @@ -0,0 +1,7 @@ + + + +int getspl(int where) +{ + return 0; +} diff --git a/PLZPART/tweak.c b/PLZPART/tweak.c new file mode 100755 index 0000000..de1808e --- /dev/null +++ b/PLZPART/tweak.c @@ -0,0 +1,15 @@ +#include "common.h" +#include "tweak.h" + +void tw_opengraph() +{ +} + +void tw_opengraph2() +{ +} + +void tw_setrgbpalette(int pal, int r, int g, int b) +{ + vga_set_palette_entry(pal, r, g, b); +} diff --git a/PLZPART/vga.c b/PLZPART/vga.c new file mode 100755 index 0000000..28b91b6 --- /dev/null +++ b/PLZPART/vga.c @@ -0,0 +1,126 @@ +/* + * Written by Nick Kovac with minor changes by Claudio Matsuoka + */ + +#include +#include "common.h" + +static int plane_select[4] = { 0, 0, 0, 0 }; +static int line_compare = 0; +static int hscroll_offset = 0; +static uint8_t palette[256 * 3]; + +#define SCREEN_WIDTH 320 +#define SCREEN_HEIGHT 400 +#define FRAME_BUFFER_WIDTH 384 +#define FRAME_BUFFER_HEIGHT 400 + +uint8_t fb[FRAME_BUFFER_WIDTH * FRAME_BUFFER_HEIGHT]; + + +void vga_select_bitplanes_02() +{ + plane_select[0] = 1; + plane_select[1] = 0; + plane_select[2] = 1; + plane_select[3] = 0; +} + +void vga_select_bitplanes_13() +{ + plane_select[0] = 0; + plane_select[1] = 1; + plane_select[2] = 0; + plane_select[3] = 1; +} + +void vga_select_bitplanes_0123() +{ + plane_select[0] = 1; + plane_select[1] = 1; + plane_select[2] = 1; + plane_select[3] = 1; +} + +void vga_write32(int offset, int val) +{ + int i, j; + + // For each selected plane, calculate 4 pixel offsets and write 4 bytes. + // offset = 0, 4, 8, etc + + for (i = 0; i < 4; i++) { + if (plane_select[i]) { + for (j = 0; j < 4; j++) { + // Get byte to write. + uint8_t b = (val >> (j * 8)); + + // Calculate offset. + int fb_offs = i + (offset + j) * 4; + + // Write pixel. + fb[fb_offs] = b; + } + } + } +} + +void vga_set_line_compare(int y) +{ + line_compare = y; +} + +void vga_set_palette_entry(int index, int r, int g, int b) +{ + index *= 3; + palette[index++] = r; + palette[index++] = g; + palette[index] = b; +} + +extern unsigned char *image; // The OpenGL background image texture + +void vga_show_framebuffer() +{ + int x, y; + + // Clear the screen. + memset(image, 0, FRAME_BUFFER_WIDTH * FRAME_BUFFER_HEIGHT * 3); + + copper1(); + copper2(); + + int nFirstLineIndex = (line_compare + 1); + + // Plot the palettised frame buffer. + uint8_t *ptr = fb; + + for (y = nFirstLineIndex; y < SCREEN_HEIGHT; y++) { + for (x = 0; x < SCREEN_WIDTH; x++) { + //ASSERT(x + hscroll_offset < FRAME_BUFFER_WIDTH); + uint8_t r, g, b; + int idx = ptr[x + hscroll_offset] * 3; + + r = palette[idx++]; + g = palette[idx++]; + b = palette[idx]; + + int ofs = (y * 320 + x) * 3; + image[ofs++] = r << 2; + image[ofs++] = g << 2; + image[ofs] = b << 2; + } + + ptr += FRAME_BUFFER_WIDTH; + } +} + +void vga_set_hscroll_offset(int offset) +{ + hscroll_offset = offset; +} + +void vga_upload_palette(uint8_t *pal) +{ + memcpy(palette, pal, 256 * 3); +} diff --git a/plzpart-gl/Makefile b/plzpart-gl/Makefile new file mode 100755 index 0000000..65bce9c --- /dev/null +++ b/plzpart-gl/Makefile @@ -0,0 +1,20 @@ + +PLZPART_OBJS = opengl.o main.o + +PLZPART_PATH = plzpart-gl + +PLZPART_PATH_OBJS = $(addprefix $(PLZPART_PATH)/,$(PLZPART_OBJS)) + +PLZPART_BIN = plzpart + +OBJS += $(PLZPART_PATH_OBJS) + +default-plzpart: + $(MAKE) -C .. plzpart-all + +plzpart-all: $(PLZPART_PATH)/$(PLZPART_BIN) + +$(PLZPART_PATH)/$(PLZPART_BIN): $(PLZPART_PATH_OBJS) + $(LD) -o $@ $(LDFLAGS) $(PLZPART_PATH_OBJS) $(LIBS) + +plz.c: tweak.h ptau.pre diff --git a/plzpart-gl/common.h b/plzpart-gl/common.h new file mode 100755 index 0000000..7603c7e --- /dev/null +++ b/plzpart-gl/common.h @@ -0,0 +1,25 @@ + +#include + + +uint16_t psini_read16(int); +uint8_t psini_read8(int); +void psini_write16(int, uint16_t); +void psini_write8(int, uint8_t); + +void vga_select_bitplanes_02(void); +void vga_select_bitplanes_13(void); +void vga_select_bitplanes_0123(void); +void vga_write32(int, int); +void vga_set_line_compare(int); +void vga_set_palette_entry(int, int, int, int); +void vga_show_framebuffer(void); +void vga_set_hscroll_offset(int); +void vga_upload_palette(uint8_t *); + +void initvect(void); + +int init_copper(void); +int close_copper(void); +void copper1(void); +void copper2(void); diff --git a/plzpart-gl/main.c b/plzpart-gl/main.c new file mode 100755 index 0000000..e754764 --- /dev/null +++ b/plzpart-gl/main.c @@ -0,0 +1,32 @@ +#include +#include "../dis/dis.h" +#include "graphics.h" +#include "opengl.h" +#include "common.h" + +extern void plz(); +extern void vect(); + +int main(int argc, char **argv) { + dis_partstart(); + float time = 0.0; + + if (init_graphics("Plzpart", argc, argv) < 0) { + fprintf(stderr, "Can't init graphics\n"); + return -1; + }; + + init_opengl(); + //init_copper(); + //initvect(); + + while(!dis_exit() && time < 32.32) { + draw_bg(time); + swap_buffers(); + time += (float)adjust_framerate() / 60; + } + + //vect(); + //close_copper(); + return 0; +} diff --git a/plzpart-gl/opengl.c b/plzpart-gl/opengl.c new file mode 100755 index 0000000..b9a9429 --- /dev/null +++ b/plzpart-gl/opengl.c @@ -0,0 +1,135 @@ +#include +#include +#include +#include +#include +#include "u2gl.h" +#include "opengl.h" + +static int view_width; +static int view_height; + +static struct u2gl_program bg_program; + +float obj[9]; + +float bg_obj[12] = { + 0.0f, 0.0f, 0.0f, + 320.0f, 0.0f, 0.0f, + 0.0f, 200.0f, 0.0f, + 320.0f, 200.0f, 0.0f +}; + +static const char vertex_shader_texture[] = +"uniform mat4 pMatrix;\n" +"uniform mat4 uMatrix;\n" +"attribute vec4 aPosition;\n" +"varying vec3 vPosition;\n" +"attribute vec2 aTexPosition;\n" +"varying vec2 vTexPosition;\n" +"\n" +"void main() {\n" +" mat4 Matrix = pMatrix * uMatrix;\n" +" vec4 position = Matrix * aPosition;\n" +" gl_Position = position;\n" +" vTexPosition = aTexPosition;\n" +" vPosition = vec3(position);\n" +"}\n"; + +static char fragment_shader_texture[20000]; + +int uRes_location; +int uTime_location; + +static float tex_coords[] = { + 0.0f, 1.0f, + 1.0f, 1.0f, + 0.0f, 0.0f, + 1.0f, 0.0f +}; + +void draw_bg(float t) +{ + glUniform1f(uTime_location, t); + + //glActiveTexture(GL_TEXTURE0); + //glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 320, 400, GL_RGB, + // GL_UNSIGNED_BYTE, image); + glUseProgram(bg_program.program); + u2gl_draw_textured_triangle_strip(&bg_program, bg_obj, 4); +} + +#if 0 +static void init_texture() +{ + GLuint tex[3]; + + u2gl_set_tex_coords(tex_coords); + + glGenTextures(1, tex); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, tex[0]); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + + image = calloc(3, 320 * 400); + + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 320, 400, 0, GL_RGB, + GL_UNSIGNED_BYTE, image); + glGenerateMipmap(GL_TEXTURE_2D); + u2gl_check_error("init_texture 1"); +} +#endif + +extern int window_width; +extern int window_height; + +int init_opengl() +{ + GLuint v, f; + FILE *in; + + view_width = 320; + view_height = 200; + + in = fopen("plz.glsl", "r"); + if (in != NULL) { + fread(fragment_shader_texture, 20000, 1, in); + fclose(in); + } + + v = u2gl_compile_vertex_shader(vertex_shader_texture); + f = u2gl_compile_fragment_shader(fragment_shader_texture); + u2gl_create_program(&bg_program, f, v); + u2gl_check_error("create program bg"); + + uRes_location = glGetUniformLocation(bg_program.program, "iResolution"); + uTime_location = glGetUniformLocation(bg_program.program, "iGlobalTime"); + u2gl_check_error("get uniform locations"); + + glUniform3f(uRes_location, (float)window_width, (float)window_height, 0.0f); + u2gl_check_error("set resolution"); + + glDisable(GL_DEPTH_TEST); + glEnable(GL_BLEND); + + //glBlendFunc(GL_SRC_ALPHA, GL_ONE); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glClearColor(.0, .0, .0, 0); + u2gl_check_error("init_opengl"); + + //init_texture(); + //u2gl_check_error("init_texture"); + + u2gl_projection(0, view_width, 0, view_height, &bg_program); + + return 0; +} + +void clear_screen() +{ + glClear(GL_COLOR_BUFFER_BIT); +} diff --git a/plzpart-gl/opengl.h b/plzpart-gl/opengl.h new file mode 100755 index 0000000..402ff9d --- /dev/null +++ b/plzpart-gl/opengl.h @@ -0,0 +1,4 @@ + +int init_opengl(void); +void clear_screen(void); +void draw_bg(float); diff --git a/plzpart-gl/plz.glsl b/plzpart-gl/plz.glsl new file mode 100755 index 0000000..773c02c --- /dev/null +++ b/plzpart-gl/plz.glsl @@ -0,0 +1,482 @@ +precision mediump float; + +uniform vec3 iResolution; // viewport resolution (in pixels) +uniform float iGlobalTime; // shader playback time (in seconds) + +#define PI 3.1415926535 +#define DPII (PI*2.0) + +int GetPerPlasmaTime(int t) +{ + // Get the time since this plasma started using the total time. + // Times for each plasma are (from the timetable array): 723, 1491, + // 1875, 2259, 2278. (64 is added to each time because it takes 64 + // frames to drop the current plasma offscreen before switching to + // the new one.) + + if (t < 723+64) { + + } else if (t < 1491+64) { + t -= 723+64; + } else if (t < 1875+64) { + t -= 1491+64; + } else if (t < 2259+64) { + t -= 1875+64; + } else if (t < 2278+64) { + t -= 2259+64; + } else { + t = 0; + } + + return t; +} + +int GetPlasmaIndex(int t) +{ + int nPlasmaIndex = 0; + + if (t < 723+64) { + nPlasmaIndex = 0; + } else if (t < 1491+64) { + nPlasmaIndex = 1; + } else if (t < 1875+64) { + nPlasmaIndex = 2; + } + + return nPlasmaIndex; +} + +int GetYOffset(int t) +{ + int nResult = 60; + bool bDrop = false; + + if ( (t >= 723) && (t < (723+64)) ) { + t -= 723; + bDrop = true; + } else if ( (t >= 1491) && (t < (1491+64)) ) { + t -= 1491; + bDrop = true; + } else if ( (t >= 1875) && (t < (1875+64)) ) { + t -= 1875; + bDrop = true; + } else if ( (t >= 2259) && (t < (2259+64)) ) { + t -= 2259; + bDrop = true; + } + + if (bDrop) { + nResult = t * t / 4 * 43 / 128 + 60; + } + + return nResult; +} + +float FadeColourComponent(float c, int t) +{ + float fResult = c; + float fProportion = 0.0; + + if ((t >= 0) && (t < 128)) { + // For plasma 1, fade from white to the palette. + fProportion = float(t) / 127.0; + fResult = (fProportion * c) + ((1.0 - fProportion) * 1.0); + } else if ( (t >= (723+64)) && (t < (723+64+32)) ) { + // For plasma 2, fade from black to the palette. + fProportion = float(t-723-64) / 31.0; + fResult = (fProportion * c) + ((1.0 - fProportion) * 0.0); + } else if ( (t >= (1491+64)) && (t < (1491+64+32)) ) { + // For plasma 3, fade from black to the palette. + fProportion = float(t-1491-64) / 31.0; + fResult = (fProportion * c) + ((1.0 - fProportion) * 0.0); + } + + return fResult; +} + +int GetInitialL1(int nPlasmaIndex) +{ + if (nPlasmaIndex == 0) { + return 1000; + } else if (nPlasmaIndex == 1) { + return 1000; + } else /* if (nPlasmaIndex == 2) */ { + return 3500; + } +} +int GetInitialL2(int nPlasmaIndex) +{ + if (nPlasmaIndex == 0) { + return 2000; + } else if (nPlasmaIndex == 1) { + return 2000; + } else /* if (nPlasmaIndex == 2) */ { + return 1000; + } +} + +int GetInitialL3(int nPlasmaIndex) +{ + if (nPlasmaIndex == 0) { + return 3000; + } else if (nPlasmaIndex == 1) { + return 4000; + } else /* if (nPlasmaIndex == 2) */ { + return 3000; + } +} + +int GetInitialL4(int nPlasmaIndex) +{ + if (nPlasmaIndex == 0) { + return 4000; + } else if (nPlasmaIndex == 1) { + return 4000; + } else /* if (nPlasmaIndex == 2) */ { + return 1000; + } +} + +int GetInitialK1(int nPlasmaIndex) +{ + if (nPlasmaIndex == 0) { + return 3500; + } else if (nPlasmaIndex == 1) { + return 1500; + } else /* if (nPlasmaIndex == 2) */ { + return 3500; + } +} + +int GetInitialK2(int nPlasmaIndex) +{ + if (nPlasmaIndex == 0) { + return 2300; + } else if (nPlasmaIndex == 1) { + return 2300; + } else /* if (nPlasmaIndex == 2) */ { + return 3300; + } +} + +int GetInitialK3(int nPlasmaIndex) +{ + if (nPlasmaIndex == 0) { + return 3900; + } else if (nPlasmaIndex == 1) { + return 3900; + } else /* if (nPlasmaIndex == 2) */ { + return 2900; + } +} + +int GetInitialK4(int nPlasmaIndex) +{ + if (nPlasmaIndex == 0) { + return 3670; + } else if (nPlasmaIndex == 1) { + return 1670; + } else /* if (nPlasmaIndex == 2) */ { + return 2670; + } +} + +int GetC1(int nXOffset0or1, int t) +{ + int nPlasmaIndex = GetPlasmaIndex(t); + t = GetPerPlasmaTime(t); + + int nResult = 0; + if (nXOffset0or1 == 0) { + nResult = GetInitialK1(nPlasmaIndex) + (-3 * t); + } else { + nResult = GetInitialL1(nPlasmaIndex) + (-1 * t); + } + + float fResult = float(nResult); + fResult = mod(fResult, 4096.0); + + if (fResult < 0.0) { + fResult += 4096.0; + } + + return int(fResult); +} + +int GetC2(int nXOffset0or1, int t) +{ + int nPlasmaIndex = GetPlasmaIndex(t); + t = GetPerPlasmaTime(t); + + int nResult = 0; + if (nXOffset0or1 == 0) { + nResult = GetInitialK2(nPlasmaIndex) + (-2 * t); + } else { + nResult = GetInitialL2(nPlasmaIndex) + (-2 * t); + } + + float fResult = float(nResult); + fResult = mod(fResult, 4096.0); + + if (fResult < 0.0) { + fResult += 4096.0; + } + + return int(fResult); +} + +int GetC3(int nXOffset0or1, int t) +{ + int nPlasmaIndex = GetPlasmaIndex(t); + t = GetPerPlasmaTime(t); + + int nResult = 0; + if (nXOffset0or1 == 0) { + nResult = GetInitialK3(nPlasmaIndex) + (1 * t); + } else { + nResult = GetInitialL3(nPlasmaIndex) + (2 * t); + } + + float fResult = float(nResult); + fResult = mod(fResult, 4096.0); + + if (fResult < 0.0) { + fResult += 4096.0; + } + + return int(fResult); +} + +int GetC4(int nXOffset0or1, int t) +{ + int nPlasmaIndex = GetPlasmaIndex(t); + t = GetPerPlasmaTime(t); + + int nResult = 0; + if (nXOffset0or1 == 0) { + nResult = GetInitialK4(nPlasmaIndex) + (2 * t); + } else { + nResult = GetInitialL4(nPlasmaIndex) + (3 * t); + } + + float fResult = float(nResult); + fResult = mod(fResult, 4096.0); + + if (fResult < 0.0) { + fResult += 4096.0; + } + + return int(fResult); +} + +float Palette0_GetRed(float nIndex) +{ + float a = 0.0; + + if ((nIndex >= 0.0) && (nIndex < 64.0)) { + a = nIndex; + } else if ((nIndex >= 64.0) && (nIndex < 128.0)) { + a = 63.0 - (nIndex - 64.0); + } else if ((nIndex >= 128.0) && (nIndex < 192.0)) { + a = 0.0; + } else { + a = nIndex - 192.0; + } + + return (cos(a*DPII/128.0+PI)*31.0+32.0) / 63.0; +} + +float Palette0_GetGreen(float nIndex) +{ + return 0.0; +} + +float Palette0_GetBlue(float nIndex) +{ + float a = 0.0; + + if ((nIndex >= 0.0) && (nIndex < 128.0)) { + a = 0.0; + } else if ((nIndex >= 128.0) && (nIndex < 192.0)) { + a = nIndex - 128.0; + } else { + a = 63.0 - (nIndex - 192.0); + } + + return (cos(a*DPII/128.0+PI)*31.0+32.0) / 63.0; +} + +float Palette1_GetGreen(float nIndex) +{ + float a = 0.0; + + if ((nIndex >= 0.0) && (nIndex < 128.0)) { + a = 0.0; + } else if ((nIndex >= 128.0) && (nIndex < 192.0)) { + a = nIndex - 128.0; + } else { + a = 63.0; + } + + return (cos(a*DPII/128.0+PI)*31.0+32.0) / 63.0; +} + +float Palette1_GetBlue(float nIndex) +{ + float a = 0.0; + + if ((nIndex >= 0.0) && (nIndex < 64.0)) { + a = 0.0; + } else if ((nIndex >= 64.0) && (nIndex < 128.0)) { + a = nIndex - 64.0; + } else if ((nIndex >= 128.0) && (nIndex < 192.0)) { + a = 63.0 - (nIndex - 128.0); + } else { + a = nIndex - 192.0; + } + + return (cos(a*DPII/128.0+PI)*31.0+32.0) / 63.0; +} + +float Palette2_GetRed(float nIndex) +{ + float a = 0.0; + + if ((nIndex >= 0.0) && (nIndex < 64.0)) { + a = 0.0; + } else if ((nIndex >= 64.0) && (nIndex < 128.0)) { + a = nIndex - 64.0; + } else if ((nIndex >= 128.0) && (nIndex < 192.0)) { + a = 63.0 - (nIndex - 128.0); + } else { + a = 0.0; + } + + return (cos(a*DPII/128.0+PI)*31.0+32.0) / 63.0 / 2.0; +} + +float Palette_GetRed(float nIndex, int t) +{ + int nPlasmaIndex = GetPlasmaIndex(t); + t = GetPerPlasmaTime(t); + float fResult = 0.0; + + if (nPlasmaIndex == 0) { + fResult = Palette0_GetRed(nIndex); + } else if (nPlasmaIndex == 1) { + fResult = Palette0_GetRed(nIndex); + } else if (nPlasmaIndex == 2) { + fResult = Palette2_GetRed(nIndex); + } + + return fResult; +} + +float Palette_GetGreen(float nIndex, int t) +{ + int nPlasmaIndex = GetPlasmaIndex(t); + t = GetPerPlasmaTime(t); + float fResult = 0.0; + + if (nPlasmaIndex == 0) { + fResult = Palette0_GetGreen(nIndex); + } else if (nPlasmaIndex == 1) { + fResult = Palette1_GetGreen(nIndex); + } else if (nPlasmaIndex == 2) { + fResult = Palette2_GetRed(nIndex); + } + + return fResult; +} + +float Palette_GetBlue(float nIndex, int t) +{ + int nPlasmaIndex = GetPlasmaIndex(t); + t = GetPerPlasmaTime(t); + float fResult = 0.0; + + if (nPlasmaIndex == 0) { + fResult = Palette0_GetBlue(nIndex); + } else if (nPlasmaIndex == 1) { + fResult = Palette1_GetBlue(nIndex); + } else if (nPlasmaIndex == 2) { + fResult = Palette2_GetRed(nIndex); + } + + return fResult; +} + +void main(void) +{ + // t is an integer frame count. + int t = int(iGlobalTime * 60.0); + + // Wrap t when it exceeds 2323, so that the plasmas will repeat. + float fT = float(t); + t = int(mod(fT, 1939.0)); + + // fPlasmaX is a float from 0 to 319, + // fPlasmaY is a float from 0 to 399. + float fPlasmaX = (gl_FragCoord.x / iResolution.x) * 319.0; + float fPlasmaY = (gl_FragCoord.y / iResolution.y) * 399.0; + fPlasmaY = 399.0 - fPlasmaY; + + fPlasmaY -= float(GetYOffset(t)); + /* fPlasmaX += float(GetXOffset(t)); */ + + float fRed = 0.0; + float fGreen = 0.0; + float fBlue = 0.0; + + if ( (fPlasmaY >= 0.0) && (fPlasmaY < 280.0) ) { + float fScreenX = gl_FragCoord.x; + float fScreenY = gl_FragCoord.y; + float ah = 0.0; + float ccc = fPlasmaX / 4.0; + float fOffset = 0.0; + float bx = 0.0; + + int nXOffset0or1 = int(mod(fScreenX, 2.0)); + + // On every odd row, toggle the x offset. This causes different + // plasma constants to be read for these pixels, achieving a + // chequered overlay of two plasmas. + + int xor = int(mod(fScreenY, 2.0)); + if (xor == 1) { + if (nXOffset0or1 == 0) { + nXOffset0or1 = 1; + } else { + nXOffset0or1 = 0; + } + } + + float c1 = float(GetC1(nXOffset0or1, t)); + float c2 = float(GetC2(nXOffset0or1, t)); + float c3 = float(GetC3(nXOffset0or1, t)); + float c4 = float(GetC4(nXOffset0or1, t)); + + fOffset = ((fPlasmaY * 2.0) + (c2 * 2.0) - (ccc * 8.0) + (80.0 * 8.0)) / 2.0; + bx = ((sin(fOffset*DPII/4096.0)*55.0+sin(fOffset*DPII/4096.0*4.0)*5.0+sin(fOffset*DPII/4096.0*17.0)*3.0+64.0)*16.0); + + fOffset = bx + c1 + (ccc * 8.0); + ah = (sin(fOffset*DPII/4096.0)*55.0+sin(fOffset*DPII/4096.0*6.0)*5.0+sin(fOffset*DPII/4096.0*21.0)*4.0+64.0); + + fOffset = ((fPlasmaY * 2.0) + (c4 * 2.0) + (ccc * 32.0)) / 2.0; + bx = ((sin(fOffset*DPII/4096.0)*55.0+sin(fOffset*DPII/4096.0*5.0)*8.0+sin(fOffset*DPII/4096.0*15.0)*2.0+64.0)*8.0); + + fOffset = bx + (fPlasmaY * 2.0) + c3 - (ccc * 4.0) + (80.0 * 4.0); + ah += (sin(fOffset*DPII/4096.0)*55.0+sin(fOffset*DPII/4096.0*6.0)*5.0+sin(fOffset*DPII/4096.0*21.0)*4.0+64.0); + + fRed = Palette_GetRed(ah, t); + fGreen = Palette_GetGreen(ah, t); + fBlue = Palette_GetBlue(ah, t); + } + + fRed = FadeColourComponent(fRed, t); + fGreen = FadeColourComponent(fGreen, t); + fBlue = FadeColourComponent(fBlue, t); + + gl_FragColor = vec4(fRed, fGreen, fBlue, 1.0); +} + diff --git a/plzpart-gl/plzpart b/plzpart-gl/plzpart new file mode 100755 index 0000000..285d803 Binary files /dev/null and b/plzpart-gl/plzpart differ diff --git a/PLZPART/ASMYT.ASM b/u2plz/ASMYT.ASM similarity index 100% rename from PLZPART/ASMYT.ASM rename to u2plz/ASMYT.ASM diff --git a/PLZPART/COPPER.ASM b/u2plz/COPPER.ASM similarity index 100% rename from PLZPART/COPPER.ASM rename to u2plz/COPPER.ASM diff --git a/PLZPART/INCLUDE.ASM b/u2plz/INCLUDE.ASM similarity index 100% rename from PLZPART/INCLUDE.ASM rename to u2plz/INCLUDE.ASM diff --git a/PLZPART/LSINI.PRE b/u2plz/LSINI.PRE similarity index 100% rename from PLZPART/LSINI.PRE rename to u2plz/LSINI.PRE diff --git a/PLZPART/LSINI16.INC b/u2plz/LSINI16.INC similarity index 100% rename from PLZPART/LSINI16.INC rename to u2plz/LSINI16.INC diff --git a/PLZPART/LSINI4.INC b/u2plz/LSINI4.INC similarity index 100% rename from PLZPART/LSINI4.INC rename to u2plz/LSINI4.INC diff --git a/PLZPART/MAIN.ASM b/u2plz/MAIN.ASM similarity index 100% rename from PLZPART/MAIN.ASM rename to u2plz/MAIN.ASM diff --git a/u2plz/MAIN.C b/u2plz/MAIN.C new file mode 100755 index 0000000..bf421c4 --- /dev/null +++ b/u2plz/MAIN.C @@ -0,0 +1,13 @@ +#include "..\dis\dis.h" + +extern plz(); +extern vect(); + +main() { + dis_partstart(); + init_copper(); + initvect(); + plz(); + vect(); + close_copper(); + } \ No newline at end of file diff --git a/u2plz/PLZ.C b/u2plz/PLZ.C new file mode 100755 index 0000000..420736d --- /dev/null +++ b/u2plz/PLZ.C @@ -0,0 +1,219 @@ +#include +#include +#include +#include +#include "tweak.h" + +//#define DO_TABLES +//#define DPII (3.1415926535*2.0) + +#define LINELEN 41 +#define MAXY 280 +#define YADD 0 +#define XADD 0 +#define SINMASK 4095 +#define PLZSINI(p1,p2,p3,p4) *ptr++ = (psini[x*32+lsini[y*2+p2]*16+p1] + psini[y*4+lsini[x*64+p4]*4+p3]) + (psini[x*32+16+lsini[y*2+p2]*16+p1] + psini[y*4+lsini[x*64+32+p4]*4+p3])*256; + +extern int init_copper(); +extern int close_copper(); +extern int far frame_count; +extern int far cop_drop; +extern int far cop_plz; +extern int far cop_start; +extern char far * far cop_fadepal; +extern char far fadepal[768]; +extern far char * far cop_pal; +extern far int do_pal; + +extern int plzline(int y, int vseg); +extern int setplzparas(int c1, int c2, int c3, int c4); +extern int set_plzstart(int y); +extern char far psini[16384]; +extern int far lsini4[8192]; +extern int far lsini16[8192]; + +//int (* vmem)[LINELEN]=MK_FP(0x0a000,0); +//char psini[16384]= +//#include "psini.pre" +//char lsini[16384]= +//#include "lsini.pre" + +char ptau[256]= +#include "ptau.pre" + +int pals[6][768]; +int curpal=0; +int timetable[10]={64*6*2-45,64*6*4-45,64*6*5-45,64*6*6-45,64*6*7+90,0}; +int ttptr=0; + +int l1=1000, l2=2000, l3=3000, l4=4000; +int k1=3500, k2=2300, k3=3900, k4=3670; + +int il1=1000, il2=2000, il3=3000, il4=4000; +int ik1=3500, ik2=2300, ik3=3900, ik4=3670; + +int inittable[10][8]={{1000,2000,3000,4000,3500,2300,3900,3670}, + {1000,2000,4000,4000,1500,2300,3900,1670}, + {3500,1000,3000,1000,3500,3300,2900,2670}, + {1000,2000,3000,4000,3500,2300,3900,3670}, + {1000,2000,3000,4000,3500,2300,3900,3670}, + {1000,2000,3000,4000,3500,2300,3900,3670}}; + +plz(){ + register int x,y; + int *ptr; + long tim=0,count=0; + int ch=0,sync=2; + + while(dis_musplus()<0 && !dis_exit()); + dis_setmframe(0); + + init_plz(); + cop_drop=128; + cop_fadepal=pals[curpal++]; + + frame_count=0; + while(!dis_exit()) + { + tim+=frame_count; frame_count=0; count++; + if(dis_getmframe()>timetable[ttptr]) + { + memset(fadepal,0,768); + cop_drop=1; + cop_fadepal=pals[curpal++]; + ttptr++; + il1=inittable[ttptr][0]; + il2=inittable[ttptr][1]; + il3=inittable[ttptr][2]; + il4=inittable[ttptr][3]; + ik1=inittable[ttptr][4]; + ik2=inittable[ttptr][5]; + ik3=inittable[ttptr][6]; + ik4=inittable[ttptr][7]; + } + if(curpal==5 && cop_drop>64) break; + + asm mov dx, 3c4h + asm mov ax, 0a02h + asm out dx, ax + + setplzparas(k1,k2,k3,k4); + for(y=0;y +#include +#include +#include +#include "tweak.h" + +extern far do_line(char far *to, int dx, int dy, int cnt, char far *from, long txx1, long txy1, long txx2, long txy2, int dseg); +extern far do_block(int ycnt); +extern far do_clear(char far *vmem, int far *otau, int far *ntau); + +extern int acstau[256]; +int sini[2000]; +char (* far vmem)[160]=MK_FP(0x0a000,0); +extern char far kuva1[128][256]; +extern char far kuva2[128][256]; +extern char far kuva3[128][256]; +extern char far dist1[128][256]; +char far buu[1000]; +char sinx[128], siny[128]; +char pal[768]; + +int clrtau[8][256][2]; +int clrptr=0; + +initvect() { + int a,b,x,y,s,d=0,p=0,ch; + + for(a=0;a<1524;a++) + { + sini[a]=s=sin(a/1024.0*M_PI*4)*127; + s-=sini[a]; + } + +/* for(a=0;a<65;a++) for(b=0;b<256;b++) // chessboard + { x=1; if((a>>4)&1) x^=3; if((b>>5)&1) x^=3; kuva[a][b]=x; } + + pal[0*192+3*1]=pal[0*192+3*1+1]=pal[0*192+3*1+2]=40; + pal[0*192+3*2]=pal[0*192+3*2+1]=pal[0*192+3*2+2]=60; +*/ + for(a=1;a<32;a++) // must-sini-valk + { pal[0*192+a*3]=0; pal[0*192+a*3+1]=0; pal[0*192+a*3+2]=a*2; } + for(a=0;a<32;a++) + { pal[0*192+a*3+32*3]=a*2; pal[0*192+a*3+1+32*3]=a*2; pal[0*192+a*3+2+32*3]=63; } + + for(a=0;a<32;a++) // must-pun-kelt + { pal[1*192+a*3]=a*2; pal[1*192+a*3+1]=0; pal[1*192+a*3+2]=0; } + for(a=0;a<32;a++) + { pal[1*192+a*3+32*3]=63; pal[1*192+a*3+1+32*3]=a*2; pal[1*192+a*3+2+32*3]=0; } + + + for(a=0;a<32;a++) // must-orans-viol + { pal[2*192+a*3]=a; pal[2*192+a*3+1]=0; pal[2*192+a*3+2]=a*2/3; } + for(a=0;a<32;a++) + { pal[2*192+a*3+32*3]=31-a; pal[2*192+a*3+1+32*3]=a*2; pal[2*192+a*3+2+32*3]=21; } + + + for(y=0;y<64;y++) for(x=0;x<256;x++) + { + kuva1[y][x]=sini[(y*4+sini[x*2])&511]/4+32; + kuva2[y][x]=sini[(y*4+sini[x*2])&511]/4+32+64; + kuva3[y][x]=sini[(y*4+sini[x*2])&511]/4+32+128; + } + + for(y=0;y<128;y++) for(x=0;x<256;x++) + dist1[y][x]=sini[y*8]/3; + + for(a=0;a<8*256;a++) { clrtau[0][a][0]=640; clrtau[0][a][1]=0; } + } + +extern far char * to; +extern far char * from; +extern far int * ctau; +extern far int dseg; +extern far int xx, yy; +extern far long ay1,ay2,ax1,ax2,xx1,yy1,xx2,yy2; +extern far long txx1,txy1,tay1,tax1; +extern far long txx2,txy2,tay2,tax2; + +int kuvataus[]={FP_SEG(kuva1),FP_SEG(kuva2),FP_SEG(kuva3),FP_SEG(kuva1)}; +int disttaus[]={FP_SEG(dist1),FP_SEG(dist1),FP_SEG(dist1),FP_SEG(dist1)}; + +do_poly(x1,y1,x2,y2,x3,y3,x4,y4,color, dd) +int x1,y1,x2,y2,x3,y3,x4,y4,color, dd; + { + int a,b,c,d,n=0,m,s1,s2,d1,d2,dx1,dy1,dx2,dy2; + + struct points { + int x,y; } pnts[4],txt[4]={{64,4},{190,4},{190,60},{64,60}}; +// int x,y; } pnts[4],txt[4]={{1,1},{63,1},{63,63},{1,63}}; + + dd=(dd+1)&63; + + pnts[0].x=x1; pnts[0].y=y1; + pnts[1].x=x2; pnts[1].y=y2; + pnts[2].x=x3; pnts[2].y=y3; + pnts[3].x=x4; pnts[3].y=y4; + + for(n=0,a=1;a<4;a++) if(pnts[a].y +#include +#include +#include +#include +#include +#include "tweak.h" + +#define SX sinit[kx] +#define SY sinit[ky] +#define SZ sinit[kz] +#define CX kosinit[kx] +#define CY kosinit[ky] +#define CZ kosinit[kz] + +extern far char (* far vmem)[160]; +extern char far pal[768]; + +extern clear(); +extern init(); +extern shadepal(char far *fpal, char far *ppal, int shade); +extern init_copper(); +extern close_copper(); +extern int far cop_rotatev; +extern far int frame_count; +extern far char * far cop_pal; +extern far int do_pal; +extern far int cop_start; +extern far int cop_scrl; + +extern int do_poly(); +extern int getspl(int where); +extern int far sinit[1024]; +extern int far kosinit[1024]; + +char far fpal[768]; + +struct object { + char name[100]; + + int pnts; + struct points_3d { + int x; + int y; + int z; + int xx; + int yy; + int zz; + int xxx; + int yyy; + } point[256]; + + int faces; + struct polygon { + int p1; + int p2; + int p3; + int p4; + int p5; + int p6; + int n; + int color; + } pg[256]; + + int lines; + struct lines { + int p1; + int p2; + int n; + int col; + } lin[256]; + } object={ + "Cube", + 8, // points + { + {125,125,125}, + {125,-125,125}, + {-125,-125,125}, + {-125,125,125}, + {125,125,-125}, + {125,-125,-125}, + {-125,-125,-125}, + {-125,125,-125}, + }, + 6, // faces + { + {1,2,3,0,0,0,0,0}, + {7,6,5,4,0,0,0,0}, + {0,4,5,1,0,0,0,1}, + {1,5,6,2,0,0,0,2}, + {2,6,7,3,0,0,0,1}, + {3,7,4,0,0,0,0,2}} + }; + +struct polygons_to_draw { + int p; + int dis; + } ptodraw[256]; +int polys=0; + +int light_src[6]={0}; +int lls[6]={0}; + +int cxx, cxy, cxz, cyx, cyy, cyz, czx, czy, czz; +int kx=0,ky=0,kz=0,dis=320,tx=0,ty=-50; +int ls_kx=0,ls_ky=0,ls_kz=0,ls_x=0,ls_y=0,ls_z=128; +int page=0; +int frames=0; + +vect() + { + int c=0,a; + + tw_opengraph(); + + while(dis_musplus()<13 && !dis_exit()); frame_count=0; + while(!dis_exit()) + { + a=dis_musplus(); + if(a>=-4 && a<0) break; + swappage(); + while(frame_count<1); frames+=frame_count; frame_count=0; + cop_pal=fpal; do_pal=1; + + calculate(1); + draw(15); + clear(); + } +// tw_closegraph(); + } + +calculate(int k) + { + int a; + static int px=0,py=256; + + getspl(4*256+frames*4); + kx=kx&1023; + ky=ky&1023; + kz=kz&1023; + ls_kx=ls_kx&1023; + ls_ky=ls_ky&1023; + + ls_y=kosinit[ls_kx]>>8; + ls_x=(sinit[ls_kx]>>8)*(sinit[ls_ky]>>8)>>7; + ls_z=(sinit[ls_kx]>>8)*(kosinit[ls_ky]>>8)>>7; + + count_const(); + rotate(); + sort_faces(); + } + +count_const() + { + //matrix equations: + //X Y Z -> nX + //X Y Z -> nY + //X Y Z -> nZ + // + // 0=Ycos*Zcos 2=Ycos*Zsin 4=-Ysin + // 6=Xsin*Zcos*Ysin 8=Xsin*Ysin*Zsin 10=Ycos*Xsin + // -Xcos*Zsin +Xcos*Zcos + //12=Xcos*Zcos*Ysin 14=Xcos*Ysin*Zsin 16=Ycos*Xcos + // +Xsin*Zsin -Xsin*Zcos + + cxx=(long)CY*(long)CZ>>15+7; + cxy=(long)CY*(long)SZ>>15+7; + cxz=-(long)SY>>7; + + cyx=((long)SX*(long)CZ+16384L>>15)*(long)SY - (long)CX*(long)SZ>>15+7; + cyy=((long)SX*(long)SY+16384L>>15)*(long)SZ + (long)CX*(long)CZ>>15+7; + cyz=(long)CY*(long)SX>>15+7; + + czx=((long)CX*(long)CZ+16384L>>15)*(long)SY + (long)SX*(long)SZ>>15+7; + czy=((long)CX*(long)SY+16384L>>15)*(long)SZ - (long)SX*(long)CZ>>15+7; + czz=(long)CY*(long)CX>>15+7; + + } + +rotate() + { + int a,b,x,y,z,xx,yy,zz; + + for(a=0;a>1) + (y*cxy>>1) + (z*cxz>>1)>>7)+tx; + object.point[a].yy=yy=((x*cyx>>1) + (y*cyy>>1) + (z*cyz>>1)>>7)+ty; + object.point[a].zz=zz=((x*czx>>1) + (y*czy>>1) + (z*czz>>1)>>7)+dis; + +/* + 1000,1000,1000 + + x*256, y*213, / ( +*/ + + object.point[a].xxx=(xx*256L)/zz+160+160; + object.point[a].yyy=(yy*142L)/zz+66; + } + } + +sort_faces() + { + int a=0,b,c,x,y,z,p=0; + long ax,ay,az,bx,by,bz,kx,ky,kz,nx,ny,nz,s,l; + + while(a0) { a++; continue; } + + s=(ls_x*nx+ls_y*ny+ls_z*nz)/250000+32; + light_src[p]=s; + c=object.pg[a].color; + if(lls[p]!=light_src[p]) + { + shadepal(&fpal[c*64*3],&pal[c*64*3], light_src[p]); + lls[p]=light_src[p]; + } + + ptodraw[p++].p=a++; + } + polys=p; + } + + +draw() + { + int a=0,b,c,f,x,y,z; + long ax,ay,az,bx,by,bz,kx,ky,kz,nx,ny,nz,s; + + for(a=0;a