Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ starbase(3G) — HP-UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cc(1)

fc(1)

ld(1)

pc(1)

STARBASE(3G)

NAME

starbase − Starbase Graphics Library description

DESCRIPTION

The Starbase Graphics Library consists of procedures used to generate graphics text and pictures. This library is based on the emerging American National Standards Institute’s Computer Graphics Interface standard (ANSI CGI).  The Starbase Graphics Library provides a high-performance interface to HP graphics hardware and other selected graphics peripherals.  These library routines can be used in C, Pascal and Fortran77 programs.  In addition to the standard ANSI-CGI functions, Starbase provides asynchronous input functions, 3-dimensional transformations, and access to many device-dependent hardware features. 

LOADING STARBASE PROGRAMS

It is extremely important that link files be specified in the following order:

driver(s),
libsb1.a,
libsb2.a .

Some drivers may require that additional libraries be linked with them.  For instance, using libddhpgl.a requires that libdvio.a be linked as well.  Also, some functions in the Starbase library require that the math library be linked in.  Functions that require the math library are view_camera, ellipse, arc, intarc, intcircle, inttext2d, text, intline_width, line_width, dccircle, and the shading functions.  Specific requirements are described in the Starbase Device Drivers Library Manual.

For example: to compile and link the C program test.c for running on a terminal, hp98720 or hpgl plotter, use:

cc test.c -lddhpterm -ldd98720 -lhpgl -lsb1 -lsb2 -ldvio -lm -o test -O

LOADING STARBASE HP WINDOWS/9000 PROGRAMS

Series 300 only

To load a Starbase program that may be directed to a window, the window library and possibly the byte driver must be included.  The byte driver needs to be included for programs that draw to obscured graphics windows which are retained.  Again, the order is important:

driver(s), [byte_driver], window_library, libsb1.a, libsb2.a

For example:

cc test.c -ldd98720 -lddbyte -lwindow -lsb1 -lsb2 -lm -o test -O

For some monochrome devices, the bit driver is an alternative to the byte driver. This is because the bit driver requires one eighth the memory for a single-plane retained raster. 

INCLUDE FILE USAGE

The following templates show how include files should be used with the various language bindings:

C include Template

#include <starbase.c.h>
func()
{
/* function body */
}

main()
{
/* program body */
}

FORTRAN include Template

include ’/usr/include/starbase.f1.h’
program main
CPARAMETER statements
character NULL
parameter(NULL = char(0))
include ’/usr/include/starbase.f2.h’

CVARIABLE declarations

Cprogram body and/or subroutines and functions
end

Pascal include Template

program main(input,output);

$include ’/usr/include/starbase.p1.h’$

{ CONSTANTS }
{ TYPES }
{ VARIABLES }

$include ’/usr/include/starbase.p2.h’$

{ PROCEDURES AND FUNCTIONS }

begin
{program body}
end.

FILES

The following files make up the Starbase Graphics Library.  Each is shown with a description of its function. These files are located in the /usr/lib directory. 

  libsb1.aStarbase Main Library
  libsb2.aStarbase Stub Entry Points

(For series 300 only.)

  libddbit.aHP9000/Windows memory file (bit/pixel)
  libddbyte.aHP9000/Windows memory file (byte/pixel)
  libwindow.aHP9000/Windows Library

  and device drivers of the form libdd*.a

The following files are found in the /usr/include directory and should be used with the appropriate programming language. 

  starbase.c.hC program header file
  starbase.f1.hFortran77 program header file
  starbase.f2.hFortran77 program header file
  starbase.p1.hPascal program header file
  starbase.p2.hPascal program header file

SIGNALS

It is not recommended to use Starbase calls within a signal handler.  There is state information within a procedure that can be modified or lost if a second Starbase procedure is called while the first procedure is processing that information.  If it is necessary to use Starbase calls, keep track of the current active Starbase file descriptor, and use a different file descriptor to the same device.  Make sure this second file descriptor is not used outside the signal handler.  To reset the device, at the end of the signal handler make a call to the current active device using a Starbase procedure that does not actually access the device, such as inquire_color_table with a count of 0. 

STARBASE COORDINATE SYSTEMS

There are three Starbase coordinate systems: Floating point Virtual Device Coordinates, Integer Virtual Device Coordinates and Device Coordinates. Floating point operations are either 2d or 3d, and provide functions for light sources, shading, and hidden surface removal.  Floating point operations are available by default, or by using the FLOAT_XFORM gopen mode.  Integer operations provide only 2d transformations, and are available only when using the INT_XFORM gopen mode.  When using INT_XFORM mode, Floating point operations are not available.  Device coordinate operations are always available.  Although the majority of Starbase procedures are used with only one coordinate system, a few of them are used with two and some with all three.  A list of Starbase procedures and which system they are used with appears below. 
 

Floating point only:
 append_textpolygon3d
arcpolyline2d
backface_controlpolyline3d
bitmap_printpolymarker2d
bitmap_to_filepolymarker3d
block_movepop_matrix2d
block_readpop_matrix3d
block_writepush_matrix2d
character_heightpush_matrix3d
character_widthread_locator_event
clip_depthrectangle
clip_rectanglereplace_matrix2d
concat_matrixreplace_matrix3d
concat_transformation2drequest_locator
concat_transformation3dsample_locator
dc_to_vdcset_locator
default_knotsset_pick_depth
define_trimming_curveset_pick_window
depth_cueshade_mode
depth_indicatorshade_range
draw2dspline_curve2d
draw3dspline_curve3d
echo_typespline_surface
echo_updatesurface_model
ellipsetext2d
file_to_bitmaptext3d
hatch_spacingtext_alignment
hidden_surfacetext_line_path
inquire_current_position2dtext_line_space
inquire_current_position3dtext_orientation2d
inq_pick_depthtext_orientation3d
inq_pick_windowtransform_point
inquire_text_extenttransform_points
light_ambientu_knot_vector
light_modelv_knot_vector
light_sourcevdc_extent
light_switchvdc_to_dc
line_repeat_lengthvdc_to_wc
 

Floating point only (cont):
marker_orientationvertex_format
marker_sizeview_camera
move2dview_matrix2d
move3dview_matrix3d
partial_arcview_port
partial_ellipseview_volume
partial_polygon2dview_window
partial_polygon3dviewpoint
perimeter_repeat_lengthwc_to_vdc
polygon2dzbuffer_switch
 

Integer only:
 file_to_intbitmapintmove2d
intarcintpartial_arc
intbitmap_printintpartial_circle
intbitmap_to_fileintpartial_polygon2d
intblock_moveintperimeter_repeat_length
intblock_readintpolygon2d
intblock_writeintpolyline2d
intcharacter_heightline_endpoint
intcharacter_widthintpop_matrix2d
intcircleintpush_matrix2d
intclip_rectangleintrectangle
intconcat_matrix2dintreplace_matrix2d
intconcat_transform2dintrequest_locator2d
intdraw2dintsample_locator2d
intecho_type2dintset_pick_window
intecho_update2dinttext2d
inthatch_spacinginttext_orientation2d
intinquire_current_position2dinttransform_point2d
intinquire_pick_windowintvdc_extent
intinquire_text_extent2dintview_matrix2d
intline_repeat_lengthintview_port
intline_widthintview_window
 

Device coordinate only:
 dcbitmap_printdcecho_update
dcbitmap_to_filedcmarker_size
dcblock_movedcmove
dcblock_readdcpartial_polygon
dcblock_writedcpolygon
dccharacter_heightdcpolyline
dccharacter_widthdcpolymarker
dccircledcrectangle
dcdrawdctext
dcecho_typefile_to_dcbitmap
 

Common to Floating point and Integer:
 character_expansion_factorpop_matrix
character_slantpush_vdc_matrix
clip_indicatorset_hit_mode
curve_resolutionset_p1_p2
flush_matricestext_path
inquire_hittext_precision
intra_character_spacevdc_justification
mapping_mode

Common to all systems:
 await_eventinquire_color_table
await_retraceinquire_fb_configuration
background_color inquire_gerror
background_color_indexinquire_id
bank_switchinquire_input_capabilities
buffer_modeinquire_request_status
clear_controlinquire_sizes
clear_view_surfaceinterior_style
dbuffer_switchline_color
define_color_tableline_color_index
define_raster_echoline_type
designate_character_setmake_picture_current
disable_eventsmarker_color
display_enablemarker_color_index
double_buffermarker_type
drawing_modepattern_define
enable_eventsperimeter_color
file_printperimeter_color_index
fill_colorperimeter_type
fill_color_indexread_choice_event
fill_ditherrequest_choice
flush_bufferrgb_to_index
gclosesample_choice
gerr_messageset_signals
gerr_print_controltext_color
gerr_proceduretext_color_index
gescapetext_font_index
gopentext_switching_mode
hatch_orientationtrack
hatch_typetrack_off
initiate_requestwrite_enable

HARDWARE DEPENDENCIES

There are two versions of the Starbase library file, libsb1.a, on the series 300 releases.  (There is only one version, libsb1.a, on the series 800.) One series 300 version has been compiled for the 310 computer and will work for the 310, 318, 319, 320, 330, or 350 and is named /usr/lib/libsb1.10.a. The other series 300 version has been compiled to utilize 68020 instructions and to use the 68881 math co-processor.  This version is named /usr/lib/libsb1.20.a and will work on the 320, 330, or 350 computers.  The Starbase customize script, which is run whenever a system update is performed, links (ln(1)) the appropriate version into the /usr/lib/libsb1.a file. If you are running in a clustered environment, /usr/lib/libsb1.a is changed into a context-dependent file and the libraries libsb1.10.a and libsb1.20.a are linked to /usr/lib/libsb1.a+/HP-MC68010 and /usr/lib/libsb1.a+/HP-MC68881 , respectively.  Depending on the context of the node, the proper library is automatically used during the compilation process. 

 To link a program that is to run on another system, it may be necessary to link with either libsb1.10.a or libsb1.20.a instead of libsb1.a in order to use the version best-suited for the target machine. 

MKNOD SPECIAL FILES

HPGL and CADplt Device Drivers

The <Sc> parameter is the select code of the HP_IB or Serial Interface card.  The <AD> parameter is the HP_IB address.  The <LU> parameter is the logical unit of the HP_IB or Serial Interface card.  The <Pt> parameter is the serial port address. 

Series 300 Syntax

  HPIB: mknod /dev/hpgl  c 21 0x<Sc><AD>00
Serial: mknod /dev/hpgls c  1 0x<Sc><Pt>04

Series 800 Syntax

  HPIB: mknod /dev/hpgl  c 21 0x00<LU><AD>
Serial: mknod /dev/hpgls c  1 0x00<LU><Pt>

HP_HIL Device Driver

Series 300 Syntax

The <AD> parameter is the Address on the HIL serial loop. 

mknod /dev/hilx c 24 0x0000<AD>

Series 800 Syntax

The <LU> parameter is the hardware logical unit number.  The <AD> parameter is the device’s HIL serial loop address. 

mknod /dev/hilx c 24 0x00<LU><AD>
     or
mknod /dev/hil_<LU>.<AD> c 24 0x00<LU><AD>

HPTERM Device Driver

Use device file /dev/tty if you want the output to go to the terminal you are logged in on.  See your System Administrator for details on using other terminals.  Other terminals are usually designated as /dev/tty01, /dev/tty02, etc.

HP300h/HP300l Device Driver

Series 300 Syntax

mknod /dev/crt c 12 0x000000 ... (when alone)
mknod /dev/crt c 12 0x000100 ... (when also using hp98204b)

Series 800 Syntax

This driver is not supported on the series 800. 

HP9836A Device Driver

Series 300 Syntax

mknod /dev/crt c 12 0x000000

Series 800 Syntax

This driver is not supported on the series 800. 

HP98550 Device Driver

Series 300 Syntax

For internal devices:

mknod /dev/crt c 12 0x000000 (for all planes)
mknod /dev/ocrt c 12 0x000001 (for overlay planes)
mknod /dev/icrt c 12 0x000002 (for image planes)

For external device, <Sc> is the external select code of the HP98548/49/50 devices.

mknod /dev/crt c 12 0x<Sc>0200 (for all planes)
mknod /dev/ocrt c 12 0x<Sc>0201 (for overlay planes)
mknod /dev/icrt c 12 0x<Sc>0202 (for image planes)

Series 800 Syntax

The <LU> parameter is the hardware logical unit number. 

For internal devices:

mknod /dev/crt  c 14 0x00<LU>   (for all planes)
mknod /dev/ocrt c 14 0x00<LU>01 (for overlay planes)
mknod /dev/icrt c 14 0x00<LU>02 (for image planes)

HP98556 Device Driver

Series 300 Syntax

The <Sc> parameter is the external select code of the HP98556 device.

mknod /dev/crt c 12 0x<Sc>0200 (for all planes)
mknod /dev/ocrt c 12 0x<Sc>0201 (for overlay planes)
mknod /dev/icrt c 12 0x<Sc>0202 (for image planes)

Series 800 Syntax

The <LU> parameter is the logical unit number of the A1020A graphics subsystem. 

mknod /dev/crt c 14 0x00<LU>00
mknod /dev/ocrt c 14 0x00<LU>01
mknod /dev/icrt c 14 0x00<LU>02

HP98700 Device Driver

Series 300 Syntax

The <Sc> parameter is the external select code of the HP98700 device.

mknod /dev/crt c 12 0x000000 ... (for console device)
mknod /dev/crt c 12 0x<Sc>0200 ... (for external select code)

Series 800 Syntax

This driver is not supported on the series 800. 

HP98710 Device Driver

Series 300 Syntax

The <Sc> parameter is the external select code of the HP98710 device.

mknod /dev/crt c 12 0x000000 ... (for console device)
mknod /dev/crt c 12 0x<Sc>0200 ... (for external select code)

Series 800 Syntax

This driver is not supported on the series 800. 

HP98720 Device Driver

Series 300 Syntax

The <Sc> parameter is the external select code of the HP98720 device.

mknod /dev/crt c 12 0x000000 ... (for console device)
mknod /dev/crt c 12 0x<Sc>0200 ... (for external select code)

Series 800 Syntax

The <LU> parameter is the hardware logical unit number. 

mknod /dev/crt c 14 0x00<LU>00

HP98720w Device Driver

Series 300 Syntax

The <Sc> parameter is the external select code of the HP98720w device.

mknod /dev/ocrt c 12 0x000001 ... (for console device)
mknod /dev/ocrt c 12 0x<Sc>0201 ... (for external select code)

Series 800 Syntax

The <LU> parameter is the hardware logical unit number. 

mknod /dev/crt c 14 0x00<LU>00

HP98721 Device Driver

Series 300 Syntax

The <Sc> parameter is the external select code of the HP98721 device.

mknod /dev/crt c 12 0x000000 ... (for console device)
mknod /dev/crt c 12 0x<Sc>0200 ... (for external select code)

Series 800 Syntax

The <LU> is the hardware logical unit number. 

mknod /dev/crt c 14 0x00<LU>00

HP98730 Device Driver

Series 300 Syntax

The <Sc> parameter is the external select code of the HP98730 device.

mknod /dev/crt c 12 0x000000 ... (for console device)
mknod /dev/crt c 12 0x<Sc>0200 ... (for external select code)

Series 800 Syntax

The <LU> parameter is the hardware logical unit number. 

mknod /dev/crt c 14 0x00<LU>00

HP98731 Device Driver

Series 300 Syntax

The <Sc> parameter is the external select code of the HP98731 device.

mknod /dev/crt c 12 0x000000 ... (for console device)
mknod /dev/crt c 12 0x<Sc>0200 ... (for external select code)

Series 800 Syntax

The <LU> is the hardware logical unit number. 

mknod /dev/crt c 14 0x00<LU>00

HP Keyboard Device Driver

Locator Keyboard Device Driver

Use device file /dev/tty if you want the input to come from the terminal you are logged in on.  See your System Administrator for details on using other terminals.  Other terminals are usually designated as /dev/tty01, /dev/tty02, etc.

ENVIRONMENT VARIABLES

Series 300 only

SB_DISPLAY_ADDR

Frame buffer displays and the shared-memory communication mechanisms use a range of addresses on the series 300 machines.  These addresses may conflict with extremely large code, heap, or stack space. This can be avoided by setting the environment variable SB_DISPLAY_ADDR to shift this range of addresses up or down. 

If the Starbase Display Address environment variable (SB_DISPLAY_ADDR) is not set or is null, the default of 0xb00000 is used. This environment variable must be the same for all processes, so it is suggested that, if it is set, it be set in the Bourne file /etc/profile and the C Shell /etc/csh.login. 

SEE ALSO

cc(1), fc(1), ld(1), pc(1), Starbase Reference, Starbase Device Drivers Library Manual, Starbase Graphics Techniques. 

Hewlett-Packard Company  —  May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026