This allows Greg Taylor's OPL3-FPGA to be controlled from a PC using USB-MIDI. The main purpose is to allow the use of OPL3-FPGA with modified versions of ScummVM and DOSBox through a USB connection.
2018-1-8
- This project has been updated for Vivado/PetaLinux 2017.4.
- Pre-built SD card image files are in the "images" folder. Feel free to copy these to a MicroSD card and skip to the "Running" section of the README.
-
Install Vivado 2017.4 and PetaLinux 2017.4.
-
Set up the environment:
source /path/to/vivado/settings64.sh source /path/to/petalinux/settings.sh
-
Download Greg Taylor's OPL3_FPGA BSP
-
Create a new PetaLinux project:
petalinux-create -t project -s ZYBO_OPL3_FPGA_2017_4.bsp
-
Create two new Petalinux apps. From the <project_folder>:
petalinux-create -t apps --template c --name opl3d --enable petalinux-create -t apps --template install --name midi --enable
-
Clone the Vivado/PetaLinux-2017.4 branch of this git repository and replace the "midi" and "opl3d" folders in:
<project-folder>/project-spec/meta-user/recipes-apps
with the "midi" and "opl3d" folders from the repository.
-
Edit /project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi and add the following:
/{ usb_phy0: usb_phy@0 { compatible = "usb-nop-xceiv"; #phy-cells = <0>; }; }; &usb0 { dr_mode = "otg"; usb-phy = <&usb_phy0>; };
-
Configure the kernel:
petalinux-config -c kernel
Enable the following options:
- Device Drivers > USB support > USB Gadget Support -> MIDI function (*)
Then exit and save the configuration
-
Configure the apps:
petalinux-config -c rootfs
Enable the following options:
- Apps > midi (*)
- Apps > opl3d (*)
Then exit and save the configuration
-
Build Linux:
petalinux-build
-
Use petalinux-package to generate BOOT.BIN:
petalinux-package --boot --fsbl images/linux/zynq_fsbl.elf --fpga images/linux/opl3.bit --u-boot
-
Copy BOOT.BIN and image.ub (from images/linux) onto a MicroSD card and insert it into the ZYBO
-
Set JP5 to SD to enable booting from the MicroSD card
-
Remove JP1 to enable OTG mode
-
Use a Micro-USB cable to connect J9 (on the bottom side of the ZYBO!) to your PC.
-
Power on the ZYBO
-
Clone https://github.com/waltervn/scummvm.git and build the 'opl3-fpga' branch.
-
In the ScummVM launcher, go to Options > Audio and select "OPL3 FPGA" in the Adlib emulator list box. Click OK to save. Any games set up for AdLib will now use OPL3-FPGA.
-
Clone https://github.com/waltervn/dosbox.git and build the 'opl3-fpga' branch.
-
Edit dosbox.conf and make the following changes:
-
Under [sblaster] set oplmode to 'opl3fpga'.
-
Under [midi] set midiconfig to point to the OPL3-FPGA midi device.
For Linux, try the following: Run 'aconnect -l' and look for "MIDI function". Use the client number you see there to set 'midiconfig'. E.g. if your client number is 28, set midiconfig to "28:0".
Other operating systems should work as well, as long as DOSBox has MIDI support for that platform, and you can point DOSBox to the OPL3-FPGA.