wje@sii.UUCP (Bill Ezell) (05/01/84)
b Here is the 2nd in a series of articles about the innards of the Vectrex. This one is about the displayable character set, character sizes, and vector sizes. Routines mentioned are defined in the previous article. As an aside, several people have asked me how I deduced all of this stuff. I did it the old fashioned way; I disassembled the rom in the Vectrex. I also just posted the assembler I use to try all this out in net.sources. Ok, on with the show. The character drawing routines in the Vectrex expect several items of information; the height, width, relative y and x coordinates of the upper left hand corner of the first character, and the character string to display. Since the string origin is the upper left hand corner, the height must be negative or zero for normal strings. Here are some approximate sizes: value char height 0 1/16 inch -8 5/16 inch -16 9/16 inch, the biggest that looks reasonable For widths: value char height 16 1/20 inch, the smallest that is readable 127 3/8 inch, use with height -16 The size relationships are reasonably linear, so interpolate for other sizes. The coordinate system used by the character routines place (0,0) at the center of the screen, (127,127) is the upper right hand corner, (-128,-128) is the lower left hand corner. Remember that everything is drawn relative to the last position, so if you want to use these coordinates as absolute, you have to call reset0ref() before writing each string. The character set itself contains most of the ascii characters, except for lower case alphas, plus several special characters. Character values less than 0x20, space, are undefined. 0x20 through 0x5F, underscore, are normal ascii. Values from 0x60 through 0x6F give the following, anything greater than 0x6F is undefined. value character 0x60 little truck 0x61 uparrow 0x62 music note 0x63 downarrow 0x64 circle 0x65 filled circle 0x66 smaller filled circle 0x67 copyright symbol 0x68 spaceship or arrowhead 0x69 little man 0x6A smiling face 0x6B frowning face 0x6C infinity 0x6D square 0x6E beats me what it is 0x6F filled square Enough for characters, now for vectors. There are two parameters that can be specified for vectors, the endpoint and the scale factor. The coordinate system has the same origin as for characters, but once again, everything is relative to the last point. Assuming that the dot is currently at (0,0), a vector drawn to (0,127), the most positive coordinate, with a scale factor of 0x7F will draw a line from the center of the screen to the right hand side, approximately 3 inches. The scaling is linear, so a scale factor of 0xFF would give a vector as wide as the screen. That is, if the dot was currently at the left hand side of the screen a vector (0,127,mag FF) would draw a line across the screen, just fitting on it. Vectors drawn vertically are essentially the same, except a vector drawn from (0,0) to (127,0,mag 7F) is about 3-1/2 inches long, or not quite to the top of the screen. The routines move85u and move170u use scale factors of 0x7F and 0xFF, respectively. Of course, all this assumes that your Vectrex is properly adjusted, which is not a very good assumption. I have tested a random sampling of 4 and found that their calibration varies by +/- 10% or so. Maybe I'll come up with a calibration prom. Bill Ezell Software Innovations, Inc. (603) 883-9300