Skip to content

Instantly share code, notes, and snippets.

@MinatsuT
MinatsuT / pthread_sample1.c
Created December 8, 2019 16:22
pthread と sigaction の最小サンプル
/*
* pthread と sigaction の最小サンプル by みなつ
*
* gcc -o pthread_sample1 -lpthread pthread_sample1.c
*
*/
#include <pthread.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@MinatsuT
MinatsuT / make2DMap.prg
Created February 4, 2020 14:27
[WIP]RPG like 2D map generator for PiSTARTER
'
' 2Dマップジェネレーター
'
option strict
acls
var SW=1280,SH=720,xScale=2
xscreen sw,sh
var CX=SW/2,CY=SH/2
VAR VRAMW=1280,VRAMH=1024
@MinatsuT
MinatsuT / makeCloud.prg
Created February 9, 2020 16:26
[WIP]Cloud generator for PiSTARTER
'
' 丸を組み合わせた雲の生成 by みなつ
'
option strict
acls
var sw,sh,aspect
xscreen out sw,sh,aspect
var center_x=sw/2
var center_h=sh/2
@MinatsuT
MinatsuT / DitherPattern.prg
Last active February 10, 2020 16:59
Calculate coordinates of the i-th pixel of MxM size dither pattern.
'
' ディザパターンの生成 by みなつ
'
option strict
acls
xscreen 128,128
'左上、右下、右上、左下の順のパターン
dim px[4]:copy px,@px:@px:data 0,1,1,0
dim py[4]:copy py,@py:@py:data 0,1,0,1
@MinatsuT
MinatsuT / gist:805ea3a5f56ceb7e5710c6485e9a8185
Created February 16, 2020 19:09
An OGP player card example to embed a MakeCode game into twitter time line
<meta name="twitter:card" content="player"/>
<meta name="twitter:site" content="@tksm372"/>
<meta name="twitter:title" content="Accel Racing"/>
<meta name="twitter:description" content="Accel Racing: built with Microsoft MakeCode Arcade"/>
<meta name="twitter:image" content="https://static.wixstatic.com/media/402ef2_ec9458c13baf45c88edc996346fa4587~mv2.png"/>
<meta name="twitter:player" content="https://arcade.makecode.com/---run?id=_eX26DabbwduK"/>
<meta name="twitter:player:height" content="500"/>
<meta name="twitter:player:width" content="394"/>
//
// VGA test
// Author: minatsu
//
module top (
input iCLK50,
input iRESETn,
output [1:0] oLEDn,
input [1:0] iSWn,
@MinatsuT
MinatsuT / RaceCourse.prg
Created May 20, 2020 15:25
無限道路生成 for PiSTARTER
'無限道路生成 by みなつ
option strict
acls
var sw,sh,aspect
xscreen 320,176
xscreen out sw,sh,aspect
var ox=sw/2,oy=sh-1 '原点の座標(画面下中央)
var n=5 '節の数
dim d[n] '節毎の折れ角
--- src/helper/options.c 2020-05-24 00:57:37.423061762 +0900
+++ ../../openocd-esp32/src/helper/options.c 2020-05-16 11:43:58.379872344 +0900
@@ -34,9 +34,11 @@
#if IS_DARWIN
#include <libproc.h>
#endif
+#ifndef __linux__
#ifdef HAVE_SYS_SYSCTL_H
#include <sys/sysctl.h>
#endif
@MinatsuT
MinatsuT / TriPaint.prg
Created June 4, 2020 13:52
Libble Rabble like triangle painting
option strict
acls
var w=320,h=176
xscreen w,h
backcolor rgb(0,128,0)
var c%=rgb(255,192+16,128+16)
dim x[3],y[3]
while 1
@MinatsuT
MinatsuT / LR_LINE.prg
Last active June 15, 2020 18:42
Libble Rabble line for PiSTARTER
option strict
acls
xscreen 320,176
var w,h,aspect
xscreen out w,h,aspect
backcolor rgb(0,128,0)
var lc%=rgb(0,192,255)
var fc%=rgb(255,192+16,128+16)
var sth=0.1
dim vram%[w,h]