home *** CD-ROM | disk | FTP | other *** search
- /*
- * Mandel.c - TMS34082 SRAM code for Mandelbrot generation on the Vivid 24
- * ( this works in conjunction with the TMS34020 code which
- * coordinates the multiple co-processors )
- *
- */
-
- register int Row @ RA[0];
- register int Column @ RA[1];
- register float DeltaR @ RA[2];
- register float ConstI @ RA[3];
- register int Color @ RA[4];
- register float AR @ RA[5];
- register float AR2 @ RA[6];
-
- register int HRES @ RB[0];
- register float VRES @ RB[1];
- register float DeltaI @ RB[2];
- register float ConstR @ RB[3];
- register float AI @ RB[4];
- register float AI2 @ RB[5];
-
- int PixelData[2048];
-
- void main(void)
- {
- /$
- .asm
- sub ONE.d,ONE.d,RB0
- movrr RB0.d,RB1,1
- movrr RB0.d,RB2,2
- movrr RB0.d,RB4,4
- movrr RB0.d,RB8,2
- movrr RB0.d,RA2,7
- .endasm
- $/
-
- /* Move HRES to RB0 and convert VRES to floating point */
- /$
- .asm
- movrr RA0.i,@HRES
- itof RA1,@VRES
- .endasm
- $/
- DeltaI = 2 / VRES;
- DeltaR = 3 / (float)HRES;
-
- /* Signal 34020 we are done with initialization */
- /$
- .asm
- wrap ONE.f,RB9
- .endasm
- $/
- }
-
- /* This function does one line of the mandelbrot set and then interrupts */
- /* the 34020 so that it can copy the data out to the screen. */
- /* It assumes that RA0 has an integer version of the Row. */
- void func1(void)
- {
- ConstI = (DeltaI * (float)Row) - 1;
- ConstR = -2;
- for(Column = 0; Column < HRES; Column++)
- {
- AR = AI = AR2 = AI2 = 0;
- for(Color = 128; Color > 0; Color--)
- {
- AI = (AR * AI * 2) + ConstI;
- AR = AR2 - AI2 + ConstR;
- AR2 = AR * AR;
- AI2 = AI * AI;
- if((AR2 + AI2) > 4)
- break;
- }
- PixelData[Column] = Color;
- ConstR += DeltaR;
- }
-
- Column = (int)PixelData;
-
- /$
- .asm
- ;put start of pixel data array into MCADDR for TMS34020 copy
- pass RA1.i,MCADDR
- .endasm
- $/
-
- /* Tell 34020 we are done with this row */
- /$
- .asm
- wrap ONE.f,RB9
- .endasm
- $/
- }
-
- void func2(void)
- {
- }
-
- void func3(void)
- {
- }
-
- void func4(void)
- {
- }
-
- void func5(void)
- {
- }
- void func6(void)
- {
- }
-
- void func7(void)
- {
- }
-
- void func8(void)
- {
- }
-
- void func9(void)
- {
- }
-
- void func10(void)
- {
- }
-
- void func11(void)
- {
- }
-
- void func12(void)
- {
- }
-
- void func13(void)
- {
- }
- void func14(void)
- {
- }
-
- void func15(void)
- {
- }
-
- void func16(void)
- {
- }
-
- void func17(void)
- {
- }
-
- void func18(void)
- {
- }
-
- void func19(void)
- {
- }
-
- void func20(void)
- {
- }
-
- void func21(void)
- {
- }
- void func22(void)
- {
- }
-
- void func23(void)
- {
- }
-
- void func24(void)
- {
- }
-
- void func25(void)
- {
- }
-
- void func26(void)
- {
- }
-
- void func27(void)
- {
- }
-
- void func28(void)
- {
- }
-
- void func29(void)
- {
- }
- void func30(void)
- {
- }
-
- void func31(void)
- {
- }
-