Skip to content

VERA Export 0x00 \ AUDIO_CTRL writing bug with PCM #2848

Description

@Yazwh0

I think there is a bug \ optmisation issue with the VERA Export.

VERAs AUDIO_CTRL register controls both the volume in the lower 4 bits, but if the top bit is set it causes a FIFO reset. The FIFO is the stream of PCM data.

When a track is exported, PCM data is written as a stream of either a register write or a command to play an instrument. After the EXTCMD, these are in pairs, a 'command' and a 'parameter'.

0x00 is wirte the next byte to AUDIO_CTRL.
0x01 is write the next byte to AUDIO_RATE.
0x02 is start the instrument that is in the next byte.

In the streams I've exported it appears the 0x00 is set twice, once for a volume change and once to reset the FIFO as can be seen in the snippet below. The first pair sets the volme, the next clears the FIFO. This is a duplication, so could be optimised to only write on 0x00 command. However when you examine the exported byte stream other instruments do not have a corresponding 0x00 command, which implies they do no need to change volume. This means there is also no FIFO clear.

I think this means there is a bug when it comes to the exporter and the 0x00 PCM command. It either should always have a FIFO reset when a new instrument is played -- although this could be optimised into one pair of bytes rather than four. Or the FIFO reset isn't needed given it doesn't always get triggered, maybe its incorrectly being injected when the volume changes?

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions