Skip to content

pix68k v0.2.2

Choose a tag to compare

@github-actions github-actions released this 22 Nov 20:44
· 5 commits to main since this release
Immutable release. Only release title and notes can be modified.

v0.2.1 からの変更

実物のフロッピーディスク

  • USB のフロッピーディスクドライブ (USB-FDD) に入れた実物の FD (X68000 の 2HD) から起動できるようにした。ベアメタル版は pix68k.cfg に fd0 = usb-fdd: と書き、電源を入れる前に FD を入れておく。USB-FDD が 2 台あれば fd0 = usb-fdd:0、fd1 = usb-fdd:1 のように番号で分ける (usb-fdd:3 まで。番号は、ディスクが入っていて読めたドライブに読めた順に付く)。ホスト版は Linux だけで、-0 /dev/sda のようにブロックデバイスを渡す。
  • 起動のときにディスクの全体 (1,261,568 バイト) をメモリに読み、書き込み禁止のイメージとして入れる。読む間 (Pi 5 で約 50 秒) は起動が止まる。設定メニューの Restart でも読み直す。実物の FD には書かない。起動のあとの FD の入れ替えはできない。読めるのは X68000 の 2HD だけで、コピープロテクトのあるディスク、2DD、1.44MB は読めない。確かめたドライブは Y-E DATA の USB-FDU (057b:0000) で、実機は Pi 5 だけ (Pi 3 / Pi 4 はビルドだけ)。詳しくは docs/disks-and-scsi.md の「実物のフロッピーディスクを USB-FDD から読む」。
  • USB-FDD から読んだディスクを XDF のイメージに書き出せるようにした (ベアメタル版)。設定メニューの「Save FD0 image」/「Save FD1 image」で、/pix68k/FD-<CRC-32>.XDF に書く (例: FD-602F7858.XDF)。同じ名前のファイルがあれば上書きしない。HTTP の GET /fd0.xdf、GET /fd1.xdf でも取れる (net_token= があればトークンが要る)。

Raspberry Pi 2

  • ベアメタル版が Raspberry Pi 2 Model B (Rev 1.1、BCM2836) で動くようにした。32 ビットのカーネル kernel7.img で、機種は X68000 (68000、10MHz / 16MHz) だけ。X68030、060turbo、数値演算プロセッサボードは使えない。zip に kernel7.img と、config.txt の [pi2] の節を入れた。
  • Pi 2 は、HDMI が 1920x1080 ならフレームバッファを 960x540 にし、2 倍の拡大を GPU に任せる。1920x1080 に実寸で書くと、16MHz でフレームが遅れることがあるため。cmdline.txt に pix68k_gpu_scale=1 と書けば実寸で書く。モニタの枠の絵 (video_filter= の cz-600de / cz-600db) は、既定では出ない。
  • 実機では、グラディウス II のデモ (68000 16MHz) が遅れたフレーム 0 で動いた。ほかのゲームと MIDI の音源は確かめていない。詳しくは docs/baremetal.md の「Raspberry Pi 2」。
  • 全機種: HTTP の PUT /files/pix68k/<名前> は、/pix68k がなければ作ってから書く。LAN から起動して SD カードに /pix68k がないときも、ROM や pix68k.cfg を HTTP で置ける。

画面

  • osd_bars=on で、画面の右下に各コア (C0〜C3) とメモリ (MEM) の使用率を縦の棒で出す (ベアメタル版。既定は off。設定メニューの OSD bars でも切り替えられ、Save settings で保存する)。C0 は USB、SD カード、ネットワーク、C1 は X68000、C2 は画面の合成、C3 は音の合成と MIDI の音源。色は 70% まで緑、90% まで黄、その上は赤。右上の数字を出していないとき (osd=off、メニューを開いている間など) は出さない。
  • 右の余白が 96 ドット以上 128 ドット未満のとき (960x540 のフレームバッファに 768x512 の画面を出すときなど) は、右上の数字と負荷のバーを 11 文字幅に詰めて、X68000 の画面に重ならないようにした。IP アドレスが 11 文字を超えるときは 2 行に分ける。

音

  • まーきゅりーゆにっと (mercury=on) に、ボードに載っている FM 音源の YMF288 (OPN3-L) 2 個を足した。FM 12 音、SSG 6 音、リズム 12 音と、タイマーの割り込み (レベル 4) を使える。mndrv の演奏を確かめた。リズムの音はチップの中の ROM のデータで同梱できないので、WAV 6 個 (2608_BD.WAV、2608_SD.WAV、2608_TOP.WAV、2608_HH.WAV、2608_TOM.WAV、2608_RIM.WAV) を /pix68k に置く (mercury_rhythm=DIR で変えられる。ホスト版は ROM のディレクトリか --mercury-rhythm DIR)。なければリズムだけ鳴らない。リズムは本物の音の WAV では確かめておらず、音量は推測で決めた。詳しくは docs/expansion.md。
  • OPM、ADPCM、まーきゅりーゆにっとの音 (62.5kHz) を出力の周波数 (48kHz など) に直すところを、線形補間から窓をかけた sinc の多相フィルタに替えた。24kHz より上の成分が聞こえる範囲に折り返して濁っていたのが減る (28kHz の音の折り返しが -10dB から -57dB)。音はフィルタの分 0.24ms 遅れる。
  • まーきゅりーゆにっとの PCM を 62.5kHz に直すところも、前の値を保つだけだったのを多相フィルタに替えた (48kHz の PCM に 5kHz の音を入れたときの、元の音と関係のない成分が -18dB から -62dB)。PCM の周波数の 0.43 倍より上の音は、写し (イメージ) が落ちきらない。
  • Pi の HDMI の音が、16ms ごとに飛び続けることがあったのを直した。ログを UART に書く間に割り込みが止まり、DMA の送り終わりの割り込みを取りこぼすと、送っている最中のバッファに次の音を書き続けていた。ログを短く分けて書き、割り込みのたびに DMA が今どのバッファを送っているかを見て合わせ直す。Pi 3 / Pi 4 の PWM と I2S にも同じ直しを入れた (I2S は鳴らしていない。Pi 5 の PWM / I2S は別の処理で、入っていない)。10 秒ごとの sound: の行の最後に、合わせ直した回数 (DMA resync(s)) を出す。UART のログは、ほかのコアのログが行の途中に混ざることがある (ネットワークの /log と画面のログは変わらない)。
  • 音の大きさのログに、sound sources: の行を足した。音源ごとの最大、MIDI を足す前の音だけで 16 ビットの範囲を超えたフレームの数、MIDI の音源が上限に届いたフレームの数、バッファが満杯で捨てたフレームの数を出す。音が割れるという報告を調べるためのもの。読み方は docs/midi.md。

ゲームパッド

  • HORI の PC エンジン用のパッド (PCEngine PAD、VID:PID 0f0d:0138) を、ボタンの並べ直しの表に足した。I がトリガ A、II がトリガ B。RUN と SELECT の同時押しでリセット、SELECT を押しながら十字キーの上で設定メニュー (Home ボタンはない)。
  • 起動したあとに挿したゲームパッド (HORIPAD S など) が認識されないことがあったのを直した。挿してから 300ms 待って探し、読めなければ 1 秒おきに探し直す (3 回まで)。Pi 5 で HORIPAD S を挿し直すと、USB のコントローラへの命令が時間切れになり、全体が止まることがあったのも直した。この直しを確かめたのは Pi 5 の USB ポートだけで、ハブの先 (Pi 3 / Pi 4、外付けのハブ) では試していない。

ステート

  • まーきゅりーゆにっとの YMF288 と、音のフィルタの状態がステートに入るようになった (版 21)。v0.2.1 までのステートは読める。v0.2.2 で保存したステートは、v0.2.1 では読めない。

試験機の道具

  • tools/pico_kbd (試験機の Pico を USB キーボードに見せるファーム) に、ゲームパッドと USB の抜き差しを真似る機能を足した。試験用で、利用者は使わない。

既知の問題

  • Pi 2: USB のゲームパッド (HORIPAD S) を挿したまま起動すると、USB の走査が止まり、OSD とネットワークが出ないことがある。抜いて起動し、OSD が出てから挿せば使える (Pi 2 で、起動したあとに挿した HORIPAD S で遊べた)。PC エンジン用のパッドは、挿したまま起動しても止まらなかった。
  • Pi 2: USB キーボードから続けて速く打つと、文字が抜けることがある。
  • Pi 2: 既定のフレームバッファは 960x540 なので、それより大きい画面モード (1024x1024 など) は、はみ出す分が切れる (真ん中を出す)。cmdline.txt に pix68k_gpu_scale=1 と書けば切れない (16MHz でフレームが遅れることがある)。
  • Pi 2: マウスと、Pi 2 Model B の Rev 1.2 (BCM2837) は確かめていない。
  • Pi 2: Pi 2 で保存したステートを 64 ビット版で読むこと、その逆は確かめていない。

Changes since v0.2.1 (English)

Real floppy disks

  • The emulator can now boot from a real floppy disk (X68000 2HD) in a USB floppy disk drive (USB-FDD). On the bare-metal build, write fd0 = usb-fdd: in pix68k.cfg and insert the disk before powering on. With two drives, assign them by number, e.g. fd0 = usb-fdd:0 and fd1 = usb-fdd:1 (up to usb-fdd:3; numbers go to drives that have a readable disk, in the order they are read). The host build supports this on Linux only: pass the block device, e.g. -0 /dev/sda.
  • The whole disk (1,261,568 bytes) is read into memory at boot and inserted as a write-protected image. Booting stops while it is read (about 50 seconds on a Pi 5). Restart in the settings menu reads it again. Nothing is written to the real disk. Swapping disks after boot is not supported. Only X68000 2HD disks can be read; copy-protected disks, 2DD and 1.44MB disks cannot. Tested with a Y-E DATA USB-FDU (057b:0000) on a Pi 5 only (Pi 3 / Pi 4 were only built). See docs/disks-and-scsi.md (in Japanese).
  • A disk read from a USB-FDD can be saved as an XDF image (bare-metal build). "Save FD0 image" / "Save FD1 image" in the settings menu writes /pix68k/FD-<CRC-32>.XDF (e.g. FD-602F7858.XDF). An existing file with the same name is never overwritten. HTTP GET /fd0.xdf and GET /fd1.xdf also return the image (a token is required when net_token= is set).

Raspberry Pi 2

  • The bare-metal build now runs on the Raspberry Pi 2 Model B (Rev 1.1, BCM2836). It is a 32-bit kernel, kernel7.img, with the X68000 (68000, 10MHz / 16MHz) only; X68030, 060turbo and the FPU board are not available. The zip includes kernel7.img and a [pi2] section in config.txt.
  • On the Pi 2, with 1920x1080 HDMI, the frame buffer is 960x540 and the GPU scales it 2x, because when drawing 1920x1080 directly, frames can be late at 16MHz. Add pix68k_gpu_scale=1 to cmdline.txt to draw at full size. The monitor bezel (cz-600de / cz-600db in video_filter=) is not shown by default.
  • On real hardware, the Gradius II demo (68000 16MHz) ran with no late frames. Other games and the MIDI synths have not been tested. See "Raspberry Pi 2" in docs/baremetal.md.
  • All models: HTTP PUT /files/pix68k/<name> creates /pix68k if it does not exist. ROMs and pix68k.cfg can be uploaded over HTTP even when a network-booted Pi has no /pix68k on its SD card.

Display

  • osd_bars=on shows vertical bars for the load of each core (C0-C3) and memory (MEM) at the bottom right of the screen (bare-metal build; default off; also toggled with OSD bars in the settings menu and saved with Save settings). C0 is USB, SD card and network, C1 the X68000, C2 screen composition, C3 sound synthesis and MIDI synths. Bars are green up to 70%, yellow up to 90%, red above. They are hidden when the top-right numbers are (osd=off, while the menu is open, etc.).
  • When the right margin is at least 96 but less than 128 dots (e.g. a 768x512 screen in a 960x540 frame buffer), the top-right numbers and the load bars are narrowed to 11 characters so they do not cover the X68000 screen. An IP address longer than 11 characters is split over two lines.

Sound

  • Mercury-Unit (mercury=on) now has the two YMF288 (OPN3-L) FM chips on the board: 12 FM, 6 SSG and 12 rhythm channels, and timer interrupts (level 4). Playback with mndrv was tested. The rhythm sounds are ROM data inside the chip and cannot be included; place six WAV files (2608_BD.WAV, 2608_SD.WAV, 2608_TOP.WAV, 2608_HH.WAV, 2608_TOM.WAV, 2608_RIM.WAV) in /pix68k (change with mercury_rhythm=DIR; host build: the ROM directory or --mercury-rhythm DIR). Without them only the rhythm is silent. The rhythm has not been tested with real sound data, and its volume is a guess. See docs/expansion.md.
  • Conversion of OPM, ADPCM and Mercury-Unit sound (62.5kHz) to the output rate (48kHz etc.) now uses a windowed-sinc polyphase filter instead of linear interpolation. Less of the content above 24kHz folds back into the audible range (a 28kHz tone's alias drops from -10dB to -57dB). The filter delays sound by 0.24ms.
  • Mercury-Unit PCM is also converted to 62.5kHz with a polyphase filter instead of holding the previous sample (unrelated components for a 5kHz tone in 48kHz PCM drop from -18dB to -62dB). For tones above 0.43 times the PCM rate, the images are not fully removed.
  • Fixed HDMI sound on the Pi sometimes skipping every 16ms. Writing the log to the UART disabled interrupts; when a DMA completion interrupt was missed, the next sound kept being written into the buffer being sent. The log is now written in short pieces, and on each interrupt the driver checks which buffer the DMA is sending and resynchronizes. The same fix is in PWM and I2S on Pi 3 / Pi 4 (I2S not tested; Pi 5 PWM / I2S use a different driver and are not covered). The 10-second sound: log line ends with the number of resyncs (DMA resync(s)). On the UART, log lines from other cores may now be mixed into the middle of a line (the network /log and the on-screen log are unchanged).
  • The sound level log has a new sound sources: line: the peak of each source, frames where the sound before adding MIDI exceeded 16 bits, frames where a MIDI synth reached full scale, and frames dropped because the buffer was full. This is for investigating reports of distorted sound. See docs/midi.md.

Gamepads

  • Added the HORI PC Engine pad (PCEngine PAD, VID:PID 0f0d:0138) to the button remapping table. I is trigger A, II is trigger B. RUN and SELECT together reset; Up while holding SELECT opens the settings menu (there is no Home button).
  • Fixed gamepads plugged in after boot (HORIPAD S etc.) sometimes not being recognized. The driver now waits 300ms after a device is plugged in and retries every second if it cannot be read (up to 3 times). Also fixed the Pi 5 hanging when a HORIPAD S was re-plugged and a command to the USB controller timed out. This fix was tested only on the Pi 5's own USB ports, not behind a hub (Pi 3 / Pi 4, external hubs).

States

  • States now include Mercury-Unit's YMF288 chips and the sound filter state (version 21). States from v0.2.1 and earlier can still be loaded. States saved by v0.2.2 cannot be loaded by v0.2.1.

Test tools

  • tools/pico_kbd (firmware that makes the test rig's Pico a USB keyboard) can now emulate a gamepad and USB unplug / replug. Not for end users.

Known issues

  • Pi 2: booting with a USB gamepad (HORIPAD S) connected can stall the USB scan, so the OSD and network do not start. Boot without it and plug it in after the OSD appears (a HORIPAD S plugged in after boot on a Pi 2 worked). Booting with the PC Engine pad connected did not stall.
  • Pi 2: typing fast on a USB keyboard can drop characters.
  • Pi 2: the default frame buffer is 960x540, so larger screen modes (1024x1024 etc.) are cropped (the center is shown). pix68k_gpu_scale=1 in cmdline.txt avoids this (frames can be late at 16MHz).
  • Pi 2: the mouse and the Pi 2 Model B Rev 1.2 (BCM2837) have not been tested.
  • Pi 2: loading a state saved on the Pi 2 in a 64-bit build, and the reverse, has not been tested.

ソースの場所は zip の中の SOURCE.txt と、このタグのソースを参照。Circle は submodule (external/circle) なので、GitHub が自動で付けるソースの zip と tar.gz には入らない。Circle は https://github.com/rsta2/circle の、SOURCE.txt に書いたコミットを使う。添付のファイルの SHA-256 は SHA256SUMS にある。

See SOURCE.txt in the zip and the source at this tag. Circle is a submodule (external/circle), so it is not included in the source zip and tar.gz that GitHub generates; use the commit of https://github.com/rsta2/circle written in SOURCE.txt. SHA-256 checksums of the attached files are in SHA256SUMS.