Spectrum Next DVI Only Monitor Fix - hoglet67/BeebFpga GitHub Wiki
Introduction
HDMI is based on the DVI. It uses the same TMDS electrical signalling over four shielded twisted pairs. But it specifies a different, more compact, family of connectors. It also adds the ability to carry in-band data, such as audio and metadata describing the intended aspect ratio.
Although HDMI is intended to be backwards comaptible with DVI, some older DVI monitors will not display a HDMI signal that includes this additional audio data.
The Spectrum Next core supports audio data on HDMI, and the FPGA core enables this by default. The Spectrum Next firmware does allow HDMI audio to be disabled by including a property HDMISound=0 in the CONFIG.INI file. Unfortunately the firmware applies this property quite late in the boot sequence. The net effect of this is some older DVI monitors display a blank boot screen, making it hard to configure the core, or to load additional cores.
The solution to this is to build a custom version of the firmware (the TBBLUE.FW file) with the following change to update_video_settings()
void update_video_settings()
{
...
REG_NUM = REG_PERIPH4;
REG_VAL = settings[eSettingScanlines] & 3;
}
void update_video_settings()
{
...
REG_NUM = REG_PERIPH4;
// DMB: Also honour HDMISound setting, as some DVI monitors
// show a black screen if HDMI metadata is present
REG_VAL = (settings[eSettingScanlines] & 3) |
(settings[eSettingHDMISound] == 0 ? 4 : 0);
}
The definition of Peripheral Register 4 can be found here: https://wiki.specnext.dev/Peripheral_4_Register
Building a Custom TBBLUE.FW file
This instructions assume you already have basic C development tools installed, like gcc, make and git.
To compile the Spectrum Next TBBLUE.FW file from source, two additional tools are needed:
-
SDCC version 4.0 (earlier versions do not work, later versions should work). You can download a pre-compiled version of SDCC for most platforms from from sourceforge. Unzip this and either follow the instructions in INSTALL.txt, or just place the bin directory on your path.
-
hex2bin, which can be found here. This will need to be compiled.
Here's some notes on downloading and compiling hex2bin:
git clone https://github.com/algodesigner/hex2bin.git
cd hex2bin
make
sudo make install
Next, download the Spectrum Next firmware source:
git clone https://gitlab.com/thesmog358/tbblue.git
cd tbblue
Now make the above change to update_video_settings() in src/firmware/app/src/config.c
Then rebuild the TBBLUE.FW file:
cd src/firmware/app
make clean
make
cd ../firmware
make clean
make
./makefirmware
You should now have a new TBBLUE.FW file.
Installing onto the SDCARD
On the Spectrum Next SD card do the following:
- Save a copy of the existing /TBBLUE.FW, for example by renaming it to /TBBLUE.OLD
- Copy your new TBBLUE.FW file to /TBBLUE.FW
- Edit the /machines/next/CONFIG.INI file and set HDMISound=0