Explication du mode multicolor du processeur video EF9345 du VG5000µ


 

Voici le code pour réaliser ce sprite:
vous pouvez tester le code en le chargeant dans l'emulateur. Allez dans fichier et restaurer état.


Here is the code to achieve this sprite: You can test the code by loading it into the emulator. Go to file and restore state. 


https://www.dropbox.com/s/3a0gp0nbrouxvki/gost%20galaxion%20move.mrx?dl=0



0 SETET 65,"FFFFFFFFFF3F8FA3A82A"
1 SETET 66,"F7D7D14155D4D3D0D313"
2 SETET 67,"DFD747415517C707C7C4"
3 SETET 68,"FFFFFFFFFFFCF2CA2CA8"
4 SETET 69,"CAC0F3F3CFCFCFCFF3FF"
5 SETET 70,"830F3F3F3F3FCFFFFFFF"
6 SETET 71,"C2F0FCFCFCFCF3FFFFFF"
7 SETET 72,"A303CFCFF3F3F3F3CFFF"
8 SETET 73,"FFFFFFFFFFFFFFFFFFFF"
10 CLEAR 200:A=&"7000"
20 REM MACHINE CODE
21 P$="220E70211470CDEF022A0E70C9000000000000202100288121062882216728832113288400000000214122D8236626082725280000"
30 REM EXE BASIC
31 FORI=1TOLEN(P$)STEP2
32 POKEA,N:A=A+1
90 REM HEX TO DEC
91 N1=ASC(MID$(P$,I,1))-48
92 IF N1>9 THEN N1=N1-7
93 N2=ASC(MID$(P$,I+1,1))-48
94 IF N2>9 THEN N2=N2-7
95 N=16*N1+N2
96 NEXT I
98 FORX=0TO39:IFY>0ANDY<8THENY=8
99 CALL&"7000"
104 POKE&"702A",73:POKE&"7030",Y
105 POKE&"7032",X:NEXTX:Y=Y+1:IFY>31THENY=0
110 IFY<31THENGOTO 98
120 DIM A(20):DIM B(20):DIM C(20)
130 DATA 73,12,20,73,12,21,73,12,22,73,12,23
200 DATA 73,13,19,65,13,20,66,13,21,67,13,22,68,13,23,73,13,24
201 DATA 73,14,19,69,14,20,70,14,21,71,14,22,72,14,23,73,14,24
203 DATA 73,15,20,73,15,21,73,15,22,73,15,23
205 X=0:Y=0
210 FORI=1TO20:READ A(I),B(I),C(I)
230 POKE&"702A",A(I)
232 POKE&"7030",B(I)+Y
234 POKE&"7032",C(I)+X
235 CALL&"7000"
300 NEXTI
310 IFKEY(0)=7THENX=X+1
311 IFKEY(0)=8THENX=X-1
312 IFKEY(0)=9THENY=Y-1
313 IFKEY(0)=10THENY=Y+1
314 IFX<-19THENX=-19
315 IFX>16THENX=16
316 IFY<-5THENY=-5
317 IFY>14THENY=14
320 RESTORE
330 GOTO 210


Vg5000 explication : le code suivant dans le les guillemets est obligatoire pour injecter dans le circuit video le mode mlticolor: "2021002881210628822167288321132884"

ensuite vient le code qui peut être modifiable pour changer les couleurs la position du setet : "214122D823662608272528" le code 23 est celui qui ordonne au circuit video les couleurs a donner au setet, il est suivit de (66 en hexadécimal !) : les couleurs sont codées comme suit dans l'octet :0, noir, 1 rouge, 2 ver, 3 jaune, 4 bleu, 5 violet, 6 cyan, 7 blanc

ici le 66 hexadedimal signifie que les couleurs sont les suivantes :1 rouge, 2 vert, 5 violet, 6 cyan ce qui dans en binaire l'octet 01100110 (ne pas oblier que le bit zero est le noir !)

Il faut savoir que la couleur de fond est toujours le cyan 6"

Ensuite vient la position du setet avec le code 26 qui designe position y suivit de( 08 en hexadecimal ), apres nous avons le code 27 qui designe vous l'aurais surement deviné la position x suivit de sa position ( 25 en hexadecimal ! )

Voila vous savez l'essentiel sur le mode multicolor de l'EF9345



un autre exemple

Allez tout en bas à la page 77 du livre clefs pour VG5000 utilisez la routine situé en $00AD

il faut indiquer a cette routine combien d'octets on va y écrire.ici 4 octets.

par exemple pour dire au circuit video qu'il faut mettre les bords de l'écran en vert il faut appeler le circuit avec le nombre 20 apres on designe l'adresse de couleur de bordures avec le nombre 82 apres on execute avec 29, ensuite on met le nombre 2 qui est le vert.


voici ce que reçoit l'EF9345:    04,20,82,29,02

 

Et voila comment ça ce presente au finale :

10 CLEAR 200:A=&"7000"

20 REM MACHINE CODE

21 P$="000000211170CDAD00C30070000000000420822902000000000000000000000000000000000000000000000000"

30 REM EXE BASIC

31 FORI=1TOLEN(P$)STEP2

32 POKEA,N:A=A+1

90 REM HEX TO DEC

91 N1=ASC(MID$(P$,I,1))-48

92 IF N1>9 THEN N1=N1-7

93 N2=ASC(MID$(P$,I+1,1))-48

94 IF N2>9 THEN N2=N2-7

95 N=16*N1+N2

99 NEXT I:Y=8

102 CALL 28672

le 21 signifie en langage machine "charge H et l avec les deux octets qui suivent soit: 11 et 70 qui sont le debut de la routine a envoyer a l'EF9345 .

11 et 70 en decimal represente l'adresse 28689, Soit 17 octets plus loins apres P$" :

P$="000000211170CDAD00C30070000000000420822902000000000000000000000000000000000000000000000000" 

04 étant le debut de la routine de l'EF9345 !

ensuite il y a un CD qui veut dire appeler le programme situé dans les deuc octets suivant soit AD00.Tiens c'est notre routine pour communiquer avec l'EF9345 !





EF9345 explanation 


The following code in the quotation marks is mandatory to inject in the video circuit the mode mlticolor: "2021002881210628822167288321132884" 

Then comes the code that can be modified to change the colors the position of the setet: "214122D823662608272528" 

code 23 is the one that orders the video circuit the colors to give to the setet, it is followed by (66 in hexadecimal!): Colors Are coded as follows in the byte: 0, black, 1 red, 2 worm, 3 yellow, 4 blue, 5 violet, 6 cyan, 7 white Here the 66 hexadedimal means that the colors are as follows: 1 red, 2 green, 5 violet, 6 cyan which in binary byte 01100110 (do not oblige that the zero bit is black!) You should know that the background color is always cyan 6 "

 Then comes the position of the setet with the code 26 which designates position y followed by (08 in hexadecimal), after we have the code 27 which designates you surely guessed the position x followed by its position (25 in hexadecimal!) 

Here you know the essential on the multicolor mode of the EF9345 

another exemple


Go all the way down to page 77 of the key book for VG5000 use the routine located in $ 00AD It is necessary to indicate to this routine how many bytes one will write there. Here 04 bytes. For example to say to the video circuit that it is necessary to put the edges of the screen in green, it is necessary to call the circuit with the number 20 after we designate the color address of borders with the number 82 after we execute with 29, We put the number 2 which is the green. This is what the EF9345 receives: 04,20,82,29,02 And here is how this presents the final: 

10 CLEAR 200: A = & "7000" 

20 REM MACHINE CODE 21 P $ = "000000211170CDAD00C30070000000000420822902000000000000000000000000000000000000000000" 

30 REM EXE BASIC 

31 FORI = 1TOLEN (P $) STEP2 

32 POKEA, N: A = A + 1 

90 REM HEX TO DEC 

91 N1 = AUC (MID $ (P $, I, 1)) - 48

 92 IF N1> 9 THEN N1 = N1-7 

93 N2 = AUC (MID $ (P $, I + 1.1)) - 48

 94 IF N2> 9 THEN N2 = N2-7 

95 N = 16 * N1 + N2 

99 NEXT I: Y = 8

 102 CALL 28672

 The 21 means in machine language "load H and l with the two bytes that follow either: 11 and 70 which are the beginning of the routine to send to the EF9345. 11 and 70 in decimal represents address 28689, or 17 bytes farther after p$ : p$="000000211170CDAD00C30070000000000420822902000000000000000000000000000000000000000000" 04 being the beginning of the routine of the EF9345! Then there is a CD which means to call the program located in the next two bytes either AD00.Tiens it is our routine to communicate with the EF9345!

Another exemple

how to build 3 sprites...

.org 28672

nop

_debut:

ld a,65 ;number of setet

nop

ld hl,_setet65 ;load data for setet 65

call $001B ;build setet

ld a,66

nop

ld hl,_setet66

call $001B

ld a,67

nop

ld hl,_setet67

call $001B

_boucle:

ld a,20 ;first position y

ld (_cursory),a

ld a,18

ld (_cursorx),a ;firs poition x

ld a,65 ; first setet

ld (_numberofsetet),a

ld hl,_video1 ;location of code for ef9345

call $00AD

nop

nop

ld a,20

ld (_cursory),a

ld a,20

ld (_cursorx),a

ld a,67

ld (_numberofsetet),a

ld hl,_video1 ;location of code for ef9345

call $00AD

nop

nop

ld a,20

ld (_cursory),a

ld a,22

ld (_cursorx),a

ld a,66

ld (_numberofsetet),a

nop

ld hl,_video1 ;location of code for ef9345

call $00AD

jp _boucle

nop

nop

nop

_video1:

.db $1C,$21,$00,$28,$81,$21,$00,$28,$82,$21,$67,$28,$83,$21,$13,$28,$84,$21

_numberofsetet:

.db $41,$22,$D8,$23,$5A,$26

_cursory:

.db $00,$27

_cursorx:

.db $00,$28,$00

_setet65:

.db $ff,$00,$FF,$00,$FF,$00,$FF,$00,$FF,$00

_setet66:

.db $f0,$0F,$F0,$0F,$F0,$0F,$F0,$0F,$F0,$0F

_setet67:

.db $f1,$2F,$F3,$4F,$F5,$6F,$F7,$8F,$F9,$AF