Page 1 of 2

USAGE OF VLOAD BVLOAD

Posted: Fri Jun 23, 2023 10:28 am
by ahenry3068
I want to use VLOAD and or BVLOAD to save and then restore and image
in SCREEN MODE $80.

This is for my Hangman Game. The initial scene takes some time to draw
especially now that I added clouds. It will have to be redrawn before each round
of play when I start implementing game code (which is imminent).

I did not find a corresponding VSAVE OR BVSAVE in the DOCS.
I don't know enough about the memory map of the VERA to
do this without some pointers at this time ... Has anyone
got any example code to point me to ?????

Re: USAGE OF VLOAD BVLOAD

Posted: Fri Jun 23, 2023 4:47 pm
by TomXP411
I don't think there is a VSAVE. Typically, you'd either copy the data to main RAM and save from there, or you'd write the data to disk one byte at a time.

Re: USAGE OF VLOAD BVLOAD

Posted: Fri Jun 23, 2023 5:23 pm
by ahenry3068
Is all the Memory for the graphics screen in MODE $80 contiguous ?

Re: USAGE OF VLOAD BVLOAD

Posted: Fri Jun 23, 2023 6:39 pm
by DragWx
The bitmapped graphics framebuffer (i.e., what you get when you use LINE, FRAME, etc) is at VERA $00000..$12BFF, and should just be one byte per pixel in raster order.

Re: USAGE OF VLOAD BVLOAD

Posted: Fri Jun 23, 2023 8:08 pm
by ahenry3068
65535 bytes in the first Bank... 11265 in the 2nd bank ???


$00 = Black, $FF = Bright Magenta (with the default pallette of course)

Re: USAGE OF VLOAD BVLOAD

Posted: Fri Jun 23, 2023 11:23 pm
by ahenry3068
I could do 3 or 4 consecutive BSAVES

Question: CPU Cycles.

Re: USAGE OF VLOAD BVLOAD

Posted: Sat Jun 24, 2023 4:44 am
by TomXP411
If you use OPEN, PRINT#, and VPEEK, you can just do it in one big loop. Actually, I'd probably just do it in two loops; write the first 65536 bytes in the first loop, then switch banks and write the last 11K.

Re: USAGE OF VLOAD BVLOAD

Posted: Sat Jun 24, 2023 10:46 pm
by ahenry3068
Ok I tried that with this code..

Code: Select all

15000 OPEN 20,8,0,"BG.SCN,W"
15010 FOR P = 0 TO 65535
15020   PRINT#20,CHR$(VPEEK(1,P))
15021   PRINT P,
15030 NEXT P
15040 FOR P = 0 TO 11264
15050   PRINT#20,CHR$(VPEEK(2,P))
15051   PRINT 2,P
15060 NEXT P
15070 CLOSE 20
15080 RETURN
It ran without errors(took long enough that I don't think I'm going to use it now.....BUT)
But I cannot find the file "BG.SCN" which should exist after this executed.

Re: USAGE OF VLOAD BVLOAD

Posted: Sat Jun 24, 2023 10:48 pm
by ahenry3068
I'm having problems with the OPEN syntax... The usual Syntax
in previous BASICS I've used has been OPEN # 20, "OUTFILE.TXT" FOR (READ,WRITE,APPEND).



Any help is welcome.

Re: USAGE OF VLOAD BVLOAD

Posted: Sat Jun 24, 2023 11:15 pm
by ahenry3068
I really need to understand this to finish my game also......