USAGE OF VLOAD BVLOAD

All aspects of programming on the Commander X16.
User avatar
ahenry3068
Posts: 1195
Joined: Tue Apr 04, 2023 9:57 pm

USAGE OF VLOAD BVLOAD

Post 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 ?????
TomXP411
Posts: 1806
Joined: Tue May 19, 2020 8:49 pm

Re: USAGE OF VLOAD BVLOAD

Post 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.
User avatar
ahenry3068
Posts: 1195
Joined: Tue Apr 04, 2023 9:57 pm

Re: USAGE OF VLOAD BVLOAD

Post by ahenry3068 »

Is all the Memory for the graphics screen in MODE $80 contiguous ?
DragWx
Posts: 363
Joined: Tue Mar 07, 2023 9:07 pm

Re: USAGE OF VLOAD BVLOAD

Post 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.
User avatar
ahenry3068
Posts: 1195
Joined: Tue Apr 04, 2023 9:57 pm

Re: USAGE OF VLOAD BVLOAD

Post by ahenry3068 »

65535 bytes in the first Bank... 11265 in the 2nd bank ???


$00 = Black, $FF = Bright Magenta (with the default pallette of course)
User avatar
ahenry3068
Posts: 1195
Joined: Tue Apr 04, 2023 9:57 pm

Re: USAGE OF VLOAD BVLOAD

Post by ahenry3068 »

I could do 3 or 4 consecutive BSAVES

Question: CPU Cycles.
TomXP411
Posts: 1806
Joined: Tue May 19, 2020 8:49 pm

Re: USAGE OF VLOAD BVLOAD

Post 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.
User avatar
ahenry3068
Posts: 1195
Joined: Tue Apr 04, 2023 9:57 pm

Re: USAGE OF VLOAD BVLOAD

Post 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.
User avatar
ahenry3068
Posts: 1195
Joined: Tue Apr 04, 2023 9:57 pm

Re: USAGE OF VLOAD BVLOAD

Post 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.
User avatar
ahenry3068
Posts: 1195
Joined: Tue Apr 04, 2023 9:57 pm

Re: USAGE OF VLOAD BVLOAD

Post by ahenry3068 »

I really need to understand this to finish my game also......
Post Reply