VG5000 video:
HARDWARE
Inside the VG5000:
VG5000 has an SGS-Thomson EF9345 video processor built in, along
with 8 KB RAM (SRAM D4168C - 200ns)
The 9345 is a semi-graphic and screen controller microprocessor.
It is optimized to be displayed on a BW/Color TV set (64ms by line), usable
in 50 or 60Hz.
Interface among EF9343 video porcessor and the RAM
Notice that the interface is multiplexed, so you might change the
8 KB RAM with a 16 KB one.
EF9345 pinout
1-Ground |
20-+5V power supply |
2-RAM reading |
21-Data bit 3 |
3-RAM wtriting |
22-Data bit 4 |
4-Data or adress on the ADM0-ADM7 bus ? |
23-Data bit 5 |
5-Synchro output (screen) to TV |
24-Data bit 6 |
6-Synchro output (line) to TV |
25-Data bit 7 |
7-Blue output |
26-Circuit validation |
8-Green output |
27-Bit 13 |
9-Red output |
28-Bit 12 |
10-Inlaying output |
29-Bit 11 |
11-Clock input (12 mHz) |
30-Bit 10 |
12-Clock output (4 mHz) |
31-Bit 9 |
13-Synchro input |
32-Bit 8 |
14-Address on data bus |
33-Bit 7 |
15-Data output |
34-Bit 6 |
16-Data input |
35-Bit 5 |
17-Data bit 0 |
36-Bit 4 |
18-Data bit 1 |
37-Bit 3 |
19-Data bit 2 |
38-Bit 2 |
|
39-Bit 1 |
|
40-Bit 0 |
in Red: High weight bits (address bus)
en bleu: Low wight bits (address bus multiplexed with Z80
data)
Connectors:
DIN video connector pinout
Pin # |
Description |
1 |
Fast command |
2 |
Ground |
3 |
Blue |
4 |
Synchro |
5 |
Red |
6 |
Slow command |
7 |
Sound |
8 |
Green |
SCART video connector pinout
N° de broche |
Description |
1 |
Audio right output |
2 |
Audio right input |
3 |
Audio left output |
4 |
Audio common ground |
5 |
Blue ground |
6 |
Audio left input |
7 |
Blue input |
8 |
slow command input |
9 |
Green ground |
10 |
Clock |
11 |
Green input |
12 |
Remote command |
13 |
Red ground |
14 |
Remote command ground |
15 |
Red input |
16 |
Fast command input |
17 |
Video ground |
18 |
fast command ground |
19 |
Video output |
20 |
Video input |
21 |
Cable |
How to build your own cable:
VG5000 |
|
SCART TV |
7 |
Sound |
|
2 |
Audio right input |
7 |
Sound |
|
6 |
Audio left input |
2 |
Ground |
|
4 |
Audio ground |
4 |
Synchro |
|
20 |
Video input |
1 |
Fast command |
|
16 |
Fast command |
6 |
Slow command |
|
8 |
Slow command |
3 |
Blue |
|
7 |
Blue input |
8 |
Green |
|
11 |
Green input |
5 |
Red |
|
15 |
Red input |
2 |
Ground |
|
17 |
Video ground |
For those who don't have a SCARTed TV set, thee is the VU-0011,
RVB to SECAM UHF converter.
With the VU0011, you can connect your VG5000 to a Computer tuner
card (to save videos and screenshots).
SOFTWARE
EF9345 processor organization
Z80 communicates with EF9345 through an 8 bit multiplexed bus and
through the inut-output $8F and $CF ports.
The video processor has its own internal registers so that it can manage all
the display parameters.
The user can access the EF9345 through Basic functions, or direct access functions
(without using the video buffer). He can also use all EF9345 direct access functions,
using all the EF9345 modes (VG5000 only uses the 16 bits per character mode).
Within BASIC
Display:
You can display 40 columns and 25 lines, but you could use 80 columns
within machine language functions.
A l'écran s'affichent 40 x 25 soit 1000 caractères
ou 80 000 pixels. En équivalent bitmap cela donne (40 x 8) par (25 x
10), soit 320 x 250.
Characters:
- 110 ASCII text characters
- 128 Graphics characters
- 192 User characters
In 40 columns mode, a character is 8 pixels wide and 10 pixels
tall, i.e. 80 pixels per character.
The fig. 2 matrix can be used to code your own characters in
hexadecimal.
Example : the coding of the 5 th line is: 67 (4+2 = 6
and 4+2+1 = 7)
Within basic, two commands are available to redefine your characters:
SETEG and SETET.
Matrice des caractères en mode texte Matrice des caractères en mode graphique Génération des codes SETET ou SETEG Basic Instructions and Operators
CURSORX A |
Sets the cursor to the A column. |
CURSORY A |
Sets the cursor to the A line. |
DELIM A,B,C |
Highlight a message by changing the delimiter color (A parameter),
the background color (B parameter) and to underline this message (C parameter).
A and B parameters are set according to the color code table, C should
be odd to underline, and even if you don't want to underline the text.
Ex: type in the following program:
10 INIT 6,6
20 DELIM 1,2,0
30 PRINT "Hello to everybody";
40 DELIM 3,6,0
Type "RUN" and you will see a red rectangle, followed by "Hello
to everybody" on green background, and then a yellow rectangle.
|
DISPLAY A |
Modifies the display speed of characters. A parameter must be between
0 and 255. Default delay between 2 characters display is 20*A milliseconds.
The parameter is optionnal. default value is 20.
Ex: type in the following program
10 A$="TEST OF THE DISPLAY COMMAND"
20 FORI=ITOLEN(A$)
30 PRINT MID$(A$,1,1);
40 SOUND 200,1
50 DISPLAY
60 NEXT I
Run the program, then suppress the 50 line. You'll see the DISPLAY behaviour. |
EG A,B,C |
Initialises the special graphic mode (User defined characters).
A parameter gives the ink color, B parameter the background color. See
the color table below.
C parameter defines the blinking state (0 = not blinking, 1 = blinking).
Ex: type in the following program
10 CURSORX 10 : CURSORY 10
20 EG 3,4,1
This programes defines the zone beginning at (10x10) to be a user graphic
zone, blinking, yellow on blue... |
ET A,B,C |
Initialises the special text mode.
A parameter gives the color of the text.
B parameter sets the text attribute (see the characters attributes below),
C parameter sets the blinking state (0 = not blinking, 1 = blinking) |
GR A,B,C |
Initialises the VG5000 semi-graphic mode.
A, B and C parameters have the same characteristics as in EG. |
INIT A,B |
Clears the screen and chnges the background color (A parameter) and the
boder color (B parameter).
|
LPOS (A) |
Returns the column of the last character printed (on the printer). |
LPRINT |
Prints a text or a variable on the printer. |
PAGE |
Freezes the scrolling of the scrren. |
POS (A) |
Returns the column of the last character displayed (on the screen). |
PRINT |
Prints a text or a variable on the screen. |
SCREEN |
Displays an image made after a STORE command. |
SCROLL |
Re-enables the scrolling of the screen after a PAGE command. |
SETEG A,"BBCCDDEEFFGGHHIIKK" |
Defines a special user graphic character. A parameter sets the charcter
code (between 32 and 127), and double-quoted parameter defines the new
character matrix, each line given by 2 hexadecimal characters.
Ex: A character matrix
00000000 soit 00 en hexadécimal
00111000 soit 38 en hexadécimal
01000100 soit 44 en hexadécimal
01000100 soit 44 en hexadécimal
01000100 soit 44 en hexadécimal
01111100 soit 7C en hexadécimal
01000100 soit 44 en hexadécimal
01000100 soit 44 en hexadécimal
00000000 soit 00 en hexadécimal
00000000 soit 00 en hexadécimal
You can define A character by:
SETEG 65, "00384444447C44440000". |
SETET A,"BBCCDDEEFFGGHHIIJJKK" |
Same command as SETEG, but deines special user text character. |
SPC (A) |
Prints A space(s) at cursor current position. A must be between 0 and
255. |
STORE |
This command enables the user to draw complex graphics without displaying
them on screen. So, the user doesn't see it construct piece by piece.
Once the image is finished, display it with the SCREEN command.
Nota : DISPLAY, END, STOP, a screen scroll, a syntax error,display the
image.
Ex: rewrite the program for the DISPLAY example, suppress the 50 line,
and add the following lines:
50 STORE
70 SCREEN
Rem: the 70 line is optionnal, because the programs ends after it (=END). |
TAB (A) |
Prints tabulations on screen or printer. A parameter must be between 1
and 39. |
TX A,B,C |
Initialises the normal text mode.A, B and C parameters are defined like
in ET. |
CSAVES "xxxx" |
Saves the screen on tape. |
Color codes:
0
black |
1 red |
2 green |
3 yellow |
4
blue |
5 magenta |
6 cyan |
7 white |
|
|
Character attributes:
0 |
normal |
1 |
double height |
2 |
double width |
3 |
double height and double width |
4 |
video inversion |
5 |
video inversion and double height |
6 |
video inversion and double width |
7 |
video inversion, double height and double width |
Some examples:
TX 0,0 |
TX0,2 |
TX0,1 |
TX0,3 |
TX0,5 |
Here are some tricks you can use via Basic POKE command:
SWITCH BETWEEN UPPERCASE AND LOWERCASE LETTERS WITHIN BASIC
Uppercase: POKE &"47FE",1
Lowercase: POKE &"47FE",O
CHANGE THE BACKGROUND COLOR, AND THE SHAPE OF THE CURSOR
The $47FD Byte handles these 2 functions: lower 4 bits sets the
color, higher 4 bits sets the shape..
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
unused |
unused |
blinking |
shape |
color |
color |
color |
color |
bit 4: 0 = square, 1 = line
bit 5: 0 = not blinking, 1 = blinking
Examples :
red blinking square |
=> 1+32 = 33 |
POKE &"47FD",33 |
green line |
=> 2 + 16 = 18 |
POKE &"47FD",18 |
yellow square |
=> 3 |
POKE &"47FD",3 |
blue blinking line |
=> 4 + 16 + 32 = 52 |
POKE &"47FD",52 |
RESTORE THE CURSOR CURRENT POSITION
If you want to restore the cursor current position ( e.g. after
an error):
POKE &"47FD,PEEK(&"47FD") AND 191 : POKE &"4871",
PEEK(&"4871") AND 64
MACHINE LANGUAGE
System addresses
Screen memory: $4000 to $4700 ( from 16384 to 18384)
Screen variables:
47FA |
Screen refresh interruption meter |
47FB |
Flag indicating whether the screen should be refreshed or not |
47FC |
Reference value for the interruption meter. |
47FD |
Colour and shape of the cursor |
47FE |
uppercase/lowercase switch flag |
4802 |
Next character attributes and color:
Bits 0 to 2 |
ink color |
Bit 3 |
blinking |
Bit 4 |
double width (text mode) |
Bit 5 |
double height (text mode) |
Bits 4 to 6 |
background color (graphic mode) |
Bit 7 |
0 = text / 1 = graphic |
|
4803 |
INIT color attributes:
Bits 0 to 2 |
column 0 ink color |
Bit 3 |
= 0 |
Bits 4 to 6 |
background color |
Bit 7 |
= 1 |
|
4804 |
Character redefinition flag :
Bits 0 to 6 |
= 0 |
Bit 7 |
0 = normal / 1 = redifined |
|
4805 |
Cursor column |
4806 |
Cursor line |
Display handling routines:
$0092 |
Prints a 16 bits character on the screen, without using the video buffer
handled by the Z80. Character position is set in HL, H sets the line: 0
-> line 0, 8-31 -> liges 1-24, and L sets the colmumn : 0-39 ->
columns 0-39.
D sets the character code, and E sets its attribute. BC and AF registers
are altered. |
$0095 |
Prints a 16 bits character on the screen, without using the video buffer
handled by the Z80. The character is printed at the cursor current position.
D sets the character code, and E sets its attribute. BC and AF registers
are altered. |
$0098 |
Reads a 16 bits character directly in the screen memory, at position defined
by HL (codage like $0092). Character code is retrieved in D, attribute in
E. AF, BC and DE registers are altered. |
$009B |
Reads a 16 bits character directly in the screen memory, at cursor current
position. Character code is retrieved in D, attribute in E. AF, BC and DE
registers are altered. |
$009E |
Clears the screen and resets the background color defines in $4803, and
ink color defined in $4802. All registers are altered. |
$00A1 |
Clears a line and resets the background and ink colors (idem $009E). A
must be set to the line number to erase. All registers are altered. |
$00A4 |
Stops the execution of the program, until the video circuit is ready for
data transfer. AF register is altered |
$00A7 |
Calculates the physical address of a screen position, giving a column
and a line numbers. H must be the line and L the column. The address is
retrievd in HL. All registers are altered. |
$00AD |
Loads the EF9345 registers in a table whose address is given by HL. The
first Byte in the table is the length of the table. Registers are coded
with 2 Bytes each, first Byte is the selection address of the register,
the second one is the data itself. AF, BC and HL registers are altered. |
Commercial applications:
Salut L'artiste from Nice Ideas, enables drawing in 320x250
(8 colors). Using this software is not as easy as using a true bitmap mode software,
but the results are rather good.
Games:
Here are some games screenshots:
|