Share
Embed
16ビットCPU用FUZIXを実機で動かす キー入力編
2026. 6. 13開催の小江戸らぐ 6月のオフな集まり(第286回)で、セガのメガドライブ実機でFuzixを起動する話のうちキーボード入力の部分を紹介しました。
kazueda
June 14, 2026
Transcript
22 slides
-
kazueda(かずえだ)の紹介 • 大阪出身、丙午、おとめ座、O型 • 科学者(化学) • 2003年4月から浜松で、働き始める • 自転車での移動が生活の足 •
趣味は「ラジオを聴くこと」、「アメ リカのコミックの邦訳を読むこと」 @kazueda 2 X.com SNSリンク -
Platform-megadrive MEMORY { rom (rx) : ORIGIN = 0x000000, LENGTH
= 0x010000 /* 64KB Cartridge ROM */ rom_disk : ORIGIN = 0x010000, LENGTH = 0x1F0000 /* 1.9MB Cartridge ROM disk */ ram_disk : ORIGIN = 0x200000, LENGTH = 0x180000 /* 1.5 MB Cartridge RAM disk */ (rw) : ORIGIN = 0x380000, LENGTH = 0x080000 /* 512KB Cartridge RAM */ /* udata (rw) : ORIGIN = 0xFF0000, LENGTH = 0x10000 */ /* 64KB RAM (not used, except temporarilly for the stack)*/} 6 https://github.com/EythorE/FUZIX/tree/megadrive/Kernel/platform/platform-megadrive -
セガのメガドライブ • セガ・エンタープライゼスが 1988年10月29日に日本で発売し た16ビットの家庭用ゲーム機 • CPU(MPU):メインCPU: MC68000(7.67MHz/NTSC、 7.60MHz/PAL) •
RAM:メインメモリ(68000 用):64KB • VRAM:デュアルポートDRAM 64KB(32KB×2) 7 https://ja.wikipedia.org/wiki/%E3%83%A1%E3%82%AC%E3%8 3%89%E3%83%A9%E3%82%A4%E3%83%96 -
セガのメガドライブ • セガ・エンタープライゼスが 1988年10月29日に日本で発売し た16ビットの家庭用ゲーム機 • CPU(MPU):メインCPU: MC68000(7.67MHz/NTSC、 7.60MHz/PAL) •
RAM:メインメモリ(68000 用):64KB • VRAM:デュアルポートDRAM 64KB(32KB×2) 8 https://ja.wikipedia.org/wiki/%E3%83%A1%E3%82%AC%E3%8 3%89%E3%83%A9%E3%82%A4%E3%83%96 • Mega EverDriveで、2MBROMと 2MBRAMを実現 • キー入力は? -
メガドライブエミュレータのBlastem Features • savestates • integrated debugger • GDB remote
debugging • joystick/gamepad support • Mega/Sega Mouse emulation • XBAND and Saturn keyboard emulation • support for homebrew using the SSF2 mapper with Mega Everdrive compatible heuristics • save RAM and EEPROM support • Cartridge lock-on for both Sonic & Knuckles and XBAND • turbo and slow modes • configurable low pass filter • single pass GLSL shaders • Sega Master System emulation 9 https://www.retrodev.com/blastem/ -
メガドライブエミュレータのBlastem Features • savestates • integrated debugger • GDB remote
debugging • joystick/gamepad support • Mega/Sega Mouse emulation • XBAND and Saturn keyboard emulation • support for homebrew using the SSF2 mapper with Mega Everdrive compatible heuristics • save RAM and EEPROM support • Cartridge lock-on for both Sonic & Knuckles and XBAND • turbo and slow modes • configurable low pass filter • single pass GLSL shaders • Sega Master System emulation 10 https://www.retrodev.com/blastem/ -
キーボードアーキテクチャ [サターンキーボード] │ (12ニブルのシリアルデータ) ▼ [keyboard_read.S] ── 68000アセンブリでI/Oポートを高速ハンドシェイク制御 │ Z80を一時停止させながら
`scancode_buffer` (12バイト) に格納 ▼ [keyboard.c] ── バッファから「メイク/ブレイク(押下/離鍵)」と「スキャン コード」を抽出 修飾キー(Shift, Ctrl, Alt, CapsLock)の状態を管理 `saturn_keymap` 配列からASCII/キーコードに変換して返す 11