Page 1 of 1

Syntax highlighting on the VIC

Posted: Thu Feb 16, 2017 1:22 pm
by Kweepa

Code: Select all

10 data72,165,251,201,63,240,3,173,249,1,41,3,24,105
20 data3,141,134,2,173,249,1,133,251,104,76,122,242
30 fori=0to26:reada:poke320+i,a:next:poke806,64:poke807,1
SyntaxHighlighting.png
SyntaxHighlighting.png (13.08 KiB) Viewed 1620 times

Re: Syntax highlighting on the VIC

Posted: Thu Feb 16, 2017 1:48 pm
by Bobbi
Very neat!

Re: Syntax highlighting on the VIC

Posted: Thu Feb 16, 2017 2:42 pm
by vicist
Very clever :)

It does tend to ruin the colour formatting of my basic programs when run, but a novel idea nonetheless. :D

Re: Syntax highlighting on the VIC

Posted: Thu Feb 16, 2017 6:34 pm
by Kweepa

Code: Select all

10 data72,138,72,186,224,239,48,22,165,255,201,63,240,3,173,249,1,41
20 data3,24,105,3,141,134,2,173,249,1,133,255,104,170,104,76,122,242
30 fori=0to35:reada:poke320+i,a:next:poke806,64:poke807,1
Now doesn't recolor characters when running.

Code: Select all

pha; txa; pha; tsx; cpx #$ef; bmi end
lda $ff; cmp #$3f; beq lastTokenChar
lda $1f9
lastTokenChar: and #3; clc; adc #3; sta $286; lda $1f9; sta $ff
end: pla; tax; pla; jmp $f27a

Re: Syntax highlighting on the VIC

Posted: Sun Feb 19, 2017 11:01 am
by merman
Clever!

Re: Syntax highlighting on the VIC

Posted: Sun Feb 19, 2017 2:18 pm
by vicist
Better - but...

The default colour is purple.

Code: Select all

10 print"{black}hello world"
20 print"this line should also be black"
This code results in the first line being printed in black but the second line appearing in the default colour - purple.
Some extra code is needed to preserve the current colour.

Still an excellent little util though. :wink: