rhys101 / beebem

Semi-official repository for the BeebEm emulator.
Other
2 stars 0 forks source link

Implement VBI data support #20

Open simoninns opened 3 years ago

simoninns commented 3 years ago

Frame numbers, user-codes (the bit that identifies the AIV disc), sounds modes and much more are provided by VBI data in the video information processed by the original VP415. In order to correctly emulate the player (especially f-code responses) this will need to be added into the LVROM images (possibly as a separate data file of field data which the emulator can decode on the fly). VBI data decoding example code is available from the ld-decode project.

simoninns commented 3 years ago

The example code is available here:

https://github.com/happycube/ld-decode/blob/master/tools/library/tbc/vbidecoder.cpp

Basically each field provides 3 values and those values must be in field order - this gives 6 values per frame (first field, second field). These values are then decoded according to the IEC specifications (same for NTSC and PAL) so IEC 60856 or 60857 - there are some changes in amendment 2 of the IEC specs, but they are minor.

It is these codes that the F-Code commands are responding to when a request for frame number, time code, sound type, etc is made. The decode is very quick, so the same on-the-fly decode style could be used in the emulator. The codes can be recovered from ld-decode's JSON metadata format for each disc (and stored in a simple text file).