Difference between revisions of "WormsShell"

From Worms Knowledge Base

Jump to: navigation, search
(Unfinished or unimplemented features)
Line 118: Line 118:
 
* Allow skipping of language/sample set selection.
 
* Allow skipping of language/sample set selection.
  
* Fix the many remaining bugs in Worms and WormsShell which I haven't found
+
* Fix the many remaining bugs in Worms and WormsShell which I haven't found yet.
yet.
+
  
 
* Show a landscape list when you right-click during landscape generation (this feature would go on to be incorporated into the retail versions of [[Worms 2]], [[Worms Armageddon]] and [[Worms World Party]]).
 
* Show a landscape list when you right-click during landscape generation (this feature would go on to be incorporated into the retail versions of [[Worms 2]], [[Worms Armageddon]] and [[Worms World Party]]).
Line 131: Line 130:
 
* Allow running of CD version with only WormsShell installed on HD.
 
* Allow running of CD version with only WormsShell installed on HD.
  
* Translate the installer into other languages.
+
* Translate the installer, and possibly even Worms itself, into other languages.

Revision as of 14:16, 6 June 2007

(Up to Worms)
Wormshellicon.gif  WormShell
Developer: Ben Hutchings
Supported games: Worms (Amiga version only)
Language: C++ (presumably - am trying to confirm)
Licence: Freeware
Website: None

WormsShell is a combined patch and installer for the Amiga and CD32 versions of Worms. The initial version was released on 6th November, 1996 and the last version released on 25th November, 1996.

Note: Most of this information has been taken directly from the WormShell.guide that accompanies the patch, written by Ben Hutchings. As I lack the technical knowledge to really be able to re-interpret this, I'm hoping someone with programming knowledge can come in and do that.

Background

Worms has been phenonemally popular in all formats it has been released on, but unfortunately it seems that the original Amiga version is the most buggy. This is partly because it was compiled using Blitz Basic. Blitz Basic produces the slowest, most ridiculously bloated code I have ever seen in my life. Also, it does not support playing samples from Fast memory, which would of course make a lot of difference to Worms, which loads up to about 750K of samples. The main executable also seems to be missing a vital trap handler which would allow Worms to exit safely if it runs out of memory. Lastly, the CD features cannot be used without a CD³² pad.

WormsShell aims to fix the above bugs and deficiencies. However, at the moment, I have yet to add any speedups or Fast-memory-playing since these may be quite complex. In addition, WormsShell provides a number of useful options, which make it easier to use some of the special features of Worms.

Worms: The Directors Cut appears to address most if not all of the deficiencies which WormsShell deals with. There were several bugs in the demo I saw on CUCD 5, but I've been in contact with Andy Davidson and it looks like these have been dealt with. Blitz Basic's libraries have apparently been updated to eliminate some of the bugs I found in them. It looks like Worms: TDC will be duplicated some time this week (25-29 November) so it can be released just in time for Christmas.

Bugs fixed

Problems with CD-ROM drives

The executable files used for the CD and floppy versions of Worms are the same. If Worms can open "cd.device" when it starts, it assumes that it is running on a CD³² and accepts input only from a CD³² joypad and not from the keyboard. This means that if you have a CD-ROM drive, Worms will appear to have entered Helen Keller mode when you reach the code entry screen and can't type anything!

If you have a CD-ROM drive, you can now use the audio CD functions of Worms without the need for a CD³² controller.

Incompatibility with MUFS

Every call Worms makes to the DOS function Lock(), apart from those in the Blitz library functions, specifies the lock type as 0 instead of SHARED_LOCK, which it should be. The standard Amiga file system doesn't mind this but, for security, MultiUserFileSystem does. This means that the Lock() call fails and Worms thinks files are not there. WormsShell fixes these calls to use SHARED_LOCK.

Enforcer hits and crashes

I checked out Worms with the excellent "Enforcer" tool written by Michael Sinz. I found several places in the Worms code where it can read or write invalid memory addresses, sometimes causing crashes:

  • When Worms starts, it writes "WORM" to address 0. This is just plain wrong. Actually, this isn't just a bug but deliberate bad behaviour. WormsShell

removes this code.

  • Sometimes when a memory allocation fails, Blitz's memory list seems to get confused and it can try to use a null pointer when freeing memory. WormsShell fixes the code used to traverse the list.
  • Two Blitz functions which Worms uses for timing are bugged: they attempt to pack the three bytes of a CIA clock together in a memory buffer, but instead they use the contents of the buffer (which will always be 0) as the buffer address. WormsShell fixes the functions to use the buffer correctly. Note that these functions are illegal anyway as they read and write the CIAA TOD clock, which is always reserved for the use of the operating systems.

Asks you to insert disks

Instead of following the correct procedure when started from Workbench, which is to find out where it has been run from using its startup message, Worms attempts to copy the current directory of the Workbench. If it is lucky, this will work, but if you do anything with the Workbench while Worms is decrunching it won't. This could often make Worms ask you to insert disk 1 even though it was installed on a hard drive. WormsShell makes Worms use the correct directory.

Crashes if libraries missing

Worms makes many calls to the OpenLibrary() and OldOpenLibrary() OS functions so that it can use various OS functions. In many cases it does not check whether the call succeeded. If the call fails, Worms will crash when it tries to use the library. This is a particular problem with diskfont.library and mathtrans.library, which are stored on disk.

WormsShell should make Worms exit cleanly if it can't open a library - not all OpenLibrary/OldOpenLibrary calls are fixed, but those which open the disk-based libraries are.

Problems with 68010 CPU

Blitz appears to check the vector-base register only on a 68020 or better; this could potentially prevent Worms from working if you have a 68010 CPU. WormsShell makes it read the VBR on 68010s too. This fix has not been tested since I don't have a 68010 - I just noticed this problem while trying to understand the disassembled code.

Software failure 8000 0020

If Worms encounters a fatal error, e.g. it runs out of memory, then it will issue the instruction TRAP #0, which should call an "trap handler" to deal with the problem. However, Worms does not set up such a trap handler, so instead the standard OS trap handler is invoked - which just tells you "Software Failure, Error: 8000 0020". WormsShell installs a trap handler which causes Worms to jump to its exit code if a fatal error occurs. This doesn't seem to work perfectly at the moment though; Worms still crashes the machine sometimes. Also, not all memory gets freed always.

Doesn't work on NTSC Amigas

If you run Worms on an NTSC Amiga, part of Worms's screen will be cut off. This can also happen if you have a PAL Amiga but use an NTSC screenmode for your Workbench screen. But if you have the ECS Agnus or the AGA chipset (and virtually all Amigas have one or the other) and a suitable monitor or TV, then you can use PAL screenmodes anyway.

Use the tooltype FORCEPAL=YES to force the display to PAL frequencies before Worms runs and to patch the OS so that your Amiga looks like a real PAL machine. The OS settings will be restored when Worms is finished. (Thanks to Nico François for the source code I based this on.) You may need to use the tooltype CLOSEWB=YES as well to make this work properly; unfortunately this may make it impossible to return to the Workbench after exiting Worms; I'm working on that problem.


Features added

Various options to modify memory usage

There are a number of experimental options to let you control the way Worms uses memory. At some point I hope to be able to make WormsShell set these options automatically, but I need some experimental data and I want you - yes you - to provide it. Please try out different combinations of options and tell me which ones work on your system.

The tooltypes used for the options are:

  • USE2MCHIP - Worms normally sets this if you have 2M Chip RAM installed
  • USEFAST - Worms normally sets this if you have some Fast RAM installed
  • CLOSEWB - Worms normally sets this if and only if it didn't set both of the above

Option to use a CD³² pad (CD32PAD tooltype)

You should be able to use a CD³² joypad with Worms on an A1200 and maybe on an A4000 too. To do this, use the CD32PAD tooltype. Note that this will disable keyboard input to Worms.

Using audio CDs with any distribution of Worms

If you have a "cd.device" driver for your CD-ROM drive, Worms will give you the CD audio features it has on the CD³². Normally this would require you to use a CD³² joypad but WormsShell allows these two things to be used separately. See the Worms manual for information about the CD audio features. Clicking on track numbers cycles through the available tracks; clicking "CHANGE DISC" should eject the disc (I have a top-loading CD-ROM drive so I couldn't test this), wait for you to insert a new disc, and then read the new table of contents.

Start with Sheep Mode on (SHEEPMODE tooltype

Worms has a hidden feature called "Sheep Mode" which you can activate by typing "total wormage" while the title screen is displayed. This gives you lots of sheep, lots of dynamite and one banana bomb at the beginning of each round. If you like to play in this mode all the time, add the tooltype SHEEPMODE to the WormsShell icon and you will no longer have to enter the special code.

Set weapon availability

WormsShell lets you set the availability of almost all weapons freely, without going to the appropriate options screen in Worms every time you start it, and it can even change a few weapons not listed there. Use the following tooltypes:

AIRSTRIKES BANANABOMBS BAZOOKAS BLOWTORCH BUNGEE CLUSTERBOMBS DRAGONBALLS DRILL DYNAMITE FIREPUNCHES GIRDERS GRENADES KAMIKAZE MINES MINIGUN MISSILES NINJAROPE SHEEP SHOTGUN TELEPORT

The value for the tooltype should be OFF to turn the weapon off, 1-9 to allow it to be used that many times, or INFINITE to allow the weapon to be used freely.

Use multiple sample sets (SAMPLEDIRn tooltype)

The Worms manual mentions the possibility of replacing the Worms speech samples. There are several reasonably large sample sets available in the public domain, including "T2: Judgement Day", "Bottom" and "Beavis and Butthead". Normally you would install these by copying the new samples over the samples in the TWENGLISH/FRENCH/GERMAN directory. But this means you can't choose to go back to the old samples without re-installing from the original Worms disks.

WormsShell lets you have up to 3 named sample sets which replace the language options you normally see when starting Worms. To install a new sample set, first create a subdirectory for it in the directory you installed Worms, with a name up to 9 letters long. Then copy the new samples into the new directory. Finally add the tooltype SAMPLEDIRn=mydirname to the WormsShell icon, where n = 1 to replace the English option, 2 to replace French, or 3 to replace German, and mydirname is the name of the directory you created.

Use multiple configurations

If you want to use multiple configurations with WormsShell, just make copies of its icon and change the copy's tooltypes appropriately. You don't need to copy WormsShell itself. Use the command-line argument "SETTINGS" to read the configuration from a different icon.

Unfinished or unimplemented features

Ben Hutchings had intended to revise and improve some of the above bug fixes and features, as well as adding additional features and improved compatibility to the game.

  • Add code to make an intelligent decision when setting the three startup

options.

  • Add Fast-memory sample playing.
  • Speed up important routines. Some calculations are done using very slow floating point maths which could easily be replaced by integer routines over 10× faster.
  • Fix title screen colours when using SHEEPMODE tooltype.
  • Allow skipping of language/sample set selection.
  • Fix the many remaining bugs in Worms and WormsShell which I haven't found yet.
  • Add a friendly installer for extra custom landscapes and sample sets.
  • Provide the option to run worms in a 31 kHz (VGA-compatible) screen-mode.
  • Allow viewing of the FMVs on the CD when starting Worms from HD.
  • Allow running of CD version with only WormsShell installed on HD.
  • Translate the installer, and possibly even Worms itself, into other languages.
Personal tools