USAGE OF VLOAD BVLOAD
- ahenry3068
- Posts: 1195
- Joined: Tue Apr 04, 2023 9:57 pm
Re: USAGE OF VLOAD BVLOAD
I'm pulling out hair now... apparently working code without a corresponding output ??????????????????????
Re: USAGE OF VLOAD BVLOAD
You need to look at a Commodore 64 manual.ahenry3068 wrote: ↑Sat Jun 24, 2023 10:48 pm 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).
it should be something like this...
10 OPEN 8,8,8,"OUTFILE.DAT,S,W" 20 FOR I=0 TO 65535 30 PRINT#8,CHR$(VPEEK(0,I)); 40 NEXT 50 FOR I=0 TO 11263 60 PRINT#8,CHR$(VPEEK(1,I)); 70 NEXT 80 CLOSE 8
Re: USAGE OF VLOAD BVLOAD
Yeah, this is just going to keep being a challenge; a lot of X16 programming assumes that we already know how to program a C64 and how all of its peripherals work. The user guide for the 1541-II disk drive actually contains a wealth of information as to how files, file types, commands, etc all work, including example code.
Commander DOS is based on this, except the underlying media is an SD card with FAT32, instead of a floppy disk with GCR, and as far as I can tell, absolutely every file is treated as a "program" file (i.e., BASIC will let you LOAD it even if it actually shouldn't
).
Commander DOS is based on this, except the underlying media is an SD card with FAT32, instead of a floppy disk with GCR, and as far as I can tell, absolutely every file is treated as a "program" file (i.e., BASIC will let you LOAD it even if it actually shouldn't
![Razz :P](./images/smilies/icon_razz.gif)
- ahenry3068
- Posts: 1195
- Joined: Tue Apr 04, 2023 9:57 pm
Re: USAGE OF VLOAD BVLOAD
I got it working.. Sure I had something wrong with the OPEN parameters.
BVLOAD is decently quick but saving the screen with VPEEK takes forever.
BVLOAD is decently quick but saving the screen with VPEEK takes forever.
Re: USAGE OF VLOAD BVLOAD
Ah, I see what happened originally.
OPEN 5,8,5,"MYFILE.TXT,W"
This causes a silent "FILE NOT FOUND" error (need to type DOS afterwards to see the error message), because it's trying to look for an existing file to open.
OPEN 5,8,5,"MYFILE.TXT,S,W"
This works because you've specified a file type ("S" means you want to create a "sequential" file), so it will create a new file of that type if one doesn't exist already. However, CBM-DOS and Commander-DOS won't overwrite existing files by default (it'll give you another "silent" error that says "FILE EXISTS"), so you'd need to use "@0:MYFILE.TXT,S,W" instead to specify that it's OK to overwrite an existing file.
OPEN 5,8,5,"MYFILE.TXT,W"
This causes a silent "FILE NOT FOUND" error (need to type DOS afterwards to see the error message), because it's trying to look for an existing file to open.
OPEN 5,8,5,"MYFILE.TXT,S,W"
This works because you've specified a file type ("S" means you want to create a "sequential" file), so it will create a new file of that type if one doesn't exist already. However, CBM-DOS and Commander-DOS won't overwrite existing files by default (it'll give you another "silent" error that says "FILE EXISTS"), so you'd need to use "@0:MYFILE.TXT,S,W" instead to specify that it's OK to overwrite an existing file.
- ahenry3068
- Posts: 1195
- Joined: Tue Apr 04, 2023 9:57 pm
Re: USAGE OF VLOAD BVLOAD
The disk drive doc you sent is very useful.. I do have 1 C64 programming book but it glances
over BASIC and gets deep into 6502 asm. It might be useful to me one day.
But looking over the programs its a bunch of Peeks & Pokes that aren't necessarily X16 compatible.
over BASIC and gets deep into 6502 asm. It might be useful to me one day.
But looking over the programs its a bunch of Peeks & Pokes that aren't necessarily X16 compatible.