BASIC 128 Point Command
Modérateurs : Papy.G, fneck, Carl
- jonesypeter
- Messages : 33
- Inscription : 08 mai 2021 15:33
- Localisation : West Sussex, Great Britain
BASIC 128 Point Command
Greetings,
Please could I ask for some help with the Point command. I have translated the French from the BASIC 128 manual and the translation I get is making sense to me:
the number is positive if the point belongs to the shape, negative if it belongs to the bottom:
In summary, I'm trying to get the Ink or Paper colour at a specific location for simple collision detection in BASIC. I'm assuming there is not a reverse of the COLOR command which tells us the attributes at that character position.
Thanks
Peter
Salutations,
Je voudrais vous demander de l'aide concernant la commande Point. J'ai traduit le français du manuel BASIC 128 et la traduction que j'obtiens me semble logique :
le nombre est positif si le point appartient à la forme, négatif s'il appartient au fond :
En résumé, j'essaie d'obtenir la couleur de l'encre ou du papier à un endroit spécifique pour une simple détection de collision en BASIC. Je suppose qu'il n'existe pas d'inverse de la commande COLOR qui nous indique les attributs à cette position de caractère.
Merci
Peter
Please could I ask for some help with the Point command. I have translated the French from the BASIC 128 manual and the translation I get is making sense to me:
the number is positive if the point belongs to the shape, negative if it belongs to the bottom:
In summary, I'm trying to get the Ink or Paper colour at a specific location for simple collision detection in BASIC. I'm assuming there is not a reverse of the COLOR command which tells us the attributes at that character position.
Thanks
Peter
Salutations,
Je voudrais vous demander de l'aide concernant la commande Point. J'ai traduit le français du manuel BASIC 128 et la traduction que j'obtiens me semble logique :
le nombre est positif si le point appartient à la forme, négatif s'il appartient au fond :
En résumé, j'essaie d'obtenir la couleur de l'encre ou du papier à un endroit spécifique pour une simple détection de collision en BASIC. Je suppose qu'il n'existe pas d'inverse de la commande COLOR qui nous indique les attributs à cette position de caractère.
Merci
Peter
Re: BASIC 128 Point Command
Hi,
not an expert of this programming language. But it would seem like there is a notion of foreground and background.
A location where a color had been specified would return that color value (positive). On the other case, it would return a negative value (the color, but negated?).
Regards,
Olivier
not an expert of this programming language. But it would seem like there is a notion of foreground and background.
A location where a color had been specified would return that color value (positive). On the other case, it would return a negative value (the color, but negated?).
Regards,
Olivier
- jonesypeter
- Messages : 33
- Inscription : 08 mai 2021 15:33
- Localisation : West Sussex, Great Britain
Re: BASIC 128 Point Command
Thanks Oliver. That make sense as the Color command sets the border, foreground and ink colours.
Re: BASIC 128 Point Command
This would make it possible to create invisible areas to detect collision. An area drawn with the same color as background.
Re: BASIC 128 Point Command
Les couleurs de forme et de fond ne sont pas définies pour un caractère. Elles peuvent être différentes à l'intérieur d'un bloc de 8x8 pixels.
Elles sont définies pour un segment de 8 pixels, par un octet de la mémoire vidéo couleur (4 bits pour le fond et 4 bits pour la forme).
Pour les obtenir il faut sélectionner la mémoire vidéo couleur et lire l'octet.
La méthode de sélection, l'adresse en mémoire et la structure de l'octet couleur sont différentes entre les TO et les MO.
Elles sont définies pour un segment de 8 pixels, par un octet de la mémoire vidéo couleur (4 bits pour le fond et 4 bits pour la forme).
Pour les obtenir il faut sélectionner la mémoire vidéo couleur et lire l'octet.
La méthode de sélection, l'adresse en mémoire et la structure de l'octet couleur sont différentes entre les TO et les MO.
Daniel
L'obstacle augmente mon ardeur.
L'obstacle augmente mon ardeur.
- jonesypeter
- Messages : 33
- Inscription : 08 mai 2021 15:33
- Localisation : West Sussex, Great Britain
Re: BASIC 128 Point Command
Hi Daniel,
Thanks for the reply. So I have written a very simple piece of code:
So if I understand correctly 0 would relate to black Ink, -1 would relate to black paper, which is why the numbers run from -16 to -1.
Thanks
Peter
PS - Daniel - Would you prefer me to type my posts in English, or translated French? Thank you.
Thanks for the reply. So I have written a very simple piece of code:
Code : Tout sélectionner
5 cls
10 for a=0 to 15
20 color a,15-a
30 print "*";
40 next a
50 for x=0 to 127 step 8
55 print
60 print point(x,0);" ";
70 next x
Thanks
Peter
PS - Daniel - Would you prefer me to type my posts in English, or translated French? Thank you.
Re: BASIC 128 Point Command
0 -> 0000 -> not 0 -> 1...1_1111 -> -1
...
15 -> 1111 -> not 1111 -> 1...1_0000 -> -16
It sounds more like a one's complement (NOT) than a two's complement (NEG) in practice.
...
15 -> 1111 -> not 1111 -> 1...1_0000 -> -16
It sounds more like a one's complement (NOT) than a two's complement (NEG) in practice.
- jonesypeter
- Messages : 33
- Inscription : 08 mai 2021 15:33
- Localisation : West Sussex, Great Britain
Re: BASIC 128 Point Command
Thank you for all the help. I'm very impressed with the increased colour range of the TO70/70. The vast majority of other 8-bit computers of the time only offered 4 colours at 320 x 200. If you wanted more colours you often have to deal with a lower resolution (like with the Amstrad CPC). My beloved ZX Spectrum offered 7 colours (+bright versions) + black, but with the limitations of one ink and one paper per 8x8 pixels.
Having used a number of 8-bit computers the BASIC is very easy to pick up. Next stop - User defined characters.
I plan to convert some BASIC ZX Spectrum Type-In Games.
Having used a number of 8-bit computers the BASIC is very easy to pick up. Next stop - User defined characters.
I plan to convert some BASIC ZX Spectrum Type-In Games.
Code : Tout sélectionner
5 screen 6,6,6:cls
10 dim a$(16)
20 let a$(1)=" 0 - Black":let a$(2)=" 1 - Red":let a$(3)=" 2 - Green":let a$(4)=" 3 - Yellow":let a$(5)=" 4 - Blue":let a$(6)=" 5 - Magenta":let a$(7)=" 6 - Cyan":let a$(8)=" 7 - White":let a$(9)=" 8 - Grey":let a$(10)=" 9 - Light Red":let a$(11)=" 10 - Light Green"
25 let a$(12)=" 11 - Pale Yellow":let a$(13)=" 12 - Pale Blue":let a$(14)=" 13 - Pale Magenta":let a$(15)=" 14 - Light Cyan":let a$(16)=" 15 - Orange"
30 for a=0 to 15
50 color a,a:print " ";:color 0,6:print a$(a+1)
60 next a
-
- Messages : 7964
- Inscription : 18 sept. 2010 12:08
- Localisation : Brest et parfois les Flandres
Re: BASIC 128 Point Command
And you haven’t seen yet the palette of 16 colors out of 4096 one can get on mo6, to8, to9 and to9+.
@hlide you are right this is a bitwise complement operation. Negative numbers represent background colors and conversely, positive values represent fourground color. Hence 0 is a black foreground whereas -1 is returned by the black background, and of course 0=NOT -1 (bitwise).
@hlide you are right this is a bitwise complement operation. Negative numbers represent background colors and conversely, positive values represent fourground color. Hence 0 is a black foreground whereas -1 is returned by the black background, and of course 0=NOT -1 (bitwise).
Samuel.
A500 Vampire V2+ ^8^, A1200 (030@50mhz/fpu/64mb/cf 8go),
A500 GVP530(MMU/FPU) h.s., R-Pi, TO9, TO8D, TO8.Démos
A500 Vampire V2+ ^8^, A1200 (030@50mhz/fpu/64mb/cf 8go),
A500 GVP530(MMU/FPU) h.s., R-Pi, TO9, TO8D, TO8.Démos