How paint in the down two lines ?

edited May 2010 in Sinclair Basic
The down two lines on the spectrum screen cant be used. But i remeber from the 80's that exist some code that allow us to paint on these two lines with plot or draw or others.

Someone remember the code ?


thx in advance
Post edited by arfgh on

Comments

  • edited May 2010
    10 OPEN #2,"K"
    20 PRINT #2; AT 0,0;"Hello"
    30 PRINT #2;"World"
    40 PAUSE 0: REM Wait for keypress
    
    EDIT: Just noticed you were talking about PLOT and DRAW, not PRINT. I dunno how to do that, sorry!
  • edited May 2010
    David Webb's book Advanced Spectrum Machine Language, chapter 3, has routines for full-screen PLOT and DRAW.
  • edited May 2010
    If you're going to go machine code, I have to recommend using the ZX BASIC compiler that Boriel wrote. It's probably easier than using assembler, or learning c to use z88dk.

    www.zxbasic.net

    The default for plot and draw inside this is full screen, with 0,0 being at the real bottom left.

    And as a bonus, the whole program ends up being fast machine code!
  • edited May 2010
    arfgh wrote: »
    The down two lines on the spectrum screen cant be used. But i remeber from the 80's that exist some code that allow us to paint on these two lines with plot or draw or others.

    Someone remember the code ?


    thx in advance

    This can be done in MC only by copying the drawroutine and handle the PLOT differently.

    I did use this trick to use the draw-routine as movement in PITPAT.
  • edited May 2010
    not exist a way to plot or draw on these lines with basic only ?
  • edited May 2010
    arfgh wrote: »
    not exist a way to plot or draw on these lines with basic only ?

    No, the BASIC turns the Y-coordinates (AT Y,X starts at top, PLOT Y<X at bottom) with 176-y so 192 lines is only possible through MC. DRAW uses same PLOT routine so it will give an error when used there.
  • edited May 2010
    ok, i need to learn to do little programs for my help with CM. Bit this is a thing that i never tried, including in the 80's

    Some suggest or little help ?
  • edited May 2010
    I was serious about looking into ZX BASIC. (And a reference in case anyone is lost: http://www.zxbasic.net )

    I compiled this:
    10 CLS : OVER 1
    20 REM Printing on all 24 lines:
    30 BORDER 6
    40 FOR N=0 TO 23
    50 PRINT "THIS IS LINE: ";N
    60 NEXT N
    70 REM Drawing on whole screen: 
    80 BORDER 5
    90 PLOT 0,0
    100 DRAW 255,0
    110 DRAW 0,191
    120 DRAW -255,0
    130 DRAW 0,-191
    140 REM FAST CIRCLES - AND BIGGER THAN SINCLAIR BASIC ALLOWS
    150 BORDER 4
    160 FOR N=95 TO 1 STEP -1
    170 CIRCLE 128,96,N
    180 NEXT N
    190 PAUSE 0
    200 CLS
    

    With line numbers and everything! You don't have to use line numbers, but I made this as close to standard sinclair basic as possible. This program doesn't work in normal basic, because it draws in areas that Sinclair basic doesn't allow. Here's a .tzx file to show what it ends up like when you compile it:

    http://sites.google.com/site/britlion/ZXBASIC.NETScreenHandlingDemo.tzx
  • edited May 2010
    Listen to Gedlion. Use ZX Basic :) Fast programs and less limitations.
  • edited May 2010
    But Gedlion, this tzx you share, uses some CM, because i dont see the code that you paste above.
  • edited May 2010
    Because it's compiled with ZX Basic.
  • edited May 2010
    it is just the same code but only compiled with a special tool ?
  • edited May 2010
    Exactly, yes. Instead of typing it into a spectrum, I wrote it on the PC, and used ZX BASIC to make that .tzx file.

    It does end up as Machine Code - but that basic source code is what I made it from.
  • edited May 2010
    Sounds interesting !

    ok, and where i can find these compiler tools for the pc ?
  • edited May 2010
    This is turning into an Abbott & Costello sketch :-)

    The compiler tool is here: -> http://www.zxbasic.net/
  • edited May 2010
    i am surprised by this compiler. So we type in basic and the compiler makes the CM. I saw how the basic programs run really faster ! I never knew that a program like could exist.

    thx
Sign In or Register to comment.