This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{AB1} | |
org $8000 | |
; Simple vertical scrolltext for ZX Spectrum Bot | |
; @P_Malin https://twitter.com/P_Malin | |
; https://gist.github.com/pmalin/c97f01e0338de762ca30d04239bd9cba | |
ATTR_DATA: equ 16384+32*192 | |
;border 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ORG $8000 | |
; Set Border Colour to black | |
ld a,0 | |
out (254),a | |
; Fill Background with Crosshatch | |
ld a,170 | |
ld de,16384 | |
ld c,24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
// Example C# program to make a VDU string for BBC Micro Bot | |
// @P_Malin | |
// Based on stuff from @rheolism and @Kweepa | |
namespace MakeData | |
{ | |
class Program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define V ImVec2 | |
#define F float | |
#define D 2048 | |
F m[D*D],I,O,w,x,y,z,h,u,v,l;int q,i,j,T,M;F&A(int x,int y){return m[(x&(D-1))+(y&(D-1))*D];} | |
F S(F x,F y){I=A(x*D,y*D);return 1-I*I*9;} | |
void L(F& x,F a,F c){x=sqrt(1.-exp(-a*I*(1.-O)-c*O));} | |
#define R ((rand()%98)/49.-1)*l | |
void FX(ImDrawList*d,V a,V b,V B,ImVec4 o,F t){ | |
if(!q){q=1;m[0]=0;l=.5; | |
for(T=D;T>1;l=l/2,T=T/2){M=T/2;for(j=0;j<D;j+=T){for(i=0;i<D;i+=T){w=A(i,j);x=A(i+T,j);y=A(i,j+T);z=A(i+T,j+T); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Breaking Down My ImGui Party Entry "3D Spinning Glass" - @P_Malin | |
// https://github.com/ocornut/imgui/issues/3606#issuecomment-733261493 | |
// This is an annotated version of https://gist.github.com/pmalin/550058583492478beedd7b31ab468174 | |
// I've added comments and whitespace to document how this works and some size optimizations used | |
// define types that we use often enough that having the #define is a character saving | |
#define V ImVec2 | |
#define F float | |
// function R applies a generic 2d (R)otation by 'r' to the inputs x and y passed by reference |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define V ImVec2 | |
#define F float | |
void R(F&x,F&y,F r){F s=sin(r),c=cos(r),t=c*x-s*y;y=s*x+c*y;x=t;} | |
F c,e,f,g,l,x,y,z; | |
F L(F a){l*=l>0;return sqrt(1-exp(-a*(l+.1)-l*l*l));} | |
void T(F u){R(x,z,c/3+6.28*u);R(x,y,c);R(y,z,c/5);} | |
void FX(ImDrawList*d,V a,V b,V S,ImVec4,F t){ | |
int i,j,k,n=0,u,v,K=7,J=16; | |
char P[]="GZHXITGPBMBCGA",*X=P; | |
struct Q{F d,l;V o[4];}q[99]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1MO.1:V.5:F.U=0TO319:F.V=0TO255:x=U/128-1:y=V/128-1.4:z=1/SQR(x*x+y*y+1):x=x*z:y=y*z:X=0:Y=.4:Z=-2:a=0:b=y*2:c=0:S=9:P=-Y*y-Z*z:i=x*P:j=Y+y*P:k=Z+z*P:C=i*i+j*j+k*k | |
2IFC<1w=P-SQR(1-C):X=w*x:Y=Y+w*y:Z=Z+w*z:a=X:b=Y:c=Z EL.IFy<0t=(Y+1)/-y:X=X+x*t:Y=Y+y*t:Z=Z+z*t:b=1:S=Z-.6:S=X*X+S*S | |
3Y=Y+2:Z=Z-2:I=(X*a+Y*b+Z*c)*4/SQR(X*X+Y*Y+Z*Z)-?-412/192:GC.0,I*(S>1.5)*(I>0):PL.69,U*4,V*4:N., |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1MO.2:V.5:F.V=0TO255:F.U=0TO159:x=U/64-1:y=V/128-1.4:z=1/SQR(x*x+y*y+1):x=x*z:y=y*z:X=0:Y=.4:Z=-2:I=6:R=RND(1):P=-Y*y-Z*z:i=x*P:j=Y+y*P:k=Z+z*P:C=i*i+j*j+k*k | |
2IFC<1w=P-SQR(1-C):X=w*x:Y=Y+w*y:Z=Z+w*z:D=X*x+Y*y+Z*z:x=x-2*X*D:y=y-2*Y*D:z=z-2*Z*D | |
3IFy<0t=(Y+1)/-y:u=X+x*t:v=Z+z*t:L=u*u+v*v:IF9/L>R I=3+SIN(u*7)+SIN(v*7) | |
4IFC<1A.R>.9ORL<R I=0 | |
5IFR<y*y*y I=7 | |
6GC.0,I:PL.69,U*8,V*4:N., |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1D=@%:$D="$=E5H9HAI=E// 32 G.UBOBJ7I1M3I.H8EE5A3D3B / ,D F3J3;D?DIAP=YBW8S2P0P""D &1V9^;_A[AZ;S1V'=RCYEYMTMSDKCP=R&@ENSPSVNVMIB@E&JBWLYL_H^FP>JB":MO.0:V.19;3;0;19,1,0;0;5 | |
2F.I=1TO7:V=?D:D=D+1:F.J=32TOV:X=?D*8+128:Y=D?1*12-288:D=D+2:PL.5+(J<33),X,Y:N.:PL.&85,X-8*(I>1),Y+4:N.:F.I=0TO32:MOV.640,512:PL.145,416+I*2,0:N.:GC.0,0:F.I=0TO900:PL.69,RND(1279),RND(1023):N. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1$@%=");+;+4)3)U3;5;533T1*2(/H&,(,(+(*&)&I$>+>.<.3+1&0%;#[1>8>:<:3802002/\;>??D6D>I>H0F0?8@1<PJ>M>M<L;K<J\O=_>^;X;W2S1U;N[ .+/---)+'%'%! #, K0/3/8""3 3$/%,!)A8/</B%A/F/E @ ;)= 9@G,K,J G@G/L/L-GMU,Q+R#U#U&Y&Y""W O L""N-Q/W0Z.Z*UI" | |
2MO.1:F=1:F.I=0TO218ST.2:A=@%?I*10:B=@%?(I+1):C=300+(31A.B)*20:GC.0,1:PL.5+(F>0),A,C:IFF=1X=A:Y=C | |
3F=0:IF(32A.B)=0DR.X,Y:GC.0,2:F=1:IFI>36PL.&85,X+4,Y-4 | |
4N. | |
5V.5,19,0,7;0;19,1,0;0;19,2,5;0;:G.5 |
NewerOlder