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
/* description: 波形情報をメモリではなく全て演算ベースにする新音源用のメモ */ | |
/* とりあえず、サイン波、矩形波、ノコギリ波のみ */ | |
/* ノイズ発生装置は後回し */ | |
#include <math.h> | |
#define PI 3.1415926535897932 | |
#define PI2 6.2831853071795864 | |
double calcwav_sin(double r) | |
{ | |
return sin(r); |
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
/* 88鍵ピアノの音階周波数 & サンプリング周波数1Hzあたりのラジアン増分を求めて表示 */ | |
#include <stdio.h> | |
#define S 44100.00 | |
#define B 1.0594631 | |
#define PI 3.1415926535897932 | |
#define PI2 6.2831853071795864 | |
int main(int argc,char* argv[]) | |
{ |
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
double ARTBL[88] = { | |
0.0039180860759056 | |
,0.0041510676200458 | |
,0.0043979029690434 | |
,0.0046594159130819 | |
,0.0049364792274631 | |
,0.0052300175854136 | |
,0.0055410106440968 | |
,0.0058704963141278 | |
,0.0062195742235045 |
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
#!/bin/sh | |
# VGSのセットアップ | |
cd ~/ | |
git clone https://github.com/suzukiplan/vgs2.git vgs2 | |
cd vgs2/bin_src | |
make | |
export VGS2_HOME=~/vgs2 | |
export PATH=$PATH:$VGS2_HOME/bin | |
# 次回起動時に環境変数の設定を省略するための手順 |
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
#include <Windows.h> | |
#include <stdio.h> | |
HWND GetConsoleHwnd(void) | |
{ | |
#define MY_BUFSIZE 1024 | |
HWND hwndFound; | |
char pszNewWindowTitle[MY_BUFSIZE]; | |
char pszOldWindowTitle[MY_BUFSIZE]; | |
GetConsoleTitle(pszOldWindowTitle, MY_BUFSIZE); |
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
/* ファミコンの音程 ($4002-$4003 に設定すべき値) */ | |
#include <stdio.h> | |
#define S 44100.00 | |
#define B 1.0594631 | |
#define PI 3.1415926535897932 | |
#define PI2 6.2831853071795864 | |
#define CPU 1790000 |
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
#ifdef _WIN32 | |
#include <windows.h> | |
#else | |
#include <unistd.h> | |
#endif | |
#include <stdio.h> | |
#include "vgsspu.h" | |
#ifdef _WIN32 | |
static void usleep(int usec) |
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
#!/bin/sh | |
echo commits: `git log --since=1971-01-01 --until=2035-12-31 --oneline --no-merges | wc -l` | |
echo added: `git log --since=1971-01-01 --until=2035-12-31 --oneline --numstat --no-merges --pretty=format:"" | cut -f1 | awk 'BEGIN {sum=0} {sum+=$1} END {print sum}'` | |
echo deleted: `git log --since=1971-01-01 --until=2035-12-31 --oneline --numstat --no-merges --pretty=format:"" | cut -f2 | awk 'BEGIN {sum=0} {sum+=$1} END {print sum}'` |
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
#include <stdio.h> | |
void functionWithCallback(void(*callback)(int, int)) { | |
callback(1234, 5678); | |
} | |
void callback(int a, int b) { | |
printf("a=%d, b=%d\n", a, b); | |
} |
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
$ bin/vgsrun examples/hello/hello.rom | |
$8000: LDA #$00 (a=$00, x=$00, y=$00, s=$00, p=$02) | |
$8002: STA $5404 (a=$00, x=$00, y=$00, s=$00, p=$02) | |
$8005: LDX #$00 (a=$00, x=$00, y=$00, s=$00, p=$02) | |
$8007: LDA $8018, X (a=$48, x=$00, y=$00, s=$00, p=$00) | |
$800A: STA $63C7, X (a=$48, x=$00, y=$00, s=$00, p=$00) | |
$800D: INX (a=$48, x=$01, y=$00, s=$00, p=$00) | |
$800E: CPX #$12 (a=$48, x=$01, y=$00, s=$00, p=$80) | |
$8010: BNE $F5 (a=$48, x=$01, y=$00, s=$00, p=$80) | |
$8007: LDA $8018, X (a=$65, x=$01, y=$00, s=$00, p=$00) |
OlderNewer