Author Topic: How do you print a single colored line with no characters?  (Read 510 times)

0 Members and 1 Guest are viewing this topic.

Offline feax

  • CPC464
  • **
  • Posts: 8
  • Country: gr
  • Liked: 1
  • Likes Given: 4
I have written this code

Code: [Select]
50 'colines4 colored lines v.1.4
100 BORDER 2
110 MODE 1
200 FOR n=0 TO 3
300 PAPER n
350 PRINT "paper";n
400 FOR t=0 TO 600 'timer
500 NEXT t
600 NEXT n
700 GOTO 200

At first it prints colored lines that are smaller than screen width.

I want to set the background to black color and
then print width size colored line with no characters inside.

#graphics, #basic,#locomotive
« Last Edit: 23:52, 26 August 20 by feax »

Offline angelcaio

  • CPC664
  • ***
  • Posts: 132
  • Country: es
  • AMSTRAD CPC-464
  • Liked: 51
  • Likes Given: 45
You can try changing the 350 line to:
    350 PRINT "paper";n;:PAPER 0:PRINT SPC(32)
in this way the leftover spaces are overwritten with paper 0

Offline goksteroo

  • CPC464
  • **
  • Posts: 10
  • Country: au
  • Liked: 25
  • Likes Given: 1
or... 350 PRINT "paper";n;SPC(32)

Offline feax

  • CPC464
  • **
  • Posts: 8
  • Country: gr
  • Liked: 1
  • Likes Given: 4
    350 PRINT "paper";n;:PAPER 0:PRINT SPC(32)

This one prints text with selected color background and
the leftover chars of the line are default paper 0 ink.

« Last Edit: 13:57, 27 August 20 by feax »

Offline feax

  • CPC464
  • **
  • Posts: 8
  • Country: gr
  • Liked: 1
  • Likes Given: 4
or... 350 PRINT "paper";n;SPC(32)

This one prints text with selected background and
left over chars with selected background.
Each line has the same backround color that I am looking for.
One line blue,  one line yellow, etc and the pattern goes on.

But the first 25 lines are printed like a loading bar not as a block.
After line 25 the lines are printed like a block.
Can I make it look like that it prints the whole line in one movement
and not incremental?

Is there a way to pre-calculate the string I want to print
like str$=str1$+str2$:print str$
« Last Edit: 14:02, 27 August 20 by feax »

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.901
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1113
  • Likes Given: 1880
Is this what you're after?

* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Offline feax

  • CPC464
  • **
  • Posts: 8
  • Country: gr
  • Liked: 1
  • Likes Given: 4
Is this what you're after?

This is the effect I want to create

Code: [Select]
100 MODE 1
200 BORDER 2
300 PAPER 0:PRINT SPC(39);" "; 'OK
400 'PRINT SPC(40) doesn't work
500 PAPER 1:PRINT SPC(39);" "; 'OK
600 GOTO 300

I am looking to create a vertical scroll
with horizontal colored lines
In code I will have the option
to turn on/off paper number info

Final code will be
just horizontal colored lines
no printed chars
« Last Edit: 14:55, 27 August 20 by feax »

Offline Sykobee (Briggsy)

  • 6128 Plus
  • ******
  • Posts: 787
  • Country: gb
  • Liked: 288
  • Likes Given: 420
100 BORDER 2
110 MODE 1
200 FOR n=0 TO 3
300 PAPER n
330 FRAME ' sync to prevent the loading bar effect hopefully BASIC 1.1 use CALL &BD19 on 464
350 PRINT spc(40) ' or as you say, SPC(39);" "
600 NEXT n
700 GOTO 200


However you might be better off writing to screen memory the bar blocks directly instead of using PRINT
« Last Edit: 14:54, 27 August 20 by Sykobee (Briggsy) »

Offline feax

  • CPC464
  • **
  • Posts: 8
  • Country: gr
  • Liked: 1
  • Likes Given: 4
However you might be better off
writing to screen memory
the bar blocks directly instead of using PRINT

Can you write to screen memory direct with basic
or I have to code in assembly?

I don't know how to do it in assembly yet.

Do you know the range of screen memory
for assembler. ex 30000 to 40000

Offline pelrun

  • Supporter
  • 6128 Plus
  • *
  • Posts: 661
  • Country: au
    • index.php?action=treasury
  • Liked: 349
  • Likes Given: 219
Screen memory goes from &C000 to &FFFF by default, and you can POKE it directly. However you're better off using the MOVE/DRAW commands for something like this, as the screen layout is highly non-linear.
Would something like this be acceptable?
Code: [Select]
10 MODE 1
20 BORDER 2
30 LOCATE 1,25:' Make sure the next print will force a scroll
40 FOR i%=0 TO 3
50 PAPER i%:PRINT
60 NEXT
70 GOTO 40
« Last Edit: 08:09, 28 August 20 by pelrun »

Offline andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 911
  • Liked: 443
  • Likes Given: 73
But the first 25 lines are printed like a loading bar not as a block.
After line 25 the lines are printed like a block.
Can I make it look like that it prints the whole line in one movement
and not incremental?
If you want all the first 25 lines to appear simultaneously, the easiest solution is just to set all INKS to 0, then once you've printed the first 25 lines, set them to the colours you are actually hoping to display. The ink change occurs immediately and the firmware even syncs this with the start of a frame for you.