Thanks to Julio Marchi for this space in MSX All
 

Dynamic Publisher Screen (.PCT)

  This is the main Dynamic Publisher, which is composed by a black and white screen based on the MSX 2 screen 6 format, having 512x704 pixels size.
  The file consists in a header with 384 bytes starting with the string "DYNAMIC PUBLISHER SCREEN". The screen data comes next, where the data is compressed using a particular method.

  File .PCT
 ┌────────┬────────┐
 │ Header │ Data   │
 └────────┴────────┘


  The compacted data starts at file's offset &H180.

  The compacted data have two fields to describe each set of data:

  • A counter
  • Pixels pattern


  There are two types of pattern:

  • The "repeated pattern", where the same pattern is repeated N times on screen.
  • The "distinct patterns", where N different patterns are drawn on screen.


Offset Field Size Obs
0 Counter 1 byte  
1 Pattern
Patterns
1 byte
N bytes
if "repeated pattern"
if "distinct patterns"

  There "N" is the counter value plus one.

  The counter field indicates:

  • "Repeated pattern", if the "counter" most significant bit (MSb) is 1.
  • "Distinct patterns", if the "counter" most significant bit (MSb) is 0.


  Step by step for the "repeated pattern":

  1. R = Counter;
  2. Remove the MSb of R:
    • R = R AND &H7F;
  3. Move the pointer 1 byte ahead.
  4. The value read is the pattern to be repeated on screen:
    • D = Pattern;
  5. For i=1 to R+1 do:
    • Plot "D" on screen;
  6. Move the pointer 1 byte ahead.


  Step by step for the "distinct patterns":

  1. R = Counter;
  2. For i=1 to R+1 do:
    • Move the pointer 1 byte ahead.
    • The value read is the pattern to be plotted on screen:
      • D = Pattern;
    • Plot "D" on screen;
  3. Move the pointer 1 byte ahead.


  The data to be plotted on screen is an 8-bit value, where each bit represents a pixel from an 8x1 pixels group. Thus, it is necessary to invert their nibbles.

  Example: &HC8

 

  Resulting data plotted on MSX screen, where bit 1 is the black color and the bit 0 is the white:

  ■□□□■■□□


  Important note: this compress method divides the screen space into lines, there is, if we have a pattern sequence starting in one line and ending in another line, this sequence must be interrupted at the end of the first line.


  Example

  The next example is a picture that has two lines and uses the Dynamic Publisher's compress method:

 01 08 04 BD 00 BF 00


  For the first set we have:

 Counter:
 R = 01  

 Type:
 Bit_7(R) = 0
 "distinct patterns"


We have 2 "distinct patterns" (total = R+1):

 01 08 04 BD 00 BF 00


  We must invert the nibbles from each pattern:

 08 04

 becomes:

 80 40


  We knwo that:

   80        40
10000000  01000000


  The 8x1 pixels groups are disposed side by side forming a line, different from the MSX 1 pattern. According to that, the resulting values will be draw on screen like the picture below:

  ■□□□□□□□□■□□□□□□


  For the second set, we have:

 Counter:
 R = BD 

 Type:
 Bit_7(R) = 1
 "repeated pattern"

 Remove bit 7:
 R = RB AND &H7F
 R = &H3D = 61


The same pattern is repeated 62 times (R+1). Notice that each line has 64 groups of 8x1 pixels and 62 is the remaining number of groups in the first line.

 01 08 04 BD 00 BF 00


  The repeated pattern is "00". According to that, the first line ends with white pixels.

  The third set is formed by "BF 00", which fills the second line with white pixels.


Marcelo Silveira
Systems and Computing Engineer
Expert in Image Processing and Artificial Intelligence
© MarMSX 1999-2021