/* Based on https://twitter.com/seban_slt/status/1349084515755548676 https://github.com/seban-slt/Atari8BitBot/blob/master/ASM/water/water.m65 */ #include #include #include #include "gr-sim.h" #include "tfv_zp.h" #define XSIZE 40 #define YSIZE 48 static unsigned char buffer1[XSIZE*YSIZE]; static unsigned char buffer2[XSIZE*YSIZE]; static unsigned int frame=0; static void update_frame2(void) { int xx,yy,temp; for(yy=0;yy0) temp+=buffer1[(yy-1)*XSIZE+xx]; if (yy0) temp+=buffer1[yy*XSIZE+xx-1]; if (xx0) temp+=buffer2[(yy-1)*XSIZE+xx]; if (yy0) temp+=buffer2[yy*XSIZE+xx-1]; if (xxXSIZE-1) xx--; if (yy>YSIZE-1) yy--; buffer1[yy*XSIZE+xx]=0x1f; buffer1[yy*XSIZE+xx+1]=0x1f; buffer1[yy*XSIZE+xx-1]=0x1f; buffer1[(yy+1)*XSIZE+xx]=0x1f; buffer1[(yy-1)*XSIZE+xx]=0x1f; } grsim_update(); usleep(60000); frame++; ch=grsim_input(); if (ch=='q') return 0; if (ch==27) return 0; } return 0; }