Taptap v2018 : bug fixes, improvements

Questions, bug reports, features requests, ... about the Oric Software Development Kit. Please indicate clearly in the title the related element (OSDK for generic questions, PictConv, FilePack, XA, Euphoric, etc...) to make it easy to locate messages.

User avatar
waskol
Flight Lieutenant
Posts: 414
Joined: Wed Jun 13, 2007 8:20 pm
Location: FRANCE, Paris

Taptap v2018 : bug fixes, improvements

Post by waskol »

Hi,
Working with OSDK, I noticed that taptap was buggy. I need it to work for an oric project I am working on.

I had lost the source (a hdd accident), but I found them back on the forum : the listing that I provided was, hum...
Well, I was very tired or completly drunk, I don't know.

I then rewrote it from scratch and added a few functions.
Even if I intensively tested it, it can remains some bugs, so, do not hesitate to give me your feedback.

Some syntax have changed, in order to make the commands closer to a natural language and easier to remember.

This is the main help :
Syntax :
========
taptap [<command> [<parameter1> <parameter1> <parameter1> <parameter1>]]
Syntax of commands is case insensitive.
Please, separate parameters with spaces or tabs. Use double quotation
marks to wrap multiple words as one parameter (such as long file names
containing spaces).

List of commands :
------------------
help [<command>] : Without the <command> parameter, displays this help screen.
With the <command> parameter, displays extended help
on the specified command.
example : taptap help cat

cat ............ : Displays the catalog of tape.
ren ............ : Renames an Oric file in a .tap File.
copy............ : Copies one or all files from a .tap file to some separate .tap file(s).4
extract......... : Extracts one or all files from a .tap file to some separate .tap file(s).4
del............. : Deletes a file from a .tap file.
split........... : Splits .tap file into separate files.
join............ : Merge several .tap Files into one .tap file.
AutoOn ......... : Sets Auto run On
AutoOff ........ : Sets Auto run Off
Joined are the exe, and the sources.
The sources can be compiled with Delphi community (wich is freely available at no cost for open source projects or small business (this is not an advertisement !)

GitHub Repository (sources for Linux/Windows and binaries for Windows
Last edited by waskol on Sat Sep 22, 2018 12:40 pm, edited 2 times in total.
User avatar
iss
Wing Commander
Posts: 1637
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Taptap v2018 : bug fixes, improvements

Post by iss »

Cool and very useful tool, thanks!
I tried to compile it for Linux with Lazarus but build failed. After some hacking it seams promising (need to find replacement for TDirectory, TPath ...). But I wonder if it will be better to rewrite it again :mrgreen: in C for portability and add the sources to OSDK tree (if Dbug don't mind of course)?

Else, for TAP split I use the attached LUA script and to join TAP's simple "copy /b a.tap + b.tap result.tap" for Windows and "cat a.tap b.tap > result.tap" for Linux which produce working multi-taps for Oricutron.

Congrats and keep your Oric enthusiasm high ;).
Attachments
tapsplit.lua.zip
(1.06 KiB) Downloaded 398 times
User avatar
waskol
Flight Lieutenant
Posts: 414
Joined: Wed Jun 13, 2007 8:20 pm
Location: FRANCE, Paris

Re: Taptap v2018 : bug fixes, improvements

Post by waskol »

Hello iss,

I can try to convert my files in order to be Lazarus compatible :)

Of course it could be a good Idea to convert this to lua (or even yabasic, whose basic dialect is familiar to a lot of Oric enthousiasts, and wich runs on Linux too).

I already thought about lua in fact, because I would like to write a real Visual IDE for the Oric.
The Visual interface should be able to run scripts for it's different operations (build, tools,...) easy to modify by anybody that do not wan't to bother with gcc, mingw, etc...
lua is definetly a good candidate since it can be easyly embedded.

Why pascal ? because Lazarus or codetyphon can compile to a lot of platforms (like c), but the code is more structured and clean. More other, we can use the Synedit components in order to have some real code editors.

Anyway, stay stuned.
User avatar
waskol
Flight Lieutenant
Posts: 414
Joined: Wed Jun 13, 2007 8:20 pm
Location: FRANCE, Paris

Re: Taptap v2018 : bug fixes, improvements

Post by waskol »

OK, while working on a lazarus version, I found a bug (taptap was not checking the parameters as it should for the ren command, I provide the correction in the first post, and also a Lazarus version of the code.

I don't know how I will compile it for Linux since there is a windows specific call in the main module (GetCommandLine) needeed to parse the specific taptap command line syntax.

Any way, updated in the first post within 5 minutes.
User avatar
iss
Wing Commander
Posts: 1637
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Taptap v2018 : bug fixes, improvements

Post by iss »

Great! I like it.
Here is one quick solution for GetCiommandLine:

Code: Select all

function GetCommandLine : pchar;
{$ifdef win32}
     stdcall;external KernelDLL name 'GetCommandLineA';
{$else}
     var
       I: Integer;
       S: String;
     begin
       S := '';
       for I := 1 to ParamCount do S := S + ParamStr(I);
       GetCommandLine := ^S;
     end;
{$endif}
This compiles OK for me :) but the result is always:
Impossible :
XXXXX.tap is an empty file.
I'll check what's going on...
User avatar
waskol
Flight Lieutenant
Posts: 414
Joined: Wed Jun 13, 2007 8:20 pm
Location: FRANCE, Paris

Re: Taptap v2018 : bug fixes, improvements

Post by waskol »

No, it is not a good solution since Paramstr method strips ALL the double-quotes !!!

- for this, you have to addapt :

CL.Count is equivalent to Paramcount+1 (checkparams_ren in 'taptap.lpr')

And in CLNametoBytes (Unitutils.pas), you have to...
insert : s1.QuotedChar:='''';
before : s1.Delimiter:='+';
...in order to use single quotes in order to be able to use ren.
User avatar
waskol
Flight Lieutenant
Posts: 414
Joined: Wed Jun 13, 2007 8:20 pm
Location: FRANCE, Paris

Re: Taptap v2018 : bug fixes, improvements

Post by waskol »

OKay !!!

The only thing to replace GetCommandLine in Lazarus is cmdLine, simply !
This not documented nor in Lazarus wiki, nor by Free Pascal.

Now you sould be able to compile for Linux !
User avatar
waskol
Flight Lieutenant
Posts: 414
Joined: Wed Jun 13, 2007 8:20 pm
Location: FRANCE, Paris

Re: Taptap v2018 : bug fixes, improvements

Post by waskol »

Hello iss and Linux users.

We have something compiling and "working" here (I did not test everything, mainly all the possibles of the ren command).

Anyway, here is the exe (x86_64) and the sources for Lazarus Linux. Just give a try and tell me if it works for you.

taptap_lazarus2 .tar.gz

In order to work with tap from a terminal, you have to :
- set the permissions of taptap in to allow execution as a program.
- launch it from command line like this :

Code: Select all

./taptap cat tyrann.tap
User avatar
iss
Wing Commander
Posts: 1637
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Taptap v2018 : bug fixes, improvements

Post by iss »

Well done! :)
Compiled from sources without problems and it works!

Code: Select all

$ ./taptap cat $HOME/tapes/Aigle.tap 
Catalog of "Aigle.tap"
Index.... : 0
Name............ : AIGLEDOR.1
File kind....... : BASIC
Auto............ : Yes
byte 9.......... : #00
Starting Address : #0501
Ending   Address : #3F37
Size of data.... : 14903 bytes
File quality : good.

Index.... : 1
Name............ : AIGLEDOR.2
File kind....... : BASIC
Auto............ : Yes
byte 9.......... : #00
Starting Address : #0501
Ending   Address : #9FFF
Size of data.... : 39679 bytes
File quality : good.
I'll check with my TAP-files pile and will give feedback. Thanks!

EDIT: I've checked with the longest TAP-file that I know which contains 3375 ites ... and it works!
User avatar
waskol
Flight Lieutenant
Posts: 414
Joined: Wed Jun 13, 2007 8:20 pm
Location: FRANCE, Paris

Re: Taptap v2018 : bug fixes, improvements

Post by waskol »

Hourra ! :D

What I didn't know in order to make it work in Linux : add the cthread library
And also, I was obliged to changed my generic TList into dynamic arrays (I don't like that). And doing this, I have forbidden to pass TCatalog as a reference since it is now an array to GetCatalogue (UnitUtils), what was not a problem with a TList class since it is already a pointer.

I have to precise that taptap is working also with arrays saved by the BASIC STORE (STORE/RECALL) command.

But it seems that the output tap format is bugged when it is done from either Euphoric or Oricutron (Or may be it is a bug of the real Oric).
See my post here :
viewtopic.php?f=22&t=1001&start=120

Also, for help on different commands that taptap knows just type :

Code: Select all

./taptap
or

Code: Select all

./taptap help
User avatar
waskol
Flight Lieutenant
Posts: 414
Joined: Wed Jun 13, 2007 8:20 pm
Location: FRANCE, Paris

Re: Taptap v2018 : bug fixes, improvements

Post by waskol »

Taptap has a repository github, here (and got a bug fix for AutoOn/AutoOff and del commands) :
https://github.com/DJChloe/taptap
Post Reply