電子辞書Brainをいじる (12) Brainux 最新版(Trixie)をインストールして遊ぶ

Brainux 最新版(Trixieベース) が公開されました。

Release 2026-03-25-024518 · brain-hackers/buildbrain · GitHub

詳しくは、上記のリンクにも書かれていますが、
大きな変更は、以下の通りとのことです。

  • Debian 13.4 “Trixie”ベース にアップグレード
  • USB Ethernet Gadget を RNDIS から NCM に切り替え
  • USB Video Class (USBカメラ) のKernelドライバを有効化

 

インストールについて

私のBrainは、PW-SH3ですので、
sdimage-2026-03-25-024518.zip
をダウンロードして、microSDカードに書き込みしてインストールします。

インストール方法については、以前のバージョンとほとんど変わりません。
インストールするイメージファイルが違う以外には、以下のリンクの方法で
インストール&パーティション拡張まで可能です。

電子辞書Brainをいじる (1) Brainuxの環境を構築する

今回は、前回の利用状況を元に、32GBのmicroSD(実容量:29GB)を以下で設定しました。
(前回は、FAT32:16:ext4:13GBで割り振っていたのですが、既にext4利用率が95%利用済になってまして・・・)

FAT32(WindowsCE領域):10GB
ext4(Brainux領域):19GB
swap領域:1GB

 

さっそく動かしてみる

起動してみましたが、前バージョン(Debian 11 bullseyeベース)との見た目の変更はありませんでした(スクリーンショットはswap領域の確保前)。

 

次にOS状況を確認してみます。
debian 13.4 (trixie)ベースですね。linux Kernelは6.1.70です。

user@brain:~$ uname -a
Linux brain 6.1.70-ga9f534c7f53e #1 PREEMPT Tue Mar 24 17:57:31 UTC 2026 armv5tejl GNU/Linux
user@brain:~$ cat /etc/debian_version
13.4
user@brain:~$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
NAME="Debian GNU/Linux"
VERSION_ID="13"
VERSION="13 (trixie)"
VERSION_CODENAME=trixie
DEBIAN_VERSION_FULL=13.4
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
user@brain:~$

 

ちょっと触った感じでは、

改善
・aptのインストールのためにレポジトリの変更は不要で
 そのままインストールできることを確認しました。

・Debian11(bullseye)では,SDL2.0使っているアプリはそのままだと
 Illegal instuructionで異常終了しましたが、SDL2.0の自ビルドしなくても
 実行できることを確認しました。
 (動作はあいかわらず重いですが)

・デフォルトで、USB Video Class (USBカメラ)がBrainuxで認識されるようになりました。
 (詳細は後程)

変動なし
・SDカード内のパーティション容量変更は、
 Debian11(bullseye)と同じ方法で可能なことを確認しました。

・PW-SH3本体のキーボードで、記号の入力時の繰り返し入力されてしまうのは
 相変わらず。

・PW-SH3のタッチパネルで、右クリックのエミュレーション有効の設定
 をしてみたところ、有効にできることを確認。

・apt upgrade実行時に、毎回「x11-ico-dvd」が更新で引っかかってくる


要確認
・USBサウンドデバイスを追加で付けているので、ついでに確認したのですが、
 APT経由でmplayerをインストールして、wav,mp3ファイルを再生しようと
 すると、Illegal insturuction で落ちるのはちょっと気になります
 (Debian11(bullseye)では再生可能)。
 (aplayでwavファイルの再生はOKでした)

 →Debian13のmplayerパッケージでは、ARMv7 以降で追加された命令込で
  ビルドされているようで、mplayerの自ビルドすることで、
  pulseaudioを起動している状態であれば正常に再生されることを確認しています
  (詳細は後程)


・SDL1.2使っているアプリが、 既存の bullseyeベースだと早いんですが、
 新しいtrixie ベース のBrainuxだと 動作自体はするんですが、異常に遅い・・・

 →確認したら、 libsdl1.2debian (sdl1.2ライブラリ)が、
   bullseyeベースだと「libsdl1.2」 を元に作成されているのに対し、
  trixie ベースから「sdl12-compat」を元に作成されているので、
  実質SDL2へのラッパーになってしまっているようでした。
   https://packages.debian.org/ja/bullseye/libsdl1.2debian
    https://packages.debian.org/ja/trixie/libsdl1.2debian
  (bookwormまではlibsdl1.2ベースで、trixie からsdl12-compatベース)

 →検証の結果、bullseyeのlibsdl1.2のソースを取得して、
  trixie ベースの新Brainux上でビルドすることで、
  bullseyeベースBrainuxと同様にSDL1.2アプリが動作するようになりました。
  (詳細は後程)

・bullseyeとtrixie のライブラリ上の扱いの違いとして、
 t64ABIの採用があるようです。
 bullseye 非t64ABI time_tが32bit
 trixie    t64ABI time_tが64bit

 「旧ABI(非t64ABI)」と「t64 ABI」の違いは、
 日付用の型time_tを32bitか64bitに拡張したかどうかという点になります。
 time_tが32bitだと2038年1月19日以降の時刻が表現できない(Y2038問題)ので、
 このタイミングで変更になった模様。

 「旧ABI(非t64ABI)」と「t64 ABI」を利用したアプリはバイナリ互換がないので、
 両方を混在させると、aptでのパッケージ管理がめちゃくちゃになります。
 (整合性が崩れてまともにアプリが追加できなくなる)

 このため、既存のバイナリパッケージをインストールする際には、
 trixie上でのパッケージで依存パッケージ名にt64が含まれていないことを確認しましょう。

 最新パッケージに依存パッケージ名にt64が含まれていたら、
 以前のバージョンのバイナリパッケージではなく、ソースからのビルドを推奨します。
 (確実性で言えば、すべてソースからのビルドするのが理想ですが、これは大変なので)

 

USB Video Class (USBカメラ) の動作確認

今回のビルドで、デフォルトでUSB Video Classが認識されるようになりました。

USBカメラとか、HDMIキャプチャのUVCデバイスをUSB に接続するだけで、
ドライバまで適用されます。

Bus 001 Device 008: ID 298f:1996 MACROSILICON ShadowCast
|__ Port 003: Dev 008, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 003: Dev 008, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 003: Dev 008, If 2, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 003: Dev 008, If 3, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 003: Dev 008, If 4, Class=Human Interface Device, Driver=usbhid, 480M

user@brain:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 001 Device 003: ID 413c:301a Dell Computer Corp. Dell MS116 Optical Mouse
Bus 001 Device 004: ID 04d9:a01c Holtek Semiconductor, Inc. wireless multimedia keyboard with trackball [Trust ADURA 17911]
Bus 001 Device 006: ID 0b95:772b ASIX Electronics Corp. AX88772B
Bus 001 Device 008: ID 298f:1996 MACROSILICON ShadowCast
user@brain:~$
user@brain:~$ lsusb -t
/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=ci_hdrc/1p, 480M
    |__ Port 001: Dev 002, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 001: Dev 003, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 002: Dev 004, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 002: Dev 004, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 003: Dev 008, If 0, Class=Video, Driver=uvcvideo, 480M
        |__ Port 003: Dev 008, If 1, Class=Video, Driver=uvcvideo, 480M
        |__ Port 003: Dev 008, If 2, Class=Audio, Driver=snd-usb-audio, 480M
        |__ Port 003: Dev 008, If 3, Class=Audio, Driver=snd-usb-audio, 480M
        |__ Port 003: Dev 008, If 4, Class=Human Interface Device, Driver=usbhid, 480M
        |__ Port 004: Dev 006, If 0, Class=Vendor Specific Class, Driver=asix, 480M
user@brain:~$

 

UVCを利用できるアプリケーションとして「V4L2 Test Bench(qvv4l2)」を試してみました。

$ sudo apt update
$ sudo apt install qv4l2

$ qv4l2

こんな感じで、USBHDMIキャプチャを使って、Brainをサブモニター化したり、
USBカメラを利用して、ストリーミングするような使い方ができるようになりました。
(ちょっと遅延は感じられますが、hdmiキャプチャ機器の遅延もあるかもしれません。)

なお、guvcviewも試してみましたがこちらは動作が重くて使うのは難しそうです。

 

APT経由でインストールしたmplayerがIllegal instuructionで落ちるのを対策する

USBサウンドデバイスを追加で付けているのですが、wavならaplayで再生できるけど、MP3はaplayでは再生できないので、APT経由でmplayerをインストールしてみました。
ただ、APTパッケージ版のmplayerは起動するだけでIllegal instuructionで落ちる現象が発生しました。

$ sudo apt install mplayer
$ mplayer
Illegal instruction

Debian11(bullseye)でのmplayerでは再生可能だったのは確認済。

 

では、どんな理由で落ちているかを確認します。

$ sudo apt install gdb
$ gdb mplayer
(gdb) handle SIGILL stop

(gdb) run
Program received signal SIGILL, Illegal instruction.
0x005425d4 in ?? ()

(gdb) disassemble $pc-16, $pc+16
Dump of assembler code from 0x5425c4 to 0x5425e4:
0x005425c4: str r3, [sp, #20]
0x005425c8: mov r3, #0
0x005425cc: bl 0x41c330 <__gettimeofday64@plt>
0x005425d0: ldr r0, [sp]
=> 0x005425d4: movw r2, #16960 @ 0x4240
0x005425d8: movt r2, #15
0x005425dc: ldr r3, [sp, #8]
0x005425e0: ldr r1, [pc, #64] @ 0x542628
End of assembler dump.
(gdb) exit

どうやらmovw命令を実行しようとして、Illegal instruction(未定義命令実行)で落ちているようです。

確認すると、movw命令は、ARMv7-A/Rアーキテクチャ以上でサポートされています。
BrainのCPUは、ARM926EJ-SでARMv5TEJでARM5系なので、エラーになります。
なので、新Brainuxで動かすには、自分でBrainに合わせたビルドをする必要があります。

APTパッケージから、バイナリの他にもソースパッケージも入手できるので、
その方法で、ビルドしていきます。

$ sudo apt update
$ sudo apt-get install g++ build-essential
$ cd
$ mkdir DPKG-BUILD
$ cd DPKG-BUILD
$ mkdir mplayer
$ cd mplayer

#ソースパッケージをインストールする
$ sudo apt source mplayer

#ビルドに必要なパッケージをインストールする
$ sudo apt-get build-dep mplayer
$ cd mplayer-1.5+svn38674

#もし、ビルド時のオプションを変更したいのであれば、
#以下のように変更します。
#(追加指定しなくても大丈夫です)
$ vi debian/rules

#!/usr/bin/make -f

#!/usr/bin/make -f
export DEB_CFLAGS_MAINT_APPEND = -O3 -march=native -msoft-float -fomit-frame-pointer
export DEB_LDFLAGS_MAINT_APPEND = -lX11 -lXext -lXinerama


CONFIGURE_FLAGS = \ の一部
–extra-ldflags=”${LDFLAGS}” \
$(archconf)

–extra-ldflags=”${LDFLAGS}” \
–disable-armv6 \
–disable-armv6t2 \
–disable-armvfp \
–disable-neon \
–disable-thumb \
–disable-sdl \
–enable-x11 \
–disable-gl \
–enable-alsa \
$(archconf)

 

#ビルドします(Brainでの自ビルドには7-8時間程度かかる模様)
$ sudo dpkg-buildpackage -us -uc

#debパッケージが作成されるので、個別インストールします。
#(dbgsymを含むパッケージ名のものは、デバック用なので通常はインストール不要です。)

$ cd ..
$ ls -al *.deb
$ sudo dpkg -i mplayer_1.5+svn38674-2_armel.deb
$ sudo dpkg -i mencoder_1.5+svn38674-2_armel.deb
$ sudo dpkg -i mplayer-doc_1.5+svn38674-2_all.deb
$ sudo dpkg -i mplayer-gui_1.5+svn38674-2_armel.deb

#ただ、手動でdebパッケージをインストールした場合、apt upgradeでaptレポジトリの
#パッケージが再導入されてしまうので、保留対象パッケージに指定します。

$ sudo apt-mark hold mplayer mencoder mplayer-doc mplayer-gui

(もし、ビルドしないでdebファイルだけ入手した場合は、dpkg -i でインストール時にパッケージが足りないというメッセージが出ることがあるので、その場合は手動で足りないパッケージをインストールしてから、再度dpkg -i でインストールしてみてください。
sudo apt –fix-broken install <パッケージ名>)

 

#これで、インストールできました。
#MP3ファイルを再生させてみます。

$ mplayer music.mp3

#すると最初の瞬間は音が出るのですが、その後無音になりました。
#ん?ということで、試しにpulseaudio をインストールして試してみます。

$ sudo apt install pulseaudio

#インストール直後はサービスが起動していないのですが、以下のコマンドで起動できます。
#(次回再起動時には、自動で起動します。)

#pulseaudio起動コマンド
$ pulseaudio –start

(その他詳しいpulseaudioの操作ついては、PulseAudio導入についてを参照してください。)

では再度MP3ファイルを再生させてみます。

$ mplayer music.mp3

ノイズも無くきれいに再生できました。成功ですね。

 

Bulleseye(Debian11ベース)やbookworm(Debian12)のパッケージをインストールする方法

新Brainuxはtrixie(Debian13ベース)なので、APTコマンドでインストールされるのもtrixie用のパッケージになります。

以前のBrainuxはBulleseye(Debian11ベース)ですので、
互換性などの理由で、以前のバージョンのアプリをインストールしたいといった状況になる場合があります。

この場合は、APTレポジトリリストにBulleseyeのレポジトリを追加することで、対応することができます(2026/3/27時点)。

$ sudo vi /etc/apt/sources.list.d/bullseye.list

deb http://archive.debian.org/debian bullseye main contrib non-free
deb-src http://archive.debian.org/debian bullseye main contrib non-free

$ sudo vi /etc/apt/preferences.d/bullseye.pref

Package: *
Pin: release n=bullseye
Pin-Priority: 50

これで、のように手動指定することで、
bullseyeのパッケージを手動導入できるようになります。

 

同じように、bookworm(Debian 12) の場合は、以下のように追加します。

$ sudo vi /etc/apt/sources.list.d/bookworm.list

deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware

$ sudo vi /etc/apt/preferences.d/bookworm.pref

Package: *
Pin: release n=bookworm
Pin-Priority: 50

 

また、bookworm の特定パッケージだけ使いたい場合は以下のようにします。
(SAMPLE-libsdl1.2debianというパッケージの場合)

$ sudo vi /etc/apt/preferences.d/bookworm-Packege.pref

Package: Packege-Name
Pin: release n=bookworm
Pin-Priority: 700

なお、pin-proprity(リポジトリの優先度)は以下のコマンドで表示できます。

$ apt-cache policy

user@brain:~$ apt-cache policy
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 https://packagecloud.io/brainhackers/brainux/any any/main armel Packages
     release v=1,o=packagecloud.io/brainhackers/brainux,a=any,n=any,l=brainux,c=main,b=armel
     origin packagecloud.io
  50 http://archive.debian.org/debian bullseye/non-free armel Packages
     release v=11.11,o=Debian,a=oldstable,n=bullseye,l=Debian,c=non-free,b=armel
     origin archive.debian.org
  50 http://archive.debian.org/debian bullseye/contrib armel Packages
     release v=11.11,o=Debian,a=oldstable,n=bullseye,l=Debian,c=contrib,b=armel
     origin archive.debian.org
  50 http://archive.debian.org/debian bullseye/main armel Packages
     release v=11.11,o=Debian,a=oldstable,n=bullseye,l=Debian,c=main,b=armel
     origin archive.debian.org
 500 http://security.debian.org/debian-security bookworm-security/main armel Packages
     release v=12,o=Debian,a=oldstable-security,n=bookworm-security,l=Debian-Security,c=main,b=armel
     origin security.debian.org
 500 http://deb.debian.org/debian bookworm-updates/main armel Packages
     release v=12-updates,o=Debian,a=oldstable-updates,n=bookworm-updates,l=Debian,c=main,b=armel
     origin deb.debian.org
  50 http://deb.debian.org/debian bookworm/non-free-firmware armel Packages
     release v=12.13,o=Debian,a=oldstable,n=bookworm,l=Debian,c=non-free-firmware,b=armel
     origin deb.debian.org
  50 http://deb.debian.org/debian bookworm/non-free armel Packages
     release v=12.13,o=Debian,a=oldstable,n=bookworm,l=Debian,c=non-free,b=armel
     origin deb.debian.org
  50 http://deb.debian.org/debian bookworm/contrib armel Packages
     release v=12.13,o=Debian,a=oldstable,n=bookworm,l=Debian,c=contrib,b=armel
     origin deb.debian.org
  50 http://deb.debian.org/debian bookworm/main armel Packages
     release v=12.13,o=Debian,a=oldstable,n=bookworm,l=Debian,c=main,b=armel
     origin deb.debian.org
 500 http://deb.debian.org/debian-security trixie-security/updates/main armel Packages
     release v=13,o=Debian,a=stable-security,n=trixie-security,l=Debian-Security,c=main,b=armel
     origin deb.debian.org
 500 http://deb.debian.org/debian trixie-updates/main armel Packages
     release v=13-updates,o=Debian,a=stable-updates,n=trixie-updates,l=Debian,c=main,b=armel
     origin deb.debian.org
 500 http://deb.debian.org/debian trixie/non-free armel Packages
     release v=13.4,o=Debian,a=stable,n=trixie,l=Debian,c=non-free,b=armel
     origin deb.debian.org
 500 http://deb.debian.org/debian trixie/contrib armel Packages
     release v=13.4,o=Debian,a=stable,n=trixie,l=Debian,c=contrib,b=armel
     origin deb.debian.org
 500 http://deb.debian.org/debian trixie/main armel Packages
     release v=13.4,o=Debian,a=stable,n=trixie,l=Debian,c=main,b=armel
     origin deb.debian.org
Pinned packages:
     libsdl1.2debian -> 1.2.15+dfsg2-8 with priority 700
user@brain:~$

 

優先度(Pin-Priority)は、大体こんな感じで設定すればいいみたいです。

  • 1001→ダウングレード許可(手動設定)
  • 990 → Default-Release(trixie を優先したい時)
  • 700 → SDL1.2 のように個別 pinning を設定する場合に利用
  • 500 → 通常のリポジトリ(自動選択される)
  • 100 → インストール済みパッケージ
  • 50 → 手動指定ならインストール可(安全)
  • 0→ インストール不可
  • -1→ 依存関係でも絶対に使わない

 

以上のファイルを作成した後で
以下のコマンドで、各リポジトリのアプリリストを取得できます。

$ sudo apt update

user@brain:~$ sudo apt update
Hit:1 http://deb.debian.org/debian trixie InRelease
Get:2 http://deb.debian.org/debian trixie-updates InRelease [47.3 kB]
Get:3 http://deb.debian.org/debian-security trixie-security/updates InRelease [4                                            3.4 kB]
Get:4 http://deb.debian.org/debian bookworm InRelease [151 kB]
Get:5 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Get:6 http://security.debian.org/debian-security bookworm-security InRelease [48                                            .0 kB]
Get:7 http://archive.debian.org/debian bullseye InRelease [116 kB]
Get:9 http://deb.debian.org/debian-security trixie-security/updates/main Sources                                             [123 kB]
Hit:8 https://packagecloud.io/brainhackers/brainux/any any InRelease
Get:10 http://deb.debian.org/debian-security trixie-security/updates/main armel                                             Packages [106 kB]
Get:11 http://deb.debian.org/debian bookworm/main armel Packages [8,451 kB]
Get:12 http://security.debian.org/debian-security bookworm-security/main armel Packages [275 kB]
Get:13 http://security.debian.org/debian-security bookworm-security/main Translation-en [178 kB]
Get:14 http://security.debian.org/debian-security bookworm-security/contrib Translation-en [652 B]
Get:15 http://security.debian.org/debian-security bookworm-security/non-free-firmware Translation-en [472 B]
Get:16 http://deb.debian.org/debian bookworm/main Translation-en [6,108 kB]
Get:17 http://archive.debian.org/debian bullseye/non-free Sources [81.0 kB]
Get:18 http://archive.debian.org/debian bullseye/main Sources [8,500 kB]
Get:19 http://deb.debian.org/debian bookworm/contrib armel Packages [39.7 kB]
Get:20 http://deb.debian.org/debian bookworm/contrib Translation-en [48.4 kB]
Get:21 http://deb.debian.org/debian bookworm/non-free armel Packages [54.3 kB]
Get:22 http://deb.debian.org/debian bookworm/non-free Translation-en [68.1 kB]
Get:23 http://deb.debian.org/debian bookworm/non-free-firmware armel Packages [5,480 B]
Get:24 http://deb.debian.org/debian bookworm/non-free-firmware Translation-en [20.9 kB]
Get:25 http://deb.debian.org/debian bookworm-updates/main armel Packages [6,928 B]
Get:26 http://deb.debian.org/debian bookworm-updates/main Translation-en [5,448 B]
Get:27 http://archive.debian.org/debian bullseye/contrib Sources [43.2 kB]
Get:28 http://archive.debian.org/debian bullseye/main armel Packages [7,778 kB]
Get:29 http://archive.debian.org/debian bullseye/main Translation-en [6,235 kB]
Get:30 http://archive.debian.org/debian bullseye/contrib armel Packages [37.3 kB]
Get:31 http://archive.debian.org/debian bullseye/contrib Translation-en [46.9 kB]
Get:32 http://archive.debian.org/debian bullseye/non-free armel Packages [51.6 kB]
Get:33 http://archive.debian.org/debian bullseye/non-free Translation-en [92.5 kB]
Fetched 38.8 MB in 4min 40s (139 kB/s)
5 packages can be upgraded. Run 'apt list --upgradable' to see them.
user@brain:~$

レポジトリ指定でのアプリの導入などは、aptコマンド、apt-get コマンドで可能です。
-t オプションで、レポジトリを指定できます。

#パッケージ詳細表示
$ sudo apt -a show <パッケージ名>
#パッケージインストール
$ sudo apt -t bookworm install <パッケージ名>

#パッケージのソースをインストール
$ sudo apt -t bookworm source <パッケージ名>
#パッケージに必要な前提パッケージをインストール
$ sudo apt -t bookworm build-dep <パッケージ名>
# ソースパッケージの情報を表示します。
$ apt-cache -t bookworm showsrc <パッケージ名>

bullseyeとtrixie のライブラリ上の扱いの違いとして、
t64ABIの扱いがあるようです。
bullseye 非t64ABI time_tが32bit
trixie    t64ABI time_tが64bit

「旧ABI(非t64ABI)」と「t64 ABI」を利用したアプリはバイナリ互換がないので、
両方を混在させると、aptでのパッケージ管理がめちゃくちゃになります。
(整合性が崩れてまともにアプリが追加できなくなる)

このため、既存のバイナリパッケージをインストールする際には、
trixie上でのパッケージで依存パッケージ名にt64が含まれていないことを確認しましょう。

最新パッケージに依存パッケージ名にt64が含まれていたら、
以前のバージョンのバイナリパッケージではなく、ソースからのビルドを推奨します。
(確実性で言えば、すべてソースからのビルドするのが理想ですが、これは大変なので)

 

SDL1.2使っているアプリが遅いのを対策する

SDL1.2使っているアプリが、
既存の bullseyeベースだと早いんですが、新しいtrixie ベースのBrainuxだと
動作自体はするんですが、異常に遅い・・・

確認したら、libsdl1.2debian (sdl1.2ライブラリ)が、
bullseyeベースだと、libsdl1.2 を元に作成されているのに対し、
trixie ベースから、sdl12-compatを元に作成されているので、SDL2へのラッパーになってしまっているようでした。

libsdl1.2debian (bullseye) [ ソース: libsdl1.2  ]  SDL1.2
https://packages.debian.org/ja/bullseye/libsdl1.2debian

libsdl1.2debian (trixie) [ ソース: sdl12-compat  ] SDL2へのラッパー
https://packages.debian.org/ja/trixie/libsdl1.2debian

bookwormはまだlibsdl1.2ベースでした。

なので、以下のどちらかが対策案になります
・bookwormのlibsdl1.2debian (libsdl1.2ベース)をインストールする(不採用)
 →結果、副作用が多く、断念
・libsdl1.2をtrixie用にビルドする(採用)
 →インストールに手間はかかるが、副作用が少ない

bookwormのlibsdl1.2debian (libsdl1.2ベース)をインストールする(副作用有で不採用)

レポジトリを追加していれば、以下で行けるはずとやってみた。
/etc/apt/preferences.d/bookworm-libsdl1.2.prefの指定で、
bookwormのものがインストールされます。
$ sudo apt update
$ sudo apt-get install –reinstall libsdl1.2debian

エラー
mplayer(mencoder)をインストールしていることで、一部ライブラリが競合してしまっているみたい
前提パッケージのほとんどがtrixie の “t64 ABI” と bookworm の “旧 ABI”が混じってしまっている。

以下で、sdl1.2をインストールはできましたが、その後のmplayerを入れる際に
別のt64 ABIライブラリと競合してしまっていて、インストールできない。

sudo apt remove mplayer mencoder mplayer-doc mplayer-gui
sudo apt install -t bookworm libpng16-16 libasound2 libglib2.0-0 libreadline8
sudo apt install -t bookworm libsdl1.2debian libsdl-mixer1.2 libsdl-image1.2
sudo apt install -t bookworm mplayer mencoder mplayer-doc mplayer-gui

他のaptレポジトリ登録アプリのgemdropxとかも、t64 ABI関係の競合でインストールできなくなってしまうので、trixieとしてのパッケージ整合性が完全に壊れてしまっている。

なお「t64 ABI」と「旧ABI」の違いは、日付用の型time_tを32bitか64bitに拡張したという点になります。
time_tが32bitだと2038年1月19日以降の時刻が表現できない(Y2038問題)ので、このタイミングで変更になった模様。

また「旧ABI」と「t64 ABI」を利用したアプリはバイナリ互換がないので
そのままのバイナリパッケージはインストールできない。
もし一部を「旧ABI」に戻してしますと、「t64 ABI」前提のtrixie 用パッケージもインストーるできなくなるということで、この方法はダメと判断しました。

元に戻せるかやってみる(面倒くさければ、brainuxの再展開でもいいかもしれません。)

$ sudo apt remove mplayer mencoder mplayer-doc mplayer-gui
$ sudo apt remove libsdl1.2debian libsdl-mixer1.2 libsdl-image1.2
$ sudo apt autoremove
$ sudo mv /etc/apt/preferences.d/bookworm-libsdl1.2.pref /etc/apt/preferences.d/bookworm-libsdl1.2.pref.disabled
$ sudo apt install linsdl1.2debian
$ sudo mv /etc/apt/preferences.d/bookworm-libsdl1.2.pref.disabled /etc/apt/preferences.d/bookworm-libsdl1.2.pref

一応これで戻ったっぽいです。

 

libsdl1.2をtrixie用にビルドする(採用)

libsdl1.2をビルドする方法です(20260405一部パラメータ変更)。

ソースをApt sourceでbookwormリポジトリから引っ張ってこれました。こようとしました。ただ、SDL1.2(1.2.15)は bullseye が最後のソースのため、bookwormリポジトリにあるのはそのパッチ版になります(-6->-8)。

$ sudo apt update
$ sudo apt-get install g++ build-essential
$ mkdir DPKG-BUILD
$ cd DPKG-BUILD
$ mkdir libsdl1.2debian
$ cd libsdl1.2debian
$ apt -t bookworm source libsdl1.2debian
$ sudo apt build-dep libsdl1.2debian
$ cd libsdl1.2-*

#(変更しなくてもビルドは通ります。いったん最適化の目的で以下の設定を追加しました。)
$ vi debian/rules

#!/usr/bin/make -f の下に、以下の行を追加します。

export DEB_CFLAGS_MAINT_APPEND = -march=armv5tej -marm -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-tree-vectorize -fno-aggressive-loop-optimizations -fno-strict-overflow

export DEB_CXXFLAGS_MAINT_APPEND = $(DEB_CFLAGS_MAINT_APPEND)

以下のように追記します。

confflags = –disable-rpath –enable-sdl-dlopen \
–disable-video-ggi –disable-video-svga –disable-video-aalib \

confflags = –disable-rpath –enable-sdl-dlopen \
–disable-assembly –disable-video-opengl –disable-video-x11-xrandr –disable-video-x11-xv –disable-nasm –enable-video-x11 –enable-video-fbcon –disable-video-dga –disable-video-directfb –enable-joystick –disable-cdrom \
–disable-video-ggi –disable-video-svga –disable-video-aalib \

#ビルドに必要なパッケージを導入(dpkg-buildpackageで足りないパッケージが表示されます。)
$ sudo apt install libcaca-dev

#ビルド(Brain自機ビルドでは、1.5時間くらいかかりました。)
$ dpkg-buildpackage -us -uc -b

#最適化の結果、symbolsエラーになる場合があるので、
#以下のファイルを編集して、再実行します。。
vi debian/libsdl1.2debian.symbols

以下の2行を削除します。
SDL_strlcat@Base 1.2.15
SDL_strlcpy@Base 1.2.15

$ dpkg-source –commit
fix-symbols

$ dpkg-buildpackage -us -uc -b -nc

 

$ cd ..
$ sudo dpkg -i libsdl1.2debian_1.2.15+dfsg2-8_armel.deb
$ sudo dpkg -i libsdl1.2-dev_1.2.15+dfsg2-8_armel.deb
$ sudo apt-mark hold libsdl1.2debian libsdl1.2-dev
$ sudo apt-mark showhold

これで、libsdl1.2debianがシステムに上書きインストールされました。
apt管理外の登録もしていますので、勝手に上書きされることもないはずです。

これで、trixieのレポジトリに登録しているSDL1.2を利用するようなアプリでも、
普通にapt install でインストールできることも確認しています。
これらのパッケージの依存要件としてはlibsdl1.2debianは>= 1.2.15で定義されていましたので、libsdl1.2からの自ビルドは想定されていたのかもしれません。。
(「gemdropx」,「pingus」で確認しました。)

$ apt show pingus
$ sudo apt install pingus

 

bullseyeではSDL1.2を使っていたアプリがtrixieではSDL2.0になっている場合の対応

bullseyeではSDL1.2を使っていたアプリがtrixieではSDL2.0になっている場合、
単純にapt installで導入するだけでは、今まで通りの速度では動作してくれません。
(brainでは、SDL2を使っているアプリでは、非常に低速になるため)

この場合は、以前のOS(Debian11,debian12)などで、sdl1.2を使っているバージョンを探して、
そのソースを入手して自ビルドする必要があります。

そのようにSDL1.2からSDL2へ移行しているアプリや、パッケージがなくなったアプリは、
以下のようなものがあります



https://nsb.homeip.net/wp/?p=4695https://nsb.homeip.net/wp/?p=4695
(見つけたもので、机上チェックのみしたもの多数なので、未確認なものを含みます)。

このあたりをベースに確認しました。

 

hannah の場合

(trixie 以降でSDL2に移行済。t64ABI未使用。bookwormからパッケージインストール可能)

hannahを例にとって、インストールしてみます。

まずは、SDL1.2依存のパッケージを探します。
もしあれば、trixie上でt64を含むパッケージ名のものに依存があるかどうかも確認してください。

trixieでのパッケージ情報
https://packages.debian.org/ja/trixie/hannah
→dep: libsdl2-2.0-0 (>= 2.0.12) となっているので、SDL2依存です。
→t64  : を含むパッケージ なし
 →バイナリパッケージを入れても危険性は少ないと思われます。

bookwormでのパッケージ情報
https://packages.debian.org/ja/bookworm/hannah
→dep: libsdl-image1.2 (>= 1.2.10) となっているので、SDL1.2依存です。

bullseyeでのパッケージ情報
https://packages.debian.org/ja/bullseye/hannah
→dep: libsdl-image1.2 (>= 1.2.10) となっているので、SDL1.2依存です。

これを見ると、bookwormのバージョンまではSDL1.2依存だったというのがわかります。
この情報はapt showで確認することも出来ます(-aで、全レポジトリの情報が表示されます)。
 apt -a show hannah

では、bookwormレポジトリから、インストールします。
通常実行パッケージをインストールする場合は、以下のように入力しますが
状況によっては依存関係でエラーになります(t64ABIに切り替わっているABIにリンクされていたらアウト)。
今回のようにtrixie版で、「t64」を含むパッケージが依存関係に含まれていないのであれば、
直接入れても危険性は少ないです(が、完ぺきではないでのであとで問題になる可能性はゼロではないです。このリスクを避けるにはソースからのインストールになります)。

$ sudo apt -t bookworm install hannah

今回は、特に依存エラーがなく、bookworm 版のhannahが入りました。
そのままインストールできて、プレイも出来ました。

あとは、勝手にアップグレードされないように aptでホールドもしておきます。
(専用データファイルがあればそれも追加)

$ sudo apt-mark hold hannah hannah-data

 

もし、既に最新版のhannahがはいっていた場合は、うまく入らない場合があるので、
以下のようにパッケージを削除してから再導入してみてください。
また、apt show -a で依存関係を見て、特定のバージョンに依存していて、
既にそれより高いバージョンが入っているような場合は、hannahをパッケージも削除します。

今回の場合、依存関係を確認してみます。

trixie
Depends: hannah-data (= 2.0.1+ds1-0.3), libc6 (>= 2.34), libgcc-s1 (>= 3.5), libsdl2-2.0-0 (>= 2.0.12), libsdl2-image-2.0-0 (>= 2.0.5), libsdl2-mixer-2.0-0 (>= 2.6.0), libsdl2-ttf-2.0-0 (>= 2.0.15), libstdc++6 (>= 13.1)

bookworm
Depends: hannah-data (= 1.0-3.3), libc6 (>= 2.34), libgcc-s1 (>= 3.5), libsdl-image1.2 (>= 1.2.10), libsdl-mixer1.2 (>= 1.2.12), libsdl-ttf2.0-0, libsdl1.2debian (>= 1.2.15), libstdc++6 (>= 11)

このように「hannah-data」もダウングレードする必要があることが判るので、
以下のようにいったんパッケージを削除してから、再導入します。

$ sudo apt remove hannah hannah-data
$ sudo apt -t bookworm install hannah

 

enigma の場合

(trixie以降でSDL2に移行済。t64ABI使用。bookwormからソースを入手してビルド可能)

enigmaを例にとって、ソースからインストールしてみます。

まずは、SDL1.2依存のパッケージを探します。
もしあれば、trixie上でt64を含むパッケージ名のものに依存があるかどうかも確認してください。

trixieでのパッケージ情報
https://packages.debian.org/ja/trixie/enigma
→dep: libsdl2-2.0-0 (>= 2.0.12) となっているので、SDL2依存です。
→t64  : を含むパッケージ あり(libcurl3t64-gnutls)
 →バイナリパッケージがもし入ってもt64 ABIの混在が発生する可能性
  があるので危険。ソースからの導入が安全

bookwormでのパッケージ情報
https://packages.debian.org/ja/bookworm/enigma
→dep: libsdl-image1.2 (>= 1.2.10) となっているので、SDL1.2依存です。

bullseyeでのパッケージ情報
https://packages.debian.org/ja/bullseye/enigma
→dep: libsdl-image1.2 (>= 1.2.10) となっているので、SDL1.2依存です。

これを見ると、bookwormのバージョンまではSDL1.2依存だったというのがわかります。
この情報はapt showで確認することも出来ます(-aで、全レポジトリの情報が表示されます)。
 apt -a show enigma

では、bookwormレポジトリから、インストールします。
通常実行パッケージをインストールする場合は、以下のように入力しますが
状況によっては依存関係でエラーになります(t64ABIに切り替わっているABIにリンクされていたらアウト)。
今回のようにtrixie版で、「t64」を含むパッケージが依存関係に含まれている場合は、
バイナリパッケージを入れるのは危険なので、ソースでインストールする必要があります。

$ cd
$ cd DPKG-BUILD
$ mkdir enigma
$ cd enigma
$ apt source -t bookworm enigma

Error: Can not find version ‘1.20-dfsg.1-2.2’ of package ‘enigma’
Error: Unable to find a source package for enigma

#エラーになりました。
#パッケージ状況を確認します。
$ apt-cache showsrc -t bookworm enigma

Package: enigma
Binary: enigma, enigma-doc, enigma-data
Version: 1.30+dfsg-3
~

Package: enigma
Binary: enigma, enigma-doc, enigma-data
Version: 1.20-dfsg.1-2.2
~

すると、bookworm に登録しているバージョンが1.30(デフォルト)と1.20と2つあり、
sudo apt source -t bookworm enigma では、1.20を要求してしまうのですが、
“存在するが、優先度が低い”という扱いになって、発見できなかったようです。

なので、バージョン指定も込みで指定してソースをダウンロードします。
(もしこれでもダメなら、bullseye のものをダウンロードするしかありません。)

$ apt source -t bookworm enigma=1.20-dfsg.1-2.2


#依存関係を解決します。
$ sudo apt -t bookworm build-dep enigma=1.20-dfsg.1-2.2

依存エラー発生しました。

エラーになった場合は、ダメもとでtrixie版としての依存関係の解決もしておきます。
(trixie版パッケージの前バージョンのビルドであれば、これで結構足りないパッケージが補完される場合が多いです)

$ sudo apt build-dep enigma

#ビルド準備。
$ cd enigma-*

#申し訳程度の最適化設定(有効になっているか未確認)
$ vi debian/rules

#!/usr/bin/make -f の下に、以下の行を追加します。

export DEB_CFLAGS_MAINT_APPEND = -march=armv5tej -marm -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-tree-vectorize -fno-aggressive-loop-optimizations -fno-strict-overflow

export DEB_CXXFLAGS_MAINT_APPEND = $(DEB_CFLAGS_MAINT_APPEND)


#ビルドします。
$ dpkg-buildpackage -us -uc -b

dpkg-source --before-build .
dpkg-checkbuilddeps: error: unmet build dependencies: libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-gfx1.2-dev libsdl-ttf2.0-dev quilt
dpkg-buildpackage: error: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: hint: satisfy build dependencies with your package manager frontend

#以下のパッケージが足りないって言われた。
libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-gfx1.2-dev libsdl-ttf2.0-dev quilt

#なので、trixie版の依存パッケージを入れる
$ sudo apt install libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-gfx1.2-dev libsdl-ttf2.0-dev quilt

#再度ビルドを開始します。(多分brain自ビルドで、11時間ぐらい?)
$ dpkg-buildpackage -us -uc -b

#パッケージをインストールして、依存無視も入れます。
#パッケージインストール時にもしパッケージが足りないようなメッセージが出たら、
#個別でインストールしてみてください。($ sudo apt install fonts-dejavu-extra)

$ cd..
$ sudo dpkg -i enigma_1.20-dfsg.1-2.2_armel.deb enigma-data_1.20-dfsg.1-2.2_all.deb enigma-doc_1.20-dfsg.1-2.2_all.deb

$ sudo apt-mark hold enigma enigma-data enigma-doc

$ enigma

 

Python3-pygameのアプリが遅い

TrixieベースのBrainuxの場合、python3-pygameの基盤がSDL1.2からSDL2に
切り替わっているため、そのままでは非常に重くなり動作困難になります。

python3-pygameのSDL1.2化に挑戦していますが、現在難航中です。
(動作確認しているアプリが少ないので、影響はないとは思いますが)
python3-pygame ライブラリを利用したソフトウェア

Python3.13になって、いろいろ内部仕様が変わっていてSDL1.2化と共存できていません。

  • pygame 1.9.6 が SDL 1.2 を使う最後の安定版です。
  • ただし、このバージョンは Python 3.8 までしか公式対応していません。
  • Python 3.13 で動かすには、ソースコードを修正してビルドする必要があります。

 

bookwormパッケージ以前のGTK2のアプリが動かない

bookwormパッケージのGTK2 アプリは libgtk2.0-0(非 t64)を要求しますが、
libgtk2.0-0 は libcups2(non‑t64) → libgnutls30(non‑t64) → libnettle8(non‑t64:3.8.1-2) を要求します。
しかし apt 3.0.3(t64) が “libnettle8 < 3.9.1-2.2~ を禁止” しているため、依存関係が絶対に解決できません。

ですので、libgtk2.0-0を利用するbookwormパッケージについては、TrixieバースのBainuxでは動きません。

gnome-games, gtkpool, gtans あたりが対象になります。

 

Trixieで利用可能になったパッケージの紹介

debian13(Trixie)で、新たに追加になったもいくつかあります。
(それ以前でのbullseyeなどではapt installできません)

———-

trixie 以降でインストール対応のアプリ

SDL1.2

spout  小さな抽象的な白黒2D洞窟シューティングゲーム(bullseyeではapt installできない)

https://packages.debian.org/trixie/spout

起動:spout

これは日本の開発者Kuniによる、小規模で抽象的なシューティングゲームです。エンジンの排気ガスが洞窟の壁を侵食する道具としても機能する「洞窟飛行ゲーム」です。

あなたの目標は、洞窟の壁や窓枠に衝突することなく、できる限り長く上空へ飛び続けることです。

●縦スクロールの洞窟飛行ゲーム
方向変換とスラスターだけで洞窟内を飛行します。
洞窟の壁やウインドウの境界にぶつかるとゲームオーバーです。
できるだけ高い所まで、上に向かって進みます。

スペースキーを押して開始します。
シフトキーを押しながらエスケープキーを押すとプログラムを終了します。
【操作】[←]:左回転 [→]:右回転 [space]:進む [Esc]:一時停止

trixie からリポジトリに追加になったゲームです。

Brainでも快適にプレーできます
(trixieベースのDebianでは、libsdl1.2debianの入れ替えの必要あり)

噴射で洞窟の壁が破壊できるので、
狭いところや行き止まりを噴射を使って広げるなんてテクニックも必要になって切るようです。もちろん失速の期限性がありますので、操作はかなり難しくなります。

起動オプションは以下のものが使用できます。
-fでフルスクリーン
-z <数字>で、画面サイズを変更できます
 (Default:4 で、数値小さくすると画面が小さくなりますがスピードも速くなります。)

 

 インストール:APT経由 ”sudo apt install spout”
 (trixie 以降でインストール対応のアプリ。bullseyeではapt installできません。)

 

———-

python3-cairo

△ ghextris 六角形のグリッド上で行われるテトリスのようなゲーム

https://packages.debian.org/trixie/ghextris

起動:ghextris

ゲームの目的は基本的にテトリスと同じです。ゲームエリアの上部から落ちてくるブロックを使って、完全に埋まったラインを作り、それが消えて新しいブロックのためのスペースが生まれるというものです。ただし、ブロックは六角形のブロックで構成されているため、視覚化能力がさらに鍛えられます。

●ブロックが六角形のテトリス
テトリスと同じですが、ブロックが六角形なので難しいです。
【操作】 [←]:左へ [→]:右へ [↑]:回転 [SPC]:落下

Brainだと縦解像度が足りないので、画面下を表示できるように移動が必要です。
ただ、ゲーム開始がGUIだと一番上のGame->New Gameをする必要があるのですが、
画面を一番下が表示できるようにしておくと、これが出来ない。

Ctrl+Nで開始はできるので、これで代用すればゲーム自体は開始&プレイできます。
この場合ゲーム終了は、以下で可能です。
・起動したshellでCtrl+C
・タスクバーでghextrisを選んで、右クリックのClose

 

 インストール:APT経由 ”sudo apt install ghextris”

 

———-

 

まとめ

今回リリースされたTrixieベース(debian13)のBrainuxは、
以前のBullseyeベース(debian11)のBrainuxと比較すると、
少しレスポンスが遅れる気がしないでもないですが、
問題なく使えそうです。

Bullseyeベースは既に2024/8で通常サポート切れで「oldoldstable」となっていますので、
aptレポジトリがいつまで、使えるかが不透明な状態です
(aptレポジトリも強制的に変更しないと使えない状態)。

2028年まで通常サポートがあるTrixieベースのBrainuxがリリースされたことで、
しばらくは安心してBrainuxで遊べそうです。

バージョン (コードネーム) リリース日通常サポート終了LTS終了予定
13 (Trixie)2025年8月(予定)2028年8月2030年6月
12 (Bookworm)2023年6月10日2026年6月2028年6月
11 (Bullseye)2021年8月14日2024年8月2026年6月-8月

 

Views: 470

カテゴリー: Brain, Brainux, debian, Linux | コメントする

電子辞書Brainをいじる (11) BrainuxでBASICで遊ぶ

YaBasicを試す

Brainux上で動くBASICインタープリタを探してみたところ、
グラフィックもサポートしているのものとして、YaBasicというものが見つかりました。

△ yabasic  グラフィック処理も可能なBASICインタープリタ

https://packages.debian.org/bullseye/yabasic
https://2484.de/yabasic

起動:yabasic

Yabasicは伝統的なBasicインタプリタです。goto文や様々なループ文を備え、サブルーチンやライブラリを定義できます。簡単なグラフィック処理や印刷も可能です。C言語で書かれたライブラリを呼び出せるため、スタンドアロンプ​​ログラムの作成も可能です。YabasicはUnixとWindowsで動作し、充実したドキュメントが用意されています。小型でシンプル、オープンソースで無料です。

Burainuxでも動作するグラフィック処理も可能なBasicインタープリタです。

 

 インストール1:APT経由 ”sudo apt install yabasic”
 (グラフィック機能利用時には、XLIB_SKIP_ARGB_VISUALS=1が必要)

 インストール2:ソースからインストール
 (グラフィックモードの不具合解消に挑戦して、
  opwn window自体はできるようになったが、
  その先の描画でエラーになるので挫折中)
  ビルド時に-o3 -march=native指定することでの高速化はおそらくできます。

 

YaBasicの実行方法

YaBasicでBASICコードを実行するには、以下のような方法があります。
・BASICコードをファイルに保存して引数として呼び出す
 yabasic ./demo.yab

・yabasicを起動して、BASICコードを入力していき、最後に何も入力しないでEnterを押す

yabasic
 print “Hello”

 Hello

ただし、xterm上で起動すると、文字の色指定がうまく表示されないときがあるので、
その場合は、brainuxデフォルトのターミナル(lxterminal)を使いましょう。

———-

また、グラフィック処理を使う場合にはそのまま起動するだけではエラーになります。

user@brain:~$ yabasic

open window 100,100

X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 1 (X_CreateWindow)
Serial number of failed request: 18
Current serial number in output stream: 22

これは、yabasicが想定しているグラフィック環境と、実態(BrainuxのX環境)間のずれのせいでグラフィックウィンドウがうまく開けないためのようです。

この場合、以下のようにしてyabasicを起動してください。
これでグラフィックモードも開けるようになります。
 XLIB_SKIP_ARGB_VISUALS=1 yabasic

毎回入力すのが大変であれば、以下のようにalias設定すれば、
ターミナル上で、「yabasic」と入力するだけでOKになります。

echo 'alias yabasic="XLIB_SKIP_ARGB_VISUALS=1 yabasic"' >> ~/.bashrc
source ~/.bashrc

ちなみに、Linux上では、.yab の1行目に以下のどちらかを書いておいて、
chmod +x hoge.yab と打って実行権限を付ければ、
./hoge.yab で実行できるようになるそうです。

#!/usr/bin/yabasic
#!/usr/bin/env yabasic

ただbrainuxの場合は、以下のようにラッパーを作成しての対応が必要そうです。
(この対応をするのであれば、alias設定は不要です)

$ sudo mv /usr/bin/yabasic /usr/bin/yabasic-brain
$ sudo vi /usr/bin/yabasic
#!/bin/sh
XLIB_SKIP_ARGB_VISUALS=1 /usr/bin/yabasic-brain “$@”
$ sudo chmod /usr/bin/yabasic

 

———-

YaBasicのサンプルプログラム

YaBasicのマニュアルは、「https://2484.de/yabasic/support.html」に書かれています。

また、関連サイト「https://2484.de/yabasic/related.html」から、yabasicで使えるBasicコードにたどり着くこともできそうです。
Brainで使う場合は、解像度問題があるのでそこは考慮しないといけませんが、
特にRosetta Codeは非常に参考になります。

いくつか、サンプルプログラムを動かしてみます。
(一部変更済済)

hello.yab Hello World表示

#!/usr/bin/yabasic
clear screen
print "Press 'q' to quit ..."
label again
print color("green") "Hello ";
print color("blue") "World !   ";
if (inkey$(1)="q") exit
goto again

 

asciitable.yab アスキーコード表示

#!/usr/bin/yabasic
for i = 32 to 47
    for j = i to i + 80 step 16
	    s$ = chr$(j) + "  "
        if j = 32  s$ = "Spc"
        if j = 127 s$ = "Del"
		print str$(j, "#####"), ": ", s$;
    next j
    print
next i

 

gdemo.yab グラフィック表示デモ

#!/usr/bin/yabasic
w = 400
open window w, w
sleep 1
label again
backcolour 0,0,0
clear window
for i=0 to w step 5
  v = 255 * i / w
  color 0, v, (255 - v)
  line 0, i, i, w
  color (255 - v), 0, v
  line i, 0, w, i
  pause 0.025
next i
sleep 3
goto again

 

lifegame.yab ライフゲーム

#!/usr/bin/yabasic
// Game_of_Life
 
X = 59 : Y = 35 : H = 4
 
open window X*H,Y*H
backcolor 0, 0, 0
 
dim c(X,Y) : dim cn(X,Y) : dim cl(X,Y)

// Thunderbird methuselah
c(X/2-1,Y/3+1) = 1 : c(X/2,Y/3+1) = 1 : c(X/2+1,Y/3+1) = 1  
c(X/2,Y/3+3) = 1 : c(X/2,Y/3+4) = 1 : c(X/2,Y/3+5) = 1
 
s = 0
repeat
    clear window
    alive = 0 : stable = 1
    s = s + 1
    for y = 0 to Y-1 
        for x = 0 to X-1
            xm1 = mod(x-1+X, X) : xp1 = mod(x+1+X, X)
            ym1 = mod(y-1+Y, Y) : yp1 = mod(y+1+Y, Y)
            cn(x,y) = c(xm1,y) + c(xp1,y)
            cn(x,y) = c(xm1,ym1) + c(x,ym1) + c(xp1,ym1) + cn(x,y)
            cn(x,y) = c(xm1,yp1) + c(x,yp1) + c(xp1,yp1) + cn(x,y)
            if c(x,y) = 1 then
                if cn(x,y) < 2 or cn(x,y) > 3 then 
                    cn(x,y) = 0
                else 
                    cn(x,y) = 1
                    alive = alive + 1
                end if
            else 
                if cn(x,y) = 3 then 
                    cn(x,y) = 1
                    alive = alive + 1
                else
                    cn(x,y) = 0
                end if
            end if
            if c(x,y) then
                if cn(x,y) then
                    if cl(x,y) color 0, 0, 255          // adult
                    if not cl(x,y) color 0, 255, 0      // newborn
                else 
                    if cl(x,y) color 255, 0, 0          // old
                    if not cl(x,y) color 255, 255, 0    // shortlived
                end if 
                fill rect x*H,y*H,x*H+H,y*H+H
            end if
        next x
    next y

    pause 0.06
    // Copy arrays
    for i = 0 to X-1
        for j = 0 to Y-1
            if cl(i,j)<>cn(i,j) stable = 0
            cl(i,j) = c(i,j)
            c(i,j) = cn(i,j)
        next j
    next i  
until(not alive or stable)
 
if not alive then
    print "Died in ", s, " iterations"
    clear window
else 
    print "Stabilized in ", s-2, " iterations"  
end if

 

clock-degital.yab デジタル時計

#!/usr/bin/yabasic
clear screen
open window 300,100
backcolor 0, 0, 0
window origin "cc"

// Display digital clock
sub digital_clock()
    local t$(1), void
    static as$
    
    void = token(time$, t$(), "-")

    if t$(3) <> as$ then
        draw_clock(t$(1), t$(2), t$(3))
        as$ = t$(3)
    end if
end sub

sub draw_clock(hour$, mint$, ssec$)
    local d$(1), void
    
    void = token(date$, d$(), "-")
    clear window
    color 200, 255, 0
    text -140, -30, d$(3) + "/" + d$(2) + "/" + d$(4), ""
    text 0, 0, hour$ + ":" + mint$ + ":" + ssec$, "cc", ""
end sub

if peek$("library") = "main" then
    repeat
        digital_clock()
    until(upper$(inkey$(.01))="ESC")
    exit
end if

 

clock-analog.yab アナログ時計

#!/usr/bin/yabasic
REM yaclock
DEG_PER_RAD = 57.257751

winx = 440
winy = 440

radius = min(winx,winy) / 2 - 1
hx = (winx/2) - 1
hy = (winy/2) - 1

REM length of the hands (90% of the radius of the clock face)
shand = int(radius * .9)
mhand = int(radius * .9)
hhand = int(radius * .5)

REM drop coords by one since graphics are 0 based

winx = winx - 1
winy = winy - 1

clear screen

open window winx,winy

clockface()

do

    hour = val(mid$(time$,1,2))
    mins = val(mid$(time$,4,2))
    sec  = val(mid$(time$,7,2))
    
    updatehand("sec")
    updatehand("mins")
    updatehand("hour")

    pause .25

loop

sub updatehand(hand$)
    
    switch(hand$)
        case "sec"
            h_len = shand
            angle = sec * 6
            width = 6
            color 255,0,0
            ox = osx
            oy = osy
            oxm1 = osxm1
            oxm2 = osxm2
            oym1 = osym1
            oym2 = osym2
            break
        case "mins"
            h_len = mhand
            angle = mins * 6 + int(sec/10)
            width = 12
            color 0,255,0
            ox = omx
            oy = omy
            oxm1 = omxm1
            oxm2 = omxm2
            oym1 = omym1
            oym2 = omym2
            break
        case "hour"
            h_len = hhand
            angle = ((hour * 30) + (minutes / 12) * 6) + int(mins/2)
            width = 15
            color 0,0,255
            ox = ohx
            oy = ohy
            oxm1 = ohxm1
            oxm2 = ohxm2
            oym1 = ohym1
            oym2 = ohym2
            break
    end switch

    h_angle1 = angle - width
    if h_angle1 < 0 then 
        h_angle1 = h_angle1 + 360
    endif 
    h_angle1 = h_angle1 / DEG_PER_RAD
    
    h_angle2 = angle + width
    if h_angle2 > 360 then 
        h_angle2 = h_angle2 - 360
    endif   
    h_angle2 = h_angle2 / DEG_PER_RAD
    
    angle = angle / DEG_PER_RAD
    
    x = (hx + (sin(angle) * h_len))
    xm1 = (hx + (sin(h_angle1) * int(h_len * .2)))
    xm2 = (hx + (sin(h_angle2) * int(h_len * .2)))

    y = (hy - (cos(angle) * h_len))
    ym1 = (hy - (cos(h_angle1) * int(h_len * .2)))
    ym2 = (hy - (cos(h_angle2) * int(h_len * .2)))

    clear line hx,hy,oxm1,oym1
    clear line hx,hy,oxm2,oym2
    clear line oxm1,oym1,ox,oy
    clear line oxm2,oym2,ox,oy
    line hx,hy,xm1,ym1
    line hx,hy,xm2,ym2
    line xm1,ym1,x,y
    line xm2,ym2,x,y
    
    REM save off the old vals
    switch(hand$)
        case "sec"
            osx = x
            osy = y
            osxm1 = xm1
            osxm2 = xm2
            osym1 = ym1
            osym2 = ym2
            break
        case "mins"
            omx = x
            omy = y
            omxm1 = xm1
            omxm2 = xm2
            omym1 = ym1
            omym2 = ym2
            break
        case "hour"
            ohx = x
            ohy = y
            ohxm1 = xm1
            ohxm2 = xm2
            ohym1 = ym1
            ohym2 = ym2
            break
    end switch
end sub

sub clockface()
    circle hx,hy,radius
    
    htick = radius / 10
    mtick = htick / 2
    
    for z=0 to 360 step 6
        REM  Begin at zero deg and stop before 360 deg

        REM draw the hour markers
        angle = z
        angle = angle / DEG_PER_RAD
        x2 = (hx + (sin(angle) * radius))
        y2 = (hy - (cos(angle) * radius))
        if mod(z,30) = 0 then
            tick = htick
        else
            tick = mtick
        endif
        x3 = (hx + (sin(angle) * (radius - tick)))
        y3 = (hy - (cos(angle) * (radius - tick)))
        color 255,0,0
        line x2,y2,x3,y3
        color 0,0,0
    next z
end sub

 

Mandelbrot.yab マンデルブロート集合描画

#!/usr/bin/yabasic
open window 640, 400
wid = 4
xcenter = -1: ycenter = 0
ms = 0
for xcoord = 0 to 639
   for ycoord = 0 to 200
       ms = 0
       ca =(xcoord-320)/640*wid+xcenter
       cb =(ycoord-200)/640*wid+ycenter
       x = 0: y=0

       for t = 1 to 20
           xnew = x*x-y*y+ca
           ynew = 2*x*y+cb
           x=xnew:y=ynew
           magnitudesquared=x*x+y*y
           ms = magnitudesquared
           if (magnitudesquared > 100) break
           //if(magnitudesquared < 100) then : color 0,0,0 : dot xcoord, ycoord : end if
       next t
       ms = ms+1
       if(ms > 250) then
       	    color 32,64,mod(ms,255)
            dot xcoord, ycoord
            dot xcoord, 400- ycoord
        elseif (ms > 150) then
            color mod(ms,255),64,32
            dot xcoord, ycoord
            dot xcoord, 400-ycoord
        else
            color 0,0,0
            dot xcoord, ycoord
            dot xcoord, 400-ycoord
        end if
    next ycoord
next xcoord

 

その他参考になるサンプルプログラムを公開しているサイト

その他いろんなサイトで、サンプルプログラムを見つけることができます。

公式デモ

Yabasic公式ページ内にあるyabasicのソースコード内にある
demo.yab を実行すると、
素数調査&テキスト横スクロールデモ、
グラフィックデモ、三角錐回転デモ
が見られます。

 

yabasic-examples

https://github.com/spartrekus/yabasic-examples

サインカーブ表示デモとテトリスが含まれています
(テトリスは解像度の関係で下部分が表示されていないので別途調整が必要です)
(2か所ほど数字を変えれば調整できますので、挑戦してみてください。)
(ヒント: 縦20行->17行にすれば、Window最前面化せずとも表示できます。)

 

Rosetta Code(YaBasic)

https://rosettacode.org/wiki/Category:Yabasic

いろんな言語でのサンプルプログラムが刑されていますが、YaBasicだけで大量のサンプルがあります(今回サンプルとして実行したものもここサイトのものをベースにしているものがあります)。

参考(PS2版YaBASIC)

PS2版YaBasicについて

ネット上で探すと、PS2用のyabasicソースもみつかりますが、
一部PS2専用に追加されている命令が使われているようで、Brainuxで利用可能でX11版では動きませんでした。

これは、PS2で追加されたBASIC命令がいくつかあるためです。
特にsetrgb命令がが頻出するようです(色のパレット変更命令ぽい?)。

ただ、Brainで利用可能なX1ポート版では未対応で、一時期本家に取り込むかという話はあったようですが、X11などでは実装は難しいとのことでペンディングになっているようです。

https://github.com/marcIhm/yabasic/issues/39
// Additions introduced with the PS2 version
void triangle(struct command *cmd);
void gtriangle(struct command *cmd);
void setrgb(struct command *cmd);
void setdrawbuf(struct command *cmd);
void setdispbuf(struct command *cmd);

PS2用のBasicをWin32ポートに移植したものや、
javascript実装したもの(Web上で実行できます)もあるので、
こちらで動かすことはできそうです。

Win32移植版
https://sourceforge.net/projects/win32yabasic

Javascript実装
https://www.mrdictionary.net/yabasic

 

PS2用ゲームプログラムについて

PS2用YaBasicソース

Yabasic for PS2

Yabasic for PS2 : Free Download, Borrow, and Streaming : Internet Archive

昔はPS2のゲーム機加税回避のため、一部の国でプログラミング言語を梱包したことがあるようで、その際に梱包されたのがこのYabasicの移植版だったそうです。

先ほどの通り、特殊な命令が追加されています。

上記のリックから、Ps2用のYaBasicソースが入手できます。
ただ、一部特殊な命令が使われているのと、Window解像度が640×512になっていることが多いので、ゲームレイアウト的にも厳しいものもあるかもしれません。
(Brainuxの解像度は縦480ですが、Windowの枠を考えるとを実質440-450くらいです。)

———-

Win32 PS2 YaBasic Samples

https://win32yabasic.sourceforge.net/samples.html

PS2版YaBasicのWindows移植版のサンプルプログラムです。
特に、「rotating_triangle」というグラフィックデモをBrainで動かしてみたかったのですが、
PS2版で追加された専用命令をメインで使用しているため、断念しました
(下の画像はJavascript実装上で実行したものです。)。

 

 

 

 

BasiC-256を試す

プログラミング学習用のBASIC動作環境とのことです。

標準では、GUI表示されるウインドウの中に、
・エディタ部分、
・テキスト出力エリア、
・グラフィック出力エリア
が入っています。
また、変数確認エリアも追加できます。

ただ実行するだけでなく、デバック実行として、1行ずつ実行していくことも出来ます。
この際には」、変数確認エリアを見ながら確認することも出来るので、学習に役立つでしょう

〇 basic-256 (basic256)  子供向けの教育用BASICプログラミング環境

BASIC-256は、誰でも(特に中学生・高校生)にコンピュータプログラミングの基礎を教えられるように設計された、使いやすいBASICバージョンです。gosub、for/next、gotoといった伝統的な制御構造を採用しており、子どもたちがプログラムのフロー制御の仕組みを簡単に理解できます。グラフィックモードが組み込まれており、数分で画面に絵を描くことができます。
また、楽しい演習を通してプログラミングの概念を紹介する、詳細で分かりやすいチュートリアルも用意されています。

https://packages.debian.org/bullseye/basic256
https://basic256.org/

起動:basic256

ドキュメントも日本語はありませんが、用意されており、
このページにサンプルプログラムも紹介されています。
https://doc.basic256.org/doku.php

YaBasicと比べると遅いですが、実行結果の確認は楽です。

Brainで実行する場合は、Basic-256が統合環境のため、
各ウィンドウが小さくなってしますが、学習用途であれば何とかなるかもしれません。
グラフィックウィンドウについては、エディタ、テキスト出力エリア、グラフィックを同時に出力した場合で、調整すれば、縦幅170くらいは表示できそうです。
(グラフィックウィンドウについては、縮小化表示もできます[1/2(half),1/4(quarter))
出力結果をPDFで出力することも出来ます。

 

サンプルプログラムについて

サンプルプログラムとしては、以下からソースプログラムをダウンロードすれば、
中に入っていました(.kbsファイル)

https://sourceforge.net/projects/kidbasic/files
basic256_2.0.99.10.orig.tar.gz

solar_system.kbs

snowflakes.kbs

rainbow.kbs

spriteslice.kbs

ring_01.kbs

 

 

その他参考になるサンプルプログラムを公開しているサイト


ドキュメントに掲載されているサンプルプログラム

https://doc.basic256.org/doku.php?id=start

spinner.kbs  針が動いて1-10がランダムに選ばれます。

gamesballons.kbs 大量の風船が上に浮かんでいきます(がBrain上だとめっちゃ遅いです。)

CopyCat.kbs サイモン的記憶ゲーム(実行には一部修正が必要)

mobius.kbs アニメーション化されたメビウスの輪(スムーズに回転します)

morie.kbs モアレ模様が表示されます。

square.kbs スクエア・スパイラル

jagged.kbs Jagged Depths 三角形を使ってカラフルな円形を表示します。(1/2表示)

 

Rosetta Code(BASIC256)

https://rosettacode.org/wiki/Category:BASIC256

いろんな言語でのサンプルプログラムが刑されていますが、BASIC-256だけで大量のサンプルがあります。

マンデルブロート集合描画
https://rosettacode.org/wiki/Mandelbrot_set#BASIC256
(全部表示されるまでに、1時間以上かかります。)

 

Basic Bits – Copy paste & run

https://basic256.blogspot.com

BASIC-256で動作する各種プログラムを公開されています。
グラフィックデモの他に、いくつかのゲームも含まれています。

Views: 513

カテゴリー: Brain, Brainux, debian, Linux, ツール | コメントする

電子辞書Brainをいじる (10) Brainuxで別の電子辞書EX-wordをハックして遊ぶ

EX-wordとは

EX-wordは、国内シェアで SHARP Brain と双璧をなす CASIO の電子辞書です。

この電子辞書でも、Brainほどではありませんが一部解析が進んでいるようです。
例えば、TEST MENUに入ったり、PCと接続して様々な操作をしたり出来るようです。

EX-word | Brain Wiki | Fandom

ということで買ってきました。EX-word DATAPLUS 6 XS-D6500
(武蔵小山のハードオフで550円(税抜き)でした。)

“EX-word 接続ツール”(libexword)を導入する

Brainuxはdebian11ベースなので”実質PC”だからうまくいく気がする。ということで、
Brainuxに、「PC と EX-word を接続して様々な操作を行うツール(libexword)」を導入してみます。

こちらのページを参考にインストールします。
Libexword | Brain Wiki | Fandom

インストールに必要なパッケージをインストール

sudo apt install git build-essential libusb-1.0-0-dev libglib2.0-dev libreadline-dev libtool
sudo apt install libopenobex2 libopenobex2-dev

user@brain:~$ sudo apt install git build-essential libusb-1.0-0-dev libglib2.0-dev libreadline-dev libtool
[sudo] password for user:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
build-essential is already the newest version (12.9).
git is already the newest version (1:2.30.2-1+deb11u2).
libglib2.0-dev is already the newest version (2.66.8-1+deb11u4).
libglib2.0-dev set to manually installed.
libtool is already the newest version (2.4.6-15).
The following additional packages will be installed:
  libncurses-dev
Suggested packages:
  ncurses-doc readline-doc
Recommended packages:
  libusb-1.0-doc
The following NEW packages will be installed:
  libncurses-dev libreadline-dev libusb-1.0-0-dev
0 upgraded, 3 newly installed, 0 to remove and 2 not upgraded.
Need to get 516 kB of archives.
After this operation, 2,707 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.debian.org/debian bullseye/main armel libncurses-dev armel 6.2+20201114-2+deb11u2 [305 kB]
Get:2 http://archive.debian.org/debian bullseye/main armel libreadline-dev armel 8.1-1 [134 kB]
Get:3 http://archive.debian.org/debian bullseye/main armel libusb-1.0-0-dev armel 2:1.0.24-3 [76.1 kB]
Fetched 516 kB in 2s (207 kB/s)
Selecting previously unselected package libncurses-dev:armel.
(Reading database ... 59923 files and directories currently installed.)
Preparing to unpack .../libncurses-dev_6.2+20201114-2+deb11u2_armel.deb ...
Unpacking libncurses-dev:armel (6.2+20201114-2+deb11u2) ...
Selecting previously unselected package libreadline-dev:armel.
Preparing to unpack .../libreadline-dev_8.1-1_armel.deb ...
Unpacking libreadline-dev:armel (8.1-1) ...
Selecting previously unselected package libusb-1.0-0-dev:armel.
Preparing to unpack .../libusb-1.0-0-dev_2%3a1.0.24-3_armel.deb ...
Unpacking libusb-1.0-0-dev:armel (2:1.0.24-3) ...
Setting up libncurses-dev:armel (6.2+20201114-2+deb11u2) ...
Setting up libusb-1.0-0-dev:armel (2:1.0.24-3) ...
Setting up libreadline-dev:armel (8.1-1) ...
Processing triggers for man-db (2.9.4-2) ...
user@brain:~$

libexword のソースコードを取得

libexword のソースコードを取得します

cd
mkdir libexword
cd libexword/
git clone --depth 1 -b '2.0-dev' https://github.com/brijohn/libexword.git
cd libexword/

user@brain:~$ mkdir libexword
user@brain:~$ cd libexword/
user@brain:~/libexword$ ls
user@brain:~/libexword$ git clone --depth 1 -b '2.0-dev' https://github.com/brijohn/libexword.git
Cloning into 'libexword'...
remote: Enumerating objects: 42, done.
remote: Counting objects: 100% (42/42), done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 42 (delta 0), reused 25 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (42/42), 83.03 KiB | 393.00 KiB/s, done.
user@brain:~/libexword$
user@brain:~/libexword$
user@brain:~/libexword$ ls
libexword
user@brain:~/libexword$ cd libexword/
user@brain:~/libexword/libexword$ ls
AUTHORS     configure.ac     m4           NEWS          src
autogen.sh  docs             Makefile.am  protocol.txt
ChangeLog   libexword.pc.in  models.txt   README
user@brain:~/libexword/libexword$

libexwordのビルド

libexwordをビルドします。
が、そのままだとARM CPUの場合に一部動作がおかしくなるので一部修正も行います。

$ vi configure.ac

 AM_PROG_CC_C_O

+CFLAGS="$CFLAGS -fsigned-char"
+
 AC_PATH_PROGS([DOX_PROG], [doxygen], missing)

$ ./autogen.sh
$ make
$ sudo make install
$ sudo ldconfig
$ sudo mkdir -p /root/.local/share/exword/ja

user@brain:~/libexword/libexword$ ./autogen.sh
libtoolize: putting auxiliary files in '.'.
libtoolize: linking file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: linking file 'm4/libtool.m4'
libtoolize: linking file 'm4/ltoptions.m4'
libtoolize: linking file 'm4/ltsugar.m4'
libtoolize: linking file 'm4/ltversion.m4'
libtoolize: linking file 'm4/lt~obsolete.m4'
configure.ac:15: installing './ar-lib'
configure.ac:15: installing './compile'
configure.ac:16: installing './config.guess'
configure.ac:16: installing './config.sub'
configure.ac:6: installing './install-sh'
configure.ac:6: installing './missing'
Makefile.am: installing './INSTALL'
Makefile.am: installing './COPYING' using GNU General Public License v3 file
Makefile.am:     Consider adding the COPYING file to the version control system
Makefile.am:     for your code, to avoid questions about which license your project uses
src/Makefile.am: installing './depcomp'
src/swig/Makefile.am:6: installing './py-compile'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking build system type... armv5tejl-unknown-linux-gnueabi
checking host system type... armv5tejl-unknown-linux-gnueabi
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert armv5tejl-unknown-linux-gnueabi file names to armv5tejl-unknown-linux-gnueabi format... func_convert_file_noop
checking how to convert armv5tejl-unknown-linux-gnueabi file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for doxygen... /usr/bin/doxygen
checking for swig... no
checking for swig2.0... no
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking for readline in -lreadline... yes
checking for iconv_open... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libusb-1.0 >= 1.0... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/swig/Makefile
config.status: creating docs/Makefile
config.status: creating libexword.pc
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
user@brain:~/libexword/libexword$
user@brain:~/libexword/libexword$
user@brain:~/libexword/libexword$
user@brain:~/libexword/libexword$ make
make  all-recursive
make[1]: Entering directory '/home/user/libexword/libexword'
Making all in src
make[2]: Entering directory '/home/user/libexword/libexword/src'
gcc -DHAVE_CONFIG_H -I. -I..      -g -O2 -MT exword-main.o -MD -MP -MF .deps/exword-main.Tpo -c -o exword-main.o `test -f 'main.c' || echo './'`main.c
mv -f .deps/exword-main.Tpo .deps/exword-main.Po
gcc -DHAVE_CONFIG_H -I. -I..      -g -O2 -MT exword-content.o -MD -MP -MF .deps/exword-content.Tpo -c -o exword-content.o `test -f 'content.c' || echo './'`content.c
mv -f .deps/exword-content.Tpo .deps/exword-content.Po
gcc -DHAVE_CONFIG_H -I. -I..      -g -O2 -MT exword-util.o -MD -MP -MF .deps/exword-util.Tpo -c -o exword-util.o `test -f 'util.c' || echo './'`util.c
mv -f .deps/exword-util.Tpo .deps/exword-util.Po
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -I/usr/include/libusb-1.0   -g -O2 -MT libexword_la-exword.lo -MD -MP -MF .deps/libexword_la-exword.Tpo -c -o libexword_la-exword.lo `test -f 'exword.c' || echo './'`exword.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/libusb-1.0 -g -O2 -MT libexword_la-exword.lo -MD -MP -MF .deps/libexword_la-exword.Tpo -c exword.c  -fPIC -DPIC -o .libs/libexword_la-exword.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/libusb-1.0 -g -O2 -MT libexword_la-exword.lo -MD -MP -MF .deps/libexword_la-exword.Tpo -c exword.c -o libexword_la-exword.o >/dev/null 2>&1
mv -f .deps/libexword_la-exword.Tpo .deps/libexword_la-exword.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -I/usr/include/libusb-1.0   -g -O2 -MT libexword_la-crypt.lo -MD -MP -MF .deps/libexword_la-crypt.Tpo -c -o libexword_la-crypt.lo `test -f 'crypt.c' || echo './'`crypt.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/libusb-1.0 -g -O2 -MT libexword_la-crypt.lo -MD -MP -MF .deps/libexword_la-crypt.Tpo -c crypt.c  -fPIC -DPIC -o .libs/libexword_la-crypt.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/libusb-1.0 -g -O2 -MT libexword_la-crypt.lo -MD -MP -MF .deps/libexword_la-crypt.Tpo -c crypt.c -o libexword_la-crypt.o >/dev/null 2>&1
mv -f .deps/libexword_la-crypt.Tpo .deps/libexword_la-crypt.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -I/usr/include/libusb-1.0   -g -O2 -MT libexword_la-obex.lo -MD -MP -MF .deps/libexword_la-obex.Tpo -c -o libexword_la-obex.lo `test -f 'obex.c' || echo './'`obex.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/libusb-1.0 -g -O2 -MT libexword_la-obex.lo -MD -MP -MF .deps/libexword_la-obex.Tpo -c obex.c  -fPIC -DPIC -o .libs/libexword_la-obex.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/libusb-1.0 -g -O2 -MT libexword_la-obex.lo -MD -MP -MF .deps/libexword_la-obex.Tpo -c obex.c -o libexword_la-obex.o >/dev/null 2>&1
mv -f .deps/libexword_la-obex.Tpo .deps/libexword_la-obex.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -I/usr/include/libusb-1.0   -g -O2 -MT libexword_la-databuffer.lo -MD -MP -MF .deps/libexword_la-databuffer.Tpo -c -o libexword_la-databuffer.lo `test -f 'databuffer.c' || echo './'`databuffer.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/libusb-1.0 -g -O2 -MT libexword_la-databuffer.lo -MD -MP -MF .deps/libexword_la-databuffer.Tpo -c databuffer.c  -fPIC -DPIC -o .libs/libexword_la-databuffer.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/libusb-1.0 -g -O2 -MT libexword_la-databuffer.lo -MD -MP -MF .deps/libexword_la-databuffer.Tpo -c databuffer.c -o libexword_la-databuffer.o >/dev/null 2>&1
mv -f .deps/libexword_la-databuffer.Tpo .deps/libexword_la-databuffer.Plo
/bin/bash ../libtool  --tag=CC   --mode=link gcc -I/usr/include/libusb-1.0   -g -O2 -version-info 2:0:0   -o libexword.la -rpath /usr/local/lib libexword_la-exword.lo libexword_la-crypt.lo libexword_la-obex.lo libexword_la-databuffer.lo -lusb-1.0
libtool: link: gcc -shared  -fPIC -DPIC  .libs/libexword_la-exword.o .libs/libexword_la-crypt.o .libs/libexword_la-obex.o .libs/libexword_la-databuffer.o   -lusb-1.0  -g -O2   -Wl,-soname -Wl,libexword.so.2 -o .libs/libexword.so.2.0.0
libtool: link: (cd ".libs" && rm -f "libexword.so.2" && ln -s "libexword.so.2.0.0" "libexword.so.2")
libtool: link: (cd ".libs" && rm -f "libexword.so" && ln -s "libexword.so.2.0.0" "libexword.so")
libtool: link: ar cr .libs/libexword.a  libexword_la-exword.o libexword_la-crypt.o libexword_la-obex.o libexword_la-databuffer.o
libtool: link: ranlib .libs/libexword.a
libtool: link: ( cd ".libs" && rm -f "libexword.la" && ln -s "../libexword.la" "libexword.la" )
/bin/bash ../libtool  --tag=CC   --mode=link gcc   -g -O2   -o exword exword-main.o exword-content.o exword-util.o -lreadline libexword.la
libtool: link: gcc -g -O2 -o .libs/exword exword-main.o exword-content.o exword-util.o  -lreadline ./.libs/libexword.so
make[2]: Leaving directory '/home/user/libexword/libexword/src'
Making all in src/swig
make[2]: Entering directory '/home/user/libexword/libexword/src/swig'
make  all-am
make[3]: Entering directory '/home/user/libexword/libexword/src/swig'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/user/libexword/libexword/src/swig'
make[2]: Leaving directory '/home/user/libexword/libexword/src/swig'
Making all in docs
make[2]: Entering directory '/home/user/libexword/libexword/docs'
Creating Documentation
warning: Tag 'TCL_SUBST' at line 203 of file 'doxy.cfg' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'SYMBOL_CACHE_SIZE' at line 336 of file 'doxy.cfg' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'COLS_IN_ALPHA_INDEX' at line 848 of file 'doxy.cfg' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'XML_SCHEMA' at line 1403 of file 'doxy.cfg' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'XML_DTD' at line 1409 of file 'doxy.cfg' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'PERL_PATH' at line 1570 of file 'doxy.cfg' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'MSCGEN_PATH' at line 1591 of file 'doxy.cfg' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: argument 'a4wide' for option PAPER_TYPE is not a valid enum value
Using the default: a4!
warning: doxygen no longer ships with the FreeSans font.
You may want to clear or change DOT_FONTNAME.
Otherwise you run the risk that the wrong font is being used for dot generated graphs.
make[2]: Leaving directory '/home/user/libexword/libexword/docs'
make[2]: Entering directory '/home/user/libexword/libexword'
make[2]: Leaving directory '/home/user/libexword/libexword'
make[1]: Leaving directory '/home/user/libexword/libexword'
user@brain:~/libexword/libexword$
user@brain:~/libexword/libexword$
user@brain:~/libexword/libexword$
user@brain:~/libexword/libexword$ sudo make install
[sudo] password for user:
Making install in src
make[1]: Entering directory '/home/user/libexword/libexword/src'
make[2]: Entering directory '/home/user/libexword/libexword/src'
 /usr/bin/mkdir -p '/usr/local/lib'
 /bin/bash ../libtool   --mode=install /usr/bin/install -c   libexword.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libexword.so.2.0.0 /usr/local/lib/libexword.so.2.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libexword.so.2.0.0 libexword.so.2 || { rm -f libexword.so.2 && ln -s libexword.so.2.0.0 libexword.so.2; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libexword.so.2.0.0 libexword.so || { rm -f libexword.so && ln -s libexword.so.2.0.0 libexword.so; }; })
libtool: install: /usr/bin/install -c .libs/libexword.lai /usr/local/lib/libexword.la
libtool: install: /usr/bin/install -c .libs/libexword.a /usr/local/lib/libexword.a
libtool: install: chmod 644 /usr/local/lib/libexword.a
libtool: install: ranlib /usr/local/lib/libexword.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /usr/bin/mkdir -p '/usr/local/bin'
  /bin/bash ../libtool   --mode=install /usr/bin/install -c exword '/usr/local/bin'
libtool: install: /usr/bin/install -c .libs/exword /usr/local/bin/exword
 /usr/bin/mkdir -p '/usr/local/include'
 /usr/bin/install -c -m 644 exword.h '/usr/local/include'
make[2]: Leaving directory '/home/user/libexword/libexword/src'
make[1]: Leaving directory '/home/user/libexword/libexword/src'
Making install in src/swig
make[1]: Entering directory '/home/user/libexword/libexword/src/swig'
make  install-am
make[2]: Entering directory '/home/user/libexword/libexword/src/swig'
make[3]: Entering directory '/home/user/libexword/libexword/src/swig'
make[3]: Leaving directory '/home/user/libexword/libexword/src/swig'
make[2]: Leaving directory '/home/user/libexword/libexword/src/swig'
make[1]: Leaving directory '/home/user/libexword/libexword/src/swig'
Making install in docs
make[1]: Entering directory '/home/user/libexword/libexword/docs'
Creating Documentation
warning: Tag 'TCL_SUBST' at line 203 of file 'doxy.cfg' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'SYMBOL_CACHE_SIZE' at line 336 of file 'doxy.cfg' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'COLS_IN_ALPHA_INDEX' at line 848 of file 'doxy.cfg' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'XML_SCHEMA' at line 1403 of file 'doxy.cfg' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'XML_DTD' at line 1409 of file 'doxy.cfg' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'PERL_PATH' at line 1570 of file 'doxy.cfg' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'MSCGEN_PATH' at line 1591 of file 'doxy.cfg' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: argument 'a4wide' for option PAPER_TYPE is not a valid enum value
Using the default: a4!
warning: doxygen no longer ships with the FreeSans font.
You may want to clear or change DOT_FONTNAME.
Otherwise you run the risk that the wrong font is being used for dot generated graphs.
make[2]: Entering directory '/home/user/libexword/libexword/docs'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/user/libexword/libexword/docs'
make[1]: Leaving directory '/home/user/libexword/libexword/docs'
make[1]: Entering directory '/home/user/libexword/libexword'
make[2]: Entering directory '/home/user/libexword/libexword'
make[2]: Nothing to be done for 'install-exec-am'.
 /usr/bin/mkdir -p '/usr/local/share/exword'
 /usr/bin/install -c -m 644 models.txt '/usr/local/share/exword'
 /usr/bin/mkdir -p '/usr/local/lib/pkgconfig'
 /usr/bin/install -c -m 644 libexword.pc '/usr/local/lib/pkgconfig'
make[2]: Leaving directory '/home/user/libexword/libexword'
make[1]: Leaving directory '/home/user/libexword/libexword'
user@brain:~/libexword/libexword$ sudo ldconfig
user@brain:~/libexword/libexword$ sudo mkdir -p /root/.local/share/exword/ja
user@brain:~/libexword/libexword$

コマンドが実行出来るか確認

試しに実行して見ます

$ sudo bash
# exword

まずは動いてますね。

user@brain:/home/user/libexword/libexword# sudo bash
root@brain:/home/user/libexword/libexword# exword
Exword dictionary tool.
Type 'help' for a list of commands.
>> help
connect [mode] [region] - connect to attached dictionary
disconnect              - disconnect from dictionary
model                   - display model information
capacity                - display medium capacity
format                  - format SD card
list                    - list files
delete <filename>       - delete a file
send <filename>         - upload a file
get <filename>          - download a file
setpath <path>          - changes directory on dictionary
cd <sub-function>       - audio cd commands
dict <sub-function>     - add-on dictionary commands
set <option> [value]    - sets program options
exit                    - exits program
>>exit
root@brain:/home/user/libexword/libexword#

 

BrainからEX-wordに接続してみる

まずは、EX-Word側の1番側スロットにSdカード入れておきます。

・電源を入れて、ライブラリーボタン -> ライブラリー ボタン -> パソコン接続を起動します。

・Brain側のUSBホストアダプタと、EX wordをUSBケーブルで接続します。

・USBケーブルで接続すると、Brain側では、Ex wordをusbデバイスとして認識します。

$ lsusb
Bus 001 Device 007: ID 07cf:6101 Casio Computer Co., Ltd fx-9750gII

user@brain:~/libexword/libexword$ lsusb
Bus 001 Device 006: ID 0b95:772b ASIX Electronics Corp. AX88772B
Bus 001 Device 005: ID 1997:2433 Shenzhen Riitek Technology Co., Ltd wireless mini keyboard with touchpad
Bus 001 Device 004: ID 413c:301a Dell Computer Corp. Dell MS116 Optical Mouse
Bus 001 Device 007: ID 07cf:6101 Casio Computer Co., Ltd fx-9750gII
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

・実際に接続してみます。
以下の流れでは、接続、EXwordの情報、ExwotdのSDカードにファイル転送しています。
なお、root権限での操作が必要です。
(setpathしないままで、listコマンドを実行すると、Segmentation faultエラーになるのでSDカード(crd0://)のほうを操作しています)

$ sudo bash
# exword
>> connect
>> model
>> capacity
>> setpath crd0://
>> capacity
>> list
>> send README
>> list
>> disconnect
>> exit

user@brain:~/libexword/libexword$ sudo bash
root@brain:/home/user/libexword/libexword# exword
Exword dictionary tool.
Type 'help' for a list of commands.
>> help
connect [mode] [region] - connect to attached dictionary
disconnect              - disconnect from dictionary
model                   - display model information
capacity                - display medium capacity
format                  - format SD card
list                    - list files
delete <filename>       - delete a file
send <filename>         - upload a file
get <filename>          - download a file
setpath <path>          - changes directory on dictionary
cd <sub-function>       - audio cd commands
dict <sub-function>     - add-on dictionary commands
set <option> [value]    - sets program options
exit                    - exits program
>> connect
connecting to device...done
\_INTERNAL_00\ >> model
Model: gy131,ON,0100
Sub: gy999
Extended: CY400
Capabilities: SW P F C CC
\_INTERNAL_00\ >> capacity
Capacity: 104857600 / 104645940
\_INTERNAL_00\ >> setpath crd0://
\_SD_00\ >>
\_SD_00\ >> capacity
Capacity: 31253889024 / 31253725184
\_SD_00\ >>
\_SD_00\ >> list
<SYSTEM~1>
OK, Success
\_SD_00\ >>
\_SD_00\ >> send README
uploading...OK, Success
\_SD_00\ >>
\_SD_00\ >> list
<SYSTEM~1>
README
OK, Success
\_SD_00\ >>
\_SD_00\ >> disconnect
disconnecting...done
>> exit
root@brain:/home/user/libexword/libexword#

EX wordに挿していたSDカードの中身を見てみると、
ファイルが保存されていますね。問題なさそうです。

なお、コンパイルオプションの変更なしの状態で発生していた
「デフォルトのパス(_INTERNAL_00/=drv0://)でlist実行するとSegmentation faultエラーが出る件」については、コンパイルオプションの変更で出なくなりました。

 

Segmentation faultエラーの原因調査

以下、以前の調査状況の記録です(コンパイルオプション変更なし時の動作)。
コンパイルオプションを変更するだけで解決するっぽいです。

内蔵ストレージのList実行時のsegmentation faultの件について調査

同じ Debian 13 でも、x64 と ARM では OBEX の挙動が違うようです。

環境DebianCPUOBEX の挙動list の結果
x6413x86_64BODY → BODY → BODY_END(複数)複数行表示される
ARM13ARMv5(Brain)BODY が 1 回しか返らない1 行だけ

推定理由 1:ARM の libusb がパケットをまとめてしまう

ARMv5 の USB コントローラは古く、 bulk transfer の最大パケットサイズが小さいため、

  • x64 → 16KB 以上の転送が一度に来る
  • ARM → 4KB など小さい単位で区切られる

その結果:

  • x64 → OBEX が複数 BODY を返す
  • ARM → OBEX が 1 BODY にまとめて返す(または 1 BODY しか返さない)

推定理由 2:ARM の libopenobex が「BODY_END」を返さないバグ

実際、OpenOBEX には ARM で BODY_END が返らない既知バグがあるそうです。

そのため:

  • x64 → BODY, BODY, BODY_END と返る
  • ARM → BODY のみ返ってループ終了

dict installしてもex-wordで起動できない

同様に、OBEX 実装の関係かもしれません。

動かない場合はx64のPCでDebianなどの環境で実行して、みてください。 

 

EX-Word用のソフトウェア開発について

現在、BrainHackersのDiscordにてEX-Word用の開発用テンプレートについて
動きがあるようです。

Brain Hackers のDiscordに参加するには、以下のページをご確認ください。
GitHub – brain-hackers/README: Brain Hackers について

現時点でビルド済で公開されているソフトが実質GNUBOYしかない状況ですが、
もしかしたら、EX-Word用のソフトウェアが公開されるかもしれません。

私は、現状GNUBOYの起動もうまくいっていない状況なので、
進捗を期待して、応援しております。

 

実行テスト(事項ファイル転送)

Hello worldについて、GitHUBの「GitHub Actions」という機能でビルドされたものがあること分かったのでこちらを試してみました(GitHUB勉強しないと・・・)。

ビルド環境の構築までは大変そうでしたので、GitHub Actionsというキーワードからたどりました
Actionsをクリック
→ 一番最近のBuildをクリック
 → build.ymlのBuild EX-word addion をクリック
  → Publishの下に、あるURLをクリック
    https://github.com/watamario15/exword-devel/releases/tag/v1

2026/01/24時点では
https://github.com/brain-hackers/exword-template
から、右ペイン側のReleasesから最新のリリース(v1)をたどって
以下のURLからでも、build.zipを入手できるようです。
https://github.com/brain-hackers/exword-template/releases/tag/v1

$ cd
vcd exqord
$ mkdir HELLO
$ cd HELLO
$ https://github.com/brain-hackers/exword-template/releases/download/v1/build.zip
$ unzip build
$ cd build/ja
$ sudo cp -r HELLO/ /root/.local/share/exword/ja/HELLO

$ sudo bash
# exword
>> connect
>> dict reset brain
>> dict auth brain 0x4CF94CF9484B484B571E571152DB52DB0ABF0ABF
>> dict install HELLO
>> disconnect

build.zipを解凍して、build/ja/HELLO フォルダの中身を /root/.local/share/exword/ja/HELLOにコピーして
Brainuxから、EX-wordに転送してみたところ、ライブラリのメニューに登録され、
実行できました。

user@brain:~/libexword/build/ja$ sudo cp -r /home/user/libexword/build/ja/HELLO/ /root/.local/share/exword/ja/HELLO
root@brain:/home/user/libexword#
root@brain:/home/user/libexword# exword
Exword dictionary tool.
Type 'help' for a list of commands.
>> connect
connecting to device...done
\_INTERNAL_00\ >> dict reset brain
User brain with key 0x4CF94CF9484B484B571E571152DB52DB0ABF0ABF registered
\_INTERNAL_00\ >>
\_INTERNAL_00\ >> dict auth brain 0x4CF94CF9484B484B571E571152DB52DB0ABF0ABF
Authentication sucessful.
\_INTERNAL_00\ >> dict install HELLO
Transferring infogt5.htm...Done
Transferring diction.htm...Done
Transferring infodp5.htm...Done
Transferring hello.d01...Done
Transferring fileinfo.cji...Done
\_INTERNAL_00\ >> disconnect
disconnecting...done
root@brain:/home/user/libexword#

ちなみに x64のDebian13でexwordをビルドする場合は、
コンパイルオプションの変更は必要ありません。
そのままで、正常に起動できることを確認しました。

少し調べた段階ではarm環境では、いくつか不具合があり、
内臓ストレージのlist表示や、dict installしてもex-wordで起動できない状況があるようです。

⇛コンパイルオプションで解決できるとのことです。
 CFLAGS=”$CFLAGS -fsigned-char”

 

 

Gnuboy EX(後日確認予定)

EX-wordで実行できるツールとして、「Gnuboy EX」が紹介されていました。
GAMEBOT/GAMEBOY Colorのエミュレータになります。

Gnuboy EX | Brain Wiki | Fandom

また、各種ドキュメントはここにあるようです。

インストール(現在試行錯誤中)

現在試行錯誤中です。
手順通りにインストールしたはずなのですが、メニューからGnuboy EXを起動しても、すぐにライブラリに戻っちゃいます。

(以下備考)

前準備

GNUBY.7z をダウンロードします。

・7zを解凍するためのツールをインストールする。

$ sudo apt install p7zip-fulll

user@brain:~/libexword/libexword$ sudo apt show p7zip-full
Package: p7zip-full
Version: 16.02+dfsg-8
Priority: optional
Section: utils
Source: p7zip
Maintainer: Robert Luberda <robert@debian.org>
Installed-Size: 3,932 kB
Depends: p7zip (= 16.02+dfsg-8), libc6 (>= 2.7), libgcc-s1 (>= 3.5), libstdc++6 (>= 5)
Suggests: p7zip-rar
Breaks: p7zip (<< 15.09+dfsg-3~)
Replaces: p7zip (<< 15.09+dfsg-3~)
Homepage: http://p7zip.sourceforge.net/
Tag: admin::file-distribution, implemented-in::c++, interface::commandline,
 role::program, scope::utility, use::checking, use::compressing,
 works-with-format::tar, works-with-format::zip, works-with::archive,
 works-with::file
Download-Size: 931 kB
APT-Sources: http://archive.debian.org/debian bullseye/main armel Packages
Description: 7z and 7za file archivers with high compression ratio
 p7zip is the Unix command-line port of 7-Zip, a file archiver that
 handles the 7z format which features very high compression ratios.
 .
 p7zip-full provides utilities to pack and unpack 7z archives within
 a shell or using a GUI (such as Ark, File Roller or Nautilus).
 .
 Installing p7zip-full allows File Roller to use the very efficient 7z
 compression format for packing and unpacking files and directories.
 Additionally, it provides the 7z and 7za commands.
 .
 List of supported formats:
   - Packing / unpacking: 7z, ZIP, GZIP, BZIP2, XZ and TAR
   - Unpacking only: APM, ARJ, CAB, CHM, CPIO, CramFS, DEB, DMG, FAT,
     HFS, ISO, LZH, LZMA, LZMA2, MBR, MSI, MSLZ, NSIS, NTFS, RAR (only
     if non-free p7zip-rar package is installed), RPM, SquashFS, UDF,
     VHD, WIM, XAR and Z.
 .
 The dependent package, p7zip, provides 7zr, a light version of 7za,
 and p7zip, a gzip-like wrapper around 7zr.



user@brain:~/libexword/libexword$ sudo apt install p7zip-full
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  p7zip
Suggested packages:
  p7zip-rar
The following NEW packages will be installed:
  p7zip p7zip-full
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Need to get 1,240 kB of archives.
After this operation, 4,753 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.debian.org/debian bullseye/main armel p7zip armel 16.02+dfsg-8 [309 kB]
Get:2 http://archive.debian.org/debian bullseye/main armel p7zip-full armel 16.02+dfsg-8 [931 kB]
Fetched 1,240 kB in 3s (439 kB/s)
Selecting previously unselected package p7zip.
(Reading database ... 60037 files and directories currently installed.)
Preparing to unpack .../p7zip_16.02+dfsg-8_armel.deb ...
Unpacking p7zip (16.02+dfsg-8) ...
Selecting previously unselected package p7zip-full.
Preparing to unpack .../p7zip-full_16.02+dfsg-8_armel.deb ...
Unpacking p7zip-full (16.02+dfsg-8) ...
Setting up p7zip (16.02+dfsg-8) ...
Setting up p7zip-full (16.02+dfsg-8) ...
Processing triggers for man-db (2.9.4-2) ...
user@brain:~/libexword/libexword$

設定ファイルの作成と、ダウンロードした”GNUBY.7z”を解凍します。

$ cd /home/user/libexword/

#GNUBOYの定義ファイルを用意します。
vi /home/user/libexword/gnuboy.rc

set romdir \\\\drv0\\  # Where to place the ROM
set savedir \\\\drv0\\  # Where to place the save data
# set skin \\\\drv0\\zelda.gra  # Which skin to load
set sprsort 0  # Improve performance

$cp rom.gbc /home/user/libexword/

$ 7z x GNUBY.7z
$ sudo cp -r /home/user/libexword/GNUBY /root/.local/share/exword/ja/GNUBY

$ cd /home/user/libexword/

$ 7z x GNUBY.7z

7-Zip [32] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,32 bits,1 CPU LE)

Scanning the drive for archives:
1 file, 43892 bytes (43 KiB)

Extracting archive: GNUBY.7z
--
Path = GNUBY.7z
Type = 7z
Physical Size = 43892
Headers Size = 247
Method = LZMA2:96k
Solid = +
Blocks = 1

Everything is Ok

Folders: 1
Files: 5
Size:       95621
Compressed: 43892

$ sudo cp -r  /home/user/libexword/GNUBY  /root/.local/share/exword/ja/GNUBY

インストール

では、EX-wordにインストールしてみます。

$ cd /home/user/libexword/
$ sudo bash
# exword
>> connect
>> dict reset brain
>> dict auth brain <key>
>> dict install GNUBY
>> send gnuboy.rc
>> send rom.gbc
>> dusconnext
>>exit
# exit
$

user@brain:~/libexword/$ cd /home/user/libexword/
user@brain:~/libexword/$ sudo bash
root@brain:/home/user/libexword# exword
Exword dictionary tool.
Type 'help' for a list of commands.
>> connect
connecting to device...done
\_INTERNAL_00\ >> dict reset brain
User brain
 with key 0x6D556D55687E687E771F771F723072302B132B00 registered
\_INTERNAL_00\ >>
\_INTERNAL_00\ >> dict auth brain 0x6D556D55687E687E771F771F723072302B132B00
Authentication sucessful.
\_INTERNAL_00\ >>
\_INTERNAL_00\ >>
\_INTERNAL_00\ >> dict install GNUBY
Transferring infogt5.htm...Done
Transferring diction.htm...Done
Transferring infodp5.htm...Done
Transferring gnuby.d01...Done
Transferring fileinfo.cji...Done
\_INTERNAL_00\ >>
\_INTERNAL_00\ >> send gnuboy.rc
uploading...OK, Success
\_INTERNAL_00\ >>
\_INTERNAL_00\ >> send rom.gbc
uploading...OK, Success
\_INTERNAL_00\ >>
\_INTERNAL_00\ >> disconnect
disconnecting...done
>> exit
root@brain:/home/user/libexword# exit
user@brain:~/libexword/$ 

結果、辞書メニューには出てくるのだが、Gnuboy EXが起動する気配がない。

手順通りにインストールしたはずなのですが、メニューからを起動しても、すぐにライブラリ(本体保存やカード1保存の選択の画面)に戻っちゃいます。

SDカード(crd0:にもインストールを試してみましたが同じでした。rcファイルは内容変更済)
それかBrainuxからのインストールでは、無理だったのかな?

最近、インストールファイル中のhtmlファイルの改行コードがCRLFでないと
この現象が出るような話も見かけたのですがちゃんとCRLFになっているようで
まだ原因不明です。
心あたりある方がいればぜひ教えてください。

 

Views: 622

カテゴリー: Brain, Brainux, debian, EX-Word, Linux | コメントする