Graphics Problem

 BBS: Inland Empire Archive
Date: 06-07-92 (03:56)             Number: 121
From: RICH GELDREICH               Refer#: NONE
  To: MATT HART                     Recvd: NO  
Subj: Graphics Problem               Conf: (2) Quik_Bas
(Matt Hart)
>I've got a graphics question for you:

>I've tested some code that will change from blinking attributes to
>highlight backgrounds.  But a strange thing happens - I can POKE
>into video memory,     but nothing is displayed until the program
>ends.  Everything stays switch though.  Subsequent writes will
>immediately show up.  Here it is:

DEFINT A-Z
CLS

Attr = 4 * 16 + 14              'Yellow on red
HighAttr = Attr + 128           ' Set blink/highlight bit

DEF SEG = &HB800
POKE 0, 65: POKE 1, HighAttr

WHILE INKEY$ = "": WEND         ' A blinking yellow on red "A"

X = INP(&H3DA)                  ' Reset flip/flop

OUT &H3C0, 16 + 32              ' Index Mode Control register - enable
                                ' bit 5
OUT &H3C0, INP(&H3C0) AND 247   ' Reset Bit 3 -  Blink/Intensity

DEF SEG

'Now the screen is blank

WHILE INKEY$ = "": WEND

>     The program ends, drops to DOS, and Presto - I have a yellow on
>bright red "A", and subsequent writes and such continue with
intensity...


    About the blank screen: Bit 5 of the AC Index Register controls
where the video data gets its palette. When it's set, the palette is
derived from palette RAM, when reset, it does not(which causes the
blank screen). You must keep bit 5 on when tweaking with this
register...

    The other problem was that you were setting bit 3, not resetting it.
I used "INP(&h3c0) and 247" to reset the bit, on the EGA this won't work
(because this register isn't readable on the EGA).

    Hope that helps!

    Rich Geldreich

(P.S. A little while ago I got some code from you to use the Tandy 8 bit
DAC. I recently posted it on another QB echo- it has your original
intro-
duction and your name on it. I just added a few usefull function to it
(such as playing strings instead of just arrays). I hope you don't
mind.)



--- RBBSMAIL 17.2A
 * Origin: Computer Co-Op RBBS HST, 609-784-9404 Voorhees
NJ (RBBS-PC 1:266/29)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET