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.