Module spectrusty::chip::plus

source ·
Expand description

An emulator of the ULAplus enhanced graphics.

This emulator wraps one of the ULA chipset emulators that implements UlaPlusInner trait and enhances its graphics with ULAplus capabilities.

The UlaPlus chipset responds to the ports (fully decoded):

  • 0xFF - the main screen mode port (read and write, has priority),
  • 0xBF3B - the register port (write-only),
  • 0xFF3B - the data port (read and write)

and provides the new graphics capabilities according to the ULAplus version 1.1 specification.

Implementation specifics (may change in the future releases):

  • No HSL or CMYK 1.0 support, instead a grayscale mode has been implemented (1.1, see below for details).
  • The new way of multiplexing the 2-bit blue value to obtain a 3-bit blue value (1.1).
  • SCLD (Timex) modes are also supported: secondary screen, hi-color, hi-res, and shadow screen bank.
  • Port 0xFF has priority over the register port. Bits 0 to 5 written to port 0xBF3B with mode group set are bitwise ORed with the bits written previously to port 0xFF. When in palette mode, bits are not modified.
  • Reading of the value previously written to port previously written to port 0xFF is disabled by default, to not confuse some programs (BBC BASIC), that the chipset supports SCLD MMU paging. This can be enabled with UlaPlus::enable_reading_scld_mode.
  • The ULAplus capabilities can be disabled or enabled in run time with UlaPlus::enable_ulaplus_modes.
  • Hard reset sets the screen and color mode to the default and sets all palette entries to 0, but doesn’t change the ULAplus capabilities disable flag.
  • The inner chip features and bugs (e.g. floating bus, keyboard issue, snow interference) are carried through, and in case of the snow effect, only the primary screens are being affected.
  • The “locking” bit of Spectrum’s 128k memory paging doesn’t affect the ULAplus modes, but it makes the shadow memory inaccessible if it’s being paged out when the bit is being enabled.
  • When used with 48k ULA the shadow screen page is the same as the normal screen page.
  • The grayscale and palette modes are applied to all graphic modes including high resolution.
  • In grayscale mode with palette enabled, each palette entry describes a grayscale intensity from 0 to 255.
  • In grayscale mode with palette off, each color is converted to grayscale based on the color intensity.
  • In low resolution with palette mode enabled the palette entries 8 to 15 are being used to determine border color.
  • In high resolution with palette mode enabled the palette entries 24 to 31 are being used to determine colors.

In 128k mode, there are four available screen memory areas and in this documentation and source code they are referenced as:

identifier16kb pageaddress range¹aliasesidx²
screen 050x0000-0x1AFFprimary0
screen 150x2000-0x3AFFsecondary2
shadow screen 070x0000-0x1AFFpri. shadow1
shadow screen 170x2000-0x3AFFsec. shadow3

In 48k mode, there are two available screen memory areas:

identifieraddress rangealiasesref²
screen 00x4000-0x5AFFprimary0
screen 10x6000-0x7AFFsecondary1

¹ - Relative to the beginning of the 16kb page. ² - A screen bank argument for e.g. ZxMemory::screen_ref and ZxMemory::screen_mut.

Modules

Structs

Provides ULAplus screen and color modes for Ula, Ula128 and Ula3.

Traits

Implemented by chipsets that UlaPlus can enhance.