Posts: 3,368
Threads: 195
Joined: Jan 2003
Code:
CLS
x% = 80 '0 to 80
y% = 25 '1 to 25
colorBack% = 7 '0 to 7
colorFore% = 2 '0 to 15
colorBlink% = 1 '0 to 1
IF colorBlink% = 1 THEN colorBack% = colorBack% + 8
DEF SEG = &HB800
POKE ((x% - 1) + (y% - 1) * 80) * 2 + 1, colorBack% * 16 + colorFore%
POKE ((x% - 1) + (y% - 1) * 80) * 2, 7
DEF SEG
SLEEP
Questions:
1) How to I use color backgrounds 8 to 15? Impossible?
2) What's the POKE code for a cursor position?
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 35
Threads: 1
Joined: Oct 2003
Try this:
Code:
DEF SEG = &HB800
x = 5
y = 5
fcol = 15
bcol = 1
i = (y * 80 + x) * 2
POKE i, ASC("A")
POKE i + 1, fcol + 16 * bcol
: Dj Dennie ::
Posts: 1,752
Threads: 21
Joined: Jun 2002
To disable blinking:
Code:
junk = INP(&H3DA) 'disable text blinking
OUT &H3C0, &H20 + &H10 'and enable all the background colors
OldAttr = INP(&H3C1)
OUT &H3C0, OldAttr AND &HF7
junk = INP(&H3DA)
To change a character on the screen:
Code:
POKE (Row - 1) * NumCols * 2 + (Col - 1) * 2, Char
To change a color on the screen:
Code:
POKE (Row - 1) * NumCols * 2 + (Col - 1) * 2 + 1, Colr
Where NumCols is the number of columns active (80 or 40).
Posts: 3,368
Threads: 195
Joined: Jan 2003
thanks for the blink off code, but what I actually meant was
"code for the cursor position cursor"
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 1,752
Threads: 21
Joined: Jun 2002
LOCATE changes the position of the cursor...when you're writing directly to video memory, the cursor has no effect. The text goes where you write it to.
Posts: 3,368
Threads: 195
Joined: Jan 2003
*shrug*
I just wanted to be qool and use DEF SEG for that, too.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 3,288
Threads: 167
Joined: Nov 2001
POS and Screen functions I think.
Posts: 134
Threads: 13
Joined: Jun 2003
Brighter future for "text" adventure games...