<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:media="http://search.yahoo.com/mrss/"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bash &#8211; 馬修 IT</title>
	<atom:link href="https://blog.ocam.live/archives/tag/bash/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.ocam.live</link>
	<description>生活中所接觸各種電腦及網路問題與懷舊模擬器的專業問題解決與新資訊介紹的網站</description>
	<lastBuildDate>Tue, 21 Oct 2025 09:04:07 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.ocam.live/wp-content/uploads/2025/03/cropped-logo-1-300x300.png</url>
	<title>Bash &#8211; 馬修 IT</title>
	<link>https://blog.ocam.live</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Batocera V4.x 存檔的備份方式</title>
		<link>https://blog.ocam.live/archives/4186</link>
		
		<dc:creator><![CDATA[blog.ocam.live]]></dc:creator>
		<pubDate>Tue, 21 Oct 2025 09:04:06 +0000</pubDate>
				<category><![CDATA[電玩模擬器]]></category>
		<category><![CDATA[IT 日常]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[batocera]]></category>
		<guid isPermaLink="false">https://blog.ocam.live/?p=4186</guid>

					<description><![CDATA[Batocera 是專為遊戲模擬而設計的系統，但「存檔」並不是存在雲端，而是實體儲存在裝置的磁碟分區中。一旦  [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Batocera 是專為遊戲模擬而設計的系統，但「存檔」並不是存在雲端，而是實體儲存在裝置的磁碟分區中。一旦 SD 卡損壞、USB 隨身碟拔除不當、系統重刷或版本升級，都可能導致存檔遺失。存檔包含：模擬器的即時存檔（savestate）。遊戲內原生存檔（save、memory card 檔案等）部分模擬器的設定檔（例如 RetroArch 的設定、控制器配置）。 若沒有備份，所有遊戲進度可能瞬間消失。你花的所有遊戲時間跟回憶都要重來一次。</p>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>文章內容</h2><nav><ul><li class=""><a href="#syncthing-備方方式">Syncthing 備方方式</a></li><li class=""><a href="#rclone-備方方式">Rclone 備方方式</a></li><li class=""><a href="#進階-inotifywait-加-rclone-備份方式">進階 inotifywait 加  rclone 備份方式 </a></li><li class=""><a href="#結論">結論</a></li></ul></nav></div>



<h2 class="wp-block-heading" id="syncthing-備方方式">Syncthing 備方方式</h2>



<p>Syncthing 它是「點對點（P2P）」的同步軟體，只能在你自己控制的兩台以上設備之間直接傳輸檔案，設備可以是另一台 Batocera 或 NAS(有裝Syncthing) 或個人電腦(有裝Syncthing) 且兩台電腦在軟體有啟動的裝態下會自動同步。詳細的說明可參考 <a href="https://wiki.batocera.org/syncthing" target="_blank" rel="noreferrer noopener nofollow">Batocera WIKI </a></p>



<h2 class="wp-block-heading" id="rclone-備方方式">Rclone 備方方式</h2>



<p>rclone 為單一方向上傳或同步雲端(如 Google Drive)或 NAS 設備的程式。如果要同步至雲端依各雲端的不同，事先的需求會不一樣。詳細的操作說明各參考各網路的教學或參考 <a href="https://wiki.batocera.org/rclone_cloudbackup" target="_blank" rel="noreferrer noopener nofollow">Batocera WIKI</a></p>



<p>官方提供的 SCRIPT。把它放至 /userdata/system/services 。之後可至 ES 介面操作自動啟動或執行 batocera-services enable &lt;your_service_name> 設定開機自動啟動。個人覺的使用這個方式並不好。因為它會每 60 秒檢查檔案跟備份，對 SD 這種慢速的儲存媒體來說可能不是那麼友好。當你在玩大檔案的 ISO 遊戲是可能會卡一下。</p>



<pre class="wp-block-code"><code>#!/bin/bash
# ------------------------------- CONFIG BEGIN --------------------------------
 
# The location of Batocera data on your cloud storage.
destDir=/Batocera
 
# Waiting time between two backups in seconds.
# The below configuration means that the service will do a backup every minute.
waitSeconds=60
 
# Change name setted from rclone config as name, default is backup
rcloneName=backup
 
# If set to true, logs from all runs of the service are preserved.
# If set to false, only logs since the last start of the service are kept.
keepLogs=false
 
# -------------------------------- CONFIG END ---------------------------------
 
runFile=/var/run/backup-service
logFile=/var/log/backup-service.log
 
# This needs to be set explicitly, because $HOME is not set when the service is started by Batocera.
export RCLONE_CONFIG=/userdata/system/.config/rclone/rclone.conf
 
manual() {
    echo "> CONFIG sync" ------------------------------------------------------------------------------------
    rclone sync /userdata/system/batocera.conf ${rcloneName}:${destDir}/system --progress
 
    echo "> SAVES sync" -------------------------------------------------------------------------------------
    rclone sync /userdata/saves ${rcloneName}:${destDir}/saves --exclude "flatpak/**" --progress
 
    echo "> ROMS sync" --------------------------------------------------------------------------------------
    rclone sync /userdata/roms ${rcloneName}:${destDir}/roms --exclude "flatpak/**" --progress
 
    echo "> BIOS sync" --------------------------------------------------------------------------------------
    rclone sync /userdata/bios ${rcloneName}:${destDir}/bios --progress
}
 
start() {
    touch ${runFile}
 
    if &#091; "$keepLogs" = false ]; then
        rm -f ${logFile}
    fi
 
    timeStamp="$(date)"
    echo -e "\n--- SERVICE START - &#091;${timeStamp}] ---\n" >>${logFile}
 
    while test -e ${runFile}; do
        sleep ${waitSeconds}
        rclone sync /userdata/saves ${rcloneName}:${destDir}/saves --exclude "flatpak/**" --log-file ${logFile} --log-level INFO
    done
}
 
stop() {
    rm -f ${runFile}
}
 
status() {
    if test -e ${runFile}; then
        echo "Backup service is running. Logs: ${logFile}"
    else
        echo "Backup service is not running."
    fi
}
 
case "$1" in
    manual)
        manual
        ;;
    start)
        start &amp;
        ;;
    stop)
        stop
        ;;
    status)
        status
        ;;
    *)
        echo "Usage: https://gitlab.com/peterbozso/batocera-backup-service"
        ;;
esac</code></pre>



<h2 class="wp-block-heading" id="進階-inotifywait-加-rclone-備份方式">進階 inotifywait 加  rclone 備份方式 </h2>



<p><code>inotifywait</code> 是 Linux 系統中 <strong>用來監聽檔案或目錄變化的工具</strong>也就是當檔有有新增修改刪除時會抓檔名或問錄抓出來之後再傳給 rclone 作同步處理。這樣只會處理本機端有異動的檔案而不用去比對整個存檔目錄。但可惜的是 Batocera 本身並不提供 <code>inotifywait</code> 程式。得去下載 Batocera 的 tool-chain (docker image) 跟 <code>inotifywait</code>  source code 。build 完成後再傳至遊戲機裡。 </p>



<p>我自已本身用的程式如下</p>



<pre class="wp-block-code"><code>#!/bin/bash

RCLONE=/usr/bin/rclone
REMOTE="InfiniCloud:"
WATCH_DIR="/userdata/saves"
LOGFILE="/userdata/system/savesync.log"

echo "&#091;INFO] SaveSync Service Started at $(date)" >> "$LOGFILE"

# 使用 inotifywait 監控目錄
/userdata/bin/inotifywait -m -r -e close_write,create,modify,delete "$WATCH_DIR" --format '%w%f' | while read FILE
do
    echo "&#091;INFO] Detected change in: $FILE at $(date)" >> "$LOGFILE"
    # 上傳到雲端（copy = 保留遠端所有檔案，不刪除）
	if ping -c 1 -W 2 8.8.8.8 >/dev/null 2>&amp;1; then
		$RCLONE --config /userdata/system/.config/rclone/rclone.conf copy "$WATCH_DIR" "$REMOTE" --log-file="$LOGFILE" --log-level INFO
	fi
done</code></pre>



<h2 class="wp-block-heading" id="結論">結論</h2>



<p>依個人的環境選擇 Syncthing 或 rclone 。除非對 Linux 有點程度的可選用 inotifywait 加  rclone 。但在 x86 電腦主機上最最簡單的方式是使用 Raid 卡。用鏡像功能直接處理。</p>


<div class="wp-block-stackable-heading stk-block-heading stk-block-heading--v2 stk-block stk-7280d78" id="x-68000-games-supporting" data-block-id="7280d78"><h2 class="stk-block-heading__text">延伸閱讀</h2></div><div class="reading-grid"><a href="https://blog.ocam.live/archives/4944" class="card">
      <img fetchpriority="high" decoding="async" width="300" height="300" src="https://blog.ocam.live/wp-content/uploads/2026/04/N64RecompLauncher-300x300.webp" class="attachment-thumbnail size-thumbnail" alt="N64RecompLauncher" title="Batocera V4.x 存檔的備份方式">
      <div class="card-content">
        <div class="card-title">Batocera 新增 N64RecompLauncher</div>
      </div>
		</a><a href="https://blog.ocam.live/archives/4009" class="card">
      <img decoding="async" width="300" height="300" src="https://blog.ocam.live/wp-content/uploads/2025/05/WordPress-Hacked-300x300.jpg" class="attachment-thumbnail size-thumbnail" alt="WordPress Hacked" title="Batocera V4.x 存檔的備份方式">
      <div class="card-content">
        <div class="card-title">WordPress 問題解說：網站被駭後如何處理？</div>
      </div>
		</a><a href="https://blog.ocam.live/archives/4904" class="card">
      <img decoding="async" width="300" height="300" src="https://blog.ocam.live/wp-content/uploads/2026/03/Super-Contra_snes_main-300x300.png" class="attachment-thumbnail size-thumbnail" alt="Super Contra_snes_main_menu" title="Batocera V4.x 存檔的備份方式">
      <div class="card-content">
        <div class="card-title">任天堂的超級魂斗羅遊戲已移植至超級任天堂</div>
      </div>
		</a></div></ul>
]]></content:encoded>
					
		
		
		<media:content url="https://blog.ocam.live/wp-content/uploads/2025/10/存檔備份.jpg" medium="image"></media:content>
            	</item>
		<item>
		<title>免費的 DDNS Duck DNS 簡單快速設定方式</title>
		<link>https://blog.ocam.live/archives/4040</link>
		
		<dc:creator><![CDATA[blog.ocam.live]]></dc:creator>
		<pubDate>Wed, 28 May 2025 07:40:52 +0000</pubDate>
				<category><![CDATA[IT 日常]]></category>
		<category><![CDATA[程式設言]]></category>
		<category><![CDATA[Bash]]></category>
		<guid isPermaLink="false">https://blog.ocam.live/?p=4040</guid>

					<description><![CDATA[Duck DNS 是一個免費的動態 DNS 服務，讓使用者將自己的網域（如 myhome.duckdns.or [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Duck DNS 是一個免費的動態 DNS 服務，讓使用者將自己的網域（如 myhome.duckdns.org）指向變動的 Internet IP，(HiNET) 適合自架伺服器、遠端存取等用途，且支援多平台更新與簡易設定。相較於 No-IP 可省去每個月都要再更新一次的困擾。</p>



<ul class="wp-block-list">
<li><strong>網站</strong>：<a class="" href="https://www.duckdns.org" target="_blank" rel="noopener">https://www.duckdns.org</a></li>



<li><strong>限制條件</strong>：
<ul class="wp-block-list">
<li>免費註冊。</li>



<li>每個帳號可建立最多 <strong>5 個子網域</strong>。</li>



<li>不支援自訂域名（只能使用 <code>yourname.duckdns.org</code>）。</li>
</ul>
</li>



<li><strong>更新方式</strong>：提供範例腳本（Linux、Windows、路由器等）。</li>



<li><strong>優點</strong>：
<ul class="wp-block-list">
<li>簡單穩定。</li>



<li>支援多平台。</li>



<li>社群活躍。</li>
</ul>
</li>
</ul>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>文章大綱</h2><nav><ul><li class=""><a href="#前往-duck-dns-網站，並且使用-google-登入">前往 DuckDNS 網站，並且使用 Google 登入</a></li><li class=""><a href="#設定網域">設定網域</a></li><li class=""><a href="#記下子網域名字跟-token">記下子網域名字跟 token</a></li><li class=""><a href="#程式自動更新-ip">程式自動更新 IP</a></li></ul></nav></div>



<h2 class="wp-block-heading" id="前往-duck-dns-網站，並且使用-google-登入">前往 DuckDNS 網站，並且使用 Google 登入</h2>



<p>前往 <a href="https://www.duckdns.org/" target="_blank" rel="noreferrer noopener">https://www.duckdns.org/</a> 到 DuckDNS 的首頁，就會看到 DuckDNS 提供了一些登入方式，用右上方 Google 登入。</p>



<p>第一次登入完成後會要求完成 reCaptcha 驗證，依照指示點擊及即可。</p>



<figure class="wp-block-image size-large"><img decoding="async" src="https://blog.ocam.live/wp-content/uploads/2025/05/duck_dns_login-1024x284.png" alt="duck dns login" class="wp-image-4042" title="免費的 DDNS Duck DNS 簡單快速設定方式"></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1024" height="251" src="https://blog.ocam.live/wp-content/uploads/2025/05/duck_dns_reCaptcha.png" alt="duckdns reCaptcha" class="wp-image-4043" title="免費的 DDNS Duck DNS 簡單快速設定方式" srcset="https://blog.ocam.live/wp-content/uploads/2025/05/duck_dns_reCaptcha.png 1024w, https://blog.ocam.live/wp-content/uploads/2025/05/duck_dns_reCaptcha-600x147.png 600w, https://blog.ocam.live/wp-content/uploads/2025/05/duck_dns_reCaptcha-860x211.png 860w, https://blog.ocam.live/wp-content/uploads/2025/05/duck_dns_reCaptcha-768x188.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading" id="設定網域">設定網域</h2>



<p>由於 DuckDNS 只能使用 <code>duckdns.org</code> 當作網域。所以你得選一個你自已喜歡且尚未被選走的網域。如 <code>yourname.duckdns.org</code> 。這裡的 <code>yourname</code> 就是你選的子網域。</p>



<p>在方區塊中，輸入自己喜歡的子網域，並且按下 add doman 即可。之後再更新 current ip (選項)。不作也行等一下可用程式自動更新。</p>



<figure class="wp-block-image size-large"><img decoding="async" src="https://blog.ocam.live/wp-content/uploads/2025/05/duck_dns_add_domain-1024x316.png" alt="duck dns add domain" class="wp-image-4045" title="免費的 DDNS Duck DNS 簡單快速設定方式"></figure>



<h2 class="wp-block-heading" id="記下子網域名字跟-token">記下子網域名字跟 token</h2>



<p>如圖所示。等一下會用到</p>



<figure class="wp-block-image size-large"><img decoding="async" src="https://blog.ocam.live/wp-content/uploads/2025/05/duck_dns_token-1024x244.png" alt="duck dns token" class="wp-image-4046" title="免費的 DDNS Duck DNS 簡單快速設定方式"></figure>



<h2 class="wp-block-heading" id="程式自動更新-ip">程式自動更新 IP</h2>



<p>因為我使用的是 Allwinner H3 的 SBC . 作業系統是 Linux . 請用 root 登入並建立一個 bash 的 script 檔。如</p>



<pre class="wp-block-code"><code>vi ~/duckdns_update.sh</code></pre>



<p>把下方程式碼貼上。並記得改 DOMAIN 跟 TOKEN 那兩行。換上 DuckDNS 給你的資料</p>



<pre class="wp-block-code"><code>#!/bin/bash

# 設定參數
DOMAIN="your-subdomain"  # 你的 DuckDNS 子網域，例如 "yourname"
TOKEN="your-duckdns-token"  # DuckDNS 給的 token

# IP 快取檔案路徑
IP_FILE="/tmp/duckdns_current_ip.txt"

# 取得目前的公網 IP（使用 ipify）
CURRENT_IP=$(curl -s https://api.ipify.org)

# 如果取得不到 IP，直接退出
if &#091;&#091; -z "$CURRENT_IP" ]]; then
  echo "無法取得目前 IP"
  exit 1
fi

# 如果檔案不存在，建立一個空檔案
if &#091;&#091; ! -f "$IP_FILE" ]]; then
  echo "" > "$IP_FILE"
fi

# 讀取上次紀錄的 IP
LAST_IP=$(cat "$IP_FILE")

# 比對 IP 是否有變更
if &#091;&#091; "$CURRENT_IP" == "$LAST_IP" ]]; then
  echo "IP 無變更（$CURRENT_IP），不更新 DuckDNS"
  exit 0
fi

# 嘗試更新 DuckDNS
UPDATE_URL="https://www.duckdns.org/update?domains=${DOMAIN}&amp;token=${TOKEN}&amp;ip=${CURRENT_IP}"
RESPONSE=$(curl -s "$UPDATE_URL")

if &#091;&#091; "$RESPONSE" == "OK" ]]; then
  echo "DuckDNS 更新成功：$CURRENT_IP"
  echo "$CURRENT_IP" > "$IP_FILE"
else
  echo "DuckDNS 更新失敗：$RESPONSE"
  exit 1
fi
</code></pre>



<p>龻更權限</p>



<pre class="wp-block-code"><code>chmod +x duckdns_update.sh</code></pre>



<p><strong>加入 crontab 自動執行（例如每 5 分鐘）</strong>：</p>



<pre class="wp-block-code"><code>crontab -e</code></pre>



<pre class="wp-block-code"><code>*/5 * * * * ~/duckdns_update.sh >> ~/duckdns.log 2>&amp;1</code></pre>



<p>完成。之後就會每 5 分檢查一下。如需要就會更新 DuckDNS 上的 IP . </p>


<div class="wp-block-stackable-heading stk-block-heading stk-block-heading--v2 stk-block stk-7280d78" id="x-68000-games-supporting" data-block-id="7280d78"><h2 class="stk-block-heading__text">延伸閱讀</h2></div><div class="reading-grid"><a href="https://blog.ocam.live/archives/4613" class="card">
      <img loading="lazy" decoding="async" width="300" height="300" src="https://blog.ocam.live/wp-content/uploads/2025/12/cloudflare_cache_logo-300x300.jpg" class="attachment-thumbnail size-thumbnail" alt="cloudflare cache settings" srcset="https://blog.ocam.live/wp-content/uploads/2025/12/cloudflare_cache_logo-300x300.jpg 300w, https://blog.ocam.live/wp-content/uploads/2025/12/cloudflare_cache_logo-600x600.jpg 600w, https://blog.ocam.live/wp-content/uploads/2025/12/cloudflare_cache_logo-860x860.jpg 860w, https://blog.ocam.live/wp-content/uploads/2025/12/cloudflare_cache_logo-768x768.jpg 768w, https://blog.ocam.live/wp-content/uploads/2025/12/cloudflare_cache_logo.jpg 1024w" sizes="auto, (max-width: 300px) 100vw, 300px" title="免費的 DDNS Duck DNS 簡單快速設定方式">
      <div class="card-content">
        <div class="card-title">減少 AI 爬蟲對 WordPress 的影響建議增加 Cloudflare 快取設定</div>
      </div>
		</a><a href="https://blog.ocam.live/archives/3715" class="card">
      <img loading="lazy" decoding="async" width="300" height="300" src="https://blog.ocam.live/wp-content/uploads/2025/04/batocera_logo-300x300.jpg" class="attachment-thumbnail size-thumbnail" alt="batocera_logo" title="免費的 DDNS Duck DNS 簡單快速設定方式">
      <div class="card-content">
        <div class="card-title">Batocera 41 新增 Nuked SC-55 Roland SC-55mkII 模擬器</div>
      </div>
		</a><a href="https://blog.ocam.live/archives/4852" class="card">
      <img loading="lazy" decoding="async" width="300" height="300" src="https://blog.ocam.live/wp-content/uploads/2026/02/ok4-300x300.png" class="attachment-thumbnail size-thumbnail" alt="遊戲標題畫面" title="免費的 DDNS Duck DNS 簡單快速設定方式">
      <div class="card-content">
        <div class="card-title">PCE-CD-ROM² 酒井法子-鏡之國夢冒險繁體中文化完成</div>
      </div>
		</a></div></ul>



<p></p>
]]></content:encoded>
					
		
		
		<media:content url="https://blog.ocam.live/wp-content/uploads/2025/05/duck-dns.webp" medium="image"></media:content>
            	</item>
		<item>
		<title>Batocera 41 新增 Nuked SC-55 Roland SC-55mkII 模擬器</title>
		<link>https://blog.ocam.live/archives/3715</link>
		
		<dc:creator><![CDATA[blog.ocam.live]]></dc:creator>
		<pubDate>Sat, 26 Apr 2025 00:58:00 +0000</pubDate>
				<category><![CDATA[電玩模擬器]]></category>
		<category><![CDATA[程式設言]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[batocera]]></category>
		<category><![CDATA[SC-55]]></category>
		<guid isPermaLink="false">https://blog.ocam.live/?p=3715</guid>

					<description><![CDATA[Batocera 預設並未支援 Nuked SC-55 。但要新增也並非不可能。本文就是要教大家如何在 Bat [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading" id="batocera-預設並未支援-nuked-sc-55-。但要新增也並非不可能。本文就是要教大家如何在-batocera-41-版上新增-nuked-sc-55-並讓-x-68000-的模擬器可使用-nuked-sc-55-產生出-roland-sc-55-mk-ii-的音源">Batocera 預設並未支援 Nuked SC-55 。但要新增也並非不可能。本文就是要教大家如何在 Batocera 41 版上新增 Nuked SC-55 並讓 X68000 的模擬器可使用 Nuked SC-55 產生出 Roland SC-55mkII 的音源</h2>



<figure class="wp-block-image size-large"><img decoding="async" src="https://blog.ocam.live/wp-content/uploads/2025/04/Roland_sc-55-1-1024x574.jpg" alt="Roland_sc-55" class="wp-image-3648" title="Batocera 41 新增 Nuked SC-55 Roland SC-55mkII 模擬器"></figure>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>文章大綱</h2><nav><ul><li class=""><a href="#batocera-預設並未支援-nuked-sc-55-。但要新增也並非不可能。本文就是要教大家如何在-batocera-41-版上新增-nuked-sc-55-並讓-x-68000-的模擬器可使用-nuked-sc-55-產生出-roland-sc-55-mk-ii-的音源">Batocera 預設並未支援 Nuked SC-55 。但要新增也並非不可能。本文就是要教大家如何在 Batocera 41 版上新增 Nuked SC-55 並讓 X68000 的模擬器可使用 Nuked SC-55 產生出 Roland SC-55mkII 的音源</a></li><li class=""><a href="#首先安裝必要程式-x-64-版-batocera-適用">首先安裝必要程式(X64 版 Batocera 適用)</a></li><li class=""><a href="#在-emulationstation-的介面中啟用-nuked-sc-55-服務">在 Emulationstation 的介面中啟用 Nuked SC-55 服務</a></li><li class=""><a href="#設定-retroarch-的-midi-out-put-至-nuked-sc-55">設定 Retroarch 的 MIDI Out put 至 Nuked SC-55</a></li><li class=""><a href="#測試遊戲效果，使用-x-68000-悪魔城ドラキュラ">測試遊戲效果，使用  X68000 悪魔城ドラキュラ</a></li><li class=""><a href="#faq">FAQ</a><ul><li class=""><a href="#faq-question-1745479952799">有沒有支援 arm</a></li><li class=""><a href="#faq-question-1745480243356">重開機後 SC55SERVICE 不會自動啟動</a></li><li class=""><a href="#faq-question-1745480420404">執行 SC-55 有什麼硬體限制</a></li><li class=""><a href="#faq-question-1745482911702">Nuked SC-55 能商用嗎？</a></li><li class=""><a href="#faq-question-1745808021365">強迫中斷遊戲後音樂聲仍在</a></li></ul></li></ul></nav></div>



<h2 class="wp-block-heading" id="首先安裝必要程式-x-64-版-batocera-適用">首先安裝必要程式(X64 版 Batocera 適用)</h2>



<ul class="wp-block-list">
<li><a href="https://drive.google.com/file/d/1kC8d76xMODrKkBLEj8IVX3bXc5XWSraA/view?usp=sharing" target="_blank" rel="noopener">按這裡下載</a> 我自已編的 X64 版的 Nuked SC-55</li>



<li><a href="https://www.google.com/search?q=Roland+SC-55mkII+SC-55+SC-155+ROM" target="_blank" rel="noreferrer noopener">SC-55 ROMs</a>&nbsp;用 Google 搜尋</li>



<li>把 nuked_sc-55.zip 解壓裡頭會有三個檔案分別用 SSH 放入至指定目錄</li>



<li>sc55Service 放進 /userdata/system/services 如 services  目錄未存在請在 SSH 下底下指令，之後在 copy 檔案</li>
</ul>



<pre class="wp-block-code"><code> mkdir -p /userdata/system/services</code></pre>



<ul class="wp-block-list">
<li>nuked-sc55 放進 /userdata/bios 裡</li>



<li>librtmidi.so.7 放進 /userdata/bios 裡</li>
</ul>



<p>上述完成後在 SSH 的介面上下變更權限的指令</p>



<pre class="wp-block-code"><code>chmod 755  /userdata/bios/nuked-sc55;
chmod 755  /userdata/system/services/sc55Service ;</code></pre>



<p>完成安裝的所有動作後重啟 Batocera</p>



<h2 class="wp-block-heading" id="在-emulationstation-的介面中啟用-nuked-sc-55-服務">在 Emulationstation 的介面中啟用 Nuked SC-55 服務</h2>



<ul class="wp-block-list">
<li>在 Emulationstation 中選擇 system settings</li>



<li>拉到最下方會看到 services</li>



<li>點進 services 此時就會看到 SC55SERVICE </li>



<li>勾選 SC55SERVICE  Nuked SC-55 就會啟用</li>
</ul>



<figure class="wp-block-image size-large"><img decoding="async" src="https://blog.ocam.live/wp-content/uploads/2025/04/screenshot-2025.04.23-07h57.52-1024x576.jpg" alt="screenshot 2025.04.23 07h57.52" class="wp-image-3718" title="Batocera 41 新增 Nuked SC-55 Roland SC-55mkII 模擬器"></figure>



<h2 class="wp-block-heading" id="設定-retroarch-的-midi-out-put-至-nuked-sc-55">設定 Retroarch 的 MIDI Out put 至 Nuked SC-55</h2>



<ul class="wp-block-list">
<li>打開 Retroarch 的設定介面</li>



<li>選擇 Settings-&gt;Audio-&gt;MIDI-&gt;OutPut</li>



<li>按左或右選到 Nuked SC55</li>
</ul>



<figure class="wp-block-image size-large"><img decoding="async" src="https://blog.ocam.live/wp-content/uploads/2025/04/screenshot-2025.04.23-07h51.03-1024x576.png" alt="screenshot 2025.04.23 07h51.03" class="wp-image-3720" title="Batocera 41 新增 Nuked SC-55 Roland SC-55mkII 模擬器"></figure>



<p>到這裡 Retroarch 的設定就算完成。至於是否要把這個檔案存下來當作是預設值就看個人。因為當 Retroarch 的 MIDI 有設定但抓不到值時 Retroarch 會回到預設關掉的狀態。 </p>



<h2 class="wp-block-heading" id="測試遊戲效果，使用-x-68000-悪魔城ドラキュラ">測試遊戲效果，使用 &nbsp;X68000 悪魔城ドラキュラ</h2>



<p>用 Batocera 打開遊戲之後就會進到選擇音效的畫面，這裡記得選 SC-55 (紅字的)。這樣該遊戲就會用 Nuked SC-55 作為音效輸出。此時音樂會大幅升級，用 Roland SC-55mkII 的音源果然不一樣。您也可觀看這邊的有<a href="https://blog.ocam.live/archives/3641">支援 SC-55 遊戲列表</a></p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="645" height="412" src="https://blog.ocam.live/wp-content/uploads/2025/04/惡魔城_select_music.png" alt="悪魔城 ドラキュラ x68000 ，Main music selection screen" class="wp-image-3722" style="width:742px;height:auto" title="Batocera 41 新增 Nuked SC-55 Roland SC-55mkII 模擬器" srcset="https://blog.ocam.live/wp-content/uploads/2025/04/惡魔城_select_music.png 645w, https://blog.ocam.live/wp-content/uploads/2025/04/惡魔城_select_music-600x383.png 600w" sizes="auto, (max-width: 645px) 100vw, 645px" /></figure>



<h2 class="wp-block-heading" id="faq">FAQ</h2>


<div id="rank-math-faq" class="rank-math-block">
<div class="rank-math-list ">
<div id="faq-question-1745479952799" class="rank-math-list-item">
<h3 class="rank-math-question ">有沒有支援 arm</h3>
<div class="rank-math-answer ">

<p>arm64的可自行編譯，參考 <a href="https://github.com/jcmoyer/Nuked-SC55.git" target="_blank" rel="noopener">git</a> 。arm32 不行。程式 64bit only</p>

</div>
</div>
<div id="faq-question-1745480243356" class="rank-math-list-item">
<h3 class="rank-math-question ">重開機後 SC55SERVICE 不會自動啟動</h3>
<div class="rank-math-answer ">

<p>BUG，我尚未完全了解 Batocera 的 Boot 順序，暫時只能要使用時到 ES 的 SERVICE 關掉再打開 SC-55 服務。估計是 alsa 佔用問題. </p>

</div>
</div>
<div id="faq-question-1745480420404" class="rank-math-list-item">
<h3 class="rank-math-question ">執行 SC-55 有什麼硬體限制</h3>
<div class="rank-math-answer ">

<p>X64 至少要 INTEL N-100 、I3 2代、Pentium haswell。ARM64 至少 S922 / RPI5 / RK3588 有機會可使用。s905x3  應不行。<a href="https://www.rock-chips.com/a/cn/product/RK35xilie/2022/0926/1656.html" target="_blank" rel="noopener"></p>
<p></a><a href="https://www.rock-chips.com/a/cn/product/RK35xilie/2022/0926/1656.html" target="_blank" rel="noopener"></a><a href="https://www.rock-chips.com/a/cn/product/RK35xilie/2022/0926/1656.html" target="_blank" rel="noopener"></a></p>

</div>
</div>
<div id="faq-question-1745482911702" class="rank-math-list-item">
<h3 class="rank-math-question ">Nuked SC-55 能商用嗎？</h3>
<div class="rank-math-answer ">

<p>不行。Batocera 也規定不行。<a href="https://github.com/jcmoyer/Nuked-SC55/blob/master/LICENSE" target="_blank" rel="noopener">LICENSE</a> 按這裡看</p>

</div>
</div>
<div id="faq-question-1745808021365" class="rank-math-list-item">
<h3 class="rank-math-question ">強迫中斷遊戲後音樂聲仍在</h3>
<div class="rank-math-answer ">

<p>請到 SERVICE 那邊關掉後再重開 SC55SERVICE</p>

</div>
</div>
</div>
</div>

<div class="wp-block-stackable-heading stk-block-heading stk-block-heading--v2 stk-block stk-7280d78" id="x-68000-games-supporting" data-block-id="7280d78"><h2 class="stk-block-heading__text">延伸閱讀</h2></div><div class="reading-grid"><a href="https://blog.ocam.live/archives/4162" class="card">
      <img loading="lazy" decoding="async" width="300" height="300" src="https://blog.ocam.live/wp-content/uploads/2025/09/霸王-cover-800x619-1-300x300.jpg" class="attachment-thumbnail size-thumbnail" alt="三國志II霸王的大陸封面" title="Batocera 41 新增 Nuked SC-55 Roland SC-55mkII 模擬器">
      <div class="card-content">
        <div class="card-title">2025 PlayStation 三國志 II 霸王的大陸復刻加強版金手指</div>
      </div>
		</a><a href="https://blog.ocam.live/archives/4828" class="card">
      <img loading="lazy" decoding="async" width="300" height="300" src="https://blog.ocam.live/wp-content/uploads/2026/02/PCE-CDROM-酒井法子-鏡之國夢冒險-300x300.jpg" class="attachment-thumbnail size-thumbnail" alt="PCE-CDROM 酒井法子-鏡之國夢冒險" srcset="https://blog.ocam.live/wp-content/uploads/2026/02/PCE-CDROM-酒井法子-鏡之國夢冒險-300x300.jpg 300w, https://blog.ocam.live/wp-content/uploads/2026/02/PCE-CDROM-酒井法子-鏡之國夢冒險-600x600.jpg 600w, https://blog.ocam.live/wp-content/uploads/2026/02/PCE-CDROM-酒井法子-鏡之國夢冒險-860x860.jpg 860w, https://blog.ocam.live/wp-content/uploads/2026/02/PCE-CDROM-酒井法子-鏡之國夢冒險-768x768.jpg 768w, https://blog.ocam.live/wp-content/uploads/2026/02/PCE-CDROM-酒井法子-鏡之國夢冒險.jpg 1024w" sizes="auto, (max-width: 300px) 100vw, 300px" title="Batocera 41 新增 Nuked SC-55 Roland SC-55mkII 模擬器">
      <div class="card-content">
        <div class="card-title">PCE-CD-ROM² 酒井法子-鏡之國夢冒險繁體中文化專案啟動</div>
      </div>
		</a><a href="https://blog.ocam.live/archives/4944" class="card">
      <img loading="lazy" decoding="async" width="300" height="300" src="https://blog.ocam.live/wp-content/uploads/2026/04/N64RecompLauncher-300x300.webp" class="attachment-thumbnail size-thumbnail" alt="N64RecompLauncher" title="Batocera 41 新增 Nuked SC-55 Roland SC-55mkII 模擬器">
      <div class="card-content">
        <div class="card-title">Batocera 新增 N64RecompLauncher</div>
      </div>
		</a></div></ul>
]]></content:encoded>
					
		
		
		<media:content url="https://blog.ocam.live/wp-content/uploads/2025/04/batocera_logo.jpg" medium="image"></media:content>
            	</item>
		<item>
		<title>Batocera 4.1 新增 Fluidsynth MIDI音樂支援</title>
		<link>https://blog.ocam.live/archives/3556</link>
		
		<dc:creator><![CDATA[blog.ocam.live]]></dc:creator>
		<pubDate>Mon, 21 Apr 2025 07:41:32 +0000</pubDate>
				<category><![CDATA[電玩模擬器]]></category>
		<category><![CDATA[程式設言]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[batocera]]></category>
		<category><![CDATA[fluidsynth]]></category>
		<guid isPermaLink="false">https://blog.ocam.live/?p=3556</guid>

					<description><![CDATA[為何需要 Fluidsynth MIDI 音樂 Batocera 為何要設定 MIDI 。因為部份 PC980 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-stackable-heading stk-block-heading stk-block-heading--v2 stk-block stk-b9gve23" id="為何需要-fluidsynth-midi-音樂" data-block-id="b9gve23"><h2 class="stk-block-heading__text">為何需要 Fluidsynth MIDI 音樂</h2></div>



<p>Batocera 為何要設定 MIDI 。因為部份 PC9801 / x68000 的遊戲有些支援 GM MIDI ，如當時有許多著名的遊戲（像是《東方Project》初期作、Falcom 的 RPG 等，Konami 的 惡魔城 ）。這些遊戲常常使用 MIDI 音樂或依賴外部音源（如 Roland MT-32、SC-55、GM MIDI ）。這時 Fluidsynth 就上場了！它可以讀取高品質 SoundFont（例如模仿 SC-55/SC-88 的音源），讓你聽到接近原始音效的音樂。</p>



<nav class="wp-block-stackable-table-of-contents stk-block-table-of-contents stk-block stk-vd2hw4u" data-block-id="vd2hw4u"><p class="stk-table-of-contents__title">文章大綱</p><ul class="stk-table-of-contents__table"><li><a href="#為何需要-fluidsynth-midi-音樂">為何需要 Fluidsynth MIDI 音樂</a></li><li><a href="#按裝-fluidsynth-service-檔">按裝 Fluidsynth Service 檔</a></li><li><a href="#測試">測試</a></li></ul></nav>



<div class="wp-block-stackable-heading stk-block-heading stk-block-heading--v2 stk-block stk-0hcknj8" id="按裝-fluidsynth-service-檔" data-block-id="0hcknj8"><h2 class="stk-block-heading__text">按裝 Fluidsynth Service 檔</h2></div>



<p>由於 Batocera 在 4.1 的版本有 Fluidsynth 的主程式，也有 1 個 FluidR3_GM.sf2 缺的只是 1 個 service 檔。這裡使用 service 有 1 個主要是目地是因為它可以被 Emulationstation 的介面上控制是否可自動啟動或關閉，甚至重新啟動等。這會比 hard-code 在程式裡有較多彈性</p>



<p>1：首先 SSH 進你的 Batocera 主機<br>2：執行<br> mkdir -p /userdata/system/services<br>3：vi  /userdata/system/services/fluidsynthService<br>把下方的程式碼貼上 。貼完按 :wq 寫入並退出 vi</p>



<pre class="wp-block-code"><code>#!/bin/bash
###
### Batocera.PLUS
### Alexandre Freire dos Santos
### Start/Stop FluidSynth as a server process
###

function startFluidsynth()
{
    if ! &#091; -e '/dev/snd/seq' ]
    then
        modprobe snd_seq

        if ! &#091; -e '/dev/snd/seq' ]
        then
            return 1
        fi
    fi

    fluidsynth --midi-driver  alsa_seq \
               --audio-driver alsa \
               --no-shell \
               --server \
               --quiet \
               /usr/share/soundfonts/FluidR3_GM.sf2 \
               &gt; /dev/null 2&gt;&amp;1
}


function stopFluidsynth()
{
    if &#091; "$(pidof -s fluidsynth)" ]
    then
        killall -15 fluidsynth &gt; /dev/null 2&gt;&amp;1
    fi

    if lsmod | grep -qE '^&#091; ]*snd_seq&#091; ]'
    then
        modprobe -r snd_seq
    fi
}

function restartFluidsynth()
{
    startFluidsynth
    sleep 0.5
    stopFluidsynth
}

case ${1} in
    start)
        startFluidsynth &amp;
        ;;
    stop)
        stopFluidsynth
        ;;
    restart)
        restartFluidsynth
        ;;
    *)
        echo "usage: $(basename "${0}") start | stop | restart"
        exit 1 
esac

exit 0

</code></pre>



<p>4: 執行 chmod 755  /userdata/system/services/fluidsynthService </p>



<p>5:在 Emulationstation 的介面上執行重開機。</p>



<p>6: 在 Emulationstation 的 <strong>MAIN MENU</strong>&nbsp;→&nbsp;<strong>SYSTEM SETTINGS</strong>&nbsp;→&nbsp;<strong>SERVICES</strong>. 你就會看到 fluidsynthService  的按鈕。1 個是啟用，1 個是關閉。依自已本身的需求選擇。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="500" height="295" src="https://blog.ocam.live/wp-content/uploads/2025/04/batocera_system_setting.jpg" alt="Batocera system settings" class="wp-image-3612" title="Batocera 4.1 新增 Fluidsynth MIDI音樂支援"></figure>



<div class="wp-block-stackable-heading stk-block-heading stk-block-heading--v2 stk-block stk-pwrln05" id="測試" data-block-id="pwrln05"><h2 class="stk-block-heading__text">測試</h2></div>



<p>選擇 1 個有支援 GM MIDI 的遊戲，在 1 開始跑記憶體檢測時把開 Retroarch 的 Menu. 選擇設定-&gt;audio-&gt;midi-&gt;output 按左或右選擇你的 output device ，通常有 Synth 字串的那個就是。之後我是建議把 config 存檔。這樣才不會每次都要設定。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="818" height="514" src="https://blog.ocam.live/wp-content/uploads/2025/04/batocera_Midi.png" alt="batocera Midi" class="wp-image-3614" title="Batocera 4.1 新增 Fluidsynth MIDI音樂支援" srcset="https://blog.ocam.live/wp-content/uploads/2025/04/batocera_Midi.png 818w, https://blog.ocam.live/wp-content/uploads/2025/04/batocera_Midi-600x377.png 600w, https://blog.ocam.live/wp-content/uploads/2025/04/batocera_Midi-768x483.png 768w" sizes="auto, (max-width: 818px) 100vw, 818px" /></figure>


<div class="wp-block-stackable-heading stk-block-heading stk-block-heading--v2 stk-block stk-7280d78" id="x-68000-games-supporting" data-block-id="7280d78"><h2 class="stk-block-heading__text">延伸閱讀</h2></div><div class="reading-grid"><a href="https://blog.ocam.live/archives/4915" class="card">
      <img loading="lazy" decoding="async" width="300" height="300" src="https://blog.ocam.live/wp-content/uploads/2026/04/cobra2.cover_-300x300.png" class="attachment-thumbnail size-thumbnail" alt="PC Engine CD-ROM 眼鏡蛇 2 傳説之男繁體中文化" title="Batocera 4.1 新增 Fluidsynth MIDI音樂支援">
      <div class="card-content">
        <div class="card-title">PC Engine CD-ROM 眼鏡蛇 2 傳説之男繁體中文化</div>
      </div>
		</a><a href="https://blog.ocam.live/archives/4040" class="card">
      <img loading="lazy" decoding="async" width="300" height="300" src="https://blog.ocam.live/wp-content/uploads/2025/05/duck-dns-300x300.webp" class="attachment-thumbnail size-thumbnail" alt="Duck DNS feature image" title="Batocera 4.1 新增 Fluidsynth MIDI音樂支援">
      <div class="card-content">
        <div class="card-title">免費的 DDNS Duck DNS 簡單快速設定方式</div>
      </div>
		</a><a href="https://blog.ocam.live/archives/3759" class="card">
      <img loading="lazy" decoding="async" width="300" height="300" src="https://blog.ocam.live/wp-content/uploads/2025/04/image_compress-300x300.jpg" class="attachment-thumbnail size-thumbnail" alt="image compress" title="Batocera 4.1 新增 Fluidsynth MIDI音樂支援">
      <div class="card-content">
        <div class="card-title">WordPress 簡單手動壓縮媒體庫</div>
      </div>
		</a></div></ul>
]]></content:encoded>
					
		
		
		<media:content url="https://blog.ocam.live/wp-content/uploads/2025/04/FluidSynthWebHeader.png" medium="image"></media:content>
            	</item>
	</channel>
</rss>
