User Tools

Site Tools


plato:cdc.io:patch.structure

Patch Structure

Overview

First, a warning:

Never Directly Apply

The format of the patch file MUST be precise and failure to understand how the format works can render a target useless/corrupt. For this reason, never apply a patch directly to a working file. Always apply to a disposable copy.

Moreover, patches from one system to another may require careful edits after patching is applied due to conditionals which may refer to system names, types, identifiers, or other location specific variables and artifacts.

The B66 file structure is a rough analog to that required by the PF command, but that's where the similarities end.

Each record, and its corresponding type, is rigorously structured.  

 +---+--------------------------------------------------------+
 |TYP|Structured Body                                         |
 +---+--------------------------------------------------------+
Type Structured Body
+++ CAPTURE START: Free-form comment. Start of Patch.
CTL Control Record / Block Separator.
B66 Specially-encoded, ASCII-encoded Binary representation of a line-oriented record.
TXT Specially-encoded, ASCII/Text representation of a charset letter or parser directive (e.g. lcommon=
MAP Follows TXT records and is followed by BIT recors which render the TXT values for each character visually.
--- CAPTURE END : Free-form comment. End of Patch.

For this tutorial, we will examine the system file sysid:

sysid
+++ CAPTURE START:
CTL-FIL s0file     BLK sysid      TYP common     EXT lesson     SEQ   1
TXTlcommon=320
B66     1okachris hopkins<<<<<<<s<<<<<<<<< 01/04/98  12.16.05.b[[[[[[[[[
B66    17[[[[[[[[[[[[[[[[
B66    33[[[[[[[[[[[[[[[[
B66    49[[[[[[[[[[[[[[[[
B66    65[[[[[[[[[[[[[[[[
B66    81[[[[[[[[[[[[[[[[
B66    97[[[[[[[[[[[[[[[[
B66   113[[[[[[[[[[[[[[[[
B66   129[[[[[[[[[[[[[[[[
B66   145[[[[[[[[[[[[[[[[
B66   161[[[[[[[[[[[[[[[[
B66   177[[[[[[[[[[[[[[[[
B66   193[[[[[[[[[[[[[[[[
B66   209[[[[[[[[[[[[[[[[
B66   225[[[[[[[[[[[[[[[[
B66   241[[[[[[[[[[[[[[[[
B66   257[[[[[[[[[[[[[[[[
B66   273[[[[[[[[[[[[[[[[
B66   289[[[[[[[[[[[[[[[[
B66   305[[[[[[[[[[[[[[[[
CTL-FIL s0file     BLK pubcware   TYP common     EXT lesson     SEQ   2
TXTlcommon=320
B66     1o2-d<b#ib<#n[[[[[[[[[[[[[[[
B66    17[[[[[[[[[[[[[[[[
B66    33[[[[[[[[[[[[[[[[
B66    49[[[[[[[[[[[[[[[[
B66    65[[[[[[[[[[[[[[[[
B66    81[[[[[[[[[[[[[[[[
B66    97[[[[[[[[[[[[[[[[
B66   113[[[[[[[[[[[[[[[[
B66   129[[[[[[[[[[[[[[[[
B66   145[[[[[[[[[[[[[[[[
B66   161[[[[[[[[[[[[[[[[
B66   177[[[[[[[[[[[[[[[[
B66   193[[[[[[[[[[[[[[[[
B66   209[[[[[[[[[[[[[[[[
B66   225[[[[[[[[[[[[[[[[
B66   241[[[[[[[[[[[[[[[[
B66   257[[[[[[[[[[[[[[[[
B66   273[[[[[[[[[[[[[[[[
B66   289[[[[[[[[[[[[[[[[
B66   305[[[[[[[[[[[[[[[[
--- CAPTURE END  :

For purposes of this tutorial, the following patch files have also been stored for your reference:

CTL Record

The CTL Record identifies the boundary between 320-word blocks in the PLATO File.

Example:

 ....+....1....+....2....+....3....+....4....+....5....+....6....+....7.
 CTL-FIL s0file     BLK sysid      TYP common     EXT lesson     SEQ   1
Columns Content Description
1-3 CTL (Field Identifier)
4 - or + Partial Indicator for SOURCE
5-7 FIL (Field Identifier)
8 (space) (Field Separator)
9-18 <filename> 1 to 10 character name of the file from which this patch was created
19 (space) (Field Separator)
20-22 BLK (Field Identifier)
23 (space) (Field Separator)
24-33 <blockname> 1 to 10 character name of the block within the file from which this patch was created
34 (space) (Field Separator)
35-37 TYP (Field Identifier)
38 (space) (Field Separator)
39-48 <blocktype> 1 to 10 character type of the block within the file from which this patch was created
49 (space) (Field Separator)
50-52 EXT (Field Identifier)
53 (space) (Field Separator)
54-63 <extension> 1 to 10 character describing type of the FILE from which this patch was created
64 (space) (Field Separator)
65-67 EXT (Field Identifier)
68 (space) (Field Separator)
69-71 <seqnum> 3-digit number identifying the original starting block sequence number of the sequence of blocks comprising this set of blocks.

TXT Record

The TXT record varies by the type of block being processed.

CHARSET Type

The patch system uses the TXT records ALONE when constructing a character set.

Columns Content Description
1-3 TXT (Field Identifier)
4-11 char (Field Identifier)
12-14 nnn Decimal, 3-digit number of the character slot described by the values to follow
15 (space) (Field Separator)
16-78 8 octal values

The octal values to follow represent the “vertical slices” (columns) of the bitmap composing the character. Each octal value is 18-bits (one for each vertical position) of which the least significant 16 are used.

A sample of the character set standard from lesson charsets:

....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
TXTchar    000 o000000,o000000,o000000,o000000,o000000,o000000,o000000,o000000
TXTchar    001 o000140,o001220,o001220,o001220,o001220,o000740,o000020,o000000
TXTchar    002 o017760,o000440,o001020,o001020,o001020,o000440,o000300,o000000
TXTchar    003 o000300,o000440,o001020,o001020,o001020,o001020,o000440,o000000
TXTchar    004 o000300,o000440,o001020,o001020,o001020,o000440,o017760,o000000
TXTchar    005 o000300,o000640,o001220,o001220,o001220,o001220,o000620,o000000
.
.
.
TXTchar    123 o000000,o000000,o001460,o001460,o000000,o000000,o000000,o000000
TXTchar    124 o000000,o000000,o000000,o017620,o000000,o000000,o000000,o000000
TXTchar    125 o002000,o001000,o000400,o000200,o000100,o000040,o000020,o000000
TXTchar    126 o000740,o001020,o002310,o002450,o002750,o001040,o000700,o000000
TXTchar    127 o000000,o000000,o000000,o000000,o000000,o000000,o000000,o000000

Because these can be difficult to visualize, the patch file format provides for a visual representation of the resulting displayed character:

MAPchar 000  char 001  char 002  char 003  char 004  char 005  char 006  char 007  
BIT                                                                                
BIT                                                                                
BIT                                                                                
BIT                    *                         *                 **              
BIT                    *                         *                *  *             
BIT                    *                         *                *                
BIT           ****     * ***       ****      *** *     ****      ***      **** *   
BIT               *    **   *     *    *    *   **    *    *      *      *    *    
BIT           *****    *     *   *         *     *   *******      *      *    *    
BIT          *    *    *     *   *         *     *   *            *       ****     
BIT          *    *    **   *     *    *    *   **    *           *      *         
BIT           **** *   * ***       ****      *** *     *****     ***      *****    
BIT                                                                      *     *   
BIT                                                                       *****    
BIT                                                                                
BIT                                                                                
MAPchar 008  char 009  char 010  char 011  char 012  char 013  char 014  char 015  
BIT                                                                                
BIT                                                                                
BIT                                                                                
BIT**           *         *      **          **                                    
BIT *                             *           *                                    
BIT *                             *           *                                    
BIT * ***      **        **       *  **       *      *** **    ** ***      ***     
BIT **   *      *         *       * *         *      *  *  *    **   *    *   *    
BIT *    *      *         *       **          *      *  *  *    *    *   *     *   
BIT *    *      *         *       * *         *      *  *  *    *    *   *     *   
BIT *    *      *         *       *  *        *      *  *  *    *    *    *   *    
BIT *    *     ***        *      **   **     ***     *  *  *    *    *     ***     
BIT                       *                                                        
BIT                       *                                                        
BIT                     **                                                         
BIT                                                                                
The MAP and BIT records are ignored during patch processing.

COMMON Type

The format of the TXT record within a TYP of common is simply of the format:

....+....1....+....2..
TXTlcommon=<value>

where value is the length, in words, of the common values to follow.

In our example:

CTL-FIL s0file     BLK sysid      TYP common     EXT lesson     SEQ   1
TXTlcommon=320

The B66 record values that follow must describe 320, 60-bit words of storage.

B66 Record

Each lower-case character is the display-code representation of the six-bit binary values between 0 (zero) and 63 [decimal].

Special characters represent specific values of different types. For binary type blocks (discussed in this article) 1):

  • # = Escape (parser directive)
  • _ = the internal value of the Divide character (o60)
  • > = the internal value of a colon : (shift semicolon)
  • < = 6-bits of ZERO
  • [ = 60-bits of ZERO
  • ] = -1 2)
  • ~ = -0 3)

SOURCE Type

The SOURCE type line format is represented by a sequence of TUTOR line-oriented records:

CTL-FIL ncharset   BLK -reminder- TYP source     EXT lesson     SEQ   2
B66*list   symbols<<<<<
B66*list   mods<<<<<<<<
B66*list   eject<<<<<<<
B66*       <<
B66* #hwould be nice to delay adding a char until going to<<<<<<
B66* the actual design page, so that pressing #hb#ha#hc#hk after<<<
B66* typing the wrong letter wouldn#h7t stick in a (blank)<<<<<<
B66* char for that letter.<<<<<<<
B66*       <<
B66*       <<
B66*          #hjust a reminder for some future date--there<<<<<
B66*       should be better integrity checks on the incoming<<<
B66*       charset info...a bad terminal memory address for<<<<
B66*       one character in a charset recently caused the<<<<<<
B66*       charset editor to bomb off with an execution error.<[
B66*       <<
B66*       --#hrick #hblomme   #hjune 26, 1975[
B66*       <<
B66********  don emerick  icbd             11/05/76  13.26.55<<
B66*#hhi marshall,<<<<<<
B66*        #hi got a long delayed request to make re the charset<<<<<<<<<
B66*editor#h> a lot of my character designs depend on symmetry.<[
B66*        <[
B66*#hwould it be possible to set up an option in the charset <<
B66*editor like the #h,make a copy of a character#h,, except that[
B66*the new option would allow us to reflect the #h,copied#h,<<<<
B66*character thru the x-axis, the y-axis, or thru the origin#h/[
B66*#hit seems to me the point-for-point transformation routine<[
B66*would be quite simple to establish.<<<<
B66*        <[
B66*#hif this note should go to some else, please forward it.<<<
B66*                        #hthanks, #hdon<<
B66********<<

A line-end representation is a 12-bit sequence of ZEROs.

COMMON Type

For COMMON entries, each B66 record identifier is followed by a six-digit decimal number describing the offset at which the value that follows, is to be placed.

In our example of file s0file / common sysid:

B66     1okachris hopkins<<<<<<<s<<<<<<<<< 01/04/98  12.16.05.b[[[[[[[[[
B66    17[[[[[[[[[[[[[[[[
B66    33[[[[[[[[[[[[[[[[
B66    49[[[[[[[[[[[[[[[[
B66    65[[[[[[[[[[[[[[[[
B66    81[[[[[[[[[[[[[[[[
B66    97[[[[[[[[[[[[[[[[
B66   113[[[[[[[[[[[[[[[[
B66   129[[[[[[[[[[[[[[[[
B66   145[[[[[[[[[[[[[[[[
B66   161[[[[[[[[[[[[[[[[
B66   177[[[[[[[[[[[[[[[[
B66   193[[[[[[[[[[[[[[[[
B66   209[[[[[[[[[[[[[[[[
B66   225[[[[[[[[[[[[[[[[
B66   241[[[[[[[[[[[[[[[[
B66   257[[[[[[[[[[[[[[[[
B66   273[[[[[[[[[[[[[[[[
B66   289[[[[[[[[[[[[[[[[
B66   305[[[[[[[[[[[[[[[[

In the example - there are sixteen, 60-bit words described per line.

1)
For printout type blocks (not discussed in this article), values are parsed in a slightly different manner.
2)
Octal value 0o77777777777777777776
3)
Octal value 0o77777777777777777777
plato/cdc.io/patch.structure.txt · Last modified: 2023/11/26 07:41 by Site Administrator