Skip to content

PI.CONFIG

Matthew Splett edited this page Aug 5, 2023 · 17 revisions

PI.CONFIG special file

A map of configuration values that can be read and written from the TI-99/4A as a DISPLAY VARIABLE 80 file.

Generally, just manage this from TIPI.TIPICFG (CALL TIPI w/no args)

However URI mappings are intended for programatic use to circumvent 256 character URL limitations.

Default Map Keys

  • AUTO
  • CS1_FILE
  • DIR_SORT
  • DSK1_DIR
  • DSK2_DIR
  • DSK3_DIR
  • DSK4_DIR
  • DSK5_DIR
  • DSK6_DIR
  • DSK7_DIR
  • DSK8_DIR
  • DSK9_DIR
  • MOUSE_SCALE (deprecated)
  • SECTOR_COUNT
  • TIPI_NAME (deprecated)
  • TZ
  • URI1
  • URI2
  • URI3
  • WIFI_SSID
  • WIFI_PSK
  • EAGER_WRITE
  • HOST_EOL
  • NATIVE_TEXT_DIRS

Not present by default

  • TIPI_SIG_DELAY

Floppy PATH aliasing

DSK1_DIR, DSK2_DIR, DSK3_DIR, DSK4_DIR may be set to a path in TI syntax ('.' separaters not '/') underneath the TIPI. base folder to allow some compatibility with programs that require Level 3 and some Level 2 IO. To disable this aliasing clear the value.

When the value is set, the volume name for the aliased disk will be reported as the name of the folder it is mapped to.

Directories may be nested.

To map to the base folder, use a value of just a single dot '.'

Examples:

  • DSK1_DIR=TIARTIST.INSCEBOT
    • maps DSK1 to TIPI.TIARTIST.INSCEBOT with volumne name INSCEBOT
  • DSK2_DIR=.
    • maps DSK2 to TIPI with volume name TIPI
  • DSK3_DIR=
    • unmaps DSK3

Example working in BASIC

PI.CONFIG can be read or written to as a DISPLAY VARIABLE 80 file. Internally it is a map, not a file, so when you write a key=value pair it will overwrite whatever value was there before, instead of adding a new line to a file.

Updates are distributed to the TIPI services when the file is closed.

To set a config variable in BASIC:

10 OPEN #1:"PI.CONFIG", OUTPUT
20 PRINT #1:"URI1=http://www.cwfk.net/4afiles"
30 CLOSE #1

To read you cannot just read a single entry, you have to iterate across all the entries, at least until you find what you want. Here is an example that prints the configuration:

10 OPEN #1:"PI.CONFIG", INPUT
20 INPUT #1:A$
30 PRINT A$
40 GOTO 20

Cassette file mapping

There are a few programs that only support storing data with the CS1 tape device.

CS1_FILE can be set to the path of a file to allow overriding access to the console cassette device driver. This requires a TIPI ROM update from August 2023. If the CS1_FILE mapping is empty, then TIPI rejects the request and allows the console DSRLNK routine to continue searching and find the actual GROM cassette driver. If it is set, then TIPI will handle the request just like it handles other file requests. This does not involve any audio format. Files created with this will be in normal TIFILES format. Automatic native file transformations such as loading a GAME/TB text file as a PROGRAM image file are supported. If set to a file that does not exist, it will be created with the next OPEN or SAVE operation to the CS1 device. Unlike the DSKn_DIR mappings, this should be mapped to a filepath that includes a filename part.

To set the mapping to Tunnels of Doom game Pennies and Prizes in your TIPI.TOD. directory:

10 OPEN #1:"PI.CONFIG", OUTPUT
20 PRINT #1:"CS1_FILE=TOD.PENNIES"
30 CLOSE #1

Timezone setting

10 OPEN #1:"PI.CONFIG", OUTPUT
20 INPUT "Enter timezone to set:":TZ$
30 PRINT #1:"TZ="&TZ$
40 CLOSE #1

For a list of timezone values see: timezones

Note: the values are case sensitive.

Directory Sorting

You can control how directories are included in the CATALOG file for TIPI devices. Up until December 2020, TIPI defaulted to returning directories and files are mixed together, sorted in alphabetical order. As of now, the default is to list the directories in alphabetical order first, then list the files in alphabetical order.

This can be controlled by the user using the DIR_SORT entry. You may change it from FIRST to either MIXED or LAST.

And example of changing it back to MIXED:

10 OPEN #1:"PI.CONFIG", OUTPUT
20 PRINT #1:"DIR_SORT=MIXED"
30 CLOSE #1

Eager Writing

Normally TIPI does not write record files when OPEN, or WRITE PAB opcodes are performed. It waits until CLOSE. Some software may have taken advantage of the fact that the legacy disk controllers create files up front and can then use lvl2 io access to further manipulate them, they may need eager writing so that as soon as any change is performed the file will be written to the host file system. To turn eager writing on, set the PI.CONFIG value to 'on' (in lowercase)

10 OPEN #1:"PI.CONFIG", OUTPUT
20 PRINT #1:"EAGER_WRITE=on"
30 CLOSE #1

Host End Of Line

When using the ?W. file path modifier, DISPLAY format files are written without a TIFILES header, and each record is written as a line. By default the end-of-line is MS Windows style CRLF.

To set this to Unix/Linux style end-of-line, set the PI.CONFIG HOST_EOL key to the string 'LF'. Case matters.

10 OPEN #1:"PI.CONFIG", OUTPUT
20 PRINT #1:"HOST_EOL=LF"
30 CLOSE #1

To set it back to Windows style, set the value to 'CRLF'. Case matters.

10 OPEN #1:"PI.CONFIG", OUTPUT
20 PRINT #1:"HOST_EOL=CRLF"
30 CLOSE #1

Only CRLF and LF are valid values. Invalid values will behave as though it is set to CRLF.

Native Text Directories

Directories on TIPI can be marked for writing native files by default, as though the device name always has the ?W flag specified. To do this, write the NATIVE_TEXT_DIRS key to the PI.CONFIG file, with a comma separated list of TIPI directories. All files in any subdirectories of an included directory will also default to the ?W behavior.

Files written in DISPLAY VARIABLE 80 format will be saved as plain text files without a TIFILES FIAD header. This is supported by OPEN, READ, WRITE, STATUS, CLOSE, direct-input and direct-output file access.

When cataloging a directory that NATIVE_TEXT_DIRS applies to, any file that does not have a TIFILES FIAD header, will be listed as a DISPLAY VARIABLE 80 file. The catalog size entry, which is normally the sector count, will be the line count of the native text file. Without NATIVE_TEXT_DIRS applied, a catalog normally list such files as DISPLAY FIXED 128.

Configuring from BASIC

PI.CONFIG can be opened with a record length from 80 to 254, so that longer entries may be set.

To set the NATIVE_TEXT_DIRS to include TIPI.SOURCECODE. use code similar to the following:

10 OPEN #1:"PI.CONFIG", OUTPUT, VARIABLE 254
20 PRINT #1:"NATIVE_TEXT_DIRS=SOURCECODE."
30 CLOSE #1

To add TIPI.MYPROJECTS.ASM. to the list of dirs code similar to the following should work:

100 SK$="NATIVE_TEXT_DIRS"
110 AV$="MYPROJECTS.ASM."
120 OPEN #1:"PI.CONFIG",UPDATE,VARIABLE 254
130 LINPUT #1:L$
140 EQ=POS(L$,"=",1)
150 K$=SEG$(L$,1,EQ-1)
160 IF K$<>SK$ THEN 130
170 V$=SEG$(L$,EQ+1,LEN(L$))
180 IF LEN(V$)>0 THEN V$=V$&","
190 V$=V$&AV$
200 PRINT V$
210 PRINT #1:SK$&"="&V$
220 CLOSE #1

Sector Count

The default value is 1440, but can be changed if you need to simulate a smaller or larger disk drives behavior. Write SECTOR_COUNT=720 and your catalog volume descriptions will report based on the new value.

Mouse Scale (deprecated)

MOUSE_SCALE is no longer used.

TIPI_NAME (deprecated)

Not used.

TIPI_SIG_DELAY

REMOVED: version 3.0 of TIPI no longer consumes this setting.

This setting can be changed to potentially improve performance and reliability. Higher number will be more reliable. Lower number will be faster.

The delay iterations between sending data and sending latch signal between the PI and the hardware.. For normal TIPI peb and sideport boards this has been tuned to what works for each Raspberry PI model. However now with the MiSTer implementation, some of that tuning does not work.

For a Raspberry PI Zero W, on MiSTer there are reports that a value of 100 works.

TIPI_SIG_DELAY=100

For the Raspberry PI Zero 2W, there hasn't been any tuning, so it should be falling back to 200. However that is likely slower than necessary.

This can be written with TI BASIC along with any other of these settings. However if you are having reliability issues that may not work. This is backed by the data file /home/tipi/tipi.config on the PI. It is plain text, you can edit it, and it will take effect if you revisit the 4A title screen.

WIFI_SSID

The name of the wifi network you want to connect to. Changes to this will reboot the Raspberry PI on close.

WIFI_PSK

The pre-shared-key or wifi password of the network you want to connect to. Changes to this will reboot the Raspbery PI on close.

Clone this wiki locally