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

Re: USAGE OF VLOAD BVLOAD

Post by ahenry3068 »

I'm pulling out hair now... apparently working code without a corresponding output ??????????????????????
TomXP411
Posts: 1806
Joined: Tue May 19, 2020 8:49 pm

Re: USAGE OF VLOAD BVLOAD

Post by TomXP411 »

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).
You need to look at a Commodore 64 manual.

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
DragWx
Posts: 363
Joined: Tue Mar 07, 2023 9:07 pm

Re: USAGE OF VLOAD BVLOAD

Post by DragWx »

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

Re: USAGE OF VLOAD BVLOAD

Post by ahenry3068 »

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.
DragWx
Posts: 363
Joined: Tue Mar 07, 2023 9:07 pm

Re: USAGE OF VLOAD BVLOAD

Post by DragWx »

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

Re: USAGE OF VLOAD BVLOAD

Post by ahenry3068 »

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.
Post Reply