• Jeffrey Lee's avatar
    Add support for custom teletext modes · 92e90b01
    Jeffrey Lee authored
      This set of changes:
      * Adds support for the T, TX and TY mode string elements (as per RISCOS Ltd)
      * Adds support for entering arbitrary-resolution teletext modes by using mode selector blocks with the Teletext mode flag set
      * ScrRCol and ScrBRow mode variables can be provided in the mode selector in order to restrict the number of text rows/columns in teletext modes (as per RISCOS Ltd)
      * If the rows / columns are restricted in this manner then the text window will be centered on the screen, to try and avoid things looking too ugly (no variable text scaling implemented)
      * For HiResTTX, all colour depths >= 4bpp are now supported by teletext. This essentially makes the TTX256 switch obsolete.
      * If the "native" mode 7 is unavailable then the kernel will try a series of fallback resolutions & colour depths in an effort to find a combination that works
      Known bugs/issues:
      * Teletext column count has a max limit of 255 due to TTXDoubleCounts being a byte array
      * If there's a border around the text window, the border will not be refreshed when changing transparency modes using a VDU 23,18,0 sequence
      * ScreenLoad looks like it can overflow the LargeCommon buffer (no buffer size check) - needs fixing before LargeCommon can be safely shrunk below (Old)TTXMapSize
      File changes:
      - hdr/KernelWS - Make CharWidth non-conditional. Adjust handling of teletext workspace; it's now allocated from the system heap to allow it to cope with arbitrary screen sizes
      - s/vdu/vdu23 - Make CharWidth non-conditional
      - s/vdu/vducursoft - Make CursorTeletext cope with arbitrary colour depths, make CharWidth non-conditional, remove hard-coded teletext values
      - s/vdu/vdudriver - Deal with teletext workspace allocation during ModeChangeSub. Deal with selecting teletext modes (and validating colour depth) in GenerateModeSelectorVars.
      - s/vdu/vdugrafl - Make CharWidth non-conditional. Calculate offset required for text window centering.
      - s/vdu/vdumodes - Remove TTX256
      - s/vdu/vduswis - Try other teletext modes if native mode 7 not available. Extend OS_ScreenMode reason codes to cope with teletext mode strings.
      - s/vdu/vduttx - Update to use dynamic workspace. Replace various hardcoded values with variable lookups. Update character plotting + colour/palette selection to work with true-colour modes if HiResTTX.
      - s/vdu/vduwrch - Move some useful code into a subroutine. Update FastCLS to cope with true-colour teletext. Update AddressR0R1 to cope with text window centering offset. Make CharWidth non-conditional.
      Tested on Raspberry Pi, BB-xM
      VDU 23,18,0 in 256-colour teletext now works correctly (previously 64-colour mode was in use, causing palette update to be ruined by VIDC1-mangling)
    Version 5.74. Tagged as 'Kernel-5_74'
VersionNum 799 Bytes