Back to Vectrex Programming Tutorial Index
Modifying HELLO WORLD
Well, we just did assemble our first vectrex program and let
it run (or didn't you?). What small things can be done to the
above program, so that we can learn a bit more about vectrex?
Let us now change the size of the text.
This is fairly simple, since only a changing of a BIOS RAM
location is neccessary. The 'variable' responsible is Vec_Text_HW
($C82A), which is a word pointer. It consists of two byte
variables, namely Vec_Text_Height ($C82A) and Vec_Text_Width
($C82B). As mentioned above the height is a negative size. The
default size is $F848, which is heigth=-8 and width=72. Well,
these are just numbers they don't tell me anything. What these
numbers actually are is the 'speed' of the vector beam as
described in 'Length of vectors /
Scale'. Just experiment with the numbers to get a feeling for
which numbers represent the display size you want.
Before the 'main:' line in the 'HELLO WORLD' example enter the
following lines:
LDA #$F1 ; HEIGTH (big=-14)
LDB #$60 ; WIDTH (big=96)
STA Vec_Text_Height ; store heigth
STB Vec_Text_Width ; store width
(NOTE, instead of the more obvious code above you can also
abriviate like:
LDD #$F160 ; HEIGTH, WIDTH (-14, 96)
STD Vec_Text_HW ; store to BIOS RAM location
)
This gives you a larger text display. Note, to center the text
you might also want to change the Y, X position (see example
further below).
We can also change the brightness of the text, there are some
other 'static' functions for intensity, like:
Intensity_1F ($F29D)
Intensity_3F ($F2A1)
Intensity_5F ($F2A5)
Intensity_7F ($F2A9)
Just call them instead of the Intensity_5F ($F2A5) in the
example (you must change the 'defines' in the header section
too). There also is a 'variable' intensity function, Intensity_a
($F2AB). As you might have guessed, this function expects a
parameter in the A register. The value in A is the intensity
which will be set by the function.
So... by now we can change three settings: position, size and
brightness. If you like exercizing you might try a HELLO WORLD
which bounces the text around the screen, changes text size and
brightness at every bounce (or something like that).
You might also want to take a look at the following BIOS
functions (Appendix A), they all have
some relation to string printing. The later functions print a
group (list) of strings.
Print_Str_hwyx ($F373)
Print_Str_yx ($F378)
Print_Str_d ($F37A)
Print_Str ($F495)
Print_List_hw ($F385)
Print_List ($F38A)
Print_List_chk ($F38C)
Next page Last Page
Vectrex Programming Tutorial Index
|