QB / QB64 Discussion Forum     RULES     Other Subforums, Links and Downloads    Index of Threads

# Oops Run this 1 instead

February 23 2003 at 2:22 AM

Response to Text Mode 'Binary Fire'

Sorry bout that, i guess i should do this
when i'm not so tired.

DECLARE SUB MyPrint (Ch%, X%, Y%, C%)
DECLARE FUNCTION TextPoint% (X%, Y%)

WIDTH 80, 25
DEFINT A-Z

CLS

FOR I = 0 TO 15
PALETTE I, I
NEXT

FOR I = 0 TO 3
OUT 968, I
OUT 969, I * 4
OUT 969, 0
OUT 969, 0

OUT 968, I + 4
OUT 969, 63
OUT 969, I * 4
OUT 969, 0

OUT 968, I + 8
OUT 969, 63
OUT 969, 63
OUT 969, I * 4

OUT 968, I + 12
OUT 969, 63
OUT 969, 63
OUT 969, 63

NEXT

DO

FOR I = 1 TO 79
IF INT(RND * 2) = 0 THEN MyPrint 32, I, 23, 15 ELSE MyPrint 32, I, 23, 0
NEXT

FOR Ix = 0 TO 80
FOR Iy = 23 TO 1 STEP -1
C = TextPoint(Ix + 1, Iy) + TextPoint(Ix - 1, Iy)
C = C + TextPoint(Ix, Iy + 1) + TextPoint(Ix, Iy - 1)
IF C > 3 THEN MyPrint ((C AND 1) + 48), Ix - 1, Iy - 1, (C \ 4) ELSE MyPrint 32, Ix - 1, Iy - 1, (C \ 4)
NEXT
NEXT

WAIT 986, 8
WAIT 986, 8, 8

WAIT 986, 8
WAIT 986, 8, 8

LOOP

SUB MyPrint (Ch, X, Y, C)

DEF SEG = &HB800
Ys = (X - 1) * 2 + (Y - 1) * 160

POKE Ys, Ch
POKE Ys + 1, C

END SUB

FUNCTION TextPoint (X, Y)

DEF SEG = &HB800
TextPoint = PEEK(((X - 1) * 2 + (Y - 1) * 160) + 1)

END FUNCTION

 Respond to this message