From d5d26bd86051d38dd15809964ea6c7873d5f3582 Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Sun, 8 Oct 2023 20:09:33 +0200 Subject: [PATCH] "Bubble Universe" display hack for 340 and color scope. PDP-10 implementation of https://twitter.com/yuruyurau/status/1226846058728177665 https://oldbytes.space/@zxdunny/109342959566427298 --- src/lars/bubunv.78 | 177 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 src/lars/bubunv.78 diff --git a/src/lars/bubunv.78 b/src/lars/bubunv.78 new file mode 100644 index 000000000..38030d93d --- /dev/null +++ b/src/lars/bubunv.78 @@ -0,0 +1,177 @@ + TITLE BUBBLE UNIVERSE + +;Source: +;https://oldbytes.space/@zxdunny/109342959566427298 +;https://twitter.com/yuruyurau/status/1226846058728177665 + +A=1 +B=A+1 +C=3 +I=4 +J=5 +U=6 +V=7 +X=10 +RI=11 +T=12 +DOT=13 +RED=14 +GREEN=15 +P=17 + +DIS==130 +CSCOPE==420 +340P==0 + +PDLLEN=20 +TABSIZ=8192. + +N=200. +IJSTEP=1304. ;TABSIZ/2PI +RISTEP=35. ;2PI/235*IJSTEP +TSTEP=33. ;0.025*IJSTEP +RSTEP=<170000/N>+1 +GSTEP=<1700/N>+1 + +LOC 41 + JRST NTS + +LOC 100 + +GO: SETO A, + .IOTLSR A, +NTS: +IFN 340P,[ + CONO DIS,100 + CONSO DIS,200 + JRST .-1 + DATAO DIS,[020016] + MOVE DOT,[220000,,022000] +] + MOVE P,[-PDLLEN,,PDL] + PUSHJ P,MAKTAB + + MOVEI U,0 + MOVEI V,0 + MOVEI X,0 + MOVEI T,0 + +TLOOP: MOVEI I,0 + MOVEI RI,0 +IFE 340P,MOVEI RED,0 +ILOOP: MOVEI J,0 +IFE 340P,MOVEI GREEN,0 +JLOOP: MOVE A,I + ADD A,V ;i+v + ANDI A,TABSIZ-1 + MOVE U,SINTAB(A) ;u = sin(i+v) + ADDI A,TABSIZ/4 + MOVE V,SINTAB(A) ;v = cos(i+v) + MOVE A,RI + ADD A,X ;r*i+x + ANDI A,TABSIZ-1 + ADD U,SINTAB(A) ;u += sin(r*i+x) + ADDI A,TABSIZ/4 + ADD V,SINTAB(A) ;v += cos(r*i+x) + MOVE X,U + ADD X,T ;x = u+t + +IFN 340P,[ + MOVE A,U + IDIVI A,6 ;Divide by 6 to scale to +-512. + ADDI A,512. + DPB A,[001200,,DOT] + MOVE A,V + IDIVI A,6. + ADDI A,512. + DPB A,[221200,,DOT] + CONSO DIS,200 + JRST .-1 + DATAO DIS,DOT ;Draw a point. +] +.ELSE [ + MOVE A,U + IDIVI A,11. ;Divide by 11 to scale to +-256. + ADDI A,256. + LSH A,9 + MOVE B,V + IDIVI B,11. + ADDI B,256. + ADD A,B + MOVE C,RED + ANDI C,170000 + MOVE B,GREEN + ANDI B,1700 + IOR C,B + CONO CSCOPE,202030(C) ;Set color. + DATAO CSCOPE,A ;Draw a point. +] + ADDI J,IJSTEP +IFE 340P,ADDI GREEN,GSTEP + CAMGE J,[N*IJSTEP] + JRST JLOOP + ADDI I,IJSTEP +IFE 340P,ADDI RED,RSTEP + ADDI RI,RISTEP + CAMGE I,[N*IJSTEP] + JRST ILOOP + ADDI T,TSTEP + JRST TLOOP + +MAKTAB: MOVE C,[-TABSIZ-TABSIZ/4,,SINTAB] + MOVE A,[0.0] +MAKT0: PUSH P,A + PUSHJ P,SIN + FMPR A,[1303.7972938088067] ;TABSIZ/2PI + MULI A,400 + TSC A,A + ASH B,-243(A) + MOVEM B,(C) + POP P,A + FADR A,[0.0007669903939428206] ;2PI/TABSIZ + AOBJN C,MAKT0 + POPJ P, + +PDL: BLOCK PDLLEN +SINTAB: BLOCK TABSIZ+TABSIZ/4 + +;This is copied from Spacewar. +SIN: CAMG A,SC9 + CAMGE A,[-.000211431983] + JRST .+2 + POPJ P, + FDVR A,SC1 + PUSH P,A + PUSH P,B + MULI A,400 + TSC A,A + ASH B,-243(A) + MOVNS A,B + ANDCMI A,1 + TLC A,232000 + FAD A,A + FADRB A,-1(P) + TRNE B,2 + MOVNS A,-1(P) + FMP A,A + MOVE B,SC9 + FMP B,A + FAD B,SC7 + FMP B,A + FAD B,SC5 + FMP B,A + FAD B,SC3 + FMP A,B + FADR A,SC1 + FMPRM A,-1(P) + POP P,B + POP P,A + POPJ P, + +SC1: 1.5707963267 +SC3: -0.64596371106 +SC5: 0.07968967928 +SC7: -0.00467376557 +SC9: 0.00015148419 + +END GO