Syntax highlighting on the VIC

Basic and Machine Language

Moderator: Moderators

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

Syntax highlighting on the VIC

Postby Kweepa » Thu Feb 16, 2017 1:22 pm

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 230 times

Bobbi
Vic 20 Afficionado
Posts: 347
Joined: Thu Oct 13, 2016 11:35 am
Location: Toronto
Occupation: Programmer

Re: Syntax highlighting on the VIC

Postby Bobbi » Thu Feb 16, 2017 1:48 pm

Very neat!

User avatar
vicist
Vic 20 Devotee
Posts: 200
Joined: Tue Oct 09, 2012 5:26 am
Location: Surrey, UK

Re: Syntax highlighting on the VIC

Postby vicist » Thu Feb 16, 2017 2:42 pm

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: 1082
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Re: Syntax highlighting on the VIC

Postby Kweepa » Thu Feb 16, 2017 6:34 pm

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 Hobbyist
Posts: 124
Joined: Thu Feb 25, 2016 9:46 am
Location: Skegness UK
Occupation: Writer

Re: Syntax highlighting on the VIC

Postby merman » Sun Feb 19, 2017 11:01 am

Clever!

User avatar
vicist
Vic 20 Devotee
Posts: 200
Joined: Tue Oct 09, 2012 5:26 am
Location: Surrey, UK

Re: Syntax highlighting on the VIC

Postby vicist » Sun Feb 19, 2017 2:18 pm

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:


Return to “Programming”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests