Loading / Saving

Home Forums Newbrain Basic Loading / Saving

Tagged: 

  • Creator
    Topic
  • #3528
    CDesp
    Keymaster
    • Topics: 15
    • Replies: 24
    • Total posts: 39
      Up
      0
      Down
      ::

      To load/save from tape 2 you can issue these commands:

      • Poke 19,2 (that sets the default loading device to tape 2) and then load/save as usual.
      • Openin#2,2 and then Load#2 this does not change the default device
      • Openout#2,2,“filename” and then Save#2 this does not change the default device

      Notes on Loading/Saving

      Some files on the Newbrain are saved with bigger buffer and those should be loaded with a special command like Load “*32” or Load “*56”. You can use the Load “*56” even if the file was saved with “*32” but not vice versa.

      You can also save your files with bigger buffer using this command Save “*32:filename” or Save “*56:filename”.

      Filenames should not have extensions.

      On the emulator these kind of files have filenames starting with 32 like “32 Monopoly.bas” so in order to load this file you need to select the file and then type Load “*32” and then Run of course.

    Viewing 8 reply threads
    • Author
      Replies
      • #3805
        loudscotsbloke
        Participant
        • Topics: 0
        • Replies: 1
        • Total posts: 1
          Up
          0
          Down
          ::

          Hi. Is there anyway to save a BASIC file as a WAV? I have written a new game, and of course the emulator saves it as a .BAS tokenised file, but I want to be able to load it on to my real Newbrain via the cassette port, so ideally need a WAV file.

        • #3806
          CDesp
          Keymaster
          Topic Author
          • Topics: 15
          • Replies: 24
          • Total posts: 39
            Up
            0
            Down
            ::

            Hi,

            No not possible. I have a project in mind to do in the future that will take a .bas file and produce a .wav file.

            The only way to transfer the file now is via serial rs232.

          • #3815
            CDesp
            Keymaster
            Topic Author
            • Topics: 15
            • Replies: 24
            • Total posts: 39
              Up
              0
              Down
              ::

              Ok i made a tool to do this. I have not tested it.

              So here it is https://newbrainemu.eu/download/bin2wave/.

               

            • #3824
              Enzo Ciaffarafa
              Participant
              • Topics: 0
              • Replies: 3
              • Total posts: 3
                Up
                0
                Down
                ::

                Hi Chris. I have tested your BIN2Wave tool and unfortunately receiving ERROR 130 on physical NewBrain. Does not get past lead of the program via open #1,1 command before reporting error. I have extracted a number of tokenised files from your emulator discs and all report same behaviour.  I have been experimenting with NewBrain emulator found in MAME 0.287 and it has fully working tape support for WAV files for NewBrain for Load and Save. I have uploaded two test zip files which hopefully will help you fix tool.

                NEWBRAIN_TEST_1.ZIP has 13 line BASIC program in ASCII (NBAVE.BAS) along with tokensied version (NBAVEEMU.BAS) along with saved WAV file from MAME (NBAVEMAME.WAV) and your tool output (NBAVEEMU.WAV). NBWAVEMAME.WAV loads perfectly on physical NewBrain and MAME emulator but your tool output (NBAVEEMU.WAV) reports ERROR 130.

                NEWBRAIN_TEST_2_ZIP has classic NIM.BAS file from Beginners tape. NIM.WAV is a known working WAV file taken directly from the original tape. NIMMAME.WAV is the WAV file output by MAME after loading the original WAV and NIMDESP is the WAV output from your tool. The NIMWAVE.WAV file works perfectly with the physical NewBrain but ERROR 130 with the tool output. .

                Hopefully you can compare the WAV files and understand what the issue might be. On initial inspection there are major differences in teh WAV files.

                If your NewBrian emulator could support WAV files in the same way as MAME it would make it much easier for users of NewBrain’s to load and exchange programs without extra hardware such as disc controllers etc. I use a disc controller and Gotek along with the Emulator to transfer files from the emulator to phyical NewBrain and physical 5.25″ floppies and vice versa.

                Happy to help test again if you have an update and love the work you are doing to keep the NewBrain alive!

              • #3827
                CDesp
                Keymaster
                Topic Author
                • Topics: 15
                • Replies: 24
                • Total posts: 39
                  Up
                  0
                  Down
                  ::

                  Hi,

                  you can try the attached patterns (just overwrite the contents of the folder). They are the same as the mame wave.

                  But be aware you cannot convert a non TAPE file to a wav file. The file you are converting should be a tape file not a disk one.

                  If you want to convert a disk file you can do it by loading it on the newbrain and then poke 19,1 and save it as tape. That will produce a tape file which then you can convert it to a wave file to be written to a real tape and then be read by a real newbrain.

                  Anyway if that doesn’t work i ll have to build me a cable and do some tests.

                  Attachments:
                • #3829
                  Enzo Ciaffarafa
                  Participant
                  • Topics: 0
                  • Replies: 3
                  • Total posts: 3
                    Up
                    0
                    Down
                    ::

                    Thank you for the update. Changing the patterns has definitely helped and thank you for the how-to to create the tape files within the emulator as that helped me with the testing. Had some success testing with MAME, NewBrain Emulator and physical NewBrain but also lots which failed. Have attached two ZIPs with working and failed examples and tried to concentrate testing on the tapes you provide with the emulator. Amazingly The Crossing which I don’t have access to a tape version other than your emulator worked first time but NewBrain Chess failed. The tool generates a wave file over 24 minutes long for Chess which cannot be right. Throws up Error 130 roughly one minute in on a physical NewBrain. The correct length should be roughly 2mins 50 and I have attached working WAV I recorded for comparison. Similar error with other tapes from emulator. Hopefully if you get Chess working, rest will work also. Happy to test again if you have a look and update. Another improvement to the emulator would be to support exporting listings as ASCII as I see you supoprt import but cannot see the equivalent export function. In the mean time I will continue to create WAV backups manually and will share in the future if you can host on your site.

                    Attachments:
                  • #3831
                    Enzo Ciaffarafa
                    Participant
                    • Topics: 0
                    • Replies: 3
                    • Total posts: 3
                      Up
                      0
                      Down
                      ::

                      Uploades Failed ZIP again without working analogue CHESS WAV file as too big to upload.

                      Attachments:
                    • #3833
                      CDesp
                      Keymaster
                      Topic Author
                      • Topics: 15
                      • Replies: 24
                      • Total posts: 39
                        Up
                        0
                        Down
                        ::

                        Hi.

                        You can export text through printer.

                        Open#8,8

                        List#8

                        The output will go to the file printernew.txt

                      • #3845
                        CDesp
                        Keymaster
                        Topic Author
                        • Topics: 15
                        • Replies: 24
                        • Total posts: 39
                          Up
                          0
                          Down
                          ::

                          Ok there is a new version that fixes all problems (i think).

                          Please try and let me know.

                          Redownload from the files section

                      Viewing 8 reply threads
                      • You must be logged in to reply to this topic.