Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.acorn.programmer > #5358 > unrolled thread
| Started by | xltardy@gmail.com |
|---|---|
| First post | 2018-01-11 03:05 -0800 |
| Last post | 2018-04-09 21:05 +0100 |
| Articles | 14 — 7 participants |
Back to article view | Back to comp.sys.acorn.programmer
Simple programming query xltardy@gmail.com - 2018-01-11 03:05 -0800
Re: Simple programming query Alan Adams <alan@adamshome.org.uk> - 2018-01-11 12:11 +0000
Re: Simple programming query xltardy@gmail.com - 2018-01-11 06:01 -0800
Re: Simple programming query jgh@mdfs.net - 2018-01-11 09:24 -0800
Re: Simple programming query xltardy@gmail.com - 2018-01-11 10:15 -0800
Re: Simple programming query Richard Ashbery <basura@invalid.addr.uk> - 2018-01-12 21:24 +0000
Re: Simple programming query Rick Murray <Rick@bogus.email.address> - 2018-01-13 11:16 +0100
Re: Simple programming query xltardy@gmail.com - 2018-03-01 23:09 -0800
Re: Simple programming query Rick Murray <Rick@bogus.email.address> - 2018-03-02 22:45 +0100
Re: Simple programming query xltardy@gmail.com - 2018-04-07 00:38 -0700
Re: Simple programming query David Feugey <dfeugey@riscos.fr> - 2018-04-07 13:50 +0200
Re: Simple programming query xltardy@gmail.com - 2018-04-09 11:40 -0700
Re: Simple programming query David Feugey <dfeugey@riscos.fr> - 2018-04-10 08:31 +0200
Re: Simple programming query druck <news@druck.org.uk> - 2018-04-09 21:05 +0100
| From | xltardy@gmail.com |
|---|---|
| Date | 2018-01-11 03:05 -0800 |
| Subject | Simple programming query |
| Message-ID | <42169e6d-3096-4930-8c88-e7b69efc9c2c@googlegroups.com> |
Hi all. In BBC BASIC, what is (are) the command(s) to output a filled rectangle with a colour in 256 colour mode 13. It is for a small utility I have just coded to give the number of colours in a picture. It runs ok, telling me for colour 0 to 255 there are X pixels displayed on screen, but I'd like to plot a small rectangle with each colour, next to the results.
[toc] | [next] | [standalone]
| From | Alan Adams <alan@adamshome.org.uk> |
|---|---|
| Date | 2018-01-11 12:11 +0000 |
| Message-ID | <f45bb6b856.Alan.Adams@ArmX6.adamshome.org.uk> |
| In reply to | #5358 |
I assume this is not a WIMP programme. If it is, it gets more
complicated.
GCOL will allow you to set the current graphics foreground and
background colours, then RECTANGLE FILL will draw a rectangle filled
with the graphics foreground colour.
HELP will give you the necessary details for each of these.
Alan
In message <42169e6d-3096-4930-8c88-e7b69efc9c2c@googlegroups.com>
xltardy@gmail.com wrote:
> Hi all.
> In BBC BASIC, what is (are) the command(s) to output a filled
> rectangle with a colour in 256 colour mode 13.
> It is for a small utility I have just coded to give the number of
> colours in a picture.
> It runs ok, telling me for colour 0 to 255 there are X pixels
> displayed on screen, but I'd like to plot a small rectangle with each
> colour, next to the results.
--
Alan Adams, from Northamptonshire
alan@adamshome.org.uk
http://www.nckc.org.uk/
[toc] | [prev] | [next] | [standalone]
| From | xltardy@gmail.com |
|---|---|
| Date | 2018-01-11 06:01 -0800 |
| Message-ID | <01bcfeec-1232-4ea3-a4ff-1b75ecf0b4fa@googlegroups.com> |
| In reply to | #5359 |
ok thanks. Yes it is a non WIMP BASIC programmer.
[toc] | [prev] | [next] | [standalone]
| From | jgh@mdfs.net |
|---|---|
| Date | 2018-01-11 09:24 -0800 |
| Message-ID | <9bcd3908-45b3-4aca-bdff-461a2903488f@googlegroups.com> |
| In reply to | #5359 |
xltardy wrote: > > In BBC BASIC, what is (are) the command(s) to output a filled > > rectangle with a colour in 256 colour mode 13. Alan Adams wrote: > GCOL will allow you to set the current graphics foreground and The OP mentioned a 256-colour screen modes, COLOUR/GCOL only allow you to select the top 6 bits of a colour number as bit 7 is used to select foreground or background (and bit 6 for other purposes on some platforms). In 256-colour screen modes you need: GCOL 0,colour_bits_7to2 >> 2 TINT colour_bits_1to0 << 6 ie, to select 8-bit colour %abcdefgh you use: GCOL 0,%00abcdef TINT %gh000000 for plot foreground colour and GCOL 0,%10abcdef TINT %gh000000 for plot background colour
[toc] | [prev] | [next] | [standalone]
| From | xltardy@gmail.com |
|---|---|
| Date | 2018-01-11 10:15 -0800 |
| Message-ID | <c7a1799e-efd3-4b58-9bac-8c3aa34b8327@googlegroups.com> |
| In reply to | #5361 |
Le jeudi 11 janvier 2018 18:24:40 UTC+1, j...@mdfs.net a écrit : > xltardy wrote: > > > In BBC BASIC, what is (are) the command(s) to output a filled > > > rectangle with a colour in 256 colour mode 13. > > Alan Adams wrote: > > GCOL will allow you to set the current graphics foreground and > > The OP mentioned a 256-colour screen modes, COLOUR/GCOL only allow > you to select the top 6 bits of a colour number as bit 7 is used > to select foreground or background (and bit 6 for other purposes > on some platforms). In 256-colour screen modes you need: > > GCOL 0,colour_bits_7to2 >> 2 TINT colour_bits_1to0 << 6 > > ie, to select 8-bit colour %abcdefgh you use: > > GCOL 0,%00abcdef TINT %gh000000 for plot foreground colour and > GCOL 0,%10abcdef TINT %gh000000 for plot background colour Thanks. I will try to use that tonight. I should have said my machine is a BBCA3000 with RISC OS 3.11. (old VIDC with its not freely selectable 256 colour screen modes).
[toc] | [prev] | [next] | [standalone]
| From | Richard Ashbery <basura@invalid.addr.uk> |
|---|---|
| Date | 2018-01-12 21:24 +0000 |
| Message-ID | <56b96cd21fbasura@invalid.addr.uk> |
| In reply to | #5362 |
In article <c7a1799e-efd3-4b58-9bac-8c3aa34b8327@googlegroups.com>, <xltardy@gmail.com> wrote: > Le jeudi 11 janvier 2018 18:24:40 UTC+1, j...@mdfs.net a écrit : > > xltardy wrote: > > > > In BBC BASIC, what is (are) the command(s) to output a filled > > > > rectangle with a colour in 256 colour mode 13. > > [snip] > > > > GCOL 0,%00abcdef TINT %gh000000 for plot foreground colour and > > GCOL 0,%10abcdef TINT %gh000000 for plot background colour > Thanks. > I will try to use that tonight. > I should have said my machine is a BBCA3000 with RISC OS 3.11. > (old VIDC with its not freely selectable 256 colour screen modes). My understanding of the VIDC system colour system is that you only have a total of 64 colours but their shade can be altered with the TINT keyword. This gives 256 possible colour variations (64 different colours multiplied by 4 shades). Although the TINT keyword can handle 256 variations it only has 4 distinct levels..... (0-64,64-128,128-192,192-255). So a TINT range of 0-63 for example only gives a single effective TINT level (no additional brightness). You can see this action with a simple example... MODE 13 PRINT "Press any key to new display tint value" FOR x = 0 TO 128 GCOL 0,3 TINT x RECTANGLE FILL 200,200,100 g = GET PRINT TAB(0,30)"Tint value = ";x NEXT TINT transitions are at 63(64-1) and 127(128-1). jgh@mdfs.net examples show the binary equivalent - this is useful because it shows the bits that need setting for GCOL - bit 7 sets foreground/background colour (0 for foreground, 1 for background). The TINT statement requires bits 6 and 7 to be set to 00 (0-64),01 (64-128),10 (128-192) and 11 (192-255). Richard
[toc] | [prev] | [next] | [standalone]
| From | Rick Murray <Rick@bogus.email.address> |
|---|---|
| Date | 2018-01-13 11:16 +0100 |
| Message-ID | <56b9b38ce5Rick@bogus.email.address> |
| In reply to | #5363 |
In article <56b96cd21fbasura@invalid.addr.uk>, Richard Ashbery <basura@invalid.addr.uk> wrote: > TINT keyword. This gives 256 possible colour variations (64 different > colours multiplied by 4 shades). Although the TINT keyword can handle > 256 variations it only has 4 distinct levels..... You can see this semi-visually by looking at the default Paint palette for a 256 colour sprite, where the colours are displayed in groups of four (tints). Boring code of how it works here: https://www.riscosopen.org/viewer/view/~checkout~/castle/RiscOS/Sources/Apps/Paint/c/Colours?rev=4.8 -- ___ /__/ o __ /_ / \ / /__ / \ (heyrick one nine seven three at yahoo dot co dot uk)
[toc] | [prev] | [next] | [standalone]
| From | xltardy@gmail.com |
|---|---|
| Date | 2018-03-01 23:09 -0800 |
| Message-ID | <15b3f5f9-89fa-4b34-b9a2-8a7120fd2013@googlegroups.com> |
| In reply to | #5365 |
Thanks to all of you. I eventually coded it in assembly. https://youtu.be/9ygUSkFXbYQ?t=4m20s From your various explanations, I think I will never understand why some say there are 64 colours, when anyway the VIDC has only 16 truely selectable colours among 4096 ...
[toc] | [prev] | [next] | [standalone]
| From | Rick Murray <Rick@bogus.email.address> |
|---|---|
| Date | 2018-03-02 22:45 +0100 |
| Message-ID | <56d2aabbb0Rick@bogus.email.address> |
| In reply to | #5427 |
In article <15b3f5f9-89fa-4b34-b9a2-8a7120fd2013@googlegroups.com>, <xltardy@gmail.com> wrote: > From your various explanations, I think I will never understand why some > say there are 64 colours, when anyway the VIDC has only 16 truely > selectable colours among 4096 ... Huh? Palette is 256 colours. They are in groups of four (four tints to a colour). 256 ÷ 4 = 64. Where did you get the 16 from? -- ___ /__/ o __ /_ / \ / /__ / \ (heyrick one nine seven three at yahoo dot co dot uk)
[toc] | [prev] | [next] | [standalone]
| From | xltardy@gmail.com |
|---|---|
| Date | 2018-04-07 00:38 -0700 |
| Message-ID | <00be9224-9faa-44ce-a7ce-0ff5a2dc1629@googlegroups.com> |
| In reply to | #5428 |
Le vendredi 2 mars 2018 22:45:28 UTC+1, Rick Murray a écrit : > In article <15b3f5f9-89fa-4b34-b9a2-8a7120fd2013@googlegroups.com>, > <@gmail.com> wrote: > > > From your various explanations, I think I will never understand why some > > say there are 64 colours, when anyway the VIDC has only 16 truely > > selectable colours among 4096 ... > > Huh? > > Palette is 256 colours. They are in groups of four (four tints to a > colour). 256 ÷ 4 = 64. > > Where did you get the 16 from? > > -- > ___ > /__/ o __ /_ > / \ / /__ / \ (heyrick one nine seven three at yahoo dot co dot uk) Simply from the VLSI ARM datasheet. Clearly the palette selection has only 16 entries, thus only 16 colours are freely selectable, all other colours come from this free choice of 16 colours.
[toc] | [prev] | [next] | [standalone]
| From | David Feugey <dfeugey@riscos.fr> |
|---|---|
| Date | 2018-04-07 13:50 +0200 |
| Message-ID | <e857fee456.riscosfr@dfeugey.riscos.fr> |
| In reply to | #5444 |
In message <00be9224-9faa-44ce-a7ce-0ff5a2dc1629@googlegroups.com>
xltardy@gmail.com wrote:
> Le vendredi 2 mars 2018 22:45:28 UTC+1, Rick Murray a écrit :
>> In article <15b3f5f9-89fa-4b34-b9a2-8a7120fd2013@googlegroups.com>,
>> <@gmail.com> wrote:
>>
>>> From your various explanations, I think I will never understand why some
>>> say there are 64 colours, when anyway the VIDC has only 16 truely
>>> selectable colours among 4096 ...
>>
>> Huh?
>>
>> Palette is 256 colours. They are in groups of four (four tints to a
>> colour). 256 ÷ 4 = 64.
>>
>> Where did you get the 16 from?
>>
>> --
>> ___
>> /__/ o __ /_
>> / \ / /__ / \ (heyrick one nine seven three at yahoo dot co dot uk)
> Simply from the VLSI ARM datasheet.
> Clearly the palette selection has only 16 entries, thus only 16
> colours are freely selectable, all other colours come from this free
> choice of 16 colours.
That's right. You have 256 colours, but based on a palette where you
fix only 16 significative ones. So it's true to say that only 16
colours are freely selectable. But you'll get a gradiant of 256 real &
different colours.
"the VIDC1a had 16 hardware palette registers. This meant that in
screen modes with sixteen colours or fewer, the colours could be
mapped to any of the 4096 available. However, in 256 colour modes, 4
bits of the colour data were hardware derived and could not be
adjusted. The net result was 256 colours, but only 16 of them could be
assigned as desired, covering a range of the 4096 available colours."
https://en.wikipedia.org/wiki/Acorn_Archimedes
On the other hand, VIDC1 is really old technology :)
Bye, David
--
RISC OS FR - www.riscos.fr
Informations sur RISC OS et sa communauté
Licences ABC et Raspberry Pi gratuits !
[toc] | [prev] | [next] | [standalone]
| From | xltardy@gmail.com |
|---|---|
| Date | 2018-04-09 11:40 -0700 |
| Message-ID | <16dbb854-2db2-4cbc-a359-727862d5d508@googlegroups.com> |
| In reply to | #5445 |
Le samedi 7 avril 2018 14:03:46 UTC+2, David Feugey a écrit : > In message <00be9224-9faa-44ce-a7ce-0ff5a2dc1629@googlegroups.com> > @gmail.com wrote: > > > Le vendredi 2 mars 2018 22:45:28 UTC+1, Rick Murray a écrit : > >> In article <15b3f5f9-89fa-4b34-b9a2-8a7120fd2013@googlegroups.com>, > >> <@gmail.com> wrote: > >> > >>> From your various explanations, I think I will never understand why some > >>> say there are 64 colours, when anyway the VIDC has only 16 truely > >>> selectable colours among 4096 ... > >> > >> Huh? > >> > >> Palette is 256 colours. They are in groups of four (four tints to a > >> colour). 256 ÷ 4 = 64. > >> > >> Where did you get the 16 from? > >> > >> -- > >> ___ > >> /__/ o __ /_ > >> / \ / /__ / \ (heyrick one nine seven three at yahoo dot co dot uk) > > > > Simply from the VLSI ARM datasheet. > > Clearly the palette selection has only 16 entries, thus only 16 > > colours are freely selectable, all other colours come from this free > > choice of 16 colours. > > That's right. You have 256 colours, but based on a palette where you > fix only 16 significative ones. So it's true to say that only 16 > colours are freely selectable. But you'll get a gradiant of 256 real & > different colours. > > "the VIDC1a had 16 hardware palette registers. This meant that in > screen modes with sixteen colours or fewer, the colours could be > mapped to any of the 4096 available. However, in 256 colour modes, 4 > bits of the colour data were hardware derived and could not be > adjusted. The net result was 256 colours, but only 16 of them could be > assigned as desired, covering a range of the 4096 available colours." > > https://en.wikipedia.org/wiki/Acorn_Archimedes > > On the other hand, VIDC1 is really old technology :) > > Bye, David > -- > RISC OS FR - www.riscos.fr > Informations sur RISC OS et sa communauté > Licences ABC et Raspberry Pi gratuits ! So why is that this 64 colours spring in almost all explanations ? That's not the 1st time I read that (and each time I wonder).
[toc] | [prev] | [next] | [standalone]
| From | David Feugey <dfeugey@riscos.fr> |
|---|---|
| Date | 2018-04-10 08:31 +0200 |
| Message-ID | <5aa86ce656.riscosfr@dfeugey.riscos.fr> |
| In reply to | #5446 |
In message <16dbb854-2db2-4cbc-a359-727862d5d508@googlegroups.com>
xltardy@gmail.com wrote:
> So why is that this 64 colours spring in almost all explanations ?
> That's not the 1st time I read that (and each time I wonder).
No idea :)
--
RISC OS FR - www.riscos.fr
Informations sur RISC OS et sa communauté
Licences ABC et Raspberry Pi gratuits !
[toc] | [prev] | [next] | [standalone]
| From | druck <news@druck.org.uk> |
|---|---|
| Date | 2018-04-09 21:05 +0100 |
| Message-ID | <pagh2i$3bd$1@dont-email.me> |
| In reply to | #5445 |
On 07/04/2018 12:50, David Feugey wrote: > That's right. You have 256 colours, but based on a palette where you > fix only 16 significative ones. So it's true to say that only 16 > colours are freely selectable. But you'll get a gradiant of 256 real & > different colours. > > "the VIDC1a had 16 hardware palette registers. This meant that in > screen modes with sixteen colours or fewer, the colours could be > mapped to any of the 4096 available. However, in 256 colour modes, 4 > bits of the colour data were hardware derived and could not be > adjusted. The net result was 256 colours, but only 16 of them could be > assigned as desired, covering a range of the 4096 available colours." > > https://en.wikipedia.org/wiki/Acorn_Archimedes That's not really a good description. Although the 16 pallet entries are used in 256 colour modes, they affect the bottom 4 bits of all colours in a completely un-useful way. The only sensible action is to accept the default palette of 64 base colours (4x4x4 RGB) with 16 tint (white levels) variations. > On the other hand, VIDC1 is really old technology The VIDC20's (and later) true 256 colour modes with 256 palette entries, is far more useful, you can do some great effects. ---druck
[toc] | [prev] | [standalone]
Back to top | Article view | comp.sys.acorn.programmer
csiph-web