Menu

How to properly use CAS1 devices

Anonymous
2016-12-08
2016-12-12
  • Anonymous

    Anonymous - 2016-12-08

    Ok, I never owned one of these machines that PC-BASIC emulates, as my family never could afford them. PC-BASIC allows me to reclaim a part of my youth I missed, which is great. But here's the problem: I don't know how to use those computers. I am curious as to how interfacing with a cassette drive works from a user (me) point of view, so I am playing with that feature. I set up pc-basic.ini to point device to "WAV:basic.wav", this works fine. Saving a program using save "cas1:whatever" seems to work, loading with the load command works, but I can't overwrite the contents of the emulated tape, nor can I add more programs to it (I don't even know if tape drives could store more than one program). I always get a device I/O error.

    I guess the solution I am looking for is if someone out there wrote a program or 2 already that accesses the tape drive and they could share the code that would be really nice.

    Anyway, thanks for the help
    Daniel

     
  • Rob Hagemans

    Rob Hagemans - 2016-12-08

    What you're describing should be possible, I think, but the cassette emulation is a bit flaky so there may be a bug. Perhaps in the secons session, it considers that the tape has ended when the WAV file (which was created in the first session) stops. One tape can certainly hold more than a single program - does it work if you save multiple programs in one PC-BASIC session?

    There won't be many programs around that use the cassette drive: tapes were never at all popular with the IBM PC. Those shelling out the $2000 (as you say, these things were amazingly expensive) would usually also buy a disk drive, and later models no longer had a cassette interface. I only know of one BASIC program stored on tape 'in the wild' (this one http://www.brutman.com/Cassette_Waveforms/Cassette_Waveforms.html) and that is a machine code loader, so not much use with PC-BASIC. Unfortunately, because it's been good funfinguring out how to decode them :)

    If you know of more original IBM PC tape recordings, please let me know, by the way!

    Rob

     
  • Anonymous

    Anonymous - 2016-12-08

    Hmm, I was able to save 2 very simple programs to tape, but loading failed

    PC-BASIC 16.12.0rc0
    (C) Copyright 2013--2016 Rob Hagemans.
    60300 Bytes free
    Ok 
    10 print "test 1"
    20 end
    save "cas1:test1"
    Ok 
    10 print "test 2"
    save "cas1:test2"
    Ok 
    list
    10 PRINT "test 2"
    20 END
    Ok 
    load "cas1:test1"
    Device I/O error 
    Ok 

    After fiddling around, it seems like the tape can't be "rewound". If I start a new session, load "cas1:test2", it skips test1 and loads test2. Then attempting to load test 1 in the same session leads to "disk timeout" errors. I am getting closer to loading and storing multiple programs on one tape though.

     
  • Rob Hagemans

    Rob Hagemans - 2016-12-08

    That's correct, there isn't a way to rewind - GW-BASIC simply has no command to do so. MOTOR toggles the tape motor (not yet implemented in PC-BASIC) but that doesn't rewind either. Apart from that, it looks like it's doing the right thing in what you show above, since test2 is stored after test1; Device Timeout is the error you get when you reach the end of tape.

    In the dev version of PC-BASIC I'm cycling the tape around once it gets to the end, but it remains to be seen if that is a better solution.

     
  • Anonymous

    Anonymous - 2016-12-09

    So far I can get multiple programs saved to tape in one session, but if I quit, start a new one, I get an I/O error trying to append to the tape. Is this normal?

     
  • Rob Hagemans

    Rob Hagemans - 2016-12-09

    It's not unexpected - consider that a cassette tape is of a finite length, and you can't keep recording beyond the end of the tape. So when PC-BASIC opens an existing file, it considers the length of the file is the length of the tape. If it creates a new file, there isn't anythingyet, so it just continues adding to the recording until you quit.

    It's probably not the best way of doing things - I was considering setting a tape length (say, 45 mins like a standard cassette) and allowing adding to a recording until that is reached. Perhaps that behaviour is more intuitive, I am not sure.

     
  • Anonymous

    Anonymous - 2016-12-10

    That would be more intuitive than a one time use would be, where you can add to it in one session, but as soon as you start another session it acts as if it was read only.

     
  • Rob Hagemans

    Rob Hagemans - 2016-12-12

    I'll keep that in mind. Just to avoid misunderstanding though, it's not treated as read-only: if you save on the tape without loading the existing program first, it will overwrite it; it just won't go beyond what it sees as the end of the tape.

     
  • bambi

    bambi - 2017-10-10

    Hello: I am having problems in using the CAS1 command. I have recorded an original PC audio file from a cassette tape as a wav file and placed it in the users folder. However I cannot seem to load the file in to the emulator. file name is PCTYP.WAV . CAS1:WAV inputs, but LOAD"CAS1:PCTYP..WAV" results in 'Device Unavailable' - What am I doing wrong? Thank you

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.