Menu

(no subject)

2022-11-05
2022-11-30
  • Yet Another Troll

    Wow. It's been a while. Well, I figured GFA/X11-Basic would be the perfect language to mangle the output from Atari BASIC and Atari LOGO written to the virtual cassette tape, since 4KB for a filesystem driver is just too much bloat 😂 into something the host OS can work with, or a maybe completely different OS, because why not. Don't worry, all the debug cruft only goes to the screen, never the output file🤗

    Edited some formatting errors, and how did the subject get deleted and the post wind up in Open Discussion and not in Programs???

    Altirra, an 8-bit Atari computer emulator

    CAS file format - description

    Program CASDump
    
     Clr CASFile$, TXTFile$
    
     FileSelect "Select input CAS file", "./*", "in.cas", CASFile$
     FileSelect "Select output text file", "./*", "out.txt", TXTFile$
    
     DefFn Sep$(x) = String$(38, "*")
    
     Print "'"; CASFile$; "'"
     Print "'"; TXTFile$; "'"
    
     ! Stop
    
     Open "I", #1, CASFile$
     Open "A", #2, TXTFile$
    
     If Loc(#2) > 0
      Print #2
      Print #2
     EndIf
    
     Print #2, @Sep$(0)
     Print #2, "BEGIN "; Date$; " "; Time$; " "; CASFile$
     Print #2, @Sep$(0)
     Print #2
    
     Clr TextSeen%
    
     While Not EOF(#1)
    
      CType$ = Space$(4)
      Clr CLen%, CAux%, CData$
    
      BGet #1, VarPtr(CType$), 4
      BGet #1, VarPtr(CLen%), 2
      BGet #1, VarPtr(CAux%), 2
    
      Print CType$, CLen%, CAux%
    
      If (CAux% > 7000) And TextSeen%
       Print #2
       Print #2
       Print #2, @Sep$(0) ! String$(38, "*")
       Print #2
       TextSeen% = False
      EndIf
    
      If CLen%
       CData$ = Space$(CLen%)
       BGet #1, VarPtr(CData$), CLen%
    
       Print Left$(CData$, 2), 
       Print Asc(Mid$(CData$, 3, 1)) And 255,
       Print Asc(Right$(CData$, 1)) And 255
    
       ! Print "'"; Mid$(CData$, 4, CLen% - 4); "'    "
    
       Print "'";
    
       For i% = 4 To CLen% - 1
        j% = Asc(Mid$(CData$, i%, 1)) And 255
        If j% = 155
         Print "\"; "n";
         Print #2
        Else If (j% < 32) Or (j% > 126)
         Print "&#"; j%; ";";
         Print #2, "&#"; j%; ";";
        Else
         Print Mid$(CData$, i%, 1);
         Print #2, Mid$(CData$, i%, 1);
        EndIf
       Next i%
    
       Print "'"
    
       TextSeen% = True
    
      EndIf
    
     WEnd
    
     Print #2
     Print #2
     Print #2, @Sep$(0) ! String$(38, "*")
     Print #2, "END "; CasFile$
     Print #2, @Sep$(0)
    
     Close #1
     Close #2
    
     Print "OK"
    End
    

    Program run screenshot

     

    Last edit: Yet Another Troll 2022-11-05
  • Yet Another Troll

    Yikes, sorry for the activity notification spam everyone 🤦🏻‍♂️

     

Anonymous
Anonymous

Add attachments
Cancel