Skip to content

Instantly share code, notes, and snippets.

View RGBA-CRT's full-sized avatar

RGBA_CRT RGBA-CRT

View GitHub Profile
@RGBA-CRT
RGBA-CRT / gbwave2pcm.abp
Last active May 12, 2019 07:48
GBの波形メモリデータをwavに変換するプログラム
#console
#include<RGBALib.sbp>
'GBの波形メモリデータをwavに変換するプログラム for ActiveBasic4
'波形メモリデータはNezplugのDumpとかで取得
printf(ex"GB CH3 Wave To 16bit PCM Tool ::: RGBA_CRT 2019\n")
Dim buf[16] AS Byte
Dim pcmbuf[32] AS Integer
@RGBA-CRT
RGBA-CRT / conlistup
Created March 20, 2019 15:40
listup serialport
' Listupcomport
#console
#include<RGBALib.sbp>
Const DIGCF_DEFAULT = &H1 ' only valid with DIGCF_DEVICEINTERFACE
Const DIGCF_PRESENT = &H2
Const DIGCF_ALLCLASSES = &H4
Const DIGCF_PROFILE = &H8
Const DIGCF_DEVICEINTERFACE = &H10
Const DICS_ENABLE=1
' Listupcomport
#console
#include<RGBALib.sbp>
Const DIGCF_DEFAULT = &H1 ' only valid with DIGCF_DEVICEINTERFACE
Const DIGCF_PRESENT = &H2
Const DIGCF_ALLCLASSES = &H4
Const DIGCF_PROFILE = &H8
Const DIGCF_DEVICEINTERFACE = &H10
Const DICS_ENABLE=1
@RGBA-CRT
RGBA-CRT / e1000e-amd64
Last active December 25, 2019 22:45
e1000eドライバについて(ビルド成功環境)
https://www.intel.co.jp/content/www/jp/ja/support/articles/000005480/network-and-i-o/ethernet-products.html
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 8.3.0-6ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=aut
@RGBA-CRT
RGBA-CRT / get_ts_program_txt_all.bat
Created May 3, 2021 17:05
ts録画ファイルから.ts.program.txtを生成するpythonスクリプト(TVRemotePlusに喰わせる用)
@echo off
for /f "delims=" %%i in ('dir /b .\*.ts') do (
py make_program_txt.py "%%i"
)
pause
@RGBA-CRT
RGBA-CRT / startup-display-powersave.md
Created May 5, 2022 13:31
ノートPCにdebianサーバーを作るのにした設定を集積するgist

カバーを閉じたらディスプレイの電源を切る

ネットで拾った設定の改変

  • su -
  • apt install acpid
  • event設置
    rgbacrt@RCSV-5-debian:~$ cat /etc/acpi/events/lm_lid
    event=button/lid.*
    action=/etc/acpi/lid.sh
@RGBA-CRT
RGBA-CRT / gist:c7b50d0fdc2095feaf3c163c8b90ee31
Created May 5, 2024 11:39
Zanacのサウンドテストとその他解析メモ
;61e0に以下を配置。タイトル画面のキーUpdateの後ろの処理をフックする(ファイルオフセット9B3Aあたりに4C E0 61 EA EA EA)
;左右で曲セレクト、ステージの数値が変わる
;Aボタンで再生
;SEL+STARTでステージセレクト反映
;エンディングの隠しメッセージ当たりのデータを上書きしているので注意。
LDA $F5
AND #$03
BEQ ch2
LDA $F5
AND #$02
@RGBA-CRT
RGBA-CRT / GBA 犬夜叉 解析メモ.txt
Last active July 15, 2024 11:42
GBA 犬夜叉 解析メモ
# GBA 犬夜叉 解析メモ
2024/5/27 RGBA_CRT
デバッグメニューを探したい
===============================================================
```c
「中断したところからゲームを再開します」 is param1=8204, param2=b5
filter: (R0!=$4500) && (R0!=$4600)
@RGBA-CRT
RGBA-CRT / build.bat
Created July 7, 2024 15:55
小さなEXEを作るテスト(2KB~)
i686-w64-mingw32-gcc -march=pentium -nostdlib -nodefaultlibs -fno-ident -fno-asynchronous-unwind-tables -nostartfiles tellpath.c -c -o tellpath.o
windres tellpath.rc -o res.o
ld tellpath.o res.o -olauncher.exe -T smallexe.lds -lkernel32 -luser32 --subsystem windows
strip -R .reloc launcher.exe
copy launcher.exe ..\launcher.exe /Y
@RGBA-CRT
RGBA-CRT / msvc2gcc.h
Last active September 23, 2024 11:57
MSVC safe func replace
#ifndef _MSC_VER
#define fopen_s(fd, name, mode) ((*fd = fopen(name, mode)) ? errno : errno)
#define _wfopen_s(fd, name, mode) ((*fd = _wfopen(name, mode)) ? errno : errno)
#define _snprintf_s(buf, bsize, count, format, ...) (snprintf(buf, (bsize<count) ? bsize : count, format, __VA_ARGS__))
#define sscanf_s sscanf // 注意:文字列系は文字列バッファサイズを外す必要あり
// not tested. todo: return value
#define strcpy_s(str1, str1len, str2) do{strncpy(str1,str2,str1len); ((char*)str1)[str1len-1]='\0';}while(0)
#define strncpy_s(str1, str1len, str2, str2len) strcpy_s(str1,((str1len<(str2len+1))?str1len:(str2len+1)), str2)
#define wcsncpy_s(str1, str1len, str2, str2len) wcsncpy(str1,((str1len<(str2len+1))?str1len:(str2len+1)), str2)
#endif