Syntax highlighting on the VIC

Basic and Machine Language

Moderator: Moderators

Post Reply
User avatar
Kweepa
Vic 20 Scientist
Posts: 1314
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Syntax highlighting on the VIC

Post 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 1574 times
Bobbi
Vic 20 Afficionado
Posts: 355
Joined: Thu Oct 13, 2016 11:35 am
Location: Toronto
Occupation: Programmer

Re: Syntax highlighting on the VIC

Post by Bobbi »

Very neat!
User avatar
vicist
Vic 20 Afficionado
Posts: 352
Joined: Tue Oct 09, 2012 5:26 am
Location: Sheffield, UK

Re: Syntax highlighting on the VIC

Post by vicist »

Very clever :)

It does tend to ruin the colour formatting of my basic programs when run, but a novel idea nonetheless. :D
User avatar
Kweepa
Vic 20 Scientist
Posts: 1314
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Re: Syntax highlighting on the VIC

Post 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
merman
Vic 20 Enthusiast
Posts: 152
Joined: Thu Feb 25, 2016 9:46 am
Location: Skegness UK
Occupation: Writer

Re: Syntax highlighting on the VIC

Post by merman »

Clever!
User avatar
vicist
Vic 20 Afficionado
Posts: 352
Joined: Tue Oct 09, 2012 5:26 am
Location: Sheffield, UK

Re: Syntax highlighting on the VIC

Post 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:
Post Reply