VERA Graphics from BASIC

qbradq

New Member
Sep 14, 2019
24
15
3
I am very excited about this project. I am a BASIC beginner but I am pretty familiar with 6502 ASM. Is anyone trying to use the VERA graphics module from BASIC programs yet?

I am interested in either extending the existing BASIC ROM with VERA commands or collaborating on a BASIC extension prg for that purpose. Are there any existing efforts to this affect?

One final question, could anyone advise me the preferred way to re-enter BASIC (with the existing program in-place) from inside a BASIC program that changes the VERA registers?

Example Program:
Code:
10 VPOKE 4,0,0:REM DISABLE LAYER 0
20 END:REM RETURN TO BASIC




Result:




Intended Result:


 

PowerfulBadBoy

New Member
Jul 17, 2019
21
11
3
The problem is, you ARE "back in basic". It's just that you disabled layer 0 which is what is used to display the text.

All operations in memory are saved even when the program is terminated. This is intentional.
 
  • Like
Reactions: Panda

PowerfulBadBoy

New Member
Jul 17, 2019
21
11
3
Just found this out while perusing the VERA documentation
If you want to reset the graphics chip, poke (Internal x16 memory, IE: NOT VPOKE) $9F25 with %10000000 or 128

Edit: The memory location was 1 byte off in my original post. Fixed.
 
Last edited:

qbradq

New Member
Sep 14, 2019
24
15
3
Just found this out while perusing the VERA documentation
If you want to reset the graphics chip, poke (Internal x16 memory, IE: NOT VPOKE) $9F26 with %10000000 or 128
Resetting the VERA does not produce the desired results. However, restoring the expected values via VPOKE does seem to do what I intended.

Code:
10 VPOKE 4,0,0
20 FOR X=0 TO 10000:NEXT
30 VPOKE 4,0,1
40 END
 
May 22, 2019
491
251
63
I am very excited about this project. I am a BASIC beginner but I am pretty familiar with 6502 ASM. Is anyone trying to use the VERA graphics module from BASIC programs yet?
It would be a waste of time. Lorin has said that they intend to add graphics commands (line, box, circle, paint), and so writing graphics routines using BASIC right now would be kind of pointless. It would also be slow, as poking one pixel at a time would take a long time to accomplish anything.
 

Panda

New Member
I have tried writing a few programs in BASIC already. I've found the BASIC interpreter too slow do anything serious with graphics.
Here was my early version of the Matrix code green screen. This was to try out the VPOKE command. There was a bug with the VPEEK command at the time that's been fixed.

I eventually wrote a faster version in C and cross complied. (see video)
Code:
10 VPOKE4,0,%100001:SYS65375
20 DIM X(40),PAL(31):PB=$200
30 FOR X=0TO39:X(X)=INT(RND(1)*30):NEXT
50 FOR COL=1TO30
60 READ PAL(COL):VPOKE4,PB+COL*2+1,0
70 NEXT:COL=1
100 FOR X=0TO39
110 VPOKE0,X*2+(X(X)*256),RND(1)*127
120 VPOKE0,X*2+(X(X)*256)+1,COL
130 X(X)=X(X)+1:IFX(X)>29THENX(X)=0
140 NEXT
150 PAL(31)=PAL(1):FOR T=1TO30
160 PAL(T)=PAL(T+1)
170 VPOKE4,PB+T*2,PAL(T)
180 NEXT: COL=COL-1:IF COL<1THENCOL=30
190 GOTO 100
500 DATA 240,224,192,176,160,144,128,112,96,80,65,48,32,16
510 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0