News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

How do you print a single colored line with no characters?

Started by feax, 21:47, 26 August 20

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

feax

I have written this code


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

angelcaio

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

goksteroo


feax

Quote from: angelcaio on 09:04, 27 August 20350 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.


feax

Quote from: goksteroo on 09:10, 27 August 20
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$

AMSDOS

* 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

feax

Quote from: AMSDOS on 12:06, 27 August 20
Is this what you're after?

This is the effect I want to create


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

Sykobee (Briggsy)

#7
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

feax

Quote from: Sykobee (Briggsy) on 12:52, 27 August 20
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

pelrun

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?
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

andycadley

Quote from: feax on 11:47, 27 August 20
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.

Powered by SMFPacks Menu Editor Mod