English Amiga Board


Go Back   English Amiga Board > Support > New to Emulation or Amiga scene

 
 
Thread Tools
Old 20 August 2023, 20:13   #1
Lektroid
Registered User
 
Lektroid's Avatar
 
Join Date: Aug 2020
Location: UK
Posts: 122
Is there a batch .lha converter?

Hi, I've been using the handful of WHDLoad games which I got on CF card when I bought my A1200, these were already converted (I never knew how to make native .lha games run). I have recently stumbled upon the TOSEC collection which is full of tens of thousands of .lha files. I am wondering if there is a way to batch convert .lha files to be executable files to load directly with WHDLoad?

I'd be happy to do the conversion externally for speed (I have both Mac and PC), or on the Amiga itself (A1200). Or even if someone knows a routine I can enter to batch convert them using the CLI.


If anyone can help, it would be a huge help, and very much appreciated.
Lektroid is offline  
Old 20 August 2023, 23:11   #2
yelworC
Registered User
 
yelworC's Avatar
 
Join Date: Feb 2021
Location: Germany
Posts: 69
LHA files are archive files similar to zip and rar and so on.

7zip on the PC can open them.. so you can select them all in windows explorer window and then select 7zip extract all from context menu and they will be extracted.. after that there should be a ton of folders where every folder contains one game that was inside one lha file

So its not converting files, its simple unarchiving them the same way you do with zip and similar files.

you could do this on the amiga with for example an on the fly generated script file using the "list" format but this would really take ages on a real amiga
yelworC is offline  
Old 21 August 2023, 11:02   #3
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,348
It should be noted however, that using 7Zip, or any unarchiver on a PC or non-Amiga filesystem runs the risk of losing important file properties, such as permission flags, comments and non-standard filenames. More often than not this doesn't cause any problems, but it's worth bearing in mind.

If speed is an issue, mounting the CF card on the PC and using WinUAE to unarchive them might be worth looking at.
Daedalus is offline  
Old 23 August 2023, 13:31   #4
mcbpete
Zone Friend
 
mcbpete's Avatar
 
Join Date: Oct 2004
Location: London, England
Age: 42
Posts: 239
Send a message via MSN to mcbpete Send a message via Yahoo to mcbpete
Quote:
Originally Posted by Daedalus View Post
It should be noted however, that using 7Zip, or any unarchiver on a PC or non-Amiga filesystem runs the risk of losing important file properties, such as permission flags, comments and non-standard filenames.
Definitely this! Had first hand experience and had to redownload a big collection that I'd screwed up by extracting them *outside* and Amiga environment. Found that there were quite a lot of unusually named files in WHDLoad games that immediately cause the Windows/Dos filesystem to have a big moan.

Easiest thing to batch extract them (either on the Amiga itself, or via an WinUAE environment) would be to get a hold of a copy of Directory Opus. You can then just have the source lhas in one pane, the target location for the extracted folders in the other, select all of the archive files and press 'Arc Ext'
mcbpete is offline  
Old 23 August 2023, 15:24   #5
modrobert
old bearded fool
 
modrobert's Avatar
 
Join Date: Jan 2010
Location: Bangkok
Age: 56
Posts: 779
Quote:
Originally Posted by Lektroid View Post
I am wondering if there is a way to batch convert .lha files to be executable files to load directly with WHDLoad?
Does the .lha files include floppy images or something else?

Anyway, in order to convert you need the WHDLoad installer for each game, which can be found here:

http://whdload.de/download.html

When running the WHDLoad installer of the slave on your Amiga you will be asked to insert the original floppy of the game (rawdic), you can skip this and use the "select file" option if you have the game floppy image in .adf format.

There is no way to automate this AFAIK, but there are packs of games ready for WHDLoad which can be found on Turran's ftp server.

Last edited by modrobert; 23 August 2023 at 15:33.
modrobert is offline  
Old 23 August 2023, 15:57   #6
Ian
Global Moderator
 
Ian's Avatar
 
Join Date: May 2001
Location: Derby, UK
Age: 46
Posts: 2,287
TOSEC doesn't have any LHA files.

If WHDLoad is your favoured method for games, then just download retoplays collection from Turrans' Amiga FTP site.

You can probably just highlight all of them and extract them to your SD card as Deadalus said though some permission won't be correct on the files, but it will be a very small percentage of them affected.

If you want to do this from the amiga side, you need to setup dopus and configure some of the buttons to do this, I believe a few people have shared their configs for dopus which you can do this from. It's pretty easy though.

Here's one example here: https://eab.abime.net/showthread.php?t=106935

There's many more though.
Ian is offline  
Old 23 August 2023, 16:16   #7
mrv2k
Registered User
 
Join Date: Apr 2020
Location: England
Age: 53
Posts: 431
You could use the List command in AmigaDOS to make up a batch file. You'd need lha installed in your c: drawer. For example...

Code:
list >test PAT=#?.lha LFORMAT "LHA x %n"
The command would need to be done in each drawer and then you just execute the test script. Here's an example of the output generated.

Code:
LHA x NinjaGaiden2_v0.1_BETA.lha
LHA x NightWalk_v1.0_BETA.lha
LHA x NibblerSuperExtra_v1.0.lha
LHA x Neutralizer2Demo_v0.1_BETA.lha
LHA x Netherworld_v1.5_2033_BETA.lha
This is the simplest way to do it, you can make it as complicated as you want and automate the whole process with basic amigados commands.
mrv2k is offline  
Old 25 August 2023, 02:09   #8
arcam
Registered User
 
Join Date: May 2021
Location: Fay-aux-Loges (France)
Posts: 51
Thumbs up

Quote:
Originally Posted by mrv2k View Post
You could use the List command in AmigaDOS to make up a batch file. You'd need lha installed in your c: drawer. For example...

Code:
list >test PAT=#?.lha LFORMAT "LHA x %n"
The command would need to be done in each drawer and then you just execute the test script. Here's an example of the output generated.

Code:
LHA x NinjaGaiden2_v0.1_BETA.lha
LHA x NightWalk_v1.0_BETA.lha
LHA x NibblerSuperExtra_v1.0.lha
LHA x Neutralizer2Demo_v0.1_BETA.lha
LHA x Netherworld_v1.5_2033_BETA.lha
This is the simplest way to do it, you can make it as complicated as you want and automate the whole process with basic amigados commands.
Cool tips ! Thanks
arcam is offline  
Old 25 August 2023, 05:16   #9
Channel-Z
Registered User
 
Channel-Z's Avatar
 
Join Date: Jan 2022
Location: Australia
Posts: 78
If you want to extract lha files in batches on PC without any file/drawer name issues like when using 7zip etc. Someone on here recommended Extractnow. I have been using it for a while now no issues, nice light program and has some nice features. get it here https://extractnow.com/#/home
Channel-Z is offline  
Old 26 August 2023, 00:34   #10
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,338
Quote:
Originally Posted by mrv2k View Post
You could use the List command in AmigaDOS to make up a batch file. You'd need lha installed in your c: drawer. For example...
This is already accomplished by SPat, which is already in your path.
idrougge is offline  
Old 25 February 2024, 21:51   #11
Yesideez
(2b)||!(2b)
 
Yesideez's Avatar
 
Join Date: Mar 2007
Location: Cranbrook, Devon, UK
Age: 50
Posts: 241
Quote:
Originally Posted by mrv2k View Post
You could use the List command in AmigaDOS to make up a batch file. You'd need lha installed in your c: drawer. For example...

Code:
list >test PAT=#?.lha LFORMAT "LHA x %n"
The command would need to be done in each drawer and then you just execute the test script. Here's an example of the output generated.
The only extra step I add in this is sorting the contents of the generated script:
Code:
1.SYS:> list >ram:tr #?.lha lformat "lha x *"%n*""
1.SYS:> sort ram:tr to ram:tr
1.SYS:> execute ram:tr
That way if for some reason one of the files fails, it terminates the script and you know straight away how far it got without loading the file ram:tr into something like Ed and hunting for it. I've also added quotes around the archive name just in case as with *" around %n if a space is present, it'll stop. None of the WHDL files have spaces that I've found so far but - I like to err on the side of caution.
Yesideez is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to extract batch of .lha archives into folders Foebane support.Apps 78 14 September 2018 16:53
New batch of AmyITX Chucky support.Hardware 13 13 June 2018 17:52
next batch of games? boing_1000 project.SPS (was CAPS) 19 02 August 2008 23:45
Best way of Batch Un-archiving... Peter support.Apps 16 27 November 2006 14:49
Req: Batch 2... rob72 request.Old Rare Games 4 24 January 2004 23:58

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 16:43.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.08168 seconds with 15 queries