Image Map Image Map
Results 1 to 9 of 9

Thread: Cross-platform Development: Text BASIC to CAS or DSK

  1. #1
    Join Date
    Oct 2007
    Location
    Adelaide, Australia
    Posts
    9

    Question Cross-platform Development: Text BASIC to CAS or DSK

    Hi,

    I have been playing with a GIMP plugin that outputs a low resolution image (128x48 ) to a BASIC file in a text format for input into a TRS80 (I/III/IV) emulator (My hardware is currently not functional). The problem I am having is getting the text file to easily load into the emulator. I'm using sdltrs under linux, and when I cut and paste the file, partway through pasting the file into the emulator it starts to skip important details...like line numbers (or parts thereof). I'm guessing that it's something to do with the timing of the emulator having to tokenize the newly entered line while my pasted code continues to be typed in (and lost). Not sure if anyone else has experienced this or not. My current workaround is to paste every line individually, and as you can imagine, that takes quite a bit more time (and is labour intensive)

    Anyway, one solution would be to convert the text file to a tokenized BASIC file, convert to CAS and then mount and load.

    Another solution would be to do the same but only onto a virtual floppy disk.

    Does anyone know how I would convert a BASIC text file into either a CAS or DSK file for use in an emulator?

    Thanks,
    Hawk

  2. #2
    Join Date
    Apr 2017
    Location
    N Bellmore, LI
    Posts
    283
    Blog Entries
    1

    Default

    Im not sure if this works but can you use a serial emulator to load the characters slowly eg. 300 baud?
    Wanted: Any old clunky 286-P1 machine that has some kind of working battery or replaceable with off the shelf parts. Preferred: 10+lbs 386 machines.

  3. #3
    Join Date
    Oct 2007
    Location
    Adelaide, Australia
    Posts
    9

    Default

    Thanks for the suggestion but I'm not sure how I'd do that.

    I was hoping that there were some command line tools that might add files to a disk or convert TXT files to BAS files and then CAS files. I can't believe that I'm the only user that doesn't enjoy using the line editor on the TRS-80 for developing BASIC programs. In fact I had forgotten all about the line editor. I was so used to more modern (late 70s early 80s) platforms that include screen editors for entering programs. I had to try and remember all the TRS80 editing commands from back when I was in high school.

    I've searched around a bit but been unable to find anything that will do the job.

    Can anyone suggest where I would find the format for tokenized TRS80 BASIC programs?

  4. #4
    Join Date
    Apr 2017
    Location
    N Bellmore, LI
    Posts
    283
    Blog Entries
    1

    Default

    If you got a few hours to spare and some fingers with good stamina you could always do it that way .

    See if you can find a CAS with a basic program on it. You could probably somehow reverse engineer the file system which is likely quite primitive, then add your image program in.
    Wanted: Any old clunky 286-P1 machine that has some kind of working battery or replaceable with off the shelf parts. Preferred: 10+lbs 386 machines.

  5. #5

    Default

    Quote Originally Posted by twistedpneumatic View Post
    If you got a few hours to spare and some fingers with good stamina you could always do it that way .

    See if you can find a CAS with a basic program on it. You could probably somehow reverse engineer the file system which is likely quite primitive, then add your image program in.
    You want to create a CAS file from text? I'm pretty sure you can do that already with Knut's tools.

    Copy the text to a file on a TRSTOOLS disk, save as /BAS.

    Load in the emulator. CSAVE to the virtual tape drive. You can use those tools to get the .CAS file.

    I have a BBS that I had to repair on my Mac, it was 23 basic programs in overlays. The /BAS file can be ASCII or Tokenized, doesnt matter to basic it just loads it.

    CSAVE can also be done at high speed for Model III.

  6. #6
    Join Date
    Oct 2007
    Location
    Adelaide, Australia
    Posts
    9

    Default

    Thanks Tibs, that's the sort of response I was hoping for. The snippet of information that I was missing is that the TRS-80 can open either a ASCII or tokenized file.

    Unfortunately the TRSTOOLS is only available for Windows and currently I have been working in a Linux environment, mostly because I have been unable to compile the GIMP plugin for either Windows or OSX (You can tell that I'm fairly OS agnostic;^).

    I will keep looking for a more platform independent solution as it's not easy to chop and change OSs on the fly.

  7. #7

    Default

    I have two suggestions (possibly both futile) for how to try to get copy and paste to work: (1) try fiddling with the -keystretch option, (2) try using xtrs rather than sdltrs.

    As for getting a CAS file: Do I understand correctly that this BASIC code is being generated by something you wrote? If yes, then it shouldn't be too hard to instead generate some assembly code (even if you don't know any Z-80 assembly), which you could pass to George's zmac, which will output a CAS file.

    I'm thinking you would startup BASIC with a "Memory Size?" of 31000, and when you loaded the CAS file with a SYSTEM comand, the graphics data would be loaded at location 31000, from which your BASIC application could read it with peeks and then use it however it wants.

    The assembly code you output could be as simple as this:
    Code:
      ORG 31000
        DEFB 10100010b  ; first two bits are fixed, next six are pixel data
        DEFB 10111100b
        ... ; continue for 1024 bytes
      END 31000
    -Alan

  8. #8

    Default

    Perhaps the more obvious solution would be to emulate a disk-based system, import the ASCII BASIC file using IMPORT/CMD (found on the utility.dsk included in the xtrs or sdltrs distribution), and then load the ASCII BASIC file into Disk BASIC using the "LOAD" command (which, if I remember correctly, will automatically detect whether the argument is an ASCII file or a tokenized file, and load either one).
    -Alan

  9. #9

    Default

    Quote Originally Posted by Hawk View Post
    Thanks Tibs, that's the sort of response I was hoping for. The snippet of information that I was missing is that the TRS-80 can open either a ASCII or tokenized file.

    Unfortunately the TRSTOOLS is only available for Windows and currently I have been working in a Linux environment, mostly because I have been unable to compile the GIMP plugin for either Windows or OSX (You can tell that I'm fairly OS agnostic;^).

    I will keep looking for a more platform independent solution as it's not easy to chop and change OSs on the fly.
    Ok, I use Ubuntu and OS X, just use the windows emulators . Or PM me the files and I'll send you some CAS files if you just cant get there.

    The other options just mentioned are also great ways of learning. There is more than one way to skin a cat with the TRS-80s

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •