Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DEF SEG = &HB800
#1
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?

Smile
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.
Reply
#2
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 ::
Reply
#3
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).
Reply
#4
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.
Reply
#5
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.
Reply
#6
*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.
Reply
#7
POS and Screen functions I think.
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#8
Brighter future for "text" adventure games... Smile
ingCheetah, the Running Cheetah Software programmer

http://rcs.fateback.com/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)