Qbasicnews.com
May 26, 2020, 05:47:15 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: colorprint sub and doulble buffing in screen 13  (Read 2928 times)
andy
Senior Member
**
Posts: 175



WWW
« on: May 28, 2004, 07:45:58 AM »

I am using the doulble buffering sub that (i think it was Relsoft) made, but it won't work with the sub i got off someone that prints to the screen without a black box around the text, it just doesn't print the text?

Anyone know why or got any ideas of how i can do it without having to make all the text into sprites(they work).
Logged

eminiscing about trapezoids in conjunction with stratospherical parabolas:

No questions asked.

www.stickskate.com
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #1 on: May 28, 2004, 10:30:32 AM »

It would be nice that you told us which double buffering routine and which print routine you are using, as we are not fortune-tellers Cheesy

Y'know it's only that there are like 10 different ways to do a double buffer, and 10 different routines that print text Wink
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Neo
Na_th_an
*****
Posts: 2150



« Reply #2 on: May 28, 2004, 11:19:12 AM »

And combining those 10 different ways usually doesn't work either Wink Try the text-printing routine of the same creator as the Double-Buffer routine.
Logged
barok
Na_th_an
*****
Posts: 1727


How about a tasty lead sandwich?


« Reply #3 on: May 28, 2004, 09:24:56 PM »

or better yet, make your own double buffer routine and text-printing routine.  you'd understand it better.

like neo said, the text routine probably isn't compatible with the buffer routine.  for example, the text routine might be sending it's text to a different spot in memory instead to relsofts buffer.  or something like that.
Logged

Jumping Jahoolipers!
andy
Senior Member
**
Posts: 175



WWW
« Reply #4 on: May 29, 2004, 10:24:38 AM »

colour print routine

Code:
SUB COLORPRINT (ROW, COLUMN, text2$, TEXTCOLOR)
startx = (COLUMN - 1) * 8
starty = (ROW - 1) * 8
FOR x = 1 TO LEN(text2$)
  char = ASC(MID$(text2$, x, 1))
  FOR y = &HFA6E + char * 8 TO &HFA6E + 7 + char * 8
    DEF SEG = &HF000 ' poss 000
    bits = PEEK(y)
    DEF SEG = &HA000
    Offset& = starty * 320& + startx
    IF bits AND 128 THEN POKE Offset&, TEXTCOLOR
    Offset& = Offset& + 1
    IF bits AND 64 THEN POKE Offset&, TEXTCOLOR
    Offset& = Offset& + 1
    IF bits AND 32 THEN POKE Offset&, TEXTCOLOR
    Offset& = Offset& + 1
    IF bits AND 16 THEN POKE Offset&, TEXTCOLOR
    Offset& = Offset& + 1
    IF bits AND 8 THEN POKE Offset&, TEXTCOLOR
    Offset& = Offset& + 1
    IF bits AND 4 THEN POKE Offset&, TEXTCOLOR
    Offset& = Offset& + 1
    IF bits AND 2 THEN POKE Offset&, TEXTCOLOR
    Offset& = Offset& + 1
    IF bits AND 1 THEN POKE Offset&, TEXTCOLOR
    Offset& = Offset& + 1
    starty = starty + 1
  NEXT
  startx = startx + 8
  starty = (ROW - 1) * 8
NEXT
DEF SEG

END SUB


double buffing routine
DEFINT A-Z
SUB setVideoSeg (SEGMENT) STATIC    ' By Plasma357

  DEF SEG

  IF videoAddrOff& = 0 THEN   ' First time the sub is called

    ' We need to find the location of b$AddrC, which holds the graphics
    ' offset (b$OffC) and segment (b$SegC). Since b$AddrC is in the default
    ' segment, we can find it by setting it to a certain value, and then
    ' searching for that value.

    SCREEN 13                 ' Set b$SegC to A000 (00A0 in memory)
    PSET (160, 100), 0        ' Set b$OffC to 7DA0 (not needed in the IDE)

    FOR Offset& = 0 TO 32764                 ' Search for b$AddrC, which is
      IF PEEK(Offset&) = &HA0 THEN           ' in the default segment and
        IF PEEK(Offset& + 1) = &H7D THEN     ' should have a value of
          IF PEEK(Offset& + 2) = &H0 THEN    ' A0 7D 00 A0.
            IF PEEK(Offset& + 3) = &HA0 THEN
              videoAddrOff& = Offset& + 2    ' If we found it, record the
              EXIT FOR                       ' offset of b$SegC and quit
            END IF                           ' looking. (Oddly, changing
          END IF                             ' the b$OffC doesn't seem to
        END IF                               ' do anything, so this is why
      END IF                                 ' this sub only changes b$SegC)
    NEXT

  END IF

  ' Change b$SegC to the specified Segment

  POKE videoAddrOff&, SEGMENT AND &HFF
  POKE videoAddrOff& + 1, (SEGMENT AND &HFF00&) \ &H100


   'setVideoSeg myBufferSegment%
   'WAIT &H3DA, 8: WAIT &H3DA, 8, 8
   'setVideoSeg &HA000
   'PUT (0, 0), myBuffer%(6), PSET

END SUB
Code:


I would make my own, but I am no good at memory stuff, I don't know anything about def seg, var seg, poke, peek, or tuff like &h3da.

Logged

eminiscing about trapezoids in conjunction with stratospherical parabolas:

No questions asked.

www.stickskate.com
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #5 on: May 29, 2004, 10:46:33 AM »

Setvideoseg is based on creating a "virtual screen" somewhere in memory. It changes some stuff so QB drawing commands draw in you array and not in video memory, so you can afterwards copy that array to the actual video memory -> double buffer.

The print routine you are using is POKING to video memory directly, so they are not compatible. Use PSET instead of those POKEs for a quick fix.
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #6 on: May 31, 2004, 05:21:27 AM »

Plasma made SetVideoSeg

Plasma<>Rel

And I didn't make ClrPrint either.  Though I made a similar version.

Yeah, what Nathan said. PSET instead of POKE.
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
andy
Senior Member
**
Posts: 175



WWW
« Reply #7 on: May 31, 2004, 10:51:11 AM »

cheers, sorry about the name I get confused easily
Logged

eminiscing about trapezoids in conjunction with stratospherical parabolas:

No questions asked.

www.stickskate.com
barok
Na_th_an
*****
Posts: 1727


How about a tasty lead sandwich?


« Reply #8 on: May 31, 2004, 11:07:13 AM »

Quote from: "relsoft"


Plasma<>Rel


love the way you phrased that Rel.  Cheesy
Logged

Jumping Jahoolipers!
Nexinarus
Wandering Guru
***
Posts: 301



WWW
« Reply #9 on: May 31, 2004, 09:37:16 PM »

Yeah but maybe he ment:
"Rel" <> "Plasma"

as that is more correct Wink.
Logged
Neo
Na_th_an
*****
Posts: 2150



« Reply #10 on: June 02, 2004, 11:12:33 AM »

But they're both geniuses... Wink
Logged
andy
Senior Member
**
Posts: 175



WWW
« Reply #11 on: June 05, 2004, 01:06:10 PM »

cheers, I have done it and it works fine
Logged

eminiscing about trapezoids in conjunction with stratospherical parabolas:

No questions asked.

www.stickskate.com
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!