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 ?????
USAGE OF VLOAD BVLOAD
Re: USAGE OF VLOAD BVLOAD
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.
- ahenry3068
- Posts: 1195
- Joined: Tue Apr 04, 2023 9:57 pm
Re: USAGE OF VLOAD BVLOAD
Is all the Memory for the graphics screen in MODE $80 contiguous ?
Re: USAGE OF VLOAD BVLOAD
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.
- ahenry3068
- Posts: 1195
- Joined: Tue Apr 04, 2023 9:57 pm
Re: USAGE OF VLOAD BVLOAD
65535 bytes in the first Bank... 11265 in the 2nd bank ???
$00 = Black, $FF = Bright Magenta (with the default pallette of course)
$00 = Black, $FF = Bright Magenta (with the default pallette of course)
- ahenry3068
- Posts: 1195
- Joined: Tue Apr 04, 2023 9:57 pm
Re: USAGE OF VLOAD BVLOAD
I could do 3 or 4 consecutive BSAVES
Question: CPU Cycles.
Question: CPU Cycles.
Re: USAGE OF VLOAD BVLOAD
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.
- ahenry3068
- Posts: 1195
- Joined: Tue Apr 04, 2023 9:57 pm
Re: USAGE OF VLOAD BVLOAD
Ok I tried that with this code..
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.
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
But I cannot find the file "BG.SCN" which should exist after this executed.
- ahenry3068
- Posts: 1195
- Joined: Tue Apr 04, 2023 9:57 pm
Re: USAGE OF VLOAD BVLOAD
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.
in previous BASICS I've used has been OPEN # 20, "OUTFILE.TXT" FOR (READ,WRITE,APPEND).
Any help is welcome.
- ahenry3068
- Posts: 1195
- Joined: Tue Apr 04, 2023 9:57 pm
Re: USAGE OF VLOAD BVLOAD
I really need to understand this to finish my game also......