Add ascii file to .tap

Struggling with Fuse or trying to find an emulator with a specific feature. Ask your questions here.
Post Reply
mariano_dm
Drutt
Posts: 14
Joined: Fri Sep 02, 2022 11:28 pm

Add ascii file to .tap

Post by mariano_dm »

This might be a dumb question.

I haven't found any suitable utility to add a file to a tape or dsk from command line. bas2tap and bin2tap only work with executables and tokenized basic.

I was able to do it via tapcat (after a pain to make it work). and I can see the new file in the new tape, but now load just keeps looping (it is a logo program, so no tokenizing should be required)

thanks for your help
User avatar
+3code
Manic Miner
Posts: 451
Joined: Sat Mar 19, 2022 7:40 am

Re: Add ascii file to .tap

Post by +3code »

User avatar
patters
Manic Miner
Posts: 472
Joined: Thu Apr 11, 2019 1:06 am

Re: Add ascii file to .tap

Post by patters »

z88dk-appmake, from https://github.com/z88dk/z88dk/releases?

I have used it to insert a loading screen into a TAP file - e.g.:
https://github.com/patters-syno/artille ... ake_tap.sh
User avatar
Luzie
Manic Miner
Posts: 913
Joined: Fri May 01, 2020 2:07 pm

Re: Add ascii file to .tap

Post by Luzie »

mariano_dm wrote: Sat Sep 17, 2022 7:16 pm I haven't found any suitable utility to add a file to a tape or dsk from command line. bas2tap and bin2tap only work with executables and tokenized basic.
What kind of file do you want to add? Binary Data or as your questions suggest, plain ASCII-Characters?

Two TAP-Files can be simply put together with using e.g. CMD-Command:

Code: Select all

COPY /b TAP1.tap+TAP2.tap TAP1and2.TAP
mariano_dm
Drutt
Posts: 14
Joined: Fri Sep 02, 2022 11:28 pm

Re: Add ascii file to .tap

Post by mariano_dm »

just a plain ascii file
trying to autorun a logo proogram
User avatar
flatduckrecords
Manic Miner
Posts: 808
Joined: Thu May 07, 2020 11:47 am
Location: Oban, Scotland
Contact:

Re: Add ascii file to .tap

Post by flatduckrecords »

Hi @mariano_dm,

This works for me:

Code: Select all

bin2tap.exe -append -a 49722 -o logo.tap SQRSTR\ LOG.txt
The contents of SQRSTR:

Code: Select all

TO SQUARESTAR
REPEAT 8 [SQUARE RT 45]
END
Just had a quick look at Sinclair Logo—is that what you're using? It needs to have the filenames 10 characters long, ending with "LOG" and padded with spaces in between if necessarty. It's also case-sensitive. The bytes header needs to specify location 49722 (0xC23A). If any of those is not quite right the loader routine will just keep looking (emulated tapes will loop around).

Line breaks in the text file need to be encoded as 0x0D (not 0x0A) or the interpreter will get confused.

Hope that helps!


User avatar
Luzie
Manic Miner
Posts: 913
Joined: Fri May 01, 2020 2:07 pm

Re: Add ascii file to .tap

Post by Luzie »

mariano_dm wrote: Wed Sep 21, 2022 10:17 pm just a plain ascii file
trying to autorun a logo proogram
So it should be loaded via

Code: Select all

LOAD ""CODE
or

Code: Select all

LOAD ""
?
User avatar
+3code
Manic Miner
Posts: 451
Joined: Sat Mar 19, 2022 7:40 am

Re: Add ascii file to .tap

Post by +3code »

Luzie wrote: Thu Sep 22, 2022 7:47 pm So it should be loaded via

Code: Select all

LOAD ""CODE
or

Code: Select all

LOAD ""
?
The first, I assume, as it is a LOGO source code, not BASIC.
User avatar
+3code
Manic Miner
Posts: 451
Joined: Sat Mar 19, 2022 7:40 am

Re: Add ascii file to .tap

Post by +3code »

mariano_dm wrote: Wed Sep 21, 2022 10:17 pm trying to autorun a logo proogram
Time ago I was with the same idea. The only solution I found was to make an snapshot after all is loaded and ready and then use a utility like SNAPRUN to load and run directly the snapshot.

Edit: you can use too the old transfers like Multiface, etc, to make the runable snapshot.
mariano_dm
Drutt
Posts: 14
Joined: Fri Sep 02, 2022 11:28 pm

Re: Add ascii file to .tap

Post by mariano_dm »

thanks everyone for your replies, I'll give them a try !
mariano_dm
Drutt
Posts: 14
Joined: Fri Sep 02, 2022 11:28 pm

Re: Add ascii file to .tap

Post by mariano_dm »

I finally had some time to try it
found this nice utility to add files to tapes

Code: Select all

tr '\n' '\15' < AUTORUN.LOG > AUTO.LOG
./taput add -n "auto   LOG" AUTO.LOG tape.tap
almost there, just it seems I also have to translate the EOF, it is trying to read a 'W' past the file


Image

Code: Select all

TO SQUARE
REPEAT 4 [FD 30 RT 90]
END

TO SQUARESTAR
REPEAT 8 [SQUARE RT 45]
END

SQUARESTAR

Post Reply